Eclipse Kepler JDT content assist dreadfully slow on MacOS - java

Running on MacOS using Kepler (4.3.1) and Java Proposals are dreadfully long, hanging the UI whenever I mistype something. This activity seems to cause serious Disk I/O:
Call graph:
565 Thread_1045514 DispatchQueue_1: com.apple.main-thread (serial)
+ 181 ??? (in ) [0x1069d1d91]
+ 133 ??? (in ) [0x1069d1d2c]
+ 81 ??? (in ) [0x1069d1d27]
+ 56 ??? (in ) [0x1069d1cf4]
+ 55 ??? (in ) [0x1069d1cc3]
+ 9 ??? (in ) [0x1069d1d8a]
+ 6 ??? (in ) [0x1069d1d1d]
+ 6 ??? (in ) [0x1069d1d59]
+ 6 ??? (in ) [0x1069d1d93]
+ 4 ??? (in ) [0x1069d1dca]
+ 3 ??? (in ) [0x106508c94]
+ ! 3 ??? (in ) [0x1067e05fc]
+ ! 2 Java_java_io_UnixFileSystem_getBooleanAttributes0 (in libjava.dylib) + 86 [0x10059c51a]
+ ! : 1 JNU_GetStringPlatformChars (in libjava.dylib) + 1163 [0x1005995e2]
+ ! : | 1 jni_CallObjectMethod (in libjvm.dylib) + 278 [0x105cda1c6]
+ ! : | 1 jni_invoke_nonstatic(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) (in libjvm.dylib) + 698 [0x105ce8605]
+ ! : | 1 JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*) (in libjvm.dylib) + 40 [0x105cb4b60]
+ ! : | 1 JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) (in libjvm.dylib) + 401 [0x105cb4cf7]
+ ! : | 1 os::stack_shadow_pages_available(Thread*, methodHandle) (in libjvm.dylib) + 1 [0x105df2a67]
+ ! : 1 JNU_GetStringPlatformChars (in libjava.dylib) + 1352 [0x10059969f]
+ ! : 1 jni_GetByteArrayRegion (in libjvm.dylib) + 127 [0x105ce4b37]
+ ! 1 Java_java_io_UnixFileSystem_getBooleanAttributes0 (in libjava.dylib) + 109 [0x10059c531]
+ ! 1 stat$INODE64 (in libsystem_kernel.dylib) + 10 [0x7fff83301dfa]
I've increased my memory to 2G, but the heap display never goes beyond 350M. I occasionally get the "your results took too long" dialoging seen in some content assist activities. Are my indexes corrupt? Any thoughts on how I can get content assist back to normal?

Related

libc++abi.dylib: terminating with uncaught exception of type NSException when building an OpenGL application using JAVA

Below is the full error message, the code is a demo from my teacher so I suppose it is correct.
2020-02-15 21:28:37.934 java[14142:330555] * Assertion failure in +[NSUndoManager _endTopLevelGroupings], /BuildRoot/Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1454.90/Foundation/Misc.subproj/NSUndoManager.m:361
2020-02-15 21:28:37.935 java[14142:330555] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff37ff32db __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff5f2a3c76 objc_exception_throw + 48
2 CoreFoundation 0x00007fff37ff9072 +[NSException raise:format:arguments:] + 98
3 Foundation 0x00007fff3a122340 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 Foundation 0x00007fff3a0b0f44 +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 469
5 AppKit 0x00007fff354fd96e -[NSApplication run] + 997
6 libglfw.dylib 0x000000012650ba85 libglfw.dylib + 68229
7 libglfw.dylib 0x0000000126505416 libglfw.dylib + 42006
8 ??? 0x00000001128fb950 0x0 + 4606376272
9 ??? 0x00000001128f5790 0x0 + 4606351248
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Quit unexpectedly while using the libjvm.dylib plug-in

I'm creating an application with Java 1.8 and running on Mac but
my application have problem running on Mac OSX 10.8 always showing error "quit unexpectedly while using the libjvm.dylib plug-in"
but on other OSX runs smoothly without problem.
Here's the error...
Process: java [247]
Path: /usr/bin/java
Identifier: net.java.openjdk.cmd
Version: 1.0 (1.0)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
User ID: 501
PlugIn Path: /Users/Shared/*/libjvm.dylib
PlugIn Identifier: libjvm.dylib
PlugIn Version: ??? (1)
Date/Time: 2015-04-22 00:57:51.018 -0700
OS Version: Mac OS X 10.8 (12A269)
Report Version: 10
Interval Since Last Report: 21289 sec
Crashes Since Last Report: 12
Per-App Interval Since Last Report: 1821 sec
Per-App Crashes Since Last Report: 11
Anonymous UUID: 829F8A3C-A684-4821-9CC3-7C29F828A3ED
Crashed Thread: 31 Java: QuantumRenderer-0
Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: EXC_I386_GPFLT
Application Specific Information:
abort() called
Thread 0:: AppKit Thread Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff8d713686 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8d712cf7 mach_msg + 251
2 com.apple.CoreFoundation 0x00007fff8df29f23 __CFRunLoopServiceMachPort + 195
3 com.apple.CoreFoundation 0x00007fff8df2f606 __CFRunLoopRun + 1078
4 com.apple.CoreFoundation 0x00007fff8df2edd2 CFRunLoopRunSpecific + 290
5 com.apple.HIToolbox 0x00007fff948c8774 RunCurrentEventLoopInMode + 209
6 com.apple.HIToolbox 0x00007fff948c8512 ReceiveNextEventCommon + 356
7 com.apple.HIToolbox 0x00007fff948c83a3 BlockUntilNextEventMatchingListInMode + 62
8 com.apple.AppKit 0x00007fff938eafa3 _DPSNextEvent + 685
9 com.apple.AppKit 0x00007fff938ea862 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
10 libosxapp.dylib 0x000000019dff442a -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
11 com.apple.AppKit 0x00007fff938e1c03 -[NSApplication run] + 517
12 libosxapp.dylib 0x000000019dff423e +[NSApplicationAWT runAWTLoopWithApp:] + 156
13 libsplashscreen.dylib 0x000000019dfd3128 __SplashInitPlatform_block_invoke_1 + 360
14 JavaNativeFoundation 0x000000019d7cfe5c +[JNFRunLoop _performCopiedBlock:] + 15
15 com.apple.Foundation 0x00007fff9098c8a7 __NSThreadPerformPerform + 225
16 com.apple.CoreFoundation 0x00007fff8df0c841 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
17 com.apple.CoreFoundation 0x00007fff8df0c165 __CFRunLoopDoSources0 + 245
18 com.apple.CoreFoundation 0x00007fff8df2f4e5 __CFRunLoopRun + 789
19 com.apple.CoreFoundation 0x00007fff8df2edd2 CFRunLoopRunSpecific + 290
20 java 0x000000010beba6cc CreateExecutionEnvironment + 871
21 java 0x000000010beb665c JLI_Launch + 1952
22 java 0x000000010bebc68a main + 101
23 java 0x000000010beb5eb4 start + 52
Thread 1:
0 libsystem_kernel.dylib 0x00007fff8d715386 __semwait_signal + 10
1 libsystem_c.dylib 0x00007fff95909ce5 pthread_join + 847
2 java 0x000000010beb9ccc ContinueInNewThread0 + 102
3 java 0x000000010beb72d0 ContinueInNewThread + 201
4 java 0x000000010beb9aa1 JVMInit + 315
5 java 0x000000010beb704e JLI_Launch + 4498
6 java 0x000000010bebc68a main + 101
7 java 0x000000010beba35e apple_main + 92
8 libsystem_c.dylib 0x00007fff9587f782 _pthread_start + 327
9 libsystem_c.dylib 0x00007fff9586c1c1 thread_start + 13
Thread 2:
0 libsystem_kernel.dylib 0x00007fff8d7150fa __psynch_cvwait + 10
1 libsystem_c.dylib 0x00007fff95883fc9 _pthread_cond_wait + 869
2 libjvm.dylib 0x000000010c46e473 Parker::park(bool, long) + 495
3 libjvm.dylib 0x000000010c55fd4c Unsafe_Park + 126
4 ??? 0x000000010d47a9aa 0 + 4517767594
5 ??? 0x000000010d47ade6 0 + 4517768678
6 ??? 0x000000010d08f160 0 + 4513657184
7 ??? 0x000000010d08f98d 0 + 4513659277
8 ??? 0x000000010d08f98d 0 + 4513659277
9 ??? 0x000000010d08f98d 0 + 4513659277
10 ??? 0x000000010d08f710 0 + 4513658640
11 ??? 0x000000010d08f160 0 + 4513657184
12 ??? 0x000000010d08f710 0 + 4513658640
13 ??? 0x000000010d08f98d 0 + 4513659277
14 ??? 0x000000010d08f98d 0 + 4513659277
15 ??? 0x000000010d08f98d 0 + 4513659277
16 ??? 0x000000010d08f98d 0 + 4513659277
17 ??? 0x000000010d08f710 0 + 4513658640
18 ??? 0x000000010d08f98d 0 + 4513659277
19 ??? 0x000000010d08f98d 0 + 4513659277
20 ??? 0x000000010d08f98d 0 + 4513659277
21 ??? 0x000000010d0884e7 0 + 4513629415
22 libjvm.dylib 0x000000010c2e8516 JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) + 1710
23 libjvm.dylib 0x000000010c31d58b jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) + 447
24 libjvm.dylib 0x000000010c316785 jni_CallStaticVoidMethod + 349
25 java 0x000000010beb7c82 JavaMain + 2456
26 libsystem_c.dylib 0x00007fff9587f782 _pthread_start + 327
27 libsystem_c.dylib 0x00007fff9586c1c1 thread_start + 13

Java based mac app is not working in old MacOSX

I have developed a Java-based app and create a desktop mac app. As you know, when you create a bundle for Mac you have to embed the complete JDK (in my case 1.8) in the bundle, so it does not matter if the target has or hasn't Java installed, your app comes with it.
Everything is working fine in MacOSX 10.10 and 10.9 ... (I have not tested in 10.7 or 10.8).
But when I run in a 10.6.8 MacOSX Java crashes ... in the console I see this:
Process: JavaAppLauncher [354]
Path: /Applications/myapp.app/Contents/MacOS/JavaAppLauncher
Identifier: com.myapp.desktop
Version: 1.0.8 (1)
Code Type: X86-64 (Native)
Parent Process: launchd [130]
Date/Time: 2015-02-27 16:58:14.384 +0100
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread: 3
Thread 0: Dispatch queue: com.apple.main-thread
0 libSystem.B.dylib 0x00007fff8a4acd7a mach_msg_trap + 10
1 libSystem.B.dylib 0x00007fff8a4ad3ed mach_msg + 59
2 com.apple.CoreFoundation 0x00007fff848a2902 __CFRunLoopRun + 1698
3 com.apple.CoreFoundation 0x00007fff848a1d8f CFRunLoopRunSpecific + 575
4 libjli.dylib 0x0000000100038b34 CreateExecutionEnvironment + 871
5 libjli.dylib 0x0000000100034ac4 JLI_Launch + 1952
6 com.myapp.desktop 0x00000001d7448990 launch + 5696
7 com.myapp.desktop 0x00000001d7447136 main + 102
8 com.myapp.desktop 0x00000001d74470c4 start + 52
Thread 1: Dispatch queue: com.apple.libdispatch-manager
0 libSystem.B.dylib 0x00007fff8a4c5c0a kevent + 10
1 libSystem.B.dylib 0x00007fff8a4c7add _dispatch_mgr_invoke + 154
2 libSystem.B.dylib 0x00007fff8a4c77b4 _dispatch_queue_invoke + 185
3 libSystem.B.dylib 0x00007fff8a4c72de _dispatch_worker_thread2 + 252
4 libSystem.B.dylib 0x00007fff8a4c6c08 _pthread_wqthread + 353
5 libSystem.B.dylib 0x00007fff8a4c6aa5 start_wqthread + 13
Thread 2:
0 libSystem.B.dylib 0x00007fff8a4e7a6a __semwait_signal + 10
1 libSystem.B.dylib 0x00007fff8a50e896 pthread_join + 844
2 libjli.dylib 0x0000000100038134 ContinueInNewThread0 + 102
3 libjli.dylib 0x0000000100035738 ContinueInNewThread + 201
4 libjli.dylib 0x0000000100037f09 JVMInit + 315
5 libjli.dylib 0x00000001000354b6 JLI_Launch + 4498
6 com.myapp.desktop 0x00000001d7448990 launch + 5696
7 com.myapp.desktop 0x00000001d7447136 main + 102
8 libjli.dylib 0x00000001000387c6 apple_main + 92
9 libSystem.B.dylib 0x00007fff8a4e5fd6 _pthread_start + 331
10 libSystem.B.dylib 0x00007fff8a4e5e89 thread_start + 13
Thread 3 Crashed:
0 com.apple.CoreFoundation 0x00007fff848d98a1 ___forwarding___ + 673
1 com.apple.CoreFoundation 0x00007fff848d5a38 _CF_forwarding_prep_0 + 232
2 libobjc.A.dylib 0x00007fff89347325 _class_initialize + 384
3 libobjc.A.dylib 0x00007fff8935552b prepareForMethodLookup + 234
4 libobjc.A.dylib 0x00007fff8934dcb9 lookUpMethod + 73
5 libobjc.A.dylib 0x00007fff89345faa objc_msgSend + 198
6 libawt_lwawt.dylib 0x0000000116528ca4 JNI_OnLoad + 412
7 libjava.dylib 0x00000001004c7c49 Java_java_lang_ClassLoader_00024NativeLibrary_load + 208
8 ??? 0x00000001027474d4 0 + 4336153812
9 ??? 0x000000010273b98d 0 + 4336105869
10 ??? 0x000000010273b160 0 + 4336103776
11 ??? 0x000000010273b98d 0 + 4336105869
12 ??? 0x000000010273b98d 0 + 4336105869
13 ??? 0x00000001027344e7 0 + 4336076007
14 libjvm.dylib 0x0000000101ad4442 JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) + 1710
15 libjvm.dylib 0x0000000101b094bb jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) + 447
16 libjvm.dylib 0x0000000101b027ed jni_CallStaticVoidMethodV + 232
17 libjava.dylib 0x00000001004d49cb JNU_CallStaticMethodByName + 282
18 libawt.dylib 0x00000001163bb337 AWT_OnLoad + 547
19 libawt.dylib 0x00000001163bb384 JNI_OnLoad + 9
20 libjava.dylib 0x00000001004c7c49 Java_java_lang_ClassLoader_00024NativeLibrary_load + 208
21 ??? 0x00000001027474d4 0 + 4336153812
22 ??? 0x000000010273b98d 0 + 4336105869
23 ??? 0x000000010273b160 0 + 4336103776
24 ??? 0x000000010273b98d 0 + 4336105869
25 ??? 0x000000010273b98d 0 + 4336105869
26 ??? 0x000000010273b98d 0 + 4336105869
27 ??? 0x000000010273b710 0 + 4336105232
28 ??? 0x00000001027344e7 0 + 4336076007
29 libjvm.dylib 0x0000000101ad4442 JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) + 1710
30 libjvm.dylib 0x0000000101b2ade2 JVM_DoPrivileged + 1208
31 ??? 0x00000001027474d4 0 + 4336153812
32 ??? 0x000000010273b710 0 + 4336105232
33 ??? 0x000000010273b98d 0 + 4336105869
34 ??? 0x00000001027344e7 0 + 4336076007
35 libjvm.dylib 0x0000000101ad4442 JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) + 1710
36 libjvm.dylib 0x0000000101aa92b5 InstanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*) + 191
37 libjvm.dylib 0x0000000101aaa797 InstanceKlass::initialize_impl(instanceKlassHandle, Thread*) + 1479
38 libjvm.dylib 0x0000000101aaaa19 InstanceKlass::initialize(Thread*) + 61
39 libjvm.dylib 0x0000000101ba674a LinkResolver::resolve_static_call(CallInfo&, KlassHandle&, Symbol*, Symbol*, KlassHandle, bool, bool, Thread*) + 156
40 libjvm.dylib 0x0000000101ba695e LinkResolver::resolve_invokestatic(CallInfo&, constantPoolHandle, int, Thread*) + 258
41 libjvm.dylib 0x0000000101ba6a1f LinkResolver::resolve_invoke(CallInfo&, Handle, constantPoolHandle, int, Bytecodes::Code, Thread*) + 179
42 libjvm.dylib 0x0000000101ace819 InterpreterRuntime::resolve_invoke(JavaThread*, Bytecodes::Code) + 881
43 ??? 0x00000001027533ba 0 + 4336202682
44 ??? 0x000000010273b98d 0 + 4336105869
45 ??? 0x000000010273b710 0 + 4336105232
46 ??? 0x000000010273b7e4 0 + 4336105444
47 ??? 0x000000010273b710 0 + 4336105232
48 ??? 0x000000010273b98d 0 + 4336105869
49 ??? 0x00000001027344e7 0 + 4336076007
50 libjvm.dylib 0x0000000101ad4442 JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) + 1710
51 libjvm.dylib 0x0000000101b094bb jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) + 447
52 libjvm.dylib 0x0000000101b026b5 jni_CallStaticVoidMethod + 349
53 libjli.dylib 0x00000001000360ea JavaMain + 2456
54 libSystem.B.dylib 0x00007fff8a4e5fd6 _pthread_start + 331
55 libSystem.B.dylib 0x00007fff8a4e5e89 thread_start + 13
Any ideas ?
JRE/JDK 8 requires OS X 10.8 (Mountain Lion) or higher.
http://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jre.html#A1098497
JRE/JDK 7 requires OS X 10.7 (Lion) or higher.
http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jre.html#requirements
What I normally do is create a second version of the app to target JRE 6, which is system-included (or automatically downloaded when needed) prior to OS X 10.7. I don't target JRE 8, instead just target JRE 7, so you only need to have two versions of the app to cover the vast majority of OS X users.

Why has this Java application crashed on CVDisplayLink thread on Mac?

Could anybody give me any clues about this why this java application has crashed, Im unable to replicate the issue but it says it crashed on CVDisplayLink thread on Mac, is this known problem ?
Process: SongKong [12527]
Path: /Applications/SongKong.app/Contents/MacOS/SongKong
Identifier: com.jthink.songkong
Version: 3.0 (1.0)
Code Type: X86-64 (Native)
Parent Process: launchd [521]
Responsible: SongKong [12527]
User ID: 501
Date/Time: 2014-09-12 14:35:00.730 -0400
OS Version: Mac OS X 10.9.4 (13E28)
Report Version: 11
Anonymous UUID: 27FE9D66-7F0A-3CC3-A589-A56FE55FB4DD
Crashed Thread: 22 CVDisplayLink
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
abort() called
Application Specific Signatures:
Graphics hardware encountered an error and was reset: 0x00000000
Thread 0:: AppKit Thread Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff8c0fea1a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff8c0fdd18 mach_msg + 64
2 com.apple.CoreFoundation 0x00007fff8bf0ef15 CFRunLoopServiceMachPort + 181
3 com.apple.CoreFoundation 0x00007fff8bf0e539 __CFRunLoopRun + 1161
4 com.apple.CoreFoundation 0x00007fff8bf0de75 CFRunLoopRunSpecific + 309
5 com.apple.HIToolbox 0x00007fff92583a0d RunCurrentEventLoopInMode + 226
6 com.apple.HIToolbox 0x00007fff925837b7 ReceiveNextEventCommon + 479
7 com.apple.HIToolbox 0x00007fff925835bc _BlockUntilNextEventMatchingListInModeWithFilter + 65
8 com.apple.AppKit 0x00007fff8c77524e _DPSNextEvent + 1434
9 com.apple.AppKit 0x00007fff8c77489b -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
10 libosxapp.dylib 0x0000000127cbe42a -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
11 com.apple.AppKit 0x00007fff8c76899c -[NSApplication run] + 553
12 libosxapp.dylib 0x0000000127cbe23e +[NSApplicationAWT runAWTLoopWithApp:] + 156
13 libawt_lwawt.dylib 0x0000000127e9794f -[AWTStarter starter:] + 905
14 com.apple.Foundation 0x00007fff88be713e __NSThreadPerformPerform + 229
15 com.apple.CoreFoundation 0x00007fff8bf1d5b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
16 com.apple.CoreFoundation 0x00007fff8bf0ec62 __CFRunLoopDoSources0 + 242
17 com.apple.CoreFoundation 0x00007fff8bf0e3ef __CFRunLoopRun + 831
18 com.apple.CoreFoundation 0x00007fff8bf0de75 CFRunLoopRunSpecific + 309
19 libjli.dylib 0x000000010183cb34 CreateExecutionEnvironment + 871
20 libjli.dylib 0x0000000101838ac4 JLI_Launch + 1952
21 com.jthink.songkong 0x00000001017cf8ab launch + 5243
22 com.jthink.songkong 0x00000001017ce2e6 main + 102
23 com.jthink.songkong 0x00000001017ce274 start + 52
...............
...............
Thread 22 Crashed:: CVDisplayLink
0 libsystem_kernel.dylib 0x00007fff8c102866 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff8d8e035c pthread_kill + 92
2 libsystem_c.dylib 0x00007fff874c2b1a abort + 125
3 libGPUSupportMercury.dylib 0x00007fff8782d1ca gpusKillClient + 111
4 libGPUSupportMercury.dylib 0x00007fff8782e65f gpusSubmitDataBuffers + 484
5 com.apple.AMDRadeonX3000GLDriver 0x00001234801fc152 0x123480000000 + 2081106
6 libGPUSupportMercury.dylib 0x00007fff8782f1b2 gpuiFinishFence + 62
7 libGPUSupportMercury.dylib 0x00007fff878328f0 gldFinishObject + 48
8 GLEngine 0x00007fff90265247 gleFinishFence + 94
9 com.apple.QuartzCore 0x00007fff889816a1 view_state_finish(_CAViewState*) + 54
10 com.apple.QuartzCore 0x00007fff8898042d view_draw(_CAView*, double, CVTimeStamp const*, bool) + 1397
11 com.apple.QuartzCore 0x00007fff8897fe7f view_display_link(double, CVTimeStamp const*, void*) + 150
12 com.apple.QuartzCore 0x00007fff8897fd40 link_callback + 237
13 com.apple.CoreVideo 0x00007fff8d8e85cc CVDisplayLink::performIO(CVTimeStamp*) + 206
14 com.apple.CoreVideo 0x00007fff8d8e7a08 CVDisplayLink::runIOThread() + 608
15 com.apple.CoreVideo 0x00007fff8d8e778f startIOThread(void*) + 147
16 libsystem_pthread.dylib 0x00007fff8d8df899 _pthread_body + 138
17 libsystem_pthread.dylib 0x00007fff8d8df72a _pthread_start + 137
18 libsystem_pthread.dylib 0x00007fff8d8e3fc9 thread_start + 13

Java SyntheticEvent on KeyListener

I am implementing some dialog windows that extend JDialog and need to implement some keyboard shortcuts, e.g.:
class MyDialog extends JDialog implements KeyListener
{
/** Constructor
*
*/
public MyDialog() {
super();
// add keyboard shortcuts:
addKeyListener(this);
setFocusable(true);
}
// ---------------------------------------------------------
// Keyboard shortcuts
// ---------------------------------------------------------
public void keyReleased(KeyEvent e) {}
public void keyTyped(KeyEvent e) {}
public void keyPressed(KeyEvent e)
{
System.out.println(e);
if ((e.getKeyCode() == KeyEvent.VK_W) && ((e.getModifiers() & Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()) != 0)) {
dispose();
}
}
}
I then have a couple different types of dialog that extend MyDialog. When the keyboard shortcut is triggered, I get the following output on the console:
java.awt.event.KeyEvent[KEY_PRESSED,keyCode=157,keyText=?,keyChar=Undefined keyChar,modifiers=?,extModifiers=?,keyLocation=KEY_LOCATION_LEFT,rawCode=0,primaryLevelUnicode=0,scancode=0] on dialog0
java.awt.event.KeyEvent[KEY_PRESSED,keyCode=87,keyText=W,keyChar='w',modifiers=?,extModifiers=?,keyLocation=KEY_LOCATION_STANDARD,rawCode=0,primaryLevelUnicode=0,scancode=0] on dialog0
2013-02-10 19:24:28.716 java[10029:2707] Attempt to call non-applicable method "keyCode" on SyntheticEvent!
2013-02-10 19:24:28.718 java[10029:2707] (
0 CoreFoundation 0x00007fff90e5f0a6 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff9617b3f0 objc_exception_throw + 43
2 CoreFoundation 0x00007fff90e5ee7c +[NSException raise:format:] + 204
3 libawt.jnilib 0x0000000110e3564b -[SyntheticEvent keyCode] + 58
4 libawt.jnilib 0x0000000110e397a4 -[NSViewAWT performKeyEquivalent:] + 507
5 AppKit 0x00007fff938793c9 -[NSView _performKeyEquivalent:conditionally:] + 41
6 AppKit 0x00007fff93879512 -[NSView performKeyEquivalent:] + 166
7 AppKit 0x00007fff938793c9 -[NSView _performKeyEquivalent:conditionally:] + 41
8 AppKit 0x00007fff93879329 -[NSWindow performKeyEquivalent:] + 64
9 AppKit 0x00007fff93879114 -[NSApplication _handleKeyEquivalent:] + 462
10 AppKit 0x00007fff93c29232 -[NSWindow keyDown:] + 89
11 Foundation 0x00007fff91965677 __NSThreadPerformPerform + 225
12 CoreFoundation 0x00007fff90dde101 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
13 CoreFoundation 0x00007fff90dddaed __CFRunLoopDoSources0 + 445
14 CoreFoundation 0x00007fff90e00dc5 __CFRunLoopRun + 789
15 CoreFoundation 0x00007fff90e006b2 CFRunLoopRunSpecific + 290
16 HIToolbox 0x00007fff8b4430a4 RunCurrentEventLoopInMode + 209
17 HIToolbox 0x00007fff8b442e42 ReceiveNextEventCommon + 356
18 HIToolbox 0x00007fff8b442cd3 BlockUntilNextEventMatchingListInMode + 62
19 AppKit 0x00007fff93655613 _DPSNextEvent + 685
20 AppKit 0x00007fff93654ed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
21 libawt.jnilib 0x0000000110de6fcf -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
22 AppKit 0x00007fff9364c283 -[NSApplication run] + 517
23 libawt.jnilib 0x0000000110de5680 +[AWTStarter startAWT:] + 1495
24 libawt.jnilib 0x0000000110de4ffa -[CPerformer perform] + 93
25 Foundation 0x00007fff91965677 __NSThreadPerformPerform + 225
26 CoreFoundation 0x00007fff90dde101 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
27 CoreFoundation 0x00007fff90ddda25 __CFRunLoopDoSources0 + 245
28 CoreFoundation 0x00007fff90e00dc5 __CFRunLoopRun + 789
29 CoreFoundation 0x00007fff90e006b2 CFRunLoopRunSpecific + 290
30 java 0x0000000107c97843 java + 18499
31 java 0x0000000107c9729a java + 17050
32 java 0x0000000107c94a98 java + 6808
)
The first two things are the println statements, which seem to be normal. I have no clue what the SyntheticEvent stuff means, and have been unsuccessful with Google. Can anybody point me in the right direction - what's wrong with this? The window disposes normally after this.
Thanks!
No idea what that output is from.
Don't use a KeyListener for this type of functionality. See:
How to Use Menus, or
How to Use Key Bindings

Categories