diff --git a/platform/platform-impl/src/com/intellij/ide/ClipboardSynchronizer.java b/platform/platform-impl/src/com/intellij/ide/ClipboardSynchronizer.java
index 0e5046e5ab64..8c292681bfc0 100644
--- a/platform/platform-impl/src/com/intellij/ide/ClipboardSynchronizer.java
+++ b/platform/platform-impl/src/com/intellij/ide/ClipboardSynchronizer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,6 +38,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections;
+import java.util.Set;
/**
*
This class is used to workaround the problem with getting clipboard contents (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4818143).
@@ -391,15 +392,15 @@ public class ClipboardSynchronizer implements ApplicationComponent {
if (formats == null || formats.length == 0) {
return Collections.emptySet();
}
- else {
- //noinspection unchecked
- return DataTransferer.getInstance().getFlavorsForFormats(formats, FLAVOR_MAP).keySet();
+ for (int i = 0, length = formats.length; i < length; i++) {
+ if (formats[i] == 0) return Collections.emptySet();
}
+ @SuppressWarnings({"unchecked", "UnnecessaryLocalVariable"})
+ final Set set = DataTransferer.getInstance().getFlavorsForFormats(formats, FLAVOR_MAP).keySet();
+ return set;
}
- catch (IllegalAccessException ignore) {
- }
- catch (IllegalArgumentException ignore) {
- }
+ catch (IllegalAccessException ignore) { }
+ catch (IllegalArgumentException ignore) { }
catch (InvocationTargetException e) {
final Throwable cause = e.getCause();
if (cause instanceof IllegalStateException) {
diff --git a/platform/platform-impl/src/com/intellij/ide/ToolkitBugsProcessor.java b/platform/platform-impl/src/com/intellij/ide/ToolkitBugsProcessor.java
index 85faedf87423..5bb3cb45c561 100644
--- a/platform/platform-impl/src/com/intellij/ide/ToolkitBugsProcessor.java
+++ b/platform/platform-impl/src/com/intellij/ide/ToolkitBugsProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2010 JetBrains s.r.o.
+ * Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -129,22 +129,6 @@ public class ToolkitBugsProcessor {
}
}
- static class Sun_6322854 extends Handler {
- Sun_6322854() {
- super("NPE - Failed to retrieve atom name");
- }
-
- @Override
- boolean process(Throwable e, StackTraceElement[] stack) {
- if (e instanceof NullPointerException && stack.length > 2) {
- return (e.getMessage() != null && e.getMessage().startsWith("Failed to retrieve atom name"))
- && stack[1].getClassName().equals("sun.awt.X11.XAtom");
-
- }
- return false;
- }
- }
-
static class Tricky_JEditorPane_registerEditorKitForContentType_NPE extends Handler {
Tricky_JEditorPane_registerEditorKitForContentType_NPE() {
super("http://ea.jetbrains.com/browser/ea_problems/13587 - JEditorPane_registerEditorKitForContentType_NPE");