mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
@@ -66,8 +66,7 @@ public class JUnitUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
final PsiParameter[] parameters = psiMethod.getParameterList().getParameters();
|
||||
return parameters.length == 0;
|
||||
return psiMethod.getParameterList().getParametersCount() == 0;
|
||||
}
|
||||
|
||||
public static boolean isTestMethod(final Location<? extends PsiMethod> location) {
|
||||
|
||||
@@ -151,7 +151,7 @@ public abstract class InspectionProfileEntry {
|
||||
if (descriptionUrl == null) return null;
|
||||
return ResourceUtil.loadText(descriptionUrl);
|
||||
}
|
||||
catch (IOException e2) { }
|
||||
catch (IOException ignored) { }
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public class IDEInspectionToolsConfigurable extends InspectionToolsConfigurable
|
||||
}
|
||||
|
||||
protected InspectionProfileImpl getCurrentProfile() {
|
||||
return (InspectionProfileImpl)((InspectionProfileManager)myProfileManager).getRootProfile();
|
||||
return (InspectionProfileImpl)myProfileManager.getRootProfile();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public class ProjectInspectionToolsConfigurable extends InspectionToolsConfigura
|
||||
}
|
||||
|
||||
protected InspectionProfileImpl getCurrentProfile() {
|
||||
return (InspectionProfileImpl)((InspectionProjectProfileManager)myProjectProfileManager).getProjectProfileImpl();
|
||||
return (InspectionProfileImpl)myProjectProfileManager.getProjectProfileImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
* @author nik
|
||||
*/
|
||||
public class ProjectInspectionToolsConfigurableProvider extends ErrorsConfigurableProvider {
|
||||
private InspectionProfileManager myProfileManager;
|
||||
private InspectionProjectProfileManager myProjectProfileManager;
|
||||
private final InspectionProfileManager myProfileManager;
|
||||
private final InspectionProjectProfileManager myProjectProfileManager;
|
||||
|
||||
public ProjectInspectionToolsConfigurableProvider(InspectionProfileManager profileManager,
|
||||
InspectionProjectProfileManager projectProfileManager) {
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ShowSettingsAction extends AnAction implements DumbAware {
|
||||
project = ProjectManager.getInstance().getDefaultProject();
|
||||
}
|
||||
|
||||
ConfigurableGroup[] group = new ConfigurableGroup[]{
|
||||
ConfigurableGroup[] group = {
|
||||
new ProjectConfigurablesGroup(project),
|
||||
new IdeConfigurablesGroup()
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ShowSettingsUtilImpl extends ShowSettingsUtil {
|
||||
_showSettingsDialog(project, group, null);
|
||||
}
|
||||
|
||||
private void _showSettingsDialog(final Project project, ConfigurableGroup[] group, Configurable toSelect) {
|
||||
private static void _showSettingsDialog(final Project project, ConfigurableGroup[] group, Configurable toSelect) {
|
||||
group = filterEmptyGroups(group);
|
||||
|
||||
if ("false".equalsIgnoreCase(System.getProperty("new.options.editor"))) {
|
||||
@@ -83,7 +83,7 @@ public class ShowSettingsUtilImpl extends ShowSettingsUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void showSettingsDialog(@Nullable final Project project, final @NotNull String nameToSelect) {
|
||||
public void showSettingsDialog(@Nullable final Project project, @NotNull final String nameToSelect) {
|
||||
ConfigurableGroup[] group;
|
||||
if (project == null) {
|
||||
group = new ConfigurableGroup[] {new IdeConfigurablesGroup()};
|
||||
|
||||
+1
-2
@@ -50,8 +50,7 @@ public class ProjectConfigurablesGroup extends ConfigurablesGroupBase implements
|
||||
protected ConfigurableFilter getConfigurableFilter() {
|
||||
return new ConfigurableFilter() {
|
||||
public boolean isIncluded(final Configurable configurable) {
|
||||
if (isDefault() && configurable instanceof NonDefaultProjectConfigurable) return false;
|
||||
return true;
|
||||
return !isDefault() || !(configurable instanceof NonDefaultProjectConfigurable);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class PersistentEnumerator<Data> implements Forceable {
|
||||
|
||||
private static final CacheKey ourFlyweight = new FlyweightKey();
|
||||
|
||||
private final File myFile;
|
||||
protected final File myFile;
|
||||
private static final int COLLISION_OFFSET = 0;
|
||||
private static final int KEY_HASHCODE_OFFSET = COLLISION_OFFSET + 4;
|
||||
private static final int KEY_REF_OFFSET = KEY_HASHCODE_OFFSET + 4;
|
||||
|
||||
@@ -41,7 +41,6 @@ public class PersistentHashMap<Key, Value> extends PersistentEnumerator<Key>{
|
||||
private PersistentHashMapValueStorage myValueStorage;
|
||||
private final DataExternalizer<Value> myValueExternalizer;
|
||||
private static final long NULL_ADDR = 0;
|
||||
private static final int NULL_SIZE = 0;
|
||||
private static final int INITIAL_INDEX_SIZE;
|
||||
static {
|
||||
String property = System.getProperty("idea.initialIndexSize");
|
||||
@@ -50,7 +49,6 @@ public class PersistentHashMap<Key, Value> extends PersistentEnumerator<Key>{
|
||||
|
||||
@NonNls
|
||||
public static final String DATA_FILE_EXTENSION = ".values";
|
||||
private final File myFile;
|
||||
private int myGarbageSize;
|
||||
private static final int VALUE_REF_OFFSET = RECORD_SIZE;
|
||||
private final byte[] myRecordBuffer = new byte[RECORD_SIZE + 8 + 4];
|
||||
@@ -123,7 +121,7 @@ public class PersistentHashMap<Key, Value> extends PersistentEnumerator<Key>{
|
||||
//System.out.println("Flushing caches: " + myFile.getPath());
|
||||
synchronized (PersistentHashMap.this) {
|
||||
synchronized (ourLock) {
|
||||
PersistentHashMap.this.clearAppenderCaches();
|
||||
clearAppenderCaches();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,9 +134,8 @@ public class PersistentHashMap<Key, Value> extends PersistentEnumerator<Key>{
|
||||
public PersistentHashMap(final File file, KeyDescriptor<Key> keyDescriptor, DataExternalizer<Value> valueExternalizer, final int initialSize) throws IOException {
|
||||
super(checkDataFiles(file), keyDescriptor, initialSize);
|
||||
try {
|
||||
myFile = file;
|
||||
myValueExternalizer = valueExternalizer;
|
||||
myValueStorage = PersistentHashMapValueStorage.create(getDataFile(myFile).getPath());
|
||||
myValueStorage = PersistentHashMapValueStorage.create(getDataFile(file).getPath());
|
||||
myGarbageSize = getMetaData();
|
||||
|
||||
if (makesSenseToCompact()) {
|
||||
@@ -247,12 +244,7 @@ public class PersistentHashMap<Key, Value> extends PersistentEnumerator<Key>{
|
||||
synchronized (ourLock) {
|
||||
return processAllDataObject(processor, new DataFilter() {
|
||||
public boolean accept(final int id) {
|
||||
try {
|
||||
return readValueId(id).address != NULL_ADDR;
|
||||
}
|
||||
catch (IOException ignored) {
|
||||
}
|
||||
return true;
|
||||
return readValueId(id).address != NULL_ADDR;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -319,7 +311,7 @@ public class PersistentHashMap<Key, Value> extends PersistentEnumerator<Key>{
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized final void markDirty() throws IOException {
|
||||
public final synchronized void markDirty() throws IOException {
|
||||
markDirty(true);
|
||||
}
|
||||
|
||||
@@ -389,14 +381,14 @@ public class PersistentHashMap<Key, Value> extends PersistentEnumerator<Key>{
|
||||
}
|
||||
}
|
||||
|
||||
private HeaderRecord readValueId(final int keyId) throws IOException {
|
||||
private HeaderRecord readValueId(final int keyId) {
|
||||
HeaderRecord result = new HeaderRecord();
|
||||
result.address = myStorage.getLong(keyId + VALUE_REF_OFFSET);
|
||||
result.size = myStorage.getInt(keyId + VALUE_REF_OFFSET + 8);
|
||||
return result;
|
||||
}
|
||||
|
||||
private void updateValueId(final int keyId, HeaderRecord value) throws IOException {
|
||||
private void updateValueId(final int keyId, HeaderRecord value) {
|
||||
myStorage.putLong(keyId + VALUE_REF_OFFSET, value.address);
|
||||
myStorage.putInt(keyId + VALUE_REF_OFFSET + 8, value.size);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user