Skip to content

Commit 5fd9020

Browse files
More core models
Adds the models required for the Java benchmarks used in the CAV'18 paper and proposed for the SV-COMP'19 Java category.
1 parent 11d01e9 commit 5fd9020

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+17439
-2064
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* Copyright (c) 1994, 2008, 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+
package java.lang;
27+
28+
/**
29+
* Thrown when an application tries to call an abstract method.
30+
* Normally, this error is caught by the compiler; this error can
31+
* only occur at run time if the definition of some class has
32+
* incompatibly changed since the currently executing method was last
33+
* compiled.
34+
*
35+
* @author unascribed
36+
* @since JDK1.0
37+
*/
38+
public
39+
class AbstractMethodError extends IncompatibleClassChangeError {
40+
private static final long serialVersionUID = -1654391082989018462L;
41+
42+
/**
43+
* Constructs an <code>AbstractMethodError</code> with no detail message.
44+
*/
45+
public AbstractMethodError() {
46+
super();
47+
}
48+
49+
/**
50+
* Constructs an <code>AbstractMethodError</code> with the specified
51+
* detail message.
52+
*
53+
* @param s the detail message.
54+
*/
55+
public AbstractMethodError(String s) {
56+
super(s);
57+
}
58+
59+
// DIFFBLUE MODEL LIBRARY
60+
// While Object.getClass() is not modelled, we can get the same
61+
// functionality by adding one toString() method per subclass of
62+
// Throwable.
63+
@Override
64+
public String toString() {
65+
String message = getLocalizedMessage();
66+
return (message != null)
67+
? ("java.lang.AbstractMethodError: " + message)
68+
: "java.lang.AbstractMethodError";
69+
}
70+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright (c) 1994, 2011, 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+
package java.lang;
27+
28+
public class ArithmeticException extends RuntimeException {
29+
private static final long serialVersionUID = 2256477558314496007L;
30+
31+
public ArithmeticException() {
32+
super();
33+
}
34+
35+
public ArithmeticException(String s) {
36+
super(s);
37+
}
38+
39+
// DIFFBLUE MODEL LIBRARY
40+
// While Object.getClass() is not modelled, we can get the same
41+
// functionality by adding one toString() method per subclass of
42+
// Throwable.
43+
@Override
44+
public String toString() {
45+
String message = getLocalizedMessage();
46+
return (message != null)
47+
? ("java.lang.ArithmeticException: " + message)
48+
: "java.lang.ArithmeticException";
49+
}
50+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright (c) 1994, 2008, 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+
package java.lang;
27+
28+
public
29+
class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException {
30+
private static final long serialVersionUID = -5116101128118950844L;
31+
32+
public ArrayIndexOutOfBoundsException() {
33+
super();
34+
}
35+
36+
public ArrayIndexOutOfBoundsException(int index) {
37+
super("Array index out of range: " + index);
38+
}
39+
40+
public ArrayIndexOutOfBoundsException(String s) {
41+
super(s);
42+
}
43+
44+
// DIFFBLUE MODEL LIBRARY
45+
// While Object.getClass() is not modelled, we can get the same
46+
// functionality by adding one toString() method per subclass of
47+
// Throwable.
48+
@Override
49+
public String toString() {
50+
String message = getLocalizedMessage();
51+
return (message != null)
52+
? ("java.lang.ArrayIndexOutOfBoundsException: " + message)
53+
: "java.lang.ArrayIndexOutOfBoundsException";
54+
}
55+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (c) 1995, 2013, 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+
package java.lang;
27+
28+
public
29+
class ArrayStoreException extends RuntimeException {
30+
private static final long serialVersionUID = -4522193890499838241L;
31+
32+
public ArrayStoreException() {
33+
super();
34+
}
35+
36+
public ArrayStoreException(String s) {
37+
super(s);
38+
}
39+
40+
// DIFFBLUE MODEL LIBRARY
41+
// While Object.getClass() is not modelled, we can get the same
42+
// functionality by adding one toString() method per subclass of
43+
// Throwable.
44+
@Override
45+
public String toString() {
46+
String message = getLocalizedMessage();
47+
return (message != null)
48+
? ("java.lang.ArrayStoreException: " + message)
49+
: "java.lang.ArrayStoreException";
50+
}
51+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* Copyright (c) 2008, 2011, 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+
package java.lang;
27+
28+
/**
29+
* Thrown to indicate that an {@code invokedynamic} instruction has
30+
* failed to find its bootstrap method,
31+
* or the bootstrap method has failed to provide a
32+
* {@linkplain java.lang.invoke.CallSite call site} with a {@linkplain java.lang.invoke.CallSite#getTarget target}
33+
* of the correct {@linkplain java.lang.invoke.MethodHandle#type method type}.
34+
*
35+
* @author John Rose, JSR 292 EG
36+
* @since 1.7
37+
*/
38+
public class BootstrapMethodError extends LinkageError {
39+
private static final long serialVersionUID = 292L;
40+
41+
/**
42+
* Constructs a {@code BootstrapMethodError} with no detail message.
43+
*/
44+
public BootstrapMethodError() {
45+
super();
46+
}
47+
48+
/**
49+
* Constructs a {@code BootstrapMethodError} with the specified
50+
* detail message.
51+
*
52+
* @param s the detail message.
53+
*/
54+
public BootstrapMethodError(String s) {
55+
super(s);
56+
}
57+
58+
/**
59+
* Constructs a {@code BootstrapMethodError} with the specified
60+
* detail message and cause.
61+
*
62+
* @param s the detail message.
63+
* @param cause the cause, may be {@code null}.
64+
*/
65+
public BootstrapMethodError(String s, Throwable cause) {
66+
super(s, cause);
67+
}
68+
69+
/**
70+
* Constructs a {@code BootstrapMethodError} with the specified
71+
* cause.
72+
*
73+
* @param cause the cause, may be {@code null}.
74+
*/
75+
public BootstrapMethodError(Throwable cause) {
76+
// cf. Throwable(Throwable cause) constructor.
77+
super(cause == null ? null : cause.toString());
78+
initCause(cause);
79+
}
80+
81+
// DIFFBLUE MODEL LIBRARY
82+
// While Object.getClass() is not modelled, we can get the same
83+
// functionality by adding one toString() method per subclass of
84+
// Throwable.
85+
@Override
86+
public String toString() {
87+
String message = getLocalizedMessage();
88+
return (message != null)
89+
? ("java.lang.BootstrapMethodError: " + message)
90+
: "java.lang.BootstrapMethodError";
91+
}
92+
}

0 commit comments

Comments
 (0)