Skip to content
Merged
Binary file modified sources/net.sf.j2s.core/dist/swingjs/SwingJS-site.zip
Binary file not shown.
Binary file modified sources/net.sf.j2s.core/dist/swingjs/net.sf.j2s.core.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.core/dist/swingjs/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20230202011832
20230216124208
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.3.1/SwingJS-site.zip
Binary file not shown.
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.3.1/net.sf.j2s.core.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.core/dist/swingjs/ver/3.3.1/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20230202011832
20230216124208
3 changes: 2 additions & 1 deletion sources/net.sf.j2s.core/src/net/sf/j2s/core/CorePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ public class CorePlugin extends Plugin {
* "net.sf.j2s.core.jar" not "net.sf.j2s.core.3.2.5"
*
*/
public static String VERSION = "3.3.1-v5";
public static String VERSION = "3.3.1-v6";

// if you change the x.x.x number, be sure to also indicate that in
// j2sApplet.js and also (Bob only) update.bat, update-clean.bat

// BH 2023.02.09 -- 3.3.1.v6 fixes j2s.excluded.paths needing /src/xxxx
// BH 2022.06.27 -- 3.3.1-v5 fixes missing method annotations
// BH 2022.01.17 -- 3.3.1-v4 fixes default interface methods referencing their own static fields
// BH 2021.01.14 -- 3.3.1-v3 fixes missing finals for nested () -> {...}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,13 @@ private void initializeUsing(File j2sFile, int level) {
}

boolean excludeFile(IFile javaSource) {
String filePath = javaSource.getFullPath().toString();
return excludeFile(javaSource.getFullPath().toString());
}

private boolean excludeFile(String filePath) {
if (lstExcludedPaths != null) {
for (int i = lstExcludedPaths.size(); --i >= 0;)
if (filePath.startsWith(lstExcludedPaths.get(i))) {
if (filePath.indexOf(lstExcludedPaths.get(i)) >= 0) {
return true;
}
}
Expand Down Expand Up @@ -746,6 +749,8 @@ private void copySiteResources(File from, File dest) {
private void copyNonclassFiles(File dir, File target) {
if (dir.equals(target))
return;
if (excludeFile(dir.getAbsolutePath().replace('\\','/') + "/"))
return;
File[] files = dir.listFiles(filter);
File f = null;
if (files != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
import org.eclipse.jdt.core.dom.WildcardType;

// TODO: superclass inheritance for JAXB XmlAccessorType
// TODO: Transpiler bug allows static String name, but JavaScript function().name is read-only and will be "clazz"

//BH 2022.01.17 -- 3.3.1-v4 fixes default interface methods referencing their own static fields
//BH 2021.01.14 -- 3.3.1-v3 fixes missing finals for nested () -> {...}
Expand Down
Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.
3 changes: 2 additions & 1 deletion sources/net.sf.j2s.java.core/src/java/awt/Container.java
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,8 @@ static class DropTargetEventTargetFilter implements EventTargetFilter {

private DropTargetEventTargetFilter() {}

public boolean accept(final Component comp) {
@Override
public boolean accept(final Component comp) {
DropTarget dt = comp.getDropTarget();
return dt != null && dt.isActive();
}
Expand Down
38 changes: 38 additions & 0 deletions sources/net.sf.j2s.java.core/src/java/util/Objects.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,44 @@ public static <T> T requireNonNull(T obj) {
return obj;
}

/**
* Returns the first argument if it is non-{@code null} and
* otherwise returns the non-{@code null} second argument.
*
* @param obj an object
* @param defaultObj a non-{@code null} object to return if the first argument
* is {@code null}
* @param <T> the type of the reference
* @return the first argument if it is non-{@code null} and
* otherwise the second argument if it is non-{@code null}
* @throws NullPointerException if both {@code obj} is null and
* {@code defaultObj} is {@code null}
* @since 9
*/
public static <T> T requireNonNullElse(T obj, T defaultObj) {
return (obj != null) ? obj : requireNonNull(defaultObj, "defaultObj");
}

/**
* Returns the first argument if it is non-{@code null} and otherwise
* returns the non-{@code null} value of {@code supplier.get()}.
*
* @param obj an object
* @param supplier of a non-{@code null} object to return if the first argument
* is {@code null}
* @param <T> the type of the first argument and return type
* @return the first argument if it is non-{@code null} and otherwise
* the value from {@code supplier.get()} if it is non-{@code null}
* @throws NullPointerException if both {@code obj} is null and
* either the {@code supplier} is {@code null} or
* the {@code supplier.get()} value is {@code null}
* @since 9
*/
public static <T> T requireNonNullElseGet(T obj, Supplier<? extends T> supplier) {
return (obj != null) ? obj
: requireNonNull(requireNonNull(supplier, "supplier").get(), "supplier.get()");
}

/**
* Checks that the specified object reference is not {@code null} and
* throws a customized {@link NullPointerException} if it is. This method
Expand Down
Loading