               rs.push (g_ref = rs.init_object 'java/lang/ThreadGroup')
               # have to run the private ThreadGroup constructor
               rs.method_lookup({class: 'java/lang/ThreadGroup', sig: {name:'<init>',type:'()V'}}).run(rs)
-              rs.main_thread = rs.set_obj 'java/lang/Thread', { priority: 1, group: g_ref }
+              rs.main_thread = rs.set_obj 'java/lang/Thread', { priority: 1, group: g_ref, threadLocals: 0 }
               rs.field_lookup({class: 'java/lang/Thread', sig: {name:'threadSeqNumber'}}).static_value = 0
             rs.push rs.main_thread
         o 'setPriority0(I)V', (rs) -> # NOP

        atomic:
          AtomicInteger: [
            o '<clinit>()V', (rs) -> #NOP
            o 'compareAndSet(II)Z', (rs) -> rs.push 1  # always true
          ]
          AtomicReferenceFieldUpdater: [
            o 'newUpdater(L!/lang/Class;L!/lang/Class;L!/lang/String;)L!/!/!/!/!;', (rs) -> rs.push 0 # null

      Unsafe: [
        o 'getUnsafe()L!/!/!;', (rs) -> # avoid reflection
            rs.static_get({'class':'sun/misc/Unsafe','sig':{'name':'theUnsafe'}})
      ]
    util:
      LocaleServiceProviderPool: [
        o 'getPool(Ljava/lang/Class;)Lsun/util/LocaleServiceProviderPool;', (rs) -> 
            # make a mock
            rs.push rs.init_object 'sun/util/LocaleServiceProviderPool'
        o 'hasProviders()Z', (rs) -> rs.push 0  # false, we can't provide anything
      ]
  
doPrivileged = (rs) ->
