Skip to content

Commit 93eceb5

Browse files
committed
Merge pull request ReactiveX#3415 from abersnaze/SubjectDeprecation
pull back the Experimental/Beta of the changes until 1.1.x (+1 squashed commit)
2 parents 241e154 + 0167e0e commit 93eceb5

File tree

5 files changed

+74
-0
lines changed

5 files changed

+74
-0
lines changed

src/main/java/rx/subjects/AsyncSubject.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ public Throwable getThrowable() {
203203
}
204204
@Override
205205
@Experimental
206+
@Deprecated
206207
@SuppressWarnings("unchecked")
207208
public T[] getValues(T[] a) {
208209
Object v = lastValue;

src/main/java/rx/subjects/PublishSubject.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,23 +155,44 @@ public Throwable getThrowable() {
155155
return null;
156156
}
157157

158+
/**
159+
* {@inheritDoc}
160+
* @deprecated this method is scheduled to be removed in the next release
161+
*/
158162
@Override
159163
@Experimental
164+
@Deprecated
160165
public boolean hasValue() {
161166
return false;
162167
}
168+
169+
/**
170+
* {@inheritDoc}
171+
* @deprecated this method is scheduled to be removed in the next release
172+
*/
163173
@Override
164174
@Experimental
175+
@Deprecated
165176
public T getValue() {
166177
return null;
167178
}
179+
/**
180+
* {@inheritDoc}
181+
* @deprecated this method is scheduled to be removed in the next release
182+
*/
168183
@Override
169184
@Experimental
185+
@Deprecated
170186
public Object[] getValues() {
171187
return new Object[0];
172188
}
189+
/**
190+
* {@inheritDoc}
191+
* @deprecated this method is scheduled to be removed in the next release
192+
*/
173193
@Override
174194
@Experimental
195+
@Deprecated
175196
public T[] getValues(T[] a) {
176197
if (a.length > 0) {
177198
a[0] = null;

src/main/java/rx/subjects/ReplaySubject.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,9 @@ public boolean hasValue() {
11621162
public T[] getValues(T[] a) {
11631163
return state.toArray(a);
11641164
}
1165+
11651166
@Override
1167+
@Experimental
11661168
public T getValue() {
11671169
return state.latest();
11681170
}

src/main/java/rx/subjects/SerializedSubject.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,38 +69,74 @@ public void onNext(T t) {
6969
public boolean hasObservers() {
7070
return actual.hasObservers();
7171
}
72+
73+
/**
74+
* {@inheritDoc}
75+
* @deprecated this method is scheduled to be removed in the next release
76+
*/
7277
@Override
7378
@Experimental
79+
@Deprecated
7480
public boolean hasCompleted() {
7581
return actual.hasCompleted();
7682
}
83+
/**
84+
* {@inheritDoc}
85+
* @deprecated this method is scheduled to be removed in the next release
86+
*/
7787
@Override
7888
@Experimental
89+
@Deprecated
7990
public boolean hasThrowable() {
8091
return actual.hasThrowable();
8192
}
93+
/**
94+
* {@inheritDoc}
95+
* @deprecated this method is scheduled to be removed in the next release
96+
*/
8297
@Override
8398
@Experimental
99+
@Deprecated
84100
public boolean hasValue() {
85101
return actual.hasValue();
86102
}
103+
/**
104+
* {@inheritDoc}
105+
* @deprecated this method is scheduled to be removed in the next release
106+
*/
87107
@Override
88108
@Experimental
109+
@Deprecated
89110
public Throwable getThrowable() {
90111
return actual.getThrowable();
91112
}
113+
/**
114+
* {@inheritDoc}
115+
* @deprecated this method is scheduled to be removed in the next release
116+
*/
92117
@Override
93118
@Experimental
119+
@Deprecated
94120
public T getValue() {
95121
return actual.getValue();
96122
}
123+
/**
124+
* {@inheritDoc}
125+
* @deprecated this method is scheduled to be removed in the next release
126+
*/
97127
@Override
98128
@Experimental
129+
@Deprecated
99130
public Object[] getValues() {
100131
return actual.getValues();
101132
}
133+
/**
134+
* {@inheritDoc}
135+
* @deprecated this method is scheduled to be removed in the next release
136+
*/
102137
@Override
103138
@Experimental
139+
@Deprecated
104140
public T[] getValues(T[] a) {
105141
return actual.getValues(a);
106142
}

src/main/java/rx/subjects/Subject.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ public final SerializedSubject<T, R> toSerialized() {
6464
*
6565
* @return {@code true} if the subject has received a throwable through {@code onError}.
6666
* @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
67+
* @deprecated this method will be moved to each Subject class individually in the next release
6768
*/
6869
@Experimental
70+
@Deprecated
6971
public boolean hasThrowable() {
7072
throw new UnsupportedOperationException();
7173
}
@@ -75,8 +77,10 @@ public boolean hasThrowable() {
7577
*
7678
* @return {@code true} if the subject completed normally via {@code onCompleted}
7779
* @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
80+
* @deprecated this method will be moved to each Subject class individually in the next release
7881
*/
7982
@Experimental
83+
@Deprecated
8084
public boolean hasCompleted() {
8185
throw new UnsupportedOperationException();
8286
}
@@ -87,8 +91,10 @@ public boolean hasCompleted() {
8791
* @return the Throwable that terminated the Subject or {@code null} if the subject hasn't terminated yet or
8892
* if it terminated normally.
8993
* @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
94+
* @deprecated this method will be moved to each Subject class individually in the next release
9095
*/
9196
@Experimental
97+
@Deprecated
9298
public Throwable getThrowable() {
9399
throw new UnsupportedOperationException();
94100
}
@@ -101,8 +107,10 @@ public Throwable getThrowable() {
101107
*
102108
* @return {@code true} if and only if the subject has some value but not an error
103109
* @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
110+
* @deprecated this method will be moved to each Subject class individually in the next release
104111
*/
105112
@Experimental
113+
@Deprecated
106114
public boolean hasValue() {
107115
throw new UnsupportedOperationException();
108116
}
@@ -117,8 +125,10 @@ public boolean hasValue() {
117125
* @return the current value or {@code null} if the Subject doesn't have a value, has terminated with an
118126
* exception or has an actual {@code null} as a value.
119127
* @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
128+
* @deprecated this method will be moved to each Subject class individually in the next release
120129
*/
121130
@Experimental
131+
@Deprecated
122132
public T getValue() {
123133
throw new UnsupportedOperationException();
124134
}
@@ -130,9 +140,11 @@ public T getValue() {
130140
*
131141
* @return a snapshot of the currently buffered non-terminal events.
132142
* @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
143+
* @deprecated this method will be moved to each Subject class individually in the next release
133144
*/
134145
@SuppressWarnings("unchecked")
135146
@Experimental
147+
@Deprecated
136148
public Object[] getValues() {
137149
T[] r = getValues((T[])EMPTY_ARRAY);
138150
if (r == EMPTY_ARRAY) {
@@ -152,8 +164,10 @@ public Object[] getValues() {
152164
* @param a the array to fill in
153165
* @return the array {@code a} if it had enough capacity or a new array containing the available values
154166
* @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
167+
* @deprecated this method will be moved to each Subject class individually in the next release
155168
*/
156169
@Experimental
170+
@Deprecated
157171
public T[] getValues(T[] a) {
158172
throw new UnsupportedOperationException();
159173
}

0 commit comments

Comments
 (0)