mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Adds support of some methods required by latest html4j. See
https://github.com/konsoletyper/teavm/issues/6
This commit is contained in:
parent
b63a6d203f
commit
8dada3b28c
2
pom.xml
2
pom.xml
|
@ -66,7 +66,7 @@
|
|||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<sonatypeOssDistMgmtSnapshotsUrl>https://oss.sonatype.org/content/repositories/snapshots/</sonatypeOssDistMgmtSnapshotsUrl>
|
||||
<html4j.version>0.7.5</html4j.version>
|
||||
<html4j.version>0.9</html4j.version>
|
||||
<jetty.version>9.2.1.v20140609</jetty.version>
|
||||
<slf4j.version>1.7.7</slf4j.version>
|
||||
</properties>
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright 2014 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.io;
|
||||
|
||||
import org.teavm.classlib.java.lang.TString;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev
|
||||
*/
|
||||
public class TEOFException extends TIOException {
|
||||
private static final long serialVersionUID = 3045477060413545010L;
|
||||
|
||||
public TEOFException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public TEOFException(TString message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
|
@ -163,4 +163,12 @@ public class TClass<T> extends TObject {
|
|||
@GeneratedBy(ClassNativeGenerator.class)
|
||||
@PluggableDependency(ClassNativeGenerator.class)
|
||||
public native TClass<?> getDeclaringClass();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <U> TClass<? extends U> asSubclass(TClass<U> clazz) {
|
||||
if (!clazz.isAssignableFrom(this)) {
|
||||
throw new TClassCastException();
|
||||
}
|
||||
return (TClass<? extends U>)this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,4 +77,8 @@ public class TThread extends TObject implements TRunnable {
|
|||
public long getId() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static boolean holdsLock(@SuppressWarnings("unused") TObject obj) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright 2014 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;
|
||||
|
||||
import org.teavm.classlib.java.lang.TObject;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev
|
||||
*/
|
||||
public abstract class TReference<T> extends TObject {
|
||||
public T get() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
}
|
||||
|
||||
public boolean isEnqueued() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean enqueue() {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright 2014 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 TWeakReference<T> extends TReference<T> {
|
||||
private T value;
|
||||
|
||||
public TWeakReference(T value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T get() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
value = null;
|
||||
}
|
||||
}
|
|
@ -105,7 +105,7 @@ public class JavaScriptBodyGenerator implements Generator {
|
|||
.append(Renderer.typeToClsString(naming, reader.parameterType(i))).append(")");
|
||||
}
|
||||
sb.append(")); })(");
|
||||
sb.append(ident == null ? "null, " : ident);
|
||||
sb.append(ident == null ? "null" : ident);
|
||||
return sb.toString();
|
||||
}
|
||||
private MethodReader findMethod(String clsName, MethodDescriptor desc) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user