Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
28,000
void (@NotNull Project project, @NonNls @Nullable String displayId, @NotificationTitle @NotNull String title, @NotificationContent @NotNull String message, @NotNull String logDetails) { LOG.warn(title + "; " + message + "; " + logDetails); VcsNotifier.getInstance(project).notifyError(displayId, title, message); }
showError
28,001
void (@NotNull Project project, @NonNls @Nullable String displayId, @NotificationTitle @NotNull String title, @NotNull Throwable e) { LOG.warn(title + "; ", e); if (isOperationCanceled(e)) return; VcsNotifier.getInstance(project).notifyError(displayId, title, getErrorTextFromException(e)); }
showError
28,002
void (@NotNull Project project, @NonNls @Nullable String displayId, @NotificationTitle @NotNull String title, @NotificationContent @NotNull String message, @NotNull String url) { LOG.info(title + "; " + message + "; " + url); VcsNotifier.getInstance(project) .notifyImportantInfo(displayId, title, HtmlChunk.link(url, message).toString(), NotificationListener.URL_OPENING_LISTENER); }
showInfoURL
28,003
void (@NotNull Project project, @NonNls @Nullable String displayId, @NotificationTitle @NotNull String title, @NotNull String prefix, @NotNull String highlight, @NotNull String postfix, @NotNull String url) { LOG.info(title + "; " + prefix + highlight + postfix + "; " + url); //noinspection HardCodedStringLiteral VcsNotifier.getInstance(project).notifyImportantWarning(displayId, title, prefix + "<a href='" + url + "'>" + highlight + "</a>" + postfix, NotificationListener.URL_OPENING_LISTENER); }
showWarningURL
28,004
void (@NotNull Project project, @NonNls @Nullable String displayId, @NotificationTitle @NotNull String title, @NotNull String prefix, @NotNull String highlight, @NotNull String postfix, @NotNull String url) { LOG.info(title + "; " + prefix + highlight + postfix + "; " + url); //noinspection HardCodedStringLiteral VcsNotifier.getInstance(project).notifyError(displayId, title, prefix + "<a href='" + url + "'>" + highlight + "</a>" + postfix, NotificationListener.URL_OPENING_LISTENER); }
showErrorURL
28,005
void (@Nullable Project project, @NotificationTitle @NotNull String title, @NotificationContent @NotNull String message) { LOG.info(title + "; " + message); Messages.showWarningDialog(project, message, title); }
showWarningDialog
28,006
void (@Nullable Project project, @NotificationTitle @NotNull String title, @NotificationContent @NotNull String message) { LOG.info(title + "; " + message); Messages.showErrorDialog(project, message, title); }
showErrorDialog
28,007
boolean (@Nullable Project project, @NotificationTitle @NotNull String title, @NotificationContent @NotNull String message) { return MessageDialogBuilder.yesNo(title, message).ask(project); }
showYesNoDialog
28,008
boolean (@Nullable Project project, @NotificationTitle @NotNull String title, @NotificationContent @NotNull String message, @NotNull DoNotAskOption doNotAskOption) { return MessageDialogBuilder.yesNo(title, message) .icon(Messages.getQuestionIcon()) .doNotAsk(doNotAskOption) .ask(project); }
showYesNoDialog
28,009
AnAction (@NotNull Project project) { return NotificationAction.createSimple(GitBundle.messagePointer("action.NotificationAction.GithubNotifications.text.configure"), () -> ShowSettingsUtil.getInstance() .showSettingsDialog(project, GithubUtil.SERVICE_DISPLAY_NAME)); }
getConfigureAction
28,010
State () { return myState; }
getState
28,011
void (@NotNull State state) { myState = state; }
loadState
28,012
GithubSettings () { return ApplicationManager.getApplication().getService(GithubSettings.class); }
getInstance
28,013
int () { return myState.CONNECTION_TIMEOUT; }
getConnectionTimeout
28,014
void (int timeout) { myState.CONNECTION_TIMEOUT = timeout; }
setConnectionTimeout
28,015
boolean () { return myState.OPEN_IN_BROWSER_GIST; }
isOpenInBrowserGist
28,016
boolean () { return myState.COPY_URL_GIST; }
isCopyURLGist
28,017
void (boolean copyLink) { myState.COPY_URL_GIST = copyLink; }
setCopyURLGist
28,018
boolean () { return myState.PRIVATE_GIST; }
isPrivateGist
28,019
boolean () { return myState.CLONE_GIT_USING_SSH; }
isCloneGitUsingSsh
28,020
void (final boolean secretGist) { myState.PRIVATE_GIST = secretGist; }
setPrivateGist
28,021
void (final boolean openInBrowserGist) { myState.OPEN_IN_BROWSER_GIST = openInBrowserGist; }
setOpenInBrowserGist
28,022
void (boolean value) { myState.CLONE_GIT_USING_SSH = value; }
setCloneGitUsingSsh
28,023
GHRepositoryPath (@NotNull String remoteUrl) { remoteUrl = removeProtocolPrefix(removeEndingDotGit(remoteUrl)); int index1 = remoteUrl.lastIndexOf('/'); if (index1 == -1) { return null; } String url = remoteUrl.substring(0, index1); int index2 = Math.max(url.lastIndexOf('/'), url.lastIndexOf(':')); if (index2 == -1) { return null; } final String username = remoteUrl.substring(index2 + 1, index1); final String reponame = remoteUrl.substring(index1 + 1); if (username.isEmpty() || reponame.isEmpty()) { return null; } return new GHRepositoryPath(username, reponame); }
getUserAndRepositoryFromRemoteUrl
28,024
String (@NotNull String url) { String path = removeProtocolPrefix(url).replace(':', '/'); int index = path.indexOf('/'); if (index == -1) { return path; } else { return path.substring(0, index); } }
getHostFromUrl
28,025
String (@NotNull String remoteUrl, @NotNull String host) { GHRepositoryPath repo = getUserAndRepositoryFromRemoteUrl(remoteUrl); if (repo == null) { return null; } return host + '/' + repo.getOwner() + '/' + repo.getRepository(); }
makeGithubRepoUrlFromRemoteUrl
28,026
void (@NotNull DocumentEvent e) { updateTokenButton(); }
textChanged
28,027
JComponent () { myHostLabel = new JBLabel(GithubBundle.message("task.repo.host.field"), SwingConstants.RIGHT); JPanel myHostPanel = new JPanel(new BorderLayout(5, 0)); myHostPanel.add(myURLText, BorderLayout.CENTER); myHostPanel.add(myShareUrlCheckBox, BorderLayout.EAST); myRepositoryLabel = new JBLabel(GithubBundle.message("task.repo.repository.field"), SwingConstants.RIGHT); myRepoAuthor = new MyTextField(GithubBundle.message("task.repo.owner.field.empty.hint")); myRepoName = new MyTextField(GithubBundle.message("task.repo.name.field.empty.hint")); myRepoAuthor.setPreferredSize("SomelongNickname"); myRepoName.setPreferredSize("SomelongReponame-with-suffixes"); JPanel myRepoPanel = new JPanel(new GridBagLayout()); GridBag bag = new GridBag().setDefaultWeightX(1).setDefaultFill(GridBagConstraints.HORIZONTAL); myRepoPanel.add(myRepoAuthor, bag.nextLine().next()); myRepoPanel.add(new JLabel("/"), bag.next().fillCellNone().insets(0, 5, 0, 5).weightx(0)); myRepoPanel.add(myRepoName, bag.next()); myTokenLabel = new JBLabel(GithubBundle.message("task.repo.token.field"), SwingConstants.RIGHT); myToken = new MyTextField(GithubBundle.message("task.repo.token.field.empty.hint")); myTokenButton = new JButton(GithubBundle.message("task.repo.token.create.button")); myTokenButton.addActionListener(e -> { generateToken(); doApply(); }); JPanel myTokenPanel = new JPanel(); myTokenPanel.setLayout(new BorderLayout(5, 5)); myTokenPanel.add(myToken, BorderLayout.CENTER); myTokenPanel.add(myTokenButton, BorderLayout.EAST); myShowNotAssignedIssues = new JBCheckBox(VcsBundle.message("checkbox.include.issues.not.assigned.to.me")); installListener(myRepoAuthor); installListener(myRepoName); installListener(myToken); installListener(myShowNotAssignedIssues); return FormBuilder.createFormBuilder() .setAlignLabelOnRight(true) .addLabeledComponent(myHostLabel, myHostPanel) .addLabeledComponent(myRepositoryLabel, myRepoPanel) .addLabeledComponent(myTokenLabel, myTokenPanel) .addComponentToRightColumn(myShowNotAssignedIssues) .getPanel(); }
createCustomPanel
28,028
void () { super.apply(); myRepository.setRepoName(getRepoName()); myRepository.setRepoAuthor(getRepoAuthor()); myRepository.setPassword(getToken()); myRepository.storeCredentials(); myRepository.setAssignedIssuesOnly(isAssignedIssuesOnly()); }
apply
28,029
void () { String token = GHRepositoryEditorKt.INSTANCE.askToken(myProject, getHost()); if (token != null) { myToken.setText(token); } }
generateToken
28,030
void (@Nullable final JComponent anchor) { super.setAnchor(anchor); myHostLabel.setAnchor(anchor); myRepositoryLabel.setAnchor(anchor); myTokenLabel.setAnchor(anchor); }
setAnchor
28,031
void () { if (StringUtil.isEmptyOrSpaces(getHost()) || StringUtil.isEmptyOrSpaces(getRepoAuthor()) || StringUtil.isEmptyOrSpaces(getRepoName())) { myTokenButton.setEnabled(false); } else { myTokenButton.setEnabled(true); } }
updateTokenButton
28,032
String () { return myURLText.getText().trim(); }
getHost
28,033
String () { return myRepoAuthor.getText().trim(); }
getRepoAuthor
28,034
String () { return myRepoName.getText().trim(); }
getRepoName
28,035
String () { return myToken.getText().trim(); }
getToken
28,036
boolean () { return !myShowNotAssignedIssues.isSelected(); }
isAssignedIssuesOnly
28,037
void (@NotNull String sampleSizeString) { myWidth = getFontMetrics(getFont()).stringWidth(sampleSizeString); }
setPreferredSize
28,038
Dimension () { Dimension size = super.getPreferredSize(); if (myWidth != -1) { size.width = myWidth; } return size; }
getPreferredSize
28,039
void (StringBuilder builder) { builder.append("<hr>"); builder.append("<table>"); builder.append("<tr><td>"); if (myAvatarUrl != null) { builder.append("<img src=\"").append(myAvatarUrl).append("\" height=\"40\" width=\"40\"/><br>"); } builder.append("</td><td>"); if (getAuthor() != null) { builder.append("<b>").append(GithubBundle.message("task.comment.author")).append("</b> <a href=\"").append(myUserHtmlUrl) .append("\">").append(getAuthor()).append("</a><br>"); } if (getDate() != null) { builder.append("<b>").append(GithubBundle.message("task.comment.date")).append("</b> ") .append(DateFormatUtil.formatDateTime(getDate())).append("<br>"); } builder.append("</td></tr></table>"); builder.append(getText()).append("<br>"); }
appendTo
28,040
CancellableConnection () { return new CancellableConnection() { private final GithubApiRequestExecutor myExecutor = getExecutor(); private final ProgressIndicator myIndicator = new EmptyProgressIndicator(); @Override protected void doTest() throws Exception { try { myExecutor.execute(myIndicator, GithubApiRequests.Repos.get(getServer(), getRepoAuthor(), getRepoName())); } catch (ProcessCanceledException ignore) { } } @Override public void cancel() { myIndicator.cancel(); } }; }
createCancellableConnection
28,041
void () { myIndicator.cancel(); }
cancel
28,042
boolean () { return super.isConfigured() && !StringUtil.isEmptyOrSpaces(getRepoAuthor()) && !StringUtil.isEmptyOrSpaces(getRepoName()) && !StringUtil.isEmptyOrSpaces(getPassword()); }
isConfigured
28,043
String () { final String name = super.getPresentableName(); return name + (!StringUtil.isEmpty(getRepoAuthor()) ? "/" + getRepoAuthor() : "") + (!StringUtil.isEmpty(getRepoName()) ? "/" + getRepoName() : ""); }
getPresentableName
28,044
Task (@NotNull GithubIssueBase issue, @NotNull List<GithubIssueCommentWithHtml> comments) { return new Task() { @NotNull private final String myRepoName = getRepoName(); private final Comment @NotNull [] myComments = ContainerUtil.map2Array(comments, Comment.class, comment -> new GithubComment(comment.getCreatedAt(), comment.getUser().getLogin(), comment.getBodyHtml(), comment.getUser().getAvatarUrl(), comment.getUser().getHtmlUrl())); @Override public boolean isIssue() { return true; } @Override public String getIssueUrl() { return issue.getHtmlUrl(); } @Override public @NlsSafe @NotNull String getId() { return myRepoName + "-" + issue.getNumber(); } @NotNull @Override public String getSummary() { return issue.getTitle(); } @Override public String getDescription() { return issue.getBody(); } @Override public Comment @NotNull [] getComments() { return myComments; } @NotNull @Override public Icon getIcon() { return AllIcons.Vcs.Vendors.Github; } @NotNull @Override public TaskType getType() { return TaskType.BUG; } @Override public Date getUpdated() { return issue.getUpdatedAt(); } @Override public Date getCreated() { return issue.getCreatedAt(); } @Override public boolean isClosed() { return issue.getState() == GithubIssueState.closed; } @Override public TaskRepository getRepository() { return GithubRepository.this; } @Override public String getPresentableName() { return getId() + ": " + getSummary(); } }; }
createTask
28,045
boolean () { return true; }
isIssue
28,046
String () { return issue.getHtmlUrl(); }
getIssueUrl
28,047
String () { return issue.getTitle(); }
getSummary
28,048
String () { return issue.getBody(); }
getDescription
28,049
Icon () { return AllIcons.Vcs.Vendors.Github; }
getIcon
28,050
TaskType () { return TaskType.BUG; }
getType
28,051
Date () { return issue.getUpdatedAt(); }
getUpdated
28,052
Date () { return issue.getCreatedAt(); }
getCreated
28,053
boolean () { return issue.getState() == GithubIssueState.closed; }
isClosed
28,054
TaskRepository () { return GithubRepository.this; }
getRepository
28,055
String () { return getId() + ": " + getSummary(); }
getPresentableName
28,056
String (@NotNull String taskName) { Matcher matcher = myPattern.matcher(taskName); return matcher.find() ? matcher.group(1) : null; }
extractId
28,057
BaseRepository () { return new GithubRepository(this); }
clone
28,058
void (@NotNull String repoName) { myRepoName = repoName; myPattern = Pattern.compile("(" + StringUtil.escapeToRegexp(repoName) + "\\-\\d+)"); }
setRepoName
28,059
void (@NotNull String repoAuthor) { myRepoAuthor = repoAuthor; }
setRepoAuthor
28,060
void (@NotNull String user) { myUser = user; }
setUser
28,061
void (String password) { super.setPassword(password); setUser(""); }
setPassword
28,062
boolean () { return myAssignedIssuesOnly; }
isAssignedIssuesOnly
28,063
void (boolean value) { myAssignedIssuesOnly = value; }
setAssignedIssuesOnly
28,064
CredentialAttributes () { String serviceName = CredentialAttributesKt.generateServiceName("Tasks", getRepositoryType().getName() + " " + getPresentableName()); return new CredentialAttributes(serviceName, "GitHub OAuth token"); }
getAttributes
28,065
GithubApiRequestExecutor () { return GithubApiRequestExecutor.Factory.getInstance().create(getPassword(), myUseProxy); }
getExecutor
28,066
ProgressIndicator () { ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); if (indicator == null) indicator = new EmptyProgressIndicator(); return indicator; }
getProgressIndicator
28,067
GithubServerPath () { return GithubServerPath.from(getUrl()); }
getServer
28,068
boolean (Object o) { if (!super.equals(o)) return false; if (!(o instanceof GithubRepository that)) return false; if (!Objects.equals(getRepoAuthor(), that.getRepoAuthor())) return false; if (!Objects.equals(getRepoName(), that.getRepoName())) return false; if (!Comparing.equal(isAssignedIssuesOnly(), that.isAssignedIssuesOnly())) return false; return true; }
equals
28,069
int () { return StringUtil.stringHashCode(getRepoName()) + 31 * StringUtil.stringHashCode(getRepoAuthor()); }
hashCode
28,070
int () { return super.getFeatures() | STATE_UPDATING; }
getFeatures
28,071
String () { return "GitHub"; }
getName
28,072
Icon () { return AllIcons.Vcs.Vendors.Github; }
getIcon
28,073
TaskRepository () { return new GithubRepository(this); }
createRepository
28,074
Class<GithubRepository> () { return GithubRepository.class; }
getRepositoryClass
28,075
TaskRepositoryEditor (GithubRepository repository, Project project, Consumer<? super GithubRepository> changeListener) { return new GithubRepositoryEditor(project, repository, changeListener); }
createEditor
28,076
EnumSet<TaskState> () { return EnumSet.of(TaskState.OPEN, TaskState.RESOLVED); }
getPossibleTaskStates
28,077
AnAction (@NotNull FileAnnotation annotation) { return new GHOpenInBrowserFromAnnotationActionGroup(annotation); }
createAction
28,078
String () { return (myUseHttp == null || !myUseHttp) ? "https" : "http"; }
getSchema
28,079
String () { return myHost; }
getHost
28,080
Integer () { return myPort; }
getPort
28,081
String () { return mySuffix; }
getSuffix
28,082
boolean (@NotNull String gitRemoteUrl) { return GitHostingUrlUtil.match(toURI(), gitRemoteUrl); }
matches
28,083
String () { return toUrl(true); }
toUrl
28,084
String (boolean showSchema) { StringBuilder builder = new StringBuilder(); if (showSchema) builder.append(getSchemaUrlPart()); builder.append(myHost).append(getPortUrlPart()).append(StringUtil.notNullize(mySuffix)); return builder.toString(); }
toUrl
28,085
String () { StringBuilder builder = new StringBuilder(getSchemaUrlPart()); if (isGithubDotCom()) { builder.append(API_PREFIX).append(myHost).append(getPortUrlPart()).append(StringUtil.notNullize(mySuffix)); } else { builder.append(myHost).append(getPortUrlPart()).append(StringUtil.notNullize(mySuffix)).append(API_SUFFIX) .append(ENTERPRISE_API_V3_SUFFIX); } return builder.toString(); }
toApiUrl
28,086
String () { StringBuilder builder = new StringBuilder(getSchemaUrlPart()); if (isGithubDotCom()) { builder.append(API_PREFIX).append(myHost).append(getPortUrlPart()).append(StringUtil.notNullize(mySuffix)).append(GRAPHQL_SUFFIX); } else { builder.append(myHost).append(getPortUrlPart()).append(StringUtil.notNullize(mySuffix)).append(API_SUFFIX).append(GRAPHQL_SUFFIX); } return builder.toString(); }
toGraphQLUrl
28,087
URI () { int port = getPort() == null ? -1 : getPort(); try { return new URI(getSchema(), null, getHost(), port, getSuffix(), null, null); } catch (URISyntaxException e) { // shouldn't happen, because we pre-validate the data throw new RuntimeException(e); } }
toURI
28,088
boolean () { return myHost.equalsIgnoreCase(DEFAULT_HOST); }
isGithubDotCom
28,089
String () { return myPort != null ? (":" + myPort.toString()) : ""; }
getPortUrlPart
28,090
String () { return getSchema() + URLUtil.SCHEME_SEPARATOR; }
getSchemaUrlPart
28,091
boolean (Object o) { return equals(o, false); }
equals
28,092
boolean (Object o, boolean ignoreProtocol) { if (this == o) return true; if (!(o instanceof GithubServerPath path)) return false; return (ignoreProtocol || Objects.equals(myUseHttp, path.myUseHttp)) && Objects.equals(myHost, path.myHost) && Objects.equals(myPort, path.myPort) && Objects.equals(mySuffix, path.mySuffix); }
equals
28,093
int () { return Objects.hash(myHost, myPort, mySuffix); }
hashCode
28,094
String () { return commentsUrl; }
getCommentsUrl
28,095
String () { return htmlUrl; }
getHtmlUrl
28,096
long () { return number; }
getNumber
28,097
GithubIssueState () { return state; }
getState
28,098
List<GithubIssueLabel> () { return labels; }
getLabels
28,099
GithubUser () { return user; }
getUser