Skip to content

Commit bacafed

Browse files
Treiblesschorlectrueden
authored andcommitted
Javadoc
1 parent 0719868 commit bacafed

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

src/main/java/org/scijava/ops/matcher/MatchingUtils.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,19 @@ private MatchingUtils() {
5858
* source, represented as a raw type, to the specified
5959
* {@link ParameterizedType} destination (which could possibly be a
6060
* supertype of the source type). Thereby, possible {@link TypeVariable}s
61-
* contained in the parameters of the source are tried to be inferred.
61+
* contained in the parameters of the source are tried to be inferred in the
62+
* sense of empty angle brackets when a new object is created:
63+
*
64+
* <pre>
65+
* List&lt;Integer&gt; listOfInts = new ArrayList&lt;&gt;();
66+
* </pre>
67+
*
68+
* Hence, the types to put between the brackets are tried to be determined.
6269
* Inference will be done by simple matching of an encountered
6370
* {@link TypeVariable} in the source to the corresponding type in the
6471
* parameters of the destination. If an {@link TypeVariable} is encountered
6572
* more than once, the corresponding type in the destination needs to
66-
* perfectly match. Else, false will be rturned.</br>
73+
* perfectly match. Else, false will be returned.</br>
6774
* </br>
6875
* Examples:
6976
* <ul>
@@ -104,7 +111,7 @@ private MatchingUtils() {
104111
* Nil&lt;Supplier&lt;String&gt;&gt;() {}.getType())</li>
105112
* </ul>
106113
* <ul>
107-
* {@code <M extends Number>} can't be inferred as type {@code String} is
114+
* {@code <M extends Number>} can't be inferred, as type {@code String} is
108115
* not within the bounds of {@code M}.
109116
* </ul>
110117
* <ul>
@@ -117,8 +124,8 @@ private MatchingUtils() {
117124
* Nil&lt;Function&lt;Double, Integer&gt;&gt;() {}.getType())</li>
118125
* </ul>
119126
* <ul>
120-
* {@code <M extends Number>} can't be inferred as types
121-
* {@code Double, Integer} are ambiguous for the double usage of {@code M}.
127+
* {@code <M extends Number>} can't be inferred, as types {@code Double} and
128+
* {@code Integer} are ambiguous for {@code M}.
122129
* </ul>
123130
*
124131
* @param src
@@ -239,9 +246,9 @@ private static void inferTypeVariables(Type[] types, Type[] inferFrom, Map<TypeV
239246
// not require equality as one var is
240247
// bounded by another and it is not the same. E.g.
241248
// assume we want to infer the types of vars:
242-
// A extends Number, B extends A
249+
// - - - A extends Number, B extends A
243250
// From types:
244-
// Number, Double
251+
// - - - Number, Double
245252
// First A is bound to Number, next B to Double. Then we
246253
// check the bounds for B. We encounter A,
247254
// for which we already inferred Number. Hence, it

0 commit comments

Comments
 (0)