Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
|---|---|---|
8,900
|
RedmineRepository () { return new RedmineRepository(this); }
|
clone
|
8,901
|
CancellableConnection () { return new NewBaseRepositoryImpl.HttpTestConnection(new HttpGet()) { @Override protected void test() throws Exception { // Strangely, Redmine doesn't return 401 or 403 error codes, if client sent wrong credentials, and instead // merely returns empty array of issues with status code of 200. This means that we should attempt to fetch // something more specific than issues to test proper configuration, e.g. current user information at // /users/current.json. Unfortunately this endpoint may be unavailable on some old servers (see IDEA-122845) // and in this case we have to come back to requesting issues in this case to test anything at all. URIBuilder uriBuilder = createUriBuilderWithApiKey("users", "current.json"); myCurrentRequest.setURI(uriBuilder.build()); HttpClient client = getHttpClient(); HttpResponse httpResponse = client.execute(myCurrentRequest); StatusLine statusLine = httpResponse.getStatusLine(); if (statusLine != null && statusLine.getStatusCode() == HttpStatus.SC_NOT_FOUND) { // Check that projects can be downloaded via given URL and the latter is not project-specific myCurrentRequest = new HttpGet(getProjectsUrl(0, 1)); statusLine = client.execute(myCurrentRequest).getStatusLine(); if (statusLine != null && statusLine.getStatusCode() == HttpStatus.SC_OK) { myCurrentRequest = new HttpGet(getIssuesUrl(0, 1, true)); statusLine = client.execute(myCurrentRequest).getStatusLine(); } } if (statusLine != null && statusLine.getStatusCode() != HttpStatus.SC_OK) { throw RequestFailedException.forStatusCode(statusLine.getStatusCode(), statusLine.getReasonPhrase()); } } }; }
|
createCancellableConnection
|
8,902
|
String () { return myAPIKey; }
|
getAPIKey
|
8,903
|
void (String APIKey) { myAPIKey = APIKey; }
|
setAPIKey
|
8,904
|
boolean () { return myAssignedToMe; }
|
isAssignedToMe
|
8,905
|
void (boolean assignedToMe) { this.myAssignedToMe = assignedToMe; }
|
setAssignedToMe
|
8,906
|
boolean () { return !isUseHttpAuthentication() && StringUtil.isNotEmpty(myAPIKey); }
|
isUseApiKeyAuthentication
|
8,907
|
String () { String name = super.getPresentableName(); if (myCurrentProject != null && myCurrentProject != UNSPECIFIED_PROJECT) { name += "/projects/" + StringUtil.notNullize(myCurrentProject.getIdentifier(), String.valueOf(myCurrentProject.getId())); //NON-NLS } return name; }
|
getPresentableName
|
8,908
|
boolean () { if (!super.isConfigured()) return false; if (isUseHttpAuthentication()) { return StringUtil.isNotEmpty(myPassword) && StringUtil.isNotEmpty(myUsername); } return StringUtil.isNotEmpty(myAPIKey); }
|
isConfigured
|
8,909
|
String (@NotNull String taskName) { return ID_PATTERN.matcher(taskName).matches() ? taskName : null; }
|
extractId
|
8,910
|
int () { return super.getFeatures() & ~NATIVE_SEARCH | BASIC_HTTP_AUTHORIZATION; }
|
getFeatures
|
8,911
|
RedmineProject () { return myCurrentProject; }
|
getCurrentProject
|
8,912
|
void (@Nullable RedmineProject project) { myCurrentProject = project != null && project.getId() == -1 ? UNSPECIFIED_PROJECT : project; }
|
setCurrentProject
|
8,913
|
List<RedmineProject> () { try { ensureProjectsDiscovered(); } catch (Exception ignored) { return Collections.emptyList(); } return Collections.unmodifiableList(myProjects); }
|
getProjects
|
8,914
|
void (@NotNull List<RedmineProject> projects) { myProjects = projects; }
|
setProjects
|
8,915
|
boolean (Object o) { if (this == o) return true; if (!(o instanceof RedmineProject project)) return false; return id == project.id; }
|
equals
|
8,916
|
int () { return id; }
|
hashCode
|
8,917
|
int () { return id; }
|
getId
|
8,918
|
void (int id) { this.id = id; }
|
setId
|
8,919
|
String () { return identifier; }
|
getIdentifier
|
8,920
|
void (@NotNull String identifier) { this.identifier = identifier; }
|
setIdentifier
|
8,921
|
RedmineProject () { return parent; }
|
getParent
|
8,922
|
String () { return getName(); }
|
toString
|
8,923
|
int () { return offset; }
|
getOffset
|
8,924
|
int () { return limit; }
|
getLimit
|
8,925
|
int () { return totalCount; }
|
getTotalCount
|
8,926
|
List<RedmineIssue> () { return issues; }
|
getIssues
|
8,927
|
RedmineIssue () { return issue; }
|
getIssue
|
8,928
|
List<RedmineProject> () { return projects; }
|
getProjects
|
8,929
|
int () { return id; }
|
getId
|
8,930
|
IssueStatus () { return status; }
|
getStatus
|
8,931
|
int () { return doneRatio; }
|
getDoneRatio
|
8,932
|
Date () { return created; }
|
getCreated
|
8,933
|
Date () { return updated; }
|
getUpdated
|
8,934
|
RedmineProject () { return project; }
|
getProject
|
8,935
|
int () { return id; }
|
getId
|
8,936
|
String () { return name; }
|
getName
|
8,937
|
boolean (Object o) { if (!super.equals(o)) return false; if (!(o instanceof JiraRepository repository)) return false; if (!Objects.equals(mySearchQuery, repository.getSearchQuery())) return false; if (!Objects.equals(myJiraVersion, repository.getJiraVersion())) return false; if (!Comparing.equal(myInCloud, repository.isInCloud())) return false; if (!Comparing.equal(myUseBearerTokenAuthentication, repository.isUseBearerTokenAuthentication())) return false; return true; }
|
equals
|
8,938
|
JiraRepository () { return new JiraRepository(this); }
|
clone
|
8,939
|
CancellableConnection () { clearCookies(); // TODO cancellable connection for XML_RPC? return new CancellableConnection() { @Override protected void doTest() throws Exception { ensureApiVersionDiscovered(); myApiVersion.findTasks(mySearchQuery, 1); } @Override public void cancel() { // do nothing for now } }; }
|
createCancellableConnection
|
8,940
|
void () { // do nothing for now }
|
cancel
|
8,941
|
boolean (@NotNull JsonObject serverInfo) { final JsonElement deploymentType = serverInfo.get("deploymentType"); if (deploymentType != null) { return deploymentType.getAsString().equals("Cloud"); } // Legacy heuristics final boolean atlassianSubDomain = isAtlassianNetSubDomain(serverInfo.get("baseUrl").getAsString()); if (atlassianSubDomain) { return true; } // JIRA OnDemand versions contained "OD" abbreviation return serverInfo.get("version").getAsString().contains("OD") ; }
|
isHostedInCloud
|
8,942
|
boolean (@NotNull String url) { return hostEndsWith(url, ".atlassian.net"); }
|
isAtlassianNetSubDomain
|
8,943
|
boolean (@NotNull String url, @NotNull String suffix) { try { final URL parsed = new URL(url); return parsed.getHost().endsWith(suffix); } catch (MalformedURLException ignored) { } return false; }
|
hostEndsWith
|
8,944
|
JiraLegacyApi () { try { XmlRpcClient client = new XmlRpcClient(getUrl()); Vector<String> parameters = new Vector<>(Collections.singletonList("")); XmlRpcRequest request = new XmlRpcRequest("jira1.getServerInfo", parameters); @SuppressWarnings("unchecked") Hashtable<String, Object> response = (Hashtable<String, Object>)client.execute(request, new CommonsXmlRpcTransport(new URL(getUrl()), getHttpClient())); if (response != null) { myJiraVersion = (String)response.get("version"); } } catch (Exception e) { LOG.error("Cannot find out JIRA version via XML-RPC", e); } return new JiraLegacyApi(this); }
|
createLegacyApi
|
8,945
|
boolean () { return myInCloud; }
|
isInCloud
|
8,946
|
void (boolean inCloud) { myInCloud = inCloud; }
|
setInCloud
|
8,947
|
boolean () { return myUseBearerTokenAuthentication; }
|
isUseBearerTokenAuthentication
|
8,948
|
void (boolean useBearerTokenAuthentication) { if (useBearerTokenAuthentication != isUseBearerTokenAuthentication()) { myUseBearerTokenAuthentication = useBearerTokenAuthentication; reconfigureClient(); } }
|
setUseBearerTokenAuthentication
|
8,949
|
boolean (@NotNull HttpClient client, @NotNull String cookieName) { for (Cookie cookie : client.getState().getCookies()) { if (cookie.getName().equals(cookieName) && !cookie.isExpired()) { return true; } } return false; }
|
containsCookie
|
8,950
|
void () { getHttpClient().getState().clearCookies(); }
|
clearCookies
|
8,951
|
HttpClient () { return super.getHttpClient(); }
|
getHttpClient
|
8,952
|
void (HttpClient client) { super.configureHttpClient(client); if (isUseBearerTokenAuthentication()) { client.getParams().setAuthenticationPreemptive(true); client.getState().clearCredentials(); } client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); }
|
configureHttpClient
|
8,953
|
int () { int features = super.getFeatures(); if (isRestApiSupported()) { return features | TIME_MANAGEMENT | STATE_UPDATING; } else { return features & ~NATIVE_SEARCH & ~STATE_UPDATING & ~TIME_MANAGEMENT; } }
|
getFeatures
|
8,954
|
boolean () { return myApiVersion == null || myApiVersion.getType() != JiraRemoteApi.ApiType.LEGACY; }
|
isRestApiSupported
|
8,955
|
boolean () { return isRestApiSupported(); }
|
isJqlSupported
|
8,956
|
String () { return mySearchQuery; }
|
getSearchQuery
|
8,957
|
void (String searchQuery) { mySearchQuery = searchQuery; }
|
setSearchQuery
|
8,958
|
void (String url) { // Compare only normalized URLs final String oldUrl = getUrl(); super.setUrl(url); // reset remote API version, only if server URL was changed if (!getUrl().equals(oldUrl)) { myApiVersion = null; myInCloud = isAtlassianNetSubDomain(getUrl()); } }
|
setUrl
|
8,959
|
void (@Nullable JiraRemoteApi.ApiType type) { if (type != null) { myApiVersion = type.createApi(this); } }
|
setApiType
|
8,960
|
String () { return myJiraVersion; }
|
getJiraVersion
|
8,961
|
void (@Nullable String jiraVersion) { myJiraVersion = jiraVersion; }
|
setJiraVersion
|
8,962
|
String (String... parts) { return getUrl() + REST_API_PATH + "/" + StringUtil.join(parts, "/"); }
|
getRestUrl
|
8,963
|
void () { myRepository.setSearchQuery(mySearchQueryField.getText()); myRepository.setUseBearerTokenAuthentication(myUseBearerTokenAuthenticationCheckBox.isSelected()); super.apply(); adjustSettingsForServerProperties(); }
|
apply
|
8,964
|
void (boolean connectionSuccessful) { super.afterTestConnection(connectionSuccessful); if (connectionSuccessful) { adjustSettingsForServerProperties(); } }
|
afterTestConnection
|
8,965
|
JComponent () { mySearchQueryField = new LanguageTextField(JqlLanguage.INSTANCE, myProject, myRepository.getSearchQuery()); installListener(mySearchQueryField); mySearchLabel = new JBLabel(TaskBundle.message("label.search"), SwingConstants.RIGHT); myNoteLabel = new JBLabel(); myNoteLabel.setComponentStyle(UIUtil.ComponentStyle.SMALL); myUseBearerTokenAuthenticationCheckBox = new JCheckBox(TaskApiBundle.message("use.personal.access.token")); myUseBearerTokenAuthenticationCheckBox.setSelected(myRepository.isUseBearerTokenAuthentication()); myUseBearerTokenAuthenticationCheckBox.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { useBearerTokenChanged(); } }); adjustSettingsForServerProperties(); return FormBuilder.createFormBuilder() .addComponentToRightColumn(myUseBearerTokenAuthenticationCheckBox) .addLabeledComponent(mySearchLabel, mySearchQueryField) .addComponentToRightColumn(myNoteLabel) .getPanel(); }
|
createCustomPanel
|
8,966
|
void (final ActionEvent e) { useBearerTokenChanged(); }
|
actionPerformed
|
8,967
|
void (@Nullable final JComponent anchor) { super.setAnchor(anchor); mySearchLabel.setAnchor(anchor); }
|
setAnchor
|
8,968
|
void () { if (myRepository.isJqlSupported()) { mySearchQueryField.setEnabled(true); myNoteLabel.setVisible(false); } else { mySearchQueryField.setEnabled(false); myNoteLabel.setText( TaskBundle.message("label.jql.search.cannot.be.used.in.jira.versions.prior.your.version", myRepository.getPresentableVersion())); myNoteLabel.setVisible(true); } if (myRepository.isInCloud()) { myUsernameLabel.setVisible(true); myUserNameText.setVisible(true); myUsernameLabel.setText(TaskBundle.message("label.email")); myPasswordLabel.setText(TaskBundle.message("label.api.token")); myUseBearerTokenAuthenticationCheckBox.setVisible(false); } else if (myUseBearerTokenAuthenticationCheckBox.isSelected()) { myUsernameLabel.setVisible(false); myUserNameText.setVisible(false); myPasswordLabel.setText(TaskBundle.message("label.api.token")); myUseBearerTokenAuthenticationCheckBox.setVisible(true); } else { myUsernameLabel.setVisible(true); myUserNameText.setVisible(true); myUsernameLabel.setText(TaskBundle.message("label.username")); myPasswordLabel.setText(TaskBundle.message("label.password")); myUseBearerTokenAuthenticationCheckBox.setVisible(true); } }
|
adjustSettingsForServerProperties
|
8,969
|
void () { myRepository.setUseBearerTokenAuthentication(myUseBearerTokenAuthenticationCheckBox.isSelected()); adjustSettingsForServerProperties(); }
|
useBearerTokenChanged
|
8,970
|
String () { return myRepository.getUrl() + "/browse/" + getId(); }
|
getIssueUrl
|
8,971
|
Icon () { if (myIcon == null) { // getIconUrl() shouldn't be called before the instance is properly initialized final String iconUrl = getIconUrl(); if (StringUtil.isEmpty(iconUrl)) { myIcon = TasksCoreIcons.Jira; } else { myIcon = new DeferredIconImpl<>(TasksCoreIcons.Jira, iconUrl, false, JiraTask::getIconByUrl); } } return myIcon; }
|
getIcon
|
8,972
|
TaskRepository () { return myRepository; }
|
getRepository
|
8,973
|
boolean () { return getState() == TaskState.RESOLVED; }
|
isClosed
|
8,974
|
boolean () { return true; }
|
isIssue
|
8,975
|
Icon (@Nullable String iconUrl) { return ObjectUtils.notNull(CachedIconLoader.getIcon(iconUrl), AllIcons.FileTypes.Any_type); }
|
getIconByUrl
|
8,976
|
TaskState (int id) { return switch (id) { case 1 -> TaskState.OPEN; case 3 -> TaskState.IN_PROGRESS; case 4 -> TaskState.REOPENED; case 5, // resolved 6 -> // closed TaskState.RESOLVED; default -> null; }; }
|
getStateById
|
8,977
|
TaskType (@Nullable String type) { if (type == null) { return TaskType.OTHER; } else if ("Bug".equals(type)) { return TaskType.BUG; } else if ("Exception".equals(type)) { return TaskType.EXCEPTION; } else if ("New Feature".equals(type)) { return TaskType.FEATURE; } else { return TaskType.OTHER; } }
|
getTypeByName
|
8,978
|
Icon (URL url) { if (url != null) { String key = url.toString(); if (!icons.containsKey(key)) { Icon i = new ImageIcon(url); icons.put(key, i); } return icons.get(key); } else { return null; } }
|
getIcon
|
8,979
|
Icon (String urlString) { if (urlString != null) { if (!icons.containsKey(urlString)) { try { URL url = new URL(urlString); Icon i = new ImageIcon(url); icons.put(urlString, i); } catch (MalformedURLException e1) { return null; } } return icons.get(urlString); } else { return null; } }
|
getIcon
|
8,980
|
String () { return "JIRA"; }
|
getName
|
8,981
|
Icon () { return TasksCoreIcons.Jira; }
|
getIcon
|
8,982
|
JiraRepository () { return new JiraRepository(this); }
|
createRepository
|
8,983
|
Class<JiraRepository> () { return JiraRepository.class; }
|
getRepositoryClass
|
8,984
|
TaskRepositoryEditor (JiraRepository repository, Project project, Consumer<? super JiraRepository> changeListener) { return new JiraRepositoryEditor(project, repository, changeListener); }
|
createEditor
|
8,985
|
EnumSet<TaskState> () { return EnumSet.of(TaskState.OPEN, TaskState.IN_PROGRESS, TaskState.REOPENED, TaskState.RESOLVED); }
|
getPossibleTaskStates
|
8,986
|
String () { return getType().getVersionName(); }
|
getVersionName
|
8,987
|
String () { return "JiraRemoteApi(" + getType().getVersionName() + ")"; }
|
toString
|
8,988
|
JiraLegacyApi (@NotNull JiraRepository repository) { return new JiraLegacyApi(repository); }
|
createApi
|
8,989
|
JiraRestApi2 (@NotNull JiraRepository repository) { return new JiraRestApi2(repository); }
|
createApi
|
8,990
|
JiraRestApi20Alpha1 (@NotNull JiraRepository repository) { return new JiraRestApi20Alpha1(repository); }
|
createApi
|
8,991
|
String () { return myVersionName; }
|
getVersionName
|
8,992
|
int () { return myMajorNumber; }
|
getMajorNumber
|
8,993
|
int () { return myMinorNumber; }
|
getMinorNumber
|
8,994
|
int () { return myMicroNumber; }
|
getMicroNumber
|
8,995
|
String () { return String.format("%d.%d.%d", myMajorNumber, myMinorNumber, myMicroNumber); }
|
toString
|
8,996
|
int (@NotNull JiraVersion o) { return VersionComparatorUtil.compare(toString(), o.toString()); }
|
compareTo
|
8,997
|
String () { return myJiraIssue.getKey(); }
|
getId
|
8,998
|
String () { return myJiraIssue.getSummary(); }
|
getSummary
|
8,999
|
String () { return myJiraIssue.getDescription(); }
|
getDescription
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.