From efbc83b2f663f89ab91048aea547352fd80fec4a Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Fri, 10 Feb 2017 16:38:35 +0100 Subject: [PATCH] Cleanup (method contract) --- .../src/com/intellij/openapi/vfs/impl/ZipHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/core-impl/src/com/intellij/openapi/vfs/impl/ZipHandler.java b/platform/core-impl/src/com/intellij/openapi/vfs/impl/ZipHandler.java index 7fdbca36ed12..0cce9b25af70 100644 --- a/platform/core-impl/src/com/intellij/openapi/vfs/impl/ZipHandler.java +++ b/platform/core-impl/src/com/intellij/openapi/vfs/impl/ZipHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 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. @@ -23,6 +23,7 @@ import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.io.FileAccessorCache; import com.intellij.util.text.ByteArrayCharSequence; +import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -85,7 +86,6 @@ public class ZipHandler extends ArchiveHandler { @Override protected Map createEntriesMap() throws IOException { FileAccessorCache.Handle existingZipRef = getCachedZipFileHandle(true); - assert existingZipRef != null; try { return buildEntryMapForZipFile(existingZipRef.get()); } @@ -107,7 +107,7 @@ public class ZipHandler extends ArchiveHandler { return map; } - @Nullable + @Contract("true -> !null") protected FileAccessorCache.Handle getCachedZipFileHandle(boolean createHandleIfNeeded) throws IOException { FileAccessorCache.Handle handle = createHandleIfNeeded ? ourZipFileFileAccessorCache.get(this) : ourZipFileFileAccessorCache.getIfCached(this);