-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the return types of
transitiveClosure()
and `reachableNodes(…
…)` to `Immutable*` types. One of those changes is only a change in the declared return type; the other is a behavior change: - `reachableNodes()` already returned an immutable object, even though that was not reflected in the declared return type. - `transitiveClosure()` used to return a mutable object. RELNOTES=`graph`: Changed the return types of `transitiveClosure()` and `reachableNodes()` to `Immutable*` types. `reachableNodes()` already returned an immutable object (even though that was not reflected in the declared return type); `transitiveClosure()` used to return a mutable object. PiperOrigin-RevId: 607051970
- Loading branch information
Showing
4 changed files
with
64 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
android/guava/src/com/google/common/graph/GraphsBridgeMethods.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.google.common.graph; | ||
|
||
import com.google.common.annotations.Beta; | ||
import java.util.Set; | ||
|
||
/** | ||
* Supertype for {@link Graphs}, containing the old signatures of methods whose signatures we've | ||
* changed. This provides binary compatibility for users who compiled against the old signatures. | ||
*/ | ||
@Beta | ||
@ElementTypesAreNonnullByDefault | ||
abstract class GraphsBridgeMethods { | ||
|
||
@SuppressWarnings("PreferredInterfaceType") | ||
public static <N> Graph<N> transitiveClosure(Graph<N> graph) { | ||
return Graphs.transitiveClosure(graph); | ||
} | ||
|
||
@SuppressWarnings("PreferredInterfaceType") | ||
public static <N> Set<N> reachableNodes(Graph<N> graph, N node) { | ||
return Graphs.reachableNodes(graph, node); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
guava/src/com/google/common/graph/GraphsBridgeMethods.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.google.common.graph; | ||
|
||
import com.google.common.annotations.Beta; | ||
import java.util.Set; | ||
|
||
/** | ||
* Supertype for {@link Graphs}, containing the old signatures of methods whose signatures we've | ||
* changed. This provides binary compatibility for users who compiled against the old signatures. | ||
*/ | ||
@Beta | ||
@ElementTypesAreNonnullByDefault | ||
abstract class GraphsBridgeMethods { | ||
|
||
@SuppressWarnings("PreferredInterfaceType") | ||
public static <N> Graph<N> transitiveClosure(Graph<N> graph) { | ||
return Graphs.transitiveClosure(graph); | ||
} | ||
|
||
@SuppressWarnings("PreferredInterfaceType") | ||
public static <N> Set<N> reachableNodes(Graph<N> graph, N node) { | ||
return Graphs.reachableNodes(graph, node); | ||
} | ||
} |