blob: e4aa6b8949bf2e6c8f3c851740ed2c0352fb2bab [file] [log] [blame]
Mathieu Chartier05aa4d32015-09-19 12:44:38 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// Simple class that holds a static int for testing that class unloading works
18// and re-runs the class initializer.
19public class IntHolder {
20 private static int value = 1;
21
22 public static void setValue(int newValue) {
23 value = newValue;
24 }
25
26 public static int getValue() {
27 return value;
28 }
29
30 public static void runGC() {
31 Runtime.getRuntime().gc();
32 }
Mathieu Chartier598302a2015-09-23 14:52:39 -070033
34 public static void loadLibrary(String name) {
35 System.loadLibrary(name);
36 }
Mathieu Chartiera50f9cf2015-09-25 11:34:45 -070037
38 public static native void waitForCompilation();
Mathieu Chartier05aa4d32015-09-19 12:44:38 -070039}