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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
28,100 | apache/incubator-heron | heron/spi/src/java/org/apache/heron/spi/packing/PackingPlan.java | PackingPlan.getComponentCounts | public Map<String, Integer> getComponentCounts() {
Map<String, Integer> componentCounts = new HashMap<>();
for (ContainerPlan containerPlan : getContainers()) {
for (InstancePlan instancePlan : containerPlan.getInstances()) {
Integer count = 0;
if (componentCounts.containsKey(instancePlan.... | java | public Map<String, Integer> getComponentCounts() {
Map<String, Integer> componentCounts = new HashMap<>();
for (ContainerPlan containerPlan : getContainers()) {
for (InstancePlan instancePlan : containerPlan.getInstances()) {
Integer count = 0;
if (componentCounts.containsKey(instancePlan.... | [
"public",
"Map",
"<",
"String",
",",
"Integer",
">",
"getComponentCounts",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"componentCounts",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"ContainerPlan",
"containerPlan",
":",
"getConta... | Return a map containing the count of all of the components, keyed by name | [
"Return",
"a",
"map",
"containing",
"the",
"count",
"of",
"all",
"of",
"the",
"components",
"keyed",
"by",
"name"
] | 776abe2b5a45b93a0eb957fd65cbc149d901a92a | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/spi/src/java/org/apache/heron/spi/packing/PackingPlan.java#L110-L122 |
28,101 | apache/incubator-heron | heron/spi/src/java/org/apache/heron/spi/packing/PackingPlan.java | PackingPlan.getComponentRamDistribution | public String getComponentRamDistribution() {
// Generate a map with the minimal RAM size for each component
Map<String, ByteAmount> ramMap = new HashMap<>();
for (ContainerPlan containerPlan : this.getContainers()) {
for (InstancePlan instancePlan : containerPlan.getInstances()) {
ByteAmount ... | java | public String getComponentRamDistribution() {
// Generate a map with the minimal RAM size for each component
Map<String, ByteAmount> ramMap = new HashMap<>();
for (ContainerPlan containerPlan : this.getContainers()) {
for (InstancePlan instancePlan : containerPlan.getInstances()) {
ByteAmount ... | [
"public",
"String",
"getComponentRamDistribution",
"(",
")",
"{",
"// Generate a map with the minimal RAM size for each component",
"Map",
"<",
"String",
",",
"ByteAmount",
">",
"ramMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"ContainerPlan",
"contai... | Get the formatted String describing component RAM distribution from PackingPlan,
used by executor
@return String describing component RAM distribution | [
"Get",
"the",
"formatted",
"String",
"describing",
"component",
"RAM",
"distribution",
"from",
"PackingPlan",
"used",
"by",
"executor"
] | 776abe2b5a45b93a0eb957fd65cbc149d901a92a | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/spi/src/java/org/apache/heron/spi/packing/PackingPlan.java#L130-L152 |
28,102 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/DexMaker.java | DexMaker.declare | public Code declare(MethodId<?, ?> method, int flags) {
TypeDeclaration typeDeclaration = getTypeDeclaration(method.declaringType);
if (typeDeclaration.methods.containsKey(method)) {
throw new IllegalStateException("already declared: " + method);
}
int supportedFlags = Modif... | java | public Code declare(MethodId<?, ?> method, int flags) {
TypeDeclaration typeDeclaration = getTypeDeclaration(method.declaringType);
if (typeDeclaration.methods.containsKey(method)) {
throw new IllegalStateException("already declared: " + method);
}
int supportedFlags = Modif... | [
"public",
"Code",
"declare",
"(",
"MethodId",
"<",
"?",
",",
"?",
">",
"method",
",",
"int",
"flags",
")",
"{",
"TypeDeclaration",
"typeDeclaration",
"=",
"getTypeDeclaration",
"(",
"method",
".",
"declaringType",
")",
";",
"if",
"(",
"typeDeclaration",
".",... | Declares a method or constructor.
@param flags a bitwise combination of {@link Modifier#PUBLIC}, {@link
Modifier#PRIVATE}, {@link Modifier#PROTECTED}, {@link Modifier#STATIC},
{@link Modifier#FINAL} and {@link Modifier#SYNCHRONIZED}.
<p><strong>Warning:</strong> the {@link Modifier#SYNCHRONIZED} flag
is insufficient t... | [
"Declares",
"a",
"method",
"or",
"constructor",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/DexMaker.java#L262-L288 |
28,103 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/DexMaker.java | DexMaker.declare | public void declare(FieldId<?, ?> fieldId, int flags, Object staticValue) {
TypeDeclaration typeDeclaration = getTypeDeclaration(fieldId.declaringType);
if (typeDeclaration.fields.containsKey(fieldId)) {
throw new IllegalStateException("already declared: " + fieldId);
}
int ... | java | public void declare(FieldId<?, ?> fieldId, int flags, Object staticValue) {
TypeDeclaration typeDeclaration = getTypeDeclaration(fieldId.declaringType);
if (typeDeclaration.fields.containsKey(fieldId)) {
throw new IllegalStateException("already declared: " + fieldId);
}
int ... | [
"public",
"void",
"declare",
"(",
"FieldId",
"<",
"?",
",",
"?",
">",
"fieldId",
",",
"int",
"flags",
",",
"Object",
"staticValue",
")",
"{",
"TypeDeclaration",
"typeDeclaration",
"=",
"getTypeDeclaration",
"(",
"fieldId",
".",
"declaringType",
")",
";",
"if... | Declares a field.
@param flags a bitwise combination of {@link Modifier#PUBLIC}, {@link
Modifier#PRIVATE}, {@link Modifier#PROTECTED}, {@link Modifier#STATIC},
{@link Modifier#FINAL}, {@link Modifier#VOLATILE}, and {@link
Modifier#TRANSIENT}.
@param staticValue a constant representing the initial value for the
static ... | [
"Declares",
"a",
"field",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/DexMaker.java#L301-L321 |
28,104 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/DexMaker.java | DexMaker.generate | public byte[] generate() {
if (outputDex == null) {
DexOptions options = new DexOptions();
options.minSdkVersion = DexFormat.API_NO_EXTENDED_OPCODES;
outputDex = new DexFile(options);
}
for (TypeDeclaration typeDeclaration : types.values()) {
outp... | java | public byte[] generate() {
if (outputDex == null) {
DexOptions options = new DexOptions();
options.minSdkVersion = DexFormat.API_NO_EXTENDED_OPCODES;
outputDex = new DexFile(options);
}
for (TypeDeclaration typeDeclaration : types.values()) {
outp... | [
"public",
"byte",
"[",
"]",
"generate",
"(",
")",
"{",
"if",
"(",
"outputDex",
"==",
"null",
")",
"{",
"DexOptions",
"options",
"=",
"new",
"DexOptions",
"(",
")",
";",
"options",
".",
"minSdkVersion",
"=",
"DexFormat",
".",
"API_NO_EXTENDED_OPCODES",
";",... | Generates a dex file and returns its bytes. | [
"Generates",
"a",
"dex",
"file",
"and",
"returns",
"its",
"bytes",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/DexMaker.java#L326-L342 |
28,105 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/DexMaker.java | DexMaker.generateFileName | private String generateFileName() {
int checksum = 1;
Set<TypeId<?>> typesKeySet = types.keySet();
Iterator<TypeId<?>> it = typesKeySet.iterator();
int[] checksums = new int[typesKeySet.size()];
int i = 0;
while (it.hasNext()) {
TypeId<?> typeId = it.next();... | java | private String generateFileName() {
int checksum = 1;
Set<TypeId<?>> typesKeySet = types.keySet();
Iterator<TypeId<?>> it = typesKeySet.iterator();
int[] checksums = new int[typesKeySet.size()];
int i = 0;
while (it.hasNext()) {
TypeId<?> typeId = it.next();... | [
"private",
"String",
"generateFileName",
"(",
")",
"{",
"int",
"checksum",
"=",
"1",
";",
"Set",
"<",
"TypeId",
"<",
"?",
">",
">",
"typesKeySet",
"=",
"types",
".",
"keySet",
"(",
")",
";",
"Iterator",
"<",
"TypeId",
"<",
"?",
">",
">",
"it",
"=",... | parent class types. | [
"parent",
"class",
"types",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/DexMaker.java#L346-L371 |
28,106 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/DexMaker.java | DexMaker.generateAndLoad | public ClassLoader generateAndLoad(ClassLoader parent, File dexCache) throws IOException {
if (dexCache == null) {
String property = System.getProperty("dexmaker.dexcache");
if (property != null) {
dexCache = new File(property);
} else {
dexCac... | java | public ClassLoader generateAndLoad(ClassLoader parent, File dexCache) throws IOException {
if (dexCache == null) {
String property = System.getProperty("dexmaker.dexcache");
if (property != null) {
dexCache = new File(property);
} else {
dexCac... | [
"public",
"ClassLoader",
"generateAndLoad",
"(",
"ClassLoader",
"parent",
",",
"File",
"dexCache",
")",
"throws",
"IOException",
"{",
"if",
"(",
"dexCache",
"==",
"null",
")",
"{",
"String",
"property",
"=",
"System",
".",
"getProperty",
"(",
"\"dexmaker.dexcach... | Generates a dex file and loads its types into the current process.
<h3>Picking a dex cache directory</h3>
The {@code dexCache} should be an application-private directory. If
you pass a world-writable directory like {@code /sdcard} a malicious app
could inject code into your process. Most applications should use this:
... | [
"Generates",
"a",
"dex",
"file",
"and",
"loads",
"its",
"types",
"into",
"the",
"current",
"process",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/DexMaker.java#L500-L539 |
28,107 | linkedin/dexmaker | dexmaker-mockito-inline-dispatcher/src/main/java/com/android/dx/mockito/inline/MockMethodDispatcher.java | MockMethodDispatcher.get | public static MockMethodDispatcher get(String identifier, Object instance) {
if (instance == INSTANCE) {
// Avoid endless loop if ConcurrentHashMap was redefined to check for being a mock.
return null;
} else {
return INSTANCE.get(identifier);
}
} | java | public static MockMethodDispatcher get(String identifier, Object instance) {
if (instance == INSTANCE) {
// Avoid endless loop if ConcurrentHashMap was redefined to check for being a mock.
return null;
} else {
return INSTANCE.get(identifier);
}
} | [
"public",
"static",
"MockMethodDispatcher",
"get",
"(",
"String",
"identifier",
",",
"Object",
"instance",
")",
"{",
"if",
"(",
"instance",
"==",
"INSTANCE",
")",
"{",
"// Avoid endless loop if ConcurrentHashMap was redefined to check for being a mock.",
"return",
"null",
... | Get the dispatcher for a identifier.
@param identifier identifier of the dispatcher
@param instance instance that might be mocked
@return dispatcher for the identifier | [
"Get",
"the",
"dispatcher",
"for",
"a",
"identifier",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline-dispatcher/src/main/java/com/android/dx/mockito/inline/MockMethodDispatcher.java#L45-L52 |
28,108 | linkedin/dexmaker | dexmaker-mockito-inline-dispatcher/src/main/java/com/android/dx/mockito/inline/MockMethodDispatcher.java | MockMethodDispatcher.set | public static void set(String identifier, Object advice) {
INSTANCE.putIfAbsent(identifier, new MockMethodDispatcher(advice));
} | java | public static void set(String identifier, Object advice) {
INSTANCE.putIfAbsent(identifier, new MockMethodDispatcher(advice));
} | [
"public",
"static",
"void",
"set",
"(",
"String",
"identifier",
",",
"Object",
"advice",
")",
"{",
"INSTANCE",
".",
"putIfAbsent",
"(",
"identifier",
",",
"new",
"MockMethodDispatcher",
"(",
"advice",
")",
")",
";",
"}"
] | Set up a new advice to receive calls for an identifier
@param identifier a unique identifier
@param advice advice the dispatcher should call | [
"Set",
"up",
"a",
"new",
"advice",
"to",
"receive",
"calls",
"for",
"an",
"identifier"
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline-dispatcher/src/main/java/com/android/dx/mockito/inline/MockMethodDispatcher.java#L69-L71 |
28,109 | linkedin/dexmaker | dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/MockMethodAdvice.java | MockMethodAdvice.isOverridden | public boolean isOverridden(Object instance, Method origin) {
Class<?> currentType = instance.getClass();
do {
try {
return !origin.equals(currentType.getDeclaredMethod(origin.getName(),
origin.getParameterTypes()));
} catch (NoSuchMethodE... | java | public boolean isOverridden(Object instance, Method origin) {
Class<?> currentType = instance.getClass();
do {
try {
return !origin.equals(currentType.getDeclaredMethod(origin.getName(),
origin.getParameterTypes()));
} catch (NoSuchMethodE... | [
"public",
"boolean",
"isOverridden",
"(",
"Object",
"instance",
",",
"Method",
"origin",
")",
"{",
"Class",
"<",
"?",
">",
"currentType",
"=",
"instance",
".",
"getClass",
"(",
")",
";",
"do",
"{",
"try",
"{",
"return",
"!",
"origin",
".",
"equals",
"(... | Check if a method is overridden.
@param instance mocked instance
@param origin method that might be overridden
@return {@code true} iff the method is overridden | [
"Check",
"if",
"a",
"method",
"is",
"overridden",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/MockMethodAdvice.java#L239-L252 |
28,110 | linkedin/dexmaker | dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/extended/StaticMockitoSessionBuilder.java | StaticMockitoSessionBuilder.spyStatic | @UnstableApi
public <T> StaticMockitoSessionBuilder spyStatic(Class<T> clazz) {
staticMockings.add(new StaticMocking<>(clazz, () -> Mockito.mock(clazz, withSettings()
.defaultAnswer(CALLS_REAL_METHODS))));
return this;
} | java | @UnstableApi
public <T> StaticMockitoSessionBuilder spyStatic(Class<T> clazz) {
staticMockings.add(new StaticMocking<>(clazz, () -> Mockito.mock(clazz, withSettings()
.defaultAnswer(CALLS_REAL_METHODS))));
return this;
} | [
"@",
"UnstableApi",
"public",
"<",
"T",
">",
"StaticMockitoSessionBuilder",
"spyStatic",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"staticMockings",
".",
"add",
"(",
"new",
"StaticMocking",
"<>",
"(",
"clazz",
",",
"(",
")",
"->",
"Mockito",
".",
"... | Sets up spying for static methods of a class.
@param clazz The class to set up static spying for
@return This builder | [
"Sets",
"up",
"spying",
"for",
"static",
"methods",
"of",
"a",
"class",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/extended/StaticMockitoSessionBuilder.java#L101-L106 |
28,111 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/Constants.java | Constants.getConstant | static TypedConstant getConstant(Object value) {
if (value == null) {
return CstKnownNull.THE_ONE;
} else if (value instanceof Boolean) {
return CstBoolean.make((Boolean) value);
} else if (value instanceof Byte) {
return CstByte.make((Byte) value);
} ... | java | static TypedConstant getConstant(Object value) {
if (value == null) {
return CstKnownNull.THE_ONE;
} else if (value instanceof Boolean) {
return CstBoolean.make((Boolean) value);
} else if (value instanceof Byte) {
return CstByte.make((Byte) value);
} ... | [
"static",
"TypedConstant",
"getConstant",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"CstKnownNull",
".",
"THE_ONE",
";",
"}",
"else",
"if",
"(",
"value",
"instanceof",
"Boolean",
")",
"{",
"return",
"CstBoolean... | Returns a rop constant for the specified value.
@param value null, a boxed primitive, String, Class, or TypeId. | [
"Returns",
"a",
"rop",
"constant",
"for",
"the",
"specified",
"value",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Constants.java#L43-L71 |
28,112 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/stock/ProxyBuilder.java | ProxyBuilder.build | public T build() throws IOException {
check(handler != null, "handler == null");
check(constructorArgTypes.length == constructorArgValues.length,
"constructorArgValues.length != constructorArgTypes.length");
Class<? extends T> proxyClass = buildProxyClass();
Constructor<?... | java | public T build() throws IOException {
check(handler != null, "handler == null");
check(constructorArgTypes.length == constructorArgValues.length,
"constructorArgValues.length != constructorArgTypes.length");
Class<? extends T> proxyClass = buildProxyClass();
Constructor<?... | [
"public",
"T",
"build",
"(",
")",
"throws",
"IOException",
"{",
"check",
"(",
"handler",
"!=",
"null",
",",
"\"handler == null\"",
")",
";",
"check",
"(",
"constructorArgTypes",
".",
"length",
"==",
"constructorArgValues",
".",
"length",
",",
"\"constructorArgVa... | Create a new instance of the class to proxy.
@throws UnsupportedOperationException if the class we are trying to create a proxy for is
not accessible.
@throws IOException if an exception occurred writing to the {@code dexCache} directory.
@throws UndeclaredThrowableException if the constructor for the base class to pr... | [
"Create",
"a",
"new",
"instance",
"of",
"the",
"class",
"to",
"proxy",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/stock/ProxyBuilder.java#L232-L259 |
28,113 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/stock/ProxyBuilder.java | ProxyBuilder.superMethodName | private static String superMethodName(Method method) {
String returnType = method.getReturnType().getName();
return "super$" + method.getName() + "$"
+ returnType.replace('.', '_').replace('[', '_').replace(';', '_');
} | java | private static String superMethodName(Method method) {
String returnType = method.getReturnType().getName();
return "super$" + method.getName() + "$"
+ returnType.replace('.', '_').replace('[', '_').replace(';', '_');
} | [
"private",
"static",
"String",
"superMethodName",
"(",
"Method",
"method",
")",
"{",
"String",
"returnType",
"=",
"method",
".",
"getReturnType",
"(",
")",
".",
"getName",
"(",
")",
";",
"return",
"\"super$\"",
"+",
"method",
".",
"getName",
"(",
")",
"+",... | The super method must include the return type, otherwise its ambiguous
for methods with covariant return types. | [
"The",
"super",
"method",
"must",
"include",
"the",
"return",
"type",
"otherwise",
"its",
"ambiguous",
"for",
"methods",
"with",
"covariant",
"return",
"types",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/stock/ProxyBuilder.java#L674-L678 |
28,114 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/stock/ProxyBuilder.java | ProxyBuilder.getConstructorsToOverwrite | @SuppressWarnings("unchecked")
private static <T> Constructor<T>[] getConstructorsToOverwrite(Class<T> clazz) {
return (Constructor<T>[]) clazz.getDeclaredConstructors();
} | java | @SuppressWarnings("unchecked")
private static <T> Constructor<T>[] getConstructorsToOverwrite(Class<T> clazz) {
return (Constructor<T>[]) clazz.getDeclaredConstructors();
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"<",
"T",
">",
"Constructor",
"<",
"T",
">",
"[",
"]",
"getConstructorsToOverwrite",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"(",
"Constructor",
"<",
"T",
">",
"["... | hence this cast is safe. | [
"hence",
"this",
"cast",
"is",
"safe",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/stock/ProxyBuilder.java#L717-L720 |
28,115 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/stock/ProxyBuilder.java | ProxyBuilder.generateCodeForReturnStatement | @SuppressWarnings({ "rawtypes", "unchecked" })
private static void generateCodeForReturnStatement(Code code, Class methodReturnType,
Local localForResultOfInvoke, Local localOfMethodReturnType, Local aBoxedResult) {
if (PRIMITIVE_TO_UNBOX_METHOD.containsKey(methodReturnType)) {
code.... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
private static void generateCodeForReturnStatement(Code code, Class methodReturnType,
Local localForResultOfInvoke, Local localOfMethodReturnType, Local aBoxedResult) {
if (PRIMITIVE_TO_UNBOX_METHOD.containsKey(methodReturnType)) {
code.... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"private",
"static",
"void",
"generateCodeForReturnStatement",
"(",
"Code",
"code",
",",
"Class",
"methodReturnType",
",",
"Local",
"localForResultOfInvoke",
",",
"Local",
"localOfMetho... | This one is tricky to fix, I gave up. | [
"This",
"one",
"is",
"tricky",
"to",
"fix",
"I",
"gave",
"up",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/stock/ProxyBuilder.java#L839-L853 |
28,116 | linkedin/dexmaker | dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/extended/ExtendedMockito.java | ExtendedMockito.staticMockMarker | @UnstableApi
@SuppressWarnings("unchecked")
public static <T> T staticMockMarker(Class<T> clazz) {
for (StaticMockitoSession session : sessions) {
T marker = session.staticMockMarker(clazz);
if (marker != null) {
return marker;
}
}
ret... | java | @UnstableApi
@SuppressWarnings("unchecked")
public static <T> T staticMockMarker(Class<T> clazz) {
for (StaticMockitoSession session : sessions) {
T marker = session.staticMockMarker(clazz);
if (marker != null) {
return marker;
}
}
ret... | [
"@",
"UnstableApi",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"staticMockMarker",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"for",
"(",
"StaticMockitoSession",
"session",
":",
"sessions",
")",
"{",
"T... | Many methods of mockito take mock objects. To be able to call the same methods for static
mocking, this method gets a marker object that can be used instead.
@param clazz The class object the marker should be crated for
@return A marker object. This should not be used directly. It can only be passed into other
Extende... | [
"Many",
"methods",
"of",
"mockito",
"take",
"mock",
"objects",
".",
"To",
"be",
"able",
"to",
"call",
"the",
"same",
"methods",
"for",
"static",
"mocking",
"this",
"method",
"gets",
"a",
"marker",
"object",
"that",
"can",
"be",
"used",
"instead",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/extended/ExtendedMockito.java#L161-L172 |
28,117 | linkedin/dexmaker | dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/extended/ExtendedMockito.java | ExtendedMockito.spyOn | @UnstableApi
@SuppressWarnings("CheckReturnValue")
public static void spyOn(Object toSpy) {
if (onSpyInProgressInstance.get() != null) {
throw new IllegalStateException("Cannot set up spying on an existing object while "
+ "setting up spying for another existing object");... | java | @UnstableApi
@SuppressWarnings("CheckReturnValue")
public static void spyOn(Object toSpy) {
if (onSpyInProgressInstance.get() != null) {
throw new IllegalStateException("Cannot set up spying on an existing object while "
+ "setting up spying for another existing object");... | [
"@",
"UnstableApi",
"@",
"SuppressWarnings",
"(",
"\"CheckReturnValue\"",
")",
"public",
"static",
"void",
"spyOn",
"(",
"Object",
"toSpy",
")",
"{",
"if",
"(",
"onSpyInProgressInstance",
".",
"get",
"(",
")",
"!=",
"null",
")",
"{",
"throw",
"new",
"Illegal... | Make an existing object a spy.
<p>This does <u>not</u> clone the existing objects. If a method is stubbed on a spy
converted by this method all references to the already existing object will be affected by
the stubbing.
@param toSpy The existing object to convert into a spy | [
"Make",
"an",
"existing",
"object",
"a",
"spy",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/extended/ExtendedMockito.java#L207-L221 |
28,118 | linkedin/dexmaker | dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/extended/ExtendedMockito.java | ExtendedMockito.verifyInt | @SuppressWarnings({"CheckReturnValue", "MockitoUsage", "unchecked"})
static void verifyInt(MockedVoidMethod method, VerificationMode mode, InOrder
instanceInOrder) {
if (onMethodCallDuringVerification.get() != null) {
throw new IllegalStateException("Verification is already in progre... | java | @SuppressWarnings({"CheckReturnValue", "MockitoUsage", "unchecked"})
static void verifyInt(MockedVoidMethod method, VerificationMode mode, InOrder
instanceInOrder) {
if (onMethodCallDuringVerification.get() != null) {
throw new IllegalStateException("Verification is already in progre... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"CheckReturnValue\"",
",",
"\"MockitoUsage\"",
",",
"\"unchecked\"",
"}",
")",
"static",
"void",
"verifyInt",
"(",
"MockedVoidMethod",
"method",
",",
"VerificationMode",
"mode",
",",
"InOrder",
"instanceInOrder",
")",
"{",
"if",
... | Common implementation of verification of static method calls.
@param method The static method call to be verified
@param mode The verification mode
@param instanceInOrder If set, the {@link StaticInOrder} object | [
"Common",
"implementation",
"of",
"verification",
"of",
"static",
"method",
"calls",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/extended/ExtendedMockito.java#L341-L425 |
28,119 | linkedin/dexmaker | dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/InlineDexmakerMockMaker.java | InlineDexmakerMockMaker.getMethodsToProxy | private <T> Method[] getMethodsToProxy(MockCreationSettings<T> settings) {
Set<MethodSetEntry> abstractMethods = new HashSet<>();
Set<MethodSetEntry> nonAbstractMethods = new HashSet<>();
Class<?> superClass = settings.getTypeToMock();
while (superClass != null) {
for (Metho... | java | private <T> Method[] getMethodsToProxy(MockCreationSettings<T> settings) {
Set<MethodSetEntry> abstractMethods = new HashSet<>();
Set<MethodSetEntry> nonAbstractMethods = new HashSet<>();
Class<?> superClass = settings.getTypeToMock();
while (superClass != null) {
for (Metho... | [
"private",
"<",
"T",
">",
"Method",
"[",
"]",
"getMethodsToProxy",
"(",
"MockCreationSettings",
"<",
"T",
">",
"settings",
")",
"{",
"Set",
"<",
"MethodSetEntry",
">",
"abstractMethods",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"Set",
"<",
"MethodSetEnt... | Get methods to proxy.
<p>Only abstract methods will need to get proxied as all other methods will get an entry
hook.
@param settings description of the current mocking process.
@return methods to proxy. | [
"Get",
"methods",
"to",
"proxy",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/InlineDexmakerMockMaker.java#L201-L242 |
28,120 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/AnnotationId.java | AnnotationId.get | public static <D, V> AnnotationId<D, V> get(TypeId<D> declaringType, TypeId<V> type,
ElementType annotatedElement) {
if (annotatedElement != ElementType.TYPE &&
annotatedElement != ElementType.METHOD &&
annotatedElement != ElementTy... | java | public static <D, V> AnnotationId<D, V> get(TypeId<D> declaringType, TypeId<V> type,
ElementType annotatedElement) {
if (annotatedElement != ElementType.TYPE &&
annotatedElement != ElementType.METHOD &&
annotatedElement != ElementTy... | [
"public",
"static",
"<",
"D",
",",
"V",
">",
"AnnotationId",
"<",
"D",
",",
"V",
">",
"get",
"(",
"TypeId",
"<",
"D",
">",
"declaringType",
",",
"TypeId",
"<",
"V",
">",
"type",
",",
"ElementType",
"annotatedElement",
")",
"{",
"if",
"(",
"annotatedE... | Construct an instance. It initially contains no elements.
@param declaringType the type declaring the program element.
@param type the annotation type.
@param annotatedElement the program element type to be annotated.
@return an annotation {@code AnnotationId<D,V>} instance. | [
"Construct",
"an",
"instance",
".",
"It",
"initially",
"contains",
"no",
"elements",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/AnnotationId.java#L92-L102 |
28,121 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/AnnotationId.java | AnnotationId.set | public void set(Element element) {
if (element == null) {
throw new NullPointerException("element == null");
}
CstString pairName = new CstString(element.getName());
Constant pairValue = Element.toConstant(element.getValue());
NameValuePair nameValuePair = new NameVa... | java | public void set(Element element) {
if (element == null) {
throw new NullPointerException("element == null");
}
CstString pairName = new CstString(element.getName());
Constant pairValue = Element.toConstant(element.getValue());
NameValuePair nameValuePair = new NameVa... | [
"public",
"void",
"set",
"(",
"Element",
"element",
")",
"{",
"if",
"(",
"element",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"element == null\"",
")",
";",
"}",
"CstString",
"pairName",
"=",
"new",
"CstString",
"(",
"element",
... | Set an annotation element of this instance.
If there is a preexisting element with the same name, it will be
replaced by this method.
@param element {@code non-null;} the annotation element to be set. | [
"Set",
"an",
"annotation",
"element",
"of",
"this",
"instance",
".",
"If",
"there",
"is",
"a",
"preexisting",
"element",
"with",
"the",
"same",
"name",
"it",
"will",
"be",
"replaced",
"by",
"this",
"method",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/AnnotationId.java#L111-L120 |
28,122 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/AnnotationId.java | AnnotationId.addToMethod | public void addToMethod(DexMaker dexMaker, MethodId<?, ?> method) {
if (annotatedElement != ElementType.METHOD) {
throw new IllegalStateException("This annotation is not for method");
}
if (!method.declaringType.equals(declaringType)) {
throw new IllegalArgumentException... | java | public void addToMethod(DexMaker dexMaker, MethodId<?, ?> method) {
if (annotatedElement != ElementType.METHOD) {
throw new IllegalStateException("This annotation is not for method");
}
if (!method.declaringType.equals(declaringType)) {
throw new IllegalArgumentException... | [
"public",
"void",
"addToMethod",
"(",
"DexMaker",
"dexMaker",
",",
"MethodId",
"<",
"?",
",",
"?",
">",
"method",
")",
"{",
"if",
"(",
"annotatedElement",
"!=",
"ElementType",
".",
"METHOD",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"This ann... | Add this annotation to a method.
@param dexMaker DexMaker instance.
@param method Method to be added to. | [
"Add",
"this",
"annotation",
"to",
"a",
"method",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/AnnotationId.java#L128-L162 |
28,123 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/Local.java | Local.initialize | int initialize(int nextAvailableRegister) {
this.reg = nextAvailableRegister;
this.spec = RegisterSpec.make(nextAvailableRegister, type.ropType);
return size();
} | java | int initialize(int nextAvailableRegister) {
this.reg = nextAvailableRegister;
this.spec = RegisterSpec.make(nextAvailableRegister, type.ropType);
return size();
} | [
"int",
"initialize",
"(",
"int",
"nextAvailableRegister",
")",
"{",
"this",
".",
"reg",
"=",
"nextAvailableRegister",
";",
"this",
".",
"spec",
"=",
"RegisterSpec",
".",
"make",
"(",
"nextAvailableRegister",
",",
"type",
".",
"ropType",
")",
";",
"return",
"... | Assigns registers to this local.
@return the number of registers required. | [
"Assigns",
"registers",
"to",
"this",
"local",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Local.java#L44-L48 |
28,124 | linkedin/dexmaker | dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/JvmtiAgent.java | JvmtiAgent.appendToBootstrapClassLoaderSearch | void appendToBootstrapClassLoaderSearch(InputStream jarStream) throws IOException {
File jarFile = File.createTempFile("mockito-boot", ".jar");
jarFile.deleteOnExit();
byte[] buffer = new byte[64 * 1024];
try (OutputStream os = new FileOutputStream(jarFile)) {
while (true) {... | java | void appendToBootstrapClassLoaderSearch(InputStream jarStream) throws IOException {
File jarFile = File.createTempFile("mockito-boot", ".jar");
jarFile.deleteOnExit();
byte[] buffer = new byte[64 * 1024];
try (OutputStream os = new FileOutputStream(jarFile)) {
while (true) {... | [
"void",
"appendToBootstrapClassLoaderSearch",
"(",
"InputStream",
"jarStream",
")",
"throws",
"IOException",
"{",
"File",
"jarFile",
"=",
"File",
".",
"createTempFile",
"(",
"\"mockito-boot\"",
",",
"\".jar\"",
")",
";",
"jarFile",
".",
"deleteOnExit",
"(",
")",
"... | Append the jar to be bootstrap class load. This makes the classes in the jar behave as if
they are loaded from the BCL. E.g. classes from java.lang can now call the classes in the
jar.
@param jarStream stream of jar to be added | [
"Append",
"the",
"jar",
"to",
"be",
"bootstrap",
"class",
"load",
".",
"This",
"makes",
"the",
"classes",
"in",
"the",
"jar",
"behave",
"as",
"if",
"they",
"are",
"loaded",
"from",
"the",
"BCL",
".",
"E",
".",
"g",
".",
"classes",
"from",
"java",
"."... | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/JvmtiAgent.java#L85-L102 |
28,125 | linkedin/dexmaker | dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/extended/StaticMockitoSession.java | StaticMockitoSession.mockStatic | <T> void mockStatic(StaticMocking<T> mocking) {
if (ExtendedMockito.staticMockMarker(mocking.clazz) != null) {
throw new IllegalArgumentException(mocking.clazz + " is already mocked");
}
mockingInProgressClass.set(mocking.clazz);
try {
classToMarker.put(mocking.c... | java | <T> void mockStatic(StaticMocking<T> mocking) {
if (ExtendedMockito.staticMockMarker(mocking.clazz) != null) {
throw new IllegalArgumentException(mocking.clazz + " is already mocked");
}
mockingInProgressClass.set(mocking.clazz);
try {
classToMarker.put(mocking.c... | [
"<",
"T",
">",
"void",
"mockStatic",
"(",
"StaticMocking",
"<",
"T",
">",
"mocking",
")",
"{",
"if",
"(",
"ExtendedMockito",
".",
"staticMockMarker",
"(",
"mocking",
".",
"clazz",
")",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"("... | Init mocking for a class.
@param mocking Description and settings of the mocking
@param <T> The class to mock | [
"Init",
"mocking",
"for",
"a",
"class",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/extended/StaticMockitoSession.java#L91-L104 |
28,126 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/Code.java | Code.mark | public void mark(Label label) {
adopt(label);
if (label.marked) {
throw new IllegalStateException("already marked");
}
label.marked = true;
if (currentLabel != null) {
jump(label); // blocks must end with a branch, return or throw
}
current... | java | public void mark(Label label) {
adopt(label);
if (label.marked) {
throw new IllegalStateException("already marked");
}
label.marked = true;
if (currentLabel != null) {
jump(label); // blocks must end with a branch, return or throw
}
current... | [
"public",
"void",
"mark",
"(",
"Label",
"label",
")",
"{",
"adopt",
"(",
"label",
")",
";",
"if",
"(",
"label",
".",
"marked",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"already marked\"",
")",
";",
"}",
"label",
".",
"marked",
"=",
"tr... | Start defining instructions for the named label. | [
"Start",
"defining",
"instructions",
"for",
"the",
"named",
"label",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L333-L343 |
28,127 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/Code.java | Code.splitCurrentLabel | private void splitCurrentLabel(Label alternateSuccessor, List<Label> catchLabels) {
Label newLabel = new Label();
adopt(newLabel);
currentLabel.primarySuccessor = newLabel;
currentLabel.alternateSuccessor = alternateSuccessor;
currentLabel.catchLabels = catchLabels;
curre... | java | private void splitCurrentLabel(Label alternateSuccessor, List<Label> catchLabels) {
Label newLabel = new Label();
adopt(newLabel);
currentLabel.primarySuccessor = newLabel;
currentLabel.alternateSuccessor = alternateSuccessor;
currentLabel.catchLabels = catchLabels;
curre... | [
"private",
"void",
"splitCurrentLabel",
"(",
"Label",
"alternateSuccessor",
",",
"List",
"<",
"Label",
">",
"catchLabels",
")",
"{",
"Label",
"newLabel",
"=",
"new",
"Label",
"(",
")",
";",
"adopt",
"(",
"newLabel",
")",
";",
"currentLabel",
".",
"primarySuc... | Closes the current label and starts a new one.
@param catchLabels an immutable list of catch labels | [
"Closes",
"the",
"current",
"label",
"and",
"starts",
"a",
"new",
"one",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L462-L470 |
28,128 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/Code.java | Code.cast | public void cast(Local<?> target, Local<?> source) {
if (source.getType().ropType.isReference()) {
addInstruction(new ThrowingCstInsn(Rops.CHECK_CAST, sourcePosition,
RegisterSpecList.make(source.spec()), catches, target.type.constant));
moveResult(target, true);
... | java | public void cast(Local<?> target, Local<?> source) {
if (source.getType().ropType.isReference()) {
addInstruction(new ThrowingCstInsn(Rops.CHECK_CAST, sourcePosition,
RegisterSpecList.make(source.spec()), catches, target.type.constant));
moveResult(target, true);
... | [
"public",
"void",
"cast",
"(",
"Local",
"<",
"?",
">",
"target",
",",
"Local",
"<",
"?",
">",
"source",
")",
"{",
"if",
"(",
"source",
".",
"getType",
"(",
")",
".",
"ropType",
".",
"isReference",
"(",
")",
")",
"{",
"addInstruction",
"(",
"new",
... | Performs either a numeric cast or a type cast.
<h3>Numeric Casts</h3>
Converts a primitive to a different representation. Numeric casts may
be lossy. For example, converting the double {@code 1.8d} to an integer
yields {@code 1}, losing the fractional part. Converting the integer
{@code 0x12345678} to a short yields {... | [
"Performs",
"either",
"a",
"numeric",
"cast",
"or",
"a",
"type",
"cast",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L753-L762 |
28,129 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/Code.java | Code.toBasicBlocks | BasicBlockList toBasicBlocks() {
if (!localsInitialized) {
initializeLocals();
}
cleanUpLabels();
BasicBlockList result = new BasicBlockList(labels.size());
for (int i = 0; i < labels.size(); i++) {
result.set(i, labels.get(i).toBasicBlock());
}
... | java | BasicBlockList toBasicBlocks() {
if (!localsInitialized) {
initializeLocals();
}
cleanUpLabels();
BasicBlockList result = new BasicBlockList(labels.size());
for (int i = 0; i < labels.size(); i++) {
result.set(i, labels.get(i).toBasicBlock());
}
... | [
"BasicBlockList",
"toBasicBlocks",
"(",
")",
"{",
"if",
"(",
"!",
"localsInitialized",
")",
"{",
"initializeLocals",
"(",
")",
";",
"}",
"cleanUpLabels",
"(",
")",
";",
"BasicBlockList",
"result",
"=",
"new",
"BasicBlockList",
"(",
"labels",
".",
"size",
"("... | produce BasicBlocks for dex | [
"produce",
"BasicBlocks",
"for",
"dex"
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L875-L887 |
28,130 | linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/Code.java | Code.cleanUpLabels | private void cleanUpLabels() {
int id = 0;
for (Iterator<Label> i = labels.iterator(); i.hasNext();) {
Label label = i.next();
if (label.isEmpty()) {
i.remove();
} else {
label.compact();
label.id = id++;
}
... | java | private void cleanUpLabels() {
int id = 0;
for (Iterator<Label> i = labels.iterator(); i.hasNext();) {
Label label = i.next();
if (label.isEmpty()) {
i.remove();
} else {
label.compact();
label.id = id++;
}
... | [
"private",
"void",
"cleanUpLabels",
"(",
")",
"{",
"int",
"id",
"=",
"0",
";",
"for",
"(",
"Iterator",
"<",
"Label",
">",
"i",
"=",
"labels",
".",
"iterator",
"(",
")",
";",
"i",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"Label",
"label",
"=",
"... | Removes empty labels and assigns IDs to non-empty labels. | [
"Removes",
"empty",
"labels",
"and",
"assigns",
"IDs",
"to",
"non",
"-",
"empty",
"labels",
"."
] | c58ffebcbb2564c7d1fa6fb58b48f351c330296d | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L892-L903 |
28,131 | yegor256/cactoos | src/main/java/org/cactoos/scalar/Checked.java | Checked.wrappedException | @SuppressWarnings("unchecked")
private E wrappedException(final Exception exp) {
E wrapped = new UncheckedFunc<>(this.func).apply(exp);
final int level = new InheritanceLevel(
exp.getClass(), wrapped.getClass()
).value();
final String message = wrapped.getMessage()
... | java | @SuppressWarnings("unchecked")
private E wrappedException(final Exception exp) {
E wrapped = new UncheckedFunc<>(this.func).apply(exp);
final int level = new InheritanceLevel(
exp.getClass(), wrapped.getClass()
).value();
final String message = wrapped.getMessage()
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"E",
"wrappedException",
"(",
"final",
"Exception",
"exp",
")",
"{",
"E",
"wrapped",
"=",
"new",
"UncheckedFunc",
"<>",
"(",
"this",
".",
"func",
")",
".",
"apply",
"(",
"exp",
")",
";",
"fin... | Wraps exception.
Skips unnecessary wrapping of exceptions of the same type.
Allows wrapping of exceptions of the same type if the error message
has been changed.
@param exp Exception
@return E Wrapped exception | [
"Wraps",
"exception",
".",
"Skips",
"unnecessary",
"wrapping",
"of",
"exceptions",
"of",
"the",
"same",
"type",
".",
"Allows",
"wrapping",
"of",
"exceptions",
"of",
"the",
"same",
"type",
"if",
"the",
"error",
"message",
"has",
"been",
"changed",
"."
] | 7d2366be99f8d93eecfca2941ac23d4337dc224e | https://github.com/yegor256/cactoos/blob/7d2366be99f8d93eecfca2941ac23d4337dc224e/src/main/java/org/cactoos/scalar/Checked.java#L98-L118 |
28,132 | yegor256/cactoos | src/main/java/org/cactoos/io/TailOf.java | TailOf.copy | private int copy(final byte[] buffer, final byte[] response,
final int read) {
System.arraycopy(
buffer, read - this.count, response, 0, this.count
);
return new MinOf(this.count, read).intValue();
} | java | private int copy(final byte[] buffer, final byte[] response,
final int read) {
System.arraycopy(
buffer, read - this.count, response, 0, this.count
);
return new MinOf(this.count, read).intValue();
} | [
"private",
"int",
"copy",
"(",
"final",
"byte",
"[",
"]",
"buffer",
",",
"final",
"byte",
"[",
"]",
"response",
",",
"final",
"int",
"read",
")",
"{",
"System",
".",
"arraycopy",
"(",
"buffer",
",",
"read",
"-",
"this",
".",
"count",
",",
"response",... | Copy full buffer to response.
@param buffer The buffer array
@param response The response array
@param read Number of bytes read in buffer
@return Number of bytes in the response buffer | [
"Copy",
"full",
"buffer",
"to",
"response",
"."
] | 7d2366be99f8d93eecfca2941ac23d4337dc224e | https://github.com/yegor256/cactoos/blob/7d2366be99f8d93eecfca2941ac23d4337dc224e/src/main/java/org/cactoos/io/TailOf.java#L109-L115 |
28,133 | yegor256/cactoos | src/main/java/org/cactoos/io/TailOf.java | TailOf.copyPartial | private int copyPartial(final byte[] buffer, final byte[] response,
final int num, final int read) {
final int result;
if (num > 0) {
System.arraycopy(
response, read, response, 0, this.count - read
);
System.arraycopy(buffer, 0, response, this... | java | private int copyPartial(final byte[] buffer, final byte[] response,
final int num, final int read) {
final int result;
if (num > 0) {
System.arraycopy(
response, read, response, 0, this.count - read
);
System.arraycopy(buffer, 0, response, this... | [
"private",
"int",
"copyPartial",
"(",
"final",
"byte",
"[",
"]",
"buffer",
",",
"final",
"byte",
"[",
"]",
"response",
",",
"final",
"int",
"num",
",",
"final",
"int",
"read",
")",
"{",
"final",
"int",
"result",
";",
"if",
"(",
"num",
">",
"0",
")"... | Copy buffer to response for read count smaller then buffer size.
@param buffer The buffer array
@param response The response array
@param num Number of bytes in response array from previous read
@param read Number of bytes read in the buffer
@return New count of bytes in the response array
@checkstyle ParameterNumberCh... | [
"Copy",
"buffer",
"to",
"response",
"for",
"read",
"count",
"smaller",
"then",
"buffer",
"size",
"."
] | 7d2366be99f8d93eecfca2941ac23d4337dc224e | https://github.com/yegor256/cactoos/blob/7d2366be99f8d93eecfca2941ac23d4337dc224e/src/main/java/org/cactoos/io/TailOf.java#L126-L140 |
28,134 | yegor256/cactoos | src/main/java/org/cactoos/scalar/ScalarWithFallback.java | ScalarWithFallback.fallback | @SuppressWarnings("PMD.AvoidThrowingRawExceptionTypes")
private T fallback(final Throwable exp) throws Exception {
final Sorted<Map.Entry<FallbackFrom<T>, Integer>> candidates =
new Sorted<>(
Comparator.comparing(Map.Entry::getValue),
new Filtered<>(
... | java | @SuppressWarnings("PMD.AvoidThrowingRawExceptionTypes")
private T fallback(final Throwable exp) throws Exception {
final Sorted<Map.Entry<FallbackFrom<T>, Integer>> candidates =
new Sorted<>(
Comparator.comparing(Map.Entry::getValue),
new Filtered<>(
... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.AvoidThrowingRawExceptionTypes\"",
")",
"private",
"T",
"fallback",
"(",
"final",
"Throwable",
"exp",
")",
"throws",
"Exception",
"{",
"final",
"Sorted",
"<",
"Map",
".",
"Entry",
"<",
"FallbackFrom",
"<",
"T",
">",
",",
"I... | Finds the best fallback for the given exception type and apply it to
the exception or throw the original error if no fallback found.
@param exp The original exception
@return Result of the most suitable fallback
@throws Exception The original exception if no fallback found | [
"Finds",
"the",
"best",
"fallback",
"for",
"the",
"given",
"exception",
"type",
"and",
"apply",
"it",
"to",
"the",
"exception",
"or",
"throw",
"the",
"original",
"error",
"if",
"no",
"fallback",
"found",
"."
] | 7d2366be99f8d93eecfca2941ac23d4337dc224e | https://github.com/yegor256/cactoos/blob/7d2366be99f8d93eecfca2941ac23d4337dc224e/src/main/java/org/cactoos/scalar/ScalarWithFallback.java#L89-L116 |
28,135 | yegor256/cactoos | src/main/java/org/cactoos/io/WriterAsOutputStream.java | WriterAsOutputStream.next | private int next(final byte[] buffer, final int offset,
final int length) throws IOException {
final int max = Math.min(length, this.input.remaining());
this.input.put(buffer, offset, max);
this.input.flip();
while (true) {
final CoderResult result = this.decoder.deco... | java | private int next(final byte[] buffer, final int offset,
final int length) throws IOException {
final int max = Math.min(length, this.input.remaining());
this.input.put(buffer, offset, max);
this.input.flip();
while (true) {
final CoderResult result = this.decoder.deco... | [
"private",
"int",
"next",
"(",
"final",
"byte",
"[",
"]",
"buffer",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
")",
"throws",
"IOException",
"{",
"final",
"int",
"max",
"=",
"Math",
".",
"min",
"(",
"length",
",",
"this",
".",
"inp... | Write a portion from the buffer.
@param buffer The buffer
@param offset Offset in the buffer
@param length Maximum possible amount to take
@return How much was taken
@throws IOException If fails | [
"Write",
"a",
"portion",
"from",
"the",
"buffer",
"."
] | 7d2366be99f8d93eecfca2941ac23d4337dc224e | https://github.com/yegor256/cactoos/blob/7d2366be99f8d93eecfca2941ac23d4337dc224e/src/main/java/org/cactoos/io/WriterAsOutputStream.java#L185-L208 |
28,136 | yegor256/cactoos | src/main/java/org/cactoos/scalar/FallbackFrom.java | FallbackFrom.support | public Integer support(final Class<? extends Throwable> target) {
return new MinOf(
new Mapped<>(
supported -> new InheritanceLevel(target, supported).value(),
this.exceptions
)
).intValue();
} | java | public Integer support(final Class<? extends Throwable> target) {
return new MinOf(
new Mapped<>(
supported -> new InheritanceLevel(target, supported).value(),
this.exceptions
)
).intValue();
} | [
"public",
"Integer",
"support",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"target",
")",
"{",
"return",
"new",
"MinOf",
"(",
"new",
"Mapped",
"<>",
"(",
"supported",
"->",
"new",
"InheritanceLevel",
"(",
"target",
",",
"supported",
")",... | Calculate level of support of the given exception type.
@param target Exception type
@return Level of support: greater or equals to 0 if the target
is supported and {@link Integer#MIN_VALUE} otherwise
@see InheritanceLevel | [
"Calculate",
"level",
"of",
"support",
"of",
"the",
"given",
"exception",
"type",
"."
] | 7d2366be99f8d93eecfca2941ac23d4337dc224e | https://github.com/yegor256/cactoos/blob/7d2366be99f8d93eecfca2941ac23d4337dc224e/src/main/java/org/cactoos/scalar/FallbackFrom.java#L85-L92 |
28,137 | yegor256/cactoos | src/main/java/org/cactoos/scalar/InheritanceLevel.java | InheritanceLevel.calculateLevel | private int calculateLevel() {
int level = Integer.MIN_VALUE;
Class<?> sclass = this.derived.getSuperclass();
int idx = 0;
while (!sclass.equals(Object.class)) {
idx += 1;
if (sclass.equals(this.base)) {
level = idx;
break;
... | java | private int calculateLevel() {
int level = Integer.MIN_VALUE;
Class<?> sclass = this.derived.getSuperclass();
int idx = 0;
while (!sclass.equals(Object.class)) {
idx += 1;
if (sclass.equals(this.base)) {
level = idx;
break;
... | [
"private",
"int",
"calculateLevel",
"(",
")",
"{",
"int",
"level",
"=",
"Integer",
".",
"MIN_VALUE",
";",
"Class",
"<",
"?",
">",
"sclass",
"=",
"this",
".",
"derived",
".",
"getSuperclass",
"(",
")",
";",
"int",
"idx",
"=",
"0",
";",
"while",
"(",
... | Calculates inheritance level.
@return Integer Level | [
"Calculates",
"inheritance",
"level",
"."
] | 7d2366be99f8d93eecfca2941ac23d4337dc224e | https://github.com/yegor256/cactoos/blob/7d2366be99f8d93eecfca2941ac23d4337dc224e/src/main/java/org/cactoos/scalar/InheritanceLevel.java#L84-L97 |
28,138 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/EnvUtil.java | EnvUtil.convertTcpToHttpUrl | public static String convertTcpToHttpUrl(String connect) {
String protocol = connect.contains(":" + DOCKER_HTTPS_PORT) ? "https:" : "http:";
return connect.replaceFirst("^tcp:", protocol);
} | java | public static String convertTcpToHttpUrl(String connect) {
String protocol = connect.contains(":" + DOCKER_HTTPS_PORT) ? "https:" : "http:";
return connect.replaceFirst("^tcp:", protocol);
} | [
"public",
"static",
"String",
"convertTcpToHttpUrl",
"(",
"String",
"connect",
")",
"{",
"String",
"protocol",
"=",
"connect",
".",
"contains",
"(",
"\":\"",
"+",
"DOCKER_HTTPS_PORT",
")",
"?",
"\"https:\"",
":",
"\"http:\"",
";",
"return",
"connect",
".",
"re... | Convert docker host URL to an http URL | [
"Convert",
"docker",
"host",
"URL",
"to",
"an",
"http",
"URL"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/EnvUtil.java#L43-L46 |
28,139 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/EnvUtil.java | EnvUtil.greaterOrEqualsVersion | public static boolean greaterOrEqualsVersion(String versionA, String versionB) {
String largerVersion = extractLargerVersion(versionA, versionB);
return largerVersion != null && largerVersion.equals(versionA);
} | java | public static boolean greaterOrEqualsVersion(String versionA, String versionB) {
String largerVersion = extractLargerVersion(versionA, versionB);
return largerVersion != null && largerVersion.equals(versionA);
} | [
"public",
"static",
"boolean",
"greaterOrEqualsVersion",
"(",
"String",
"versionA",
",",
"String",
"versionB",
")",
"{",
"String",
"largerVersion",
"=",
"extractLargerVersion",
"(",
"versionA",
",",
"versionB",
")",
";",
"return",
"largerVersion",
"!=",
"null",
"&... | Check whether the first given API version is larger or equals the second given version
@param versionA first version to check against
@param versionB the second version
@return true if versionA is greater or equals versionB, false otherwise | [
"Check",
"whether",
"the",
"first",
"given",
"API",
"version",
"is",
"larger",
"or",
"equals",
"the",
"second",
"given",
"version"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/EnvUtil.java#L85-L88 |
28,140 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/EnvUtil.java | EnvUtil.extractFromPropertiesAsMap | public static Map<String, String> extractFromPropertiesAsMap(String prefix, Properties properties) {
Map<String, String> ret = new HashMap<>();
Enumeration names = properties.propertyNames();
String prefixP = prefix + ".";
while (names.hasMoreElements()) {
String propName = (... | java | public static Map<String, String> extractFromPropertiesAsMap(String prefix, Properties properties) {
Map<String, String> ret = new HashMap<>();
Enumeration names = properties.propertyNames();
String prefixP = prefix + ".";
while (names.hasMoreElements()) {
String propName = (... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"extractFromPropertiesAsMap",
"(",
"String",
"prefix",
",",
"Properties",
"properties",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"ret",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"... | Extract part of given properties as a map. The given prefix is used to find the properties,
the rest of the property name is used as key for the map.
NOTE: If key is "._combine" ({@link #PROPERTY_COMBINE_POLICY_SUFFIX)} it is ignored! This is reserved for combine policy tweaking.
@param prefix prefix which specifies ... | [
"Extract",
"part",
"of",
"given",
"properties",
"as",
"a",
"map",
".",
"The",
"given",
"prefix",
"is",
"used",
"to",
"find",
"the",
"properties",
"the",
"rest",
"of",
"the",
"property",
"name",
"is",
"used",
"as",
"key",
"for",
"the",
"map",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/EnvUtil.java#L224-L240 |
28,141 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/EnvUtil.java | EnvUtil.formatDurationTill | public static String formatDurationTill(long start) {
long duration = System.currentTimeMillis() - start;
StringBuilder res = new StringBuilder();
TimeUnit current = HOURS;
while (duration > 0) {
long temp = current.convert(duration, MILLISECONDS);
if (temp > 0... | java | public static String formatDurationTill(long start) {
long duration = System.currentTimeMillis() - start;
StringBuilder res = new StringBuilder();
TimeUnit current = HOURS;
while (duration > 0) {
long temp = current.convert(duration, MILLISECONDS);
if (temp > 0... | [
"public",
"static",
"String",
"formatDurationTill",
"(",
"long",
"start",
")",
"{",
"long",
"duration",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"start",
";",
"StringBuilder",
"res",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"TimeUnit",
"cur... | Calculate the duration between now and the given time
Taken mostly from http://stackoverflow.com/a/5062810/207604 . Kudos to @dblevins
@param start starting time (in milliseconds)
@return time in seconds | [
"Calculate",
"the",
"duration",
"between",
"now",
"and",
"the",
"given",
"time"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/EnvUtil.java#L324-L355 |
28,142 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/EnvUtil.java | EnvUtil.firstRegistryOf | public static String firstRegistryOf(String ... checkFirst) {
for (String registry : checkFirst) {
if (registry != null) {
return registry;
}
}
// Check environment as last resort
return System.getenv("DOCKER_REGISTRY");
} | java | public static String firstRegistryOf(String ... checkFirst) {
for (String registry : checkFirst) {
if (registry != null) {
return registry;
}
}
// Check environment as last resort
return System.getenv("DOCKER_REGISTRY");
} | [
"public",
"static",
"String",
"firstRegistryOf",
"(",
"String",
"...",
"checkFirst",
")",
"{",
"for",
"(",
"String",
"registry",
":",
"checkFirst",
")",
"{",
"if",
"(",
"registry",
"!=",
"null",
")",
"{",
"return",
"registry",
";",
"}",
"}",
"// Check envi... | Return the first non null registry given. Use the env var DOCKER_REGISTRY as final fallback
@param checkFirst list of registries to check
@return registry found or null if none. | [
"Return",
"the",
"first",
"non",
"null",
"registry",
"given",
".",
"Use",
"the",
"env",
"var",
"DOCKER_REGISTRY",
"as",
"final",
"fallback"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/EnvUtil.java#L368-L376 |
28,143 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/EnvUtil.java | EnvUtil.storeTimestamp | public static void storeTimestamp(File tsFile, Date buildDate) throws MojoExecutionException {
try {
if (tsFile.exists()) {
tsFile.delete();
}
File dir = tsFile.getParentFile();
if (!dir.exists()) {
if (!dir.mkdirs()) {
... | java | public static void storeTimestamp(File tsFile, Date buildDate) throws MojoExecutionException {
try {
if (tsFile.exists()) {
tsFile.delete();
}
File dir = tsFile.getParentFile();
if (!dir.exists()) {
if (!dir.mkdirs()) {
... | [
"public",
"static",
"void",
"storeTimestamp",
"(",
"File",
"tsFile",
",",
"Date",
"buildDate",
")",
"throws",
"MojoExecutionException",
"{",
"try",
"{",
"if",
"(",
"tsFile",
".",
"exists",
"(",
")",
")",
"{",
"tsFile",
".",
"delete",
"(",
")",
";",
"}",
... | create a timestamp file holding time in epoch seconds | [
"create",
"a",
"timestamp",
"file",
"holding",
"time",
"in",
"epoch",
"seconds"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/EnvUtil.java#L404-L419 |
28,144 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/access/KeyStoreUtil.java | KeyStoreUtil.createDockerKeyStore | public static KeyStore createDockerKeyStore(String certPath) throws IOException, GeneralSecurityException {
PrivateKey privKey = loadPrivateKey(certPath + "/key.pem");
Certificate[] certs = loadCertificates(certPath + "/cert.pem");
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultTyp... | java | public static KeyStore createDockerKeyStore(String certPath) throws IOException, GeneralSecurityException {
PrivateKey privKey = loadPrivateKey(certPath + "/key.pem");
Certificate[] certs = loadCertificates(certPath + "/cert.pem");
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultTyp... | [
"public",
"static",
"KeyStore",
"createDockerKeyStore",
"(",
"String",
"certPath",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"PrivateKey",
"privKey",
"=",
"loadPrivateKey",
"(",
"certPath",
"+",
"\"/key.pem\"",
")",
";",
"Certificate",
"[",
... | Create a key stored holding certificates and secret keys from the given Docker key cert
@param certPath directory holding the keys (key.pem) and certs (ca.pem, cert.pem)
@return a keystore where the private key is secured with "docker"
@throws IOException is reading of the the PEMs failed
@throws GeneralSecurityExcep... | [
"Create",
"a",
"key",
"stored",
"holding",
"certificates",
"and",
"secret",
"keys",
"from",
"the",
"given",
"Docker",
"key",
"cert"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/access/KeyStoreUtil.java#L39-L49 |
28,145 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/access/ecr/EcrExtendedAuth.java | EcrExtendedAuth.extendedAuth | public AuthConfig extendedAuth(AuthConfig localCredentials) throws IOException, MojoExecutionException {
JsonObject jo = getAuthorizationToken(localCredentials);
JsonArray authorizationDatas = jo.getAsJsonArray("authorizationData");
JsonObject authorizationData = authorizationDatas.get(0).getAs... | java | public AuthConfig extendedAuth(AuthConfig localCredentials) throws IOException, MojoExecutionException {
JsonObject jo = getAuthorizationToken(localCredentials);
JsonArray authorizationDatas = jo.getAsJsonArray("authorizationData");
JsonObject authorizationData = authorizationDatas.get(0).getAs... | [
"public",
"AuthConfig",
"extendedAuth",
"(",
"AuthConfig",
"localCredentials",
")",
"throws",
"IOException",
",",
"MojoExecutionException",
"{",
"JsonObject",
"jo",
"=",
"getAuthorizationToken",
"(",
"localCredentials",
")",
";",
"JsonArray",
"authorizationDatas",
"=",
... | Perform extended authentication. Use the provided credentials as IAM credentials and
get a temporary ECR token.
@param localCredentials IAM id/secret
@return ECR base64 encoded username:password
@throws IOException
@throws MojoExecutionException | [
"Perform",
"extended",
"authentication",
".",
"Use",
"the",
"provided",
"credentials",
"as",
"IAM",
"credentials",
"and",
"get",
"a",
"temporary",
"ECR",
"token",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/access/ecr/EcrExtendedAuth.java#L89-L97 |
28,146 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/AnsiLogger.java | AnsiLogger.progressStart | public void progressStart() {
// A progress indicator is always written out to standard out if a tty is enabled.
if (!batchMode && log.isInfoEnabled()) {
imageLines.remove();
updateCount.remove();
imageLines.set(new HashMap<String, Integer>());
updateCount... | java | public void progressStart() {
// A progress indicator is always written out to standard out if a tty is enabled.
if (!batchMode && log.isInfoEnabled()) {
imageLines.remove();
updateCount.remove();
imageLines.set(new HashMap<String, Integer>());
updateCount... | [
"public",
"void",
"progressStart",
"(",
")",
"{",
"// A progress indicator is always written out to standard out if a tty is enabled.",
"if",
"(",
"!",
"batchMode",
"&&",
"log",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"imageLines",
".",
"remove",
"(",
")",
";",
"u... | Start a progress bar | [
"Start",
"a",
"progress",
"bar"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/AnsiLogger.java#L121-L129 |
28,147 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/AnsiLogger.java | AnsiLogger.progressUpdate | public void progressUpdate(String layerId, String status, String progressMessage) {
if (!batchMode && log.isInfoEnabled() && StringUtils.isNotEmpty(layerId)) {
if (useAnsi) {
updateAnsiProgress(layerId, status, progressMessage);
} else {
updateNonAnsiProgr... | java | public void progressUpdate(String layerId, String status, String progressMessage) {
if (!batchMode && log.isInfoEnabled() && StringUtils.isNotEmpty(layerId)) {
if (useAnsi) {
updateAnsiProgress(layerId, status, progressMessage);
} else {
updateNonAnsiProgr... | [
"public",
"void",
"progressUpdate",
"(",
"String",
"layerId",
",",
"String",
"status",
",",
"String",
"progressMessage",
")",
"{",
"if",
"(",
"!",
"batchMode",
"&&",
"log",
".",
"isInfoEnabled",
"(",
")",
"&&",
"StringUtils",
".",
"isNotEmpty",
"(",
"layerId... | Update the progress | [
"Update",
"the",
"progress"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/AnsiLogger.java#L134-L143 |
28,148 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/AnsiLogger.java | AnsiLogger.format | private String format(String message, Object[] params) {
if (params.length == 0) {
return message;
} else if (params.length == 1 && params[0] instanceof Throwable) {
// We print only the message here since breaking exception will bubble up
// anyway
return... | java | private String format(String message, Object[] params) {
if (params.length == 0) {
return message;
} else if (params.length == 1 && params[0] instanceof Throwable) {
// We print only the message here since breaking exception will bubble up
// anyway
return... | [
"private",
"String",
"format",
"(",
"String",
"message",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"if",
"(",
"params",
".",
"length",
"==",
"0",
")",
"{",
"return",
"message",
";",
"}",
"else",
"if",
"(",
"params",
".",
"length",
"==",
"1",
"&&... | Use parameters when given, otherwise we use the string directly | [
"Use",
"parameters",
"when",
"given",
"otherwise",
"we",
"use",
"the",
"string",
"directly"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/AnsiLogger.java#L232-L242 |
28,149 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/ContainerTracker.java | ContainerTracker.registerContainer | public synchronized void registerContainer(String containerId,
ImageConfiguration imageConfig,
GavLabel gavLabel) {
ContainerShutdownDescriptor descriptor = new ContainerShutdownDescriptor(imageConfig, containerId);
... | java | public synchronized void registerContainer(String containerId,
ImageConfiguration imageConfig,
GavLabel gavLabel) {
ContainerShutdownDescriptor descriptor = new ContainerShutdownDescriptor(imageConfig, containerId);
... | [
"public",
"synchronized",
"void",
"registerContainer",
"(",
"String",
"containerId",
",",
"ImageConfiguration",
"imageConfig",
",",
"GavLabel",
"gavLabel",
")",
"{",
"ContainerShutdownDescriptor",
"descriptor",
"=",
"new",
"ContainerShutdownDescriptor",
"(",
"imageConfig",
... | Register a started container to this tracker
@param containerId container id to register
@param imageConfig configuration of associated image
@param gavLabel pom label to identifying the reactor project where the container was created | [
"Register",
"a",
"started",
"container",
"to",
"this",
"tracker"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/ContainerTracker.java#L34-L41 |
28,150 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/ContainerTracker.java | ContainerTracker.lookupContainer | public synchronized String lookupContainer(String lookup) {
if (aliasToContainerMap.containsKey(lookup)) {
return aliasToContainerMap.get(lookup);
}
return imageToContainerMap.get(lookup);
} | java | public synchronized String lookupContainer(String lookup) {
if (aliasToContainerMap.containsKey(lookup)) {
return aliasToContainerMap.get(lookup);
}
return imageToContainerMap.get(lookup);
} | [
"public",
"synchronized",
"String",
"lookupContainer",
"(",
"String",
"lookup",
")",
"{",
"if",
"(",
"aliasToContainerMap",
".",
"containsKey",
"(",
"lookup",
")",
")",
"{",
"return",
"aliasToContainerMap",
".",
"get",
"(",
"lookup",
")",
";",
"}",
"return",
... | Lookup a container by name or alias from the tracked containers
@param lookup name or alias of the container to lookup
@return container id found or <code>null</code> | [
"Lookup",
"a",
"container",
"by",
"name",
"or",
"alias",
"from",
"the",
"tracked",
"containers"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/ContainerTracker.java#L64-L69 |
28,151 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/ContainerTracker.java | ContainerTracker.removeShutdownDescriptors | public synchronized Collection<ContainerShutdownDescriptor> removeShutdownDescriptors(GavLabel gavLabel) {
List<ContainerShutdownDescriptor> descriptors;
if (gavLabel != null) {
descriptors = removeFromPomLabelMap(gavLabel);
removeFromPerContainerMap(descriptors);
} else ... | java | public synchronized Collection<ContainerShutdownDescriptor> removeShutdownDescriptors(GavLabel gavLabel) {
List<ContainerShutdownDescriptor> descriptors;
if (gavLabel != null) {
descriptors = removeFromPomLabelMap(gavLabel);
removeFromPerContainerMap(descriptors);
} else ... | [
"public",
"synchronized",
"Collection",
"<",
"ContainerShutdownDescriptor",
">",
"removeShutdownDescriptors",
"(",
"GavLabel",
"gavLabel",
")",
"{",
"List",
"<",
"ContainerShutdownDescriptor",
">",
"descriptors",
";",
"if",
"(",
"gavLabel",
"!=",
"null",
")",
"{",
"... | Get all shutdown descriptors for a given pom label and remove it from the tracker. The descriptors
are returned in reverse order of their registration.
If no pom label is given, then all descriptors are returned.
@param gavLabel the label for which to get the descriptors or <code>null</code> for all descriptors
@retu... | [
"Get",
"all",
"shutdown",
"descriptors",
"for",
"a",
"given",
"pom",
"label",
"and",
"remove",
"it",
"from",
"the",
"tracker",
".",
"The",
"descriptors",
"are",
"returned",
"in",
"reverse",
"order",
"of",
"their",
"registration",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/ContainerTracker.java#L80-L93 |
28,152 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/AbstractDockerMojo.java | AbstractDockerMojo.getBuildTimestamp | protected synchronized Date getBuildTimestamp() throws IOException {
Date now = (Date) getPluginContext().get(CONTEXT_KEY_BUILD_TIMESTAMP);
if (now == null) {
now = getReferenceDate();
getPluginContext().put(CONTEXT_KEY_BUILD_TIMESTAMP,now);
}
return now;
} | java | protected synchronized Date getBuildTimestamp() throws IOException {
Date now = (Date) getPluginContext().get(CONTEXT_KEY_BUILD_TIMESTAMP);
if (now == null) {
now = getReferenceDate();
getPluginContext().put(CONTEXT_KEY_BUILD_TIMESTAMP,now);
}
return now;
} | [
"protected",
"synchronized",
"Date",
"getBuildTimestamp",
"(",
")",
"throws",
"IOException",
"{",
"Date",
"now",
"=",
"(",
"Date",
")",
"getPluginContext",
"(",
")",
".",
"get",
"(",
"CONTEXT_KEY_BUILD_TIMESTAMP",
")",
";",
"if",
"(",
"now",
"==",
"null",
")... | Get the current build timestamp. this has either already been created by a previous
call or a new current date is created
@return timestamp to use | [
"Get",
"the",
"current",
"build",
"timestamp",
".",
"this",
"has",
"either",
"already",
"been",
"created",
"by",
"a",
"previous",
"call",
"or",
"a",
"new",
"current",
"date",
"is",
"created"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/AbstractDockerMojo.java#L284-L291 |
28,153 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/AbstractDockerMojo.java | AbstractDockerMojo.getReferenceDate | protected Date getReferenceDate() throws IOException {
Date referenceDate = EnvUtil.loadTimestamp(getBuildTimestampFile());
return referenceDate != null ? referenceDate : new Date();
} | java | protected Date getReferenceDate() throws IOException {
Date referenceDate = EnvUtil.loadTimestamp(getBuildTimestampFile());
return referenceDate != null ? referenceDate : new Date();
} | [
"protected",
"Date",
"getReferenceDate",
"(",
")",
"throws",
"IOException",
"{",
"Date",
"referenceDate",
"=",
"EnvUtil",
".",
"loadTimestamp",
"(",
"getBuildTimestampFile",
"(",
")",
")",
";",
"return",
"referenceDate",
"!=",
"null",
"?",
"referenceDate",
":",
... | from an existing build date file. If this does not exist, the current date is used. | [
"from",
"an",
"existing",
"build",
"date",
"file",
".",
"If",
"this",
"does",
"not",
"exist",
"the",
"current",
"date",
"is",
"used",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/AbstractDockerMojo.java#L295-L298 |
28,154 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/AbstractDockerMojo.java | AbstractDockerMojo.initImageConfiguration | private String initImageConfiguration(Date buildTimeStamp) {
// Resolve images
resolvedImages = ConfigHelper.resolveImages(
log,
images, // Unresolved images
new ConfigHelper.Resolver() {
@Override
public List<... | java | private String initImageConfiguration(Date buildTimeStamp) {
// Resolve images
resolvedImages = ConfigHelper.resolveImages(
log,
images, // Unresolved images
new ConfigHelper.Resolver() {
@Override
public List<... | [
"private",
"String",
"initImageConfiguration",
"(",
"Date",
"buildTimeStamp",
")",
"{",
"// Resolve images",
"resolvedImages",
"=",
"ConfigHelper",
".",
"resolveImages",
"(",
"log",
",",
"images",
",",
"// Unresolved images",
"new",
"ConfigHelper",
".",
"Resolver",
"(... | Resolve and customize image configuration | [
"Resolve",
"and",
"customize",
"image",
"configuration"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/AbstractDockerMojo.java#L323-L349 |
28,155 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/DockerAccessFactory.java | DockerAccessFactory.getDefaultDockerHostProviders | private List<DockerConnectionDetector.DockerHostProvider> getDefaultDockerHostProviders(DockerAccessContext dockerAccessContext, Logger log) {
DockerMachineConfiguration config = dockerAccessContext.getMachine();
if (dockerAccessContext.isSkipMachine()) {
config = null;
} else if (c... | java | private List<DockerConnectionDetector.DockerHostProvider> getDefaultDockerHostProviders(DockerAccessContext dockerAccessContext, Logger log) {
DockerMachineConfiguration config = dockerAccessContext.getMachine();
if (dockerAccessContext.isSkipMachine()) {
config = null;
} else if (c... | [
"private",
"List",
"<",
"DockerConnectionDetector",
".",
"DockerHostProvider",
">",
"getDefaultDockerHostProviders",
"(",
"DockerAccessContext",
"dockerAccessContext",
",",
"Logger",
"log",
")",
"{",
"DockerMachineConfiguration",
"config",
"=",
"dockerAccessContext",
".",
"... | Return a list of providers which could delive connection parameters from
calling external commands. For this plugin this is docker-machine, but can be overridden
to add other config options, too.
@return list of providers or <code>null</code> if none are applicable | [
"Return",
"a",
"list",
"of",
"providers",
"which",
"could",
"delive",
"connection",
"parameters",
"from",
"calling",
"external",
"commands",
".",
"For",
"this",
"plugin",
"this",
"is",
"docker",
"-",
"machine",
"but",
"can",
"be",
"overridden",
"to",
"add",
... | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/DockerAccessFactory.java#L67-L85 |
28,156 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/DockerAccessFactory.java | DockerAccessFactory.setDockerHostAddressProperty | private void setDockerHostAddressProperty(DockerAccessContext dockerAccessContext, String dockerUrl) throws MojoFailureException {
Properties props = dockerAccessContext.getProjectProperties();
if (props.getProperty("docker.host.address") == null) {
final String host;
try {
... | java | private void setDockerHostAddressProperty(DockerAccessContext dockerAccessContext, String dockerUrl) throws MojoFailureException {
Properties props = dockerAccessContext.getProjectProperties();
if (props.getProperty("docker.host.address") == null) {
final String host;
try {
... | [
"private",
"void",
"setDockerHostAddressProperty",
"(",
"DockerAccessContext",
"dockerAccessContext",
",",
"String",
"dockerUrl",
")",
"throws",
"MojoFailureException",
"{",
"Properties",
"props",
"=",
"dockerAccessContext",
".",
"getProjectProperties",
"(",
")",
";",
"if... | Registry for managed containers | [
"Registry",
"for",
"managed",
"containers"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/DockerAccessFactory.java#L88-L104 |
28,157 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/config/ConfigHelper.java | ConfigHelper.resolveImages | public static List<ImageConfiguration> resolveImages(Logger logger,
List<ImageConfiguration> images,
Resolver imageResolver,
String imageNameFilter,
... | java | public static List<ImageConfiguration> resolveImages(Logger logger,
List<ImageConfiguration> images,
Resolver imageResolver,
String imageNameFilter,
... | [
"public",
"static",
"List",
"<",
"ImageConfiguration",
">",
"resolveImages",
"(",
"Logger",
"logger",
",",
"List",
"<",
"ImageConfiguration",
">",
"images",
",",
"Resolver",
"imageResolver",
",",
"String",
"imageNameFilter",
",",
"Customizer",
"imageCustomizer",
")"... | Resolve image with an external image resolver
@param images the original image config list (can be null)
@param imageResolver the resolver used to extend on an image configuration
@param imageNameFilter filter to select only certain image configurations with the given name
@param imageCustomizer final customization ho... | [
"Resolve",
"image",
"with",
"an",
"external",
"image",
"resolver"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/config/ConfigHelper.java#L52-L69 |
28,158 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/config/ConfigHelper.java | ConfigHelper.initAndValidate | public static String initAndValidate(List<ImageConfiguration> images, String apiVersion, NameFormatter nameFormatter,
Logger log) {
// Init and validate configs. After this step, getResolvedImages() contains the valid configuration.
for (ImageConfiguration imageC... | java | public static String initAndValidate(List<ImageConfiguration> images, String apiVersion, NameFormatter nameFormatter,
Logger log) {
// Init and validate configs. After this step, getResolvedImages() contains the valid configuration.
for (ImageConfiguration imageC... | [
"public",
"static",
"String",
"initAndValidate",
"(",
"List",
"<",
"ImageConfiguration",
">",
"images",
",",
"String",
"apiVersion",
",",
"NameFormatter",
"nameFormatter",
",",
"Logger",
"log",
")",
"{",
"// Init and validate configs. After this step, getResolvedImages() co... | Initialize and validate the configuration.
@param images the images to check
@param apiVersion the original API version intended to use
@param nameFormatter formatter for image names
@param log a logger for printing out diagnostic messages
@return the minimal API Docker API required to be used for the given configura... | [
"Initialize",
"and",
"validate",
"the",
"configuration",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/config/ConfigHelper.java#L121-L128 |
28,159 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/config/ConfigHelper.java | ConfigHelper.matchesConfiguredImages | public static boolean matchesConfiguredImages(String imageList, ImageConfiguration imageConfig) {
if (imageList == null) {
return true;
}
Set<String> imagesAllowed = new HashSet<>(Arrays.asList(imageList.split("\\s*,\\s*")));
return imagesAllowed.contains(imageConfig.getName(... | java | public static boolean matchesConfiguredImages(String imageList, ImageConfiguration imageConfig) {
if (imageList == null) {
return true;
}
Set<String> imagesAllowed = new HashSet<>(Arrays.asList(imageList.split("\\s*,\\s*")));
return imagesAllowed.contains(imageConfig.getName(... | [
"public",
"static",
"boolean",
"matchesConfiguredImages",
"(",
"String",
"imageList",
",",
"ImageConfiguration",
"imageConfig",
")",
"{",
"if",
"(",
"imageList",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"Set",
"<",
"String",
">",
"imagesAllowed",
"=... | Check if the provided image configuration matches the given | [
"Check",
"if",
"the",
"provided",
"image",
"configuration",
"matches",
"the",
"given"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/config/ConfigHelper.java#L131-L137 |
28,160 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/config/ConfigHelper.java | ConfigHelper.filterImages | private static List<ImageConfiguration> filterImages(String nameFilter, List<ImageConfiguration> imagesToFilter) {
List<ImageConfiguration> ret = new ArrayList<>();
for (ImageConfiguration imageConfig : imagesToFilter) {
if (matchesConfiguredImages(nameFilter, imageConfig)) {
... | java | private static List<ImageConfiguration> filterImages(String nameFilter, List<ImageConfiguration> imagesToFilter) {
List<ImageConfiguration> ret = new ArrayList<>();
for (ImageConfiguration imageConfig : imagesToFilter) {
if (matchesConfiguredImages(nameFilter, imageConfig)) {
... | [
"private",
"static",
"List",
"<",
"ImageConfiguration",
">",
"filterImages",
"(",
"String",
"nameFilter",
",",
"List",
"<",
"ImageConfiguration",
">",
"imagesToFilter",
")",
"{",
"List",
"<",
"ImageConfiguration",
">",
"ret",
"=",
"new",
"ArrayList",
"<>",
"(",
... | list of image names which should be used | [
"list",
"of",
"image",
"names",
"which",
"should",
"be",
"used"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/config/ConfigHelper.java#L143-L151 |
28,161 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/config/ConfigHelper.java | ConfigHelper.resolveConfiguration | private static List<ImageConfiguration> resolveConfiguration(Resolver imageResolver,
List<ImageConfiguration> unresolvedImages) {
List<ImageConfiguration> ret = new ArrayList<>();
if (unresolvedImages != null) {
for (ImageConfi... | java | private static List<ImageConfiguration> resolveConfiguration(Resolver imageResolver,
List<ImageConfiguration> unresolvedImages) {
List<ImageConfiguration> ret = new ArrayList<>();
if (unresolvedImages != null) {
for (ImageConfi... | [
"private",
"static",
"List",
"<",
"ImageConfiguration",
">",
"resolveConfiguration",
"(",
"Resolver",
"imageResolver",
",",
"List",
"<",
"ImageConfiguration",
">",
"unresolvedImages",
")",
"{",
"List",
"<",
"ImageConfiguration",
">",
"ret",
"=",
"new",
"ArrayList",
... | Resolve and initialize external configuration | [
"Resolve",
"and",
"initialize",
"external",
"configuration"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/config/ConfigHelper.java#L154-L164 |
28,162 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/config/ConfigHelper.java | ConfigHelper.verifyImageNames | private static void verifyImageNames(List<ImageConfiguration> ret) {
for (ImageConfiguration config : ret) {
if (config.getName() == null) {
throw new IllegalArgumentException("Configuration error: <image> must have a non-null <name>");
}
}
} | java | private static void verifyImageNames(List<ImageConfiguration> ret) {
for (ImageConfiguration config : ret) {
if (config.getName() == null) {
throw new IllegalArgumentException("Configuration error: <image> must have a non-null <name>");
}
}
} | [
"private",
"static",
"void",
"verifyImageNames",
"(",
"List",
"<",
"ImageConfiguration",
">",
"ret",
")",
"{",
"for",
"(",
"ImageConfiguration",
"config",
":",
"ret",
")",
"{",
"if",
"(",
"config",
".",
"getName",
"(",
")",
"==",
"null",
")",
"{",
"throw... | Extract authentication information | [
"Extract",
"authentication",
"information"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/config/ConfigHelper.java#L168-L174 |
28,163 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/MojoExecutionService.java | MojoExecutionService.callPluginGoal | public void callPluginGoal(String fullGoal) throws MojoFailureException, MojoExecutionException {
String[] parts = splitGoalSpec(fullGoal);
Plugin plugin = project.getPlugin(parts[0]);
String goal = parts[1];
if (plugin == null) {
throw new MojoFailureException("No goal " + ... | java | public void callPluginGoal(String fullGoal) throws MojoFailureException, MojoExecutionException {
String[] parts = splitGoalSpec(fullGoal);
Plugin plugin = project.getPlugin(parts[0]);
String goal = parts[1];
if (plugin == null) {
throw new MojoFailureException("No goal " + ... | [
"public",
"void",
"callPluginGoal",
"(",
"String",
"fullGoal",
")",
"throws",
"MojoFailureException",
",",
"MojoExecutionException",
"{",
"String",
"[",
"]",
"parts",
"=",
"splitGoalSpec",
"(",
"fullGoal",
")",
";",
"Plugin",
"plugin",
"=",
"project",
".",
"getP... | Call another goal after restart has finished | [
"Call",
"another",
"goal",
"after",
"restart",
"has",
"finished"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/MojoExecutionService.java#L58-L88 |
28,164 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/assembly/DockerFileBuilder.java | DockerFileBuilder.write | public File write(File destDir) throws IOException {
File target = new File(destDir,"Dockerfile");
FileUtils.fileWrite(target, content());
return target;
} | java | public File write(File destDir) throws IOException {
File target = new File(destDir,"Dockerfile");
FileUtils.fileWrite(target, content());
return target;
} | [
"public",
"File",
"write",
"(",
"File",
"destDir",
")",
"throws",
"IOException",
"{",
"File",
"target",
"=",
"new",
"File",
"(",
"destDir",
",",
"\"Dockerfile\"",
")",
";",
"FileUtils",
".",
"fileWrite",
"(",
"target",
",",
"content",
"(",
")",
")",
";",... | Create a DockerFile in the given directory
@param destDir directory where to store the dockerfile
@return the full path to the docker file
@throws IOException if writing fails | [
"Create",
"a",
"DockerFile",
"in",
"the",
"given",
"directory"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/DockerFileBuilder.java#L83-L87 |
28,165 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/assembly/DockerFileBuilder.java | DockerFileBuilder.createKeyValue | private String createKeyValue(String key, String value) {
StringBuilder sb = new StringBuilder();
// no quoting the key; "Keys are alphanumeric strings which may contain periods (.) and hyphens (-)"
sb.append(key).append('=');
if (value == null || value.isEmpty()) {
return sb... | java | private String createKeyValue(String key, String value) {
StringBuilder sb = new StringBuilder();
// no quoting the key; "Keys are alphanumeric strings which may contain periods (.) and hyphens (-)"
sb.append(key).append('=');
if (value == null || value.isEmpty()) {
return sb... | [
"private",
"String",
"createKeyValue",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// no quoting the key; \"Keys are alphanumeric strings which may contain periods (.) and hyphens (-)\"",
"sb",
... | Escape any slashes, quotes, and newlines int the value. If any escaping occurred, quote the value.
@param key The key
@param value The value
@return Escaped and quoted key="value" | [
"Escape",
"any",
"slashes",
"quotes",
"and",
"newlines",
"int",
"the",
"value",
".",
"If",
"any",
"escaping",
"occurred",
"quote",
"the",
"value",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/DockerFileBuilder.java#L250-L282 |
28,166 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/assembly/DockerFileBuilder.java | DockerFileBuilder.run | public DockerFileBuilder run(List<String> runCmds) {
if (runCmds != null) {
for (String cmd : runCmds) {
if (!StringUtils.isEmpty(cmd)) {
this.runCmds.add(cmd);
}
}
}
return this;
} | java | public DockerFileBuilder run(List<String> runCmds) {
if (runCmds != null) {
for (String cmd : runCmds) {
if (!StringUtils.isEmpty(cmd)) {
this.runCmds.add(cmd);
}
}
}
return this;
} | [
"public",
"DockerFileBuilder",
"run",
"(",
"List",
"<",
"String",
">",
"runCmds",
")",
"{",
"if",
"(",
"runCmds",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"cmd",
":",
"runCmds",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"cmd"... | Adds the RUN Commands within the build image section
@param runCmds
@return | [
"Adds",
"the",
"RUN",
"Commands",
"within",
"the",
"build",
"image",
"section"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/DockerFileBuilder.java#L434-L443 |
28,167 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/ContainerNamingUtil.java | ContainerNamingUtil.getContainersToStop | public static Collection<Container> getContainersToStop(final ImageConfiguration image,
final String defaultContainerNamePattern,
final Date buildTimestamp,
... | java | public static Collection<Container> getContainersToStop(final ImageConfiguration image,
final String defaultContainerNamePattern,
final Date buildTimestamp,
... | [
"public",
"static",
"Collection",
"<",
"Container",
">",
"getContainersToStop",
"(",
"final",
"ImageConfiguration",
"image",
",",
"final",
"String",
"defaultContainerNamePattern",
",",
"final",
"Date",
"buildTimestamp",
",",
"final",
"Collection",
"<",
"Container",
">... | Keep only the entry with the higest index if an indexed naming scheme for container has been chosen.
@param image the image from which to the the container pattern
@param buildTimestamp the timestamp for the build
@param containers the list of existing containers
@return a list with potentially lower indexed entries re... | [
"Keep",
"only",
"the",
"entry",
"with",
"the",
"higest",
"index",
"if",
"an",
"indexed",
"naming",
"scheme",
"for",
"container",
"has",
"been",
"chosen",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/ContainerNamingUtil.java#L66-L87 |
28,168 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/RegistryService.java | RegistryService.pushImages | public void pushImages(Collection<ImageConfiguration> imageConfigs,
int retries, RegistryConfig registryConfig, boolean skipTag) throws DockerAccessException, MojoExecutionException {
for (ImageConfiguration imageConfig : imageConfigs) {
BuildImageConfiguration buildConfig... | java | public void pushImages(Collection<ImageConfiguration> imageConfigs,
int retries, RegistryConfig registryConfig, boolean skipTag) throws DockerAccessException, MojoExecutionException {
for (ImageConfiguration imageConfig : imageConfigs) {
BuildImageConfiguration buildConfig... | [
"public",
"void",
"pushImages",
"(",
"Collection",
"<",
"ImageConfiguration",
">",
"imageConfigs",
",",
"int",
"retries",
",",
"RegistryConfig",
"registryConfig",
",",
"boolean",
"skipTag",
")",
"throws",
"DockerAccessException",
",",
"MojoExecutionException",
"{",
"f... | Push a set of images to a registry
@param imageConfigs images to push (but only if they have a build configuration)
@param retries how often to retry
@param registryConfig a global registry configuration
@param skipTag flag to skip pushing tagged images
@throws DockerAccessException
@throws MojoExecutionException | [
"Push",
"a",
"set",
"of",
"images",
"to",
"a",
"registry"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/RegistryService.java#L44-L71 |
28,169 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/config/BuildImageConfiguration.java | BuildImageConfiguration.initDockerFileFile | private void initDockerFileFile(Logger log) {
// can't have dockerFile/dockerFileDir and dockerArchive
if ((dockerFile != null || dockerFileDir != null) && dockerArchive != null) {
throw new IllegalArgumentException("Both <dockerFile> (<dockerFileDir>) and <dockerArchive> are set. " +
... | java | private void initDockerFileFile(Logger log) {
// can't have dockerFile/dockerFileDir and dockerArchive
if ((dockerFile != null || dockerFileDir != null) && dockerArchive != null) {
throw new IllegalArgumentException("Both <dockerFile> (<dockerFileDir>) and <dockerArchive> are set. " +
... | [
"private",
"void",
"initDockerFileFile",
"(",
"Logger",
"log",
")",
"{",
"// can't have dockerFile/dockerFileDir and dockerArchive",
"if",
"(",
"(",
"dockerFile",
"!=",
"null",
"||",
"dockerFileDir",
"!=",
"null",
")",
"&&",
"dockerArchive",
"!=",
"null",
")",
"{",
... | Initialize the dockerfile location and the build mode | [
"Initialize",
"the",
"dockerfile",
"location",
"and",
"the",
"build",
"mode"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/config/BuildImageConfiguration.java#L628-L639 |
28,170 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/assembly/DockerAssemblyManager.java | DockerAssemblyManager.createBuildTarBall | private File createBuildTarBall(BuildDirs buildDirs, List<ArchiverCustomizer> archiverCustomizers,
AssemblyConfiguration assemblyConfig, ArchiveCompression compression) throws MojoExecutionException {
File archive = new File(buildDirs.getTemporaryRootDirectory(), "docker-buil... | java | private File createBuildTarBall(BuildDirs buildDirs, List<ArchiverCustomizer> archiverCustomizers,
AssemblyConfiguration assemblyConfig, ArchiveCompression compression) throws MojoExecutionException {
File archive = new File(buildDirs.getTemporaryRootDirectory(), "docker-buil... | [
"private",
"File",
"createBuildTarBall",
"(",
"BuildDirs",
"buildDirs",
",",
"List",
"<",
"ArchiverCustomizer",
">",
"archiverCustomizers",
",",
"AssemblyConfiguration",
"assemblyConfig",
",",
"ArchiveCompression",
"compression",
")",
"throws",
"MojoExecutionException",
"{"... | Create final tar-ball to be used for building the archive to send to the Docker daemon | [
"Create",
"final",
"tar",
"-",
"ball",
"to",
"be",
"used",
"for",
"building",
"the",
"archive",
"to",
"send",
"to",
"the",
"Docker",
"daemon"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/DockerAssemblyManager.java#L305-L323 |
28,171 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/assembly/DockerAssemblyManager.java | DockerAssemblyManager.ensureThatArtifactFileIsSet | private File ensureThatArtifactFileIsSet(MavenProject project) {
Artifact artifact = project.getArtifact();
if (artifact == null) {
return null;
}
File oldFile = artifact.getFile();
if (oldFile != null) {
return oldFile;
}
Build build = pro... | java | private File ensureThatArtifactFileIsSet(MavenProject project) {
Artifact artifact = project.getArtifact();
if (artifact == null) {
return null;
}
File oldFile = artifact.getFile();
if (oldFile != null) {
return oldFile;
}
Build build = pro... | [
"private",
"File",
"ensureThatArtifactFileIsSet",
"(",
"MavenProject",
"project",
")",
"{",
"Artifact",
"artifact",
"=",
"project",
".",
"getArtifact",
"(",
")",
";",
"if",
"(",
"artifact",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"File",
"oldFile... | warning with an error following. | [
"warning",
"with",
"an",
"error",
"following",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/DockerAssemblyManager.java#L494-L517 |
28,172 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/assembly/AssemblyFiles.java | AssemblyFiles.addEntry | public void addEntry(File srcFile, File destFile) {
entries.add(new Entry(srcFile,destFile));
} | java | public void addEntry(File srcFile, File destFile) {
entries.add(new Entry(srcFile,destFile));
} | [
"public",
"void",
"addEntry",
"(",
"File",
"srcFile",
",",
"File",
"destFile",
")",
"{",
"entries",
".",
"add",
"(",
"new",
"Entry",
"(",
"srcFile",
",",
"destFile",
")",
")",
";",
"}"
] | Add a entry to the list of assembly files which possible should be monitored
@param srcFile source file to monitor. The source file must exist.
@param destFile the destination to which it is eventually copied. The destination file must be relative. | [
"Add",
"a",
"entry",
"to",
"the",
"list",
"of",
"assembly",
"files",
"which",
"possible",
"should",
"be",
"monitored"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/AssemblyFiles.java#L49-L51 |
28,173 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/StartOrderResolver.java | StartOrderResolver.resolve | private List<Resolvable> resolve(List<Resolvable> images) {
List<Resolvable> resolved = new ArrayList<>();
// First pass: Pick all data images and all without dependencies
for (Resolvable config : images) {
List<String> volumesOrLinks = extractDependentImagesFor(config);
... | java | private List<Resolvable> resolve(List<Resolvable> images) {
List<Resolvable> resolved = new ArrayList<>();
// First pass: Pick all data images and all without dependencies
for (Resolvable config : images) {
List<String> volumesOrLinks = extractDependentImagesFor(config);
... | [
"private",
"List",
"<",
"Resolvable",
">",
"resolve",
"(",
"List",
"<",
"Resolvable",
">",
"images",
")",
"{",
"List",
"<",
"Resolvable",
">",
"resolved",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// First pass: Pick all data images and all without dependenci... | an appropriate container which can be linked into the image | [
"an",
"appropriate",
"container",
"which",
"can",
"be",
"linked",
"into",
"the",
"image"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/StartOrderResolver.java#L38-L55 |
28,174 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/ArchiveService.java | ArchiveService.createChangedFilesArchive | public File createChangedFilesArchive(List<AssemblyFiles.Entry> entries, File assemblyDir,
String imageName, MojoParameters mojoParameters) throws MojoExecutionException {
return dockerAssemblyManager.createChangedFilesArchive(entries, assemblyDir, imageName, mojoParame... | java | public File createChangedFilesArchive(List<AssemblyFiles.Entry> entries, File assemblyDir,
String imageName, MojoParameters mojoParameters) throws MojoExecutionException {
return dockerAssemblyManager.createChangedFilesArchive(entries, assemblyDir, imageName, mojoParame... | [
"public",
"File",
"createChangedFilesArchive",
"(",
"List",
"<",
"AssemblyFiles",
".",
"Entry",
">",
"entries",
",",
"File",
"assemblyDir",
",",
"String",
"imageName",
",",
"MojoParameters",
"mojoParameters",
")",
"throws",
"MojoExecutionException",
"{",
"return",
"... | Create an tar archive from a set of assembly files. Only files which changed since the last call are included.
@param entries changed files. List must not be empty or null
@param imageName image's name
@param mojoParameters
@return created archive | [
"Create",
"an",
"tar",
"archive",
"from",
"a",
"set",
"of",
"assembly",
"files",
".",
"Only",
"files",
"which",
"changed",
"since",
"the",
"last",
"call",
"are",
"included",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/ArchiveService.java#L109-L112 |
28,175 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/access/ContainerNetworkingConfig.java | ContainerNetworkingConfig.aliases | public ContainerNetworkingConfig aliases(NetworkConfig config) {
JsonObject endPoints = new JsonObject();
endPoints.add("Aliases", JsonFactory.newJsonArray(config.getAliases()));
JsonObject endpointConfigMap = new JsonObject();
endpointConfigMap.add(config.getCustomNetwork(), endPoints)... | java | public ContainerNetworkingConfig aliases(NetworkConfig config) {
JsonObject endPoints = new JsonObject();
endPoints.add("Aliases", JsonFactory.newJsonArray(config.getAliases()));
JsonObject endpointConfigMap = new JsonObject();
endpointConfigMap.add(config.getCustomNetwork(), endPoints)... | [
"public",
"ContainerNetworkingConfig",
"aliases",
"(",
"NetworkConfig",
"config",
")",
"{",
"JsonObject",
"endPoints",
"=",
"new",
"JsonObject",
"(",
")",
";",
"endPoints",
".",
"add",
"(",
"\"Aliases\"",
",",
"JsonFactory",
".",
"newJsonArray",
"(",
"config",
"... | Add networking aliases to a custom network
@param config network config as configured in the pom.xml
@return this configuration | [
"Add",
"networking",
"aliases",
"to",
"a",
"custom",
"network"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/access/ContainerNetworkingConfig.java#L18-L27 |
28,176 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/BuildService.java | BuildService.buildImage | public void buildImage(ImageConfiguration imageConfig, ImagePullManager imagePullManager, BuildContext buildContext)
throws DockerAccessException, MojoExecutionException {
if (imagePullManager != null) {
autoPullBaseImage(imageConfig, imagePullManager, buildContext);
}
... | java | public void buildImage(ImageConfiguration imageConfig, ImagePullManager imagePullManager, BuildContext buildContext)
throws DockerAccessException, MojoExecutionException {
if (imagePullManager != null) {
autoPullBaseImage(imageConfig, imagePullManager, buildContext);
}
... | [
"public",
"void",
"buildImage",
"(",
"ImageConfiguration",
"imageConfig",
",",
"ImagePullManager",
"imagePullManager",
",",
"BuildContext",
"buildContext",
")",
"throws",
"DockerAccessException",
",",
"MojoExecutionException",
"{",
"if",
"(",
"imagePullManager",
"!=",
"nu... | Pull the base image if needed and run the build.
@param imageConfig the image configuration
@param buildContext the build context
@throws DockerAccessException
@throws MojoExecutionException | [
"Pull",
"the",
"base",
"image",
"if",
"needed",
"and",
"run",
"the",
"build",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/BuildService.java#L63-L71 |
28,177 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/BuildService.java | BuildService.buildImage | protected void buildImage(ImageConfiguration imageConfig, MojoParameters params, boolean noCache, Map<String, String> buildArgs)
throws DockerAccessException, MojoExecutionException {
String imageName = imageConfig.getName();
ImageName.validate(imageName);
BuildImageConfiguration b... | java | protected void buildImage(ImageConfiguration imageConfig, MojoParameters params, boolean noCache, Map<String, String> buildArgs)
throws DockerAccessException, MojoExecutionException {
String imageName = imageConfig.getName();
ImageName.validate(imageName);
BuildImageConfiguration b... | [
"protected",
"void",
"buildImage",
"(",
"ImageConfiguration",
"imageConfig",
",",
"MojoParameters",
"params",
",",
"boolean",
"noCache",
",",
"Map",
"<",
"String",
",",
"String",
">",
"buildArgs",
")",
"throws",
"DockerAccessException",
",",
"MojoExecutionException",
... | Build an image
@param imageConfig the image configuration
@param params mojo params for the project
@param noCache if not null, dictate the caching behaviour. Otherwise its taken from the build configuration
@param buildArgs
@throws DockerAccessException
@throws MojoExecutionException | [
"Build",
"an",
"image"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/BuildService.java#L99-L161 |
28,178 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/RunService.java | RunService.stopContainer | public void stopContainer(String containerId,
ImageConfiguration imageConfig,
boolean keepContainer,
boolean removeVolumes)
throws DockerAccessException, ExecException {
ContainerTracker.ContainerShutdownDescriptor... | java | public void stopContainer(String containerId,
ImageConfiguration imageConfig,
boolean keepContainer,
boolean removeVolumes)
throws DockerAccessException, ExecException {
ContainerTracker.ContainerShutdownDescriptor... | [
"public",
"void",
"stopContainer",
"(",
"String",
"containerId",
",",
"ImageConfiguration",
"imageConfig",
",",
"boolean",
"keepContainer",
",",
"boolean",
"removeVolumes",
")",
"throws",
"DockerAccessException",
",",
"ExecException",
"{",
"ContainerTracker",
".",
"Cont... | Stop a container immediately by id.
@param containerId the container to stop
@param imageConfig image configuration for this container
@param keepContainer whether to keep container or to remove them after stoppings
@param removeVolumes whether to remove volumes after stopping | [
"Stop",
"a",
"container",
"immediately",
"by",
"id",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/RunService.java#L169-L177 |
28,179 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/RunService.java | RunService.stopPreviouslyStartedContainer | public void stopPreviouslyStartedContainer(String containerId,
boolean keepContainer,
boolean removeVolumes)
throws DockerAccessException, ExecException {
ContainerTracker.ContainerShutdownDescriptor descriptor... | java | public void stopPreviouslyStartedContainer(String containerId,
boolean keepContainer,
boolean removeVolumes)
throws DockerAccessException, ExecException {
ContainerTracker.ContainerShutdownDescriptor descriptor... | [
"public",
"void",
"stopPreviouslyStartedContainer",
"(",
"String",
"containerId",
",",
"boolean",
"keepContainer",
",",
"boolean",
"removeVolumes",
")",
"throws",
"DockerAccessException",
",",
"ExecException",
"{",
"ContainerTracker",
".",
"ContainerShutdownDescriptor",
"de... | Lookup up whether a certain has been already started and registered. If so, stop it
@param containerId the container to stop
@param keepContainer whether to keep container or to remove them after stoppings
@param removeVolumes whether to remove volumes after stopping
@throws DockerAccessException | [
"Lookup",
"up",
"whether",
"a",
"certain",
"has",
"been",
"already",
"started",
"and",
"registered",
".",
"If",
"so",
"stop",
"it"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/RunService.java#L188-L196 |
28,180 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/RunService.java | RunService.stopStartedContainers | public void stopStartedContainers(boolean keepContainer,
boolean removeVolumes,
boolean removeCustomNetworks,
GavLabel gavLabel)
throws DockerAccessException, ExecException {
Set<Network> ne... | java | public void stopStartedContainers(boolean keepContainer,
boolean removeVolumes,
boolean removeCustomNetworks,
GavLabel gavLabel)
throws DockerAccessException, ExecException {
Set<Network> ne... | [
"public",
"void",
"stopStartedContainers",
"(",
"boolean",
"keepContainer",
",",
"boolean",
"removeVolumes",
",",
"boolean",
"removeCustomNetworks",
",",
"GavLabel",
"gavLabel",
")",
"throws",
"DockerAccessException",
",",
"ExecException",
"{",
"Set",
"<",
"Network",
... | Stop all registered container
@param keepContainer whether to keep container or to remove them after stopping
@param removeVolumes whether to remove volumes after stopping
@throws DockerAccessException if during stopping of a container sth fails | [
"Stop",
"all",
"registered",
"container"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/RunService.java#L204-L215 |
28,181 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/RunService.java | RunService.getImagesConfigsInOrder | public List<StartOrderResolver.Resolvable> getImagesConfigsInOrder(QueryService queryService, List<ImageConfiguration> images) {
return StartOrderResolver.resolve(queryService, convertToResolvables(images));
} | java | public List<StartOrderResolver.Resolvable> getImagesConfigsInOrder(QueryService queryService, List<ImageConfiguration> images) {
return StartOrderResolver.resolve(queryService, convertToResolvables(images));
} | [
"public",
"List",
"<",
"StartOrderResolver",
".",
"Resolvable",
">",
"getImagesConfigsInOrder",
"(",
"QueryService",
"queryService",
",",
"List",
"<",
"ImageConfiguration",
">",
"images",
")",
"{",
"return",
"StartOrderResolver",
".",
"resolve",
"(",
"queryService",
... | Get the proper order for images to start
@param images list of images for which the order should be created
@return list of images in the right startup order | [
"Get",
"the",
"proper",
"order",
"for",
"images",
"to",
"start"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/RunService.java#L239-L241 |
28,182 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/RunService.java | RunService.createPortMapping | public PortMapping createPortMapping(RunImageConfiguration runConfig, Properties properties) {
try {
return new PortMapping(runConfig.getPorts(), properties);
} catch (IllegalArgumentException exp) {
throw new IllegalArgumentException("Cannot parse port mapping", exp);
}
... | java | public PortMapping createPortMapping(RunImageConfiguration runConfig, Properties properties) {
try {
return new PortMapping(runConfig.getPorts(), properties);
} catch (IllegalArgumentException exp) {
throw new IllegalArgumentException("Cannot parse port mapping", exp);
}
... | [
"public",
"PortMapping",
"createPortMapping",
"(",
"RunImageConfiguration",
"runConfig",
",",
"Properties",
"properties",
")",
"{",
"try",
"{",
"return",
"new",
"PortMapping",
"(",
"runConfig",
".",
"getPorts",
"(",
")",
",",
"properties",
")",
";",
"}",
"catch"... | Create port mapping for a specific configuration as it can be used when creating containers
@param runConfig the cun configuration
@param properties properties to lookup variables
@return the portmapping | [
"Create",
"port",
"mapping",
"for",
"a",
"specific",
"configuration",
"as",
"it",
"can",
"be",
"used",
"when",
"creating",
"containers"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/RunService.java#L250-L256 |
28,183 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/RunService.java | RunService.addShutdownHookForStoppingContainers | public void addShutdownHookForStoppingContainers(final boolean keepContainer, final boolean removeVolumes, final boolean removeCustomNetworks) {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
try {
stopStartedContaine... | java | public void addShutdownHookForStoppingContainers(final boolean keepContainer, final boolean removeVolumes, final boolean removeCustomNetworks) {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
try {
stopStartedContaine... | [
"public",
"void",
"addShutdownHookForStoppingContainers",
"(",
"final",
"boolean",
"keepContainer",
",",
"final",
"boolean",
"removeVolumes",
",",
"final",
"boolean",
"removeCustomNetworks",
")",
"{",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"addShutdownHook",
"("... | Add a shutdown hook in order to stop all registered containers | [
"Add",
"a",
"shutdown",
"hook",
"in",
"order",
"to",
"stop",
"all",
"registered",
"containers"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/RunService.java#L261-L272 |
28,184 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/RunService.java | RunService.createVolumesAsPerVolumeBinds | public List<String> createVolumesAsPerVolumeBinds(ServiceHub hub, List<String> binds, List<VolumeConfiguration> volumes)
throws DockerAccessException {
Map<String, Integer> indexMap = new HashMap<>();
List<String> volumesCreated = new ArrayList<>();
for (int index = 0; index < volu... | java | public List<String> createVolumesAsPerVolumeBinds(ServiceHub hub, List<String> binds, List<VolumeConfiguration> volumes)
throws DockerAccessException {
Map<String, Integer> indexMap = new HashMap<>();
List<String> volumesCreated = new ArrayList<>();
for (int index = 0; index < volu... | [
"public",
"List",
"<",
"String",
">",
"createVolumesAsPerVolumeBinds",
"(",
"ServiceHub",
"hub",
",",
"List",
"<",
"String",
">",
"binds",
",",
"List",
"<",
"VolumeConfiguration",
">",
"volumes",
")",
"throws",
"DockerAccessException",
"{",
"Map",
"<",
"String",... | Creates a Volume if a volume is referred to during startup in bind mount mapping and
a VolumeConfiguration exists
@param hub Service hub
@param binds volume binds present in ImageConfiguration
@param volumes VolumeConfigs present
@return List of volumes created
@throws DockerAccessException | [
"Creates",
"a",
"Volume",
"if",
"a",
"volume",
"is",
"referred",
"to",
"during",
"startup",
"in",
"bind",
"mount",
"mapping",
"and",
"a",
"VolumeConfiguration",
"exists"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/RunService.java#L558-L581 |
28,185 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/access/util/LocalSocketUtil.java | LocalSocketUtil.canConnectUnixSocket | public static boolean canConnectUnixSocket(File path) {
try (UnixSocketChannel channel = UnixSocketChannel.open()) {
return channel.connect(new UnixSocketAddress(path));
} catch (IOException e) {
return false;
}
} | java | public static boolean canConnectUnixSocket(File path) {
try (UnixSocketChannel channel = UnixSocketChannel.open()) {
return channel.connect(new UnixSocketAddress(path));
} catch (IOException e) {
return false;
}
} | [
"public",
"static",
"boolean",
"canConnectUnixSocket",
"(",
"File",
"path",
")",
"{",
"try",
"(",
"UnixSocketChannel",
"channel",
"=",
"UnixSocketChannel",
".",
"open",
"(",
")",
")",
"{",
"return",
"channel",
".",
"connect",
"(",
"new",
"UnixSocketAddress",
"... | Check whether we can connect to a local Unix socket | [
"Check",
"whether",
"we",
"can",
"connect",
"to",
"a",
"local",
"Unix",
"socket"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/access/util/LocalSocketUtil.java#L37-L43 |
28,186 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/access/ecr/AwsSigner4Request.java | AwsSigner4Request.getOrderedHeadersToSign | private static Map<String, String> getOrderedHeadersToSign(Header[] headers) {
Map<String, String> unique = new TreeMap<>();
for (Header header : headers) {
String key = header.getName().toLowerCase(Locale.US).trim();
if (key.equals("connection")) {
// do not sign... | java | private static Map<String, String> getOrderedHeadersToSign(Header[] headers) {
Map<String, String> unique = new TreeMap<>();
for (Header header : headers) {
String key = header.getName().toLowerCase(Locale.US).trim();
if (key.equals("connection")) {
// do not sign... | [
"private",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"getOrderedHeadersToSign",
"(",
"Header",
"[",
"]",
"headers",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"unique",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"for",
"(",
"Header"... | Get the ordered map of headers to sign.
@param headers the possible headers to sign
@return A <String, StringBuilder> map of headers to sign. Key is the name of the
header, Value is the comma separated values with minimized space | [
"Get",
"the",
"ordered",
"map",
"of",
"headers",
"to",
"sign",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/access/ecr/AwsSigner4Request.java#L157-L184 |
28,187 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/access/ecr/AwsSigner4Request.java | AwsSigner4Request.canonicalHeaders | private static String canonicalHeaders(Map<String, String> headers) {
StringBuilder canonical = new StringBuilder();
for (Map.Entry<String, String> header : headers.entrySet()) {
canonical.append(header.getKey()).append(':').append(header.getValue()).append('\n');
}
return ca... | java | private static String canonicalHeaders(Map<String, String> headers) {
StringBuilder canonical = new StringBuilder();
for (Map.Entry<String, String> header : headers.entrySet()) {
canonical.append(header.getKey()).append(':').append(header.getValue()).append('\n');
}
return ca... | [
"private",
"static",
"String",
"canonicalHeaders",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"StringBuilder",
"canonical",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
... | Create canonical header set. The headers are ordered by name.
@param headers The set of headers to sign
@return The signing value from headers. Headers are separated with newline. Each header is
formatted name:value with each header value whitespace trimmed and minimized | [
"Create",
"canonical",
"header",
"set",
".",
"The",
"headers",
"are",
"ordered",
"by",
"name",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/access/ecr/AwsSigner4Request.java#L193-L199 |
28,188 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/access/PortMapping.java | PortMapping.updateProperties | public void updateProperties(Map<String, Container.PortBinding> dockerObtainedDynamicBindings) {
for (Map.Entry<String, Container.PortBinding> entry : dockerObtainedDynamicBindings.entrySet()) {
String variable = entry.getKey();
Container.PortBinding portBinding = entry.getValue();
... | java | public void updateProperties(Map<String, Container.PortBinding> dockerObtainedDynamicBindings) {
for (Map.Entry<String, Container.PortBinding> entry : dockerObtainedDynamicBindings.entrySet()) {
String variable = entry.getKey();
Container.PortBinding portBinding = entry.getValue();
... | [
"public",
"void",
"updateProperties",
"(",
"Map",
"<",
"String",
",",
"Container",
".",
"PortBinding",
">",
"dockerObtainedDynamicBindings",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Container",
".",
"PortBinding",
">",
"entry",
":",
"d... | Update variable-to-port mappings with dynamically obtained ports and host ips.
This should only be called once after this dynamically allocated parts has been be obtained.
@param dockerObtainedDynamicBindings keys are the container ports, values are the dynamically mapped host ports and host ips. | [
"Update",
"variable",
"-",
"to",
"-",
"port",
"mappings",
"with",
"dynamically",
"obtained",
"ports",
"and",
"host",
"ips",
".",
"This",
"should",
"only",
"be",
"called",
"once",
"after",
"this",
"dynamically",
"allocated",
"parts",
"has",
"been",
"be",
"obt... | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/access/PortMapping.java#L104-L125 |
28,189 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/access/PortMapping.java | PortMapping.toDockerPortBindingsJson | JsonObject toDockerPortBindingsJson() {
Map<String, Integer> portMap = getContainerPortToHostPortMap();
if (!portMap.isEmpty()) {
JsonObject portBindings = new JsonObject();
Map<String, String> bindToMap = getBindToHostMap();
for (Map.Entry<String, Integer> entry : p... | java | JsonObject toDockerPortBindingsJson() {
Map<String, Integer> portMap = getContainerPortToHostPortMap();
if (!portMap.isEmpty()) {
JsonObject portBindings = new JsonObject();
Map<String, String> bindToMap = getBindToHostMap();
for (Map.Entry<String, Integer> entry : p... | [
"JsonObject",
"toDockerPortBindingsJson",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"portMap",
"=",
"getContainerPortToHostPortMap",
"(",
")",
";",
"if",
"(",
"!",
"portMap",
".",
"isEmpty",
"(",
")",
")",
"{",
"JsonObject",
"portBindings",
"... | Create a JSON specification which can be used to in a Docker API request as the 'PortBindings' part
for creating container.
@return 'PortBindings' object or null if no port mappings are used. | [
"Create",
"a",
"JSON",
"specification",
"which",
"can",
"be",
"used",
"to",
"in",
"a",
"Docker",
"API",
"request",
"as",
"the",
"PortBindings",
"part",
"for",
"creating",
"container",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/access/PortMapping.java#L133-L159 |
28,190 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/access/PortMapping.java | PortMapping.toJson | public JsonArray toJson() {
Map<String, Integer> portMap = getContainerPortToHostPortMap();
if (portMap.isEmpty()) {
return null;
}
JsonArray ret = new JsonArray();
Map<String, String> bindToMap = getBindToHostMap();
for (Map.Entry<String, Integer> entry : p... | java | public JsonArray toJson() {
Map<String, Integer> portMap = getContainerPortToHostPortMap();
if (portMap.isEmpty()) {
return null;
}
JsonArray ret = new JsonArray();
Map<String, String> bindToMap = getBindToHostMap();
for (Map.Entry<String, Integer> entry : p... | [
"public",
"JsonArray",
"toJson",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"portMap",
"=",
"getContainerPortToHostPortMap",
"(",
")",
";",
"if",
"(",
"portMap",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"JsonArray",
... | Return the content of the mapping as an array with all specifications as given
@return port mappings as JSON array or null if no mappings exist | [
"Return",
"the",
"content",
"of",
"the",
"mapping",
"as",
"an",
"array",
"with",
"all",
"specifications",
"as",
"given"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/access/PortMapping.java#L166-L203 |
28,191 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/access/PortMapping.java | PortMapping.getPortFromProjectOrSystemProperty | private Integer getPortFromProjectOrSystemProperty(String var) {
String sysProp = System.getProperty(var);
if (sysProp != null) {
return getAsIntOrNull(sysProp);
}
if (projProperties.containsKey(var)) {
return getAsIntOrNull(projProperties.getProperty(var));
... | java | private Integer getPortFromProjectOrSystemProperty(String var) {
String sysProp = System.getProperty(var);
if (sysProp != null) {
return getAsIntOrNull(sysProp);
}
if (projProperties.containsKey(var)) {
return getAsIntOrNull(projProperties.getProperty(var));
... | [
"private",
"Integer",
"getPortFromProjectOrSystemProperty",
"(",
"String",
"var",
")",
"{",
"String",
"sysProp",
"=",
"System",
".",
"getProperty",
"(",
"var",
")",
";",
"if",
"(",
"sysProp",
"!=",
"null",
")",
"{",
"return",
"getAsIntOrNull",
"(",
"sysProp",
... | First check system properties, then the variables given | [
"First",
"check",
"system",
"properties",
"then",
"the",
"variables",
"given"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/access/PortMapping.java#L262-L271 |
28,192 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/assembly/MappingTrackArchiver.java | MappingTrackArchiver.getAssemblyFiles | public AssemblyFiles getAssemblyFiles(MavenSession session) {
AssemblyFiles ret = new AssemblyFiles(new File(getDestFile().getParentFile(), assemblyName));
// Where the 'real' files are copied to
for (Addition addition : added) {
Object resource = addition.resource;
File ... | java | public AssemblyFiles getAssemblyFiles(MavenSession session) {
AssemblyFiles ret = new AssemblyFiles(new File(getDestFile().getParentFile(), assemblyName));
// Where the 'real' files are copied to
for (Addition addition : added) {
Object resource = addition.resource;
File ... | [
"public",
"AssemblyFiles",
"getAssemblyFiles",
"(",
"MavenSession",
"session",
")",
"{",
"AssemblyFiles",
"ret",
"=",
"new",
"AssemblyFiles",
"(",
"new",
"File",
"(",
"getDestFile",
"(",
")",
".",
"getParentFile",
"(",
")",
",",
"assemblyName",
")",
")",
";",
... | Get all files depicted by this assembly.
@return assembled files | [
"Get",
"all",
"files",
"depicted",
"by",
"this",
"assembly",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/MappingTrackArchiver.java#L59-L88 |
28,193 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/assembly/MappingTrackArchiver.java | MappingTrackArchiver.getArtifactFromJar | private Artifact getArtifactFromJar(File jar) {
// Lets figure the real mvn source of file.
String type = extractFileType(jar);
if (type != null) {
try {
ArrayList<Properties> options = new ArrayList<Properties>();
try (ZipInputStream in = new ZipInput... | java | private Artifact getArtifactFromJar(File jar) {
// Lets figure the real mvn source of file.
String type = extractFileType(jar);
if (type != null) {
try {
ArrayList<Properties> options = new ArrayList<Properties>();
try (ZipInputStream in = new ZipInput... | [
"private",
"Artifact",
"getArtifactFromJar",
"(",
"File",
"jar",
")",
"{",
"// Lets figure the real mvn source of file.",
"String",
"type",
"=",
"extractFileType",
"(",
"jar",
")",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"try",
"{",
"ArrayList",
"<",
"... | look into a jar file and check for pom.properties. The first pom.properties found are returned. | [
"look",
"into",
"a",
"jar",
"file",
"and",
"check",
"for",
"pom",
".",
"properties",
".",
"The",
"first",
"pom",
".",
"properties",
"found",
"are",
"returned",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/MappingTrackArchiver.java#L127-L160 |
28,194 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/access/hc/DockerAccessWithHcClient.java | DockerAccessWithHcClient.logRemoveResponse | private void logRemoveResponse(JsonArray logElements) {
for (int i = 0; i < logElements.size(); i++) {
JsonObject entry = logElements.get(i).getAsJsonObject();
for (Object key : entry.keySet()) {
log.debug("%s: %s", key, entry.get(key.toString()));
}
}... | java | private void logRemoveResponse(JsonArray logElements) {
for (int i = 0; i < logElements.size(); i++) {
JsonObject entry = logElements.get(i).getAsJsonObject();
for (Object key : entry.keySet()) {
log.debug("%s: %s", key, entry.get(key.toString()));
}
}... | [
"private",
"void",
"logRemoveResponse",
"(",
"JsonArray",
"logElements",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"logElements",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"JsonObject",
"entry",
"=",
"logElements",
".",
"get",
... | Callback for processing response chunks | [
"Callback",
"for",
"processing",
"response",
"chunks"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/access/hc/DockerAccessWithHcClient.java#L703-L710 |
28,195 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/AuthConfigFactory.java | AuthConfigFactory.extendedAuthentication | private AuthConfig extendedAuthentication(AuthConfig standardAuthConfig, String registry) throws IOException, MojoExecutionException {
EcrExtendedAuth ecr = new EcrExtendedAuth(log, registry);
if (ecr.isAwsRegistry()) {
return ecr.extendedAuth(standardAuthConfig);
}
return st... | java | private AuthConfig extendedAuthentication(AuthConfig standardAuthConfig, String registry) throws IOException, MojoExecutionException {
EcrExtendedAuth ecr = new EcrExtendedAuth(log, registry);
if (ecr.isAwsRegistry()) {
return ecr.extendedAuth(standardAuthConfig);
}
return st... | [
"private",
"AuthConfig",
"extendedAuthentication",
"(",
"AuthConfig",
"standardAuthConfig",
",",
"String",
"registry",
")",
"throws",
"IOException",
",",
"MojoExecutionException",
"{",
"EcrExtendedAuth",
"ecr",
"=",
"new",
"EcrExtendedAuth",
"(",
"log",
",",
"registry",... | Try various extended authentication method. Currently only supports amazon ECR
@param standardAuthConfig The locally stored credentials.
@param registry The registry to authenticated against.
@return The given credentials, if registry does not need extended authentication;
else, the credentials after authentication.
... | [
"Try",
"various",
"extended",
"authentication",
"method",
".",
"Currently",
"only",
"supports",
"amazon",
"ECR"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/AuthConfigFactory.java#L157-L163 |
28,196 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/AuthConfigFactory.java | AuthConfigFactory.parseOpenShiftConfig | private AuthConfig parseOpenShiftConfig() {
Map kubeConfig = DockerFileUtil.readKubeConfig();
if (kubeConfig == null) {
return null;
}
String currentContextName = (String) kubeConfig.get("current-context");
if (currentContextName == null) {
return null;
... | java | private AuthConfig parseOpenShiftConfig() {
Map kubeConfig = DockerFileUtil.readKubeConfig();
if (kubeConfig == null) {
return null;
}
String currentContextName = (String) kubeConfig.get("current-context");
if (currentContextName == null) {
return null;
... | [
"private",
"AuthConfig",
"parseOpenShiftConfig",
"(",
")",
"{",
"Map",
"kubeConfig",
"=",
"DockerFileUtil",
".",
"readKubeConfig",
"(",
")",
";",
"if",
"(",
"kubeConfig",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"currentContextName",
"=",
... | Parse OpenShift config to get credentials, but return null if not found | [
"Parse",
"OpenShift",
"config",
"to",
"get",
"credentials",
"but",
"return",
"null",
"if",
"not",
"found"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/AuthConfigFactory.java#L458-L476 |
28,197 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/QueryService.java | QueryService.getMandatoryContainer | public Container getMandatoryContainer(String containerIdOrName) throws DockerAccessException {
Container container = getContainer(containerIdOrName);
if (container == null) {
throw new DockerAccessException("Cannot find container %s", containerIdOrName);
}
return container;
... | java | public Container getMandatoryContainer(String containerIdOrName) throws DockerAccessException {
Container container = getContainer(containerIdOrName);
if (container == null) {
throw new DockerAccessException("Cannot find container %s", containerIdOrName);
}
return container;
... | [
"public",
"Container",
"getMandatoryContainer",
"(",
"String",
"containerIdOrName",
")",
"throws",
"DockerAccessException",
"{",
"Container",
"container",
"=",
"getContainer",
"(",
"containerIdOrName",
")",
";",
"if",
"(",
"container",
"==",
"null",
")",
"{",
"throw... | Get container by id
@param containerIdOrName container id or name
@return container found
@throws DockerAccessException if an error occurs or no container with this id or name exists | [
"Get",
"container",
"by",
"id"
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/QueryService.java#L36-L42 |
28,198 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/QueryService.java | QueryService.getNetworkByName | public Network getNetworkByName(final String networkName) throws DockerAccessException {
for (Network el : docker.listNetworks()) {
if (networkName.equals(el.getName())) {
return el;
}
}
return null;
} | java | public Network getNetworkByName(final String networkName) throws DockerAccessException {
for (Network el : docker.listNetworks()) {
if (networkName.equals(el.getName())) {
return el;
}
}
return null;
} | [
"public",
"Network",
"getNetworkByName",
"(",
"final",
"String",
"networkName",
")",
"throws",
"DockerAccessException",
"{",
"for",
"(",
"Network",
"el",
":",
"docker",
".",
"listNetworks",
"(",
")",
")",
"{",
"if",
"(",
"networkName",
".",
"equals",
"(",
"e... | Get a network for a given network name.
@param networkName name of network to lookup
@return the network found or <code>null</code> if no network is available.
@throws DockerAccessException in case of an remote error | [
"Get",
"a",
"network",
"for",
"a",
"given",
"network",
"name",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/QueryService.java#L60-L67 |
28,199 | fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/QueryService.java | QueryService.getContainersForImage | public List<Container> getContainersForImage(final String image, final boolean all) throws DockerAccessException {
return docker.getContainersForImage(image, all);
} | java | public List<Container> getContainersForImage(final String image, final boolean all) throws DockerAccessException {
return docker.getContainersForImage(image, all);
} | [
"public",
"List",
"<",
"Container",
">",
"getContainersForImage",
"(",
"final",
"String",
"image",
",",
"final",
"boolean",
"all",
")",
"throws",
"DockerAccessException",
"{",
"return",
"docker",
".",
"getContainersForImage",
"(",
"image",
",",
"all",
")",
";",
... | Get all containers which are build from an image. By default only the last containers are considered but this
can be tuned with a global parameters.
@param image for which its container are looked up
@param all whether to fetch all containers
@return list of <code>Container</code> objects
@throws DockerAccessException... | [
"Get",
"all",
"containers",
"which",
"are",
"build",
"from",
"an",
"image",
".",
"By",
"default",
"only",
"the",
"last",
"containers",
"are",
"considered",
"but",
"this",
"can",
"be",
"tuned",
"with",
"a",
"global",
"parameters",
"."
] | 70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3 | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/QueryService.java#L98-L100 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.