From 647c745eb7badd61e01ac2ce0f8de2625658860d Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 11 Feb 2019 23:49:13 +0100 Subject: [PATCH] Cleanup (formatting) --- .../vfs/newvfs/impl/NullVirtualFile.java | 26 ++---------- .../vfs/newvfs/impl/StubVirtualFile.java | 42 ++++++------------- .../vfs/newvfs/impl/FakeVirtualFile.java | 28 +++---------- 3 files changed, 22 insertions(+), 74 deletions(-) diff --git a/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/impl/NullVirtualFile.java b/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/impl/NullVirtualFile.java index 0277f71529c0..61e51830c249 100644 --- a/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/impl/NullVirtualFile.java +++ b/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/impl/NullVirtualFile.java @@ -1,33 +1,15 @@ -/* - * Copyright 2000-2009 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * @author max - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vfs.newvfs.impl; -import org.jetbrains.annotations.NonNls; - +/** + * @author max + */ public class NullVirtualFile extends StubVirtualFile { public static final NullVirtualFile INSTANCE = new NullVirtualFile(); private NullVirtualFile() {} @Override - @NonNls public String toString() { return "VirtualFile.NULL_OBJECT"; } diff --git a/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/impl/StubVirtualFile.java b/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/impl/StubVirtualFile.java index de8060b90f40..76b9a94c9d14 100644 --- a/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/impl/StubVirtualFile.java +++ b/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/impl/StubVirtualFile.java @@ -1,29 +1,10 @@ -/* - * Copyright 2000-2014 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * @author max - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vfs.newvfs.impl; import com.intellij.openapi.util.Key; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.VirtualFileSystem; import com.intellij.util.keyFMap.KeyFMap; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -32,9 +13,12 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.charset.Charset; +/** + * @author max + */ public class StubVirtualFile extends VirtualFile { - @Override @NotNull + @Override public byte[] contentsToByteArray() throws IOException { throw new UnsupportedOperationException(); } @@ -44,8 +28,8 @@ public class StubVirtualFile extends VirtualFile { throw new UnsupportedOperationException(); } - @Override @NotNull + @Override public VirtualFileSystem getFileSystem() { throw new UnsupportedOperationException(); } @@ -60,27 +44,25 @@ public class StubVirtualFile extends VirtualFile { throw new UnsupportedOperationException(); } - @Override @NotNull - @NonNls + @Override public String getName() { throw new UnsupportedOperationException(); } - @Override @NotNull - public OutputStream getOutputStream(final Object requestor, final long newModificationStamp, final long newTimeStamp) throws IOException { + @Override + public OutputStream getOutputStream(Object requestor, long newModificationStamp, long newTimeStamp) throws IOException { throw new UnsupportedOperationException(); } @Override - @Nullable public VirtualFile getParent() { throw new UnsupportedOperationException(); } - @Override @NotNull + @Override public String getPath() { throw new UnsupportedOperationException(); } @@ -90,8 +72,8 @@ public class StubVirtualFile extends VirtualFile { throw new UnsupportedOperationException(); } - @Override @NotNull + @Override public String getUrl() { throw new UnsupportedOperationException(); } @@ -112,7 +94,7 @@ public class StubVirtualFile extends VirtualFile { } @Override - public void refresh(final boolean asynchronous, final boolean recursive, final Runnable postRunnable) { + public void refresh(boolean asynchronous, boolean recursive, Runnable postRunnable) { throw new UnsupportedOperationException(); } diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/FakeVirtualFile.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/FakeVirtualFile.java index efe08e06a6b5..d291aeaf8023 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/FakeVirtualFile.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/FakeVirtualFile.java @@ -1,23 +1,8 @@ -/* - * Copyright 2000-2014 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vfs.newvfs.impl; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; /** @@ -27,13 +12,13 @@ public class FakeVirtualFile extends StubVirtualFile { private final VirtualFile myParent; private final String myName; - public FakeVirtualFile(@NotNull final VirtualFile parent, @NotNull final String name) { - myName = name; + public FakeVirtualFile(@NotNull VirtualFile parent, @NotNull String name) { myParent = parent; + myName = name; } - @Override @NotNull + @Override public VirtualFile getParent() { return myParent; } @@ -46,13 +31,12 @@ public class FakeVirtualFile extends StubVirtualFile { @NotNull @Override public String getPath() { - final String basePath = myParent.getPath(); + String basePath = myParent.getPath(); return StringUtil.endsWithChar(basePath, '/') ? basePath + myName : basePath + '/' + myName; } - @Override @NotNull - @NonNls + @Override public String getName() { return myName; }