From 614ec5b5535a12c56537ce4e9469975f7dfa9bd9 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Fri, 7 Dec 2012 21:32:48 +0100 Subject: [PATCH 1/2] Cleanup --- .../openapi/application/ModalityState.java | 7 ++----- .../impl/ProjectLifecycleListener.java | 20 ++++++++----------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/platform/core-api/src/com/intellij/openapi/application/ModalityState.java b/platform/core-api/src/com/intellij/openapi/application/ModalityState.java index e95f8eefc3ea..fde756290433 100644 --- a/platform/core-api/src/com/intellij/openapi/application/ModalityState.java +++ b/platform/core-api/src/com/intellij/openapi/application/ModalityState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 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. @@ -24,15 +24,12 @@ import java.awt.*; */ public abstract class ModalityState { @NotNull public static final ModalityState NON_MODAL; - @NotNull @Deprecated public static final ModalityState NON_MMODAL; static { try { + @SuppressWarnings("unchecked") final Class ex = (Class)Class.forName("com.intellij.openapi.application.impl.ModalityStateEx"); NON_MODAL = ex.newInstance(); - NON_MMODAL = NON_MODAL; - - assert NON_MODAL != null; } catch (ClassNotFoundException e) { throw new IllegalStateException(e); diff --git a/platform/platform-api/src/com/intellij/openapi/project/impl/ProjectLifecycleListener.java b/platform/platform-api/src/com/intellij/openapi/project/impl/ProjectLifecycleListener.java index 82e6477cc0e3..74d2cafb4940 100644 --- a/platform/platform-api/src/com/intellij/openapi/project/impl/ProjectLifecycleListener.java +++ b/platform/platform-api/src/com/intellij/openapi/project/impl/ProjectLifecycleListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 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. @@ -13,33 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -/* - * @author max - */ package com.intellij.openapi.project.impl; import com.intellij.openapi.project.Project; import com.intellij.util.messages.Topic; import org.jetbrains.annotations.NotNull; +/** + * @author max + */ public interface ProjectLifecycleListener { Topic TOPIC = Topic.create("Various stages of project lifecycle notifications", ProjectLifecycleListener.class); void projectComponentsInitialized(Project project); void beforeProjectLoaded(@NotNull Project project); + void afterProjectClosed(@NotNull Project project); abstract class Adapter implements ProjectLifecycleListener { - public void projectComponentsInitialized(final Project project) {} + public void projectComponentsInitialized(final Project project) { } - public void beforeProjectLoaded(@NotNull final Project project) { + public void beforeProjectLoaded(@NotNull final Project project) { } - } - - public void afterProjectClosed(@NotNull Project project) { - - } + public void afterProjectClosed(@NotNull Project project) { } } } From 2b5b35866c2f515711073db9881c776bd69d2978 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Fri, 7 Dec 2012 21:59:22 +0100 Subject: [PATCH 2/2] Brain-dead dependency fixed --- platform/util/src/com/intellij/util/io/URLUtil.java | 11 +++++++---- platform/util/util.iml | 9 --------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/platform/util/src/com/intellij/util/io/URLUtil.java b/platform/util/src/com/intellij/util/io/URLUtil.java index 231047e086a0..d3b2d3f879c3 100644 --- a/platform/util/src/com/intellij/util/io/URLUtil.java +++ b/platform/util/src/com/intellij/util/io/URLUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 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. @@ -16,14 +16,17 @@ package com.intellij.util.io; -import com.google.common.base.Charsets; import com.intellij.openapi.util.io.FileUtil; import gnu.trove.TIntArrayList; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; -import java.io.*; +import java.io.FileNotFoundException; +import java.io.FilterInputStream; +import java.io.IOException; +import java.io.InputStream; import java.net.URL; +import java.nio.charset.Charset; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -120,7 +123,7 @@ public class URLUtil { for (int j = 0; j < bytes.size(); j++) { bytesArray[j] = (byte)bytes.getQuick(j); } - decoded.append(new String(bytesArray, Charsets.UTF_8)); + decoded.append(new String(bytesArray, Charset.forName("UTF-8"))); continue; } } diff --git a/platform/util/util.iml b/platform/util/util.iml index f94a232b957e..3e482bfe30e0 100644 --- a/platform/util/util.iml +++ b/platform/util/util.iml @@ -20,15 +20,6 @@ - - - - - - - - -