Cleanup (formatting)

This commit is contained in:
Roman Shevchenko
2019-02-11 23:49:13 +01:00
parent 5aa869bde5
commit 647c745eb7
3 changed files with 22 additions and 74 deletions
@@ -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";
}
@@ -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();
}
@@ -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;
}