id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
164,600 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/scm/svn/SubversionManager.java | SubversionManager.createTag | public void createTag(final String tagUrl, final String commitMessage)
throws IOException, InterruptedException {
build.getWorkspace()
.act(new SVNCreateTagCallable(tagUrl, commitMessage, getLocation(), getSvnAuthenticationProvider(build),
buildListener));
... | java | public void createTag(final String tagUrl, final String commitMessage)
throws IOException, InterruptedException {
build.getWorkspace()
.act(new SVNCreateTagCallable(tagUrl, commitMessage, getLocation(), getSvnAuthenticationProvider(build),
buildListener));
... | [
"public",
"void",
"createTag",
"(",
"final",
"String",
"tagUrl",
",",
"final",
"String",
"commitMessage",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"build",
".",
"getWorkspace",
"(",
")",
".",
"act",
"(",
"new",
"SVNCreateTagCallable",
"(",... | Creates a tag directly from the working copy.
@param tagUrl The URL of the tag to create.
@param commitMessage Commit message
@return The commit info upon successful operation.
@throws IOException On IO of SVN failure | [
"Creates",
"a",
"tag",
"directly",
"from",
"the",
"working",
"copy",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/scm/svn/SubversionManager.java#L71-L76 |
164,601 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/scm/svn/SubversionManager.java | SubversionManager.revertWorkingCopy | public void revertWorkingCopy() throws IOException, InterruptedException {
build.getWorkspace()
.act(new RevertWorkingCopyCallable(getLocation(), getSvnAuthenticationProvider(build), buildListener));
} | java | public void revertWorkingCopy() throws IOException, InterruptedException {
build.getWorkspace()
.act(new RevertWorkingCopyCallable(getLocation(), getSvnAuthenticationProvider(build), buildListener));
} | [
"public",
"void",
"revertWorkingCopy",
"(",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"build",
".",
"getWorkspace",
"(",
")",
".",
"act",
"(",
"new",
"RevertWorkingCopyCallable",
"(",
"getLocation",
"(",
")",
",",
"getSvnAuthenticationProvider"... | Revert all the working copy changes. | [
"Revert",
"all",
"the",
"working",
"copy",
"changes",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/scm/svn/SubversionManager.java#L81-L84 |
164,602 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/scm/svn/SubversionManager.java | SubversionManager.safeRevertWorkingCopy | public void safeRevertWorkingCopy() {
try {
revertWorkingCopy();
} catch (Exception e) {
debuggingLogger.log(Level.FINE, "Failed to revert working copy", e);
log("Failed to revert working copy: " + e.getLocalizedMessage());
Throwable cause = e.getCause();
... | java | public void safeRevertWorkingCopy() {
try {
revertWorkingCopy();
} catch (Exception e) {
debuggingLogger.log(Level.FINE, "Failed to revert working copy", e);
log("Failed to revert working copy: " + e.getLocalizedMessage());
Throwable cause = e.getCause();
... | [
"public",
"void",
"safeRevertWorkingCopy",
"(",
")",
"{",
"try",
"{",
"revertWorkingCopy",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"debuggingLogger",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"\"Failed to revert working copy\"",
",",
... | Attempts to revert the working copy. In case of failure it just logs the error. | [
"Attempts",
"to",
"revert",
"the",
"working",
"copy",
".",
"In",
"case",
"of",
"failure",
"it",
"just",
"logs",
"the",
"error",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/scm/svn/SubversionManager.java#L89-L117 |
164,603 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/IssuesTrackerHelper.java | IssuesTrackerHelper.setIssueTrackerInfo | public void setIssueTrackerInfo(BuildInfoBuilder builder) {
Issues issues = new Issues();
issues.setAggregateBuildIssues(aggregateBuildIssues);
issues.setAggregationBuildStatus(aggregationBuildStatus);
issues.setTracker(new IssueTracker("JIRA", issueTrackerVersion));
Set<Issue> a... | java | public void setIssueTrackerInfo(BuildInfoBuilder builder) {
Issues issues = new Issues();
issues.setAggregateBuildIssues(aggregateBuildIssues);
issues.setAggregationBuildStatus(aggregationBuildStatus);
issues.setTracker(new IssueTracker("JIRA", issueTrackerVersion));
Set<Issue> a... | [
"public",
"void",
"setIssueTrackerInfo",
"(",
"BuildInfoBuilder",
"builder",
")",
"{",
"Issues",
"issues",
"=",
"new",
"Issues",
"(",
")",
";",
"issues",
".",
"setAggregateBuildIssues",
"(",
"aggregateBuildIssues",
")",
";",
"issues",
".",
"setAggregationBuildStatus... | Apply issues tracker info to a build info builder (used by generic tasks and maven2 which doesn't use the extractor | [
"Apply",
"issues",
"tracker",
"info",
"to",
"a",
"build",
"info",
"builder",
"(",
"used",
"by",
"generic",
"tasks",
"and",
"maven2",
"which",
"doesn",
"t",
"use",
"the",
"extractor"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/IssuesTrackerHelper.java#L103-L113 |
164,604 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/BuildRetentionFactory.java | BuildRetentionFactory.createBuildRetention | public static BuildRetention createBuildRetention(Run build, boolean discardOldArtifacts) {
BuildRetention buildRetention = new BuildRetention(discardOldArtifacts);
LogRotator rotator = null;
BuildDiscarder buildDiscarder = build.getParent().getBuildDiscarder();
if (buildDiscarder != nul... | java | public static BuildRetention createBuildRetention(Run build, boolean discardOldArtifacts) {
BuildRetention buildRetention = new BuildRetention(discardOldArtifacts);
LogRotator rotator = null;
BuildDiscarder buildDiscarder = build.getParent().getBuildDiscarder();
if (buildDiscarder != nul... | [
"public",
"static",
"BuildRetention",
"createBuildRetention",
"(",
"Run",
"build",
",",
"boolean",
"discardOldArtifacts",
")",
"{",
"BuildRetention",
"buildRetention",
"=",
"new",
"BuildRetention",
"(",
"discardOldArtifacts",
")",
";",
"LogRotator",
"rotator",
"=",
"n... | Create a Build retention object out of the build
@param build The build to create the build retention out of
@param discardOldArtifacts Flag whether to discard artifacts of those builds that are to be discarded.
@return a new Build retention | [
"Create",
"a",
"Build",
"retention",
"object",
"out",
"of",
"the",
"build"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/BuildRetentionFactory.java#L24-L45 |
164,605 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java | DockerUtils.getImageIdFromTag | public static String getImageIdFromTag(String imageTag, String host) throws IOException {
DockerClient dockerClient = null;
try {
dockerClient = getDockerClient(host);
return dockerClient.inspectImageCmd(imageTag).exec().getId();
} finally {
closeQuietly(docke... | java | public static String getImageIdFromTag(String imageTag, String host) throws IOException {
DockerClient dockerClient = null;
try {
dockerClient = getDockerClient(host);
return dockerClient.inspectImageCmd(imageTag).exec().getId();
} finally {
closeQuietly(docke... | [
"public",
"static",
"String",
"getImageIdFromTag",
"(",
"String",
"imageTag",
",",
"String",
"host",
")",
"throws",
"IOException",
"{",
"DockerClient",
"dockerClient",
"=",
"null",
";",
"try",
"{",
"dockerClient",
"=",
"getDockerClient",
"(",
"host",
")",
";",
... | Get image Id from imageTag using DockerBuildInfoHelper client.
@param imageTag
@param host
@return | [
"Get",
"image",
"Id",
"from",
"imageTag",
"using",
"DockerBuildInfoHelper",
"client",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java#L34-L42 |
164,606 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java | DockerUtils.pushImage | public static void pushImage(String imageTag, String username, String password, String host) throws IOException {
final AuthConfig authConfig = new AuthConfig();
authConfig.withUsername(username);
authConfig.withPassword(password);
DockerClient dockerClient = null;
try {
... | java | public static void pushImage(String imageTag, String username, String password, String host) throws IOException {
final AuthConfig authConfig = new AuthConfig();
authConfig.withUsername(username);
authConfig.withPassword(password);
DockerClient dockerClient = null;
try {
... | [
"public",
"static",
"void",
"pushImage",
"(",
"String",
"imageTag",
",",
"String",
"username",
",",
"String",
"password",
",",
"String",
"host",
")",
"throws",
"IOException",
"{",
"final",
"AuthConfig",
"authConfig",
"=",
"new",
"AuthConfig",
"(",
")",
";",
... | Push docker image using the docker java client.
@param imageTag
@param username
@param password
@param host | [
"Push",
"docker",
"image",
"using",
"the",
"docker",
"java",
"client",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java#L52-L64 |
164,607 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java | DockerUtils.pullImage | public static void pullImage(String imageTag, String username, String password, String host) throws IOException {
final AuthConfig authConfig = new AuthConfig();
authConfig.withUsername(username);
authConfig.withPassword(password);
DockerClient dockerClient = null;
try {
... | java | public static void pullImage(String imageTag, String username, String password, String host) throws IOException {
final AuthConfig authConfig = new AuthConfig();
authConfig.withUsername(username);
authConfig.withPassword(password);
DockerClient dockerClient = null;
try {
... | [
"public",
"static",
"void",
"pullImage",
"(",
"String",
"imageTag",
",",
"String",
"username",
",",
"String",
"password",
",",
"String",
"host",
")",
"throws",
"IOException",
"{",
"final",
"AuthConfig",
"authConfig",
"=",
"new",
"AuthConfig",
"(",
")",
";",
... | Pull docker image using the docker java client.
@param imageTag
@param username
@param password
@param host | [
"Pull",
"docker",
"image",
"using",
"the",
"docker",
"java",
"client",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java#L74-L86 |
164,608 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java | DockerUtils.getParentId | public static String getParentId(String digest, String host) throws IOException {
DockerClient dockerClient = null;
try {
dockerClient = getDockerClient(host);
return dockerClient.inspectImageCmd(digest).exec().getParent();
} finally {
closeQuietly(dockerClien... | java | public static String getParentId(String digest, String host) throws IOException {
DockerClient dockerClient = null;
try {
dockerClient = getDockerClient(host);
return dockerClient.inspectImageCmd(digest).exec().getParent();
} finally {
closeQuietly(dockerClien... | [
"public",
"static",
"String",
"getParentId",
"(",
"String",
"digest",
",",
"String",
"host",
")",
"throws",
"IOException",
"{",
"DockerClient",
"dockerClient",
"=",
"null",
";",
"try",
"{",
"dockerClient",
"=",
"getDockerClient",
"(",
"host",
")",
";",
"return... | Get parent digest of an image.
@param digest
@param host
@return | [
"Get",
"parent",
"digest",
"of",
"an",
"image",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java#L95-L103 |
164,609 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java | DockerUtils.getLayersDigests | public static List<String> getLayersDigests(String manifestContent) throws IOException {
List<String> dockerLayersDependencies = new ArrayList<String>();
JsonNode manifest = Utils.mapper().readTree(manifestContent);
JsonNode schemaVersion = manifest.get("schemaVersion");
if (schemaVersi... | java | public static List<String> getLayersDigests(String manifestContent) throws IOException {
List<String> dockerLayersDependencies = new ArrayList<String>();
JsonNode manifest = Utils.mapper().readTree(manifestContent);
JsonNode schemaVersion = manifest.get("schemaVersion");
if (schemaVersi... | [
"public",
"static",
"List",
"<",
"String",
">",
"getLayersDigests",
"(",
"String",
"manifestContent",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"dockerLayersDependencies",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"JsonNo... | Get a list of layer digests from docker manifest.
@param manifestContent
@return
@throws IOException | [
"Get",
"a",
"list",
"of",
"layer",
"digests",
"from",
"docker",
"manifest",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java#L142-L164 |
164,610 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java | DockerUtils.digestToFileName | public static String digestToFileName(String digest) {
if (StringUtils.startsWith(digest, "sha1")) {
return "manifest.json";
}
return getShaVersion(digest) + "__" + getShaValue(digest);
} | java | public static String digestToFileName(String digest) {
if (StringUtils.startsWith(digest, "sha1")) {
return "manifest.json";
}
return getShaVersion(digest) + "__" + getShaValue(digest);
} | [
"public",
"static",
"String",
"digestToFileName",
"(",
"String",
"digest",
")",
"{",
"if",
"(",
"StringUtils",
".",
"startsWith",
"(",
"digest",
",",
"\"sha1\"",
")",
")",
"{",
"return",
"\"manifest.json\"",
";",
"}",
"return",
"getShaVersion",
"(",
"digest",
... | Digest format to layer file name.
@param digest
@return | [
"Digest",
"format",
"to",
"layer",
"file",
"name",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java#L276-L281 |
164,611 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java | DockerUtils.getNumberOfDependentLayers | public static int getNumberOfDependentLayers(String imageContent) throws IOException {
JsonNode history = Utils.mapper().readTree(imageContent).get("history");
if (history == null) {
throw new IllegalStateException("Could not find 'history' tag");
}
int layersNum = history.s... | java | public static int getNumberOfDependentLayers(String imageContent) throws IOException {
JsonNode history = Utils.mapper().readTree(imageContent).get("history");
if (history == null) {
throw new IllegalStateException("Could not find 'history' tag");
}
int layersNum = history.s... | [
"public",
"static",
"int",
"getNumberOfDependentLayers",
"(",
"String",
"imageContent",
")",
"throws",
"IOException",
"{",
"JsonNode",
"history",
"=",
"Utils",
".",
"mapper",
"(",
")",
".",
"readTree",
"(",
"imageContent",
")",
".",
"get",
"(",
"\"history\"",
... | Returns number of dependencies layers in the image.
@param imageContent
@return
@throws IOException | [
"Returns",
"number",
"of",
"dependencies",
"layers",
"in",
"the",
"image",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java#L290-L319 |
164,612 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/maven/MavenReleaseWrapper.java | MavenReleaseWrapper.getMavenModules | private List<String> getMavenModules(MavenModuleSetBuild mavenBuild) throws IOException, InterruptedException {
FilePath pathToModuleRoot = mavenBuild.getModuleRoot();
FilePath pathToPom = new FilePath(pathToModuleRoot, mavenBuild.getProject().getRootPOM(null));
return pathToPom.act(new MavenMod... | java | private List<String> getMavenModules(MavenModuleSetBuild mavenBuild) throws IOException, InterruptedException {
FilePath pathToModuleRoot = mavenBuild.getModuleRoot();
FilePath pathToPom = new FilePath(pathToModuleRoot, mavenBuild.getProject().getRootPOM(null));
return pathToPom.act(new MavenMod... | [
"private",
"List",
"<",
"String",
">",
"getMavenModules",
"(",
"MavenModuleSetBuild",
"mavenBuild",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"FilePath",
"pathToModuleRoot",
"=",
"mavenBuild",
".",
"getModuleRoot",
"(",
")",
";",
"FilePath",
"p... | Retrieve from the parent pom the path to the modules of the project | [
"Retrieve",
"from",
"the",
"parent",
"pom",
"the",
"path",
"to",
"the",
"modules",
"of",
"the",
"project"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/maven/MavenReleaseWrapper.java#L238-L242 |
164,613 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/maven/MavenReleaseWrapper.java | MavenReleaseWrapper.getRelativePomPath | private String getRelativePomPath(MavenModule mavenModule, MavenModuleSetBuild mavenBuild) {
String relativePath = mavenModule.getRelativePath();
if (StringUtils.isBlank(relativePath)) {
return POM_NAME;
}
// If this is the root module, return the root pom path.
if (... | java | private String getRelativePomPath(MavenModule mavenModule, MavenModuleSetBuild mavenBuild) {
String relativePath = mavenModule.getRelativePath();
if (StringUtils.isBlank(relativePath)) {
return POM_NAME;
}
// If this is the root module, return the root pom path.
if (... | [
"private",
"String",
"getRelativePomPath",
"(",
"MavenModule",
"mavenModule",
",",
"MavenModuleSetBuild",
"mavenBuild",
")",
"{",
"String",
"relativePath",
"=",
"mavenModule",
".",
"getRelativePath",
"(",
")",
";",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"r... | Retrieve the relative path to the pom of the module | [
"Retrieve",
"the",
"relative",
"path",
"to",
"the",
"pom",
"of",
"the",
"module"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/maven/MavenReleaseWrapper.java#L271-L294 |
164,614 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/maven/MavenReleaseWrapper.java | MavenReleaseWrapper.createPomPath | private String createPomPath(String relativePath, String moduleName) {
if (!moduleName.contains(".xml")) {
// Inside the parent pom, the reference is to the pom.xml file
return relativePath + "/" + POM_NAME;
}
// There is a reference to another xml file, which is not the ... | java | private String createPomPath(String relativePath, String moduleName) {
if (!moduleName.contains(".xml")) {
// Inside the parent pom, the reference is to the pom.xml file
return relativePath + "/" + POM_NAME;
}
// There is a reference to another xml file, which is not the ... | [
"private",
"String",
"createPomPath",
"(",
"String",
"relativePath",
",",
"String",
"moduleName",
")",
"{",
"if",
"(",
"!",
"moduleName",
".",
"contains",
"(",
"\".xml\"",
")",
")",
"{",
"// Inside the parent pom, the reference is to the pom.xml file",
"return",
"rela... | Creates the actual path to the xml file of the module. | [
"Creates",
"the",
"actual",
"path",
"to",
"the",
"xml",
"file",
"of",
"the",
"module",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/maven/MavenReleaseWrapper.java#L299-L307 |
164,615 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/maven/MavenModulesExtractor.java | MavenModulesExtractor.invoke | public List<String> invoke(File f, VirtualChannel channel) throws IOException, InterruptedException {
MavenProject mavenProject = getMavenProject(f.getAbsolutePath());
return mavenProject.getModel().getModules();
} | java | public List<String> invoke(File f, VirtualChannel channel) throws IOException, InterruptedException {
MavenProject mavenProject = getMavenProject(f.getAbsolutePath());
return mavenProject.getModel().getModules();
} | [
"public",
"List",
"<",
"String",
">",
"invoke",
"(",
"File",
"f",
",",
"VirtualChannel",
"channel",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"MavenProject",
"mavenProject",
"=",
"getMavenProject",
"(",
"f",
".",
"getAbsolutePath",
"(",
")"... | This is needed when running on slaves. | [
"This",
"is",
"needed",
"when",
"running",
"on",
"slaves",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/maven/MavenModulesExtractor.java#L21-L24 |
164,616 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/ExtractorUtils.java | ExtractorUtils.getVcsRevision | public static String getVcsRevision(Map<String, String> env) {
String revision = env.get("SVN_REVISION");
if (StringUtils.isBlank(revision)) {
revision = env.get(GIT_COMMIT);
}
if (StringUtils.isBlank(revision)) {
revision = env.get("P4_CHANGELIST");
}
... | java | public static String getVcsRevision(Map<String, String> env) {
String revision = env.get("SVN_REVISION");
if (StringUtils.isBlank(revision)) {
revision = env.get(GIT_COMMIT);
}
if (StringUtils.isBlank(revision)) {
revision = env.get("P4_CHANGELIST");
}
... | [
"public",
"static",
"String",
"getVcsRevision",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"env",
")",
"{",
"String",
"revision",
"=",
"env",
".",
"get",
"(",
"\"SVN_REVISION\"",
")",
";",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"revision",
")... | Get the VCS revision from the Jenkins build environment. The search will one of "SVN_REVISION", "GIT_COMMIT",
"P4_CHANGELIST" in the environment.
@param env Th Jenkins build environment.
@return The vcs revision for supported VCS | [
"Get",
"the",
"VCS",
"revision",
"from",
"the",
"Jenkins",
"build",
"environment",
".",
"The",
"search",
"will",
"one",
"of",
"SVN_REVISION",
"GIT_COMMIT",
"P4_CHANGELIST",
"in",
"the",
"environment",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/ExtractorUtils.java#L81-L90 |
164,617 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/ExtractorUtils.java | ExtractorUtils.getVcsUrl | public static String getVcsUrl(Map<String, String> env) {
String url = env.get("SVN_URL");
if (StringUtils.isBlank(url)) {
url = publicGitUrl(env.get("GIT_URL"));
}
if (StringUtils.isBlank(url)) {
url = env.get("P4PORT");
}
return url;
} | java | public static String getVcsUrl(Map<String, String> env) {
String url = env.get("SVN_URL");
if (StringUtils.isBlank(url)) {
url = publicGitUrl(env.get("GIT_URL"));
}
if (StringUtils.isBlank(url)) {
url = env.get("P4PORT");
}
return url;
} | [
"public",
"static",
"String",
"getVcsUrl",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"env",
")",
"{",
"String",
"url",
"=",
"env",
".",
"get",
"(",
"\"SVN_URL\"",
")",
";",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"url",
")",
")",
"{",
"... | Get the VCS url from the Jenkins build environment. The search will one of "SVN_REVISION", "GIT_COMMIT",
"P4_CHANGELIST" in the environment.
@param env Th Jenkins build environment.
@return The vcs url for supported VCS | [
"Get",
"the",
"VCS",
"url",
"from",
"the",
"Jenkins",
"build",
"environment",
".",
"The",
"search",
"will",
"one",
"of",
"SVN_REVISION",
"GIT_COMMIT",
"P4_CHANGELIST",
"in",
"the",
"environment",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/ExtractorUtils.java#L99-L108 |
164,618 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/ExtractorUtils.java | ExtractorUtils.daysBetween | private static long daysBetween(Date date1, Date date2) {
long diff;
if (date2.after(date1)) {
diff = date2.getTime() - date1.getTime();
} else {
diff = date1.getTime() - date2.getTime();
}
return diff / (24 * 60 * 60 * 1000);
} | java | private static long daysBetween(Date date1, Date date2) {
long diff;
if (date2.after(date1)) {
diff = date2.getTime() - date1.getTime();
} else {
diff = date1.getTime() - date2.getTime();
}
return diff / (24 * 60 * 60 * 1000);
} | [
"private",
"static",
"long",
"daysBetween",
"(",
"Date",
"date1",
",",
"Date",
"date2",
")",
"{",
"long",
"diff",
";",
"if",
"(",
"date2",
".",
"after",
"(",
"date1",
")",
")",
"{",
"diff",
"=",
"date2",
".",
"getTime",
"(",
")",
"-",
"date1",
".",... | Naive implementation of the difference in days between two dates | [
"Naive",
"implementation",
"of",
"the",
"difference",
"in",
"days",
"between",
"two",
"dates"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/ExtractorUtils.java#L394-L402 |
164,619 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/ExtractorUtils.java | ExtractorUtils.getBuildNumbersNotToBeDeleted | public static List<String> getBuildNumbersNotToBeDeleted(Run build) {
List<String> notToDelete = Lists.newArrayList();
List<? extends Run<?, ?>> builds = build.getParent().getBuilds();
for (Run<?, ?> run : builds) {
if (run.isKeepLog()) {
notToDelete.add(String.valueO... | java | public static List<String> getBuildNumbersNotToBeDeleted(Run build) {
List<String> notToDelete = Lists.newArrayList();
List<? extends Run<?, ?>> builds = build.getParent().getBuilds();
for (Run<?, ?> run : builds) {
if (run.isKeepLog()) {
notToDelete.add(String.valueO... | [
"public",
"static",
"List",
"<",
"String",
">",
"getBuildNumbersNotToBeDeleted",
"(",
"Run",
"build",
")",
"{",
"List",
"<",
"String",
">",
"notToDelete",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"List",
"<",
"?",
"extends",
"Run",
"<",
"?",
","... | Get the list of build numbers that are to be kept forever. | [
"Get",
"the",
"list",
"of",
"build",
"numbers",
"that",
"are",
"to",
"be",
"kept",
"forever",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/ExtractorUtils.java#L415-L424 |
164,620 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/ExtractorUtils.java | ExtractorUtils.entityToString | public static String entityToString(HttpEntity entity) throws IOException {
if (entity != null) {
InputStream is = entity.getContent();
return IOUtils.toString(is, "UTF-8");
}
return "";
} | java | public static String entityToString(HttpEntity entity) throws IOException {
if (entity != null) {
InputStream is = entity.getContent();
return IOUtils.toString(is, "UTF-8");
}
return "";
} | [
"public",
"static",
"String",
"entityToString",
"(",
"HttpEntity",
"entity",
")",
"throws",
"IOException",
"{",
"if",
"(",
"entity",
"!=",
"null",
")",
"{",
"InputStream",
"is",
"=",
"entity",
".",
"getContent",
"(",
")",
";",
"return",
"IOUtils",
".",
"to... | Converts the http entity to string. If entity is null, returns empty string.
@param entity
@return
@throws IOException | [
"Converts",
"the",
"http",
"entity",
"to",
"string",
".",
"If",
"entity",
"is",
"null",
"returns",
"empty",
"string",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/ExtractorUtils.java#L555-L561 |
164,621 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/ExtractorUtils.java | ExtractorUtils.createAndGetTempDir | public static FilePath createAndGetTempDir(final FilePath ws) throws IOException, InterruptedException {
// The token that combines the project name and unique number to create unique workspace directory.
String workspaceList = System.getProperty("hudson.slaves.WorkspaceList");
return ws.act(new... | java | public static FilePath createAndGetTempDir(final FilePath ws) throws IOException, InterruptedException {
// The token that combines the project name and unique number to create unique workspace directory.
String workspaceList = System.getProperty("hudson.slaves.WorkspaceList");
return ws.act(new... | [
"public",
"static",
"FilePath",
"createAndGetTempDir",
"(",
"final",
"FilePath",
"ws",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"// The token that combines the project name and unique number to create unique workspace directory.",
"String",
"workspaceList",
"... | Create a temporary directory under a given workspace | [
"Create",
"a",
"temporary",
"directory",
"under",
"a",
"given",
"workspace"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/ExtractorUtils.java#L586-L599 |
164,622 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/maven2/MavenDependenciesRecorder.java | MavenDependenciesRecorder.postExecute | @Override
public boolean postExecute(MavenBuildProxy build, MavenProject pom, MojoInfo mojo, BuildListener listener,
Throwable error) {
//listener.getLogger().println("[MavenDependenciesRecorder] mojo: " + mojo.getClass() + ":" + mojo.getGoal());
//listener.getLogger().println("[MavenDep... | java | @Override
public boolean postExecute(MavenBuildProxy build, MavenProject pom, MojoInfo mojo, BuildListener listener,
Throwable error) {
//listener.getLogger().println("[MavenDependenciesRecorder] mojo: " + mojo.getClass() + ":" + mojo.getGoal());
//listener.getLogger().println("[MavenDep... | [
"@",
"Override",
"public",
"boolean",
"postExecute",
"(",
"MavenBuildProxy",
"build",
",",
"MavenProject",
"pom",
",",
"MojoInfo",
"mojo",
",",
"BuildListener",
"listener",
",",
"Throwable",
"error",
")",
"{",
"//listener.getLogger().println(\"[MavenDependenciesRecorder] ... | Mojos perform different dependency resolution, so we add dependencies for each mojo. | [
"Mojos",
"perform",
"different",
"dependency",
"resolution",
"so",
"we",
"add",
"dependencies",
"for",
"each",
"mojo",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/maven2/MavenDependenciesRecorder.java#L54-L61 |
164,623 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/maven2/MavenDependenciesRecorder.java | MavenDependenciesRecorder.postBuild | @Override
public boolean postBuild(MavenBuildProxy build, MavenProject pom, BuildListener listener)
throws InterruptedException, IOException {
build.executeAsync(new BuildCallable<Void, IOException>() {
// record is transient, so needs to make a copy first
private final S... | java | @Override
public boolean postBuild(MavenBuildProxy build, MavenProject pom, BuildListener listener)
throws InterruptedException, IOException {
build.executeAsync(new BuildCallable<Void, IOException>() {
// record is transient, so needs to make a copy first
private final S... | [
"@",
"Override",
"public",
"boolean",
"postBuild",
"(",
"MavenBuildProxy",
"build",
",",
"MavenProject",
"pom",
",",
"BuildListener",
"listener",
")",
"throws",
"InterruptedException",
",",
"IOException",
"{",
"build",
".",
"executeAsync",
"(",
"new",
"BuildCallable... | Sends the collected dependencies over to the master and record them. | [
"Sends",
"the",
"collected",
"dependencies",
"over",
"to",
"the",
"master",
"and",
"record",
"them",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/maven2/MavenDependenciesRecorder.java#L66-L82 |
164,624 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/CredentialManager.java | CredentialManager.getPreferredDeployer | public static CredentialsConfig getPreferredDeployer(DeployerOverrider deployerOverrider, ArtifactoryServer server) {
if (deployerOverrider.isOverridingDefaultDeployer()) {
CredentialsConfig deployerCredentialsConfig = deployerOverrider.getDeployerCredentialsConfig();
if (deployerCredent... | java | public static CredentialsConfig getPreferredDeployer(DeployerOverrider deployerOverrider, ArtifactoryServer server) {
if (deployerOverrider.isOverridingDefaultDeployer()) {
CredentialsConfig deployerCredentialsConfig = deployerOverrider.getDeployerCredentialsConfig();
if (deployerCredent... | [
"public",
"static",
"CredentialsConfig",
"getPreferredDeployer",
"(",
"DeployerOverrider",
"deployerOverrider",
",",
"ArtifactoryServer",
"server",
")",
"{",
"if",
"(",
"deployerOverrider",
".",
"isOverridingDefaultDeployer",
"(",
")",
")",
"{",
"CredentialsConfig",
"depl... | Decides and returns the preferred deployment credentials to use from this builder settings and selected server
@param deployerOverrider Deploy-overriding capable builder
@param server Selected Artifactory server
@return Preferred deployment credentials | [
"Decides",
"and",
"returns",
"the",
"preferred",
"deployment",
"credentials",
"to",
"use",
"from",
"this",
"builder",
"settings",
"and",
"selected",
"server"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/CredentialManager.java#L41-L57 |
164,625 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/maven3/Maven3Builder.java | Maven3Builder.perform | @Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)
throws InterruptedException, IOException {
listener.getLogger().println("Jenkins Artifactory Plugin version: " + ActionableHelper.getArtifactoryPluginVersion());
EnvVars env = build.get... | java | @Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)
throws InterruptedException, IOException {
listener.getLogger().println("Jenkins Artifactory Plugin version: " + ActionableHelper.getArtifactoryPluginVersion());
EnvVars env = build.get... | [
"@",
"Override",
"public",
"boolean",
"perform",
"(",
"AbstractBuild",
"<",
"?",
",",
"?",
">",
"build",
",",
"Launcher",
"launcher",
",",
"BuildListener",
"listener",
")",
"throws",
"InterruptedException",
",",
"IOException",
"{",
"listener",
".",
"getLogger",
... | Used by FreeStyle Maven jobs only | [
"Used",
"by",
"FreeStyle",
"Maven",
"jobs",
"only"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/maven3/Maven3Builder.java#L81-L97 |
164,626 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/maven3/Maven3Builder.java | Maven3Builder.perform | public boolean perform(Run<?, ?> build, Launcher launcher, TaskListener listener, EnvVars env, FilePath workDir, FilePath tempDir)
throws InterruptedException, IOException {
listener.getLogger().println("Jenkins Artifactory Plugin version: " + ActionableHelper.getArtifactoryPluginVersion());
... | java | public boolean perform(Run<?, ?> build, Launcher launcher, TaskListener listener, EnvVars env, FilePath workDir, FilePath tempDir)
throws InterruptedException, IOException {
listener.getLogger().println("Jenkins Artifactory Plugin version: " + ActionableHelper.getArtifactoryPluginVersion());
... | [
"public",
"boolean",
"perform",
"(",
"Run",
"<",
"?",
",",
"?",
">",
"build",
",",
"Launcher",
"launcher",
",",
"TaskListener",
"listener",
",",
"EnvVars",
"env",
",",
"FilePath",
"workDir",
",",
"FilePath",
"tempDir",
")",
"throws",
"InterruptedException",
... | Used by Pipeline jobs only | [
"Used",
"by",
"Pipeline",
"jobs",
"only"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/maven3/Maven3Builder.java#L100-L112 |
164,627 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/maven3/Maven3Builder.java | Maven3Builder.copyClassWorldsFile | private FilePath copyClassWorldsFile(FilePath ws, URL resource) {
try {
FilePath remoteClassworlds =
ws.createTextTempFile("classworlds", "conf", "");
remoteClassworlds.copyFrom(resource);
return remoteClassworlds;
} catch (Exception e) {
... | java | private FilePath copyClassWorldsFile(FilePath ws, URL resource) {
try {
FilePath remoteClassworlds =
ws.createTextTempFile("classworlds", "conf", "");
remoteClassworlds.copyFrom(resource);
return remoteClassworlds;
} catch (Exception e) {
... | [
"private",
"FilePath",
"copyClassWorldsFile",
"(",
"FilePath",
"ws",
",",
"URL",
"resource",
")",
"{",
"try",
"{",
"FilePath",
"remoteClassworlds",
"=",
"ws",
".",
"createTextTempFile",
"(",
"\"classworlds\"",
",",
"\"conf\"",
",",
"\"\"",
")",
";",
"remoteClass... | Copies a classworlds file to a temporary location either on the local filesystem or on a slave depending on the
node type.
@return The path of the classworlds.conf file | [
"Copies",
"a",
"classworlds",
"file",
"to",
"a",
"temporary",
"location",
"either",
"on",
"the",
"local",
"filesystem",
"or",
"on",
"a",
"slave",
"depending",
"on",
"the",
"node",
"type",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/maven3/Maven3Builder.java#L284-L293 |
164,628 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/action/ActionableHelper.java | ActionableHelper.getPublisher | public static <T extends Publisher> T getPublisher(AbstractProject<?, ?> project, Class<T> type) {
// Search for a publisher of the given type in the project and return it if found:
T publisher = new PublisherFindImpl<T>().find(project, type);
if (publisher != null) {
return publishe... | java | public static <T extends Publisher> T getPublisher(AbstractProject<?, ?> project, Class<T> type) {
// Search for a publisher of the given type in the project and return it if found:
T publisher = new PublisherFindImpl<T>().find(project, type);
if (publisher != null) {
return publishe... | [
"public",
"static",
"<",
"T",
"extends",
"Publisher",
">",
"T",
"getPublisher",
"(",
"AbstractProject",
"<",
"?",
",",
"?",
">",
"project",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"// Search for a publisher of the given type in the project and return it if fo... | Search for a publisher of the given type in a project and return it, or null if it is not found.
@return The publisher | [
"Search",
"for",
"a",
"publisher",
"of",
"the",
"given",
"type",
"in",
"a",
"project",
"and",
"return",
"it",
"or",
"null",
"if",
"it",
"is",
"not",
"found",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/action/ActionableHelper.java#L80-L90 |
164,629 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/action/ActionableHelper.java | ActionableHelper.getArtifactoryPluginVersion | public static String getArtifactoryPluginVersion() {
String pluginsSortName = "artifactory";
//Validates Jenkins existence because in some jobs the Jenkins instance is unreachable
if (Jenkins.getInstance() != null
&& Jenkins.getInstance().getPlugin(pluginsSortName) != null
... | java | public static String getArtifactoryPluginVersion() {
String pluginsSortName = "artifactory";
//Validates Jenkins existence because in some jobs the Jenkins instance is unreachable
if (Jenkins.getInstance() != null
&& Jenkins.getInstance().getPlugin(pluginsSortName) != null
... | [
"public",
"static",
"String",
"getArtifactoryPluginVersion",
"(",
")",
"{",
"String",
"pluginsSortName",
"=",
"\"artifactory\"",
";",
"//Validates Jenkins existence because in some jobs the Jenkins instance is unreachable",
"if",
"(",
"Jenkins",
".",
"getInstance",
"(",
")",
... | Returns the version of Jenkins Artifactory Plugin or empty string if not found
@return the version of Jenkins Artifactory Plugin or empty string if not found | [
"Returns",
"the",
"version",
"of",
"Jenkins",
"Artifactory",
"Plugin",
"or",
"empty",
"string",
"if",
"not",
"found"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/action/ActionableHelper.java#L250-L259 |
164,630 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/action/ActionableHelper.java | ActionableHelper.deleteFilePath | public static void deleteFilePath(FilePath workspace, String path) throws IOException {
if (StringUtils.isNotBlank(path)) {
try {
FilePath propertiesFile = new FilePath(workspace, path);
propertiesFile.delete();
} catch (Exception e) {
thro... | java | public static void deleteFilePath(FilePath workspace, String path) throws IOException {
if (StringUtils.isNotBlank(path)) {
try {
FilePath propertiesFile = new FilePath(workspace, path);
propertiesFile.delete();
} catch (Exception e) {
thro... | [
"public",
"static",
"void",
"deleteFilePath",
"(",
"FilePath",
"workspace",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"path",
")",
")",
"{",
"try",
"{",
"FilePath",
"propertiesFile",
"=",
"new... | Deletes a FilePath file.
@param workspace The build workspace.
@param path The path in the workspace.
@throws IOException In case of missing file. | [
"Deletes",
"a",
"FilePath",
"file",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/action/ActionableHelper.java#L277-L286 |
164,631 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/scm/git/GitManager.java | GitManager.getRemoteUrl | public String getRemoteUrl(String defaultRemoteUrl) {
if (StringUtils.isBlank(defaultRemoteUrl)) {
RemoteConfig remoteConfig = getJenkinsScm().getRepositories().get(0);
URIish uri = remoteConfig.getURIs().get(0);
return uri.toPrivateString();
}
return default... | java | public String getRemoteUrl(String defaultRemoteUrl) {
if (StringUtils.isBlank(defaultRemoteUrl)) {
RemoteConfig remoteConfig = getJenkinsScm().getRepositories().get(0);
URIish uri = remoteConfig.getURIs().get(0);
return uri.toPrivateString();
}
return default... | [
"public",
"String",
"getRemoteUrl",
"(",
"String",
"defaultRemoteUrl",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"defaultRemoteUrl",
")",
")",
"{",
"RemoteConfig",
"remoteConfig",
"=",
"getJenkinsScm",
"(",
")",
".",
"getRepositories",
"(",
")",
... | This method is currently in use only by the SvnCoordinator | [
"This",
"method",
"is",
"currently",
"in",
"use",
"only",
"by",
"the",
"SvnCoordinator"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/scm/git/GitManager.java#L185-L193 |
164,632 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/RepositoryConf.java | RepositoryConf.getRepoKey | public String getRepoKey() {
String repoKey;
if (isDynamicMode()) {
repoKey = keyFromText;
} else {
repoKey = keyFromSelect;
}
return repoKey;
} | java | public String getRepoKey() {
String repoKey;
if (isDynamicMode()) {
repoKey = keyFromText;
} else {
repoKey = keyFromSelect;
}
return repoKey;
} | [
"public",
"String",
"getRepoKey",
"(",
")",
"{",
"String",
"repoKey",
";",
"if",
"(",
"isDynamicMode",
"(",
")",
")",
"{",
"repoKey",
"=",
"keyFromText",
";",
"}",
"else",
"{",
"repoKey",
"=",
"keyFromSelect",
";",
"}",
"return",
"repoKey",
";",
"}"
] | Used to get the current repository key
@return keyFromText or keyFromSelect reflected by the dynamicMode flag | [
"Used",
"to",
"get",
"the",
"current",
"repository",
"key"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/RepositoryConf.java#L34-L42 |
164,633 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/types/buildInfo/Env.java | Env.collectVariables | public void collectVariables(EnvVars env, Run build, TaskListener listener) {
EnvVars buildParameters = Utils.extractBuildParameters(build, listener);
if (buildParameters != null) {
env.putAll(buildParameters);
}
addAllWithFilter(envVars, env, filter.getPatternFilter());
... | java | public void collectVariables(EnvVars env, Run build, TaskListener listener) {
EnvVars buildParameters = Utils.extractBuildParameters(build, listener);
if (buildParameters != null) {
env.putAll(buildParameters);
}
addAllWithFilter(envVars, env, filter.getPatternFilter());
... | [
"public",
"void",
"collectVariables",
"(",
"EnvVars",
"env",
",",
"Run",
"build",
",",
"TaskListener",
"listener",
")",
"{",
"EnvVars",
"buildParameters",
"=",
"Utils",
".",
"extractBuildParameters",
"(",
"build",
",",
"listener",
")",
";",
"if",
"(",
"buildPa... | Collect environment variables and system properties under with filter constrains | [
"Collect",
"environment",
"variables",
"and",
"system",
"properties",
"under",
"with",
"filter",
"constrains"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/types/buildInfo/Env.java#L36-L50 |
164,634 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/types/buildInfo/Env.java | Env.append | protected void append(Env env) {
addAllWithFilter(this.envVars, env.envVars, filter.getPatternFilter());
addAllWithFilter(this.sysVars, env.sysVars, filter.getPatternFilter());
} | java | protected void append(Env env) {
addAllWithFilter(this.envVars, env.envVars, filter.getPatternFilter());
addAllWithFilter(this.sysVars, env.sysVars, filter.getPatternFilter());
} | [
"protected",
"void",
"append",
"(",
"Env",
"env",
")",
"{",
"addAllWithFilter",
"(",
"this",
".",
"envVars",
",",
"env",
".",
"envVars",
",",
"filter",
".",
"getPatternFilter",
"(",
")",
")",
";",
"addAllWithFilter",
"(",
"this",
".",
"sysVars",
",",
"en... | Append environment variables and system properties from othre PipelineEvn object | [
"Append",
"environment",
"variables",
"and",
"system",
"properties",
"from",
"othre",
"PipelineEvn",
"object"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/types/buildInfo/Env.java#L55-L58 |
164,635 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/types/buildInfo/Env.java | Env.addAllWithFilter | private void addAllWithFilter(Map<String, String> toMap, Map<String, String> fromMap, IncludeExcludePatterns pattern) {
for (Object o : fromMap.entrySet()) {
Map.Entry entry = (Map.Entry) o;
String key = (String) entry.getKey();
if (PatternMatcher.pathConflicts(key, pattern))... | java | private void addAllWithFilter(Map<String, String> toMap, Map<String, String> fromMap, IncludeExcludePatterns pattern) {
for (Object o : fromMap.entrySet()) {
Map.Entry entry = (Map.Entry) o;
String key = (String) entry.getKey();
if (PatternMatcher.pathConflicts(key, pattern))... | [
"private",
"void",
"addAllWithFilter",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"toMap",
",",
"Map",
"<",
"String",
",",
"String",
">",
"fromMap",
",",
"IncludeExcludePatterns",
"pattern",
")",
"{",
"for",
"(",
"Object",
"o",
":",
"fromMap",
".",
"... | Adds all pairs from 'fromMap' to 'toMap' excluding once that matching the pattern | [
"Adds",
"all",
"pairs",
"from",
"fromMap",
"to",
"toMap",
"excluding",
"once",
"that",
"matching",
"the",
"pattern"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/types/buildInfo/Env.java#L63-L72 |
164,636 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java | DeployerResolverOverriderConverter.credentialsMigration | public void credentialsMigration(T overrider, Class overriderClass) {
try {
deployerMigration(overrider, overriderClass);
resolverMigration(overrider, overriderClass);
} catch (NoSuchFieldException | IllegalAccessException | IOException e) {
converterErrors.add(getCon... | java | public void credentialsMigration(T overrider, Class overriderClass) {
try {
deployerMigration(overrider, overriderClass);
resolverMigration(overrider, overriderClass);
} catch (NoSuchFieldException | IllegalAccessException | IOException e) {
converterErrors.add(getCon... | [
"public",
"void",
"credentialsMigration",
"(",
"T",
"overrider",
",",
"Class",
"overriderClass",
")",
"{",
"try",
"{",
"deployerMigration",
"(",
"overrider",
",",
"overriderClass",
")",
";",
"resolverMigration",
"(",
"overrider",
",",
"overriderClass",
")",
";",
... | Migrate to Jenkins "Credentials" plugin from the old credential implementation | [
"Migrate",
"to",
"Jenkins",
"Credentials",
"plugin",
"from",
"the",
"old",
"credential",
"implementation"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java#L72-L79 |
164,637 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java | DeployerResolverOverriderConverter.createInitialResolveDetailsFromDeployDetails | private ServerDetails createInitialResolveDetailsFromDeployDetails(ServerDetails deployerDetails) {
RepositoryConf oldResolveRepositoryConfig = deployerDetails.getResolveReleaseRepository();
RepositoryConf oldSnapshotResolveRepositoryConfig = deployerDetails.getResolveSnapshotRepository();
Repos... | java | private ServerDetails createInitialResolveDetailsFromDeployDetails(ServerDetails deployerDetails) {
RepositoryConf oldResolveRepositoryConfig = deployerDetails.getResolveReleaseRepository();
RepositoryConf oldSnapshotResolveRepositoryConfig = deployerDetails.getResolveSnapshotRepository();
Repos... | [
"private",
"ServerDetails",
"createInitialResolveDetailsFromDeployDetails",
"(",
"ServerDetails",
"deployerDetails",
")",
"{",
"RepositoryConf",
"oldResolveRepositoryConfig",
"=",
"deployerDetails",
".",
"getResolveReleaseRepository",
"(",
")",
";",
"RepositoryConf",
"oldSnapshot... | Creates a new ServerDetails object for resolver, this will take URL and name from the deployer ServerDetails as a default behaviour | [
"Creates",
"a",
"new",
"ServerDetails",
"object",
"for",
"resolver",
"this",
"will",
"take",
"URL",
"and",
"name",
"from",
"the",
"deployer",
"ServerDetails",
"as",
"a",
"default",
"behaviour"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java#L181-L188 |
164,638 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java | DeployerResolverOverriderConverter.createInitialDeployDetailsFromOldDeployDetails | private ServerDetails createInitialDeployDetailsFromOldDeployDetails(ServerDetails oldDeployerDetails) {
RepositoryConf oldDeployRepositoryConfig = oldDeployerDetails.getDeployReleaseRepository();
RepositoryConf oldSnapshotDeployRepositoryConfig = oldDeployerDetails.getDeploySnapshotRepository();
... | java | private ServerDetails createInitialDeployDetailsFromOldDeployDetails(ServerDetails oldDeployerDetails) {
RepositoryConf oldDeployRepositoryConfig = oldDeployerDetails.getDeployReleaseRepository();
RepositoryConf oldSnapshotDeployRepositoryConfig = oldDeployerDetails.getDeploySnapshotRepository();
... | [
"private",
"ServerDetails",
"createInitialDeployDetailsFromOldDeployDetails",
"(",
"ServerDetails",
"oldDeployerDetails",
")",
"{",
"RepositoryConf",
"oldDeployRepositoryConfig",
"=",
"oldDeployerDetails",
".",
"getDeployReleaseRepository",
"(",
")",
";",
"RepositoryConf",
"oldSn... | Creates a new ServerDetails object for deployer, this will take URL and name from the oldDeployer ServerDetails | [
"Creates",
"a",
"new",
"ServerDetails",
"object",
"for",
"deployer",
"this",
"will",
"take",
"URL",
"and",
"name",
"from",
"the",
"oldDeployer",
"ServerDetails"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java#L193-L200 |
164,639 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/PropertyUtils.java | PropertyUtils.loadGradleProperties | private static Properties loadGradleProperties(FilePath gradlePropertiesFilePath)
throws IOException, InterruptedException {
return gradlePropertiesFilePath.act(new MasterToSlaveFileCallable<Properties>() {
public Properties invoke(File gradlePropertiesFile, VirtualChannel channel) throw... | java | private static Properties loadGradleProperties(FilePath gradlePropertiesFilePath)
throws IOException, InterruptedException {
return gradlePropertiesFilePath.act(new MasterToSlaveFileCallable<Properties>() {
public Properties invoke(File gradlePropertiesFile, VirtualChannel channel) throw... | [
"private",
"static",
"Properties",
"loadGradleProperties",
"(",
"FilePath",
"gradlePropertiesFilePath",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"return",
"gradlePropertiesFilePath",
".",
"act",
"(",
"new",
"MasterToSlaveFileCallable",
"<",
"Propertie... | Load a properties file from a file path
@param gradlePropertiesFilePath The file path where the gradle.properties is located.
@return The loaded properties.
@throws IOException In case an error occurs while reading the properties file, this exception is thrown. | [
"Load",
"a",
"properties",
"file",
"from",
"a",
"file",
"path"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/PropertyUtils.java#L81-L104 |
164,640 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/DockerImage.java | DockerImage.generateBuildInfoModule | public Module generateBuildInfoModule(Run build, TaskListener listener, ArtifactoryConfigurator config, String buildName, String buildNumber, String timestamp) throws IOException {
if (artifactsProps == null) {
artifactsProps = ArrayListMultimap.create();
}
artifactsProps.put("build.... | java | public Module generateBuildInfoModule(Run build, TaskListener listener, ArtifactoryConfigurator config, String buildName, String buildNumber, String timestamp) throws IOException {
if (artifactsProps == null) {
artifactsProps = ArrayListMultimap.create();
}
artifactsProps.put("build.... | [
"public",
"Module",
"generateBuildInfoModule",
"(",
"Run",
"build",
",",
"TaskListener",
"listener",
",",
"ArtifactoryConfigurator",
"config",
",",
"String",
"buildName",
",",
"String",
"buildNumber",
",",
"String",
"timestamp",
")",
"throws",
"IOException",
"{",
"i... | Generates the build-info module for this docker image.
Additionally. this method tags the deployed docker layers with properties,
such as build.name, build.number and custom properties defined in the Jenkins build.
@param build
@param listener
@param config
@param buildName
@param buildNumber
@param timestamp
@return
@... | [
"Generates",
"the",
"build",
"-",
"info",
"module",
"for",
"this",
"docker",
"image",
".",
"Additionally",
".",
"this",
"method",
"tags",
"the",
"deployed",
"docker",
"layers",
"with",
"properties",
"such",
"as",
"build",
".",
"name",
"build",
".",
"number",... | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/DockerImage.java#L115-L169 |
164,641 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/DockerImage.java | DockerImage.findAndSetManifestFromArtifactory | private boolean findAndSetManifestFromArtifactory(ArtifactoryServer server, ArtifactoryDependenciesClient dependenciesClient, TaskListener listener) throws IOException {
String candidateImagePath = DockerUtils.getImagePath(imageTag);
String manifestPath;
// Try to get manifest, assuming reverse... | java | private boolean findAndSetManifestFromArtifactory(ArtifactoryServer server, ArtifactoryDependenciesClient dependenciesClient, TaskListener listener) throws IOException {
String candidateImagePath = DockerUtils.getImagePath(imageTag);
String manifestPath;
// Try to get manifest, assuming reverse... | [
"private",
"boolean",
"findAndSetManifestFromArtifactory",
"(",
"ArtifactoryServer",
"server",
",",
"ArtifactoryDependenciesClient",
"dependenciesClient",
",",
"TaskListener",
"listener",
")",
"throws",
"IOException",
"{",
"String",
"candidateImagePath",
"=",
"DockerUtils",
"... | Find and validate manifest.json file in Artifactory for the current image.
Since provided imageTag differs between reverse-proxy and proxy-less configuration, try to build the correct manifest path.
@param server
@param dependenciesClient
@param listener
@return
@throws IOException | [
"Find",
"and",
"validate",
"manifest",
".",
"json",
"file",
"in",
"Artifactory",
"for",
"the",
"current",
"image",
".",
"Since",
"provided",
"imageTag",
"differs",
"between",
"reverse",
"-",
"proxy",
"and",
"proxy",
"-",
"less",
"configuration",
"try",
"to",
... | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/DockerImage.java#L180-L200 |
164,642 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/DockerImage.java | DockerImage.checkAndSetManifestAndImagePathCandidates | private boolean checkAndSetManifestAndImagePathCandidates(String manifestPath, String candidateImagePath, ArtifactoryDependenciesClient dependenciesClient, TaskListener listener) throws IOException {
String candidateManifest = getManifestFromArtifactory(dependenciesClient, manifestPath);
if (candidateMa... | java | private boolean checkAndSetManifestAndImagePathCandidates(String manifestPath, String candidateImagePath, ArtifactoryDependenciesClient dependenciesClient, TaskListener listener) throws IOException {
String candidateManifest = getManifestFromArtifactory(dependenciesClient, manifestPath);
if (candidateMa... | [
"private",
"boolean",
"checkAndSetManifestAndImagePathCandidates",
"(",
"String",
"manifestPath",
",",
"String",
"candidateImagePath",
",",
"ArtifactoryDependenciesClient",
"dependenciesClient",
",",
"TaskListener",
"listener",
")",
"throws",
"IOException",
"{",
"String",
"ca... | Check if the provided manifestPath is correct.
Set the manifest and imagePath in case of the correct manifest.
@param manifestPath
@param candidateImagePath
@param dependenciesClient
@param listener
@return true if found the correct manifest
@throws IOException | [
"Check",
"if",
"the",
"provided",
"manifestPath",
"is",
"correct",
".",
"Set",
"the",
"manifest",
"and",
"imagePath",
"in",
"case",
"of",
"the",
"correct",
"manifest",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/DockerImage.java#L212-L227 |
164,643 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/types/buildInfo/BuildInfo.java | BuildInfo.getBuildFilesList | private List<org.jfrog.hudson.pipeline.types.File> getBuildFilesList(Stream<? extends BaseBuildFileBean> buildFilesStream) {
return buildFilesStream
.filter(buildFile -> StringUtils.isNotBlank(buildFile.getLocalPath()))
.filter(buildFile -> StringUtils.isNotBlank(buildFile.getRem... | java | private List<org.jfrog.hudson.pipeline.types.File> getBuildFilesList(Stream<? extends BaseBuildFileBean> buildFilesStream) {
return buildFilesStream
.filter(buildFile -> StringUtils.isNotBlank(buildFile.getLocalPath()))
.filter(buildFile -> StringUtils.isNotBlank(buildFile.getRem... | [
"private",
"List",
"<",
"org",
".",
"jfrog",
".",
"hudson",
".",
"pipeline",
".",
"types",
".",
"File",
">",
"getBuildFilesList",
"(",
"Stream",
"<",
"?",
"extends",
"BaseBuildFileBean",
">",
"buildFilesStream",
")",
"{",
"return",
"buildFilesStream",
".",
"... | Return a list of 'Files' of downloaded or uploaded files. Filters build files without local and remote paths.
@param buildFilesStream - Stream of build Artifacts or Dependencies.
@return - List of build files. | [
"Return",
"a",
"list",
"of",
"Files",
"of",
"downloaded",
"or",
"uploaded",
"files",
".",
"Filters",
"build",
"files",
"without",
"local",
"and",
"remote",
"paths",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/types/buildInfo/BuildInfo.java#L126-L133 |
164,644 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/ArtifactoryServer.java | ArtifactoryServer.getConnectionRetries | public List<Integer> getConnectionRetries() {
List<Integer> items = new ArrayList<Integer>();
for (int i = 0; i < 10; i++) {
items.add(i);
}
return items;
} | java | public List<Integer> getConnectionRetries() {
List<Integer> items = new ArrayList<Integer>();
for (int i = 0; i < 10; i++) {
items.add(i);
}
return items;
} | [
"public",
"List",
"<",
"Integer",
">",
"getConnectionRetries",
"(",
")",
"{",
"List",
"<",
"Integer",
">",
"items",
"=",
"new",
"ArrayList",
"<",
"Integer",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"10",
";",
"i",
"++"... | To populate the dropdown list from the jelly | [
"To",
"populate",
"the",
"dropdown",
"list",
"from",
"the",
"jelly"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/ArtifactoryServer.java#L127-L133 |
164,645 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/ArtifactoryServer.java | ArtifactoryServer.getResolvingCredentialsConfig | public CredentialsConfig getResolvingCredentialsConfig() {
if (resolverCredentialsConfig != null && resolverCredentialsConfig.isCredentialsProvided()) {
return getResolverCredentialsConfig();
}
if (deployerCredentialsConfig != null) {
return getDeployerCredentialsConfig()... | java | public CredentialsConfig getResolvingCredentialsConfig() {
if (resolverCredentialsConfig != null && resolverCredentialsConfig.isCredentialsProvided()) {
return getResolverCredentialsConfig();
}
if (deployerCredentialsConfig != null) {
return getDeployerCredentialsConfig()... | [
"public",
"CredentialsConfig",
"getResolvingCredentialsConfig",
"(",
")",
"{",
"if",
"(",
"resolverCredentialsConfig",
"!=",
"null",
"&&",
"resolverCredentialsConfig",
".",
"isCredentialsProvided",
"(",
")",
")",
"{",
"return",
"getResolverCredentialsConfig",
"(",
")",
... | Decides what are the preferred credentials to use for resolving the repo keys of the server
@return Preferred credentials for repo resolving. Never null. | [
"Decides",
"what",
"are",
"the",
"preferred",
"credentials",
"to",
"use",
"for",
"resolving",
"the",
"repo",
"keys",
"of",
"the",
"server"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/ArtifactoryServer.java#L351-L360 |
164,646 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/maven/PomTransformer.java | PomTransformer.invoke | public Boolean invoke(File pomFile, VirtualChannel channel) throws IOException, InterruptedException {
org.jfrog.build.extractor.maven.reader.ModuleName current = new org.jfrog.build.extractor.maven.reader.ModuleName(
currentModule.groupId, currentModule.artifactId);
Map<org.jfrog.buil... | java | public Boolean invoke(File pomFile, VirtualChannel channel) throws IOException, InterruptedException {
org.jfrog.build.extractor.maven.reader.ModuleName current = new org.jfrog.build.extractor.maven.reader.ModuleName(
currentModule.groupId, currentModule.artifactId);
Map<org.jfrog.buil... | [
"public",
"Boolean",
"invoke",
"(",
"File",
"pomFile",
",",
"VirtualChannel",
"channel",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"org",
".",
"jfrog",
".",
"build",
".",
"extractor",
".",
"maven",
".",
"reader",
".",
"ModuleName",
"curre... | Performs the transformation.
@return True if the file was modified. | [
"Performs",
"the",
"transformation",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/maven/PomTransformer.java#L61-L77 |
164,647 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/scm/perforce/AbstractPerforceManager.java | AbstractPerforceManager.edit | public void edit(int currentChangeListId, FilePath filePath) throws Exception {
establishConnection().editFile(currentChangeListId, new File(filePath.getRemote()));
} | java | public void edit(int currentChangeListId, FilePath filePath) throws Exception {
establishConnection().editFile(currentChangeListId, new File(filePath.getRemote()));
} | [
"public",
"void",
"edit",
"(",
"int",
"currentChangeListId",
",",
"FilePath",
"filePath",
")",
"throws",
"Exception",
"{",
"establishConnection",
"(",
")",
".",
"editFile",
"(",
"currentChangeListId",
",",
"new",
"File",
"(",
"filePath",
".",
"getRemote",
"(",
... | Opens file for editing.
@param currentChangeListId The current change list id to open the file for editing at
@param filePath The filePath which contains the file we need to edit
@throws IOException Thrown in case of perforce communication errors
@throws InterruptedException | [
"Opens",
"file",
"for",
"editing",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/scm/perforce/AbstractPerforceManager.java#L98-L100 |
164,648 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/executors/MavenExecutor.java | MavenExecutor.convertJdkPath | private void convertJdkPath(Launcher launcher, EnvVars extendedEnv) {
String separator = launcher.isUnix() ? "/" : "\\";
String java_home = extendedEnv.get("JAVA_HOME");
if (StringUtils.isNotEmpty(java_home)) {
if (!StringUtils.endsWith(java_home, separator)) {
java_h... | java | private void convertJdkPath(Launcher launcher, EnvVars extendedEnv) {
String separator = launcher.isUnix() ? "/" : "\\";
String java_home = extendedEnv.get("JAVA_HOME");
if (StringUtils.isNotEmpty(java_home)) {
if (!StringUtils.endsWith(java_home, separator)) {
java_h... | [
"private",
"void",
"convertJdkPath",
"(",
"Launcher",
"launcher",
",",
"EnvVars",
"extendedEnv",
")",
"{",
"String",
"separator",
"=",
"launcher",
".",
"isUnix",
"(",
")",
"?",
"\"/\"",
":",
"\"\\\\\"",
";",
"String",
"java_home",
"=",
"extendedEnv",
".",
"g... | The Maven3Builder class is looking for the PATH+JDK environment variable due to legacy code.
In The pipeline flow we need to convert the JAVA_HOME to PATH+JDK in order to reuse the code. | [
"The",
"Maven3Builder",
"class",
"is",
"looking",
"for",
"the",
"PATH",
"+",
"JDK",
"environment",
"variable",
"due",
"to",
"legacy",
"code",
".",
"In",
"The",
"pipeline",
"flow",
"we",
"need",
"to",
"convert",
"the",
"JAVA_HOME",
"to",
"PATH",
"+",
"JDK",... | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/executors/MavenExecutor.java#L84-L93 |
164,649 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/BuildUniqueIdentifierHelper.java | BuildUniqueIdentifierHelper.getRootBuild | public static AbstractBuild<?, ?> getRootBuild(AbstractBuild<?, ?> currentBuild) {
AbstractBuild<?, ?> rootBuild = null;
AbstractBuild<?, ?> parentBuild = getUpstreamBuild(currentBuild);
while (parentBuild != null) {
if (isPassIdentifiedDownstream(parentBuild)) {
root... | java | public static AbstractBuild<?, ?> getRootBuild(AbstractBuild<?, ?> currentBuild) {
AbstractBuild<?, ?> rootBuild = null;
AbstractBuild<?, ?> parentBuild = getUpstreamBuild(currentBuild);
while (parentBuild != null) {
if (isPassIdentifiedDownstream(parentBuild)) {
root... | [
"public",
"static",
"AbstractBuild",
"<",
"?",
",",
"?",
">",
"getRootBuild",
"(",
"AbstractBuild",
"<",
"?",
",",
"?",
">",
"currentBuild",
")",
"{",
"AbstractBuild",
"<",
"?",
",",
"?",
">",
"rootBuild",
"=",
"null",
";",
"AbstractBuild",
"<",
"?",
"... | Get the root build which triggered the current build. The build root is considered to be the one furthest one
away from the current build which has the isPassIdentifiedDownstream active, if no parent build exists, check
that the current build needs an upstream identifier, if it does return it.
@param currentBuild The ... | [
"Get",
"the",
"root",
"build",
"which",
"triggered",
"the",
"current",
"build",
".",
"The",
"build",
"root",
"is",
"considered",
"to",
"be",
"the",
"one",
"furthest",
"one",
"away",
"from",
"the",
"current",
"build",
"which",
"has",
"the",
"isPassIdentifiedD... | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/BuildUniqueIdentifierHelper.java#L35-L48 |
164,650 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/BuildUniqueIdentifierHelper.java | BuildUniqueIdentifierHelper.getProject | private static AbstractProject<?, ?> getProject(String fullName) {
Item item = Hudson.getInstance().getItemByFullName(fullName);
if (item != null && item instanceof AbstractProject) {
return (AbstractProject<?, ?>) item;
}
return null;
} | java | private static AbstractProject<?, ?> getProject(String fullName) {
Item item = Hudson.getInstance().getItemByFullName(fullName);
if (item != null && item instanceof AbstractProject) {
return (AbstractProject<?, ?>) item;
}
return null;
} | [
"private",
"static",
"AbstractProject",
"<",
"?",
",",
"?",
">",
"getProject",
"(",
"String",
"fullName",
")",
"{",
"Item",
"item",
"=",
"Hudson",
".",
"getInstance",
"(",
")",
".",
"getItemByFullName",
"(",
"fullName",
")",
";",
"if",
"(",
"item",
"!=",... | Get a project according to its full name.
@param fullName The full name of the project.
@return The project which answers the full name. | [
"Get",
"a",
"project",
"according",
"to",
"its",
"full",
"name",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/BuildUniqueIdentifierHelper.java#L75-L81 |
164,651 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/scm/git/GitCoordinator.java | GitCoordinator.pushDryRun | public void pushDryRun() throws Exception {
if (releaseAction.isCreateVcsTag()) {
if (scmManager.isTagExists(scmManager.getRemoteConfig(releaseAction.getTargetRemoteName()), releaseAction.getTagUrl())) {
throw new Exception(String.format("Tag with name '%s' already exists", releaseAc... | java | public void pushDryRun() throws Exception {
if (releaseAction.isCreateVcsTag()) {
if (scmManager.isTagExists(scmManager.getRemoteConfig(releaseAction.getTargetRemoteName()), releaseAction.getTagUrl())) {
throw new Exception(String.format("Tag with name '%s' already exists", releaseAc... | [
"public",
"void",
"pushDryRun",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"releaseAction",
".",
"isCreateVcsTag",
"(",
")",
")",
"{",
"if",
"(",
"scmManager",
".",
"isTagExists",
"(",
"scmManager",
".",
"getRemoteConfig",
"(",
"releaseAction",
".",
"g... | This method uses the configured git credentials and repo, to test its validity.
In addition, in case the user requested creation of a new tag, it checks that
another tag with the same name doesn't exist | [
"This",
"method",
"uses",
"the",
"configured",
"git",
"credentials",
"and",
"repo",
"to",
"test",
"its",
"validity",
".",
"In",
"addition",
"in",
"case",
"the",
"user",
"requested",
"creation",
"of",
"a",
"new",
"tag",
"it",
"checks",
"that",
"another",
"t... | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/scm/git/GitCoordinator.java#L66-L83 |
164,652 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java | DockerAgentUtils.registerImagOnAgents | public synchronized static void registerImagOnAgents(Launcher launcher, final String imageTag,
final String host, final String targetRepo, final ArrayListMultimap<String, String> artifactsProps,
final int buildInfoId) throws IOException, InterruptedException {
// Master
final... | java | public synchronized static void registerImagOnAgents(Launcher launcher, final String imageTag,
final String host, final String targetRepo, final ArrayListMultimap<String, String> artifactsProps,
final int buildInfoId) throws IOException, InterruptedException {
// Master
final... | [
"public",
"synchronized",
"static",
"void",
"registerImagOnAgents",
"(",
"Launcher",
"launcher",
",",
"final",
"String",
"imageTag",
",",
"final",
"String",
"host",
",",
"final",
"String",
"targetRepo",
",",
"final",
"ArrayListMultimap",
"<",
"String",
",",
"Strin... | Registers an image to be captured by the build-info proxy.
@param imageTag
@param host
@param targetRepo
@param buildInfoId
@throws IOException
@throws InterruptedException | [
"Registers",
"an",
"image",
"to",
"be",
"captured",
"by",
"the",
"build",
"-",
"info",
"proxy",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java#L36-L63 |
164,653 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java | DockerAgentUtils.registerImage | private static void registerImage(String imageId, String imageTag, String targetRepo,
ArrayListMultimap<String, String> artifactsProps, int buildInfoId) throws IOException {
DockerImage image = new DockerImage(imageId, imageTag, targetRepo, buildInfoId, artifactsProps);
images.add(image);
... | java | private static void registerImage(String imageId, String imageTag, String targetRepo,
ArrayListMultimap<String, String> artifactsProps, int buildInfoId) throws IOException {
DockerImage image = new DockerImage(imageId, imageTag, targetRepo, buildInfoId, artifactsProps);
images.add(image);
... | [
"private",
"static",
"void",
"registerImage",
"(",
"String",
"imageId",
",",
"String",
"imageTag",
",",
"String",
"targetRepo",
",",
"ArrayListMultimap",
"<",
"String",
",",
"String",
">",
"artifactsProps",
",",
"int",
"buildInfoId",
")",
"throws",
"IOException",
... | Registers an image to the images cache, so that it can be captured by the build-info proxy.
@param imageId
@param imageTag
@param targetRepo
@param buildInfoId
@throws IOException | [
"Registers",
"an",
"image",
"to",
"the",
"images",
"cache",
"so",
"that",
"it",
"can",
"be",
"captured",
"by",
"the",
"build",
"-",
"info",
"proxy",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java#L74-L78 |
164,654 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java | DockerAgentUtils.getImagesByBuildId | public static List<DockerImage> getImagesByBuildId(int buildInfoId) {
List<DockerImage> list = new ArrayList<DockerImage>();
Iterator<DockerImage> it = images.iterator();
while (it.hasNext()) {
DockerImage image = it.next();
if (image.getBuildInfoId() == buildInfoId && im... | java | public static List<DockerImage> getImagesByBuildId(int buildInfoId) {
List<DockerImage> list = new ArrayList<DockerImage>();
Iterator<DockerImage> it = images.iterator();
while (it.hasNext()) {
DockerImage image = it.next();
if (image.getBuildInfoId() == buildInfoId && im... | [
"public",
"static",
"List",
"<",
"DockerImage",
">",
"getImagesByBuildId",
"(",
"int",
"buildInfoId",
")",
"{",
"List",
"<",
"DockerImage",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"DockerImage",
">",
"(",
")",
";",
"Iterator",
"<",
"DockerImage",
">",
"... | Gets a list of registered docker images from the images cache, if it has been
registered to the cache for a specific build-info ID and if a docker manifest has been captured for it
by the build-info proxy.
@param buildInfoId
@return | [
"Gets",
"a",
"list",
"of",
"registered",
"docker",
"images",
"from",
"the",
"images",
"cache",
"if",
"it",
"has",
"been",
"registered",
"to",
"the",
"cache",
"for",
"a",
"specific",
"build",
"-",
"info",
"ID",
"and",
"if",
"a",
"docker",
"manifest",
"has... | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java#L87-L97 |
164,655 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java | DockerAgentUtils.getAndDiscardImagesByBuildId | public static List<DockerImage> getAndDiscardImagesByBuildId(int buildInfoId) {
List<DockerImage> list = new ArrayList<DockerImage>();
synchronized(images) {
Iterator<DockerImage> it = images.iterator();
while (it.hasNext()) {
DockerImage image = it.next();
... | java | public static List<DockerImage> getAndDiscardImagesByBuildId(int buildInfoId) {
List<DockerImage> list = new ArrayList<DockerImage>();
synchronized(images) {
Iterator<DockerImage> it = images.iterator();
while (it.hasNext()) {
DockerImage image = it.next();
... | [
"public",
"static",
"List",
"<",
"DockerImage",
">",
"getAndDiscardImagesByBuildId",
"(",
"int",
"buildInfoId",
")",
"{",
"List",
"<",
"DockerImage",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"DockerImage",
">",
"(",
")",
";",
"synchronized",
"(",
"images",
... | Gets a list of registered docker images from the images cache, if it has been
registered to the cache for a specific build-info ID and if a docker manifest has been captured for it
by the build-info proxy.
Additionally, the methods also removes the returned images from the cache.
@param buildInfoId
@return | [
"Gets",
"a",
"list",
"of",
"registered",
"docker",
"images",
"from",
"the",
"images",
"cache",
"if",
"it",
"has",
"been",
"registered",
"to",
"the",
"cache",
"for",
"a",
"specific",
"build",
"-",
"info",
"ID",
"and",
"if",
"a",
"docker",
"manifest",
"has... | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java#L107-L125 |
164,656 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java | DockerAgentUtils.getDockerImagesFromAgents | public static List<DockerImage> getDockerImagesFromAgents(final int buildInfoId, TaskListener listener) throws IOException, InterruptedException {
List<DockerImage> dockerImages = new ArrayList<DockerImage>();
// Collect images from the master:
dockerImages.addAll(getAndDiscardImagesByBuildId(b... | java | public static List<DockerImage> getDockerImagesFromAgents(final int buildInfoId, TaskListener listener) throws IOException, InterruptedException {
List<DockerImage> dockerImages = new ArrayList<DockerImage>();
// Collect images from the master:
dockerImages.addAll(getAndDiscardImagesByBuildId(b... | [
"public",
"static",
"List",
"<",
"DockerImage",
">",
"getDockerImagesFromAgents",
"(",
"final",
"int",
"buildInfoId",
",",
"TaskListener",
"listener",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"List",
"<",
"DockerImage",
">",
"dockerImages",
"=... | Retrieves from all the Jenkins agents all the docker images, which have been registered for a specific build-info ID
Only images for which manifests have been captured are returned.
@param buildInfoId
@return
@throws IOException
@throws InterruptedException | [
"Retrieves",
"from",
"all",
"the",
"Jenkins",
"agents",
"all",
"the",
"docker",
"images",
"which",
"have",
"been",
"registered",
"for",
"a",
"specific",
"build",
"-",
"info",
"ID",
"Only",
"images",
"for",
"which",
"manifests",
"have",
"been",
"captured",
"a... | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java#L136-L162 |
164,657 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java | DockerAgentUtils.pushImage | public static boolean pushImage(Launcher launcher, final JenkinsBuildInfoLog log, final String imageTag, final String username, final String password, final String host)
throws IOException, InterruptedException {
return launcher.getChannel().call(new MasterToSlaveCallable<Boolean, IOException>() {... | java | public static boolean pushImage(Launcher launcher, final JenkinsBuildInfoLog log, final String imageTag, final String username, final String password, final String host)
throws IOException, InterruptedException {
return launcher.getChannel().call(new MasterToSlaveCallable<Boolean, IOException>() {... | [
"public",
"static",
"boolean",
"pushImage",
"(",
"Launcher",
"launcher",
",",
"final",
"JenkinsBuildInfoLog",
"log",
",",
"final",
"String",
"imageTag",
",",
"final",
"String",
"username",
",",
"final",
"String",
"password",
",",
"final",
"String",
"host",
")",
... | Execute push docker image on agent
@param launcher
@param log
@param imageTag
@param username
@param password
@param host @return
@throws IOException
@throws InterruptedException | [
"Execute",
"push",
"docker",
"image",
"on",
"agent"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java#L176-L191 |
164,658 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java | DockerAgentUtils.pullImage | public static boolean pullImage(Launcher launcher, final String imageTag, final String username, final String password, final String host)
throws IOException, InterruptedException {
return launcher.getChannel().call(new MasterToSlaveCallable<Boolean, IOException>() {
public Boolean call... | java | public static boolean pullImage(Launcher launcher, final String imageTag, final String username, final String password, final String host)
throws IOException, InterruptedException {
return launcher.getChannel().call(new MasterToSlaveCallable<Boolean, IOException>() {
public Boolean call... | [
"public",
"static",
"boolean",
"pullImage",
"(",
"Launcher",
"launcher",
",",
"final",
"String",
"imageTag",
",",
"final",
"String",
"username",
",",
"final",
"String",
"password",
",",
"final",
"String",
"host",
")",
"throws",
"IOException",
",",
"InterruptedEx... | Execute pull docker image on agent
@param launcher
@param imageTag
@param username
@param password
@param host
@return
@throws IOException
@throws InterruptedException | [
"Execute",
"pull",
"docker",
"image",
"on",
"agent"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java#L205-L214 |
164,659 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java | DockerAgentUtils.updateImageParentOnAgents | public static boolean updateImageParentOnAgents(final JenkinsBuildInfoLog log, final String imageTag, final String host, final int buildInfoId) throws IOException, InterruptedException {
boolean parentUpdated = updateImageParent(log, imageTag, host, buildInfoId);
List<Node> nodes = Jenkins.getInstance()... | java | public static boolean updateImageParentOnAgents(final JenkinsBuildInfoLog log, final String imageTag, final String host, final int buildInfoId) throws IOException, InterruptedException {
boolean parentUpdated = updateImageParent(log, imageTag, host, buildInfoId);
List<Node> nodes = Jenkins.getInstance()... | [
"public",
"static",
"boolean",
"updateImageParentOnAgents",
"(",
"final",
"JenkinsBuildInfoLog",
"log",
",",
"final",
"String",
"imageTag",
",",
"final",
"String",
"host",
",",
"final",
"int",
"buildInfoId",
")",
"throws",
"IOException",
",",
"InterruptedException",
... | Updates property of parent id for the image provided.
Returns false if image was not captured true otherwise.
@param log
@param imageTag
@param host
@param buildInfoId
@return
@throws IOException
@throws InterruptedException | [
"Updates",
"property",
"of",
"parent",
"id",
"for",
"the",
"image",
"provided",
".",
"Returns",
"false",
"if",
"image",
"was",
"not",
"captured",
"true",
"otherwise",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java#L228-L243 |
164,660 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java | DockerAgentUtils.getImageIdFromAgent | public static String getImageIdFromAgent(Launcher launcher, final String imageTag, final String host) throws IOException, InterruptedException {
return launcher.getChannel().call(new MasterToSlaveCallable<String, IOException>() {
public String call() throws IOException {
return Docke... | java | public static String getImageIdFromAgent(Launcher launcher, final String imageTag, final String host) throws IOException, InterruptedException {
return launcher.getChannel().call(new MasterToSlaveCallable<String, IOException>() {
public String call() throws IOException {
return Docke... | [
"public",
"static",
"String",
"getImageIdFromAgent",
"(",
"Launcher",
"launcher",
",",
"final",
"String",
"imageTag",
",",
"final",
"String",
"host",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"return",
"launcher",
".",
"getChannel",
"(",
")",... | Get image ID from imageTag on the current agent.
@param imageTag
@return | [
"Get",
"image",
"ID",
"from",
"imageTag",
"on",
"the",
"current",
"agent",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java#L278-L284 |
164,661 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java | DockerAgentUtils.getParentIdFromAgent | public static String getParentIdFromAgent(Launcher launcher, final String imageID, final String host) throws IOException, InterruptedException {
return launcher.getChannel().call(new MasterToSlaveCallable<String, IOException>() {
public String call() throws IOException {
return Docke... | java | public static String getParentIdFromAgent(Launcher launcher, final String imageID, final String host) throws IOException, InterruptedException {
return launcher.getChannel().call(new MasterToSlaveCallable<String, IOException>() {
public String call() throws IOException {
return Docke... | [
"public",
"static",
"String",
"getParentIdFromAgent",
"(",
"Launcher",
"launcher",
",",
"final",
"String",
"imageID",
",",
"final",
"String",
"host",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"return",
"launcher",
".",
"getChannel",
"(",
")",... | Get image parent ID from imageID on the current agent.
@param imageID
@return | [
"Get",
"image",
"parent",
"ID",
"from",
"imageID",
"on",
"the",
"current",
"agent",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerAgentUtils.java#L292-L298 |
164,662 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/gradle/BaseGradleReleaseAction.java | BaseGradleReleaseAction.initBuilderSpecific | @Override
protected void initBuilderSpecific() throws Exception {
reset();
FilePath workspace = getModuleRoot(EnvVars.masterEnvVars);
FilePath gradlePropertiesPath = new FilePath(workspace, "gradle.properties");
if (releaseProps == null) {
releaseProps = PropertyUtils.get... | java | @Override
protected void initBuilderSpecific() throws Exception {
reset();
FilePath workspace = getModuleRoot(EnvVars.masterEnvVars);
FilePath gradlePropertiesPath = new FilePath(workspace, "gradle.properties");
if (releaseProps == null) {
releaseProps = PropertyUtils.get... | [
"@",
"Override",
"protected",
"void",
"initBuilderSpecific",
"(",
")",
"throws",
"Exception",
"{",
"reset",
"(",
")",
";",
"FilePath",
"workspace",
"=",
"getModuleRoot",
"(",
"EnvVars",
".",
"masterEnvVars",
")",
";",
"FilePath",
"gradlePropertiesPath",
"=",
"ne... | Initialize the version properties map from the gradle.properties file, and the additional properties from the
gradle.properties file. | [
"Initialize",
"the",
"version",
"properties",
"map",
"from",
"the",
"gradle",
".",
"properties",
"file",
"and",
"the",
"additional",
"properties",
"from",
"the",
"gradle",
".",
"properties",
"file",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/gradle/BaseGradleReleaseAction.java#L76-L88 |
164,663 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/gradle/BaseGradleReleaseAction.java | BaseGradleReleaseAction.getModuleRoot | public FilePath getModuleRoot(Map<String, String> globalEnv) throws IOException, InterruptedException {
FilePath someWorkspace = project.getSomeWorkspace();
if (someWorkspace == null) {
throw new IllegalStateException("Couldn't find workspace");
}
Map<String, String> workspa... | java | public FilePath getModuleRoot(Map<String, String> globalEnv) throws IOException, InterruptedException {
FilePath someWorkspace = project.getSomeWorkspace();
if (someWorkspace == null) {
throw new IllegalStateException("Couldn't find workspace");
}
Map<String, String> workspa... | [
"public",
"FilePath",
"getModuleRoot",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"globalEnv",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"FilePath",
"someWorkspace",
"=",
"project",
".",
"getSomeWorkspace",
"(",
")",
";",
"if",
"(",
"... | Get the root path where the build is located, the project may be checked out to
a sub-directory from the root workspace location.
@param globalEnv EnvVars to take the workspace from, if workspace is not found
then it is take from project.getSomeWorkspace()
@return The location of the root of the Gradle build.
@throws ... | [
"Get",
"the",
"root",
"path",
"where",
"the",
"build",
"is",
"located",
"the",
"project",
"may",
"be",
"checked",
"out",
"to",
"a",
"sub",
"-",
"directory",
"from",
"the",
"root",
"workspace",
"location",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/gradle/BaseGradleReleaseAction.java#L100-L124 |
164,664 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/gradle/BaseGradleReleaseAction.java | BaseGradleReleaseAction.extractNumericVersion | private String extractNumericVersion(Collection<String> versionStrings) {
if (versionStrings == null) {
return "";
}
for (String value : versionStrings) {
String releaseValue = calculateReleaseVersion(value);
if (!releaseValue.equals(value)) {
... | java | private String extractNumericVersion(Collection<String> versionStrings) {
if (versionStrings == null) {
return "";
}
for (String value : versionStrings) {
String releaseValue = calculateReleaseVersion(value);
if (!releaseValue.equals(value)) {
... | [
"private",
"String",
"extractNumericVersion",
"(",
"Collection",
"<",
"String",
">",
"versionStrings",
")",
"{",
"if",
"(",
"versionStrings",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"for",
"(",
"String",
"value",
":",
"versionStrings",
")",
"{",
... | Try to extract a numeric version from a collection of strings.
@param versionStrings Collection of string properties.
@return The version string if exists in the collection. | [
"Try",
"to",
"extract",
"a",
"numeric",
"version",
"from",
"a",
"collection",
"of",
"strings",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/gradle/BaseGradleReleaseAction.java#L341-L352 |
164,665 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/ReleaseAction.java | ReleaseAction.init | @SuppressWarnings("UnusedDeclaration")
public void init() throws Exception {
initBuilderSpecific();
resetFields();
if (!UserPluginInfo.NO_PLUGIN_KEY.equals(getSelectedStagingPluginName())) {
PluginSettings selectedStagingPluginSettings = getSelectedStagingPlugin();
tr... | java | @SuppressWarnings("UnusedDeclaration")
public void init() throws Exception {
initBuilderSpecific();
resetFields();
if (!UserPluginInfo.NO_PLUGIN_KEY.equals(getSelectedStagingPluginName())) {
PluginSettings selectedStagingPluginSettings = getSelectedStagingPlugin();
tr... | [
"@",
"SuppressWarnings",
"(",
"\"UnusedDeclaration\"",
")",
"public",
"void",
"init",
"(",
")",
"throws",
"Exception",
"{",
"initBuilderSpecific",
"(",
")",
";",
"resetFields",
"(",
")",
";",
"if",
"(",
"!",
"UserPluginInfo",
".",
"NO_PLUGIN_KEY",
".",
"equals... | invoked from the jelly file
@throws Exception Any exception | [
"invoked",
"from",
"the",
"jelly",
"file"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/ReleaseAction.java#L106-L130 |
164,666 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/ReleaseAction.java | ReleaseAction.doApi | @SuppressWarnings({"UnusedDeclaration"})
protected void doApi(StaplerRequest req, StaplerResponse resp) throws IOException, ServletException {
try {
log.log(Level.INFO, "Initiating Artifactory Release Staging using API");
// Enforce release permissions
project.checkPermis... | java | @SuppressWarnings({"UnusedDeclaration"})
protected void doApi(StaplerRequest req, StaplerResponse resp) throws IOException, ServletException {
try {
log.log(Level.INFO, "Initiating Artifactory Release Staging using API");
// Enforce release permissions
project.checkPermis... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"UnusedDeclaration\"",
"}",
")",
"protected",
"void",
"doApi",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"resp",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"try",
"{",
"log",
".",
"log",
"(",
"L... | This method is used to initiate a release staging process using the Artifactory Release Staging API. | [
"This",
"method",
"is",
"used",
"to",
"initiate",
"a",
"release",
"staging",
"process",
"using",
"the",
"Artifactory",
"Release",
"Staging",
"API",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/ReleaseAction.java#L273-L313 |
164,667 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/ReleaseAction.java | ReleaseAction.calculateNextVersion | protected String calculateNextVersion(String fromVersion) {
// first turn it to release version
fromVersion = calculateReleaseVersion(fromVersion);
String nextVersion;
int lastDotIndex = fromVersion.lastIndexOf('.');
try {
if (lastDotIndex != -1) {
// ... | java | protected String calculateNextVersion(String fromVersion) {
// first turn it to release version
fromVersion = calculateReleaseVersion(fromVersion);
String nextVersion;
int lastDotIndex = fromVersion.lastIndexOf('.');
try {
if (lastDotIndex != -1) {
// ... | [
"protected",
"String",
"calculateNextVersion",
"(",
"String",
"fromVersion",
")",
"{",
"// first turn it to release version",
"fromVersion",
"=",
"calculateReleaseVersion",
"(",
"fromVersion",
")",
";",
"String",
"nextVersion",
";",
"int",
"lastDotIndex",
"=",
"fromVersio... | Calculates the next snapshot version based on the current release version
@param fromVersion The version to bump to next development version
@return The next calculated development (snapshot) version | [
"Calculates",
"the",
"next",
"snapshot",
"version",
"based",
"on",
"the",
"current",
"release",
"version"
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/ReleaseAction.java#L470-L499 |
164,668 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/ReleaseAction.java | ReleaseAction.addVars | public void addVars(Map<String, String> env) {
if (tagUrl != null) {
env.put("RELEASE_SCM_TAG", tagUrl);
env.put(RT_RELEASE_STAGING + "SCM_TAG", tagUrl);
}
if (releaseBranch != null) {
env.put("RELEASE_SCM_BRANCH", releaseBranch);
env.put(RT_RELEAS... | java | public void addVars(Map<String, String> env) {
if (tagUrl != null) {
env.put("RELEASE_SCM_TAG", tagUrl);
env.put(RT_RELEASE_STAGING + "SCM_TAG", tagUrl);
}
if (releaseBranch != null) {
env.put("RELEASE_SCM_BRANCH", releaseBranch);
env.put(RT_RELEAS... | [
"public",
"void",
"addVars",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"env",
")",
"{",
"if",
"(",
"tagUrl",
"!=",
"null",
")",
"{",
"env",
".",
"put",
"(",
"\"RELEASE_SCM_TAG\"",
",",
"tagUrl",
")",
";",
"env",
".",
"put",
"(",
"RT_RELEASE_STAG... | Add some of the release build properties to a map. | [
"Add",
"some",
"of",
"the",
"release",
"build",
"properties",
"to",
"a",
"map",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/ReleaseAction.java#L678-L693 |
164,669 | jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/gradle/GradleInitScriptWriter.java | GradleInitScriptWriter.generateInitScript | public String generateInitScript(EnvVars env) throws IOException, InterruptedException {
StringBuilder initScript = new StringBuilder();
InputStream templateStream = getClass().getResourceAsStream("/initscripttemplate.gradle");
String templateAsString = IOUtils.toString(templateStream, Charsets.... | java | public String generateInitScript(EnvVars env) throws IOException, InterruptedException {
StringBuilder initScript = new StringBuilder();
InputStream templateStream = getClass().getResourceAsStream("/initscripttemplate.gradle");
String templateAsString = IOUtils.toString(templateStream, Charsets.... | [
"public",
"String",
"generateInitScript",
"(",
"EnvVars",
"env",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"StringBuilder",
"initScript",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"InputStream",
"templateStream",
"=",
"getClass",
"(",
")",
... | Generate the init script from the Artifactory URL.
@return The generated script. | [
"Generate",
"the",
"init",
"script",
"from",
"the",
"Artifactory",
"URL",
"."
] | f5fcfff6a5a50be5374813e49d1fe3aaf6422333 | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/gradle/GradleInitScriptWriter.java#L50-L61 |
164,670 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/binary/BinaryUtils.java | BinaryUtils.convertBytesToInt | public static int convertBytesToInt(byte[] bytes, int offset)
{
return (BITWISE_BYTE_TO_INT & bytes[offset + 3])
| ((BITWISE_BYTE_TO_INT & bytes[offset + 2]) << 8)
| ((BITWISE_BYTE_TO_INT & bytes[offset + 1]) << 16)
| ((BITWISE_BYTE_TO_INT & bytes[offset]) << ... | java | public static int convertBytesToInt(byte[] bytes, int offset)
{
return (BITWISE_BYTE_TO_INT & bytes[offset + 3])
| ((BITWISE_BYTE_TO_INT & bytes[offset + 2]) << 8)
| ((BITWISE_BYTE_TO_INT & bytes[offset + 1]) << 16)
| ((BITWISE_BYTE_TO_INT & bytes[offset]) << ... | [
"public",
"static",
"int",
"convertBytesToInt",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
")",
"{",
"return",
"(",
"BITWISE_BYTE_TO_INT",
"&",
"bytes",
"[",
"offset",
"+",
"3",
"]",
")",
"|",
"(",
"(",
"BITWISE_BYTE_TO_INT",
"&",
"bytes",
"["... | Take four bytes from the specified position in the specified
block and convert them into a 32-bit int, using the big-endian
convention.
@param bytes The data to read from.
@param offset The position to start reading the 4-byte int from.
@return The 32-bit integer represented by the four bytes. | [
"Take",
"four",
"bytes",
"from",
"the",
"specified",
"position",
"in",
"the",
"specified",
"block",
"and",
"convert",
"them",
"into",
"a",
"32",
"-",
"bit",
"int",
"using",
"the",
"big",
"-",
"endian",
"convention",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/binary/BinaryUtils.java#L85-L91 |
164,671 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/binary/BinaryUtils.java | BinaryUtils.convertBytesToInts | public static int[] convertBytesToInts(byte[] bytes)
{
if (bytes.length % 4 != 0)
{
throw new IllegalArgumentException("Number of input bytes must be a multiple of 4.");
}
int[] ints = new int[bytes.length / 4];
for (int i = 0; i < ints.length; i++)
{
... | java | public static int[] convertBytesToInts(byte[] bytes)
{
if (bytes.length % 4 != 0)
{
throw new IllegalArgumentException("Number of input bytes must be a multiple of 4.");
}
int[] ints = new int[bytes.length / 4];
for (int i = 0; i < ints.length; i++)
{
... | [
"public",
"static",
"int",
"[",
"]",
"convertBytesToInts",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"if",
"(",
"bytes",
".",
"length",
"%",
"4",
"!=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Number of input bytes must be a multiple ... | Convert an array of bytes into an array of ints. 4 bytes from the
input data map to a single int in the output data.
@param bytes The data to read from.
@return An array of 32-bit integers constructed from the data.
@since 1.1 | [
"Convert",
"an",
"array",
"of",
"bytes",
"into",
"an",
"array",
"of",
"ints",
".",
"4",
"bytes",
"from",
"the",
"input",
"data",
"map",
"to",
"a",
"single",
"int",
"in",
"the",
"output",
"data",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/binary/BinaryUtils.java#L101-L113 |
164,672 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/binary/BinaryUtils.java | BinaryUtils.convertBytesToLong | public static long convertBytesToLong(byte[] bytes, int offset)
{
long value = 0;
for (int i = offset; i < offset + 8; i++)
{
byte b = bytes[i];
value <<= 8;
value |= b;
}
return value;
} | java | public static long convertBytesToLong(byte[] bytes, int offset)
{
long value = 0;
for (int i = offset; i < offset + 8; i++)
{
byte b = bytes[i];
value <<= 8;
value |= b;
}
return value;
} | [
"public",
"static",
"long",
"convertBytesToLong",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
")",
"{",
"long",
"value",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"offset",
";",
"i",
"<",
"offset",
"+",
"8",
";",
"i",
"++",
")",
"{",
... | Utility method to convert an array of bytes into a long. Byte ordered is
assumed to be big-endian.
@param bytes The data to read from.
@param offset The position to start reading the 8-byte long from.
@return The 64-bit integer represented by the eight bytes.
@since 1.1 | [
"Utility",
"method",
"to",
"convert",
"an",
"array",
"of",
"bytes",
"into",
"a",
"long",
".",
"Byte",
"ordered",
"is",
"assumed",
"to",
"be",
"big",
"-",
"endian",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/binary/BinaryUtils.java#L124-L135 |
164,673 | dwdyer/uncommons-maths | demo/src/java/main/org/uncommons/maths/demo/GaussianDistribution.java | GaussianDistribution.getExpectedProbability | private double getExpectedProbability(double x)
{
double y = 1 / (standardDeviation * Math.sqrt(Math.PI * 2));
double z = -(Math.pow(x - mean, 2) / (2 * Math.pow(standardDeviation, 2)));
return y * Math.exp(z);
} | java | private double getExpectedProbability(double x)
{
double y = 1 / (standardDeviation * Math.sqrt(Math.PI * 2));
double z = -(Math.pow(x - mean, 2) / (2 * Math.pow(standardDeviation, 2)));
return y * Math.exp(z);
} | [
"private",
"double",
"getExpectedProbability",
"(",
"double",
"x",
")",
"{",
"double",
"y",
"=",
"1",
"/",
"(",
"standardDeviation",
"*",
"Math",
".",
"sqrt",
"(",
"Math",
".",
"PI",
"*",
"2",
")",
")",
";",
"double",
"z",
"=",
"-",
"(",
"Math",
".... | This is the probability density function for the Gaussian
distribution. | [
"This",
"is",
"the",
"probability",
"density",
"function",
"for",
"the",
"Gaussian",
"distribution",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/demo/src/java/main/org/uncommons/maths/demo/GaussianDistribution.java#L65-L70 |
164,674 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/combinatorics/PermutationGenerator.java | PermutationGenerator.reset | public final void reset()
{
for (int i = 0; i < permutationIndices.length; i++)
{
permutationIndices[i] = i;
}
remainingPermutations = totalPermutations;
} | java | public final void reset()
{
for (int i = 0; i < permutationIndices.length; i++)
{
permutationIndices[i] = i;
}
remainingPermutations = totalPermutations;
} | [
"public",
"final",
"void",
"reset",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"permutationIndices",
".",
"length",
";",
"i",
"++",
")",
"{",
"permutationIndices",
"[",
"i",
"]",
"=",
"i",
";",
"}",
"remainingPermutations",
"=",
... | Resets the generator state. | [
"Resets",
"the",
"generator",
"state",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/combinatorics/PermutationGenerator.java#L83-L90 |
164,675 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/combinatorics/PermutationGenerator.java | PermutationGenerator.nextPermutationAsArray | @SuppressWarnings("unchecked")
public T[] nextPermutationAsArray()
{
T[] permutation = (T[]) Array.newInstance(elements.getClass().getComponentType(),
permutationIndices.length);
return nextPermutationAsArray(permutation);
} | java | @SuppressWarnings("unchecked")
public T[] nextPermutationAsArray()
{
T[] permutation = (T[]) Array.newInstance(elements.getClass().getComponentType(),
permutationIndices.length);
return nextPermutationAsArray(permutation);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"T",
"[",
"]",
"nextPermutationAsArray",
"(",
")",
"{",
"T",
"[",
"]",
"permutation",
"=",
"(",
"T",
"[",
"]",
")",
"Array",
".",
"newInstance",
"(",
"elements",
".",
"getClass",
"(",
")",
"... | Generate the next permutation and return an array containing
the elements in the appropriate order.
@see #nextPermutationAsArray(Object[])
@see #nextPermutationAsList()
@return The next permutation as an array. | [
"Generate",
"the",
"next",
"permutation",
"and",
"return",
"an",
"array",
"containing",
"the",
"elements",
"in",
"the",
"appropriate",
"order",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/combinatorics/PermutationGenerator.java#L131-L137 |
164,676 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/combinatorics/PermutationGenerator.java | PermutationGenerator.nextPermutationAsList | public List<T> nextPermutationAsList()
{
List<T> permutation = new ArrayList<T>(elements.length);
return nextPermutationAsList(permutation);
} | java | public List<T> nextPermutationAsList()
{
List<T> permutation = new ArrayList<T>(elements.length);
return nextPermutationAsList(permutation);
} | [
"public",
"List",
"<",
"T",
">",
"nextPermutationAsList",
"(",
")",
"{",
"List",
"<",
"T",
">",
"permutation",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
"elements",
".",
"length",
")",
";",
"return",
"nextPermutationAsList",
"(",
"permutation",
")",
"... | Generate the next permutation and return a list containing
the elements in the appropriate order.
@see #nextPermutationAsList(java.util.List)
@see #nextPermutationAsArray()
@return The next permutation as a list. | [
"Generate",
"the",
"next",
"permutation",
"and",
"return",
"a",
"list",
"containing",
"the",
"elements",
"in",
"the",
"appropriate",
"order",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/combinatorics/PermutationGenerator.java#L179-L183 |
164,677 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/random/JavaRNG.java | JavaRNG.createLongSeed | private static long createLongSeed(byte[] seed)
{
if (seed == null || seed.length != SEED_SIZE_BYTES)
{
throw new IllegalArgumentException("Java RNG requires a 64-bit (8-byte) seed.");
}
return BinaryUtils.convertBytesToLong(seed, 0);
} | java | private static long createLongSeed(byte[] seed)
{
if (seed == null || seed.length != SEED_SIZE_BYTES)
{
throw new IllegalArgumentException("Java RNG requires a 64-bit (8-byte) seed.");
}
return BinaryUtils.convertBytesToLong(seed, 0);
} | [
"private",
"static",
"long",
"createLongSeed",
"(",
"byte",
"[",
"]",
"seed",
")",
"{",
"if",
"(",
"seed",
"==",
"null",
"||",
"seed",
".",
"length",
"!=",
"SEED_SIZE_BYTES",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Java RNG requires a 64-... | Helper method to convert seed bytes into the long value required by the
super class. | [
"Helper",
"method",
"to",
"convert",
"seed",
"bytes",
"into",
"the",
"long",
"value",
"required",
"by",
"the",
"super",
"class",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/random/JavaRNG.java#L79-L86 |
164,678 | dwdyer/uncommons-maths | demo/src/java/main/org/uncommons/swing/SwingBackgroundTask.java | SwingBackgroundTask.execute | public void execute()
{
Runnable task = new Runnable()
{
public void run()
{
final V result = performTask();
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
... | java | public void execute()
{
Runnable task = new Runnable()
{
public void run()
{
final V result = performTask();
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
... | [
"public",
"void",
"execute",
"(",
")",
"{",
"Runnable",
"task",
"=",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"final",
"V",
"result",
"=",
"performTask",
"(",
")",
";",
"SwingUtilities",
".",
"invokeLater",
"(",
"new",
... | Asynchronous call that begins execution of the task
and returns immediately. | [
"Asynchronous",
"call",
"that",
"begins",
"execution",
"of",
"the",
"task",
"and",
"returns",
"immediately",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/demo/src/java/main/org/uncommons/swing/SwingBackgroundTask.java#L49-L67 |
164,679 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/statistics/DataSet.java | DataSet.addValue | public void addValue(double value)
{
if (dataSetSize == dataSet.length)
{
// Increase the capacity of the array.
int newLength = (int) (GROWTH_RATE * dataSetSize);
double[] newDataSet = new double[newLength];
System.arraycopy(dataSet, 0, newDataSet, 0,... | java | public void addValue(double value)
{
if (dataSetSize == dataSet.length)
{
// Increase the capacity of the array.
int newLength = (int) (GROWTH_RATE * dataSetSize);
double[] newDataSet = new double[newLength];
System.arraycopy(dataSet, 0, newDataSet, 0,... | [
"public",
"void",
"addValue",
"(",
"double",
"value",
")",
"{",
"if",
"(",
"dataSetSize",
"==",
"dataSet",
".",
"length",
")",
"{",
"// Increase the capacity of the array.",
"int",
"newLength",
"=",
"(",
"int",
")",
"(",
"GROWTH_RATE",
"*",
"dataSetSize",
")",... | Adds a single value to the data set and updates any
statistics that are calculated cumulatively.
@param value The value to add. | [
"Adds",
"a",
"single",
"value",
"to",
"the",
"data",
"set",
"and",
"updates",
"any",
"statistics",
"that",
"are",
"calculated",
"cumulatively",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/statistics/DataSet.java#L83-L96 |
164,680 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/statistics/DataSet.java | DataSet.getMedian | public final double getMedian()
{
assertNotEmpty();
// Sort the data (take a copy to do this).
double[] dataCopy = new double[getSize()];
System.arraycopy(dataSet, 0, dataCopy, 0, dataCopy.length);
Arrays.sort(dataCopy);
int midPoint = dataCopy.length / 2;
if ... | java | public final double getMedian()
{
assertNotEmpty();
// Sort the data (take a copy to do this).
double[] dataCopy = new double[getSize()];
System.arraycopy(dataSet, 0, dataCopy, 0, dataCopy.length);
Arrays.sort(dataCopy);
int midPoint = dataCopy.length / 2;
if ... | [
"public",
"final",
"double",
"getMedian",
"(",
")",
"{",
"assertNotEmpty",
"(",
")",
";",
"// Sort the data (take a copy to do this).",
"double",
"[",
"]",
"dataCopy",
"=",
"new",
"double",
"[",
"getSize",
"(",
")",
"]",
";",
"System",
".",
"arraycopy",
"(",
... | Determines the median value of the data set.
@return If the number of elements is odd, returns the middle element.
If the number of elements is even, returns the midpoint of the two
middle elements.
@since 1.0.1 | [
"Determines",
"the",
"median",
"value",
"of",
"the",
"data",
"set",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/statistics/DataSet.java#L159-L175 |
164,681 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/statistics/DataSet.java | DataSet.sumSquaredDiffs | private double sumSquaredDiffs()
{
double mean = getArithmeticMean();
double squaredDiffs = 0;
for (int i = 0; i < getSize(); i++)
{
double diff = mean - dataSet[i];
squaredDiffs += (diff * diff);
}
return squaredDiffs;
} | java | private double sumSquaredDiffs()
{
double mean = getArithmeticMean();
double squaredDiffs = 0;
for (int i = 0; i < getSize(); i++)
{
double diff = mean - dataSet[i];
squaredDiffs += (diff * diff);
}
return squaredDiffs;
} | [
"private",
"double",
"sumSquaredDiffs",
"(",
")",
"{",
"double",
"mean",
"=",
"getArithmeticMean",
"(",
")",
";",
"double",
"squaredDiffs",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getSize",
"(",
")",
";",
"i",
"++",
")",
"{... | Helper method for variance calculations.
@return The sum of the squares of the differences between
each value and the arithmetic mean.
@throws EmptyDataSetException If the data set is empty. | [
"Helper",
"method",
"for",
"variance",
"calculations",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/statistics/DataSet.java#L298-L308 |
164,682 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/binary/BitString.java | BitString.getBit | public boolean getBit(int index)
{
assertValidIndex(index);
int word = index / WORD_LENGTH;
int offset = index % WORD_LENGTH;
return (data[word] & (1 << offset)) != 0;
} | java | public boolean getBit(int index)
{
assertValidIndex(index);
int word = index / WORD_LENGTH;
int offset = index % WORD_LENGTH;
return (data[word] & (1 << offset)) != 0;
} | [
"public",
"boolean",
"getBit",
"(",
"int",
"index",
")",
"{",
"assertValidIndex",
"(",
"index",
")",
";",
"int",
"word",
"=",
"index",
"/",
"WORD_LENGTH",
";",
"int",
"offset",
"=",
"index",
"%",
"WORD_LENGTH",
";",
"return",
"(",
"data",
"[",
"word",
... | Returns the bit at the specified index.
@param index The index of the bit to look-up (0 is the least-significant bit).
@return A boolean indicating whether the bit is set or not.
@throws IndexOutOfBoundsException If the specified index is not a bit
position in this bit string. | [
"Returns",
"the",
"bit",
"at",
"the",
"specified",
"index",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/binary/BitString.java#L129-L135 |
164,683 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/binary/BitString.java | BitString.setBit | public void setBit(int index, boolean set)
{
assertValidIndex(index);
int word = index / WORD_LENGTH;
int offset = index % WORD_LENGTH;
if (set)
{
data[word] |= (1 << offset);
}
else // Unset the bit.
{
data[word] &= ~(1 << offs... | java | public void setBit(int index, boolean set)
{
assertValidIndex(index);
int word = index / WORD_LENGTH;
int offset = index % WORD_LENGTH;
if (set)
{
data[word] |= (1 << offset);
}
else // Unset the bit.
{
data[word] &= ~(1 << offs... | [
"public",
"void",
"setBit",
"(",
"int",
"index",
",",
"boolean",
"set",
")",
"{",
"assertValidIndex",
"(",
"index",
")",
";",
"int",
"word",
"=",
"index",
"/",
"WORD_LENGTH",
";",
"int",
"offset",
"=",
"index",
"%",
"WORD_LENGTH",
";",
"if",
"(",
"set"... | Sets the bit at the specified index.
@param index The index of the bit to set (0 is the least-significant bit).
@param set A boolean indicating whether the bit should be set or not.
@throws IndexOutOfBoundsException If the specified index is not a bit
position in this bit string. | [
"Sets",
"the",
"bit",
"at",
"the",
"specified",
"index",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/binary/BitString.java#L145-L158 |
164,684 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/binary/BitString.java | BitString.flipBit | public void flipBit(int index)
{
assertValidIndex(index);
int word = index / WORD_LENGTH;
int offset = index % WORD_LENGTH;
data[word] ^= (1 << offset);
} | java | public void flipBit(int index)
{
assertValidIndex(index);
int word = index / WORD_LENGTH;
int offset = index % WORD_LENGTH;
data[word] ^= (1 << offset);
} | [
"public",
"void",
"flipBit",
"(",
"int",
"index",
")",
"{",
"assertValidIndex",
"(",
"index",
")",
";",
"int",
"word",
"=",
"index",
"/",
"WORD_LENGTH",
";",
"int",
"offset",
"=",
"index",
"%",
"WORD_LENGTH",
";",
"data",
"[",
"word",
"]",
"^=",
"(",
... | Inverts the value of the bit at the specified index.
@param index The bit to flip (0 is the least-significant bit).
@throws IndexOutOfBoundsException If the specified index is not a bit
position in this bit string. | [
"Inverts",
"the",
"value",
"of",
"the",
"bit",
"at",
"the",
"specified",
"index",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/binary/BitString.java#L167-L173 |
164,685 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/binary/BitString.java | BitString.swapSubstring | public void swapSubstring(BitString other, int start, int length)
{
assertValidIndex(start);
other.assertValidIndex(start);
int word = start / WORD_LENGTH;
int partialWordSize = (WORD_LENGTH - start) % WORD_LENGTH;
if (partialWordSize > 0)
{
swap... | java | public void swapSubstring(BitString other, int start, int length)
{
assertValidIndex(start);
other.assertValidIndex(start);
int word = start / WORD_LENGTH;
int partialWordSize = (WORD_LENGTH - start) % WORD_LENGTH;
if (partialWordSize > 0)
{
swap... | [
"public",
"void",
"swapSubstring",
"(",
"BitString",
"other",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"assertValidIndex",
"(",
"start",
")",
";",
"other",
".",
"assertValidIndex",
"(",
"start",
")",
";",
"int",
"word",
"=",
"start",
"/",
"WO... | An efficient method for exchanging data between two bit strings. Both bit strings must
be long enough that they contain the full length of the specified substring.
@param other The bitstring with which this bitstring should swap bits.
@param start The start position for the substrings to be exchanged. All bit
indices... | [
"An",
"efficient",
"method",
"for",
"exchanging",
"data",
"between",
"two",
"bit",
"strings",
".",
"Both",
"bit",
"strings",
"must",
"be",
"long",
"enough",
"that",
"they",
"contain",
"the",
"full",
"length",
"of",
"the",
"specified",
"substring",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/binary/BitString.java#L237-L265 |
164,686 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/number/Rational.java | Rational.compareTo | public int compareTo(Rational other)
{
if (denominator == other.getDenominator())
{
return ((Long) numerator).compareTo(other.getNumerator());
}
else
{
Long adjustedNumerator = numerator * other.getDenominator();
Long otherAdjustedNumerator... | java | public int compareTo(Rational other)
{
if (denominator == other.getDenominator())
{
return ((Long) numerator).compareTo(other.getNumerator());
}
else
{
Long adjustedNumerator = numerator * other.getDenominator();
Long otherAdjustedNumerator... | [
"public",
"int",
"compareTo",
"(",
"Rational",
"other",
")",
"{",
"if",
"(",
"denominator",
"==",
"other",
".",
"getDenominator",
"(",
")",
")",
"{",
"return",
"(",
"(",
"Long",
")",
"numerator",
")",
".",
"compareTo",
"(",
"other",
".",
"getNumerator",
... | Compares this value with the specified object for order. Returns a negative
integer, zero, or a positive integer as this value is less than, equal to, or
greater than the specified value.
@param other Another Rational value.
@return A negative integer, zero, or a positive integer as this value is less
than, equal to, o... | [
"Compares",
"this",
"value",
"with",
"the",
"specified",
"object",
"for",
"order",
".",
"Returns",
"a",
"negative",
"integer",
"zero",
"or",
"a",
"positive",
"integer",
"as",
"this",
"value",
"is",
"less",
"than",
"equal",
"to",
"or",
"greater",
"than",
"t... | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/number/Rational.java#L329-L341 |
164,687 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/random/DiehardInputGenerator.java | DiehardInputGenerator.generateOutputFile | public static void generateOutputFile(Random rng,
File outputFile) throws IOException
{
DataOutputStream dataOutput = null;
try
{
dataOutput = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(outputFile)));
f... | java | public static void generateOutputFile(Random rng,
File outputFile) throws IOException
{
DataOutputStream dataOutput = null;
try
{
dataOutput = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(outputFile)));
f... | [
"public",
"static",
"void",
"generateOutputFile",
"(",
"Random",
"rng",
",",
"File",
"outputFile",
")",
"throws",
"IOException",
"{",
"DataOutputStream",
"dataOutput",
"=",
"null",
";",
"try",
"{",
"dataOutput",
"=",
"new",
"DataOutputStream",
"(",
"new",
"Buffe... | Generates a file of random data in a format suitable for the DIEHARD test.
DIEHARD requires 3 million 32-bit integers.
@param rng The random number generator to use to generate the data.
@param outputFile The file that the random data is written to.
@throws IOException If there is a problem writing to the file. | [
"Generates",
"a",
"file",
"of",
"random",
"data",
"in",
"a",
"format",
"suitable",
"for",
"the",
"DIEHARD",
"test",
".",
"DIEHARD",
"requires",
"3",
"million",
"32",
"-",
"bit",
"integers",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/random/DiehardInputGenerator.java#L70-L90 |
164,688 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/Maths.java | Maths.raiseToPower | public static long raiseToPower(int value, int power)
{
if (power < 0)
{
throw new IllegalArgumentException("This method does not support negative powers.");
}
long result = 1;
for (int i = 0; i < power; i++)
{
result *= value;
}
... | java | public static long raiseToPower(int value, int power)
{
if (power < 0)
{
throw new IllegalArgumentException("This method does not support negative powers.");
}
long result = 1;
for (int i = 0; i < power; i++)
{
result *= value;
}
... | [
"public",
"static",
"long",
"raiseToPower",
"(",
"int",
"value",
",",
"int",
"power",
")",
"{",
"if",
"(",
"power",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"This method does not support negative powers.\"",
")",
";",
"}",
"long",
... | Calculate the first argument raised to the power of the second.
This method only supports non-negative powers.
@param value The number to be raised.
@param power The exponent (must be positive).
@return {@code value} raised to {@code power}. | [
"Calculate",
"the",
"first",
"argument",
"raised",
"to",
"the",
"power",
"of",
"the",
"second",
".",
"This",
"method",
"only",
"supports",
"non",
"-",
"negative",
"powers",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/Maths.java#L111-L123 |
164,689 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/Maths.java | Maths.restrictRange | public static int restrictRange(int value, int min, int max)
{
return Math.min((Math.max(value, min)), max);
} | java | public static int restrictRange(int value, int min, int max)
{
return Math.min((Math.max(value, min)), max);
} | [
"public",
"static",
"int",
"restrictRange",
"(",
"int",
"value",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"return",
"Math",
".",
"min",
"(",
"(",
"Math",
".",
"max",
"(",
"value",
",",
"min",
")",
")",
",",
"max",
")",
";",
"}"
] | If the specified value is not greater than or equal to the specified minimum and
less than or equal to the specified maximum, adjust it so that it is.
@param value The value to check.
@param min The minimum permitted value.
@param max The maximum permitted value.
@return {@code value} if it is between the specified lim... | [
"If",
"the",
"specified",
"value",
"is",
"not",
"greater",
"than",
"or",
"equal",
"to",
"the",
"specified",
"minimum",
"and",
"less",
"than",
"or",
"equal",
"to",
"the",
"specified",
"maximum",
"adjust",
"it",
"so",
"that",
"it",
"is",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/Maths.java#L170-L173 |
164,690 | dwdyer/uncommons-maths | demo/src/java/main/org/uncommons/maths/demo/ProbabilityDistribution.java | ProbabilityDistribution.doQuantization | protected static Map<Double, Double> doQuantization(double max,
double min,
double[] values)
{
double range = max - min;
int noIntervals = 20;
double intervalSize = range / noInter... | java | protected static Map<Double, Double> doQuantization(double max,
double min,
double[] values)
{
double range = max - min;
int noIntervals = 20;
double intervalSize = range / noInter... | [
"protected",
"static",
"Map",
"<",
"Double",
",",
"Double",
">",
"doQuantization",
"(",
"double",
"max",
",",
"double",
"min",
",",
"double",
"[",
"]",
"values",
")",
"{",
"double",
"range",
"=",
"max",
"-",
"min",
";",
"int",
"noIntervals",
"=",
"20",... | Convert the continuous values into discrete values by chopping up
the distribution into several equally-sized intervals. | [
"Convert",
"the",
"continuous",
"values",
"into",
"discrete",
"values",
"by",
"chopping",
"up",
"the",
"distribution",
"into",
"several",
"equally",
"-",
"sized",
"intervals",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/demo/src/java/main/org/uncommons/maths/demo/ProbabilityDistribution.java#L90-L113 |
164,691 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/combinatorics/CombinationGenerator.java | CombinationGenerator.reset | public final void reset()
{
for (int i = 0; i < combinationIndices.length; i++)
{
combinationIndices[i] = i;
}
remainingCombinations = totalCombinations;
} | java | public final void reset()
{
for (int i = 0; i < combinationIndices.length; i++)
{
combinationIndices[i] = i;
}
remainingCombinations = totalCombinations;
} | [
"public",
"final",
"void",
"reset",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"combinationIndices",
".",
"length",
";",
"i",
"++",
")",
"{",
"combinationIndices",
"[",
"i",
"]",
"=",
"i",
";",
"}",
"remainingCombinations",
"=",
... | Reset the combination generator. | [
"Reset",
"the",
"combination",
"generator",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/combinatorics/CombinationGenerator.java#L94-L101 |
164,692 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/combinatorics/CombinationGenerator.java | CombinationGenerator.nextCombinationAsArray | @SuppressWarnings("unchecked")
public T[] nextCombinationAsArray()
{
T[] combination = (T[]) Array.newInstance(elements.getClass().getComponentType(),
combinationIndices.length);
return nextCombinationAsArray(combination);
} | java | @SuppressWarnings("unchecked")
public T[] nextCombinationAsArray()
{
T[] combination = (T[]) Array.newInstance(elements.getClass().getComponentType(),
combinationIndices.length);
return nextCombinationAsArray(combination);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"T",
"[",
"]",
"nextCombinationAsArray",
"(",
")",
"{",
"T",
"[",
"]",
"combination",
"=",
"(",
"T",
"[",
"]",
")",
"Array",
".",
"newInstance",
"(",
"elements",
".",
"getClass",
"(",
")",
"... | Generate the next combination and return an array containing
the appropriate elements.
@see #nextCombinationAsArray(Object[])
@see #nextCombinationAsList()
@return An array containing the elements that make up the next combination. | [
"Generate",
"the",
"next",
"combination",
"and",
"return",
"an",
"array",
"containing",
"the",
"appropriate",
"elements",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/combinatorics/CombinationGenerator.java#L139-L145 |
164,693 | dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/number/AdjustableNumberGenerator.java | AdjustableNumberGenerator.setValue | public void setValue(T value)
{
try
{
lock.writeLock().lock();
this.value = value;
}
finally
{
lock.writeLock().unlock();
}
} | java | public void setValue(T value)
{
try
{
lock.writeLock().lock();
this.value = value;
}
finally
{
lock.writeLock().unlock();
}
} | [
"public",
"void",
"setValue",
"(",
"T",
"value",
")",
"{",
"try",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"this",
".",
"value",
"=",
"value",
";",
"}",
"finally",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"unlock"... | Change the value that is returned by this generator.
@param value The new value to return. | [
"Change",
"the",
"value",
"that",
"is",
"returned",
"by",
"this",
"generator",
"."
] | b7ba13aea70625bb7f37c856783a29e17e354964 | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/number/AdjustableNumberGenerator.java#L52-L63 |
164,694 | aliyun/fc-java-sdk | src/main/java/com/aliyuncs/fc/auth/AcsURLEncoder.java | AcsURLEncoder.urlEncode | public static String urlEncode(String path) throws URISyntaxException {
if (isNullOrEmpty(path)) return path;
return UrlEscapers.urlFragmentEscaper().escape(path);
} | java | public static String urlEncode(String path) throws URISyntaxException {
if (isNullOrEmpty(path)) return path;
return UrlEscapers.urlFragmentEscaper().escape(path);
} | [
"public",
"static",
"String",
"urlEncode",
"(",
"String",
"path",
")",
"throws",
"URISyntaxException",
"{",
"if",
"(",
"isNullOrEmpty",
"(",
"path",
")",
")",
"return",
"path",
";",
"return",
"UrlEscapers",
".",
"urlFragmentEscaper",
"(",
")",
".",
"escape",
... | used for encoding url path segment | [
"used",
"for",
"encoding",
"url",
"path",
"segment"
] | 45ee0cbff93d4ea7eaa87fc08fd18ac176df2dfe | https://github.com/aliyun/fc-java-sdk/blob/45ee0cbff93d4ea7eaa87fc08fd18ac176df2dfe/src/main/java/com/aliyuncs/fc/auth/AcsURLEncoder.java#L42-L46 |
164,695 | aliyun/fc-java-sdk | src/main/java/com/aliyuncs/fc/auth/AcsURLEncoder.java | AcsURLEncoder.encode | public static String encode(String value) throws UnsupportedEncodingException {
if (isNullOrEmpty(value)) return value;
return URLEncoder.encode(value, URL_ENCODING);
} | java | public static String encode(String value) throws UnsupportedEncodingException {
if (isNullOrEmpty(value)) return value;
return URLEncoder.encode(value, URL_ENCODING);
} | [
"public",
"static",
"String",
"encode",
"(",
"String",
"value",
")",
"throws",
"UnsupportedEncodingException",
"{",
"if",
"(",
"isNullOrEmpty",
"(",
"value",
")",
")",
"return",
"value",
";",
"return",
"URLEncoder",
".",
"encode",
"(",
"value",
",",
"URL_ENCOD... | used for encoding queries or form data | [
"used",
"for",
"encoding",
"queries",
"or",
"form",
"data"
] | 45ee0cbff93d4ea7eaa87fc08fd18ac176df2dfe | https://github.com/aliyun/fc-java-sdk/blob/45ee0cbff93d4ea7eaa87fc08fd18ac176df2dfe/src/main/java/com/aliyuncs/fc/auth/AcsURLEncoder.java#L52-L55 |
164,696 | aliyun/fc-java-sdk | src/main/java/com/aliyuncs/fc/http/HttpResponse.java | HttpResponse.getResponse | public static HttpResponse getResponse(String urls, HttpRequest request,
HttpMethod method, int connectTimeoutMillis, int readTimeoutMillis) throws IOException {
OutputStream out = null;
InputStream content = null;
HttpResponse response = null;
... | java | public static HttpResponse getResponse(String urls, HttpRequest request,
HttpMethod method, int connectTimeoutMillis, int readTimeoutMillis) throws IOException {
OutputStream out = null;
InputStream content = null;
HttpResponse response = null;
... | [
"public",
"static",
"HttpResponse",
"getResponse",
"(",
"String",
"urls",
",",
"HttpRequest",
"request",
",",
"HttpMethod",
"method",
",",
"int",
"connectTimeoutMillis",
",",
"int",
"readTimeoutMillis",
")",
"throws",
"IOException",
"{",
"OutputStream",
"out",
"=",
... | Get http response | [
"Get",
"http",
"response"
] | 45ee0cbff93d4ea7eaa87fc08fd18ac176df2dfe | https://github.com/aliyun/fc-java-sdk/blob/45ee0cbff93d4ea7eaa87fc08fd18ac176df2dfe/src/main/java/com/aliyuncs/fc/http/HttpResponse.java#L116-L149 |
164,697 | aliyun/fc-java-sdk | src/main/java/com/aliyuncs/fc/config/Config.java | Config.refreshCredentials | public void refreshCredentials() {
if (this.credsProvider == null)
return;
try {
AlibabaCloudCredentials creds = this.credsProvider.getCredentials();
this.accessKeyID = creds.getAccessKeyId();
this.accessKeySecret = creds.getAccessKeySecret();
... | java | public void refreshCredentials() {
if (this.credsProvider == null)
return;
try {
AlibabaCloudCredentials creds = this.credsProvider.getCredentials();
this.accessKeyID = creds.getAccessKeyId();
this.accessKeySecret = creds.getAccessKeySecret();
... | [
"public",
"void",
"refreshCredentials",
"(",
")",
"{",
"if",
"(",
"this",
".",
"credsProvider",
"==",
"null",
")",
"return",
";",
"try",
"{",
"AlibabaCloudCredentials",
"creds",
"=",
"this",
".",
"credsProvider",
".",
"getCredentials",
"(",
")",
";",
"this",... | refresh credentials if CredentialProvider set | [
"refresh",
"credentials",
"if",
"CredentialProvider",
"set"
] | 45ee0cbff93d4ea7eaa87fc08fd18ac176df2dfe | https://github.com/aliyun/fc-java-sdk/blob/45ee0cbff93d4ea7eaa87fc08fd18ac176df2dfe/src/main/java/com/aliyuncs/fc/config/Config.java#L218-L234 |
164,698 | groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/models/History.java | History.addExtraInfo | public void addExtraInfo(String key, Object value) {
// Turn extraInfo into map
Map<String, Object> infoMap = (HashMap<String, Object>)getMapFromJSON(extraInfo);
// Add value
infoMap.put(key, value);
// Turn back into string
extraInfo = getJSONFromMap(infoMap);
} | java | public void addExtraInfo(String key, Object value) {
// Turn extraInfo into map
Map<String, Object> infoMap = (HashMap<String, Object>)getMapFromJSON(extraInfo);
// Add value
infoMap.put(key, value);
// Turn back into string
extraInfo = getJSONFromMap(infoMap);
} | [
"public",
"void",
"addExtraInfo",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"// Turn extraInfo into map",
"Map",
"<",
"String",
",",
"Object",
">",
"infoMap",
"=",
"(",
"HashMap",
"<",
"String",
",",
"Object",
">",
")",
"getMapFromJSON",
"(",
... | Add key value pair to extra info
@param key Key of new item
@param value New value to add | [
"Add",
"key",
"value",
"pair",
"to",
"extra",
"info"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/models/History.java#L409-L417 |
164,699 | groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/models/History.java | History.getMapFromJSON | private Map<String, Object> getMapFromJSON(String json) {
Map<String, Object> propMap = new HashMap<String, Object>();
ObjectMapper mapper = new ObjectMapper();
// Initialize string if empty
if (json == null || json.length() == 0) {
json = "{}";
}
try {
... | java | private Map<String, Object> getMapFromJSON(String json) {
Map<String, Object> propMap = new HashMap<String, Object>();
ObjectMapper mapper = new ObjectMapper();
// Initialize string if empty
if (json == null || json.length() == 0) {
json = "{}";
}
try {
... | [
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"getMapFromJSON",
"(",
"String",
"json",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"propMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"ObjectMapper",
"mappe... | Turn json string into map
@param json
@return | [
"Turn",
"json",
"string",
"into",
"map"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/models/History.java#L442-L458 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.