|
| 1 | +/* |
| 2 | + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | + * |
| 5 | + * This code is free software; you can redistribute it and/or modify it |
| 6 | + * under the terms of the GNU General Public License version 2 only, as |
| 7 | + * published by the Free Software Foundation. Oracle designates this |
| 8 | + * particular file as subject to the "Classpath" exception as provided |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. |
| 10 | + * |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that |
| 15 | + * accompanied this code). |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU General Public License version |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | + * |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
| 22 | + * or visit www.oracle.com if you need additional information or have any |
| 23 | + * questions. |
| 24 | + */ |
| 25 | + |
| 26 | +/* |
| 27 | + * DIFFBLUE MODEL LIBRARY |
| 28 | + * At the moment, the methods defined in this class are not called anywhere |
| 29 | + * because the classes that extend this class override each method without |
| 30 | + * calling methods from this class. |
| 31 | + * |
| 32 | + * This file is only present to maintain the original inheritance. However, it |
| 33 | + * would make sense to implement some of the modelled methods here instead of |
| 34 | + * in the StringBuilder and StringBuffer classes, in the case these methods |
| 35 | + * are modelled in a similar way. |
| 36 | + */ |
| 37 | + |
| 38 | +package java.lang; |
| 39 | + |
| 40 | +import org.cprover.CProver; |
| 41 | + |
| 42 | +abstract class AbstractStringBuilder implements Appendable, CharSequence { |
| 43 | + |
| 44 | + AbstractStringBuilder() {} |
| 45 | + |
| 46 | + AbstractStringBuilder(int capacity) {} |
| 47 | + |
| 48 | + @Override |
| 49 | + public int length() { |
| 50 | + return CProver.nondetInt(); |
| 51 | + } |
| 52 | + |
| 53 | + public int capacity() { |
| 54 | + CProver.notModelled(); |
| 55 | + return CProver.nondetInt(); |
| 56 | + } |
| 57 | + |
| 58 | + public void ensureCapacity(int minimumCapacity) {} |
| 59 | + |
| 60 | + public void trimToSize() {} |
| 61 | + |
| 62 | + public void setLength(int newLength) {} |
| 63 | + |
| 64 | + @Override |
| 65 | + public char charAt(int index) { |
| 66 | + return 'c'; |
| 67 | + } |
| 68 | + |
| 69 | + public int codePointAt(int index) { |
| 70 | + return CProver.nondetInt(); |
| 71 | + } |
| 72 | + |
| 73 | + public int codePointBefore(int index) { |
| 74 | + return CProver.nondetInt(); |
| 75 | + } |
| 76 | + |
| 77 | + public int codePointCount(int beginIndex, int endIndex) { |
| 78 | + return CProver.nondetInt(); |
| 79 | + } |
| 80 | + |
| 81 | + public int offsetByCodePoints(int index, int codePointOffset) { |
| 82 | + return CProver.nondetInt(); |
| 83 | + } |
| 84 | + |
| 85 | + public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) { |
| 86 | + CProver.notModelled(); |
| 87 | + } |
| 88 | + |
| 89 | + public void setCharAt(int index, char ch) {} |
| 90 | + |
| 91 | + public AbstractStringBuilder append(Object obj) { |
| 92 | + return CProver.nondetWithNullForNotModelled(); |
| 93 | + } |
| 94 | + |
| 95 | + public AbstractStringBuilder append(String str) { |
| 96 | + return CProver.nondetWithNullForNotModelled(); |
| 97 | + } |
| 98 | + |
| 99 | + public AbstractStringBuilder append(StringBuffer sb) { |
| 100 | + return CProver.nondetWithNullForNotModelled(); |
| 101 | + } |
| 102 | + |
| 103 | + AbstractStringBuilder append(AbstractStringBuilder asb) { |
| 104 | + return CProver.nondetWithNullForNotModelled(); |
| 105 | + } |
| 106 | + |
| 107 | + @Override |
| 108 | + public AbstractStringBuilder append(CharSequence s) { |
| 109 | + return CProver.nondetWithNullForNotModelled(); |
| 110 | + } |
| 111 | + |
| 112 | + @Override |
| 113 | + public AbstractStringBuilder append(CharSequence s, int start, int end) { |
| 114 | + return CProver.nondetWithNullForNotModelled(); |
| 115 | + } |
| 116 | + |
| 117 | + public AbstractStringBuilder append(char[] str) { |
| 118 | + return CProver.nondetWithNullForNotModelled(); |
| 119 | + } |
| 120 | + |
| 121 | + public AbstractStringBuilder append(char str[], int offset, int len) { |
| 122 | + return CProver.nondetWithNullForNotModelled(); |
| 123 | + } |
| 124 | + |
| 125 | + public AbstractStringBuilder append(boolean b) { |
| 126 | + return CProver.nondetWithNullForNotModelled(); |
| 127 | + } |
| 128 | + |
| 129 | + @Override |
| 130 | + public AbstractStringBuilder append(char c) { |
| 131 | + return CProver.nondetWithNullForNotModelled(); |
| 132 | + } |
| 133 | + |
| 134 | + public AbstractStringBuilder append(int i) { |
| 135 | + return CProver.nondetWithNullForNotModelled(); |
| 136 | + } |
| 137 | + |
| 138 | + public AbstractStringBuilder append(long l) { |
| 139 | + return CProver.nondetWithNullForNotModelled(); |
| 140 | + } |
| 141 | + |
| 142 | + public AbstractStringBuilder append(float f) { |
| 143 | + return CProver.nondetWithNullForNotModelled(); |
| 144 | + } |
| 145 | + |
| 146 | + public AbstractStringBuilder append(double d) { |
| 147 | + return CProver.nondetWithNullForNotModelled(); |
| 148 | + } |
| 149 | + |
| 150 | + public AbstractStringBuilder delete(int start, int end) { |
| 151 | + return CProver.nondetWithNullForNotModelled(); |
| 152 | + } |
| 153 | + |
| 154 | + public AbstractStringBuilder appendCodePoint(int codePoint) { |
| 155 | + return CProver.nondetWithNullForNotModelled(); |
| 156 | + } |
| 157 | + |
| 158 | + public AbstractStringBuilder deleteCharAt(int index) { |
| 159 | + return CProver.nondetWithNullForNotModelled(); |
| 160 | + } |
| 161 | + |
| 162 | + public AbstractStringBuilder replace(int start, int end, String str) { |
| 163 | + return CProver.nondetWithNullForNotModelled(); |
| 164 | + } |
| 165 | + |
| 166 | + public String substring(int start) { |
| 167 | + return CProver.nondetWithNullForNotModelled(); |
| 168 | + } |
| 169 | + |
| 170 | + @Override |
| 171 | + public CharSequence subSequence(int start, int end) { |
| 172 | + return CProver.nondetWithNullForNotModelled(); |
| 173 | + } |
| 174 | + |
| 175 | + public String substring(int start, int end) { |
| 176 | + return CProver.nondetWithNullForNotModelled(); |
| 177 | + } |
| 178 | + |
| 179 | + public AbstractStringBuilder insert(int index, char[] str, int offset, |
| 180 | + int len) { |
| 181 | + return CProver.nondetWithNullForNotModelled(); |
| 182 | + } |
| 183 | + |
| 184 | + public AbstractStringBuilder insert(int offset, Object obj) { |
| 185 | + return CProver.nondetWithNullForNotModelled(); |
| 186 | + } |
| 187 | + |
| 188 | + public AbstractStringBuilder insert(int offset, String str) { |
| 189 | + return CProver.nondetWithNullForNotModelled(); |
| 190 | + } |
| 191 | + |
| 192 | + public AbstractStringBuilder insert(int offset, char[] str) { |
| 193 | + return CProver.nondetWithNullForNotModelled(); |
| 194 | + } |
| 195 | + |
| 196 | + public AbstractStringBuilder insert(int dstOffset, CharSequence s) { |
| 197 | + return CProver.nondetWithNullForNotModelled(); |
| 198 | + } |
| 199 | + |
| 200 | + public AbstractStringBuilder insert(int dstOffset, CharSequence s, |
| 201 | + int start, int end) { |
| 202 | + return CProver.nondetWithNullForNotModelled(); |
| 203 | + } |
| 204 | + |
| 205 | + public AbstractStringBuilder insert(int offset, boolean b) { |
| 206 | + return CProver.nondetWithNullForNotModelled(); |
| 207 | + } |
| 208 | + |
| 209 | + public AbstractStringBuilder insert(int offset, char c) { |
| 210 | + return CProver.nondetWithNullForNotModelled(); |
| 211 | + } |
| 212 | + |
| 213 | + public AbstractStringBuilder insert(int offset, int i) { |
| 214 | + return CProver.nondetWithNullForNotModelled(); |
| 215 | + } |
| 216 | + |
| 217 | + public AbstractStringBuilder insert(int offset, long l) { |
| 218 | + return CProver.nondetWithNullForNotModelled(); |
| 219 | + } |
| 220 | + |
| 221 | + public AbstractStringBuilder insert(int offset, float f) { |
| 222 | + return CProver.nondetWithNullForNotModelled(); |
| 223 | + } |
| 224 | + |
| 225 | + public AbstractStringBuilder insert(int offset, double d) { |
| 226 | + return CProver.nondetWithNullForNotModelled(); |
| 227 | + } |
| 228 | + |
| 229 | + public int indexOf(String str) { |
| 230 | + return CProver.nondetInt(); |
| 231 | + } |
| 232 | + |
| 233 | + public int indexOf(String str, int fromIndex) { |
| 234 | + return CProver.nondetInt(); |
| 235 | + } |
| 236 | + |
| 237 | + public int lastIndexOf(String str) { |
| 238 | + return CProver.nondetInt(); |
| 239 | + } |
| 240 | + |
| 241 | + public int lastIndexOf(String str, int fromIndex) { |
| 242 | + return CProver.nondetInt(); |
| 243 | + } |
| 244 | + |
| 245 | + public AbstractStringBuilder reverse() { |
| 246 | + return CProver.nondetWithNullForNotModelled(); |
| 247 | + } |
| 248 | + |
| 249 | + @Override |
| 250 | + public abstract String toString(); |
| 251 | + |
| 252 | + // Method should not be used in the models |
| 253 | + // final char[] getValue(); |
| 254 | +} |
0 commit comments