Skip to content

Commit 7a9f3d9

Browse files
committed
Document version deprecated for toJavaArray methods. Fix functionaljava#264
Also suppress unchecked warnings (functionaljava#269) for them.
1 parent bcc0b71 commit 7a9f3d9

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

core/src/main/java/fj/data/Array.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ public Object[] array() {
135135
* affectation of the result of this method to a non generic array
136136
* will result in runtime error (ClassCastException).
137137
*
138-
* @deprecated use {@link #array(Class)}
138+
* @deprecated As of release 4.6, use {@link #array(Class)}.
139139
*/
140+
@SuppressWarnings("unchecked")
140141
@Deprecated
141142
public A[] toJavaArray() {
142143
return (A[]) array();

core/src/main/java/fj/data/List.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,9 @@ public final Object[] toArrayObject() {
216216
* affectation of the result of this method to a non generic array
217217
* will result in runtime error (ClassCastException).
218218
*
219-
* @deprecated use {@link #array(Class)}
219+
* @deprecated As of release 4.6, use {@link #array(Class)}.
220220
*/
221+
@SuppressWarnings("unchecked")
221222
@Deprecated
222223
public final A[] toJavaArray() {
223224
return (A[]) toArrayObject();

core/src/main/java/fj/data/Stream.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,10 +922,11 @@ public final Option<A> toOption() {
922922
* affectation of the result of this method to a non generic array
923923
* will result in runtime error (ClassCastException).
924924
*
925-
* @deprecated use {@link #array(Class)}
925+
* @deprecated As of release 4.6, use {@link #array(Class)}.
926926
*/
927927
@Deprecated
928928
public final A[] toJavaArray() {
929+
@SuppressWarnings("unchecked")
929930
final A[] array = (A[]) new Object[length()];
930931
int i = 0;
931932
for (A a: this) {

0 commit comments

Comments
 (0)