Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
278,000
PasswordAuthentication (final String host, final String prompt) { if (AUTHENTICATION_CANCELLED) { return null; } final String password = getPlainProxyPassword(); if (PROXY_AUTHENTICATION) { final String login = getSecure("proxy.login"); if (!StringUtil.isEmptyOrSpaces(login) && !StringUtil.isEmptyOrSpaces(password)) { ...
getPromptedAuthentication
278,001
void (final @NotNull Runnable runnable) { ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator(); if (progressIndicator != null && progressIndicator.isModal()) { WaitForProgressToShow.runOrInvokeAndWaitAboveProgress(runnable); } else { Application app = ApplicationManager.getApplicat...
runAboveAll
278,002
boolean (@Nullable String url) { if (!USE_HTTP_PROXY) return false; URI uri = url != null ? VfsUtil.toUri(url) : null; return uri == null || !isProxyException(uri.getHost()); }
isHttpProxyEnabledForUrl
278,003
boolean (URI uri) { String uriHost = uri.getHost(); return isProxyException(uriHost); }
isProxyException
278,004
boolean (@Nullable String uriHost) { if (StringUtil.isEmptyOrSpaces(uriHost) || StringUtil.isEmptyOrSpaces(PROXY_EXCEPTIONS)) { return false; } List<String> hosts = StringUtil.split(PROXY_EXCEPTIONS, ","); for (String hostPattern : hosts) { String regexpPattern = StringUtil.escapeToRegexp(hostPattern.trim()).replace("\...
isProxyException
278,005
boolean (@NotNull Proxy proxy) { return !Proxy.NO_PROXY.equals(proxy) && !Proxy.Type.DIRECT.equals(proxy.type()); }
isRealProxy
278,006
void () { synchronized (myLock) { myGenericPasswords.clear(); myGenericCancelled.clear(); } }
clearGenericPasswords
278,007
void (@NotNull CommonProxy.HostInfo info) { synchronized (myLock) { myGenericPasswords.remove(info); } }
removeGeneric
278,008
boolean () { return myStore; }
isStore
278,009
void (boolean store) { myStore = store; }
setStore
278,010
String () { return myUsername; }
getUsername
278,011
void (String username) { myUsername = username; }
setUsername
278,012
String () { return myPasswordCrypt; }
getPasswordCrypt
278,013
void (String passwordCrypt) { myPasswordCrypt = passwordCrypt; }
setPasswordCrypt
278,014
String (String key) { try { synchronized (myProxyCredentials) { final Properties props = myProxyCredentials.getValue(); return props.getProperty(key, null); } } catch (Exception e) { LOG.info(e); } return null; }
getSecure
278,015
void (String key, @Nullable String value) { if (value == null) { removeSecure(key); return; } try { synchronized (myProxyCredentials) { final Properties props = myProxyCredentials.getValue(); props.setProperty(key, value); myEncryptionSupport.store(props, "Proxy Credentials", PROXY_CREDENTIALS_FILE); } } catch (Excepti...
storeSecure
278,016
void (String key) { try { synchronized (myProxyCredentials) { final Properties props = myProxyCredentials.getValue(); props.remove(key); myEncryptionSupport.store(props, "Proxy Credentials", PROXY_CREDENTIALS_FILE); } } catch (Exception e) { LOG.info(e); } }
removeSecure
278,017
HttpConfigurable () { return settings; }
getSettings
278,018
HttpProxySettingsUi () { return new HttpProxySettingsUi(settings); }
createUi
278,019
boolean (@NotNull HttpConfigurable settings) { return !Comparing.strEqual(myProxyExceptions.getText().trim(), settings.PROXY_EXCEPTIONS) || settings.USE_PROXY_PAC != myAutoDetectProxyRb.isSelected() || settings.USE_PAC_URL != myPacUrlCheckBox.isSelected() || !Comparing.strEqual(settings.PAC_URL, myPacUrlTextField.getTe...
isModified
278,020
void () { if (HttpConfigurable.getInstance() == null) { myCheckButton.setVisible(false); return; } myCheckButton.addActionListener(event -> { String error = isValid(); if (error != null) { Messages.showErrorDialog(myMainPanel, error); return; } final HttpConfigurable settings = HttpConfigurable.getInstance(); final Str...
configureCheckButton
278,021
void (@NotNull HttpConfigurable settings) { myNoProxyRb.setSelected(true); // default myAutoDetectProxyRb.setSelected(settings.USE_PROXY_PAC); myPacUrlCheckBox.setSelected(settings.USE_PAC_URL); myPacUrlTextField.setText(settings.PAC_URL); myUseHTTPProxyRb.setSelected(settings.USE_HTTP_PROXY); myProxyAuthCheckBox.setSe...
reset
278,022
void () { myProxyExceptions = new RawCommandLineEditor(text -> { List<String> result = new ArrayList<>(); for (String token : text.split(",")) { String trimmedToken = token.trim(); if (!trimmedToken.isEmpty()) { result.add(trimmedToken); } } return result; }, strings -> StringUtil.join(strings, ", ")); }
createUIComponents
278,023
void (boolean enabled) { myHostNameLabel.setEnabled(enabled); myPortNumberLabel.setEnabled(enabled); myProxyHostTextField.setEnabled(enabled); myProxyPortTextField.setEnabled(enabled); mySocks.setEnabled(enabled); myHTTP.setEnabled(enabled); myProxyExceptions.setEnabled(enabled); myProxyExceptionsLabel.setEnabled(enabl...
enableProxy
278,024
void (boolean enabled) { myProxyLoginLabel.setEnabled(enabled); myProxyLoginTextField.setEnabled(enabled); myProxyPasswordLabel.setEnabled(enabled); myProxyPasswordTextField.setEnabled(enabled); myRememberProxyPasswordCheckBox.setEnabled(enabled); }
enableProxyAuthentication
278,025
JComponent () { return myMainPanel; }
getComponent
278,026
AuthenticationPanel () { return panel; }
getPanel
278,027
List<Proxy> (@NotNull URI uri) { LOG.debug("IDEA-wide proxy selector asked for " + uri.toString()); String scheme = uri.getScheme(); if (!("http".equals(scheme) || "https".equals(scheme))) { LOG.debug("No proxy: not http/https scheme: " + scheme); return CommonProxy.NO_PROXY_LIST; } if (myHttpConfigurable.USE_HTTP_PROX...
select
278,028
List<Proxy> (@NotNull URI uri) { // It is important to avoid resetting Pac based ProxySelector unless option was changed // New instance will download configuration file and interpret it before making the connection String pacUrlForUse = myHttpConfigurable.USE_PAC_URL && !StringUtil.isEmpty(myHttpConfigurable.PAC_URL) ...
selectUsingPac
278,029
void (URI uri, SocketAddress sa, IOException ioe) { if (myHttpConfigurable.USE_PROXY_PAC) { myHttpConfigurable.removeGeneric(new CommonProxy.HostInfo(uri.getScheme(), uri.getHost(), uri.getPort())); LOG.debug("generic proxy credentials (if were saved) removed"); return; } final InetSocketAddress isa = sa instanceof Ine...
connectFailed
278,030
String () { return StringUtil.notNullize(myLoginTextField.getText()); }
getLogin
278,031
boolean () { return rememberPasswordCheckBox.isSelected(); }
isRememberPassword
278,032
JComponent () { return getLogin().isEmpty() ? myLoginTextField : myPasswordTextField; }
getPreferredFocusedComponent
278,033
PasswordAuthentication () { final String host = CommonProxy.getHostNameReliably(getRequestingHost(), getRequestingSite(), getRequestingURL()); // java.base/java/net/SocksSocketImpl.java:176 : there is SOCKS proxy auth, but without RequestorType passing final boolean isProxy = Authenticator.RequestorType.PROXY.equals(ge...
getPasswordAuthentication
278,034
void (@NotNull ActionEvent e) { HttpConfigurable.editConfigurable(ObjectUtils.tryCast(e.getSource(), JComponent.class)); }
actionPerformed
278,035
boolean (@NlsContexts.DialogTitle String title, @NlsContexts.DetailedDescription String text) { if (ApplicationManager.getApplication().isUnitTestMode()) { throw new RuntimeException(title + ": " + text); } Ref<Boolean> ok = new Ref<>(false); try { ApplicationManager.getApplication().invokeAndWait(() -> { IOExceptionDi...
showErrorDialog
278,036
String (@NotNull CommonField name) { String field = myIssuerFields.get(name.getShortName()); return field == null ? NOT_AVAILABLE : field; }
getIssuerField
278,037
String () { try { return DigestUtil.sha256Hex(myCertificate.getEncoded()); } catch (CertificateEncodingException e) { return NOT_AVAILABLE; } }
getSha256Fingerprint
278,038
String () { try { return DigestUtil.sha1Hex(myCertificate.getEncoded()); } catch (Exception e) { return NOT_AVAILABLE; } }
getSha1Fingerprint
278,039
boolean () { try { myCertificate.checkValidity(); return true; } catch (Exception e) { return false; } }
isValid
278,040
boolean () { return new Date().getTime() > myCertificate.getNotAfter().getTime(); }
isExpired
278,041
boolean () { return new Date().getTime() < myCertificate.getNotBefore().getTime(); }
isNotYetValid
278,042
boolean () { return myCertificate.getIssuerX500Principal().equals(myCertificate.getSubjectX500Principal()); }
isSelfSigned
278,043
int () { return myCertificate.getVersion(); }
getVersion
278,044
String () { return myCertificate.getSerialNumber().toString(); }
getSerialNumber
278,045
X509Certificate () { return myCertificate; }
getCertificate
278,046
X500Principal () { return myCertificate.getIssuerX500Principal(); }
getIssuerX500Principal
278,047
X500Principal () { return myCertificate.getSubjectX500Principal(); }
getSubjectX500Principal
278,048
Date () { return myCertificate.getNotBefore(); }
getNotBefore
278,049
Date () { return myCertificate.getNotAfter(); }
getNotAfter
278,050
boolean (Object other) { return other instanceof CertificateWrapper && myCertificate.equals(((CertificateWrapper)other).getCertificate()); }
equals
278,051
int () { return myCertificate.hashCode(); }
hashCode
278,052
OsCertificatesService () { return ApplicationManager.getApplication().getService(OsCertificatesService.class); }
getInstance
278,053
ConfirmingTrustManager (@NotNull String path, @NotNull String password) { return new ConfirmingTrustManager(getSystemTrustManagers(), new MutableTrustManager(path, password)); }
createForStorage
278,054
List<X509TrustManager> () { List<X509TrustManager> result = new ArrayList<>(); X509TrustManager osManager = getOperatingSystemTrustManager(); if (osManager != null) { result.add(osManager); } X509TrustManager javaRuntimeManager = getJavaRuntimeDefaultTrustManager(); if (javaRuntimeManager != null) { result.add(javaRunt...
getSystemTrustManagers
278,055
boolean (final X509Certificate[] chain, @NotNull CertificateConfirmationParameters parameters) { Application app = ApplicationManager.getApplication(); final X509Certificate endPoint = chain[0]; // IDEA-123467 and IDEA-123335 workaround String threadClassName = Strings.notNullize(Thread.currentThread().getClass().getCa...
confirmAndUpdate
278,056
X509Certificate[] () { Set<X509Certificate> certificates = new HashSet<>(); for (X509TrustManager manager : mySystemManagers) { try { certificates.addAll(Arrays.asList(manager.getAcceptedIssuers())); } catch (Throwable exception) { LOG.error("Could not get list of accepted issuers (trusted root identities) from " + man...
getAcceptedIssuers
278,057
MutableTrustManager () { return myCustomManager; }
getCustomManager
278,058
TrustManagerFactory () { try { return TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); } catch (NoSuchAlgorithmException e) { LOG.error("Cannot create trust manager factory", e); return null; } }
createFactory
278,059
KeyStore (@NotNull String path, @NotNull String password) { KeyStore keyStore; try { keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); Path cacertsFile = Path.of(path); if (Files.exists(cacertsFile)) { try (InputStream stream = Files.newInputStream(cacertsFile)) { keyStore.load(stream, password.toCharArray())...
createKeyStore
278,060
boolean (@NotNull X509Certificate certificate) { myWriteLock.lock(); try { if (isBroken()) { return false; } myKeyStore.setCertificateEntry(createAlias(certificate), certificate); flushKeyStore(); LOG.info("Added certificate for '" + certificate.getSubjectX500Principal().toString() + "' to " + myPath); // trust manager...
addCertificate
278,061
boolean (@NotNull String path) { X509Certificate certificate = CertificateUtil.loadX509Certificate(path); return certificate != null && addCertificate(certificate); }
addCertificate
278,062
String (@NotNull X509Certificate certificate) { return CertificateUtil.getCommonName(certificate); }
createAlias
278,063
boolean (@NotNull X509Certificate certificate) { return removeCertificate(createAlias(certificate)); }
removeCertificate
278,064
boolean (@NotNull String alias) { myWriteLock.lock(); try { if (isBroken()) { return false; } // for listeners X509Certificate certificate = getCertificate(alias); if (certificate == null) { LOG.error("No certificate found for alias: " + alias); return false; } myKeyStore.deleteEntry(alias); flushKeyStore(); // trust m...
removeCertificate
278,065
List<X509Certificate> () { myReadLock.lock(); try { List<X509Certificate> certificates = new ArrayList<>(); for (String alias : Collections.list(myKeyStore.aliases())) { certificates.add(getCertificate(alias)); } return List.copyOf(certificates); } catch (Exception e) { LOG.error(e); return Collections.emptyList(); } f...
getCertificates
278,066
boolean (@NotNull String alias) { myReadLock.lock(); try { return myKeyStore.containsAlias(alias); } catch (KeyStoreException e) { LOG.error(e); return false; } finally { myReadLock.unlock(); } }
containsCertificate
278,067
X509Certificate[] () { myReadLock.lock(); try { // trust no one if broken if (keyStoreIsEmpty() || isBroken()) { return NO_CERTIFICATES; } return myTrustManager.getAcceptedIssuers(); } finally { myReadLock.unlock(); } }
getAcceptedIssuers
278,068
void (@NotNull CertificateListener listener) { myDispatcher.addListener(listener); }
addListener
278,069
void (@NotNull CertificateListener listener) { myDispatcher.removeListener(listener); }
removeListener
278,070
boolean () { try { return myKeyStore.size() == 0; } catch (KeyStoreException e) { LOG.error(e); return true; } }
keyStoreIsEmpty
278,071
X509TrustManager () { try { if (myFactory != null && myKeyStore != null) { myFactory.init(myKeyStore); final TrustManager[] trustManagers = myFactory.getTrustManagers(); final X509TrustManager result = findX509TrustManager(trustManagers); if (result == null) { LOG.error("Cannot find X509 trust manager among " + Arrays....
initFactoryAndGetManager
278,072
boolean () { return myKeyStore == null || myFactory == null || myTrustManager == null; }
isBroken
278,073
CertificateConfirmationParameters (boolean addToKeyStore, @Nullable @NlsContexts.DialogMessage String certificateDetails, @Nullable Runnable onUserAcceptCallback) { return new CertificateConfirmationParameters(true, addToKeyStore, certificateDetails, onUserAcceptCallback, null); }
askConfirmation
278,074
CertificateConfirmationParameters () { return new CertificateConfirmationParameters(false, false, null, null, null); }
doNotAskConfirmation
278,075
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CertificateConfirmationParameters that = (CertificateConfirmationParameters)o; return myAskUser == that.myAskUser && myAddToKeyStore == that.myAddToKeyStore && Objects.equals(myCertificateDetails, that.myCertific...
equals
278,076
int () { return Objects.hash(myAskUser, myAddToKeyStore, myCertificateDetails, myOnUserAcceptCallback); }
hashCode
278,077
X509Certificate () { return myCertificateWrapper.getCertificate(); }
getCertificate
278,078
void (FormBuilder builder, Map<String, @NlsSafe String> fields) { builder = builder.setFormLeftIndent(IdeBorderFactory.TITLED_BORDER_INDENT); for (CommonField field : CommonField.values()) { String value = fields.get(field.getShortName()); if (value == null) { continue; } String label = new HtmlBuilder() .append(field....
updateBuilderWithPrincipalData
278,079
void (FormBuilder builder, @Nls String title) { builder.addComponent(new TitledSeparator(title), IdeBorderFactory.TITLED_BORDER_TOP_INSET); }
updateBuilderWithTitle
278,080
JComponent (@Nls String text) { JTextPane pane = new JTextPane(); pane.setOpaque(false); pane.setEditable(false); pane.setContentType("text/plain"); pane.setText(text); //Messages.installHyperlinkSupport(pane); return pane; }
getTextPane
278,081
JComponent (@NlsContexts.Label String mainText, @Nls String errorText, boolean hasError) { SimpleColoredComponent component = new SimpleColoredComponent(); if (hasError) { component.append(mainText + " (" + errorText + ")", new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.RED)); } else { component.app...
createColoredComponent
278,082
CertificateFactory () { try { return CertificateFactory.getInstance(X509); } catch (CertificateException e) { throw new RuntimeException("Can't initialize X.509 certificate factory", e); } }
createFactory
278,083
String (@NotNull X509Certificate certificate) { return new CertificateWrapper(certificate).getSubjectField(CertificateWrapper.CommonField.COMMON_NAME); }
getCommonName
278,084
CertificateWarningDialog (@NotNull X509Certificate certificate, @Nullable @NlsContexts.DialogMessage String details) { return new CertificateWarningDialog(certificate, IdeBundle.message("dialog.title.untrusted.server.s.certificate"), details == null ? IdeBundle.message("text.server.s.certificate.trusted") : IdeBundle.m...
createUntrustedCertificateWarning
278,085
CertificateWarningDialog (@NotNull X509Certificate certificate) { return createUntrustedCertificateWarning(certificate, null); }
createUntrustedCertificateWarning
278,086
CertificateWarningDialog (@NotNull X509Certificate certificate) { throw new UnsupportedOperationException("Not supported"); }
createExpiredCertificateWarning
278,087
void () { super.revalidateAndRepaint(); updateBounds(); }
revalidateAndRepaint
278,088
void () { super.updateUI(); setOpaque(false); if (myFont == null) { setFont(StartupUiUtil.getLabelFont()); } updateBounds(); }
updateUI
278,089
boolean (@NotNull MouseEvent e, int clickCount) { if (e.getButton() == MouseEvent.BUTTON1 && clickCount == 1) { ActionListener actionListener = findActionListenerAt(e.getPoint()); if (actionListener != null) { actionListener.actionPerformed(new ActionEvent(e, 0, "")); return true; } } return false; }
onClick
278,090
void (final MouseEvent e) { if (isStatusVisibleInner()) { if (findActionListenerAt(e.getPoint()) != null) { if (myOriginalCursor == null) { myOriginalCursor = myMouseTarget.getCursor(); myMouseTarget.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } } else if (myOriginalCursor != null) { myMouseTarget.setCur...
mouseMoved
278,091
boolean () { return myFont != null; }
isFontSet
278,092
void (@NotNull Font font) { setFontImpl(font); }
setFont
278,093
void () { setFontImpl(null); }
resetFont
278,094
void (Font font) { myPrimaryColumn.fragments.forEach(fragment -> fragment.myComponent.setFont(font)); mySecondaryColumn.fragments.forEach(fragment -> fragment.myComponent.setFont(font)); myFont = font; }
setFontImpl
278,095
boolean () { return myCenterAlignText; }
isCenterAlignText
278,096
void (boolean centerAlignText) { myCenterAlignText = centerAlignText; }
setCenterAlignText
278,097
void (@Nullable Component owner) { attachTo(owner, owner); }
attachTo
278,098
void (@Nullable Component owner, @Nullable Component mouseTarget) { if (myOwner != null) { myOwner.removeHierarchyListener(myHierarchyListener); } if (myMouseTarget != null) { myClickListener.uninstall(myMouseTarget); myMouseTarget.removeMouseMotionListener(myMouseMotionListener); } myOwner = owner; myMouseTarget = mou...
attachTo
278,099
boolean () { if (!isStatusVisible()) return false; if (!myInLoadingPanel) return true; JBLoadingPanel loadingPanel = UIUtil.getParentOfType(JBLoadingPanel.class, myOwner); return loadingPanel == null || !loadingPanel.isLoading(); }
isStatusVisibleInner