Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demonstrating error with time #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ jar {

artifacts {
archives jar
archives javadocJar
//this fails with many errors & warnings using gradle 2.2.1
//archives javadocJar
archives sourcesJar
}

Expand Down
Binary file added data/gdb/TestCrash.gdb/a00000001.TablesByName.atx
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000001.gdbindexes
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000001.gdbtable
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000001.gdbtablx
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000002.gdbtable
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000002.gdbtablx
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000003.gdbindexes
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000003.gdbtable
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000003.gdbtablx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000004.FDO_UUID.atx
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000004.freelist
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000004.gdbindexes
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000004.gdbtable
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000004.gdbtablx
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000004.spx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000005.gdbindexes
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000005.gdbtable
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000005.gdbtablx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000006.FDO_UUID.atx
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000006.gdbindexes
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000006.gdbtable
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000006.gdbtablx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000007.gdbindexes
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000007.gdbtable
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000007.gdbtablx
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000009.gdbindexes
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000009.gdbtable
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000009.gdbtablx
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a00000009.spx
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a0000000a.gdbindexes
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a0000000a.gdbtable
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a0000000a.gdbtablx
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/a0000000a.spx
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/gdb
Binary file not shown.
Binary file added data/gdb/TestCrash.gdb/timestamps
Binary file not shown.
5 changes: 3 additions & 2 deletions filegdb/filegdb/row.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ JNIEXPORT jobjectArray JNICALL Java_org_opensextant_giscore_filegdb_Row_getAttrA
int count;
fieldInfo->GetFieldCount(count);
jclass oclass = me.findClass("java.lang.Object");
jclass calclass = me.findClass("java.util.GregorianCalendar");
jclass calclass = me.findClass("java.util.Calendar");
jmethodID ccgetinstance = env->GetStaticMethodID(calclass, "getInstance", "()Ljava/util/Calendar;");
jmethodID ccsetTime = me.getMethod(calclass, "setTimeInMillis", "(J)V");
jobjectArray rval = env->NewObjectArray(count * 2, oclass, 0L);
int ptr = 0;
Expand Down Expand Up @@ -361,7 +362,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_opensextant_giscore_filegdb_Row_getAttrA
tm date;
row->GetDate(fieldName, date);
time_t dtm = mktime(&date);
jobject cal = env->AllocObject(calclass);
jobject cal = env->CallStaticObjectMethod(calclass, ccgetinstance);
env->CallVoidMethod(cal, ccsetTime, me.newLong(1000 * dtm));
val = cal;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ private static LinearRing makeRing(int count, double radius, double xoffset, dou

@Test
public void testReadFeatureGdb() throws IOException {
File path = new File("data/gdb/ftest1.gdb");
readGdb("data/gdb/ftest1.gdb");
}

private void readGdb(String pathname) throws IOException {
File path = new File(pathname);
IGISInputStream os = null;
try {
os = new FileGdbInputStream(path, null);
Expand Down