import java.util.*;
import java.util.zip.*;
import java.util.List;
import java.util.regex.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.concurrent.locks.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.table.*;
import java.io.*;
import java.net.*;
import java.lang.reflect.*;
import java.lang.ref.*;
import java.lang.management.*;
import java.security.*;
import java.security.spec.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.imageio.*;
import java.math.*;
import javax.swing.border.*;
import java.nio.file.Path;
import java.awt.datatransfer.StringSelection;
import javax.swing.event.AncestorListener;
import javax.swing.event.AncestorEvent;
import javax.swing.Timer;
import java.text.*;
import java.text.NumberFormat;
import javax.swing.undo.UndoManager;
import java.nio.charset.Charset;
import javax.imageio.metadata.*;
import javax.imageio.stream.*;
import java.text.SimpleDateFormat;
import java.util.TimeZone;
import java.awt.geom.*;
class main {
static class CC extends Concept {
String a, b;
}
static class AModule extends DynPrintLog {
void start() { try { super.start(); startThread("Start", new Runnable() { public void run() { try { AutoCloseable __1 = enter(); try { try {
CC cc = cnew(CC.class, "a" , "hello", "b" , "world");
ConceptFieldIndex < CC , String > index = new ConceptFieldIndex<>(mainConcepts, CC.class, "a");
assertEquals("world", index.get("hello").b);
assertNull(index.get("Hello"));
cset(cc, "a" , "yo");
assertNull(index.get("hello"));
assertEquals("world", index.get("yo").b);
print("testing findConceptWhere");
assertEquals(cc, findConceptWhereCI(CC.class, "a" , "yo"));
assertNull(findConceptWhereCI(CC.class, "a" , "x"));
print("testing delete");
cc.delete();
assertNull(index.get("yo"));
cc = cnew(CC.class, "a" , "another", "b" , "test");
assertEquals("test", index.get("another").b);
// Test null values
print("testing null");
cc = cnew(CC.class, "a" , null, "b" , "nullie");
assertEquals(cc, index.get(null));
print("testing not null anymore");
cset(cc, "a" , "x");
assertEquals(cc, index.get("x"));
assertNull(index.get(null));
print("OK");
} catch (Throwable __e) { _handleException(__e); }} finally { _close(__1); }
} catch (Exception __e) { throw rethrow(__e); } } public String toString() { return "AutoCloseable __1 = enter(); try { try {\r\n CC cc = cnew(CC, \"a\" , \"hello\",..."; }});} catch (Exception __e) { throw rethrow(__e); } }
}
static boolean _moduleClass_AModule = true;
static Thread startThread(Object runnable) {
return startThread(defaultThreadName(), runnable);
}
static Thread startThread(String name, Object runnable) {
runnable = wrapAsActivity(runnable);
return startThread(newThread(toRunnable(runnable), name));
}
static Thread startThread(Thread t) {
_registerThread(t);
t.start();
return t;
}
static Concept cnew(String name, Object... values) {
return cnew(db_mainConcepts(), name, values);
}
static Concept cnew(Concepts concepts, String name, Object... values) {
Class extends Concept> cc = findClass(name);
concepts_unlisted.set(true);
Concept c;
try {
c = cc != null ? nuObject(cc) : new Concept(name);
} finally {
concepts_unlisted.set(null);
}
concepts.register(c);
csetAll(c, values);
return c;
}
static A cnew(Class cc, Object... values) {
return cnew(db_mainConcepts(), cc, values);
}
static A cnew(Concepts concepts, Class cc, Object... values) {
concepts_unlisted.set(true);
A c;
try {
c = nuObject(cc);
} finally {
concepts_unlisted.set(null);
}
concepts.register(c);
csetAll(c, values);
return c;
}
static A assertEquals(Object x, A y) {
return assertEquals(null, x, y);
}
static A assertEquals(String msg, Object x, A y) {
if (assertVerbose()) return assertEqualsVerbose(msg, x, y);
if (!(x == null ? y == null : x.equals(y)))
throw fail((msg != null ? msg + ": " : "") + y + " != " + x);
return y;
}
static A assertNull(A a) {
assertTrue(a == null);
return a;
}
static A assertNull(String msg, A a) {
assertTrue(msg, a == null);
return a;
}
// returns number of changes
static int cset(Concept c, Object... values) { try {
if (c == null) return 0;
warnIfOddCount(values = expandParams(c.getClass(), values));
int changes = 0;
for (int i = 0; i+1 < l(values); i += 2)
if (_csetField(c, (String) values[i], values[i+1])) ++changes;
return changes;
} catch (Exception __e) { throw rethrow(__e); } }
static int cset(Iterable extends Concept> l, Object... values) {
int changes = 0;
for (Concept c : unnull(l))
changes += cset(c, values);
return changes;
}
static int cset(Concept.Ref c, Object... values) {
return cset(getVar(c), values);
}
static volatile StringBuffer local_log = new StringBuffer(); // not redirected
static volatile Appendable print_log = local_log; // might be redirected, e.g. to main bot
// in bytes - will cut to half that
static volatile int print_log_max = 1024*1024;
static volatile int local_log_max = 100*1024;
static boolean print_silent = false; // total mute if set
static Object print_byThread_lock = new Object();
static volatile ThreadLocal