From bacd02d8a71288a066051e10862491eee4604e66 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sun, 1 Mar 2015 11:25:42 +0300 Subject: [PATCH] Add some JDK classes needed to support DukeScript --- .../java/lang/ref/TReferenceQueue.java | 26 +++++++++++++++++++ .../java/lang/ref/TWeakReference.java | 4 +++ 2 files changed, 30 insertions(+) create mode 100644 teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ref/TReferenceQueue.java diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ref/TReferenceQueue.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ref/TReferenceQueue.java new file mode 100644 index 000000000..e3b50ce9d --- /dev/null +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ref/TReferenceQueue.java @@ -0,0 +1,26 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.classlib.java.lang.ref; + +/** + * + * @author Alexey Andreev + */ +public class TReferenceQueue { + public TReference poll() { + return null; + } +} diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ref/TWeakReference.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ref/TWeakReference.java index d91c55dd6..b14232f8f 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ref/TWeakReference.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/ref/TWeakReference.java @@ -26,6 +26,10 @@ public class TWeakReference extends TReference { this.value = value; } + public TWeakReference(T value, @SuppressWarnings("unused") TReferenceQueue queue) { + this.value = value; + } + @Override public T get() { return value;