Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
68,600
InputStream () { return getOriginalProcess().getInputStream(); }
getErrorStream
68,601
void () { if (myRedirectFile == null) { throw new IllegalStateException("No redirect file found"); } if (myRedirectStream == null) { throw new IllegalStateException("No redirect stream found"); } }
checkRedirectFile
68,602
List<String> (@NotNull List<String> arguments) { return ContainerUtil.map(arguments, argument -> needQuote(argument) && !isQuoted(argument) ? quote(argument) : argument); }
escapeArguments
68,603
String (@NotNull String argument) { return StringUtil.wrapWithDoubleQuote(argument); }
quote
68,604
boolean (@NotNull String argument) { return argument.contains(" "); }
needQuote
68,605
boolean (@NotNull String argument) { return StringUtil.startsWithChar(argument, '\"') && StringUtil.endsWithChar(argument, '\"'); }
isQuoted
68,606
void () { myCancelled = true; }
cancel
68,607
boolean () { return myCancelled; }
isCanceled
68,608
void (String line, Key outputType) { }
onLineAvailable
68,609
boolean (String error) { return PATTERN.matcher(error).matches(); }
canHandle
68,610
boolean (String error) { return error.startsWith(CERTIFICATE_ERROR) || // https one-way protocol untrusted server certificate error.contains(UNTRUSTED_SERVER_CERTIFICATE) || // valid but untrusted certificates - "issuer is not trusted" error - for both 1.7 and 1.8. // Implementation not based on SVNKit does not persist...
canHandle
68,611
void (@NotNull Command command) { if (accepted) { command.put("--trust-server-cert"); // force --non-interactive as it is required by --trust-server-cert, but --non-interactive is not default mode for 1.7 or earlier command.put("--non-interactive"); } }
updateParameters
68,612
boolean (@NotNull String error) { return error.contains(CERTIFICATE_ISSUER_NOT_TRUSTED); }
isValidButUntrustedCertificate
68,613
boolean (@NotNull String error) { return error.contains(CERTIFICATE_VERIFICATION_FAILED); }
isCertificateVerificationFailed
68,614
boolean () { return true; }
processHasSeparateErrorStream
68,615
BaseDataReader () { return new SimpleOutputReader(createProcessErrReader(), ProcessOutputTypes.STDERR, BaseOutputReader.Options.BLOCKING, "error stream of " + myPresentableName); }
createErrorDataReader
68,616
String (@NotNull String currentLine) { // for windows platform output is assumed in format suitable for terminal emulator // for instance, same text could be returned twice with '\r' symbol in between (so in emulator output we'll still see correct // text without duplication) // because of this we manually process '\r'...
filterCombinedText
68,617
String (@NotNull String text) { // filter terminal escape codes - they are presented in the output for windows platform text = text.replaceAll(CSI_ESCAPE_CODE, "").replaceAll(NON_CSI_ESCAPE_CODE, ""); // trim leading '\r' symbols - as they break xml parsing logic text = StringUtil.trimLeading(text, '\r'); return text; ...
filterText
68,618
Key (@NotNull String line, @NotNull Key outputType) { return outputType; }
resolveOutputType
68,619
String (@NotNull String line) { int caretReturn = line.lastIndexOf("\r"); while (caretReturn >= 0) { if (caretReturn + 1 < line.length() && line.charAt(caretReturn + 1) != '\n') { // next symbol is not '\n' - we should not treat text before found caret return symbol line = line.substring(caretReturn + 1); break; } care...
removeAllBeforeCaretReturn
68,620
boolean (String error) { return // svn 1.7 proxy error message error.contains(CANNOT_AUTHENTICATE_TO_PROXY) || // svn 1.8 proxy error message error.contains(PROXY_AUTHENTICATION_FAILED); }
canHandle
68,621
void (@NotNull Command command) { // TODO: This is quite messy logic for determining group for host - either ProxyCallback could be unified with ProxyModule // TODO: or group name resolved in ProxyModule could be saved in Command instance. // TODO: This will be done later after corresponding refactorings. String proxyH...
updateParameters
68,622
String (@NotNull String proxyHostParameter) { int start = proxyHostParameter.indexOf(":"); int finish = proxyHostParameter.indexOf(":", start + 1); return proxyHostParameter.substring(start + 1, finish); }
getHostGroup
68,623
void (@NotNull Command command) { if (!CommandRuntime.isLocal(command) && !SshConnectionType.SUBVERSION_CONFIG.equals(getState().sshConnectionType)) { command.put("--config-option", "config:tunnels:ssh=" + buildTunnelValue()); } }
onStart
68,624
SvnConfiguration () { return myRuntime.getVcs().getSvnConfiguration(); }
getConfiguration
68,625
SvnConfigurationState () { return getConfiguration().getState(); }
getState
68,626
String () { String sshPath = getState().sshExecutablePath; sshPath = !isEmpty(sshPath) ? sshPath : getExecutablePath(getConfiguration().getSshTunnelSetting()); List<String> parameters = toCommandLine(sshPath, buildTunnelCommandLine(sshPath).getParametersList().getParameters()); parameters.set(0, toSystemIndependentName...
buildTunnelValue
68,627
GeneralCommandLine (@NotNull String sshPath) { GeneralCommandLine result = new GeneralCommandLine(sshPath); boolean isPuttyLinkClient = endsWithIgnoreCase(FileUtilRt.getNameWithoutExtension(sshPath), PUTTY_LINK_CLIENT_NAME); SvnConfigurationState state = getState(); // quiet mode if (!isPuttyLinkClient) { result.addPar...
buildTunnelCommandLine
68,628
String (@Nullable String tunnelSetting) { tunnelSetting = !isEmpty(tunnelSetting) ? tunnelSetting : DEFAULT_SSH_TUNNEL_VALUE; String svnSshVariableName = getSvnSshVariableName(tunnelSetting); String svnSshVariableValue = EnvironmentUtil.getValue(svnSshVariableName); return !isEmpty(svnSshVariableValue) ? svnSshVariable...
getSshTunnelValue
68,629
String (@Nullable String tunnel) { return tunnel != null && tunnel.startsWith("$") ? notNull(substringBefore(tunnel, " "), tunnel).substring(1) : ""; }
getSvnSshVariableName
68,630
void (@NotNull Command command) { // TODO: Actually command handler should be used as canceller, but currently all handlers use same cancel logic - // TODO: - just check progress indicator command.setCanceller(new SvnProgressCanceller()); for (CommandRuntimeModule module : myModules) { module.onStart(command); } }
onStart
68,631
void (@NotNull CommandExecutor executor) { // could be situations when exit code = 0, but there is info "warning" in error stream for instance, for "svn status" // on non-working copy folder if (!StringUtil.isEmptyOrSpaces(executor.getErrorOutput())) { // here exitCode == 0, but some warnings are in error stream LOG.in...
handleSuccess
68,632
void () { myAuthenticationService.reset(); }
onFinish
68,633
void (@NotNull CommandExecutor executor, @Nullable Integer exitCode) { if (exitCode == null) { LOG.info("Null exit code returned, but not errors detected " + executor.getCommandText()); } }
logNullExitCode
68,634
AuthCallbackCase (@NotNull final String errText, @Nullable final Url url, boolean isUnderTerminal) { List<AuthCallbackCase> authCases = new ArrayList<>(); if (isUnderTerminal) { // Subversion client does not prompt for proxy credentials (just fails with error) even in terminal mode. So we handle this case the // same w...
createCallback
68,635
CommandExecutor (@NotNull Command command) { final CommandExecutor executor; if (!myVcs.getSvnConfiguration().isRunUnderTerminal() || isLocal(command)) { command.putIfNotPresent("--non-interactive"); executor = new CommandExecutor(exePath, command); } else { // do not explicitly specify "--force-interactive" as it is n...
newExecutor
68,636
TerminalExecutor (@NotNull Command command) { return SystemInfo.isWindows ? new WinTerminalExecutor(exePath, command) : new TerminalExecutor(exePath, command); }
newTerminalExecutor
68,637
boolean (@NotNull Command command) { return SvnCommandName.version.equals(command.getName()) || SvnCommandName.cleanup.equals(command.getName()) || SvnCommandName.add.equals(command.getName()) || // currently "svn delete" is only applied to local files SvnCommandName.delete.equals(command.getName()) || SvnCommandName.r...
isLocal
68,638
AuthenticationService () { return myAuthenticationService; }
getAuthenticationService
68,639
SvnVcs () { return myVcs; }
getVcs
68,640
boolean (String line, Key outputType) { return checkCertificate(line); }
doHandlePrompt
68,641
boolean (String line) { Matcher certificateErrorMatcher = ERROR_VALIDATING_CERTIFICATE_MESSAGE.matcher(line); Matcher certificateInfoMatcher = CERTIFICATE_INFORMATION_MESSAGE.matcher(line); Matcher acceptCertificateMatcher = ACCEPT_CERTIFICATE_PROMPT.matcher(line); if (certificateErrorMatcher.matches()) { serverUrl = c...
checkCertificate
68,642
void (boolean collectInfo, boolean collectError) { collectingCertificateInfo = collectInfo; collectingCertificateError = collectError; if (collectingCertificateInfo) { certificateInfo.setLength(0); } if (collectingCertificateError) { certificateError.setLength(0); } }
setCollectingMode
68,643
void () { // TODO: show 'certificateError' in dialog Url url = SvnUtil.parseUrl(serverUrl); AcceptResult result = myRuntime.getAuthenticationService().acceptCertificate(url, certificateInfo.toString()); sendData(result.toString()); }
handleAcceptCertificatePrompt
68,644
List<String> (@NotNull Command command) { List<String> parameters = command.getParameters(); detectAndRemoveMessage(parameters); return parameters; }
prepareParameters
68,645
void (@NotNull List<String> parameters) { int index = parameters.indexOf("-m"); index = index < 0 ? parameters.indexOf("--message") : index; if (index >= 0 && index + 1 < parameters.size()) { myMessage = parameters.get(index + 1); parameters.remove(index + 1); parameters.remove(index); } }
detectAndRemoveMessage
68,646
boolean () { return myIsDestroyed; }
isManuallyDestroyed
68,647
void () { deleteTempFiles(); }
cleanup
68,648
void () { myCommandLine.withEnvironment(VcsLocaleHelper.getDefaultLocaleEnvironmentVars("svn")); }
setupLocale
68,649
void () { for (File file : myTempFiles) { deleteTempFile(file); } }
deleteTempFiles
68,650
File () { File vcsFolder = new File(PathManager.getSystemPath(), "vcs"); return new File(vcsFolder, "svn"); }
getSvnFolder
68,651
void (@Nullable File file) { if (file != null) { boolean wasDeleted = FileUtil.delete(file); if (!wasDeleted) { LOG.info("Failed to delete temp file " + file.getAbsolutePath()); } } }
deleteTempFile
68,652
SvnProcessHandler () { return new SvnProcessHandler(myProcess, myCommandLine.getCommandLineString(), needsUtf8Output(), needsBinaryOutput()); }
createProcessHandler
68,653
boolean () { // TODO: Add ability so that command could indicate output type it needs by itself return myCommand.is(SvnCommandName.cat) || (myCommand.is(SvnCommandName.diff) && !myCommand.getParameters().contains("--xml")); }
needsBinaryOutput
68,654
boolean () { return myCommand.getParameters().contains("--xml"); }
needsUtf8Output
68,655
GeneralCommandLine () { return new GeneralCommandLine(); }
createCommandLine
68,656
void () { outputAdapter = new CapturingProcessAdapter(); myHandler.addProcessListener(outputAdapter); myHandler.addProcessListener(new ProcessTracker()); myHandler.addProcessListener(new ResultBuilderNotifier(listeners())); myHandler.addProcessListener(new CommandOutputLogger()); myHandler.startNotify(); }
startHandlingStreams
68,657
ProcessOutput () { return outputAdapter.getOutput(); }
getProcessOutput
68,658
ByteArrayOutputStream () { return myHandler.getBinaryOutput(); }
getBinaryOutput
68,659
Command () { return myCommand; }
getCommand
68,660
boolean (int timeout) { checkStarted(); final OSProcessHandler handler; synchronized (myLock) { // TODO: This line seems to cause situation when exitCode is not set before SvnLineCommand.runCommand() is finished. // TODO: Carefully analyze behavior (on all operating systems) and fix. if (myIsDestroyed) return true; han...
waitFor
68,661
void () { synchronized (myLock) { checkStarted(); destroyProcess(); } }
cancel
68,662
void (final LineCommandListener listener) { synchronized (myLock) { myListeners.addListener(listener); } }
addListener
68,663
LineCommandListener () { synchronized (myLock) { return myListeners.getMulticaster(); } }
listeners
68,664
boolean () { if (!myWasCancelled && myCommand.getCanceller() != null) { try { myCommand.getCanceller().checkCancelled(); } catch (ProcessCanceledException e) { myWasCancelled = true; } } return myWasCancelled; }
checkCancelled
68,665
void () { synchronized (myLock) { myNeedsDestroy = true; } }
destroyProcess
68,666
void (@DialogMessage @Nullable String destroyReason) { synchronized (myLock) { myDestroyReason = destroyReason; myNeedsDestroy = true; } }
destroyProcess
68,667
void () { synchronized (myLock) { if (!myIsDestroyed) { LOG.info("Destroying process by command: " + getCommandText()); myIsDestroyed = true; myHandler.destroyProcess(); } } }
doDestroyProcess
68,668
boolean () { synchronized (myLock) { return myNeedsDestroy; } }
needsDestroy
68,669
void () { if (isStarted()) { throw new IllegalStateException("The process has been already started"); } }
checkNotStarted
68,670
void () { if (!isStarted()) { throw new IllegalStateException("The process is not started yet"); } }
checkStarted
68,671
boolean () { synchronized (myLock) { return myProcess != null; } }
isStarted
68,672
SvnCommandName () { return myCommand.getName(); }
getCommandName
68,673
Integer () { return myExitCodeReference.get(); }
getExitCodeReference
68,674
void (int value) { myExitCodeReference.set(value); }
setExitCodeReference
68,675
Boolean () { return myWasError.get(); }
wasError
68,676
void () { LOG.info("Command text " + getCommandText()); LOG.info("Command output " + getOutput()); }
logCommand
68,677
void (String line, Key outputType) { if (myResultBuilder != null && myResultBuilder.isCanceled()) { LOG.info("Cancelling command: " + getCommandText()); destroyProcess(); } }
onLineAvailable
68,678
void (@NotNull ProcessEvent event) { setExitCodeReference(event.getExitCode()); }
processTerminated
68,679
void (@NotNull ProcessEvent event, @NotNull Key outputType) { if (ProcessOutputTypes.STDERR == outputType) { myWasError.set(true); } }
onTextAvailable
68,680
ByteArrayOutputStream () { return myBinaryOutput; }
getBinaryOutput
68,681
Charset () { return myForceUtf8 ? StandardCharsets.UTF_8 : super.getCharset(); }
getCharset
68,682
BaseDataReader () { if (myForceBinary) { return new SimpleBinaryOutputReader(myProcess.getInputStream(), readerOptions().policy()); } else { return super.createOutputDataReader(); } }
createOutputDataReader
68,683
void (byte @NotNull [] data, int size) { myBinaryOutput.write(data, 0, size); }
onBinaryAvailable
68,684
void (@NotNull List<? super String> parameters, boolean condition, @NonNls @NotNull String value) { if (condition) { parameters.add(value); } }
put
68,685
void (@NotNull List<? super String> parameters, @NonNls @NotNull String @NotNull ... values) { ContainerUtil.addAll(parameters, values); }
put
68,686
void (@NotNull List<? super String> parameters, @NotNull File path) { put(parameters, path.getAbsolutePath(), Revision.UNDEFINED); }
put
68,687
void (@NotNull List<? super String> parameters, @NotNull File path, boolean usePegRevision) { if (usePegRevision) { put(parameters, path); } else { parameters.add(path.getAbsolutePath()); } }
put
68,688
void (@NotNull List<? super String> parameters, @NotNull File path, @Nullable Revision pegRevision) { put(parameters, path.getAbsolutePath(), pegRevision); }
put
68,689
void (@NotNull List<? super String> parameters, @NotNull String path, @Nullable Revision pegRevision) { parameters.add(format(path, pegRevision)); }
put
68,690
String (@NotNull String path, @Nullable Revision pegRevision) { StringBuilder builder = new StringBuilder(path); boolean hasAtSymbol = path.contains("@"); boolean hasPegRevision = pegRevision != null && !Revision.UNDEFINED.equals(pegRevision) && !Revision.WORKING.equals(pegRevision) && pegRevision.isValid(); if (hasPeg...
format
68,691
void (@NotNull List<? super String> parameters, @NotNull Target target) { put(parameters, target.getPath(), target.getPegRevision()); }
put
68,692
void (@NotNull List<? super String> parameters, @NotNull Target target, boolean usePegRevision) { if (usePegRevision) { put(parameters, target); } else { parameters.add(target.getPath()); } }
put
68,693
void (@NotNull List<? super String> parameters, @Nullable Depth depth) { put(parameters, depth, false); }
put
68,694
void (@NotNull List<? super String> parameters, @Nullable Depth depth, boolean sticky) { if (depth != null && !Depth.UNKNOWN.equals(depth)) { put(parameters, "--depth", depth.getName()); if (sticky) { put(parameters, "--set-depth", depth.getName()); } } }
put
68,695
void (@NotNull List<? super String> parameters, @Nullable Revision revision) { if (revision != null && !Revision.UNDEFINED.equals(revision) && !Revision.WORKING.equals(revision) && revision.isValid()) { put(parameters, "--revision", format(revision)); } }
put
68,696
void (@NotNull List<? super String> parameters, @NotNull Revision startRevision, @NotNull Revision endRevision) { put(parameters, "--revision", format(startRevision) + ":" + format(endRevision)); }
put
68,697
String (@NotNull Revision revision) { return revision.getDate() != null ? "{" + DateFormatUtil.getIso8601Format().format(revision.getDate()) + "}" : revision.toString(); }
format
68,698
void (@NotNull List<? super String> parameters, @Nullable DiffOptions diffOptions) { if (diffOptions == null) return; List<String> extensions = asList( diffOptions.isIgnoreAllWhitespace() ? IGNORE_SPACE_CHANGE_DIFF_EXTENSION : null, diffOptions.isIgnoreAmountOfWhitespace() ? IGNORE_ALL_SPACE_DIFF_EXTENSION : null, diff...
put
68,699
void (@NotNull List<? super String> parameters, @Nullable Iterable<String> changeLists) { if (changeLists == null) return; for (String changeList : changeLists) { put(parameters, "--cl", changeList); } }
putChangeLists