3535import org .checkerframework .common .aliasing .qual .Unique ;
3636import org .checkerframework .dataflow .qual .Pure ;
3737import org .checkerframework .dataflow .qual .SideEffectFree ;
38+ import org .checkerframework .dataflow .qual .SideEffectsOnly ;
3839import org .checkerframework .framework .qual .AnnotatedFor ;
3940
4041import java .io .IOException ;
@@ -208,6 +209,7 @@ public final class StringBuffer
208209 *
209210 * @since 11
210211 */
212+ @ SideEffectFree
211213 @ Override
212214 public synchronized int compareTo (StringBuffer another ) {
213215 return super .compareTo (another );
@@ -219,6 +221,7 @@ public synchronized int compareTo(StringBuffer another) {
219221 return count ;
220222 }
221223
224+ @ Pure
222225 @ Override
223226 public synchronized @ NonNegative int capacity () {
224227 return super .capacity ();
@@ -252,6 +255,7 @@ public synchronized void setLength(@NonNegative int newLength) {
252255 * @throws IndexOutOfBoundsException {@inheritDoc}
253256 * @see #length()
254257 */
258+ @ Pure
255259 @ Override
256260 public synchronized char charAt (int index ) {
257261 return super .charAt (index );
@@ -261,6 +265,7 @@ public synchronized char charAt(int index) {
261265 * @throws IndexOutOfBoundsException {@inheritDoc}
262266 * @since 1.5
263267 */
268+ @ Pure
264269 @ Override
265270 public synchronized int codePointAt (int index ) {
266271 return super .codePointAt (index );
@@ -270,6 +275,7 @@ public synchronized int codePointAt(int index) {
270275 * @throws IndexOutOfBoundsException {@inheritDoc}
271276 * @since 1.5
272277 */
278+ @ Pure
273279 @ Override
274280 public synchronized int codePointBefore (int index ) {
275281 return super .codePointBefore (index );
@@ -279,6 +285,7 @@ public synchronized int codePointBefore(int index) {
279285 * @throws IndexOutOfBoundsException {@inheritDoc}
280286 * @since 1.5
281287 */
288+ @ Pure
282289 @ Override
283290 public synchronized int codePointCount (int beginIndex , int endIndex ) {
284291 return super .codePointCount (beginIndex , endIndex );
@@ -288,6 +295,7 @@ public synchronized int codePointCount(int beginIndex, int endIndex) {
288295 * @throws IndexOutOfBoundsException {@inheritDoc}
289296 * @since 1.5
290297 */
298+ @ Pure
291299 @ Override
292300 public synchronized int offsetByCodePoints (int index , int codePointOffset ) {
293301 return super .offsetByCodePoints (index , codePointOffset );
@@ -296,6 +304,7 @@ public synchronized int offsetByCodePoints(int index, int codePointOffset) {
296304 /**
297305 * @throws IndexOutOfBoundsException {@inheritDoc}
298306 */
307+ @ SideEffectsOnly ("#3" )
299308 @ Override
300309 public synchronized void getChars (int srcBegin , int srcEnd , char [] dst ,
301310 @ IndexOrHigh ({"#3" }) int dstBegin )
@@ -516,6 +525,7 @@ public synchronized StringBuffer replace(int start, int end, String str) {
516525 * @throws StringIndexOutOfBoundsException {@inheritDoc}
517526 * @since 1.2
518527 */
528+ @ SideEffectFree
519529 @ Override
520530 public synchronized String substring (int start ) {
521531 return substring (start , count );
@@ -525,6 +535,7 @@ public synchronized String substring(int start) {
525535 * @throws IndexOutOfBoundsException {@inheritDoc}
526536 * @since 1.4
527537 */
538+ @ SideEffectFree
528539 @ Override
529540 public synchronized CharSequence subSequence (int start , int end ) {
530541 return super .substring (start , end );
@@ -534,6 +545,7 @@ public synchronized CharSequence subSequence(int start, int end) {
534545 * @throws StringIndexOutOfBoundsException {@inheritDoc}
535546 * @since 1.2
536547 */
548+ @ SideEffectFree
537549 @ Override
538550 public synchronized String substring (int start , int end ) {
539551 return super .substring (start , end );
@@ -749,6 +761,7 @@ public synchronized StringBuffer repeat(CharSequence cs, int count) {
749761 return this ;
750762 }
751763
764+ @ SideEffectFree
752765 @ Override
753766 @ IntrinsicCandidate
754767 public synchronized String toString (@ GuardSatisfied StringBuffer this ) {
0 commit comments