Commit dedaecfc authored by Roman Shevchenko's avatar Roman Shevchenko
Browse files

Cleanup (null check; dead code; formatting)

parent a3428f89
Showing with 10 additions and 25 deletions
+10 -25
......@@ -223,8 +223,7 @@ public class GeneralSettings implements PersistentStateComponent<GeneralSettings
}
@Deprecated
public void setConfirmExtractFiles(boolean value) {
}
public void setConfirmExtractFiles(@SuppressWarnings("unused") boolean value) { }
public boolean isConfirmExit() {
return myConfirmExit;
......
// Copyright 2000-2018 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.
// 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.internal.statistic.persistence;
import com.intellij.ide.gdpr.ConsentOptions;
......@@ -12,9 +11,7 @@ import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.util.text.StringUtil;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@State(
name = "UsagesStatistic",
......@@ -23,12 +20,12 @@ import org.jetbrains.annotations.Nullable;
public class UsageStatisticsPersistenceComponent extends BasicSentUsagesPersistenceComponent implements PersistentStateComponent<Element> {
public static final String USAGE_STATISTICS_XML = "usage.statistics.xml";
@NonNls private boolean isShowNotification = true;
@NotNull private SendPeriod myPeriod = SendPeriod.DAILY;
private boolean isShowNotification = true;
private @NotNull SendPeriod myPeriod = SendPeriod.DAILY;
@NonNls private static final String LAST_TIME_ATTR = "time";
@NonNls private static final String IS_ALLOWED_ATTR = "allowed";
@NonNls private static final String SHOW_NOTIFICATION_ATTR = "show-notification";
private static final String LAST_TIME_ATTR = "time";
private static final String IS_ALLOWED_ATTR = "allowed";
private static final String SHOW_NOTIFICATION_ATTR = "show-notification";
public static UsageStatisticsPersistenceComponent getInstance() {
return ApplicationManager.getApplication().getComponent(UsageStatisticsPersistenceComponent.class);
......@@ -83,14 +80,6 @@ public class UsageStatisticsPersistenceComponent extends BasicSentUsagesPersiste
myPeriod = period;
}
@NotNull
private static SendPeriod parsePeriod(@Nullable String periodAttrValue) {
if (SendPeriod.DAILY.getName().equals(periodAttrValue)) return SendPeriod.DAILY;
if (SendPeriod.MONTHLY.getName().equals(periodAttrValue)) return SendPeriod.MONTHLY;
return SendPeriod.WEEKLY;
}
public void setAllowed(boolean allowed) {
ConsentOptions.getInstance().setSendingUsageStatsAllowed(allowed);
}
......@@ -108,4 +97,4 @@ public class UsageStatisticsPersistenceComponent extends BasicSentUsagesPersiste
public boolean isShowNotification() {
return isShowNotification;
}
}
}
\ No newline at end of file
......@@ -189,7 +189,7 @@ public class ConfigImportHelper {
if (new File(selectedDir, SystemInfo.isMac ? CONTENTS : BIN).isDirectory()) {
File configDir = getSettingsPath(selectedDir, PathManager.PROPERTY_CONFIG_PATH, PathManager::getDefaultConfigPathFor);
if (isConfigDirectory(configDir)) {
if (configDir != null && isConfigDirectory(configDir)) {
return pair(configDir, selectedDir);
}
}
......
......@@ -3,7 +3,6 @@ package com.intellij.openapi.components;
import com.intellij.openapi.application.PathManager;
import com.intellij.util.ThreeState;
import org.jetbrains.annotations.NonNls;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
......@@ -29,7 +28,6 @@ public @interface Storage {
*
* @see StoragePathMacros
*/
@NonNls
String value() default "";
/**
......
......@@ -72,8 +72,7 @@ public class PathManager {
}
/**
* @param insideIde {@code true} if the calling code is working inside IDE and {@code false} if it isn't (e.g. if it's running in a build
* process or a script)
* @param insideIde {@code true} if the calling code works inside IDE; {@code false} otherwise (e.g. in a build process or a script)
*/
@Contract("true -> !null")
public static String getHomePath(boolean insideIde) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment