profile
viewpoint
Elliotte Rusty Harold elharo New York http://www.elharo.com/blog/ Elliotte Rusty Harold lives in a secret mountaintop laboratory on a large island off the East Coast of the United States. He's an active member of SFWA and BSFW

elharo/fabric8-spring 1

A project to help folks use Spring Boot with Kubernetes or OpenShift

elharo/aether-demo-maven-plugin 0

A simple Maven plugin demonstrating the use of Aether.

elharo/appengine-maven-archetypes-java 0

App Engine Maven Archetypes

elharo/appengine-php-wordpress-starter-project 0

Starter project for running WordPress on Google Cloud Platform

elharo/auto 0

A collection of source code generators for Java.

elharo/avro 0

Apache Avro

elharo/bazel 0

a fast, scalable, multi-language and extensible build system

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2019 Google LLC.

2020

suztomo

comment created time in 3 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import com.google.cloud.tools.opensource.dependencies.DependencyPath;+import java.io.IOException;+import org.eclipse.aether.artifact.Artifact;++/** Annotates {@link LinkageProblem}s with {@link LinkageProblemCause}s. */+public class LinkageProblemCauseAnnotator {++  /**+   * Annotates the cause field of {@link LinkageProblem}s with the {@link LinkageProblemCause}.+   *+   * @param rootResult the class path used for generating the linkage problems.+   * @param linkageProblems linkage problems to annotate+   * @throws IOException when there is a problem reading JAR files.+   */+  static void annotate(ClassPathResult rootResult, Iterable<LinkageProblem> linkageProblems)+      throws IOException {++    for (LinkageProblem linkageProblem : linkageProblems) {+      ClassFile sourceClass = linkageProblem.getSourceClass();+      ClassPathEntry sourceEntry = sourceClass.getClassPathEntry();++      Artifact sourceArtifact = sourceEntry.getArtifact();++      // Resolves the dependency graph with the source artifact at the root.+      ClassPathBuilder classPathBuilder = new ClassPathBuilder();+      ClassPathResult subtreeResult = classPathBuilder.resolveWithMaven(sourceArtifact);++      ClassPathEntry entryInSubtree =+          findClassPathEntryForSymbol(subtreeResult, linkageProblem.getSymbol());+      if (entryInSubtree == null) {+        linkageProblem.setCause(UnknownCause.getInstance());+      } else {+        Artifact artifactInSubtree = entryInSubtree.getArtifact();+        DependencyPath pathToSourceEntry = rootResult.getDependencyPaths(sourceEntry).get(0);+        DependencyPath pathFromSourceEntryToUnselectedEntry =+            subtreeResult.getDependencyPaths(entryInSubtree).get(0);+        DependencyPath pathToUnselectedEntry =+            pathToSourceEntry.concat(pathFromSourceEntryToUnselectedEntry);++        ClassPathEntry selectedEntry =+            findEntryByArtifactId(+                rootResult, artifactInSubtree.getGroupId(), artifactInSubtree.getArtifactId());+        if (selectedEntry != null) {+          Artifact selectedArtifact = selectedEntry.getArtifact();+          if (!selectedArtifact.getVersion().equals(artifactInSubtree.getVersion())) {+            // Different version of that artifact is selected in rootResult+            linkageProblem.setCause(+                new DependencyConflict(+                    rootResult.getDependencyPaths(selectedEntry).get(0), pathToUnselectedEntry));+          } else {+            // A linkage error was already there when sourceArtifact was built.+            linkageProblem.setCause(UnknownCause.getInstance());+          }+        } else {+          // No artifact that matches groupId and artifactId in rootResult.+          linkageProblem.setCause(new MissingDependency(pathToUnselectedEntry));+        }+      }+    }+  }++  /**+   * Returns the class path entry in {@code classPathResult} for the artifact that matches {@code+   * groupId} and {@code artifactId}. {@code Null} if no matching artifact is found.+   */+  private static ClassPathEntry findEntryByArtifactId(+      ClassPathResult classPathResult, String groupId, String artifactId) {+    for (ClassPathEntry entry : classPathResult.getClassPath()) {+      Artifact artifact = entry.getArtifact();+      if (artifact.getGroupId().equals(groupId) && artifact.getArtifactId().equals(artifactId)) {+        return entry;+      }+    }+    return null;+  }++  /**+   * Returns the {@link ClassPathEntry} in {@code classPathResult} that contains the class of {@code+   * symbol}. {@code Null} if no matching entry is found.+   */+  private static ClassPathEntry findClassPathEntryForSymbol(+      ClassPathResult classPathResult, Symbol symbol) throws IOException {+    String className = symbol.getClassBinaryName();+    for (ClassPathEntry entry : classPathResult.getClassPath()) {+      if (entry.getFileNames().contains(className)) {+        return entry;+      }+    }+    return null;+  }++  /**+   * Returns the dependency path of the first {@link ClassPathEntry} in {@code classPathResult} that+   * contains the class of {@code symbol}. Null if no such entry is found.+   */+  private static DependencyPath findDependencyPathForSymbol(

Another instance method for ClasspathResult. I suspect what you have here is three overloaded findEntry methods with different argument types.

suztomo

comment created time in 3 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import com.google.cloud.tools.opensource.dependencies.DependencyPath;+import java.io.IOException;+import org.eclipse.aether.artifact.Artifact;++/** Annotates {@link LinkageProblem}s with {@link LinkageProblemCause}s. */+public class LinkageProblemCauseAnnotator {++  /**+   * Annotates the cause field of {@link LinkageProblem}s with the {@link LinkageProblemCause}.+   *+   * @param rootResult the class path used for generating the linkage problems.+   * @param linkageProblems linkage problems to annotate+   * @throws IOException when there is a problem reading JAR files.+   */+  static void annotate(ClassPathResult rootResult, Iterable<LinkageProblem> linkageProblems)+      throws IOException {++    for (LinkageProblem linkageProblem : linkageProblems) {+      ClassFile sourceClass = linkageProblem.getSourceClass();+      ClassPathEntry sourceEntry = sourceClass.getClassPathEntry();++      Artifact sourceArtifact = sourceEntry.getArtifact();++      // Resolves the dependency graph with the source artifact at the root.+      ClassPathBuilder classPathBuilder = new ClassPathBuilder();+      ClassPathResult subtreeResult = classPathBuilder.resolveWithMaven(sourceArtifact);++      ClassPathEntry entryInSubtree =+          findClassPathEntryForSymbol(subtreeResult, linkageProblem.getSymbol());+      if (entryInSubtree == null) {+        linkageProblem.setCause(UnknownCause.getInstance());+      } else {+        Artifact artifactInSubtree = entryInSubtree.getArtifact();+        DependencyPath pathToSourceEntry = rootResult.getDependencyPaths(sourceEntry).get(0);+        DependencyPath pathFromSourceEntryToUnselectedEntry =+            subtreeResult.getDependencyPaths(entryInSubtree).get(0);+        DependencyPath pathToUnselectedEntry =+            pathToSourceEntry.concat(pathFromSourceEntryToUnselectedEntry);++        ClassPathEntry selectedEntry =+            findEntryByArtifactId(+                rootResult, artifactInSubtree.getGroupId(), artifactInSubtree.getArtifactId());+        if (selectedEntry != null) {+          Artifact selectedArtifact = selectedEntry.getArtifact();+          if (!selectedArtifact.getVersion().equals(artifactInSubtree.getVersion())) {+            // Different version of that artifact is selected in rootResult+            linkageProblem.setCause(+                new DependencyConflict(+                    rootResult.getDependencyPaths(selectedEntry).get(0), pathToUnselectedEntry));+          } else {+            // A linkage error was already there when sourceArtifact was built.+            linkageProblem.setCause(UnknownCause.getInstance());+          }+        } else {+          // No artifact that matches groupId and artifactId in rootResult.+          linkageProblem.setCause(new MissingDependency(pathToUnselectedEntry));+        }+      }+    }+  }++  /**+   * Returns the class path entry in {@code classPathResult} for the artifact that matches {@code+   * groupId} and {@code artifactId}. {@code Null} if no matching artifact is found.+   */+  private static ClassPathEntry findEntryByArtifactId(

This works better as an instance method in ClassPathResult than a static method elsewhere.

suztomo

comment created time in 3 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import com.google.cloud.tools.opensource.dependencies.DependencyPath;+import java.io.IOException;+import org.eclipse.aether.artifact.Artifact;++/** Annotates {@link LinkageProblem}s with {@link LinkageProblemCause}s. */+public class LinkageProblemCauseAnnotator {++  /**+   * Annotates the cause field of {@link LinkageProblem}s with the {@link LinkageProblemCause}.+   *+   * @param rootResult the class path used for generating the linkage problems.+   * @param linkageProblems linkage problems to annotate+   * @throws IOException when there is a problem reading JAR files.+   */+  static void annotate(ClassPathResult rootResult, Iterable<LinkageProblem> linkageProblems)+      throws IOException {++    for (LinkageProblem linkageProblem : linkageProblems) {+      ClassFile sourceClass = linkageProblem.getSourceClass();+      ClassPathEntry sourceEntry = sourceClass.getClassPathEntry();++      Artifact sourceArtifact = sourceEntry.getArtifact();++      // Resolves the dependency graph with the source artifact at the root.+      ClassPathBuilder classPathBuilder = new ClassPathBuilder();+      ClassPathResult subtreeResult = classPathBuilder.resolveWithMaven(sourceArtifact);++      ClassPathEntry entryInSubtree =+          findClassPathEntryForSymbol(subtreeResult, linkageProblem.getSymbol());+      if (entryInSubtree == null) {+        linkageProblem.setCause(UnknownCause.getInstance());+      } else {+        Artifact artifactInSubtree = entryInSubtree.getArtifact();+        DependencyPath pathToSourceEntry = rootResult.getDependencyPaths(sourceEntry).get(0);+        DependencyPath pathFromSourceEntryToUnselectedEntry =+            subtreeResult.getDependencyPaths(entryInSubtree).get(0);+        DependencyPath pathToUnselectedEntry =+            pathToSourceEntry.concat(pathFromSourceEntryToUnselectedEntry);++        ClassPathEntry selectedEntry =+            findEntryByArtifactId(+                rootResult, artifactInSubtree.getGroupId(), artifactInSubtree.getArtifactId());+        if (selectedEntry != null) {+          Artifact selectedArtifact = selectedEntry.getArtifact();+          if (!selectedArtifact.getVersion().equals(artifactInSubtree.getVersion())) {+            // Different version of that artifact is selected in rootResult+            linkageProblem.setCause(+                new DependencyConflict(+                    rootResult.getDependencyPaths(selectedEntry).get(0), pathToUnselectedEntry));+          } else {+            // A linkage error was already there when sourceArtifact was built.+            linkageProblem.setCause(UnknownCause.getInstance());+          }+        } else {+          // No artifact that matches groupId and artifactId in rootResult.+          linkageProblem.setCause(new MissingDependency(pathToUnselectedEntry));+        }+      }+    }+  }++  /**+   * Returns the class path entry in {@code classPathResult} for the artifact that matches {@code+   * groupId} and {@code artifactId}. {@code Null} if no matching artifact is found.+   */+  private static ClassPathEntry findEntryByArtifactId(

findEntryById since it's not just the artifact ID

suztomo

comment created time in 3 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import com.google.cloud.tools.opensource.dependencies.DependencyPath;+import java.io.IOException;+import org.eclipse.aether.artifact.Artifact;++/** Annotates {@link LinkageProblem}s with {@link LinkageProblemCause}s. */+public class LinkageProblemCauseAnnotator {++  /**+   * Annotates the cause field of {@link LinkageProblem}s with the {@link LinkageProblemCause}.+   *+   * @param rootResult the class path used for generating the linkage problems.+   * @param linkageProblems linkage problems to annotate+   * @throws IOException when there is a problem reading JAR files.+   */+  static void annotate(ClassPathResult rootResult, Iterable<LinkageProblem> linkageProblems)+      throws IOException {++    for (LinkageProblem linkageProblem : linkageProblems) {+      ClassFile sourceClass = linkageProblem.getSourceClass();+      ClassPathEntry sourceEntry = sourceClass.getClassPathEntry();++      Artifact sourceArtifact = sourceEntry.getArtifact();++      // Resolves the dependency graph with the source artifact at the root.+      ClassPathBuilder classPathBuilder = new ClassPathBuilder();+      ClassPathResult subtreeResult = classPathBuilder.resolveWithMaven(sourceArtifact);

I'm a little worried this might blow up in memory or CPU or both. Have you tested this with the Beam projects that cause us problems?

suztomo

comment created time in 3 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import com.google.cloud.tools.opensource.dependencies.DependencyPath;+import java.io.IOException;+import org.eclipse.aether.artifact.Artifact;++/** Annotates {@link LinkageProblem}s with {@link LinkageProblemCause}s. */+public class LinkageProblemCauseAnnotator {++  /**+   * Annotates the cause field of {@link LinkageProblem}s with the {@link LinkageProblemCause}.+   *+   * @param rootResult the class path used for generating the linkage problems.+   * @param linkageProblems linkage problems to annotate+   * @throws IOException when there is a problem reading JAR files.+   */+  static void annotate(ClassPathResult rootResult, Iterable<LinkageProblem> linkageProblems)+      throws IOException {++    for (LinkageProblem linkageProblem : linkageProblems) {+      ClassFile sourceClass = linkageProblem.getSourceClass();+      ClassPathEntry sourceEntry = sourceClass.getClassPathEntry();++      Artifact sourceArtifact = sourceEntry.getArtifact();++      // Resolves the dependency graph with the source artifact at the root.+      ClassPathBuilder classPathBuilder = new ClassPathBuilder();+      ClassPathResult subtreeResult = classPathBuilder.resolveWithMaven(sourceArtifact);++      ClassPathEntry entryInSubtree =+          findClassPathEntryForSymbol(subtreeResult, linkageProblem.getSymbol());+      if (entryInSubtree == null) {+        linkageProblem.setCause(UnknownCause.getInstance());+      } else {+        Artifact artifactInSubtree = entryInSubtree.getArtifact();+        DependencyPath pathToSourceEntry = rootResult.getDependencyPaths(sourceEntry).get(0);+        DependencyPath pathFromSourceEntryToUnselectedEntry =+            subtreeResult.getDependencyPaths(entryInSubtree).get(0);+        DependencyPath pathToUnselectedEntry =+            pathToSourceEntry.concat(pathFromSourceEntryToUnselectedEntry);++        ClassPathEntry selectedEntry =+            findEntryByArtifactId(+                rootResult, artifactInSubtree.getGroupId(), artifactInSubtree.getArtifactId());+        if (selectedEntry != null) {+          Artifact selectedArtifact = selectedEntry.getArtifact();+          if (!selectedArtifact.getVersion().equals(artifactInSubtree.getVersion())) {+            // Different version of that artifact is selected in rootResult+            linkageProblem.setCause(+                new DependencyConflict(+                    rootResult.getDependencyPaths(selectedEntry).get(0), pathToUnselectedEntry));+          } else {+            // A linkage error was already there when sourceArtifact was built.+            linkageProblem.setCause(UnknownCause.getInstance());+          }+        } else {+          // No artifact that matches groupId and artifactId in rootResult.+          linkageProblem.setCause(new MissingDependency(pathToUnselectedEntry));+        }+      }+    }+  }++  /**+   * Returns the class path entry in {@code classPathResult} for the artifact that matches {@code+   * groupId} and {@code artifactId}. {@code Null} if no matching artifact is found.+   */+  private static ClassPathEntry findEntryByArtifactId(+      ClassPathResult classPathResult, String groupId, String artifactId) {+    for (ClassPathEntry entry : classPathResult.getClassPath()) {+      Artifact artifact = entry.getArtifact();+      if (artifact.getGroupId().equals(groupId) && artifact.getArtifactId().equals(artifactId)) {+        return entry;+      }+    }+    return null;+  }++  /**+   * Returns the {@link ClassPathEntry} in {@code classPathResult} that contains the class of {@code+   * symbol}. {@code Null} if no matching entry is found.+   */+  private static ClassPathEntry findClassPathEntryForSymbol(

This also feels like it fits naturally as an instance method in ClasspathResult

suztomo

comment created time in 3 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

 public ClassPathBuilder(DependencyGraphBuilder dependencyGraphBuilder) {   }    /**-   * Builds a classpath from the transitive dependency graph of a list of artifacts.-   * When there are multiple versions of an artifact in-   * the dependency tree, the closest to the root in breadth-first order is picked up. This "pick-   * closest" strategy follows Maven's dependency mediation.+   * Builds a classpath from the transitive dependency graph from {@code artifacts}. When there are+   * multiple versions of an artifact in the dependency tree, the closest to the root in+   * breadth-first order is picked up. This "pick closest" strategy follows Maven's dependency+   * mediation.    *    * @param artifacts the first artifacts that appear in the classpath, in order-   * @param full if true all optional dependencies and their transitive dependencies are-   *     included. If false, optional dependencies are not included.+   * @param full if true all optional dependencies and their transitive dependencies are included.+   *     If false, optional dependencies are not included.    */   public ClassPathResult resolve(List<Artifact> artifacts, boolean full) {-    LinkedListMultimap<ClassPathEntry, DependencyPath> multimap = LinkedListMultimap.create();-    if (artifacts.isEmpty()) {-      return new ClassPathResult(multimap, ImmutableList.of());-    }     // dependencyGraph holds multiple versions for one artifact key (groupId:artifactId)     DependencyGraph result;     if (full) {       result = dependencyGraphBuilder.buildFullDependencyGraph(artifacts);     } else {       result = dependencyGraphBuilder.buildVerboseDependencyGraph(artifacts);     }-    List<DependencyPath> dependencyPaths = result.list();+    return performMediation(result);+  }++  /**+   * Builds a class path from the dependency graph with {@code artifact} as the root, in the same+   * way as Maven would do when the artifact was built.+   *+   * <p>Compared to {@link #resolve(List, boolean)}, this method includes direct optional

Not quite. The difference is that this method takes a root artifact and that method takes a list of artifacts from non-root dependencies.

suztomo

comment created time in 3 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import com.google.cloud.tools.opensource.dependencies.DependencyPath;+import java.io.IOException;+import org.eclipse.aether.artifact.Artifact;++/** Annotates {@link LinkageProblem}s with {@link LinkageProblemCause}s. */+public class LinkageProblemCauseAnnotator {++  /**+   * Annotates the cause field of {@link LinkageProblem}s with the {@link LinkageProblemCause}.+   *+   * @param rootResult the class path used for generating the linkage problems.+   * @param linkageProblems linkage problems to annotate+   * @throws IOException when there is a problem reading JAR files.

no period

suztomo

comment created time in 3 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import com.google.cloud.tools.opensource.dependencies.DependencyPath;+import java.io.IOException;+import org.eclipse.aether.artifact.Artifact;++/** Annotates {@link LinkageProblem}s with {@link LinkageProblemCause}s. */+public class LinkageProblemCauseAnnotator {++  /**+   * Annotates the cause field of {@link LinkageProblem}s with the {@link LinkageProblemCause}.+   *+   * @param rootResult the class path used for generating the linkage problems.

no period

suztomo

comment created time in 3 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

 public ClassPathBuilder(DependencyGraphBuilder dependencyGraphBuilder) {   }    /**-   * Builds a classpath from the transitive dependency graph of a list of artifacts.-   * When there are multiple versions of an artifact in-   * the dependency tree, the closest to the root in breadth-first order is picked up. This "pick-   * closest" strategy follows Maven's dependency mediation.+   * Builds a classpath from the transitive dependency graph from {@code artifacts}. When there are+   * multiple versions of an artifact in the dependency tree, the closest to the root in+   * breadth-first order is picked up. This "pick closest" strategy follows Maven's dependency+   * mediation.    *    * @param artifacts the first artifacts that appear in the classpath, in order-   * @param full if true all optional dependencies and their transitive dependencies are-   *     included. If false, optional dependencies are not included.+   * @param full if true all optional dependencies and their transitive dependencies are included.+   *     If false, optional dependencies are not included.    */   public ClassPathResult resolve(List<Artifact> artifacts, boolean full) {-    LinkedListMultimap<ClassPathEntry, DependencyPath> multimap = LinkedListMultimap.create();-    if (artifacts.isEmpty()) {-      return new ClassPathResult(multimap, ImmutableList.of());-    }     // dependencyGraph holds multiple versions for one artifact key (groupId:artifactId)     DependencyGraph result;     if (full) {       result = dependencyGraphBuilder.buildFullDependencyGraph(artifacts);     } else {       result = dependencyGraphBuilder.buildVerboseDependencyGraph(artifacts);     }-    List<DependencyPath> dependencyPaths = result.list();+    return performMediation(result);+  }++  /**+   * Builds a class path from the dependency graph with {@code artifact} as the root, in the same+   * way as Maven would do when the artifact was built.+   *+   * <p>Compared to {@link #resolve(List, boolean)}, this method includes direct optional+   * dependencies of {@code artifact} but excludes its transitive optional dependencies.+   */+  ClassPathResult resolveWithMaven(Artifact artifact) {+    DependencyGraph result =+        dependencyGraphBuilder.buildMavenDependencyGraph(new Dependency(artifact, "compile"));+    return performMediation(result);+  } +  private ClassPathResult performMediation(DependencyGraph result) {

performMediation --> mediate

suztomo

comment created time in 3 hours

pull request commentapache/maven-archetype

update surefire

You'd have to ask whoever wrote this originally. This PR simply updates the version.

elharo

comment created time in 6 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import static com.google.cloud.tools.opensource.classpath.TestHelper.resolve;

don't static import this

suztomo

comment created time in 6 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

  import static com.google.cloud.tools.opensource.classpath.TestHelper.COORDINATES; import static com.google.cloud.tools.opensource.classpath.TestHelper.classPathEntryOfResource;+import static com.google.cloud.tools.opensource.classpath.TestHelper.resolve;

don't static import here

suztomo

comment created time in 6 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

  package com.google.cloud.tools.opensource.classpath; -import static com.google.cloud.tools.opensource.classpath.LinkageCheckerTest.resolvePaths; import static com.google.cloud.tools.opensource.classpath.TestHelper.classPathEntryOfResource;+import static com.google.cloud.tools.opensource.classpath.TestHelper.resolve;

don't static import unfamiliar classes

suztomo

comment created time in 6 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import static com.google.common.base.Preconditions.checkNotNull;++import com.google.cloud.tools.opensource.dependencies.DependencyPath;+import java.util.Objects;+import org.eclipse.aether.artifact.Artifact;+import org.eclipse.aether.graph.Dependency;++/** An optional or provided-scope dependency is not supplied. */+class MissingDependency extends LinkageProblemCause {

nice class

suztomo

comment created time in 6 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import static com.google.common.base.Preconditions.checkNotNull;++import com.google.cloud.tools.opensource.dependencies.DependencyPath;+import java.util.Objects;++/**+ * Diamond dependency conflict caused a {@link LinkageProblem} where the {@link LinkageProblem}'s+ * invalid reference points to the symbol in {@code pathToSelectedArtifact.getLeaf()} but a valid+ * symbol is in {@code pathToUnselectedArtifact.getLeaf()}.+ */+class DependencyConflict extends LinkageProblemCause {+  DependencyPath pathToUnselectedArtifact;+  DependencyPath pathToSelectedArtifact;++  DependencyConflict(+      DependencyPath pathToSelectedArtifact, DependencyPath pathToUnselectedArtifactFromSource) {

delete "FromSource"

suztomo

comment created time in 6 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++/**+ * Linkage Checker cannot determine the cause of the linkage error.+ *+ * <p>This occurs when the POM file that used in building a library and the published POM file are+ * different.+ */+public class UnknownCause extends LinkageProblemCause {++  @Override+  public String toString() {+    return "Unknown";+  }++  @Override+  public boolean equals(Object obj) {+    return obj instanceof UnknownCause;

This tempts me to suggest a singleton.

suztomo

comment created time in 6 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

 public ClassPathResult resolve(List<Artifact> artifacts, boolean full) {     } else {       result = dependencyGraphBuilder.buildVerboseDependencyGraph(artifacts);     }-    List<DependencyPath> dependencyPaths = result.list();+    return performMediation(result);+  } +  /**+   * Builds a class path from the dependency graph with {@code artifact} as the root, in the same+   * way as Maven would do when the artifact was built.+   *+   * <p>Compared to {@link #resolve(List, boolean)}, this method includes direct optional+   * dependencies of {@code artifact} but excludes its transitive optional dependencies.+   */+  ClassPathResult resolveWithMaven(Artifact artifact) {+    DependencyGraph result =+        dependencyGraphBuilder.buildMavenDependencyGraph(new Dependency(artifact, "compile"));+    return performMediation(result);+  }++  private ClassPathResult performMediation(DependencyGraph result) {     // TODO should DependencyGraphResult have a mediate() method that returns a ClassPathResult?-    +     // To remove duplicates on (groupId:artifactId) for dependency mediation     MavenDependencyMediation mediation = new MavenDependencyMediation(); +    LinkedListMultimap<ClassPathEntry, DependencyPath> multimap = LinkedListMultimap.create();

Is this variable used anywhere?

suztomo

comment created time in 6 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import com.google.cloud.tools.opensource.dependencies.DependencyPath;+import com.google.common.base.Verify;+import java.io.IOException;+import org.eclipse.aether.artifact.Artifact;++/** Annotates {@link LinkageProblem}s with {@link LinkageProblemCause}s. */+public class LinkageProblemCauseAnnotator {++  /**+   * Annotates the cause field of {@link LinkageProblem}s with the {@link LinkageProblemCause}.+   *+   * @param rootResult the class path used for generating the linkage problems.+   * @param linkageProblems linkage problems to annotate+   * @throws IOException when there is a problem in reading JAR files.+   */+  static void annotate(ClassPathResult rootResult, Iterable<LinkageProblem> linkageProblems)+      throws IOException {++    for (LinkageProblem linkageProblem : linkageProblems) {+      ClassFile sourceClass = linkageProblem.getSourceClass();+      ClassPathEntry sourceEntry = sourceClass.getClassPathEntry();++      Artifact sourceArtifact = sourceEntry.getArtifact();+      Verify.verify(sourceArtifact != null);++      // Resolves the dependency graph with the source artifact at the root.+      ClassPathBuilder classPathBuilder = new ClassPathBuilder();+      ClassPathResult subtreeResult = classPathBuilder.resolveWithMaven(sourceArtifact);++      ClassPathEntry entryInSubtree =+          findClassPathEntryForSymbol(subtreeResult, linkageProblem.getSymbol());+      if (entryInSubtree == null) {+        linkageProblem.setCause(new UnknownCause());+      } else {+        Artifact artifactInSubtree = entryInSubtree.getArtifact();+        DependencyPath pathToSourceEntry = rootResult.getDependencyPaths(sourceEntry).get(0);+        DependencyPath pathFromSourceEntryToUnselectedEntry =+            subtreeResult.getDependencyPaths(entryInSubtree).get(0);+        DependencyPath pathToUnselectedEntry =+            pathToSourceEntry.concat(pathFromSourceEntryToUnselectedEntry);++        ClassPathEntry selectedEntry =+            findEntryByArtifactId(+                rootResult, artifactInSubtree.getGroupId(), artifactInSubtree.getArtifactId());+        if (selectedEntry != null) {+          Artifact selectedArtifact = selectedEntry.getArtifact();+          if (!selectedArtifact.getVersion().equals(artifactInSubtree.getVersion())) {+            // Different version of that artifact is selected in rootResult+            linkageProblem.setCause(+                new DependencyConflict(+                    rootResult.getDependencyPaths(selectedEntry).get(0), pathToUnselectedEntry));+          } else {+            // A linkage error was already there when sourceArtifact was built.+            linkageProblem.setCause(new UnknownCause());+          }+        } else {+          // No artifact that match groupId and artifactId in rootResult.

matches

suztomo

comment created time in 6 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import com.google.cloud.tools.opensource.dependencies.DependencyPath;+import com.google.common.base.Verify;+import java.io.IOException;+import org.eclipse.aether.artifact.Artifact;++/** Annotates {@link LinkageProblem}s with {@link LinkageProblemCause}s. */+public class LinkageProblemCauseAnnotator {++  /**+   * Annotates the cause field of {@link LinkageProblem}s with the {@link LinkageProblemCause}.+   *+   * @param rootResult the class path used for generating the linkage problems.+   * @param linkageProblems linkage problems to annotate+   * @throws IOException when there is a problem in reading JAR files.+   */+  static void annotate(ClassPathResult rootResult, Iterable<LinkageProblem> linkageProblems)+      throws IOException {++    for (LinkageProblem linkageProblem : linkageProblems) {+      ClassFile sourceClass = linkageProblem.getSourceClass();+      ClassPathEntry sourceEntry = sourceClass.getClassPathEntry();++      Artifact sourceArtifact = sourceEntry.getArtifact();+      Verify.verify(sourceArtifact != null);

Handle null appropriately if it can happen. Verify has all but one of the problems assertions have

suztomo

comment created time in 6 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import com.google.cloud.tools.opensource.dependencies.DependencyPath;+import com.google.common.base.Verify;+import java.io.IOException;+import org.eclipse.aether.artifact.Artifact;++/** Annotates {@link LinkageProblem}s with {@link LinkageProblemCause}s. */+public class LinkageProblemCauseAnnotator {++  /**+   * Annotates the cause field of {@link LinkageProblem}s with the {@link LinkageProblemCause}.+   *+   * @param rootResult the class path used for generating the linkage problems.+   * @param linkageProblems linkage problems to annotate+   * @throws IOException when there is a problem in reading JAR files.

in reading JAR files. --> reading JAR files

suztomo

comment created time in 6 hours

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblemCause that explains why there is an invalid reference

 public ClassPathBuilder(DependencyGraphBuilder dependencyGraphBuilder) {    *     included. If false, optional dependencies are not included.    */   public ClassPathResult resolve(List<Artifact> artifacts, boolean full) {-    LinkedListMultimap<ClassPathEntry, DependencyPath> multimap = LinkedListMultimap.create();     if (artifacts.isEmpty()) {-      return new ClassPathResult(multimap, ImmutableList.of());+      return new ClassPathResult(LinkedListMultimap.create(), ImmutableList.of());

why are we passing multimaps again?

suztomo

comment created time in 6 hours

issue commentGoogleCloudPlatform/cloud-opensource-java

Dashboard is showing "srczip" dependency for Guava

That's just the JDK classes. I'm sure the Guava team has some reason for putting it there, but we should probably just special case it and not report it.

suztomo

comment created time in 20 hours

issue openedGoogleCloudPlatform/cloud-opensource-java

add more depndencies to upper-bounds-check/pom.xml

https://github.com/GoogleCloudPlatform/cloud-opensource-java/blob/master/boms/upper-bounds-check/pom.xml

datastore vision

created time in 21 hours

push eventGoogleCloudPlatform/cloud-opensource-java

Elliotte Rusty Harold

commit sha bb0acefc42b7fcbf4dd34d8ce813167ac138f1f7

errors now hidden by not following optional

view details

push time in a day

PR closed apache/maven-dependency-plugin

Bump mockito-core from 2.28.2 to 3.4.0 dependencies

Bumps mockito-core from 2.28.2 to 3.4.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/mockito/mockito/releases">mockito-core's releases</a>.</em></p> <blockquote> <h2>v3.4.0</h2> <p><!-- raw HTML omitted --><!-- raw HTML omitted --><em>Release notes were automatically generated by <a href="http://shipkit.org/">Shipkit</a></em><!-- raw HTML omitted --><!-- raw HTML omitted --></p> <h4>3.4.0</h4> <ul> <li>2020-07-10 - <a href="https://github.com/mockito/mockito/compare/v3.3.12...v3.4.0">19 commits</a> by 9 authors - published to <a href="https://bintray.com/mockito/maven/mockito/3.4.0"><img src="https://img.shields.io/badge/Bintray-3.4.0-green.svg" alt="Bintray" /></a></li> <li>Commits: <a href="https://github.com/TimvdLippe">Tim van der Lippe</a> (5), <a href="https://github.com/epeee">Erhard Pointl</a> (4), <a href="https://github.com/raphw">Rafael Winterhalter</a> (3), <a href="https://github.com/grimreaper">Eitan Adler</a> (2), adrianriley (1), akluball (1), <a href="https://github.com/arteam">Artem Prigoda</a> (1), <a href="https://github.com/jamietanna">Jamie Tanna</a> (1), <a href="https://github.com/takezoe">Naoki Takezoe</a> (1)</li> <li>[Android support] Enable mocking static methods in Mockito [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1013">#1013</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1013">mockito/mockito#1013</a>)</li> <li>Document using <code>@Mock</code> with method parameters [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1961">#1961</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1961">mockito/mockito#1961</a>)</li> <li>Documentation: <code>@Mock</code> on method parameters [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1960">#1960</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1960">mockito/mockito#1960</a>)</li> <li>Update errorprone gradle plugin to v1.2.1 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1958">#1958</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1958">mockito/mockito#1958</a>)</li> <li>Update spotless Travis job name to be more descriptive [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1957">#1957</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1957">mockito/mockito#1957</a>)</li> <li>Fix a confusing typo in subclassing error message [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1953">#1953</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1953">mockito/mockito#1953</a>)</li> <li>Update bnd gradle plugin to v5.1.1 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1952">#1952</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1952">mockito/mockito#1952</a>)</li> <li>Use errorprone 2.4.0 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1951">#1951</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1951">mockito/mockito#1951</a>)</li> <li>Use jacoco v0.8.5 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1950">#1950</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1950">mockito/mockito#1950</a>)</li> <li>Fixes <a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1712">#1712</a> : prepend description to AssertionError thrown in verification [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1949">#1949</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1949">mockito/mockito#1949</a>)</li> <li>Update gradle 6 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1948">#1948</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1948">mockito/mockito#1948</a>)</li> <li>Move spotless check to separate build task [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1946">#1946</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1946">mockito/mockito#1946</a>)</li> <li>[Travis] Replace JDK 9/10 with 14 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1945">#1945</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1945">mockito/mockito#1945</a>)</li> <li>Fixes <a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1898">#1898</a> : Return mock name from toString method for deep stub mocks [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1942">#1942</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1942">mockito/mockito#1942</a>)</li> <li>[checkstyle] switch to new DTD [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1940">#1940</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1940">mockito/mockito#1940</a>)</li> <li>Use google-java-format in spotless [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1934">#1934</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1934">mockito/mockito#1934</a>)</li> <li>Update report message to use any() instead of anyObject() [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1931">#1931</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1931">mockito/mockito#1931</a>)</li> <li>[build] bump gradle to latest 5.x release [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1923">#1923</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1923">mockito/mockito#1923</a>)</li> <li>[build] update gradle-errorprone-plugin to 1.1.0 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1908">#1908</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1908">mockito/mockito#1908</a>)</li> <li>RETURNS_DEEP_STUBS override a mock's toString to <code>null</code> [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1898">#1898</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1898">mockito/mockito#1898</a>)</li> <li>"description" not printing when verify args don't match [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1712">#1712</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1712">mockito/mockito#1712</a>)</li> </ul> <h2>v3.3.12</h2> <p><!-- raw HTML omitted --><!-- raw HTML omitted --><em>Release notes were automatically generated by <a href="http://shipkit.org/">Shipkit</a></em><!-- raw HTML omitted --><!-- raw HTML omitted --></p> <h4>3.3.12</h4> <ul> <li>2020-05-25 - <a href="https://github.com/mockito/mockito/compare/v3.3.11...v3.3.12">1 commit</a> by <a href="https://github.com/vinischeidegger">Vinicius Scheidegger</a> - published to <a href="https://bintray.com/mockito/maven/mockito-development/3.3.12"><img src="https://img.shields.io/badge/Bintray-3.3.12-green.svg" alt="Bintray" /></a></li> <li>Update javadoc - remove deprecated class [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1938">#1938</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1938">mockito/mockito#1938</a>)</li> </ul> <h2>v3.3.11</h2> <p><!-- raw HTML omitted --><!-- raw HTML omitted --><em>Release notes were automatically generated by <a href="http://shipkit.org/">Shipkit</a></em><!-- raw HTML omitted --><!-- raw HTML omitted --></p> <h4>3.3.11</h4> <ul> <li>2020-05-14 - <a href="https://github.com/mockito/mockito/compare/v3.3.10...v3.3.11">5 commits</a> by <a href="https://github.com/andreisilviudragnea">Andrei Silviu Dragnea</a> (2), <a href="https://github.com/mockitoguy">Szczepan Faber</a> (2), <a href="https://github.com/grimreaper">Eitan Adler</a> (1) - published to <a href="https://bintray.com/mockito/maven/mockito-development/3.3.11"><img src="https://img.shields.io/badge/Bintray-3.3.11-green.svg" alt="Bintray" /></a></li> <li>JUnit 5 strict stubs check should not suppress the regular test failure [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1928">#1928</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1928">mockito/mockito#1928</a>)</li> <li>Fix import order [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1927">#1927</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1927">mockito/mockito#1927</a>)</li> <li>[build] add ben-manes dependency upgrade finder [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1922">#1922</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1922">mockito/mockito#1922</a>)</li> </ul> <h2>v3.3.10</h2> <p><!-- raw HTML omitted --><!-- raw HTML omitted --><em>Release notes were automatically generated by <a href="http://shipkit.org/">Shipkit</a></em><!-- raw HTML omitted --><!-- raw HTML omitted --></p> <h4>3.3.10</h4> <ul> <li>2020-04-30 - <a href="https://github.com/mockito/mockito/compare/v3.3.9...v3.3.10">1 commit</a> by <a href="https://github.com/netbeansuser2019">netbeansuser2019</a> - published to <a href="https://bintray.com/mockito/maven/mockito-development/3.3.10"><img src="https://img.shields.io/badge/Bintray-3.3.10-green.svg" alt="Bintray" /></a></li> <li>Update dependencies.gradle [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1920">#1920</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/1920">mockito/mockito#1920</a>)</li> </ul> <!-- raw HTML omitted --> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/mockito/mockito/commit/05b39bfc5e4558f4c1c6853d5b454f534bdfefe0"><code>05b39bf</code></a> 3.4.0 release (previous 3.3.12) + release notes updated by CI build 4577</li> <li><a href="https://github.com/mockito/mockito/commit/573bf0df389964d7fdeb4de486882d4599b8033c"><code>573bf0d</code></a> [ci maven-central-release] Include ability for static mocks</li> <li><a href="https://github.com/mockito/mockito/commit/bdd2b10ed5b02397614324d31449d8a58f03cf72"><code>bdd2b10</code></a> Update src/main/java/org/mockito/Captor.java</li> <li><a href="https://github.com/mockito/mockito/commit/b3fc349e8e525e41f34ff04aca8c3140ff2b335a"><code>b3fc349</code></a> Mockito <a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1013">#1013</a>: Defines and implements API for static mocking.</li> <li><a href="https://github.com/mockito/mockito/commit/87aacaeca72f99941323d7d5d981cde333177b23"><code>87aacae</code></a> Document using <code>@Mock</code> with method parameters (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1961">#1961</a>)</li> <li><a href="https://github.com/mockito/mockito/commit/0501e02994959c997dd0a5bdafc6288ae1e487ac"><code>0501e02</code></a> Update errorprone gradle plugin to v1.2.1 (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1958">#1958</a>)</li> <li><a href="https://github.com/mockito/mockito/commit/c5edffef198185ea9e5a91a71a26372e64fe2132"><code>c5edffe</code></a> Update spotless Travis job name to be more descriptive (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1957">#1957</a>)</li> <li><a href="https://github.com/mockito/mockito/commit/0ed81f72359b1a0625fa22956d34e54fdfc1d7ce"><code>0ed81f7</code></a> Fixes <a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1712">#1712</a>: prepend description to AssertionError thrown in verification (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1">#1</a>...</li> <li><a href="https://github.com/mockito/mockito/commit/397b4d247c74bd36761007d10f9c36f74d3aa310"><code>397b4d2</code></a> Update gradle-errorprone-plugin to 1.1.0 (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1908">#1908</a>)</li> <li><a href="https://github.com/mockito/mockito/commit/4fd405da2e199a06ca5950af910b102a62d66b21"><code>4fd405d</code></a> Fix a confusing typo in subclassing error message (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/1953">#1953</a>)</li> <li>Additional commits viewable in <a href="https://github.com/mockito/mockito/compare/v2.28.2...v3.4.0">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

+1 -1

0 comment

1 changed file

dependabot[bot]

pr closed time in a day

push eventGoogleCloudPlatform/cloud-opensource-java

Tomo Suzuki

commit sha 47805ea01e99942bfb1585edc5f01aa07cad3ab9

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile> (#1523) * IntelliJ renaming * dependencies module compiles * in progress * Compiles * Added test * Renamed symbols * format * LinkageProblem subclasses * ErrorType removed * format * Argument reordering * Format * Fixed visibility * Updated LinkageProblem usage * Javadoc * Fixed accessor * javadoc * Applied review * Format * at runtime * Applied review

view details

Jeff Ching

commit sha c7276b3793d4cb423c910a194d67f1c7a4d46640

deps: update google-http-client to 1.36.0, google-cloud-bom to 0.131.0 (#1525) * deps: update google-http-client to 1.36.0 * deps: bump google-cloud-bom to 0.131.0

view details

Elliotte Rusty Harold

commit sha 11db55a01889d88cf084f390110598c1df57c211

Release 8.1.0-bom (#1531) * preparing release 8.1.0-bom * 8.2.0-SNAPSHOT

view details

Elliotte Rusty Harold

commit sha 9e748234fa5c6b144b091be95e800e973f6363ca

Merge branch 'master' into opt4

view details

push time in a day

push eventGoogleCloudPlatform/cloud-opensource-java

Elliotte Rusty Harold

commit sha 11db55a01889d88cf084f390110598c1df57c211

Release 8.1.0-bom (#1531) * preparing release 8.1.0-bom * 8.2.0-SNAPSHOT

view details

push time in a day

PR merged GoogleCloudPlatform/cloud-opensource-java

Release 8.1.0-bom cla: yes

@suztomo Release 8.1.0-bom

+2 -2

0 comment

2 changed files

elharo

pr closed time in a day

create barnchGoogleCloudPlatform/cloud-opensource-java

branch : 8.1.0-bom

created branch time in a day

created tagGoogleCloudPlatform/cloud-opensource-java

tagv8.1.0-bom

Tools for detecting and avoiding linkage errors in GCP open source projects

created time in a day

PR opened apache/maven-archetype

Common
+15 -0

0 comment

1 changed file

pr created time in a day

push eventapache/maven-archetype

Elliotte Rusty Harold

commit sha eab8a2330d370bc96ba51e6399d5d8c796036d30

reformat

view details

push time in a day

create barnchapache/maven-archetype

branch : common

created branch time in a day

push eventapache/maven-archetype

Elliotte Rusty Harold

commit sha 33ba329a04af03f13a49afbffa007b40906dbc0d

revert file

view details

push time in a day

push eventapache/maven-archetype

Elliotte Rusty Harold

commit sha 8e5955c18bc60d7a987f6ade060cba055bf8f904

revert file

view details

push time in a day

create barnchapache/maven-archetype

branch : warnings

created branch time in a day

delete branch apache/maven-archetype

delete branch : deps

delete time in a day

push eventapache/maven-archetype

Elliotte Rusty Harold

commit sha e4eed30d1c0c6eabf45c49194ff6f0d8a4e4d5a7

declare dependencies

view details

Elliotte Rusty Harold

commit sha cd454696cb05ed7b32dad929ecd80bec8288c944

Merge pull request #53 from apache/deps declare dependencies

view details

push time in a day

PR merged apache/maven-archetype

declare dependencies
+28 -5

0 comment

1 changed file

elharo

pr closed time in a day

delete branch apache/maven-archetype

delete branch : surefire

delete time in a day

PR merged apache/maven-archetype

update surefire
+1 -1

0 comment

1 changed file

elharo

pr closed time in a day

push eventapache/maven-archetype

Elliotte Rusty Harold

commit sha a6eaa713c2bdb808076d2ca7db7458e34b57edf7

update surefire

view details

Elliotte Rusty Harold

commit sha e9ee9044bd8656b25cf22ba8f741bb216e5060df

Merge pull request #52 from apache/surefire update surefire

view details

push time in a day

PR opened apache/maven-archetype

declare dependencies
+28 -5

0 comment

1 changed file

pr created time in a day

create barnchapache/maven-archetype

branch : deps

created branch time in a day

PR opened apache/maven-archetype

update surefire
+1 -1

0 comment

1 changed file

pr created time in a day

create barnchapache/maven-archetype

branch : surefire

created branch time in a day

delete branch GoogleCloudPlatform/cloud-opensource-java

delete branch : chingor13-patch-2

delete time in 2 days

push eventGoogleCloudPlatform/cloud-opensource-java

Jeff Ching

commit sha c7276b3793d4cb423c910a194d67f1c7a4d46640

deps: update google-http-client to 1.36.0, google-cloud-bom to 0.131.0 (#1525) * deps: update google-http-client to 1.36.0 * deps: bump google-cloud-bom to 0.131.0

view details

push time in 2 days

push eventGoogleCloudPlatform/cloud-opensource-java

Elliotte Rusty Harold

commit sha 47572dbfc4b114837338283119b213ff2b3322b7

Enable building classpath without optional dependencies (#1521) * some optimizations * reproduce OutOfMemoryError * use smaller artifact * catalog * copyright * try not interning * enable building classpaths without optional dependencies * revert unhelpful optimization * add @Test * remove commented code * one test * unstick cla

view details

Elliotte Rusty Harold

commit sha 1ac3abaa4eb070fa57ab699e072fde58176a24b2

don't include optional dependencies when generating dashboard (#1528) * don't include optional dependencies when generating dashboard

view details

Tomo Suzuki

commit sha 47805ea01e99942bfb1585edc5f01aa07cad3ab9

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile> (#1523) * IntelliJ renaming * dependencies module compiles * in progress * Compiles * Added test * Renamed symbols * format * LinkageProblem subclasses * ErrorType removed * format * Argument reordering * Format * Fixed visibility * Updated LinkageProblem usage * Javadoc * Fixed accessor * javadoc * Applied review * Format * at runtime * Applied review

view details

Elliotte Rusty Harold

commit sha 492d6e5cee65e0f55907d466d91a6109704ca5a4

Merge branch 'master' into chingor13-patch-2

view details

push time in 2 days

PR opened GoogleCloudPlatform/cloud-opensource-java

Reviewers
drop optional dependencies when running enforcer rule

@suztomo I am wondering whether this ought to be an option configurable in pom.xml.

+1 -1

0 comment

1 changed file

pr created time in 2 days

push eventGoogleCloudPlatform/cloud-opensource-java

Elliotte Rusty Harold

commit sha d6a62c35829ea4af0fb5779e81131bc0e48287c2

drop optional dependencies when running enforcer rule

view details

push time in 2 days

create barnchGoogleCloudPlatform/cloud-opensource-java

branch : opt4

created branch time in 2 days

PR merged GoogleCloudPlatform/cloud-opensource-java

don't include optional dependencies when generating dashboard cla: yes

@suztomo This does change which errors we show in the dashboard for which dependencies. However it does seem to move the total error count down.

+11 -9

0 comment

2 changed files

elharo

pr closed time in 2 days

delete branch GoogleCloudPlatform/cloud-opensource-java

delete branch : opt3

delete time in 2 days

push eventGoogleCloudPlatform/cloud-opensource-java

Elliotte Rusty Harold

commit sha 1ac3abaa4eb070fa57ab699e072fde58176a24b2

don't include optional dependencies when generating dashboard (#1528) * don't include optional dependencies when generating dashboard

view details

push time in 2 days

PullRequestEvent

push eventgoogleapis/java-core

WhiteSource Renovate

commit sha 0fd53fe522e35fdd09783bb618ff7dcf01d82a95

deps: update dependency com.google.api-client:google-api-client-bom to v1.30.10 (#253)

view details

push time in 2 days

PR merged googleapis/java-core

deps: update dependency com.google.api-client:google-api-client-bom to v1.30.10 cla: yes

This PR contains the following updates:

Package Update Change
com.google.api-client:google-api-client-bom patch 1.30.9 -> 1.30.10

Release Notes

<details> <summary>googleapis/google-api-java-client</summary>

v1.30.10

Compare Source

</details>


Renovate configuration

:date: Schedule: At any time (no schedule defined).

:vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.

:recycle: Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: Ignore: Close this PR and you won't be reminded about this update again.


  • [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

This PR has been generated by WhiteSource Renovate. View repository job log here.

+1 -1

1 comment

1 changed file

renovate-bot

pr closed time in 2 days

push eventGoogleCloudPlatform/cloud-opensource-java

Elliotte Rusty Harold

commit sha 80023f18cf27e61a4dabef100303f5e194aaba3f

update test

view details

push time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

   <#return plural?string(pluralNoun, singularNoun)> </#function> -<#macro formatJarLinkageReport classPathEntry problemsWithClass classPathResult dependencyPathRootCauses>-  <!-- problemsWithClass: ImmutableSetMultimap<SymbolProblem, String> converted to-    ImmutableMap<SymbolProblem, Collection<String>> to get key and set of values in Freemarker -->-  <#assign problemsToClasses = problemsWithClass.asMap() />+<#macro formatJarLinkageReport classPathEntry linkageProblems classPathResult+    dependencyPathRootCauses>+  <!-- problemsToClasses: ImmutableMap<LinkageProblem, ImmutableList<String>> to get key and set of

<!-- should be <#--

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

 private LinkageChecker(    /**    * Searches the classpath for linkage errors.-   * -   * @return {@link SymbolProblem}s found in the class path and referencing classes+   *+   * @return {@link LinkageProblem}s found in the class path and referencing classes    * @throws IOException I/O error reading files in the classpath    */-  public ImmutableSetMultimap<SymbolProblem, ClassFile> findSymbolProblems() throws IOException {-    // Having Problem in key will dedup SymbolProblems-    ImmutableSetMultimap.Builder<SymbolProblem, ClassFile> problemToClass =-        ImmutableSetMultimap.builder();-    +  public ImmutableSet<LinkageProblem> findLinkageProblems() throws IOException {+    ImmutableSet.Builder<LinkageProblem> problemToClass = ImmutableSet.builder();++    // This sourceClassFile is a source of references to other symbols.     for (ClassFile classFile : symbolReferences.getClassFiles()) {       ImmutableSet<ClassSymbol> classSymbols = symbolReferences.getClassSymbols(classFile);-       for (ClassSymbol classSymbol : classSymbols) {         if (classSymbol instanceof SuperClassSymbol) {

if blocks testing subtypes suggests there's a missed opportunity to use polymorphism. Could the logic of each if block be pushed into a method in ClassSymbol and its subtypes instead?

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import java.util.Objects;++/**+ * A {@link LinkageProblem} caused by an invalid reference when both {@code sourceClass} and {@code+ * targetClass} are present in the class path.+ */+public abstract class IncompatibleLinkageProblem extends LinkageProblem {+  private final ClassFile targetClass;++  IncompatibleLinkageProblem(+      String symbolProblemMessage, ClassFile sourceClass, ClassFile targetClass, Symbol symbol) {+    super(symbolProblemMessage, sourceClass, symbol);+    this.targetClass = targetClass;+  }++  @Override+  public String formatSymbolProblem() {+    String jarInfo =+        targetClass != null ? String.format("(%s) ", targetClass.getClassPathEntry()) : "";

String.format seems like overkill here

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

       </#list>     </ul>   </#list>+  <#assign jarsInProblem = {} >+  <#list linkageProblems as problem>+    <#if (problem.getTargetClass())?? >+      <#assign targetClassPathEntry = problem.getTargetClass().getClassPathEntry() />+      <!-- Freemarker's hash requires its keys to be string.

string --> strings use <#-- to start a Freemarker comment

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

 private static ArtifactResults generateArtifactReport(           collectLatestVersions(globalDependencies), transitiveDependencies);        long totalLinkageErrorCount =-          symbolProblemTable.values().stream()-              .flatMap(problemToClasses -> problemToClasses.keySet().stream())-              .distinct()+          linkageProblemTable.values().stream()+              .flatMap(problemToClasses -> problemToClasses.stream().map(LinkageProblem::getSymbol))+              .distinct() // The dashboard count linkage errors by the symbols

count --> counts

suztomo

comment created time in 2 days

issue commentGoogleCloudPlatform/cloud-opensource-java

Freemarker comments slipping into dashboard HTML

Mistake was using HTML comments instead of FreeMarker comments. HTML comments are copied into the output unchanged. Freemarker comments are delimited by <#-- and --> and are not written to the output.

elharo

comment created time in 2 days

PR opened GoogleCloudPlatform/cloud-opensource-java

Reviewers
don't include optional dependencies when generating dashboard

@suztomo This does change which errors we show in the dashboard for which dependencies. However it does seem to move the total error count down.

+7 -4

0 comment

2 changed files

pr created time in 2 days

push eventGoogleCloudPlatform/cloud-opensource-java

Elliotte Rusty Harold

commit sha 0ee3b9aacd8ed4bef08c715f5236eedeec003c2a

remove debugging code

view details

push time in 2 days

create barnchGoogleCloudPlatform/cloud-opensource-java

branch : opt3

created branch time in 2 days

issue openedGoogleCloudPlatform/cloud-opensource-java

Freemarker comments slipping into dashboard HTML

 <!-- problemsWithClass: ImmutableSetMultimap<SymbolProblem, String> converted to
    ImmutableMap<SymbolProblem, Collection<String>> to get key and set of values in Freemarker -->

created time in 2 days

issue commentGoogleCloudPlatform/cloud-opensource-java

User input errors in DashboardMain should not create stack traces

This is how I triggered that error:

$ mvn exec:java -Dexec.arguments="-a com.google.cloud:libraries-bom:1.0.0"

elharo

comment created time in 2 days

issue openedGoogleCloudPlatform/cloud-opensource-java

User input errors in DashboardMain should not create stack traces

All possible user input errors should be handled and messaged without exposing exceptions

[WARNING] java.lang.IllegalArgumentException: The versionless coordinates should have one colon character: com.google.cloud:libraries-bom:1.0.0 at com.google.common.base.Preconditions.checkArgument (Preconditions.java:142) at com.google.cloud.tools.opensource.dashboard.DashboardMain.generateAllVersions (DashboardMain.java:119) at com.google.cloud.tools.opensource.dashboard.DashboardMain.main (DashboardMain.java:107) at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254) at java.lang.Thread.run (Thread.java:748) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.659 s [INFO] Finished at: 2020-07-13T10:05:37-04:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (default-cli) on project dashboard: An exception occured while executing the Java class. The versionless coordinates should have one colon character: com.google.cloud:libraries-bom:1.0.0 -> [Help 1] [ERROR]

created time in 2 days

delete branch apache/maven-site

delete branch : punc

delete time in 2 days

push eventapache/maven-site

Elliotte Rusty Harold

commit sha bb28d0547f13df0987fbde86fb509083b0544e1b

small grammar improvements; add periods and fix run-on sentences

view details

Elliotte Rusty Harold

commit sha 1012e9e41325148862a26bb185eb3116ab55b721

Merge pull request #179 from apache/punc small grammar improvements; add periods and fix run-on sentences

view details

push time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import com.google.common.base.Preconditions;+import com.google.common.collect.ImmutableList;+import com.google.common.collect.ImmutableListMultimap;+import com.google.common.collect.ImmutableMap;+import com.google.common.collect.Iterables;+import com.google.common.collect.ListMultimap;+import com.google.common.collect.Maps;+import com.google.common.collect.Multimaps;+import java.util.Map;+import java.util.Objects;+import java.util.Set;++/**+ * A linkage error describing an invalid reference from {@code sourceClass} to {@code symbol}.+ *+ * @see <a href="https://jlbp.dev/glossary.html#linkage-error">Java Dependency Glossary: Linkage+ *     Error</a>+ */+public abstract class LinkageProblem {++  private final Symbol symbol;+  private final ClassFile sourceClass;+  private final String symbolProblemMessage;++  /**+   * A linkage error describing an invalid reference.+   *+   * @param symbolProblemMessage human-friendly description of this linkage error. Used in+   *     conjunction with {@code symbol}, this value explains why we consider the reference to+   *     {@code symbol} as a linkage error.+   * @param sourceClass the source of the invalid reference.+   * @param symbol the target of the invalid reference+   */+  LinkageProblem(String symbolProblemMessage, ClassFile sourceClass, Symbol symbol) {+    this.symbolProblemMessage = Preconditions.checkNotNull(symbolProblemMessage);+    Preconditions.checkNotNull(symbol);++    // After finding symbol problem, there is no need to have SuperClassSymbol over ClassSymbol.+    this.symbol =+        symbol instanceof SuperClassSymbol ? new ClassSymbol(symbol.getClassBinaryName()) : symbol;+    this.sourceClass = Preconditions.checkNotNull(sourceClass);+  }++  /** Returns the target symbol that was not resolved. */+  public Symbol getSymbol() {+    return symbol;+  }++  /** Returns the source of the invalid reference which this linkage error represents. */+  public ClassFile getSourceClass() {+    return sourceClass;+  }++  @Override+  public boolean equals(Object other) {+    if (this == other) {+      return true;+    }+    if (other == null || getClass() != other.getClass()) {+      return false;+    }+    LinkageProblem that = (LinkageProblem) other;+    return symbol.equals(that.symbol) && Objects.equals(sourceClass, that.sourceClass);+  }++  @Override+  public int hashCode() {+    return Objects.hash(symbol, sourceClass);+  }++  @Override+  public final String toString() {+    return formatSymbolProblem() + " referenced by " + sourceClass;+  }++  /**+   * Returns the description of the problem on the {@code symbol}. This description does not include+   * the {@code sourceClass}. This value is useful when grouping {@link LinkageProblem}s by their+   * {@code symbol}s.+   */+  public String formatSymbolProblem() {+    return symbol.toString() + " " + symbolProblemMessage;

toString() can be inferred here

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

 private LinkageChecker(         String classFileName = classDumper.getFileName(classBinaryName);         if (!classFileNames.contains(classFileName)) {           if (classSymbol instanceof InterfaceSymbol) {-            ImmutableList<SymbolProblem> problems =-                findInterfaceProblems(classFile, (InterfaceSymbol) classSymbol);-            if (!problems.isEmpty()) {-              String interfaceName = classSymbol.getClassBinaryName();-              ClassPathEntry interfaceLocation = classDumper.findClassLocation(interfaceName);+            String interfaceName = classSymbol.getClassBinaryName();+            ClassPathEntry interfaceLocation = classDumper.findClassLocation(interfaceName);+            if (interfaceLocation != null) {               ClassFile interfaceClassFile = new ClassFile(interfaceLocation, interfaceName);-              for (SymbolProblem problem : problems) {-                problemToClass.put(problem, interfaceClassFile);+              ImmutableList<LinkageProblem> problems =+                  findInterfaceProblems(+                      classFile, (InterfaceSymbol) classSymbol, interfaceClassFile);+              if (!problems.isEmpty()) {

if block isn't needed

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

 private LinkageChecker(         String classBinaryName = fieldSymbol.getClassBinaryName();         String classFileName = classDumper.getFileName(classBinaryName);         if (!classFileNames.contains(classFileName)) {-          findSymbolProblem(classFile, fieldSymbol)-              .ifPresent(problem -> problemToClass.put(problem, classFile.topLevelClassFile()));+          findLinkageProblem(classFile, fieldSymbol, classFile.topLevelClassFile())+              .ifPresent(problemToClass::add);         }       }     }      // Filter classes in whitelist-    SetMultimap<SymbolProblem, ClassFile> filteredMap =-        Multimaps.filterEntries(problemToClass.build(), this::problemFilter);-    return ImmutableSetMultimap.copyOf(filteredMap);+    ImmutableSet<LinkageProblem> filteredMap =+        problemToClass.build().stream().filter(this::problemFilter).collect(toImmutableSet());

weird that this is filtering after building. Could you simply not add the elements we don't want in the first place.

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import com.google.common.base.Preconditions;+import com.google.common.collect.ImmutableList;+import com.google.common.collect.ImmutableListMultimap;+import com.google.common.collect.ImmutableMap;+import com.google.common.collect.Iterables;+import com.google.common.collect.ListMultimap;+import com.google.common.collect.Maps;+import com.google.common.collect.Multimaps;+import java.util.Map;+import java.util.Objects;+import java.util.Set;++/**+ * A linkage error describing an invalid reference from {@code sourceClass} to {@code symbol}.+ *+ * @see <a href="https://jlbp.dev/glossary.html#linkage-error">Java Dependency Glossary: Linkage+ *     Error</a>+ */+public abstract class LinkageProblem {++  private final Symbol symbol;+  private final ClassFile sourceClass;+  private final String symbolProblemMessage;++  /**+   * A linkage error describing an invalid reference.+   *+   * @param symbolProblemMessage human-friendly description of this linkage error. Used in+   *     conjunction with {@code symbol}, this value explains why we consider the reference to+   *     {@code symbol} as a linkage error.+   * @param sourceClass the source of the invalid reference.+   * @param symbol the target of the invalid reference+   */+  LinkageProblem(String symbolProblemMessage, ClassFile sourceClass, Symbol symbol) {+    this.symbolProblemMessage = Preconditions.checkNotNull(symbolProblemMessage);+    Preconditions.checkNotNull(symbol);++    // After finding symbol problem, there is no need to have SuperClassSymbol over ClassSymbol.+    this.symbol =+        symbol instanceof SuperClassSymbol ? new ClassSymbol(symbol.getClassBinaryName()) : symbol;+    this.sourceClass = Preconditions.checkNotNull(sourceClass);+  }++  /** Returns the target symbol that was not resolved. */+  public Symbol getSymbol() {+    return symbol;+  }++  /** Returns the source of the invalid reference which this linkage error represents. */+  public ClassFile getSourceClass() {+    return sourceClass;+  }++  @Override+  public boolean equals(Object other) {+    if (this == other) {+      return true;+    }+    if (other == null || getClass() != other.getClass()) {+      return false;+    }+    LinkageProblem that = (LinkageProblem) other;+    return symbol.equals(that.symbol) && Objects.equals(sourceClass, that.sourceClass);+  }++  @Override+  public int hashCode() {+    return Objects.hash(symbol, sourceClass);+  }++  @Override+  public final String toString() {+    return formatSymbolProblem() + " referenced by " + sourceClass;+  }++  /**+   * Returns the description of the problem on the {@code symbol}. This description does not include+   * the {@code sourceClass}. This value is useful when grouping {@link LinkageProblem}s by their+   * {@code symbol}s.+   */+  public String formatSymbolProblem() {+    return symbol.toString() + " " + symbolProblemMessage;+  }++  /** Returns mapping from symbol problem description to the names of the source classes. */

symbol --> linkage?

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

 private LinkageChecker(    /**    * Searches the classpath for linkage errors.-   * -   * @return {@link SymbolProblem}s found in the class path and referencing classes+   *+   * @return {@link LinkageProblem}s found in the class path and referencing classes    * @throws IOException I/O error reading files in the classpath    */-  public ImmutableSetMultimap<SymbolProblem, ClassFile> findSymbolProblems() throws IOException {-    // Having Problem in key will dedup SymbolProblems-    ImmutableSetMultimap.Builder<SymbolProblem, ClassFile> problemToClass =-        ImmutableSetMultimap.builder();-    +  public ImmutableSet<LinkageProblem> findLinkageProblems() throws IOException {+    ImmutableSet.Builder<LinkageProblem> problemToClass = ImmutableSet.builder();++    // This sourceClassFile is a source of references to other symbols.     for (ClassFile classFile : symbolReferences.getClassFiles()) {       ImmutableSet<ClassSymbol> classSymbols = symbolReferences.getClassSymbols(classFile);-       for (ClassSymbol classSymbol : classSymbols) {         if (classSymbol instanceof SuperClassSymbol) {-          ImmutableList<SymbolProblem> problems =-              findAbstractParentProblems(classFile, (SuperClassSymbol) classSymbol);-          if (!problems.isEmpty()) {-            String superClassName = classSymbol.getClassBinaryName();-            ClassPathEntry superClassLocation = classDumper.findClassLocation(superClassName);+          String superClassName = classSymbol.getClassBinaryName();+          ClassPathEntry superClassLocation = classDumper.findClassLocation(superClassName);+          if (superClassLocation != null) {             ClassFile superClassFile = new ClassFile(superClassLocation, superClassName);-            for (SymbolProblem problem : problems) {-              problemToClass.put(problem, superClassFile);+            ImmutableList<LinkageProblem> problems =+                findAbstractParentProblems(+                    classFile, (SuperClassSymbol) classSymbol, superClassFile);+            if (!problems.isEmpty()) {

if block doesn't seem needed here

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++import com.google.common.base.Preconditions;+import com.google.common.collect.ImmutableList;+import com.google.common.collect.ImmutableListMultimap;+import com.google.common.collect.ImmutableMap;+import com.google.common.collect.Iterables;+import com.google.common.collect.ListMultimap;+import com.google.common.collect.Maps;+import com.google.common.collect.Multimaps;+import java.util.Map;+import java.util.Objects;+import java.util.Set;++/**+ * A linkage error describing an invalid reference from {@code sourceClass} to {@code symbol}.+ *+ * @see <a href="https://jlbp.dev/glossary.html#linkage-error">Java Dependency Glossary: Linkage+ *     Error</a>+ */+public abstract class LinkageProblem {++  private final Symbol symbol;+  private final ClassFile sourceClass;+  private final String symbolProblemMessage;++  /**+   * A linkage error describing an invalid reference.+   *+   * @param symbolProblemMessage human-friendly description of this linkage error. Used in+   *     conjunction with {@code symbol}, this value explains why we consider the reference to+   *     {@code symbol} as a linkage error.+   * @param sourceClass the source of the invalid reference.+   * @param symbol the target of the invalid reference+   */+  LinkageProblem(String symbolProblemMessage, ClassFile sourceClass, Symbol symbol) {+    this.symbolProblemMessage = Preconditions.checkNotNull(symbolProblemMessage);+    Preconditions.checkNotNull(symbol);++    // After finding symbol problem, there is no need to have SuperClassSymbol over ClassSymbol.+    this.symbol =+        symbol instanceof SuperClassSymbol ? new ClassSymbol(symbol.getClassBinaryName()) : symbol;+    this.sourceClass = Preconditions.checkNotNull(sourceClass);+  }++  /** Returns the target symbol that was not resolved. */+  public Symbol getSymbol() {+    return symbol;+  }++  /** Returns the source of the invalid reference which this linkage error represents. */+  public ClassFile getSourceClass() {+    return sourceClass;+  }++  @Override+  public boolean equals(Object other) {+    if (this == other) {+      return true;+    }+    if (other == null || getClass() != other.getClass()) {+      return false;+    }+    LinkageProblem that = (LinkageProblem) other;+    return symbol.equals(that.symbol) && Objects.equals(sourceClass, that.sourceClass);+  }++  @Override+  public int hashCode() {+    return Objects.hash(symbol, sourceClass);+  }++  @Override+  public final String toString() {+    return formatSymbolProblem() + " referenced by " + sourceClass;+  }++  /**+   * Returns the description of the problem on the {@code symbol}. This description does not include+   * the {@code sourceClass}. This value is useful when grouping {@link LinkageProblem}s by their+   * {@code symbol}s.+   */+  public String formatSymbolProblem() {+    return symbol.toString() + " " + symbolProblemMessage;+  }++  /** Returns mapping from symbol problem description to the names of the source classes. */+  public static ImmutableMap<String, ImmutableList<String>> groupBySymbolProblem(

Feels like another instance of using a data structure to stand in for a more specific type. Also feels very specific to one use case. Perhaps the Map can be pushed into the class so instead there's a method that returns the source classes given a linkage problem.

Also, I expect Set<String> or Collection<String> fits better here than List<String> unless order is significant for some reason.

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++/**+ * The {@code symbol} (class or interface) defined in {@code targetClass} is not binary-compatible+ * with the {@code sourceClass}.+ *+ * <p>An example case of breaking binary-compatibility is when a superclass changes a method to+ * {@code final} and a subclass is still overriding the method. Another example is when there is a+ * method call to an interface and the interface is changed to a class with the same name.

I don't see why the second case is breaking. I'm probably missing something here, but if you can explain it to me offline, it would helpful. Thanks.

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++/**+ * The {@code symbol} (method or field) defined in {@code targetClass} is inaccessible to the {@code+ * sourceClass}.+ *+ * <p>If the source class is in a different package, the member is not public. If the source is in

different package than the target class

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++/**+ * The {@code symbol} (method or field) defined in {@code targetClass} is inaccessible to the {@code+ * sourceClass}.+ *+ * <p>If the source class is in a different package, the member is not public. If the source is in+ * the same package, the class is private. If the source is a subclass of the target class, the

class is private --> member is private

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++/**+ * The referenced {@code methodSymbol} is not implemented in the {@code targetClass} but the class+ * is declared to implement the method by {@code sourceClass}. Such unimplemented methods manifest+ * as {@link AbstractMethodError}s in runtime.

in runtime --> at runtime.

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

+/*+ * Copyright 2020 Google LLC.+ *+ * Licensed 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 com.google.cloud.tools.opensource.classpath;++/**+ * The {@code classSymbol} is inaccessible to the {@code sourceClass} as per {@code sourceClass}'s+ * definition of the class symbol.+ *+ * <p>If the source class is in a different package, the class or one of its enclosing types is not

different package than the target class

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

 private static void insertIndent(InputStream inputStream, OutputStream outputStr     indentTransformer.transform(new StreamSource(inputStream), new StreamResult(outputStream));   } -  private static void writeXmlEvents(-      XMLEventWriter writer, SymbolProblem symbolProblem, ClassFile classFile)+  private static void writeXmlEvents(XMLEventWriter writer, LinkageProblem linkageProblem)

writeXmlEvents --> writeLinkageProblem

suztomo

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/cloud-opensource-java

LinkageProblem class to replace Multimap<SymbolProblem, ClassFile>

   <#return plural?string(pluralNoun, singularNoun)> </#function> -<#macro formatJarLinkageReport classPathEntry problemsWithClass classPathResult dependencyPathRootCauses>-  <!-- problemsWithClass: ImmutableSetMultimap<SymbolProblem, String> converted to-    ImmutableMap<SymbolProblem, Collection<String>> to get key and set of values in Freemarker -->-  <#assign problemsToClasses = problemsWithClass.asMap() />+<#macro formatJarLinkageReport classPathEntry linkageProblems classPathResult+    dependencyPathRootCauses>+  <!-- problemsToClasses: ImmutableMap<SymbolProblem, ImmutableList<String>> to get key and set of

SymbolProblem --> LinkageProblem

suztomo

comment created time in 2 days

delete branch apache/maven-project-utils

delete branch : issue

delete time in 2 days

create barnchapache/maven-site

branch : punc

created branch time in 2 days

push eventapache/maven-site

David Pead

commit sha b0731e324dd3a008a803f7b92d18e58f4c8c4b1b

[MNGSITE-408] Fix alignment of events logo Submitted by: David Pead o change events <img> to float left

view details

Elliotte Rusty Harold

commit sha ad45e32f78fcb1d48c6b4120bbfa96f0285a6816

Merge pull request #178 from dpd73/bug/MNGSITE-408_Fix_alignment_of_events_logo [MNGSITE-408] Fix alignment of events logo

view details

push time in 2 days

PR merged apache/maven-site

[MNGSITE-408] Fix alignment of events logo

Submitted by: David Pead

o change events <img> to float left

+1 -1

0 comment

1 changed file

dpd73

pr closed time in 2 days

delete branch apache/maven-dependency-analyzer

delete branch : 22

delete time in 2 days

push eventapache/maven-dependency-analyzer

Elliotte Rusty Harold

commit sha 2e9e66ffb71bb0c7164738b7b6bd9471d5eec297

remove reference to deprecated public mutable field (#15) * remove reference to deprecated public mutable field

view details

push time in 2 days

more