Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
277,900
Boolean (Element dataElement) { return Boolean.valueOf(dataElement.getAttributeValue(VALUE_ATTRIBUTE)); }
readValue
277,901
T (Element dataElement) { T data = myFactory.create(); data.readExternal(dataElement); return data; }
readValue
277,902
void (Element dataElement, T value) { value.writeExternal(dataElement); }
writeValue
277,903
Storage (Element dataElement) { Storage.MapStorage storage = new Storage.MapStorage(); for (Element element : dataElement.getChildren(ITEM_TAG)) { storage.put(element.getAttributeValue(KEY_ATTR), element.getAttributeValue(VALUE_ATTR)); } return storage; }
readValue
277,904
void (Element dataElement, Storage storage) { Iterator<String> keys = ((Storage.MapStorage)storage).getKeys(); while (keys.hasNext()) { String key = keys.next(); String value = storage.get(key); Element element = new Element(ITEM_TAG); element.setAttribute(KEY_ATTR, key); if (value != null) { element.setAttribute(VALUE_ATTR, value); } dataElement.addContent(element); } }
writeValue
277,905
boolean (@NotNull AnActionEvent e) { return myProperty.get(myProperties).booleanValue(); }
isSelected
277,906
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
277,907
void (@NotNull AnActionEvent e, boolean state) { myProperty.set(myProperties, Boolean.valueOf(state)); }
setSelected
277,908
AbstractProperty<Boolean> () { return myProperty; }
getProperty
277,909
void (@NotNull AnActionEvent e) { super.update(e); e.getPresentation().setEnabled(isEnabled()); e.getPresentation().setVisible(isVisible()); }
update
277,910
boolean (String value1, String value2) { return Comparing.strEqual(value1, value2, true); }
areEqual
277,911
void (String key, String value) { if (myPropertiesComponent != null) { myPropertiesComponent.setValue(myPrefix + key, value); } }
put
277,912
String (String key) { return myPropertiesComponent != null ? myPropertiesComponent.getValue(myPrefix + key) : null; }
get
277,913
String () { return "PropertiesComponentStorage: " + myPrefix; }
toString
277,914
String (String key) { return myValues.get(key); }
get
277,915
void (String key, String value) { myValues.put(key, value); }
put
277,916
Iterator<String> () { return Collections.unmodifiableCollection(myValues.keySet()).iterator(); }
getKeys
277,917
int (AbstractPropertyContainer container) { return get(container).intValue(); }
value
277,918
void (AbstractPropertyContainer container, int value) { set(container, Integer.valueOf(value)); }
primSet
277,919
void (AbstractProperty property) { LOG.assertTrue(myExternalizers.get(property) == null, property.getName()); myExternalizers.put(property, null); }
rememberKey
277,920
void (@NotNull Element element) { Map<String, AbstractProperty> propertyByName = new HashMap<>(); for (AbstractProperty abstractProperty : myExternalizers.keySet()) { propertyByName.put(abstractProperty.getName(), abstractProperty); } for (Element child : element.getChildren()) { AbstractProperty property = propertyByName.get(child.getName()); if (property == null) { continue; } Externalizer externalizer = myExternalizers.get(property); if (externalizer == null) { continue; } try { myValues.put(property, externalizer.readValue(child)); } catch (Exception e) { LOG.info(e); } } }
readExternal
277,921
void (@NotNull Element element) { if (myExternalizers.isEmpty()) { return; } List<AbstractProperty> properties = new ArrayList<>(myExternalizers.keySet()); properties.sort(AbstractProperty.NAME_COMPARATOR); for (AbstractProperty property : properties) { Externalizer externalizer = myExternalizers.get(property); if (externalizer == null) { continue; } Object propValue = property.get(this); if (!Comparing.equal(propValue, property.getDefault(this))) { Element child = new Element(property.getName()); externalizer.writeValue(child, propValue); if (!JDOMUtil.isEmpty(child)) { element.addContent(child); } } } }
writeExternal
277,922
Object (AbstractProperty property) { Object value = myValues.get(property); return value != null ? value : property.getDefault(this); }
getValueOf
277,923
void (AbstractProperty externalizableProperty, Object value) { myValues.put(externalizableProperty, value); }
setValueOf
277,924
boolean (AbstractProperty property) { return myExternalizers.containsKey(property); }
hasProperty
277,925
List<T> (Element dataElement) { List<T> list = new SmartList<>(); for (Element element : dataElement.getChildren()) { if (NULL_ELEMENT.equals(element.getName())) { list.add(null); } else if (myItemTagName.equals(element.getName())) { T item = myItemExternalizer.readValue(element); if (item == null) { LOG.error("Can't create element " + myItemExternalizer); return list; } list.add(item); } } return list; }
readValue
277,926
void (Element dataElement, List<T> value) { for (T item : value) { if (item == null) { dataElement.addContent(new Element(NULL_ELEMENT)); } else { Element element = new Element(myItemTagName); myItemExternalizer.writeValue(element, item); if (!(item instanceof SkippableValue) || !JDOMUtil.isEmpty(element)) { dataElement.addContent(element); } } } }
writeValue
277,927
T (T value) { return value; }
copy
277,928
T (AbstractProperty.AbstractPropertyContainer container) { return myDefault; }
getDefault
277,929
String () { return myName; }
getName
277,930
String () { return myName; }
getName
277,931
List<T> (AbstractProperty.AbstractPropertyContainer container) { return Collections.emptyList(); }
getDefault
277,932
List<T> (List<T> value) { return Collections.unmodifiableList(value); }
copy
277,933
ArrayList<T> (AbstractPropertyContainer container) { final ArrayList<T> modifiableList; final List<T> list = get(container); if (list instanceof ArrayList) { modifiableList = (ArrayList<T>)list; } else { modifiableList = new ArrayList<>(list); set(container, modifiableList); } // remove nulls for (int i = modifiableList.size() - 1; i >= 0; --i) { if (modifiableList.get(i) == null) { modifiableList.remove(i); } } return modifiableList; }
getModifiableList
277,934
Iterator<T> (AbstractPropertyContainer container) { return get(container).iterator(); }
getIterator
277,935
boolean (T value1, T value2) { return Comparing.equal(value1, value2); }
areEqual
277,936
T (AbstractPropertyContainer container) { return (T)container.getValueOf(this); }
get
277,937
void (AbstractPropertyContainer container, T value) { container.setValueOf(this, value); }
set
277,938
T (Object value) { return (T)value; }
cast
277,939
String () { return getName(); }
toString
277,940
Object (AbstractProperty property) { return property.getDefault(this); }
getValueOf
277,941
void (AbstractProperty property, Object value) { throw new UnsupportedOperationException("Property: " + property.getName() + " value: " + value); }
setValueOf
277,942
boolean (AbstractProperty property) { return false; }
hasProperty
277,943
void (AbstractPropertyContainer source, AbstractProperty[] properties) { for (AbstractProperty property : properties) { setValueOf((PropertyImpl)property, source.getValueOf(property)); } }
copyFrom
277,944
boolean (AbstractPropertyContainer other, AbstractProperty[] properties) { for (AbstractProperty property : properties) { if (!property.areEqual(getValueOf((PropertyImpl)property), other.getValueOf(property))) return false; } return true; }
areValueEqual
277,945
boolean (AbstractPropertyContainer container) { return get(container).booleanValue(); }
value
277,946
void (AbstractPropertyContainer container, boolean value) { set(container, Boolean.valueOf(value)); }
primSet
277,947
JBDateTimeFormatter () { if (DateTimeFormatManager.getInstance().isOverrideSystemDateFormat()) { return CUSTOM_FORMATTER; } return DEFAULT_FORMATTER; }
getFormatter
277,948
void () { DateTimeFormatManager settings = DateTimeFormatManager.getInstance(); CUSTOM_FORMATTER = new CustomJBDateTimeFormatter(settings.getDateFormatPattern(), settings.isUse24HourTime()); if (DateTimeFormatManager.getInstance().isOverrideSystemDateFormat()) { DateFormatUtil.USE_24_HOUR_TIME = DateTimeFormatManager.getInstance().isUse24HourTime(); } }
invalidateCustomFormatter
277,949
String (@NotNull Date time) { return formatTime(time.getTime()); }
formatTime
277,950
String (@NotNull Date time) { return formatTimeWithSeconds(time.getTime()); }
formatTimeWithSeconds
277,951
String (Date date) { return formatDateTime(date.getTime()); }
formatDateTime
277,952
String (@NotNull Date date) { return formatPrettyDate(date.getTime()); }
formatPrettyDate
277,953
boolean () { return DateTimeFormatManager.getInstance().isPrettyFormattingAllowed(); }
isPrettyFormattingSupported
277,954
String (long time) { return DateFormatUtil.formatTime(time); }
formatTime
277,955
String (long time) { return DateFormatUtil.formatTimeWithSeconds(time); }
formatTimeWithSeconds
277,956
String (long time) { return DateFormatUtil.formatDate(time); }
formatDate
277,957
String (long time) { if (isPrettyFormattingSupported()) { return DateFormatUtil.formatPrettyDateTime(time); } return formatDateTime(time); }
formatPrettyDateTime
277,958
String (long time) { if (isPrettyFormattingSupported()) { return DateFormatUtil.formatPrettyDate(time); } return formatDate(time); }
formatPrettyDate
277,959
void (@NotNull Element state) { DateTimeFormatManager loaded = XmlSerializer.deserialize(state, DateTimeFormatManager.class); XmlSerializerUtil.copyBean(loaded, this); }
loadState
277,960
boolean () { return myOverrideSystemDateFormat; }
isOverrideSystemDateFormat
277,961
void (boolean overrideSystemDateFormat) { myOverrideSystemDateFormat = overrideSystemDateFormat; }
setOverrideSystemDateFormat
277,962
boolean () { return myUse24HourTime; }
isUse24HourTime
277,963
void (boolean use24HourTime) { myUse24HourTime = use24HourTime; }
setUse24HourTime
277,964
void (boolean prettyFormattingAllowed) { myPrettyFormattingAllowed = prettyFormattingAllowed; }
setPrettyFormattingAllowed
277,965
Set<String> () { return DateTimeFormatterBean.EP_NAME.getExtensionList().stream().map(bean -> bean.id).collect(Collectors.toSet()); }
getIds
277,966
String () { return myPattern; }
getDateFormatPattern
277,967
void (@NotNull String pattern) { try { //noinspection ResultOfObjectAllocationIgnored new SimpleDateFormat(pattern); myPattern = pattern; } catch (Exception ignored) { } }
setDateFormatPattern
277,968
boolean () { return myPrettyFormattingAllowed; }
isPrettyFormattingAllowed
277,969
DateTimeFormatManager () { return ApplicationManager.getApplication().getService(DateTimeFormatManager.class); }
getInstance
277,970
SyncDateFormat () { return myDateFormat; }
getFormat
277,971
SyncDateFormat () { return myDateTimeFormat; }
getDateTimeFormat
277,972
SyncDateFormat () { return myDateTimeSecondsFormat; }
getDateTimeSecondsFormat
277,973
boolean () { return false; }
isPrettyFormattingSupported
277,974
String (long time) { return getDateTimeFormat().format(new Date(time)); }
formatTime
277,975
String (long time) { return getDateTimeSecondsFormat().format(time); }
formatTimeWithSeconds
277,976
String (long time) { return getFormat().format(time); }
formatDate
277,977
String (long time) { if (DateTimeFormatManager.getInstance().isPrettyFormattingAllowed() && DateFormatUtil.isPrettyFormattingPossible(time)) { return DateFormatUtil.formatPrettyDateTime(time); } return formatTime(time); }
formatPrettyDateTime
277,978
String (long time) { if (DateTimeFormatManager.getInstance().isPrettyFormattingAllowed() && DateFormatUtil.isPrettyFormattingPossible(time)) { return DateFormatUtil.formatPrettyDate(time); } return formatDate(time); }
formatPrettyDate
277,979
String (Date date) { return formatTime(date); }
formatDateTime
277,980
String (long time) { return formatTime(time); }
formatDateTime
277,981
String (@NotNull Date date) { return formatPrettyDateTime(date.getTime()); }
formatPrettyDateTime
277,982
String (@NotNull Date date) { return formatPrettyDate(date.getTime()); }
formatPrettyDate
277,983
HttpConfigurable () { return ApplicationManager.getApplication().getService(HttpConfigurable.class); }
getInstance
277,984
boolean (@Nullable JComponent parent) { return ShowSettingsUtil.getInstance().editConfigurable(parent, new HttpProxyConfigurable()); }
editConfigurable
277,985
HttpConfigurable () { CommonProxy.isInstalledAssertion(); HttpConfigurable state = new HttpConfigurable(); XmlSerializerUtil.copyBean(this, state); if (!KEEP_PROXY_PASSWORD) { removeSecure("proxy.password"); } correctPasswords(state); return state; }
getState
277,986
void () { mySelector = new IdeaWideProxySelector(this); String name = getClass().getName(); CommonProxy commonProxy = CommonProxy.getInstance(); commonProxy.setCustom(name, mySelector); commonProxy.setCustomAuth(name, new IdeaWideAuthenticator(this)); }
initializeComponent
277,987
ProxySelector () { return mySelector; }
getOnlyBySettingsSelector
277,988
void () { String name = getClass().getName(); CommonProxy commonProxy = CommonProxy.getInstance(); commonProxy.removeCustom(name); commonProxy.removeCustomAuth(name); }
dispose
277,989
void (@NotNull HttpConfigurable to) { synchronized (myLock) { to.myGenericPasswords.values().removeIf(it -> !it.isStore()); } }
correctPasswords
277,990
void (@NotNull HttpConfigurable state) { XmlSerializerUtil.copyBean(state, this); if (!KEEP_PROXY_PASSWORD) { removeSecure("proxy.password"); } correctPasswords(this); }
loadState
277,991
boolean (@NotNull String host, int port) { synchronized (myLock) { return myGenericCancelled.contains(new CommonProxy.HostInfo(null, host, port)); } }
isGenericPasswordCanceled
277,992
void (final String host, final int port) { synchronized (myLock) { myGenericCancelled.add(new CommonProxy.HostInfo(null, host, port)); } }
setGenericPasswordCanceled
277,993
PasswordAuthentication (@NotNull String host, int port) { ProxyInfo proxyInfo; synchronized (myLock) { if (myGenericPasswords.isEmpty()) { return null; } proxyInfo = myGenericPasswords.get(new CommonProxy.HostInfo(null, host, port)); } if (proxyInfo == null) { return null; } return new PasswordAuthentication(proxyInfo.getUsername(), decode(String.valueOf(proxyInfo.getPasswordCrypt())).toCharArray()); }
getGenericPassword
277,994
void (final String host, final int port, @NotNull PasswordAuthentication authentication, boolean remember) { PasswordAuthentication coded = new PasswordAuthentication(authentication.getUserName(), encode(String.valueOf(authentication.getPassword())).toCharArray()); synchronized (myLock) { myGenericPasswords.put(new CommonProxy.HostInfo(null, host, port), new ProxyInfo(remember, coded.getUserName(), String.valueOf(coded.getPassword()))); } }
putGenericPassword
277,995
void (String login) { storeSecure("proxy.login", login); }
setProxyLogin
277,996
void (String password) { storeSecure("proxy.password", password); }
setPlainProxyPassword
277,997
String (String value) { return new String(Base64.getDecoder().decode(value), StandardCharsets.UTF_8); }
decode
277,998
String (String password) { return Base64.getEncoder().encodeToString(password.getBytes(StandardCharsets.UTF_8)); }
encode
277,999
PasswordAuthentication (final @Nls String prefix, final @NlsSafe String host, final String prompt, final int port, final boolean remember) { if (ApplicationManager.getApplication().isUnitTestMode()) { return null; } final Ref<PasswordAuthentication> value = Ref.create(); runAboveAll(() -> { if (isGenericPasswordCanceled(host, port)) { return; } PasswordAuthentication password = getGenericPassword(host, port); if (password != null) { value.set(password); return; } AuthenticationDialog dialog = new AuthenticationDialog(PopupUtil.getActiveComponent(), prefix + ": "+ host, IdeBundle.message("dialog.message.please.enter.credentials.for", prompt), "", "", remember); dialog.show(); if (dialog.getExitCode() == DialogWrapper.OK_EXIT_CODE) { AuthenticationPanel panel = dialog.getPanel(); PasswordAuthentication passwordAuthentication = new PasswordAuthentication(panel.getLogin(), panel.getPassword()); putGenericPassword(host, port, passwordAuthentication, remember && panel.isRememberPassword()); value.set(passwordAuthentication); } else { setGenericPasswordCanceled(host, port); } }); return value.get(); }
getGenericPromptedAuthentication