mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
Fix warnings
GitOrigin-RevId: b055acda48e69f36862e8c494f0189aef21e985b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
09ee1759eb
commit
857e72f73e
@@ -5,7 +5,6 @@ import com.intellij.openapi.util.SystemInfoRt;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.util.ArrayUtilRt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.*;
|
||||
import java.sql.Blob;
|
||||
@@ -22,12 +21,7 @@ public abstract class LobInfo<T extends LobInfo<?>> implements Comparable<T>, Se
|
||||
|
||||
private boolean isFullyReloaded;
|
||||
|
||||
private static final ThreadLocal<byte[]> BUFFER = new ThreadLocal<byte[]>() {
|
||||
@Override
|
||||
protected byte[] initialValue() {
|
||||
return new byte[8192];
|
||||
}
|
||||
};
|
||||
private static final ThreadLocal<byte[]> BUFFER = ThreadLocal.withInitial(() -> new byte[8192]);
|
||||
|
||||
public LobInfo(long length) {
|
||||
this.length = length;
|
||||
@@ -121,11 +115,11 @@ public abstract class LobInfo<T extends LobInfo<?>> implements Comparable<T>, Se
|
||||
return maxLength < 0 ? Integer.MAX_VALUE : maxLength;
|
||||
}
|
||||
|
||||
public static @Nullable Object fromInputStream(InputStream o, int maxLength) throws IOException {
|
||||
public static @NotNull Object fromInputStream(InputStream o, int maxLength) throws IOException {
|
||||
return fromByteArray(loadBytes(o, realMaxLength(maxLength)), maxLength);
|
||||
}
|
||||
|
||||
public static @Nullable Object fromReader(Reader o, int maxLength) throws IOException {
|
||||
public static @NotNull Object fromReader(Reader o, int maxLength) throws IOException {
|
||||
return fromString(String.valueOf(FileUtilRt.loadText(o, realMaxLength(maxLength))), maxLength);
|
||||
}
|
||||
|
||||
@@ -147,7 +141,7 @@ public abstract class LobInfo<T extends LobInfo<?>> implements Comparable<T>, Se
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (int)(length ^ (length >>> 32));
|
||||
return Long.hashCode(length);
|
||||
}
|
||||
|
||||
public static class ClobInfo extends LobInfo<ClobInfo> {
|
||||
@@ -217,7 +211,7 @@ public abstract class LobInfo<T extends LobInfo<?>> implements Comparable<T>, Se
|
||||
return Comparing.compare(data, o.data);
|
||||
}
|
||||
|
||||
public int compareTo(@NotNull byte[] bytes) {
|
||||
public int compareTo(byte @NotNull [] bytes) {
|
||||
final int lenVal = Long.compare(length, bytes.length);
|
||||
if (lenVal != 0 || length == 0) return lenVal;
|
||||
return Comparing.compare(data, bytes);
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.jetbrains.jps.incremental.relativizer;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.VisibleForTesting;
|
||||
import org.jetbrains.jps.model.serialization.JpsMavenSettings;
|
||||
|
||||
@@ -16,8 +15,8 @@ public final class MavenPathRelativizer extends CommonPathRelativizer {
|
||||
super(mavenRepositoryPath, IDENTIFIER);
|
||||
}
|
||||
|
||||
public static @Nullable String getNormalizedMavenRepositoryPath() {
|
||||
public static @NotNull String getNormalizedMavenRepositoryPath() {
|
||||
String path = JpsMavenSettings.getMavenRepositoryPath();
|
||||
return path == null ? null : PathRelativizerService.normalizePath(path);
|
||||
return PathRelativizerService.normalizePath(path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,9 +160,7 @@ public final class PathRelativizerService {
|
||||
}
|
||||
|
||||
String mavenRepositoryPath = MavenPathRelativizer.getNormalizedMavenRepositoryPath();
|
||||
if (mavenRepositoryPath != null) {
|
||||
result.add(new MavenPathRelativizer(mavenRepositoryPath));
|
||||
}
|
||||
result.add(new MavenPathRelativizer(mavenRepositoryPath));
|
||||
|
||||
String gradleRepositoryPath = GradlePathRelativizer.initializeGradleRepositoryPath();
|
||||
if (gradleRepositoryPath != null) {
|
||||
|
||||
@@ -50,7 +50,6 @@ import java.util.stream.Stream;
|
||||
|
||||
public class FileSystemTreeImpl implements FileSystemTree {
|
||||
private final Tree myTree;
|
||||
private final FileTreeStructure myTreeStructure;
|
||||
private final Project myProject;
|
||||
private final ArrayList<Runnable> myOkActions = new ArrayList<>(2);
|
||||
private final FileChooserDescriptor myDescriptor;
|
||||
@@ -72,14 +71,15 @@ public class FileSystemTreeImpl implements FileSystemTree {
|
||||
final @Nullable Runnable onInitialized,
|
||||
final @Nullable Convertor<? super TreePath, String> speedSearchConverter) {
|
||||
myProject = project;
|
||||
FileTreeStructure treeStructure;
|
||||
if (renderer == null) {
|
||||
renderer = new FileRenderer().forTree();
|
||||
myFileTreeModel = createFileTreeModel(descriptor, tree);
|
||||
myTreeStructure = null;
|
||||
treeStructure = null;
|
||||
}
|
||||
else {
|
||||
myTreeStructure = new FileTreeStructure(project, descriptor);
|
||||
myFileTreeModel = new StructureTreeModel<>(myTreeStructure, getFileComparator(), this);
|
||||
treeStructure = new FileTreeStructure(project, descriptor);
|
||||
myFileTreeModel = new StructureTreeModel<>(treeStructure, getFileComparator(), this);
|
||||
}
|
||||
myDescriptor = descriptor;
|
||||
myTree = tree;
|
||||
|
||||
@@ -135,6 +135,7 @@ public class TextRange implements Segment, Serializable {
|
||||
* @return true if the given offset is within the range, false otherwise
|
||||
* @see #containsOffset(int)
|
||||
*/
|
||||
@Override
|
||||
@Contract(pure = true)
|
||||
public boolean contains(int offset) {
|
||||
return myStartOffset <= offset && offset < myEndOffset;
|
||||
|
||||
@@ -36,7 +36,7 @@ final class EditorConfigStatusListener implements CodeStyleSettingsListener {
|
||||
@NotNull VirtualFile virtualFile,
|
||||
@NotNull Set<String> encodings) {
|
||||
myProject = project;
|
||||
myEnabledStatus = Utils.INSTANCE.isEnabled(project);
|
||||
myEnabledStatus = Utils.isEnabled(project);
|
||||
myVirtualFile = virtualFile;
|
||||
myEncodings = encodings;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ final class EditorConfigStatusListener implements CodeStyleSettingsListener {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean newEnabledStatus = Utils.INSTANCE.isEnabled(myProject);
|
||||
boolean newEnabledStatus = Utils.isEnabled(myProject);
|
||||
if (myEnabledStatus != newEnabledStatus) {
|
||||
myEnabledStatus = newEnabledStatus;
|
||||
onEditorConfigEnabled(newEnabledStatus);
|
||||
|
||||
@@ -48,7 +48,7 @@ final class GithubRepository extends BaseRepository {
|
||||
private @NotNull String myUser = "";
|
||||
private boolean myAssignedIssuesOnly = false;
|
||||
|
||||
@SuppressWarnings({"UnusedDeclaration"})
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
GithubRepository() {
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ import com.intellij.xdebugger.*;
|
||||
import com.intellij.xdebugger.breakpoints.*;
|
||||
import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider;
|
||||
import com.intellij.xdebugger.frame.*;
|
||||
import com.intellij.xdebugger.impl.XDebugSessionImpl;
|
||||
import com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl;
|
||||
import com.intellij.xdebugger.stepping.XSmartStepIntoHandler;
|
||||
import com.jetbrains.python.PyBundle;
|
||||
@@ -581,7 +580,7 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr
|
||||
}
|
||||
|
||||
public void setUnitTestDebuggingMode() {
|
||||
ExecutionEnvironment environment = ((XDebugSessionImpl)getSession()).getExecutionEnvironment();
|
||||
ExecutionEnvironment environment = getSession().getExecutionEnvironment();
|
||||
if (environment == null) return;
|
||||
RunProfile runProfile = environment.getRunProfile();
|
||||
if (runProfile instanceof AbstractPythonTestRunConfiguration
|
||||
@@ -851,7 +850,7 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr
|
||||
public @Nullable XValueChildrenList loadFrame(final @Nullable XStackFrame contextFrame) throws PyDebuggerException {
|
||||
final PyStackFrame frame = contextFrame == null ? currentFrame() : (PyStackFrame)contextFrame;
|
||||
synchronized (myFrameCacheObject) {
|
||||
// Do not reload frame every time it is needed, because due to a bug in pdb, reloading frame clears all variable changes.
|
||||
// Do not reload the frame every time it is needed, because due to a bug in pdb, reloading frame clears all variable changes.
|
||||
if (!myStackFrameCache.containsKey(frame.getThreadFrameId())) {
|
||||
XValueChildrenList values = myDebugger.loadFrame(frame.getThreadId(), frame.getFrameId(), ProcessDebugger.GROUP_TYPE.DEFAULT);
|
||||
// Could be null when the current function is called for a thread that is already dead.
|
||||
@@ -1204,7 +1203,7 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr
|
||||
}
|
||||
}
|
||||
else {
|
||||
((XDebugSessionImpl)getSession()).positionReached(suspendContext, isFailedTestStop(threadInfo));
|
||||
getSession().positionReached(suspendContext, isFailedTestStop(threadInfo));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user