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
47,300
hawkular/hawkular-commons
hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java
MessageProcessor.sendAndListen
public <T extends BasicMessage> RPCConnectionContext sendAndListen(ProducerConnectionContext context, BasicMessage basicMessage, BasicMessageListener<T> responseListener, Map<String, String> headers) throws JMSException { if (context == null) { throw new IllegalArgum...
java
public <T extends BasicMessage> RPCConnectionContext sendAndListen(ProducerConnectionContext context, BasicMessage basicMessage, BasicMessageListener<T> responseListener, Map<String, String> headers) throws JMSException { if (context == null) { throw new IllegalArgum...
[ "public", "<", "T", "extends", "BasicMessage", ">", "RPCConnectionContext", "sendAndListen", "(", "ProducerConnectionContext", "context", ",", "BasicMessage", "basicMessage", ",", "BasicMessageListener", "<", "T", ">", "responseListener", ",", "Map", "<", "String", ",...
Send the given message to its destinations across the message bus and any response sent back will be passed to the given listener. Use this for request-response messages where you expect to get a non-void response back. The response listener should close its associated consumer since typically there is only a single r...
[ "Send", "the", "given", "message", "to", "its", "destinations", "across", "the", "message", "bus", "and", "any", "response", "sent", "back", "will", "be", "passed", "to", "the", "given", "listener", ".", "Use", "this", "for", "request", "-", "response", "m...
e4a832862b3446d7f4d629bb05790f2df578e035
https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java#L278-L339
47,301
hawkular/hawkular-commons
hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java
WebSocketHelper.sendBasicMessageAsync
public void sendBasicMessageAsync(Session session, BasicMessage msg) { String text = ApiDeserializer.toHawkularFormat(msg); sendTextAsync(session, text); }
java
public void sendBasicMessageAsync(Session session, BasicMessage msg) { String text = ApiDeserializer.toHawkularFormat(msg); sendTextAsync(session, text); }
[ "public", "void", "sendBasicMessageAsync", "(", "Session", "session", ",", "BasicMessage", "msg", ")", "{", "String", "text", "=", "ApiDeserializer", ".", "toHawkularFormat", "(", "msg", ")", ";", "sendTextAsync", "(", "session", ",", "text", ")", ";", "}" ]
Converts the given message to JSON and sends that JSON text to clients asynchronously. @param session the client session where the JSON message will be sent @param msg the message to be converted to JSON and sent
[ "Converts", "the", "given", "message", "to", "JSON", "and", "sends", "that", "JSON", "text", "to", "clients", "asynchronously", "." ]
e4a832862b3446d7f4d629bb05790f2df578e035
https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java#L80-L83
47,302
hawkular/hawkular-commons
hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java
WebSocketHelper.sendBinaryAsync
public void sendBinaryAsync(Session session, InputStream inputStream, ExecutorService threadPool) { if (session == null) { return; } if (inputStream == null) { throw new IllegalArgumentException("inputStream must not be null"); } log.debugf("Attempting t...
java
public void sendBinaryAsync(Session session, InputStream inputStream, ExecutorService threadPool) { if (session == null) { return; } if (inputStream == null) { throw new IllegalArgumentException("inputStream must not be null"); } log.debugf("Attempting t...
[ "public", "void", "sendBinaryAsync", "(", "Session", "session", ",", "InputStream", "inputStream", ",", "ExecutorService", "threadPool", ")", "{", "if", "(", "session", "==", "null", ")", "{", "return", ";", "}", "if", "(", "inputStream", "==", "null", ")", ...
Sends binary data to a client asynchronously. @param session the client session where the message will be sent @param inputStream the binary data to send @param threadPool where the job will be submitted so it can execute asynchronously
[ "Sends", "binary", "data", "to", "a", "client", "asynchronously", "." ]
e4a832862b3446d7f4d629bb05790f2df578e035
https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java#L113-L134
47,303
hawkular/hawkular-commons
hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java
WebSocketHelper.sendBinarySync
public void sendBinarySync(Session session, InputStream inputStream) throws IOException { if (session == null) { return; } if (inputStream == null) { throw new IllegalArgumentException("inputStream must not be null"); } log.debugf("Attempting to send bin...
java
public void sendBinarySync(Session session, InputStream inputStream) throws IOException { if (session == null) { return; } if (inputStream == null) { throw new IllegalArgumentException("inputStream must not be null"); } log.debugf("Attempting to send bin...
[ "public", "void", "sendBinarySync", "(", "Session", "session", ",", "InputStream", "inputStream", ")", "throws", "IOException", "{", "if", "(", "session", "==", "null", ")", "{", "return", ";", "}", "if", "(", "inputStream", "==", "null", ")", "{", "throw"...
Sends binary data to a client synchronously. @param session the client where the message will be sent @param inputStream the binary data to send @throws IOException if a problem occurred during delivery of the data to a session.
[ "Sends", "binary", "data", "to", "a", "client", "synchronously", "." ]
e4a832862b3446d7f4d629bb05790f2df578e035
https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java#L143-L160
47,304
hawkular/hawkular-commons
hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/UIClientWebSocket.java
UIClientWebSocket.uiClientSessionOpen
@OnOpen public void uiClientSessionOpen(Session session) { log.infoWsSessionOpened(session.getId(), endpoint); wsEndpoints.getUiClientSessions().addSession(session.getId(), session); WelcomeResponse welcomeResponse = new WelcomeResponse(); // FIXME we should not send the true session...
java
@OnOpen public void uiClientSessionOpen(Session session) { log.infoWsSessionOpened(session.getId(), endpoint); wsEndpoints.getUiClientSessions().addSession(session.getId(), session); WelcomeResponse welcomeResponse = new WelcomeResponse(); // FIXME we should not send the true session...
[ "@", "OnOpen", "public", "void", "uiClientSessionOpen", "(", "Session", "session", ")", "{", "log", ".", "infoWsSessionOpened", "(", "session", ".", "getId", "(", ")", ",", "endpoint", ")", ";", "wsEndpoints", ".", "getUiClientSessions", "(", ")", ".", "addS...
When a UI client connects, this method is called. This will immediately send a welcome message to the UI client. @param session the new UI client's session
[ "When", "a", "UI", "client", "connects", "this", "method", "is", "called", ".", "This", "will", "immediately", "send", "a", "welcome", "message", "to", "the", "UI", "client", "." ]
e4a832862b3446d7f4d629bb05790f2df578e035
https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/UIClientWebSocket.java#L53-L66
47,305
bsblabs/embed-for-vaadin
com.bsb.common.vaadin.embed/src/main/java/com/bsb/common/vaadin/embed/AbstractEmbedVaadinTomcat.java
AbstractEmbedVaadinTomcat.doStart
private void doStart() throws LifecycleException { tomcat.getServer().addLifecycleListener(new TomcatLifecycleListener()); logger.info("Deploying application to [" + getConfig().getDeployUrl() + "]"); tomcat.start(); // Let's set the port that was used to actually start the application ...
java
private void doStart() throws LifecycleException { tomcat.getServer().addLifecycleListener(new TomcatLifecycleListener()); logger.info("Deploying application to [" + getConfig().getDeployUrl() + "]"); tomcat.start(); // Let's set the port that was used to actually start the application ...
[ "private", "void", "doStart", "(", ")", "throws", "LifecycleException", "{", "tomcat", ".", "getServer", "(", ")", ".", "addLifecycleListener", "(", "new", "TomcatLifecycleListener", "(", ")", ")", ";", "logger", ".", "info", "(", "\"Deploying application to [\"",...
Fires the embedded tomcat that is assumed to be fully configured. @throws LifecycleException if tomcat failed to start
[ "Fires", "the", "embedded", "tomcat", "that", "is", "assumed", "to", "be", "fully", "configured", "." ]
f902e70def56ab54d287d2600f9c6eef9e66c225
https://github.com/bsblabs/embed-for-vaadin/blob/f902e70def56ab54d287d2600f9c6eef9e66c225/com.bsb.common.vaadin.embed/src/main/java/com/bsb/common/vaadin/embed/AbstractEmbedVaadinTomcat.java#L173-L190
47,306
bsblabs/embed-for-vaadin
com.bsb.common.vaadin.embed/src/main/java/com/bsb/common/vaadin/embed/AbstractEmbedVaadinTomcat.java
AbstractEmbedVaadinTomcat.doStop
private void doStop() throws LifecycleException { logger.info("Stopping tomcat."); long startTime = System.currentTimeMillis(); tomcat.stop(); long duration = System.currentTimeMillis() - startTime; logger.info("Tomcat shutdown finished in " + duration + " ms."); }
java
private void doStop() throws LifecycleException { logger.info("Stopping tomcat."); long startTime = System.currentTimeMillis(); tomcat.stop(); long duration = System.currentTimeMillis() - startTime; logger.info("Tomcat shutdown finished in " + duration + " ms."); }
[ "private", "void", "doStop", "(", ")", "throws", "LifecycleException", "{", "logger", ".", "info", "(", "\"Stopping tomcat.\"", ")", ";", "long", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "tomcat", ".", "stop", "(", ")", ";", "lo...
Stops the embedded tomcat. @throws LifecycleException if tomcat failed to stop
[ "Stops", "the", "embedded", "tomcat", "." ]
f902e70def56ab54d287d2600f9c6eef9e66c225
https://github.com/bsblabs/embed-for-vaadin/blob/f902e70def56ab54d287d2600f9c6eef9e66c225/com.bsb.common.vaadin.embed/src/main/java/com/bsb/common/vaadin/embed/AbstractEmbedVaadinTomcat.java#L197-L203
47,307
CubeEngine/LogScribe
core/src/main/java/org/cubeengine/logscribe/Log.java
Log.addDelegate
public LogTarget addDelegate(Log log) { LogProxyTarget logProxyTarget = new LogProxyTarget(log); this.addTarget(logProxyTarget); return logProxyTarget; }
java
public LogTarget addDelegate(Log log) { LogProxyTarget logProxyTarget = new LogProxyTarget(log); this.addTarget(logProxyTarget); return logProxyTarget; }
[ "public", "LogTarget", "addDelegate", "(", "Log", "log", ")", "{", "LogProxyTarget", "logProxyTarget", "=", "new", "LogProxyTarget", "(", "log", ")", ";", "this", ".", "addTarget", "(", "logProxyTarget", ")", ";", "return", "logProxyTarget", ";", "}" ]
Adds a ProxyTarget for an other Logger @param log the logger to delegate to @return the created LogTarget
[ "Adds", "a", "ProxyTarget", "for", "an", "other", "Logger" ]
c3a449b82677d1d70c3efe77b68fdaaaf7525295
https://github.com/CubeEngine/LogScribe/blob/c3a449b82677d1d70c3efe77b68fdaaaf7525295/core/src/main/java/org/cubeengine/logscribe/Log.java#L103-L108
47,308
jbundle/webapp
base/src/main/java/org/jbundle/util/webapp/base/ResourceHttpServiceTracker.java
ResourceHttpServiceTracker.addingService
public Object addingService(ServiceReference reference) { HttpService httpService = (HttpService) context.getService(reference); String alias = this.getAlias(); String name = this.getProperty(RESOURCE_NAME); if (name == null) name = alias; try { httpS...
java
public Object addingService(ServiceReference reference) { HttpService httpService = (HttpService) context.getService(reference); String alias = this.getAlias(); String name = this.getProperty(RESOURCE_NAME); if (name == null) name = alias; try { httpS...
[ "public", "Object", "addingService", "(", "ServiceReference", "reference", ")", "{", "HttpService", "httpService", "=", "(", "HttpService", ")", "context", ".", "getService", "(", "reference", ")", ";", "String", "alias", "=", "this", ".", "getAlias", "(", ")"...
Http Service is up, add my resource.
[ "Http", "Service", "is", "up", "add", "my", "resource", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/ResourceHttpServiceTracker.java#L31-L46
47,309
fuinorg/utils4j
src/main/java/org/fuin/utils4j/filter/RegExprFilter.java
RegExprFilter.setTypeName
public final void setTypeName(final String typeName) { if (typeName == null) { type = LOOKING_AT; } else if (typeName.equalsIgnoreCase(TYPES[0])) { type = MATCHES; } else if (typeName.equalsIgnoreCase(TYPES[1])) { type = LOOKING_AT; } else if (t...
java
public final void setTypeName(final String typeName) { if (typeName == null) { type = LOOKING_AT; } else if (typeName.equalsIgnoreCase(TYPES[0])) { type = MATCHES; } else if (typeName.equalsIgnoreCase(TYPES[1])) { type = LOOKING_AT; } else if (t...
[ "public", "final", "void", "setTypeName", "(", "final", "String", "typeName", ")", "{", "if", "(", "typeName", "==", "null", ")", "{", "type", "=", "LOOKING_AT", ";", "}", "else", "if", "(", "typeName", ".", "equalsIgnoreCase", "(", "TYPES", "[", "0", ...
Sets the type name of the matching. @param typeName Type name ("matches", "lookingAt" or "find") or NULL (="lookingAt")
[ "Sets", "the", "type", "name", "of", "the", "matching", "." ]
71cf88e0a8d8ed67bbac513bf3cab165cd7e3280
https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/filter/RegExprFilter.java#L131-L141
47,310
dbracewell/mango
src/main/java/com/davidbracewell/reflection/Reflect.java
Reflect.onObject
public static Reflect onObject(Object object) { if (object == null) { return new Reflect(null, null); } return new Reflect(object, object.getClass()); }
java
public static Reflect onObject(Object object) { if (object == null) { return new Reflect(null, null); } return new Reflect(object, object.getClass()); }
[ "public", "static", "Reflect", "onObject", "(", "Object", "object", ")", "{", "if", "(", "object", "==", "null", ")", "{", "return", "new", "Reflect", "(", "null", ",", "null", ")", ";", "}", "return", "new", "Reflect", "(", "object", ",", "object", ...
Creates an instance of Reflect associated with an object @param object The object for reflection @return The Reflect object
[ "Creates", "an", "instance", "of", "Reflect", "associated", "with", "an", "object" ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L66-L71
47,311
dbracewell/mango
src/main/java/com/davidbracewell/reflection/Reflect.java
Reflect.onClass
public static Reflect onClass(String clazz) throws Exception { return new Reflect(null, ReflectionUtils.getClassForName(clazz)); }
java
public static Reflect onClass(String clazz) throws Exception { return new Reflect(null, ReflectionUtils.getClassForName(clazz)); }
[ "public", "static", "Reflect", "onClass", "(", "String", "clazz", ")", "throws", "Exception", "{", "return", "new", "Reflect", "(", "null", ",", "ReflectionUtils", ".", "getClassForName", "(", "clazz", ")", ")", ";", "}" ]
Creates an instance of Reflect associated with a class @param clazz The class for reflection as string @return The Reflect object @throws Exception the exception
[ "Creates", "an", "instance", "of", "Reflect", "associated", "with", "a", "class" ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L90-L92
47,312
dbracewell/mango
src/main/java/com/davidbracewell/reflection/Reflect.java
Reflect.containsField
public boolean containsField(String name) { if (StringUtils.isNullOrBlank(name)) { return false; } return ClassDescriptorCache.getInstance() .getClassDescriptor(clazz) .getFields(accessAll) .str...
java
public boolean containsField(String name) { if (StringUtils.isNullOrBlank(name)) { return false; } return ClassDescriptorCache.getInstance() .getClassDescriptor(clazz) .getFields(accessAll) .str...
[ "public", "boolean", "containsField", "(", "String", "name", ")", "{", "if", "(", "StringUtils", ".", "isNullOrBlank", "(", "name", ")", ")", "{", "return", "false", ";", "}", "return", "ClassDescriptorCache", ".", "getInstance", "(", ")", ".", "getClassDesc...
Determines if a field with the given name is associated with the class @param name The field name @return True if there is a field with the given name
[ "Determines", "if", "a", "field", "with", "the", "given", "name", "is", "associated", "with", "the", "class" ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L181-L190
47,313
dbracewell/mango
src/main/java/com/davidbracewell/reflection/Reflect.java
Reflect.create
public Reflect create() throws ReflectionException { try { return on(clazz.getConstructor(), accessAll); } catch (NoSuchMethodException e) { if (accessAll) { try { return on(clazz.getDeclaredConstructor(), accessAll); } catch (NoSuchMethodException e2...
java
public Reflect create() throws ReflectionException { try { return on(clazz.getConstructor(), accessAll); } catch (NoSuchMethodException e) { if (accessAll) { try { return on(clazz.getDeclaredConstructor(), accessAll); } catch (NoSuchMethodException e2...
[ "public", "Reflect", "create", "(", ")", "throws", "ReflectionException", "{", "try", "{", "return", "on", "(", "clazz", ".", "getConstructor", "(", ")", ",", "accessAll", ")", ";", "}", "catch", "(", "NoSuchMethodException", "e", ")", "{", "if", "(", "a...
Creates an instance of the class being reflected using the no-argument constructor. @return A <code>Reflect</code> object to do further reflection @throws ReflectionException Something went wrong constructing the object
[ "Creates", "an", "instance", "of", "the", "class", "being", "reflected", "using", "the", "no", "-", "argument", "constructor", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L227-L240
47,314
dbracewell/mango
src/main/java/com/davidbracewell/reflection/Reflect.java
Reflect.create
public Reflect create(Object... args) throws ReflectionException { return create(ReflectionUtils.getTypes(args), args); }
java
public Reflect create(Object... args) throws ReflectionException { return create(ReflectionUtils.getTypes(args), args); }
[ "public", "Reflect", "create", "(", "Object", "...", "args", ")", "throws", "ReflectionException", "{", "return", "create", "(", "ReflectionUtils", ".", "getTypes", "(", "args", ")", ",", "args", ")", ";", "}" ]
Creates an instance of the class being reflected using the most specific constructor available. @param args The arguments to the constructor. @return A <code>Reflect</code> object to do further reflection @throws ReflectionException Something went wrong constructing the object
[ "Creates", "an", "instance", "of", "the", "class", "being", "reflected", "using", "the", "most", "specific", "constructor", "available", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L249-L251
47,315
dbracewell/mango
src/main/java/com/davidbracewell/reflection/Reflect.java
Reflect.create
public Reflect create(Class[] types, Object... args) throws ReflectionException { try { return on(clazz.getConstructor(types), accessAll, args); } catch (NoSuchMethodException e) { for (Constructor constructor : getConstructors()) { if (ReflectionUtils.typesMatch(constructor.ge...
java
public Reflect create(Class[] types, Object... args) throws ReflectionException { try { return on(clazz.getConstructor(types), accessAll, args); } catch (NoSuchMethodException e) { for (Constructor constructor : getConstructors()) { if (ReflectionUtils.typesMatch(constructor.ge...
[ "public", "Reflect", "create", "(", "Class", "[", "]", "types", ",", "Object", "...", "args", ")", "throws", "ReflectionException", "{", "try", "{", "return", "on", "(", "clazz", ".", "getConstructor", "(", "types", ")", ",", "accessAll", ",", "args", ")...
Create reflect. @param types the types @param args the args @return the reflect @throws ReflectionException the reflection exception
[ "Create", "reflect", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L261-L272
47,316
dbracewell/mango
src/main/java/com/davidbracewell/reflection/Reflect.java
Reflect.getMethod
public Method getMethod(final String name) { if (StringUtils.isNullOrBlank(name)) { return null; } return getMethods().stream().filter(method -> method.getName().equals(name)).findFirst().orElse(null); }
java
public Method getMethod(final String name) { if (StringUtils.isNullOrBlank(name)) { return null; } return getMethods().stream().filter(method -> method.getName().equals(name)).findFirst().orElse(null); }
[ "public", "Method", "getMethod", "(", "final", "String", "name", ")", "{", "if", "(", "StringUtils", ".", "isNullOrBlank", "(", "name", ")", ")", "{", "return", "null", ";", "}", "return", "getMethods", "(", ")", ".", "stream", "(", ")", ".", "filter",...
Gets method. @param name the name @return the method
[ "Gets", "method", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L304-L309
47,317
dbracewell/mango
src/main/java/com/davidbracewell/reflection/Reflect.java
Reflect.containsMethod
public boolean containsMethod(final String name) { if (StringUtils.isNullOrBlank(name)) { return false; } return ClassDescriptorCache.getInstance() .getClassDescriptor(clazz) .getMethods(accessAll) ...
java
public boolean containsMethod(final String name) { if (StringUtils.isNullOrBlank(name)) { return false; } return ClassDescriptorCache.getInstance() .getClassDescriptor(clazz) .getMethods(accessAll) ...
[ "public", "boolean", "containsMethod", "(", "final", "String", "name", ")", "{", "if", "(", "StringUtils", ".", "isNullOrBlank", "(", "name", ")", ")", "{", "return", "false", ";", "}", "return", "ClassDescriptorCache", ".", "getInstance", "(", ")", ".", "...
Contains method. @param name the name @return the boolean
[ "Contains", "method", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L317-L326
47,318
dbracewell/mango
src/main/java/com/davidbracewell/reflection/Reflect.java
Reflect.invoke
public Reflect invoke(String methodName, Object... args) throws ReflectionException { Class[] types = ReflectionUtils.getTypes(args); try { return on(clazz.getMethod(methodName, types), object, accessAll, args); } catch (NoSuchMethodException e) { Method method = ReflectionUtils.best...
java
public Reflect invoke(String methodName, Object... args) throws ReflectionException { Class[] types = ReflectionUtils.getTypes(args); try { return on(clazz.getMethod(methodName, types), object, accessAll, args); } catch (NoSuchMethodException e) { Method method = ReflectionUtils.best...
[ "public", "Reflect", "invoke", "(", "String", "methodName", ",", "Object", "...", "args", ")", "throws", "ReflectionException", "{", "Class", "[", "]", "types", "=", "ReflectionUtils", ".", "getTypes", "(", "args", ")", ";", "try", "{", "return", "on", "("...
Invokes a method with a given name and arguments with the most specific method possible @param methodName The name of the method @param args The arguments to the method @return A Reflect object representing the results @throws ReflectionException Something went wrong invoking the method
[ "Invokes", "a", "method", "with", "a", "given", "name", "and", "arguments", "with", "the", "most", "specific", "method", "possible" ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L355-L367
47,319
dbracewell/mango
src/main/java/com/davidbracewell/reflection/Reflect.java
Reflect.set
public Reflect set(String fieldName, Object value) throws ReflectionException { Field field = null; boolean isAccessible = false; try { if (hasField(fieldName)) { field = getField(fieldName); isAccessible = field.isAccessible(); field.setAccessible(accessAl...
java
public Reflect set(String fieldName, Object value) throws ReflectionException { Field field = null; boolean isAccessible = false; try { if (hasField(fieldName)) { field = getField(fieldName); isAccessible = field.isAccessible(); field.setAccessible(accessAl...
[ "public", "Reflect", "set", "(", "String", "fieldName", ",", "Object", "value", ")", "throws", "ReflectionException", "{", "Field", "field", "=", "null", ";", "boolean", "isAccessible", "=", "false", ";", "try", "{", "if", "(", "hasField", "(", "fieldName", ...
Sets the value of a field. Will perform conversion on the value if needed. @param fieldName The name of the field to set @param value The value to set the field to @return This instance of Reflect @throws ReflectionException Something went wrong setting the value of field
[ "Sets", "the", "value", "of", "a", "field", ".", "Will", "perform", "conversion", "on", "the", "value", "if", "needed", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L401-L423
47,320
flex-oss/flex-fruit
fruit-jpa/src/main/java/org/cdlflex/fruit/jpa/QueryFactory.java
QueryFactory.count
public TypedQuery<Long> count(Filter filter) { CriteriaQuery<Long> query = cb.createQuery(Long.class); Root<T> from = query.from(getEntityClass()); if (filter != null) { Predicate where = new CriteriaMapper(from, cb).create(filter); query.where(where); } ...
java
public TypedQuery<Long> count(Filter filter) { CriteriaQuery<Long> query = cb.createQuery(Long.class); Root<T> from = query.from(getEntityClass()); if (filter != null) { Predicate where = new CriteriaMapper(from, cb).create(filter); query.where(where); } ...
[ "public", "TypedQuery", "<", "Long", ">", "count", "(", "Filter", "filter", ")", "{", "CriteriaQuery", "<", "Long", ">", "query", "=", "cb", ".", "createQuery", "(", "Long", ".", "class", ")", ";", "Root", "<", "T", ">", "from", "=", "query", ".", ...
Creates a new TypedQuery that queries the amount of entities of the entity class of this QueryFactory, that a query for the given Filter would return. @param filter the filter @return a query
[ "Creates", "a", "new", "TypedQuery", "that", "queries", "the", "amount", "of", "entities", "of", "the", "entity", "class", "of", "this", "QueryFactory", "that", "a", "query", "for", "the", "given", "Filter", "would", "return", "." ]
30d7eca5ee796b829f96c9932a95b259ca9738d9
https://github.com/flex-oss/flex-fruit/blob/30d7eca5ee796b829f96c9932a95b259ca9738d9/fruit-jpa/src/main/java/org/cdlflex/fruit/jpa/QueryFactory.java#L61-L71
47,321
pressgang-ccms/PressGangCCMSCommonUtilities
src/main/java/org/jboss/pressgang/ccms/utils/common/HashUtilities.java
HashUtilities.generateMD5
public static String generateMD5(final String input) { try { return generateMD5(input.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { LOG.debug("An error occurred generating the MD5 Hash of the input string", e); return null; } }
java
public static String generateMD5(final String input) { try { return generateMD5(input.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { LOG.debug("An error occurred generating the MD5 Hash of the input string", e); return null; } }
[ "public", "static", "String", "generateMD5", "(", "final", "String", "input", ")", "{", "try", "{", "return", "generateMD5", "(", "input", ".", "getBytes", "(", "\"UTF-8\"", ")", ")", ";", "}", "catch", "(", "UnsupportedEncodingException", "e", ")", "{", "...
Generates a MD5 Hash for a specific string @param input The string to be converted into an MD5 hash. @return The MD5 Hash string of the input string.
[ "Generates", "a", "MD5", "Hash", "for", "a", "specific", "string" ]
5ebf5ed30a94c34c33f4708caa04a8da99cbb15c
https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/HashUtilities.java#L43-L50
47,322
Mthwate/DatLib
src/main/java/com/mthwate/datlib/PropUtils.java
PropUtils.loadClasspath
public static Properties loadClasspath(String path) throws IOException { InputStream input = PropUtils.class.getClassLoader().getResourceAsStream(path); Properties prop = null; try { prop = load(input); } finally { IOUtils.close(input); } return prop; }
java
public static Properties loadClasspath(String path) throws IOException { InputStream input = PropUtils.class.getClassLoader().getResourceAsStream(path); Properties prop = null; try { prop = load(input); } finally { IOUtils.close(input); } return prop; }
[ "public", "static", "Properties", "loadClasspath", "(", "String", "path", ")", "throws", "IOException", "{", "InputStream", "input", "=", "PropUtils", ".", "class", ".", "getClassLoader", "(", ")", ".", "getResourceAsStream", "(", "path", ")", ";", "Properties",...
Loads properties from a file in the classpath. @since 1.0 @param path the path of the properties file @return the properties @throws IOException an error occurred while reading the file
[ "Loads", "properties", "from", "a", "file", "in", "the", "classpath", "." ]
f0b3a9f9cf6fdc773d4f86234ebd95986c9b6077
https://github.com/Mthwate/DatLib/blob/f0b3a9f9cf6fdc773d4f86234ebd95986c9b6077/src/main/java/com/mthwate/datlib/PropUtils.java#L25-L34
47,323
dbracewell/mango
src/main/java/com/davidbracewell/tuple/Tuple.java
Tuple.shiftLeft
public Tuple shiftLeft() { if (degree() < 2) { return Tuple0.INSTANCE; } Object[] copy = new Object[degree() - 1]; System.arraycopy(array(), 1, copy, 0, copy.length); return NTuple.of(copy); }
java
public Tuple shiftLeft() { if (degree() < 2) { return Tuple0.INSTANCE; } Object[] copy = new Object[degree() - 1]; System.arraycopy(array(), 1, copy, 0, copy.length); return NTuple.of(copy); }
[ "public", "Tuple", "shiftLeft", "(", ")", "{", "if", "(", "degree", "(", ")", "<", "2", ")", "{", "return", "Tuple0", ".", "INSTANCE", ";", "}", "Object", "[", "]", "copy", "=", "new", "Object", "[", "degree", "(", ")", "-", "1", "]", ";", "Sys...
Shifts the first element of the tuple resulting in a tuple of degree - 1. @return A new tuple without the shifted element;
[ "Shifts", "the", "first", "element", "of", "the", "tuple", "resulting", "in", "a", "tuple", "of", "degree", "-", "1", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/tuple/Tuple.java#L113-L120
47,324
dbracewell/mango
src/main/java/com/davidbracewell/tuple/Tuple.java
Tuple.slice
public Tuple slice(int start, int end) { Preconditions.checkArgument(start >= 0, "Start index must be >= 0"); Preconditions.checkArgument(start < end, "Start index must be < end index"); if (start >= degree()) { return Tuple0.INSTANCE; } return new NTuple(Arrays.copyOfRange(array(...
java
public Tuple slice(int start, int end) { Preconditions.checkArgument(start >= 0, "Start index must be >= 0"); Preconditions.checkArgument(start < end, "Start index must be < end index"); if (start >= degree()) { return Tuple0.INSTANCE; } return new NTuple(Arrays.copyOfRange(array(...
[ "public", "Tuple", "slice", "(", "int", "start", ",", "int", "end", ")", "{", "Preconditions", ".", "checkArgument", "(", "start", ">=", "0", ",", "\"Start index must be >= 0\"", ")", ";", "Preconditions", ".", "checkArgument", "(", "start", "<", "end", ",",...
Takes a slice of the tuple from an inclusive start to an exclusive end index. @param start Where to start the slice from (inclusive) @param end Where to end the slice at (exclusive) @return A new tuple of degree (end - start) with the elements of this tuple from start to end
[ "Takes", "a", "slice", "of", "the", "tuple", "from", "an", "inclusive", "start", "to", "an", "exclusive", "end", "index", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/tuple/Tuple.java#L160-L167
47,325
dbracewell/mango
src/main/java/com/davidbracewell/tuple/Tuple.java
Tuple.appendLeft
public <T> Tuple appendLeft(T object) { if (degree() == 0) { return Tuple1.of(object); } Object[] copy = new Object[degree() + 1]; System.arraycopy(array(), 0, copy, 1, degree()); copy[0] = object; return NTuple.of(copy); }
java
public <T> Tuple appendLeft(T object) { if (degree() == 0) { return Tuple1.of(object); } Object[] copy = new Object[degree() + 1]; System.arraycopy(array(), 0, copy, 1, degree()); copy[0] = object; return NTuple.of(copy); }
[ "public", "<", "T", ">", "Tuple", "appendLeft", "(", "T", "object", ")", "{", "if", "(", "degree", "(", ")", "==", "0", ")", "{", "return", "Tuple1", ".", "of", "(", "object", ")", ";", "}", "Object", "[", "]", "copy", "=", "new", "Object", "["...
Appends an item the beginning of the tuple resulting in a new tuple of degree + 1 @param <T> the type parameter @param object the object being appended @return A new tuple of degree + 1 containing the object at the beginning
[ "Appends", "an", "item", "the", "beginning", "of", "the", "tuple", "resulting", "in", "a", "new", "tuple", "of", "degree", "+", "1" ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/tuple/Tuple.java#L176-L184
47,326
wcm-io-caravan/caravan-hal
docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateJsonSchemaMojo.java
GenerateJsonSchemaMojo.isIncluded
private boolean isIncluded(String className) { if (includes == null || includes.size() == 0) { // generate nothing if no include defined - it makes no sense to generate for all classes from classpath return false; } return includes.stream() .filter(pattern -> SelectorUtils.matchPath(patt...
java
private boolean isIncluded(String className) { if (includes == null || includes.size() == 0) { // generate nothing if no include defined - it makes no sense to generate for all classes from classpath return false; } return includes.stream() .filter(pattern -> SelectorUtils.matchPath(patt...
[ "private", "boolean", "isIncluded", "(", "String", "className", ")", "{", "if", "(", "includes", "==", "null", "||", "includes", ".", "size", "(", ")", "==", "0", ")", "{", "// generate nothing if no include defined - it makes no sense to generate for all classes from c...
Check is class is included. @param className Class name @return true if included
[ "Check", "is", "class", "is", "included", "." ]
25d58756b58c70c8c48a17fe781e673dd93d5085
https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateJsonSchemaMojo.java#L106-L114
47,327
wcm-io-caravan/caravan-hal
docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateJsonSchemaMojo.java
GenerateJsonSchemaMojo.isExcluded
private boolean isExcluded(String className) { if (excludes == null || excludes.size() == 0) { return false; } return excludes.stream() .filter(pattern -> SelectorUtils.matchPath(pattern, className, ".", true)) .count() == 0; }
java
private boolean isExcluded(String className) { if (excludes == null || excludes.size() == 0) { return false; } return excludes.stream() .filter(pattern -> SelectorUtils.matchPath(pattern, className, ".", true)) .count() == 0; }
[ "private", "boolean", "isExcluded", "(", "String", "className", ")", "{", "if", "(", "excludes", "==", "null", "||", "excludes", ".", "size", "(", ")", "==", "0", ")", "{", "return", "false", ";", "}", "return", "excludes", ".", "stream", "(", ")", "...
Check if class is excluded @param className Class name @return true if excluded
[ "Check", "if", "class", "is", "excluded" ]
25d58756b58c70c8c48a17fe781e673dd93d5085
https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateJsonSchemaMojo.java#L121-L128
47,328
wcm-io-caravan/caravan-hal
docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateJsonSchemaMojo.java
GenerateJsonSchemaMojo.generateSchema
private void generateSchema(Class clazz) { try { File targetFile = new File(getGeneratedResourcesDirectory(), clazz.getName() + ".json"); getLog().info("Generate JSON schema: " + targetFile.getName()); SchemaFactoryWrapper schemaFactory = new SchemaFactoryWrapper(); OBJECT_MAPPER.acceptJsonF...
java
private void generateSchema(Class clazz) { try { File targetFile = new File(getGeneratedResourcesDirectory(), clazz.getName() + ".json"); getLog().info("Generate JSON schema: " + targetFile.getName()); SchemaFactoryWrapper schemaFactory = new SchemaFactoryWrapper(); OBJECT_MAPPER.acceptJsonF...
[ "private", "void", "generateSchema", "(", "Class", "clazz", ")", "{", "try", "{", "File", "targetFile", "=", "new", "File", "(", "getGeneratedResourcesDirectory", "(", ")", ",", "clazz", ".", "getName", "(", ")", "+", "\".json\"", ")", ";", "getLog", "(", ...
Generate JSON schema for given POJO @param clazz POJO class
[ "Generate", "JSON", "schema", "for", "given", "POJO" ]
25d58756b58c70c8c48a17fe781e673dd93d5085
https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateJsonSchemaMojo.java#L134-L146
47,329
josueeduardo/snappy
plugin-parent/snappy-loader/src/main/java/io/joshworks/snappy/loader/LaunchedURLClassLoader.java
LaunchedURLClassLoader.loadClass
@Override protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { synchronized (LaunchedURLClassLoader.LOCK_PROVIDER.getLock(this, name)) { Class<?> loadedClass = findLoadedClass(name); if (loadedClass == null) { Handler....
java
@Override protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { synchronized (LaunchedURLClassLoader.LOCK_PROVIDER.getLock(this, name)) { Class<?> loadedClass = findLoadedClass(name); if (loadedClass == null) { Handler....
[ "@", "Override", "protected", "Class", "<", "?", ">", "loadClass", "(", "String", "name", ",", "boolean", "resolve", ")", "throws", "ClassNotFoundException", "{", "synchronized", "(", "LaunchedURLClassLoader", ".", "LOCK_PROVIDER", ".", "getLock", "(", "this", "...
Attempt to load classes from the URLs before delegating to the parent loader.
[ "Attempt", "to", "load", "classes", "from", "the", "URLs", "before", "delegating", "to", "the", "parent", "loader", "." ]
d95a9e811eda3c24a5e53086369208819884fa49
https://github.com/josueeduardo/snappy/blob/d95a9e811eda3c24a5e53086369208819884fa49/plugin-parent/snappy-loader/src/main/java/io/joshworks/snappy/loader/LaunchedURLClassLoader.java#L140-L158
47,330
dbracewell/mango
src/main/java/com/davidbracewell/collection/Sorting.java
Sorting.compare
@SuppressWarnings("unchecked") public static int compare(Object o1, Object o2) { if (o1 == null && o2 == null) { return 0; } else if (o1 == null) { return 1; } else if (o2 == null) { return -1; } return Cast.<Comparable>as(o1).compareTo(o2); }
java
@SuppressWarnings("unchecked") public static int compare(Object o1, Object o2) { if (o1 == null && o2 == null) { return 0; } else if (o1 == null) { return 1; } else if (o2 == null) { return -1; } return Cast.<Comparable>as(o1).compareTo(o2); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "int", "compare", "(", "Object", "o1", ",", "Object", "o2", ")", "{", "if", "(", "o1", "==", "null", "&&", "o2", "==", "null", ")", "{", "return", "0", ";", "}", "else", "if", ...
Compare int. @param o1 the o 1 @param o2 the o 2 @return the int
[ "Compare", "int", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/collection/Sorting.java#L62-L72
47,331
dbracewell/mango
src/main/java/com/davidbracewell/collection/Sorting.java
Sorting.hashCodeComparator
public static <T> SerializableComparator<T> hashCodeComparator() { return (o1, o2) -> { if (o1 == o2) { return 0; } else if (o1 == null) { return 1; } else if (o2 == null) { return -1; } return Integer.compare(o1.hashCode(), o2.hashC...
java
public static <T> SerializableComparator<T> hashCodeComparator() { return (o1, o2) -> { if (o1 == o2) { return 0; } else if (o1 == null) { return 1; } else if (o2 == null) { return -1; } return Integer.compare(o1.hashCode(), o2.hashC...
[ "public", "static", "<", "T", ">", "SerializableComparator", "<", "T", ">", "hashCodeComparator", "(", ")", "{", "return", "(", "o1", ",", "o2", ")", "->", "{", "if", "(", "o1", "==", "o2", ")", "{", "return", "0", ";", "}", "else", "if", "(", "o...
Compares two objects based on their hashcode. @param <T> the type of object being compared @return A simplistic comparator that compares hash code values
[ "Compares", "two", "objects", "based", "on", "their", "hashcode", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/collection/Sorting.java#L96-L107
47,332
fuinorg/srcgen4j-commons
src/main/java/org/fuin/srcgen4j/commons/Project.java
Project.addFolder
public final void addFolder(@NotNull final Folder folder) { Contract.requireArgNotNull("folder", folder); if (folders == null) { folders = new ArrayList<>(); } folders.add(folder); }
java
public final void addFolder(@NotNull final Folder folder) { Contract.requireArgNotNull("folder", folder); if (folders == null) { folders = new ArrayList<>(); } folders.add(folder); }
[ "public", "final", "void", "addFolder", "(", "@", "NotNull", "final", "Folder", "folder", ")", "{", "Contract", ".", "requireArgNotNull", "(", "\"folder\"", ",", "folder", ")", ";", "if", "(", "folders", "==", "null", ")", "{", "folders", "=", "new", "Ar...
Adds a folder to the list. If the list does not exist it's created. @param folder Folder to add.
[ "Adds", "a", "folder", "to", "the", "list", ".", "If", "the", "list", "does", "not", "exist", "it", "s", "created", "." ]
bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b
https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/Project.java#L152-L158
47,333
keenon/loglinear
src/main/java/com/github/keenon/loglinear/model/NDArray.java
NDArray.fastPassByReferenceIterator
public Iterator<int[]> fastPassByReferenceIterator() { final int[] assignments = new int[dimensions.length]; if (dimensions.length > 0) assignments[0] = -1; return new Iterator<int[]>() { @Override public boolean hasNext() { for (int i = 0; i < assignment...
java
public Iterator<int[]> fastPassByReferenceIterator() { final int[] assignments = new int[dimensions.length]; if (dimensions.length > 0) assignments[0] = -1; return new Iterator<int[]>() { @Override public boolean hasNext() { for (int i = 0; i < assignment...
[ "public", "Iterator", "<", "int", "[", "]", ">", "fastPassByReferenceIterator", "(", ")", "{", "final", "int", "[", "]", "assignments", "=", "new", "int", "[", "dimensions", ".", "length", "]", ";", "if", "(", "dimensions", ".", "length", ">", "0", ")"...
This is its own function because people will inevitably attempt this optimization of not cloning the array we hand to the iterator, to save on GC, and it should not be default behavior. If you know what you're doing, then this may be the iterator for you. @return an iterator that will mutate the value it returns to yo...
[ "This", "is", "its", "own", "function", "because", "people", "will", "inevitably", "attempt", "this", "optimization", "of", "not", "cloning", "the", "array", "we", "hand", "to", "the", "iterator", "to", "save", "on", "GC", "and", "it", "should", "not", "be...
fa0c370ab6782015412f676ef2ab11c97be58e29
https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/NDArray.java#L90-L122
47,334
keenon/loglinear
src/main/java/com/github/keenon/loglinear/model/NDArray.java
NDArray.getTableAccessOffset
private int getTableAccessOffset(int[] assignment) { assert(assignment.length == dimensions.length); int offset = 0; for (int i = 0; i < assignment.length; i++) { assert(assignment[i] < dimensions[i]); offset = (offset*dimensions[i]) + assignment[i]; } ret...
java
private int getTableAccessOffset(int[] assignment) { assert(assignment.length == dimensions.length); int offset = 0; for (int i = 0; i < assignment.length; i++) { assert(assignment[i] < dimensions[i]); offset = (offset*dimensions[i]) + assignment[i]; } ret...
[ "private", "int", "getTableAccessOffset", "(", "int", "[", "]", "assignment", ")", "{", "assert", "(", "assignment", ".", "length", "==", "dimensions", ".", "length", ")", ";", "int", "offset", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i...
Compute the distance into the one dimensional factorTable array that corresponds to a setting of all the neighbors of the factor. @param assignment assignment indices, in same order as neighbors array @return the offset index
[ "Compute", "the", "distance", "into", "the", "one", "dimensional", "factorTable", "array", "that", "corresponds", "to", "a", "setting", "of", "all", "the", "neighbors", "of", "the", "factor", "." ]
fa0c370ab6782015412f676ef2ab11c97be58e29
https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/NDArray.java#L155-L163
47,335
dbracewell/mango
src/main/java/com/davidbracewell/string/StringUtils.java
StringUtils.center
public static String center(String s, int length) { if (s == null) { return null; } int start = (int) Math.floor(Math.max(0, (length - s.length()) / 2d)); return padEnd(repeat(' ', start) + s, length, ' '); }
java
public static String center(String s, int length) { if (s == null) { return null; } int start = (int) Math.floor(Math.max(0, (length - s.length()) / 2d)); return padEnd(repeat(' ', start) + s, length, ' '); }
[ "public", "static", "String", "center", "(", "String", "s", ",", "int", "length", ")", "{", "if", "(", "s", "==", "null", ")", "{", "return", "null", ";", "}", "int", "start", "=", "(", "int", ")", "Math", ".", "floor", "(", "Math", ".", "max", ...
Center string. @param s the s @param length the length @return the string
[ "Center", "string", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L97-L103
47,336
dbracewell/mango
src/main/java/com/davidbracewell/string/StringUtils.java
StringUtils.compare
public static int compare(String s1, String s2, boolean ignoreCase) { if (s1 == null && s2 == null) { return 0; } else if (s1 == null) { return -1; } else if (s2 == null) { return 1; } return ignoreCase ? s1.compareToIgnoreCase(s2) : s1.compareTo(s2); }
java
public static int compare(String s1, String s2, boolean ignoreCase) { if (s1 == null && s2 == null) { return 0; } else if (s1 == null) { return -1; } else if (s2 == null) { return 1; } return ignoreCase ? s1.compareToIgnoreCase(s2) : s1.compareTo(s2); }
[ "public", "static", "int", "compare", "(", "String", "s1", ",", "String", "s2", ",", "boolean", "ignoreCase", ")", "{", "if", "(", "s1", "==", "null", "&&", "s2", "==", "null", ")", "{", "return", "0", ";", "}", "else", "if", "(", "s1", "==", "nu...
Null safe comparison of strings @param s1 string 1 @param s2 string 2 @param ignoreCase True perform case insensitive comparison, False perform case sensitive comparison @return as long as neither are null
[ "Null", "safe", "comparison", "of", "strings" ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L132-L141
47,337
dbracewell/mango
src/main/java/com/davidbracewell/string/StringUtils.java
StringUtils.firstNonNullOrBlank
public static String firstNonNullOrBlank(String... strings) { if (strings == null || strings.length == 0) { return null; } for (String s : strings) { if (isNotNullOrBlank(s)) { return s; } } return null; }
java
public static String firstNonNullOrBlank(String... strings) { if (strings == null || strings.length == 0) { return null; } for (String s : strings) { if (isNotNullOrBlank(s)) { return s; } } return null; }
[ "public", "static", "String", "firstNonNullOrBlank", "(", "String", "...", "strings", ")", "{", "if", "(", "strings", "==", "null", "||", "strings", ".", "length", "==", "0", ")", "{", "return", "null", ";", "}", "for", "(", "String", "s", ":", "string...
First non null or blank string. @param strings the strings @return the string
[ "First", "non", "null", "or", "blank", "string", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L149-L159
47,338
dbracewell/mango
src/main/java/com/davidbracewell/string/StringUtils.java
StringUtils.leftTrim
public static String leftTrim(CharSequence input) { if (input == null) { return null; } return StringFunctions.LEFT_TRIM.apply(input.toString()); }
java
public static String leftTrim(CharSequence input) { if (input == null) { return null; } return StringFunctions.LEFT_TRIM.apply(input.toString()); }
[ "public", "static", "String", "leftTrim", "(", "CharSequence", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "return", "StringFunctions", ".", "LEFT_TRIM", ".", "apply", "(", "input", ".", "toString", "(", ")"...
Left trim. @param input the input @return the string
[ "Left", "trim", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L334-L339
47,339
dbracewell/mango
src/main/java/com/davidbracewell/string/StringUtils.java
StringUtils.removeDiacritics
public static String removeDiacritics(CharSequence input) { if (input == null) { return null; } return StringFunctions.DIACRITICS_NORMALIZATION.apply(input.toString()); }
java
public static String removeDiacritics(CharSequence input) { if (input == null) { return null; } return StringFunctions.DIACRITICS_NORMALIZATION.apply(input.toString()); }
[ "public", "static", "String", "removeDiacritics", "(", "CharSequence", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "return", "StringFunctions", ".", "DIACRITICS_NORMALIZATION", ".", "apply", "(", "input", ".", "...
Normalizes a string by removing the diacritics. @param input the input string @return Resulting string without diacritic marks
[ "Normalizes", "a", "string", "by", "removing", "the", "diacritics", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L426-L431
47,340
dbracewell/mango
src/main/java/com/davidbracewell/string/StringUtils.java
StringUtils.rightTrim
public static String rightTrim(CharSequence input) { if (input == null) { return null; } return StringFunctions.RIGHT_TRIM.apply(input.toString()); }
java
public static String rightTrim(CharSequence input) { if (input == null) { return null; } return StringFunctions.RIGHT_TRIM.apply(input.toString()); }
[ "public", "static", "String", "rightTrim", "(", "CharSequence", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "return", "StringFunctions", ".", "RIGHT_TRIM", ".", "apply", "(", "input", ".", "toString", "(", "...
Right trim. @param input the input @return the string
[ "Right", "trim", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L472-L477
47,341
dbracewell/mango
src/main/java/com/davidbracewell/string/StringUtils.java
StringUtils.safeEquals
public static boolean safeEquals(String s1, String s2, boolean caseSensitive) { if (s1 == s2) { return true; } else if (s1 == null || s2 == null) { return false; } else if (caseSensitive) { return s1.equals(s2); } return s1.equalsIgnoreCase(s2); }
java
public static boolean safeEquals(String s1, String s2, boolean caseSensitive) { if (s1 == s2) { return true; } else if (s1 == null || s2 == null) { return false; } else if (caseSensitive) { return s1.equals(s2); } return s1.equalsIgnoreCase(s2); }
[ "public", "static", "boolean", "safeEquals", "(", "String", "s1", ",", "String", "s2", ",", "boolean", "caseSensitive", ")", "{", "if", "(", "s1", "==", "s2", ")", "{", "return", "true", ";", "}", "else", "if", "(", "s1", "==", "null", "||", "s2", ...
Safe equals. @param s1 the s 1 @param s2 the s 2 @param caseSensitive the case sensitive @return the boolean
[ "Safe", "equals", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L487-L496
47,342
dbracewell/mango
src/main/java/com/davidbracewell/string/StringUtils.java
StringUtils.split
@SneakyThrows public static List<String> split(CharSequence input, char separator) { if (input == null) { return new ArrayList<>(); } Preconditions.checkArgument(separator != '"', "Separator cannot be a quote"); try (CSVReader reader = CSV.builder().delimiter(separator).reader(new St...
java
@SneakyThrows public static List<String> split(CharSequence input, char separator) { if (input == null) { return new ArrayList<>(); } Preconditions.checkArgument(separator != '"', "Separator cannot be a quote"); try (CSVReader reader = CSV.builder().delimiter(separator).reader(new St...
[ "@", "SneakyThrows", "public", "static", "List", "<", "String", ">", "split", "(", "CharSequence", "input", ",", "char", "separator", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "new", "ArrayList", "<>", "(", ")", ";", "}", "Precond...
Properly splits a delimited separated string. @param input The input @param separator The separator @return A list of all the cells in the input
[ "Properly", "splits", "a", "delimited", "separated", "string", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L505-L519
47,343
dbracewell/mango
src/main/java/com/davidbracewell/string/StringUtils.java
StringUtils.toCanonicalForm
public static String toCanonicalForm(CharSequence input) { if (input == null) { return null; } return StringFunctions.CANONICAL_NORMALIZATION.apply(input.toString()); }
java
public static String toCanonicalForm(CharSequence input) { if (input == null) { return null; } return StringFunctions.CANONICAL_NORMALIZATION.apply(input.toString()); }
[ "public", "static", "String", "toCanonicalForm", "(", "CharSequence", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "return", "StringFunctions", ".", "CANONICAL_NORMALIZATION", ".", "apply", "(", "input", ".", "to...
Normalize to canonical form. @param input the input string @return the normalized string
[ "Normalize", "to", "canonical", "form", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L547-L552
47,344
dbracewell/mango
src/main/java/com/davidbracewell/string/StringUtils.java
StringUtils.toTitleCase
public static String toTitleCase(CharSequence input) { if (input == null) { return null; } return StringFunctions.TITLE_CASE.apply(input.toString()); }
java
public static String toTitleCase(CharSequence input) { if (input == null) { return null; } return StringFunctions.TITLE_CASE.apply(input.toString()); }
[ "public", "static", "String", "toTitleCase", "(", "CharSequence", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "return", "StringFunctions", ".", "TITLE_CASE", ".", "apply", "(", "input", ".", "toString", "(", ...
Converts an input string to title case @param input The input string @return The title cased version of the input
[ "Converts", "an", "input", "string", "to", "title", "case" ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L560-L565
47,345
dbracewell/mango
src/main/java/com/davidbracewell/string/StringUtils.java
StringUtils.trim
public static String trim(CharSequence input) { if (input == null) { return null; } return StringFunctions.TRIM.apply(input.toString()); }
java
public static String trim(CharSequence input) { if (input == null) { return null; } return StringFunctions.TRIM.apply(input.toString()); }
[ "public", "static", "String", "trim", "(", "CharSequence", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "return", "StringFunctions", ".", "TRIM", ".", "apply", "(", "input", ".", "toString", "(", ")", ")", ...
Trims a string of unicode whitespace and invisible characters @param input Input string @return Trimmed string or null if input was null
[ "Trims", "a", "string", "of", "unicode", "whitespace", "and", "invisible", "characters" ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L573-L578
47,346
dbracewell/mango
src/main/java/com/davidbracewell/string/StringUtils.java
StringUtils.unescape
public static String unescape(String input, char escapeCharacter) { if (input == null) { return null; } StringBuilder builder = new StringBuilder(); for (int i = 0; i < input.length(); ) { if (input.charAt(i) == escapeCharacter) { builder.append(input.charAt(i + 1))...
java
public static String unescape(String input, char escapeCharacter) { if (input == null) { return null; } StringBuilder builder = new StringBuilder(); for (int i = 0; i < input.length(); ) { if (input.charAt(i) == escapeCharacter) { builder.append(input.charAt(i + 1))...
[ "public", "static", "String", "unescape", "(", "String", "input", ",", "char", "escapeCharacter", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "null", ";", "}", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "f...
Unescape string. @param input the input @param escapeCharacter the escape character @return the string
[ "Unescape", "string", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L587-L602
47,347
theisenp/harbor
src/main/java/com/theisenp/harbor/utils/HarborUtils.java
HarborUtils.validateAddress
public static void validateAddress(String address) { // Check for improperly formatted addresses Matcher matcher = ADDRESS_PATTERN.matcher(address); if(!matcher.matches()) { String message = "The address must have the format X.X.X.X"; throw new IllegalArgumentException(message); } // Check for out of r...
java
public static void validateAddress(String address) { // Check for improperly formatted addresses Matcher matcher = ADDRESS_PATTERN.matcher(address); if(!matcher.matches()) { String message = "The address must have the format X.X.X.X"; throw new IllegalArgumentException(message); } // Check for out of r...
[ "public", "static", "void", "validateAddress", "(", "String", "address", ")", "{", "// Check for improperly formatted addresses", "Matcher", "matcher", "=", "ADDRESS_PATTERN", ".", "matcher", "(", "address", ")", ";", "if", "(", "!", "matcher", ".", "matches", "("...
Verifies that the given address is valid @param address
[ "Verifies", "that", "the", "given", "address", "is", "valid" ]
59a6d373a709e10ddf0945475b95394f3f7a8254
https://github.com/theisenp/harbor/blob/59a6d373a709e10ddf0945475b95394f3f7a8254/src/main/java/com/theisenp/harbor/utils/HarborUtils.java#L45-L61
47,348
theisenp/harbor
src/main/java/com/theisenp/harbor/utils/HarborUtils.java
HarborUtils.validatePeriod
public static void validatePeriod(Duration period) { if(period.equals(Duration.ZERO)) { String message = "The period must be nonzero"; throw new IllegalArgumentException(message); } }
java
public static void validatePeriod(Duration period) { if(period.equals(Duration.ZERO)) { String message = "The period must be nonzero"; throw new IllegalArgumentException(message); } }
[ "public", "static", "void", "validatePeriod", "(", "Duration", "period", ")", "{", "if", "(", "period", ".", "equals", "(", "Duration", ".", "ZERO", ")", ")", "{", "String", "message", "=", "\"The period must be nonzero\"", ";", "throw", "new", "IllegalArgumen...
Verifies that the given period is valid @param period
[ "Verifies", "that", "the", "given", "period", "is", "valid" ]
59a6d373a709e10ddf0945475b95394f3f7a8254
https://github.com/theisenp/harbor/blob/59a6d373a709e10ddf0945475b95394f3f7a8254/src/main/java/com/theisenp/harbor/utils/HarborUtils.java#L92-L97
47,349
theisenp/harbor
src/main/java/com/theisenp/harbor/utils/HarborUtils.java
HarborUtils.validateTimeout
public static void validateTimeout(Duration timeout) { if(timeout.equals(Duration.ZERO)) { String message = "The timeout must be nonzero"; throw new IllegalArgumentException(message); } }
java
public static void validateTimeout(Duration timeout) { if(timeout.equals(Duration.ZERO)) { String message = "The timeout must be nonzero"; throw new IllegalArgumentException(message); } }
[ "public", "static", "void", "validateTimeout", "(", "Duration", "timeout", ")", "{", "if", "(", "timeout", ".", "equals", "(", "Duration", ".", "ZERO", ")", ")", "{", "String", "message", "=", "\"The timeout must be nonzero\"", ";", "throw", "new", "IllegalArg...
Verifies that the given timeout is valid @param timeout
[ "Verifies", "that", "the", "given", "timeout", "is", "valid" ]
59a6d373a709e10ddf0945475b95394f3f7a8254
https://github.com/theisenp/harbor/blob/59a6d373a709e10ddf0945475b95394f3f7a8254/src/main/java/com/theisenp/harbor/utils/HarborUtils.java#L104-L109
47,350
jbundle/webapp
files/src/main/java/org/jbundle/util/webapp/files/DefaultServlet.java
DefaultServlet.setProperties
@Override public boolean setProperties(Dictionary<String, String> properties) { this.properties = properties; if (this.properties != null) { if (properties.get("debug") != null) debug = Integer.parseInt(properties.get("debug")); if (properties.get("in...
java
@Override public boolean setProperties(Dictionary<String, String> properties) { this.properties = properties; if (this.properties != null) { if (properties.get("debug") != null) debug = Integer.parseInt(properties.get("debug")); if (properties.get("in...
[ "@", "Override", "public", "boolean", "setProperties", "(", "Dictionary", "<", "String", ",", "String", ">", "properties", ")", "{", "this", ".", "properties", "=", "properties", ";", "if", "(", "this", ".", "properties", "!=", "null", ")", "{", "if", "(...
Set servlet the properties.
[ "Set", "servlet", "the", "properties", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/files/src/main/java/org/jbundle/util/webapp/files/DefaultServlet.java#L48-L98
47,351
jbundle/webapp
files/src/main/java/org/jbundle/util/webapp/files/DefaultServlet.java
DefaultServlet.setDocBase
@SuppressWarnings({ "rawtypes", "unchecked" }) public boolean setDocBase(String basePath) { proxyDirContext = null; if (basePath == null) return false; Hashtable env = new Hashtable(); File file = new File(basePath); if (!file.exists()) ...
java
@SuppressWarnings({ "rawtypes", "unchecked" }) public boolean setDocBase(String basePath) { proxyDirContext = null; if (basePath == null) return false; Hashtable env = new Hashtable(); File file = new File(basePath); if (!file.exists()) ...
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "public", "boolean", "setDocBase", "(", "String", "basePath", ")", "{", "proxyDirContext", "=", "null", ";", "if", "(", "basePath", "==", "null", ")", "return", "false", ";", ...
Set the local file path to serve files from. @param basePath @return
[ "Set", "the", "local", "file", "path", "to", "serve", "files", "from", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/files/src/main/java/org/jbundle/util/webapp/files/DefaultServlet.java#L123-L151
47,352
fuinorg/utils4j
src/main/java/org/fuin/utils4j/PropertiesUtils.java
PropertiesUtils.loadProperties
public static Properties loadProperties(final Class<?> clasz, final String filename) { checkNotNull("clasz", clasz); checkNotNull("filename", filename); final String path = getPackagePath(clasz); final String resPath = path + "/" + filename; return loadProperties(clasz.getClassL...
java
public static Properties loadProperties(final Class<?> clasz, final String filename) { checkNotNull("clasz", clasz); checkNotNull("filename", filename); final String path = getPackagePath(clasz); final String resPath = path + "/" + filename; return loadProperties(clasz.getClassL...
[ "public", "static", "Properties", "loadProperties", "(", "final", "Class", "<", "?", ">", "clasz", ",", "final", "String", "filename", ")", "{", "checkNotNull", "(", "\"clasz\"", ",", "clasz", ")", ";", "checkNotNull", "(", "\"filename\"", ",", "filename", "...
Load properties from classpath. @param clasz Class in the same package as the properties file - Cannot be <code>null</code>. @param filename Name of the properties file (without path) - Cannot be <code>null</code>. @return Properties.
[ "Load", "properties", "from", "classpath", "." ]
71cf88e0a8d8ed67bbac513bf3cab165cd7e3280
https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/PropertiesUtils.java#L57-L65
47,353
fuinorg/utils4j
src/main/java/org/fuin/utils4j/PropertiesUtils.java
PropertiesUtils.loadProperties
public static Properties loadProperties(final ClassLoader loader, final String resource) { checkNotNull("loader", loader); checkNotNull("resource", resource); final Properties props = new Properties(); try (final InputStream inStream = loader.getResourceAsStream(resource)) { ...
java
public static Properties loadProperties(final ClassLoader loader, final String resource) { checkNotNull("loader", loader); checkNotNull("resource", resource); final Properties props = new Properties(); try (final InputStream inStream = loader.getResourceAsStream(resource)) { ...
[ "public", "static", "Properties", "loadProperties", "(", "final", "ClassLoader", "loader", ",", "final", "String", "resource", ")", "{", "checkNotNull", "(", "\"loader\"", ",", "loader", ")", ";", "checkNotNull", "(", "\"resource\"", ",", "resource", ")", ";", ...
Loads a resource from the classpath as properties. @param loader Class loader to use. @param resource Resource to load. @return Properties.
[ "Loads", "a", "resource", "from", "the", "classpath", "as", "properties", "." ]
71cf88e0a8d8ed67bbac513bf3cab165cd7e3280
https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/PropertiesUtils.java#L77-L91
47,354
fuinorg/utils4j
src/main/java/org/fuin/utils4j/PropertiesUtils.java
PropertiesUtils.loadProperties
public static Properties loadProperties(final URL baseUrl, final String filename) { return loadProperties(createUrl(baseUrl, "", filename)); }
java
public static Properties loadProperties(final URL baseUrl, final String filename) { return loadProperties(createUrl(baseUrl, "", filename)); }
[ "public", "static", "Properties", "loadProperties", "(", "final", "URL", "baseUrl", ",", "final", "String", "filename", ")", "{", "return", "loadProperties", "(", "createUrl", "(", "baseUrl", ",", "\"\"", ",", "filename", ")", ")", ";", "}" ]
Load a file from an directory. @param baseUrl Directory URL - Cannot be <code>null</code>. @param filename Filename without path - Cannot be <code>null</code>. @return Properties.
[ "Load", "a", "file", "from", "an", "directory", "." ]
71cf88e0a8d8ed67bbac513bf3cab165cd7e3280
https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/PropertiesUtils.java#L147-L149
47,355
fuinorg/utils4j
src/main/java/org/fuin/utils4j/PropertiesUtils.java
PropertiesUtils.loadProperties
public static Properties loadProperties(final URL fileURL) { checkNotNull("fileURL", fileURL); final Properties props = new Properties(); try (final InputStream inStream = fileURL.openStream()) { props.load(inStream); } catch (final IOException ex) { throw new Run...
java
public static Properties loadProperties(final URL fileURL) { checkNotNull("fileURL", fileURL); final Properties props = new Properties(); try (final InputStream inStream = fileURL.openStream()) { props.load(inStream); } catch (final IOException ex) { throw new Run...
[ "public", "static", "Properties", "loadProperties", "(", "final", "URL", "fileURL", ")", "{", "checkNotNull", "(", "\"fileURL\"", ",", "fileURL", ")", ";", "final", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "try", "(", "final", "InputSt...
Load a file from an URL. @param fileURL Property file URL - Cannot be <code>null</code>. @return Properties.
[ "Load", "a", "file", "from", "an", "URL", "." ]
71cf88e0a8d8ed67bbac513bf3cab165cd7e3280
https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/PropertiesUtils.java#L159-L168
47,356
gsi-upm/Shanks
shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation.java
ShanksSimulation.createScenarioManager
private ScenarioManager createScenarioManager( Class<? extends Scenario> scenarioClass, String scenarioID, String initialState, Properties properties) throws ShanksException { // throws UnsupportedNetworkElementFieldException, // TooManyConnectionException, UnsupportedScena...
java
private ScenarioManager createScenarioManager( Class<? extends Scenario> scenarioClass, String scenarioID, String initialState, Properties properties) throws ShanksException { // throws UnsupportedNetworkElementFieldException, // TooManyConnectionException, UnsupportedScena...
[ "private", "ScenarioManager", "createScenarioManager", "(", "Class", "<", "?", "extends", "Scenario", ">", "scenarioClass", ",", "String", "scenarioID", ",", "String", "initialState", ",", "Properties", "properties", ")", "throws", "ShanksException", "{", "// ...
This method will set all required information about Scenario @return the completed Scenario object @throws DuplicatedIDException @throws UnsupportedScenarioStatusException @throws TooManyConnectionException @throws UnsupportedNetworkElementFieldException @throws NoSuchMethodException @throws SecurityException @throws ...
[ "This", "method", "will", "set", "all", "required", "information", "about", "Scenario" ]
35d87a81c22731f4f83bbd0571c9c6d466bd16be
https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation.java#L129-L168
47,357
gsi-upm/Shanks
shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation.java
ShanksSimulation.startSimulation
public void startSimulation() throws ShanksException { schedule.scheduleRepeating(Schedule.EPOCH, 0, this.scenarioManager, 2); schedule.scheduleRepeating(Schedule.EPOCH, 1, this.notificationManager, 1); this.addAgents(); this.addSteppables(); }
java
public void startSimulation() throws ShanksException { schedule.scheduleRepeating(Schedule.EPOCH, 0, this.scenarioManager, 2); schedule.scheduleRepeating(Schedule.EPOCH, 1, this.notificationManager, 1); this.addAgents(); this.addSteppables(); }
[ "public", "void", "startSimulation", "(", ")", "throws", "ShanksException", "{", "schedule", ".", "scheduleRepeating", "(", "Schedule", ".", "EPOCH", ",", "0", ",", "this", ".", "scenarioManager", ",", "2", ")", ";", "schedule", ".", "scheduleRepeating", "(", ...
The initial configuration of the scenario @throws DuplicatedAgentIDException @throws DuplicatedActionIDException
[ "The", "initial", "configuration", "of", "the", "scenario" ]
35d87a81c22731f4f83bbd0571c9c6d466bd16be
https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation.java#L245-L250
47,358
gsi-upm/Shanks
shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation.java
ShanksSimulation.addAgents
private void addAgents() throws ShanksException { for (Entry<String, ShanksAgent> agentEntry : this.agents.entrySet()) { stoppables.put(agentEntry.getKey(), schedule.scheduleRepeating(Schedule.EPOCH, 2, agentEntry.getValue(), 1)); } }
java
private void addAgents() throws ShanksException { for (Entry<String, ShanksAgent> agentEntry : this.agents.entrySet()) { stoppables.put(agentEntry.getKey(), schedule.scheduleRepeating(Schedule.EPOCH, 2, agentEntry.getValue(), 1)); } }
[ "private", "void", "addAgents", "(", ")", "throws", "ShanksException", "{", "for", "(", "Entry", "<", "String", ",", "ShanksAgent", ">", "agentEntry", ":", "this", ".", "agents", ".", "entrySet", "(", ")", ")", "{", "stoppables", ".", "put", "(", "agentE...
Add ShanksAgent's to the simulation using registerShanksAgent method @throws DuplicatedActionIDException
[ "Add", "ShanksAgent", "s", "to", "the", "simulation", "using", "registerShanksAgent", "method" ]
35d87a81c22731f4f83bbd0571c9c6d466bd16be
https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation.java#L257-L261
47,359
gsi-upm/Shanks
shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation.java
ShanksSimulation.registerShanksAgent
public void registerShanksAgent(ShanksAgent agent) throws ShanksException { if (!this.agents.containsKey(agent.getID())) { this.agents.put(agent.getID(), agent); } else { throw new DuplicatedAgentIDException(agent.getID()); } }
java
public void registerShanksAgent(ShanksAgent agent) throws ShanksException { if (!this.agents.containsKey(agent.getID())) { this.agents.put(agent.getID(), agent); } else { throw new DuplicatedAgentIDException(agent.getID()); } }
[ "public", "void", "registerShanksAgent", "(", "ShanksAgent", "agent", ")", "throws", "ShanksException", "{", "if", "(", "!", "this", ".", "agents", ".", "containsKey", "(", "agent", ".", "getID", "(", ")", ")", ")", "{", "this", ".", "agents", ".", "put"...
This method adds and registers the ShanksAgent @param agent The ShanksAgent @throws ShanksException
[ "This", "method", "adds", "and", "registers", "the", "ShanksAgent" ]
35d87a81c22731f4f83bbd0571c9c6d466bd16be
https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation.java#L270-L277
47,360
gsi-upm/Shanks
shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation.java
ShanksSimulation.unregisterShanksAgent
public void unregisterShanksAgent(String agentID){ if (this.agents.containsKey(agentID)) { // this.agents.get(agentID).stop(); if (stoppables.containsKey(agentID)) { this.agents.remove(agentID); this.stoppables.remove(agentID).stop(); } else {...
java
public void unregisterShanksAgent(String agentID){ if (this.agents.containsKey(agentID)) { // this.agents.get(agentID).stop(); if (stoppables.containsKey(agentID)) { this.agents.remove(agentID); this.stoppables.remove(agentID).stop(); } else {...
[ "public", "void", "unregisterShanksAgent", "(", "String", "agentID", ")", "{", "if", "(", "this", ".", "agents", ".", "containsKey", "(", "agentID", ")", ")", "{", "// this.agents.get(agentID).stop();", "if", "(", "stoppables", ".", "containsKey", "(", "agentID...
Unregisters an agent. @param agentID - The ID for the agent
[ "Unregisters", "an", "agent", "." ]
35d87a81c22731f4f83bbd0571c9c6d466bd16be
https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation.java#L284-L296
47,361
fuinorg/srcgen4j-commons
src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java
JaxbHelper.containsStartTag
public boolean containsStartTag(@NotNull @FileExists @IsFile final File file, @NotNull final String tagName) { Contract.requireArgNotNull("file", file); FileExistsValidator.requireArgValid("file", file); IsFileValidator.requireArgValid("file", file); Contract.requireArgNotNull("tagNa...
java
public boolean containsStartTag(@NotNull @FileExists @IsFile final File file, @NotNull final String tagName) { Contract.requireArgNotNull("file", file); FileExistsValidator.requireArgValid("file", file); IsFileValidator.requireArgValid("file", file); Contract.requireArgNotNull("tagNa...
[ "public", "boolean", "containsStartTag", "(", "@", "NotNull", "@", "FileExists", "@", "IsFile", "final", "File", "file", ",", "@", "NotNull", "final", "String", "tagName", ")", "{", "Contract", ".", "requireArgNotNull", "(", "\"file\"", ",", "file", ")", ";"...
Checks if the given file contains a start tag within the first 1024 bytes. @param file File to check. @param tagName Name of the tag. A "&lt;" will be added to this name internally to locate the start tag. @return If the file contains the start tag TRUE else FALSE.
[ "Checks", "if", "the", "given", "file", "contains", "a", "start", "tag", "within", "the", "first", "1024", "bytes", "." ]
bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b
https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java#L76-L84
47,362
fuinorg/srcgen4j-commons
src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java
JaxbHelper.create
@SuppressWarnings("unchecked") @NotNull public <TYPE> TYPE create(@NotNull final Reader reader, @NotNull final JAXBContext jaxbContext) throws UnmarshalObjectException { Contract.requireArgNotNull("reader", reader); Contract.requireArgNotNull("jaxbContext", jaxbContext); try { ...
java
@SuppressWarnings("unchecked") @NotNull public <TYPE> TYPE create(@NotNull final Reader reader, @NotNull final JAXBContext jaxbContext) throws UnmarshalObjectException { Contract.requireArgNotNull("reader", reader); Contract.requireArgNotNull("jaxbContext", jaxbContext); try { ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "NotNull", "public", "<", "TYPE", ">", "TYPE", "create", "(", "@", "NotNull", "final", "Reader", "reader", ",", "@", "NotNull", "final", "JAXBContext", "jaxbContext", ")", "throws", "UnmarshalObjectExcepti...
Creates an instance by reading the XML from a reader. @param reader Reader to use. @param jaxbContext Context to use. @return New instance. @throws UnmarshalObjectException Error deserializing the object. @param <TYPE> Type of the created object.
[ "Creates", "an", "instance", "by", "reading", "the", "XML", "from", "a", "reader", "." ]
bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b
https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java#L118-L130
47,363
fuinorg/srcgen4j-commons
src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java
JaxbHelper.create
@SuppressWarnings("unchecked") @NotNull public <TYPE> TYPE create(@NotNull @FileExists @IsFile final File file, @NotNull final JAXBContext jaxbContext) throws UnmarshalObjectException { Contract.requireArgNotNull("file", file); FileExistsValidator.requireArgValid("file", file); ...
java
@SuppressWarnings("unchecked") @NotNull public <TYPE> TYPE create(@NotNull @FileExists @IsFile final File file, @NotNull final JAXBContext jaxbContext) throws UnmarshalObjectException { Contract.requireArgNotNull("file", file); FileExistsValidator.requireArgValid("file", file); ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "NotNull", "public", "<", "TYPE", ">", "TYPE", "create", "(", "@", "NotNull", "@", "FileExists", "@", "IsFile", "final", "File", "file", ",", "@", "NotNull", "final", "JAXBContext", "jaxbContext", ")",...
Creates an instance by reading the XML from a file. @param file File to read. @param jaxbContext Context to use. @return New instance. @throws UnmarshalObjectException Error deserializing the object. @param <TYPE> Type of the created object.
[ "Creates", "an", "instance", "by", "reading", "the", "XML", "from", "a", "file", "." ]
bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b
https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java#L148-L166
47,364
fuinorg/srcgen4j-commons
src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java
JaxbHelper.create
@SuppressWarnings("unchecked") @NotNull public <TYPE> TYPE create(@NotNull final String xml, @NotNull final JAXBContext jaxbContext) throws UnmarshalObjectException { Contract.requireArgNotNull("xml", xml); Contract.requireArgNotNull("jaxbContext", jaxbContext); return (TYPE) cr...
java
@SuppressWarnings("unchecked") @NotNull public <TYPE> TYPE create(@NotNull final String xml, @NotNull final JAXBContext jaxbContext) throws UnmarshalObjectException { Contract.requireArgNotNull("xml", xml); Contract.requireArgNotNull("jaxbContext", jaxbContext); return (TYPE) cr...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "NotNull", "public", "<", "TYPE", ">", "TYPE", "create", "(", "@", "NotNull", "final", "String", "xml", ",", "@", "NotNull", "final", "JAXBContext", "jaxbContext", ")", "throws", "UnmarshalObjectException"...
Creates an instance by from a given XML. @param xml XML to parse. @param jaxbContext Context to use. @return New instance. @throws UnmarshalObjectException Error deserializing the object. @param <TYPE> Type of the created object.
[ "Creates", "an", "instance", "by", "from", "a", "given", "XML", "." ]
bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b
https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java#L184-L193
47,365
fuinorg/srcgen4j-commons
src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java
JaxbHelper.write
public <TYPE> void write(@NotNull final TYPE obj, @NotNull final File file, @NotNull final JAXBContext jaxbContext) throws MarshalObjectException { Contract.requireArgNotNull("obj", obj); Contract.requireArgNotNull("file", file); Contract.requireArgNotNull("jaxbContext", jaxbCo...
java
public <TYPE> void write(@NotNull final TYPE obj, @NotNull final File file, @NotNull final JAXBContext jaxbContext) throws MarshalObjectException { Contract.requireArgNotNull("obj", obj); Contract.requireArgNotNull("file", file); Contract.requireArgNotNull("jaxbContext", jaxbCo...
[ "public", "<", "TYPE", ">", "void", "write", "(", "@", "NotNull", "final", "TYPE", "obj", ",", "@", "NotNull", "final", "File", "file", ",", "@", "NotNull", "final", "JAXBContext", "jaxbContext", ")", "throws", "MarshalObjectException", "{", "Contract", ".",...
Marshals the object as XML to a file. @param obj Object to marshal. @param file File to write the instance to. @param jaxbContext Context to use. @throws MarshalObjectException Error writing the object. @param <TYPE> Type of the object.
[ "Marshals", "the", "object", "as", "XML", "to", "a", "file", "." ]
bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b
https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java#L211-L228
47,366
fuinorg/srcgen4j-commons
src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java
JaxbHelper.write
public <TYPE> String write(@NotNull final TYPE obj, @NotNull final JAXBContext jaxbContext) throws MarshalObjectException { Contract.requireArgNotNull("obj", obj); Contract.requireArgNotNull("jaxbContext", jaxbContext); final StringWriter writer = new StringWriter(); write(obj, w...
java
public <TYPE> String write(@NotNull final TYPE obj, @NotNull final JAXBContext jaxbContext) throws MarshalObjectException { Contract.requireArgNotNull("obj", obj); Contract.requireArgNotNull("jaxbContext", jaxbContext); final StringWriter writer = new StringWriter(); write(obj, w...
[ "public", "<", "TYPE", ">", "String", "write", "(", "@", "NotNull", "final", "TYPE", "obj", ",", "@", "NotNull", "final", "JAXBContext", "jaxbContext", ")", "throws", "MarshalObjectException", "{", "Contract", ".", "requireArgNotNull", "(", "\"obj\"", ",", "ob...
Marshals the object as XML to a string. @param obj Object to marshal. @param jaxbContext Context to use. @return XML String. @throws MarshalObjectException Error writing the object. @param <TYPE> Type of the object.
[ "Marshals", "the", "object", "as", "XML", "to", "a", "string", "." ]
bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b
https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java#L246-L254
47,367
fuinorg/srcgen4j-commons
src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java
JaxbHelper.write
public <TYPE> void write(@NotNull final TYPE obj, @NotNull final Writer writer, @NotNull final JAXBContext jaxbContext) throws MarshalObjectException { Contract.requireArgNotNull("obj", obj); Contract.requireArgNotNull("writer", writer); Contract.requireArgNotNull("jaxbContext"...
java
public <TYPE> void write(@NotNull final TYPE obj, @NotNull final Writer writer, @NotNull final JAXBContext jaxbContext) throws MarshalObjectException { Contract.requireArgNotNull("obj", obj); Contract.requireArgNotNull("writer", writer); Contract.requireArgNotNull("jaxbContext"...
[ "public", "<", "TYPE", ">", "void", "write", "(", "@", "NotNull", "final", "TYPE", "obj", ",", "@", "NotNull", "final", "Writer", "writer", ",", "@", "NotNull", "final", "JAXBContext", "jaxbContext", ")", "throws", "MarshalObjectException", "{", "Contract", ...
Marshals the object as XML to a writer. @param obj Object to marshal. @param writer Writer to write the object to. @param jaxbContext Context to use. @throws MarshalObjectException Error writing the object. @param <TYPE> Type of the object.
[ "Marshals", "the", "object", "as", "XML", "to", "a", "writer", "." ]
bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b
https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java#L272-L286
47,368
jmchilton/galaxy-bootstrap
src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java
GalaxyProperties.shouldConfigureVirtualenv
public boolean shouldConfigureVirtualenv() { if(this.configureVirtualenv == ConfigureVirtualenv.NO) { return false; } else if(this.configureVirtualenv == ConfigureVirtualenv.YES) { return true; } else { final Optional<File> whichVirtualenv = this.which("virtualenv"); return whichVirt...
java
public boolean shouldConfigureVirtualenv() { if(this.configureVirtualenv == ConfigureVirtualenv.NO) { return false; } else if(this.configureVirtualenv == ConfigureVirtualenv.YES) { return true; } else { final Optional<File> whichVirtualenv = this.which("virtualenv"); return whichVirt...
[ "public", "boolean", "shouldConfigureVirtualenv", "(", ")", "{", "if", "(", "this", ".", "configureVirtualenv", "==", "ConfigureVirtualenv", ".", "NO", ")", "{", "return", "false", ";", "}", "else", "if", "(", "this", ".", "configureVirtualenv", "==", "Configu...
Determines if a virtualenv should be created for Galaxy. @return True iff a virtualenv should be created.
[ "Determines", "if", "a", "virtualenv", "should", "be", "created", "for", "Galaxy", "." ]
4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649
https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java#L110-L119
47,369
jmchilton/galaxy-bootstrap
src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java
GalaxyProperties.isPre20141006Release
public boolean isPre20141006Release(File galaxyRoot) { if (galaxyRoot == null) { throw new IllegalArgumentException("galaxyRoot is null"); } else if (!galaxyRoot.exists()) { throw new IllegalArgumentException("galaxyRoot=" + galaxyRoot.getAbsolutePath() + " does not exist"); } File conf...
java
public boolean isPre20141006Release(File galaxyRoot) { if (galaxyRoot == null) { throw new IllegalArgumentException("galaxyRoot is null"); } else if (!galaxyRoot.exists()) { throw new IllegalArgumentException("galaxyRoot=" + galaxyRoot.getAbsolutePath() + " does not exist"); } File conf...
[ "public", "boolean", "isPre20141006Release", "(", "File", "galaxyRoot", ")", "{", "if", "(", "galaxyRoot", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"galaxyRoot is null\"", ")", ";", "}", "else", "if", "(", "!", "galaxyRoot", "...
Determines if this is a pre-2014.10.06 release of Galaxy. @param galaxyRoot The root directory of Galaxy. @return True if this is a pre-2014.10.06 release of Galaxy, false otherwise.
[ "Determines", "if", "this", "is", "a", "pre", "-", "2014", ".", "10", ".", "06", "release", "of", "Galaxy", "." ]
4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649
https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java#L126-L135
47,370
jmchilton/galaxy-bootstrap
src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java
GalaxyProperties.getConfigSampleIni
private File getConfigSampleIni(File galaxyRoot) { if (isPre20141006Release(galaxyRoot)) { return new File(galaxyRoot, "universe_wsgi.ini.sample"); } else { File configDirectory = new File(galaxyRoot, CONFIG_DIR_NAME); return new File(configDirectory, "galaxy.ini.sample"); } }
java
private File getConfigSampleIni(File galaxyRoot) { if (isPre20141006Release(galaxyRoot)) { return new File(galaxyRoot, "universe_wsgi.ini.sample"); } else { File configDirectory = new File(galaxyRoot, CONFIG_DIR_NAME); return new File(configDirectory, "galaxy.ini.sample"); } }
[ "private", "File", "getConfigSampleIni", "(", "File", "galaxyRoot", ")", "{", "if", "(", "isPre20141006Release", "(", "galaxyRoot", ")", ")", "{", "return", "new", "File", "(", "galaxyRoot", ",", "\"universe_wsgi.ini.sample\"", ")", ";", "}", "else", "{", "Fil...
Gets the sample config ini for this Galaxy installation. @param galaxyRoot The root directory of Galaxy. @return A File object for the sample config ini for Galaxy.
[ "Gets", "the", "sample", "config", "ini", "for", "this", "Galaxy", "installation", "." ]
4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649
https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java#L142-L149
47,371
jmchilton/galaxy-bootstrap
src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java
GalaxyProperties.getConfigIni
private File getConfigIni(File galaxyRoot) { if (isPre20141006Release(galaxyRoot)) { return new File(galaxyRoot, "universe_wsgi.ini"); } else { File configDirectory = new File(galaxyRoot, CONFIG_DIR_NAME); return new File(configDirectory, "galaxy.ini"); } }
java
private File getConfigIni(File galaxyRoot) { if (isPre20141006Release(galaxyRoot)) { return new File(galaxyRoot, "universe_wsgi.ini"); } else { File configDirectory = new File(galaxyRoot, CONFIG_DIR_NAME); return new File(configDirectory, "galaxy.ini"); } }
[ "private", "File", "getConfigIni", "(", "File", "galaxyRoot", ")", "{", "if", "(", "isPre20141006Release", "(", "galaxyRoot", ")", ")", "{", "return", "new", "File", "(", "galaxyRoot", ",", "\"universe_wsgi.ini\"", ")", ";", "}", "else", "{", "File", "config...
Gets the config ini for this Galaxy installation. @param galaxyRoot The root directory of Galaxy. @return A File object for the config ini for Galaxy.
[ "Gets", "the", "config", "ini", "for", "this", "Galaxy", "installation", "." ]
4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649
https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java#L156-L163
47,372
jbundle/webapp
base/src/main/java/org/jbundle/util/webapp/base/BaseWebappServlet.java
BaseWebappServlet.init
@SuppressWarnings("unchecked") public void init(ServletConfig config) throws ServletException { super.init(config); // Move init params to my properties Enumeration<String> paramNames = this.getInitParameterNames(); while (paramNames.hasMoreElements()) { Strin...
java
@SuppressWarnings("unchecked") public void init(ServletConfig config) throws ServletException { super.init(config); // Move init params to my properties Enumeration<String> paramNames = this.getInitParameterNames(); while (paramNames.hasMoreElements()) { Strin...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "init", "(", "ServletConfig", "config", ")", "throws", "ServletException", "{", "super", ".", "init", "(", "config", ")", ";", "// Move init params to my properties", "Enumeration", "<", "String",...
web servlet init method. @exception ServletException From inherited class.
[ "web", "servlet", "init", "method", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/BaseWebappServlet.java#L72-L85
47,373
jbundle/webapp
base/src/main/java/org/jbundle/util/webapp/base/BaseWebappServlet.java
BaseWebappServlet.getRequestParam
public String getRequestParam(HttpServletRequest request, String param, String defaultValue) { String value = request.getParameter(servicePid + '.' + param); if ((value == null) && (properties != null)) value = properties.get(servicePid + '.' + param); if (value == null) ...
java
public String getRequestParam(HttpServletRequest request, String param, String defaultValue) { String value = request.getParameter(servicePid + '.' + param); if ((value == null) && (properties != null)) value = properties.get(servicePid + '.' + param); if (value == null) ...
[ "public", "String", "getRequestParam", "(", "HttpServletRequest", "request", ",", "String", "param", ",", "String", "defaultValue", ")", "{", "String", "value", "=", "request", ".", "getParameter", "(", "servicePid", "+", "'", "'", "+", "param", ")", ";", "i...
Get this param from the request or from the servlet's properties. @param request @param param @param defaultValue @return
[ "Get", "this", "param", "from", "the", "request", "or", "from", "the", "servlet", "s", "properties", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/BaseWebappServlet.java#L124-L136
47,374
LevelFourAB/commons
commons-config/src/main/java/se/l4/commons/config/internal/RawFormatReader.java
RawFormatReader.readMap
private static Map<String, Object> readMap(StreamingInput input) throws IOException { boolean readEnd = false; if(input.peek() == Token.OBJECT_START) { // Check if the object is wrapped readEnd = true; input.next(); } Token t; Map<String, Object> result = new HashMap<String, Object>(); while(...
java
private static Map<String, Object> readMap(StreamingInput input) throws IOException { boolean readEnd = false; if(input.peek() == Token.OBJECT_START) { // Check if the object is wrapped readEnd = true; input.next(); } Token t; Map<String, Object> result = new HashMap<String, Object>(); while(...
[ "private", "static", "Map", "<", "String", ",", "Object", ">", "readMap", "(", "StreamingInput", "input", ")", "throws", "IOException", "{", "boolean", "readEnd", "=", "false", ";", "if", "(", "input", ".", "peek", "(", ")", "==", "Token", ".", "OBJECT_S...
Read a single map from the input, optionally while reading object start and end tokens. @param input @return @throws IOException
[ "Read", "a", "single", "map", "from", "the", "input", "optionally", "while", "reading", "object", "start", "and", "end", "tokens", "." ]
aa121b3a5504b43d0c10450a1b984694fcd2b8ee
https://github.com/LevelFourAB/commons/blob/aa121b3a5504b43d0c10450a1b984694fcd2b8ee/commons-config/src/main/java/se/l4/commons/config/internal/RawFormatReader.java#L80-L111
47,375
LevelFourAB/commons
commons-config/src/main/java/se/l4/commons/config/internal/RawFormatReader.java
RawFormatReader.readList
private static List<Object> readList(StreamingInput input) throws IOException { input.next(Token.LIST_START); List<Object> result = new ArrayList<Object>(); while(input.peek() != Token.LIST_END) { // Read the value Object value = readDynamic(input); result.add(value); } input.next(Token.LIST_E...
java
private static List<Object> readList(StreamingInput input) throws IOException { input.next(Token.LIST_START); List<Object> result = new ArrayList<Object>(); while(input.peek() != Token.LIST_END) { // Read the value Object value = readDynamic(input); result.add(value); } input.next(Token.LIST_E...
[ "private", "static", "List", "<", "Object", ">", "readList", "(", "StreamingInput", "input", ")", "throws", "IOException", "{", "input", ".", "next", "(", "Token", ".", "LIST_START", ")", ";", "List", "<", "Object", ">", "result", "=", "new", "ArrayList", ...
Read a list from the input. @param input @return @throws IOException
[ "Read", "a", "list", "from", "the", "input", "." ]
aa121b3a5504b43d0c10450a1b984694fcd2b8ee
https://github.com/LevelFourAB/commons/blob/aa121b3a5504b43d0c10450a1b984694fcd2b8ee/commons-config/src/main/java/se/l4/commons/config/internal/RawFormatReader.java#L120-L136
47,376
LevelFourAB/commons
commons-config/src/main/java/se/l4/commons/config/internal/RawFormatReader.java
RawFormatReader.readDynamic
private static Object readDynamic(StreamingInput input) throws IOException { switch(input.peek()) { case VALUE: input.next(); return input.getValue(); case NULL: input.next(); return input.getValue(); case LIST_START: return readList(input); case OBJECT_START: return readMap(i...
java
private static Object readDynamic(StreamingInput input) throws IOException { switch(input.peek()) { case VALUE: input.next(); return input.getValue(); case NULL: input.next(); return input.getValue(); case LIST_START: return readList(input); case OBJECT_START: return readMap(i...
[ "private", "static", "Object", "readDynamic", "(", "StreamingInput", "input", ")", "throws", "IOException", "{", "switch", "(", "input", ".", "peek", "(", ")", ")", "{", "case", "VALUE", ":", "input", ".", "next", "(", ")", ";", "return", "input", ".", ...
Depending on the next token read either a value, a list or a map. @param input @return @throws IOException
[ "Depending", "on", "the", "next", "token", "read", "either", "a", "value", "a", "list", "or", "a", "map", "." ]
aa121b3a5504b43d0c10450a1b984694fcd2b8ee
https://github.com/LevelFourAB/commons/blob/aa121b3a5504b43d0c10450a1b984694fcd2b8ee/commons-config/src/main/java/se/l4/commons/config/internal/RawFormatReader.java#L145-L163
47,377
akberc/ceylon-maven-plugin
src/main/java/com/dgwave/car/maven/CeylonInstall.java
CeylonInstall.execute
public void execute() throws MojoExecutionException { try { repositoryPath = findRepoPath(this.ceylonRepository); ArtifactRepositoryLayout layout = new CeylonRepoLayout(); getLog().debug("Layout: " + layout.getClass()); localRepository = ne...
java
public void execute() throws MojoExecutionException { try { repositoryPath = findRepoPath(this.ceylonRepository); ArtifactRepositoryLayout layout = new CeylonRepoLayout(); getLog().debug("Layout: " + layout.getClass()); localRepository = ne...
[ "public", "void", "execute", "(", ")", "throws", "MojoExecutionException", "{", "try", "{", "repositoryPath", "=", "findRepoPath", "(", "this", ".", "ceylonRepository", ")", ";", "ArtifactRepositoryLayout", "layout", "=", "new", "CeylonRepoLayout", "(", ")", ";", ...
MoJo execute. @see org.apache.maven.plugin.Mojo#execute() @throws MojoExecutionException In case of an error
[ "MoJo", "execute", "." ]
b7f6c4a2b24f2fa237350c9e715f4193e83415ef
https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/maven/CeylonInstall.java#L92-L128
47,378
akberc/ceylon-maven-plugin
src/main/java/com/dgwave/car/maven/CeylonInstall.java
CeylonInstall.installProject
private void installProject(final MavenProject mavenProject) throws MojoExecutionException { Artifact artifact = mavenProject.getArtifact(); String packaging = mavenProject.getPackaging(); boolean isPomArtifact = "pom".equals(packaging); try { // skip copying pom to ...
java
private void installProject(final MavenProject mavenProject) throws MojoExecutionException { Artifact artifact = mavenProject.getArtifact(); String packaging = mavenProject.getPackaging(); boolean isPomArtifact = "pom".equals(packaging); try { // skip copying pom to ...
[ "private", "void", "installProject", "(", "final", "MavenProject", "mavenProject", ")", "throws", "MojoExecutionException", "{", "Artifact", "artifact", "=", "mavenProject", ".", "getArtifact", "(", ")", ";", "String", "packaging", "=", "mavenProject", ".", "getPack...
Does the actual installation of the project's main artifact. @param mavenProject The Maven project @throws MojoExecutionException In case of error while installing
[ "Does", "the", "actual", "installation", "of", "the", "project", "s", "main", "artifact", "." ]
b7f6c4a2b24f2fa237350c9e715f4193e83415ef
https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/maven/CeylonInstall.java#L136-L166
47,379
akberc/ceylon-maven-plugin
src/main/java/com/dgwave/car/maven/CeylonInstall.java
CeylonInstall.install
void install(final File file, final Artifact artifact, final ArtifactRepository repo) throws MojoExecutionException { File destFile = new File(repo.getBasedir() + File.separator + repo.getLayout().pathOf(artifact)); destFile.getParentFile().mkdirs(); try { ...
java
void install(final File file, final Artifact artifact, final ArtifactRepository repo) throws MojoExecutionException { File destFile = new File(repo.getBasedir() + File.separator + repo.getLayout().pathOf(artifact)); destFile.getParentFile().mkdirs(); try { ...
[ "void", "install", "(", "final", "File", "file", ",", "final", "Artifact", "artifact", ",", "final", "ArtifactRepository", "repo", ")", "throws", "MojoExecutionException", "{", "File", "destFile", "=", "new", "File", "(", "repo", ".", "getBasedir", "(", ")", ...
The actual copy. @param file The actual file packaged by the Maven project @param artifact The artifact to be installed @param repo The Ceylon repository to install to @throws MojoExecutionException In case of IO error
[ "The", "actual", "copy", "." ]
b7f6c4a2b24f2fa237350c9e715f4193e83415ef
https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/maven/CeylonInstall.java#L176-L186
47,380
akberc/ceylon-maven-plugin
src/main/java/com/dgwave/car/maven/CeylonInstall.java
CeylonInstall.calculateDependencies
String calculateDependencies(final MavenProject proj) throws MojoExecutionException { Module module = new Module( new ModuleIdentifier(CeylonUtil.ceylonModuleBaseName(proj.getGroupId(), proj.getArtifactId()), proj.getVersion(), false, false)); for (De...
java
String calculateDependencies(final MavenProject proj) throws MojoExecutionException { Module module = new Module( new ModuleIdentifier(CeylonUtil.ceylonModuleBaseName(proj.getGroupId(), proj.getArtifactId()), proj.getVersion(), false, false)); for (De...
[ "String", "calculateDependencies", "(", "final", "MavenProject", "proj", ")", "throws", "MojoExecutionException", "{", "Module", "module", "=", "new", "Module", "(", "new", "ModuleIdentifier", "(", "CeylonUtil", ".", "ceylonModuleBaseName", "(", "proj", ".", "getGro...
Determines dependencies from the Maven project model. @param proj The Maven project @return String of dependency lines @throws MojoExecutionException In case the dependency version could not be determined
[ "Determines", "dependencies", "from", "the", "Maven", "project", "model", "." ]
b7f6c4a2b24f2fa237350c9e715f4193e83415ef
https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/maven/CeylonInstall.java#L195-L227
47,381
akberc/ceylon-maven-plugin
src/main/java/com/dgwave/car/maven/CeylonInstall.java
CeylonInstall.findRepoPath
File findRepoPath(final String repoAlias) { if ("user".equals(repoAlias)) { return new File(System.getProperty("user.home") + CeylonUtil.PATH_SEPARATOR + ".ceylon/repo"); } else if ("cache".equals(repoAlias)) { return new File(System.getPro...
java
File findRepoPath(final String repoAlias) { if ("user".equals(repoAlias)) { return new File(System.getProperty("user.home") + CeylonUtil.PATH_SEPARATOR + ".ceylon/repo"); } else if ("cache".equals(repoAlias)) { return new File(System.getPro...
[ "File", "findRepoPath", "(", "final", "String", "repoAlias", ")", "{", "if", "(", "\"user\"", ".", "equals", "(", "repoAlias", ")", ")", "{", "return", "new", "File", "(", "System", ".", "getProperty", "(", "\"user.home\"", ")", "+", "CeylonUtil", ".", "...
Find the Ceylon repository path from the alias. @param repoAlias The Ceylon repository alias @return File The file representing the path to the repo
[ "Find", "the", "Ceylon", "repository", "path", "from", "the", "alias", "." ]
b7f6c4a2b24f2fa237350c9e715f4193e83415ef
https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/maven/CeylonInstall.java#L235-L254
47,382
akberc/ceylon-maven-plugin
src/main/java/com/dgwave/car/maven/CeylonInstall.java
CeylonInstall.installAdditional
void installAdditional(final File installedFile, final String fileExt, final String payload, final boolean chop) throws MojoExecutionException { File additionalFile = null; if (chop) { String path = installedFile.getAbsolutePath(); additionalFile = new File(path....
java
void installAdditional(final File installedFile, final String fileExt, final String payload, final boolean chop) throws MojoExecutionException { File additionalFile = null; if (chop) { String path = installedFile.getAbsolutePath(); additionalFile = new File(path....
[ "void", "installAdditional", "(", "final", "File", "installedFile", ",", "final", "String", "fileExt", ",", "final", "String", "payload", ",", "final", "boolean", "chop", ")", "throws", "MojoExecutionException", "{", "File", "additionalFile", "=", "null", ";", "...
Installs additional files into the same repo directory as the artifact. @param installedFile The artifact to which this additional file is related @param fileExt The full file name or extension (begins with .) of the additional file @param payload The String to write to the additional file @param chop True of it repla...
[ "Installs", "additional", "files", "into", "the", "same", "repo", "directory", "as", "the", "artifact", "." ]
b7f6c4a2b24f2fa237350c9e715f4193e83415ef
https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/maven/CeylonInstall.java#L289-L309
47,383
berkesa/datatree-promise
src/main/java/io/datatree/Promise.java
Promise.complete
public boolean complete(Number value) { return root.complete(new Tree((Tree) null, null, value)); }
java
public boolean complete(Number value) { return root.complete(new Tree((Tree) null, null, value)); }
[ "public", "boolean", "complete", "(", "Number", "value", ")", "{", "return", "root", ".", "complete", "(", "new", "Tree", "(", "(", "Tree", ")", "null", ",", "null", ",", "value", ")", ")", ";", "}" ]
If not already completed, sets the value to the given numeric value. @param value the value of the Promise @return {@code true} if this invocation caused this Promise to transition to a completed state, else {@code false}
[ "If", "not", "already", "completed", "sets", "the", "value", "to", "the", "given", "numeric", "value", "." ]
d9093bdb549f69b83b3eff5e29cd511f2014f177
https://github.com/berkesa/datatree-promise/blob/d9093bdb549f69b83b3eff5e29cd511f2014f177/src/main/java/io/datatree/Promise.java#L589-L591
47,384
berkesa/datatree-promise
src/main/java/io/datatree/Promise.java
Promise.complete
public boolean complete(String value) { return root.complete(new Tree((Tree) null, null, value)); }
java
public boolean complete(String value) { return root.complete(new Tree((Tree) null, null, value)); }
[ "public", "boolean", "complete", "(", "String", "value", ")", "{", "return", "root", ".", "complete", "(", "new", "Tree", "(", "(", "Tree", ")", "null", ",", "null", ",", "value", ")", ")", ";", "}" ]
If not already completed, sets the value to the given text. @param value the value of the Promise @return {@code true} if this invocation caused this Promise to transition to a completed state, else {@code false}
[ "If", "not", "already", "completed", "sets", "the", "value", "to", "the", "given", "text", "." ]
d9093bdb549f69b83b3eff5e29cd511f2014f177
https://github.com/berkesa/datatree-promise/blob/d9093bdb549f69b83b3eff5e29cd511f2014f177/src/main/java/io/datatree/Promise.java#L628-L630
47,385
berkesa/datatree-promise
src/main/java/io/datatree/Promise.java
Promise.complete
public boolean complete(Date value) { return root.complete(new Tree((Tree) null, null, value)); }
java
public boolean complete(Date value) { return root.complete(new Tree((Tree) null, null, value)); }
[ "public", "boolean", "complete", "(", "Date", "value", ")", "{", "return", "root", ".", "complete", "(", "new", "Tree", "(", "(", "Tree", ")", "null", ",", "null", ",", "value", ")", ")", ";", "}" ]
If not already completed, sets the value to the given date. @param value the value of the Promise @return {@code true} if this invocation caused this Promise to transition to a completed state, else {@code false}
[ "If", "not", "already", "completed", "sets", "the", "value", "to", "the", "given", "date", "." ]
d9093bdb549f69b83b3eff5e29cd511f2014f177
https://github.com/berkesa/datatree-promise/blob/d9093bdb549f69b83b3eff5e29cd511f2014f177/src/main/java/io/datatree/Promise.java#L641-L643
47,386
berkesa/datatree-promise
src/main/java/io/datatree/Promise.java
Promise.complete
public boolean complete(UUID value) { return root.complete(new Tree((Tree) null, null, value)); }
java
public boolean complete(UUID value) { return root.complete(new Tree((Tree) null, null, value)); }
[ "public", "boolean", "complete", "(", "UUID", "value", ")", "{", "return", "root", ".", "complete", "(", "new", "Tree", "(", "(", "Tree", ")", "null", ",", "null", ",", "value", ")", ")", ";", "}" ]
If not already completed, sets the value to the given UUID. @param value the value of the Promise @return {@code true} if this invocation caused this Promise to transition to a completed state, else {@code false}
[ "If", "not", "already", "completed", "sets", "the", "value", "to", "the", "given", "UUID", "." ]
d9093bdb549f69b83b3eff5e29cd511f2014f177
https://github.com/berkesa/datatree-promise/blob/d9093bdb549f69b83b3eff5e29cd511f2014f177/src/main/java/io/datatree/Promise.java#L654-L656
47,387
berkesa/datatree-promise
src/main/java/io/datatree/Promise.java
Promise.complete
public boolean complete(InetAddress value) { return root.complete(new Tree((Tree) null, null, value)); }
java
public boolean complete(InetAddress value) { return root.complete(new Tree((Tree) null, null, value)); }
[ "public", "boolean", "complete", "(", "InetAddress", "value", ")", "{", "return", "root", ".", "complete", "(", "new", "Tree", "(", "(", "Tree", ")", "null", ",", "null", ",", "value", ")", ")", ";", "}" ]
If not already completed, sets the value to the given InetAddress. @param value the value of the Promise @return {@code true} if this invocation caused this Promise to transition to a completed state, else {@code false}
[ "If", "not", "already", "completed", "sets", "the", "value", "to", "the", "given", "InetAddress", "." ]
d9093bdb549f69b83b3eff5e29cd511f2014f177
https://github.com/berkesa/datatree-promise/blob/d9093bdb549f69b83b3eff5e29cd511f2014f177/src/main/java/io/datatree/Promise.java#L667-L669
47,388
berkesa/datatree-promise
src/main/java/io/datatree/Promise.java
Promise.race
public static final Promise race(Promise... promises) { if (promises == null || promises.length == 0) { return Promise.resolve(); } @SuppressWarnings("unchecked") CompletableFuture<Tree>[] futures = new CompletableFuture[promises.length]; for (int i = 0; i < promises.length; i++) { futures[i] =...
java
public static final Promise race(Promise... promises) { if (promises == null || promises.length == 0) { return Promise.resolve(); } @SuppressWarnings("unchecked") CompletableFuture<Tree>[] futures = new CompletableFuture[promises.length]; for (int i = 0; i < promises.length; i++) { futures[i] =...
[ "public", "static", "final", "Promise", "race", "(", "Promise", "...", "promises", ")", "{", "if", "(", "promises", "==", "null", "||", "promises", ".", "length", "==", "0", ")", "{", "return", "Promise", ".", "resolve", "(", ")", ";", "}", "@", "Sup...
Returns a new Promise that is completed when any of the given Promises complete, with the same result. Otherwise, if it completed exceptionally, the returned Promise also does so, with a CompletionException holding this exception as its cause. @param promises array of Promises @return a new Promise that is completed ...
[ "Returns", "a", "new", "Promise", "that", "is", "completed", "when", "any", "of", "the", "given", "Promises", "complete", "with", "the", "same", "result", ".", "Otherwise", "if", "it", "completed", "exceptionally", "the", "returned", "Promise", "also", "does",...
d9093bdb549f69b83b3eff5e29cd511f2014f177
https://github.com/berkesa/datatree-promise/blob/d9093bdb549f69b83b3eff5e29cd511f2014f177/src/main/java/io/datatree/Promise.java#L896-L920
47,389
berkesa/datatree-promise
src/main/java/io/datatree/Promise.java
Promise.toTree
@SuppressWarnings("unchecked") protected static final Tree toTree(Object object) { if (object == null) { return new Tree((Tree) null, null, null); } if (object instanceof Tree) { return (Tree) object; } if (object instanceof Map) { return new Tree((Map<String, Object>) object); } retu...
java
@SuppressWarnings("unchecked") protected static final Tree toTree(Object object) { if (object == null) { return new Tree((Tree) null, null, null); } if (object instanceof Tree) { return (Tree) object; } if (object instanceof Map) { return new Tree((Map<String, Object>) object); } retu...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "static", "final", "Tree", "toTree", "(", "Object", "object", ")", "{", "if", "(", "object", "==", "null", ")", "{", "return", "new", "Tree", "(", "(", "Tree", ")", "null", ",", "null", "...
Converts an Object to a Tree. @param object input Object @return object converted to Tree
[ "Converts", "an", "Object", "to", "a", "Tree", "." ]
d9093bdb549f69b83b3eff5e29cd511f2014f177
https://github.com/berkesa/datatree-promise/blob/d9093bdb549f69b83b3eff5e29cd511f2014f177/src/main/java/io/datatree/Promise.java#L959-L971
47,390
jbundle/webapp
base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java
HttpServiceTracker.addingService
public Object addingService(ServiceReference reference) { HttpService httpService = (HttpService) context.getService(reference); this.properties = this.updateDictionaryConfig(this.properties, true); try { String alias = this.getAlias(); String servicePid = this.prope...
java
public Object addingService(ServiceReference reference) { HttpService httpService = (HttpService) context.getService(reference); this.properties = this.updateDictionaryConfig(this.properties, true); try { String alias = this.getAlias(); String servicePid = this.prope...
[ "public", "Object", "addingService", "(", "ServiceReference", "reference", ")", "{", "HttpService", "httpService", "=", "(", "HttpService", ")", "context", ".", "getService", "(", "reference", ")", ";", "this", ".", "properties", "=", "this", ".", "updateDiction...
Http Service is up, add my servlets.
[ "Http", "Service", "is", "up", "add", "my", "servlets", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java#L63-L89
47,391
jbundle/webapp
base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java
HttpServiceTracker.makeServlet
public Servlet makeServlet(String alias, Dictionary<String, String> dictionary) { String servletClass = dictionary.get(BundleConstants.SERVICE_CLASS); return (Servlet)ClassServiceUtility.getClassService().makeObjectFromClassName(servletClass); }
java
public Servlet makeServlet(String alias, Dictionary<String, String> dictionary) { String servletClass = dictionary.get(BundleConstants.SERVICE_CLASS); return (Servlet)ClassServiceUtility.getClassService().makeObjectFromClassName(servletClass); }
[ "public", "Servlet", "makeServlet", "(", "String", "alias", ",", "Dictionary", "<", "String", ",", "String", ">", "dictionary", ")", "{", "String", "servletClass", "=", "dictionary", ".", "get", "(", "BundleConstants", ".", "SERVICE_CLASS", ")", ";", "return",...
Create the servlet. The SERVLET_CLASS property must be supplied. @param alias @param dictionary @return
[ "Create", "the", "servlet", ".", "The", "SERVLET_CLASS", "property", "must", "be", "supplied", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java#L98-L102
47,392
jbundle/webapp
base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java
HttpServiceTracker.removeService
public void removeService(ServiceReference reference, Object service) { if (serviceRegistration != null) { serviceRegistration.unregister(); serviceRegistration = null; } String alias = this.getAlias(); ((HttpService) service).unregister(alias); if (servl...
java
public void removeService(ServiceReference reference, Object service) { if (serviceRegistration != null) { serviceRegistration.unregister(); serviceRegistration = null; } String alias = this.getAlias(); ((HttpService) service).unregister(alias); if (servl...
[ "public", "void", "removeService", "(", "ServiceReference", "reference", ",", "Object", "service", ")", "{", "if", "(", "serviceRegistration", "!=", "null", ")", "{", "serviceRegistration", ".", "unregister", "(", ")", ";", "serviceRegistration", "=", "null", ";...
Http Service is down, remove my servlet.
[ "Http", "Service", "is", "down", "remove", "my", "servlet", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java#L107-L118
47,393
jbundle/webapp
base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java
HttpServiceTracker.getAlias
public String getAlias() { String alias = this.properties.get(BaseWebappServlet.ALIAS); if (alias == null) alias = this.properties.get(BaseWebappServlet.ALIAS.substring(BaseWebappServlet.PROPERTY_PREFIX.length())); return HttpServiceTracker.addURLPath(null, alias); }
java
public String getAlias() { String alias = this.properties.get(BaseWebappServlet.ALIAS); if (alias == null) alias = this.properties.get(BaseWebappServlet.ALIAS.substring(BaseWebappServlet.PROPERTY_PREFIX.length())); return HttpServiceTracker.addURLPath(null, alias); }
[ "public", "String", "getAlias", "(", ")", "{", "String", "alias", "=", "this", ".", "properties", ".", "get", "(", "BaseWebappServlet", ".", "ALIAS", ")", ";", "if", "(", "alias", "==", "null", ")", "alias", "=", "this", ".", "properties", ".", "get", ...
Get the web context path from the service name. @return
[ "Get", "the", "web", "context", "path", "from", "the", "service", "name", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java#L171-L177
47,394
jbundle/webapp
base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java
HttpServiceTracker.calculateWebAlias
public String calculateWebAlias(Dictionary<String, String> dictionary) { String alias = dictionary.get(BaseWebappServlet.ALIAS); if (alias == null) alias = dictionary.get(BaseWebappServlet.ALIAS.substring(BaseWebappServlet.PROPERTY_PREFIX.length())); if (alias == null) ...
java
public String calculateWebAlias(Dictionary<String, String> dictionary) { String alias = dictionary.get(BaseWebappServlet.ALIAS); if (alias == null) alias = dictionary.get(BaseWebappServlet.ALIAS.substring(BaseWebappServlet.PROPERTY_PREFIX.length())); if (alias == null) ...
[ "public", "String", "calculateWebAlias", "(", "Dictionary", "<", "String", ",", "String", ">", "dictionary", ")", "{", "String", "alias", "=", "dictionary", ".", "get", "(", "BaseWebappServlet", ".", "ALIAS", ")", ";", "if", "(", "alias", "==", "null", ")"...
Figure out the correct web alias. @param dictionary @return
[ "Figure", "out", "the", "correct", "web", "alias", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java#L184-L198
47,395
jbundle/webapp
base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java
HttpServiceTracker.configPropertiesUpdated
public void configPropertiesUpdated(Dictionary<String, String> properties) { if (HttpServiceTracker.propertiesEqual(properties, configProperties)) return; configProperties = properties; ServiceReference reference = context.getServiceReference(HttpService.class.getName()); ...
java
public void configPropertiesUpdated(Dictionary<String, String> properties) { if (HttpServiceTracker.propertiesEqual(properties, configProperties)) return; configProperties = properties; ServiceReference reference = context.getServiceReference(HttpService.class.getName()); ...
[ "public", "void", "configPropertiesUpdated", "(", "Dictionary", "<", "String", ",", "String", ">", "properties", ")", "{", "if", "(", "HttpServiceTracker", ".", "propertiesEqual", "(", "properties", ",", "configProperties", ")", ")", "return", ";", "configProperti...
Update the servlet's properties. Called when the configuration changes. @param contextPath
[ "Update", "the", "servlet", "s", "properties", ".", "Called", "when", "the", "configuration", "changes", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java#L240-L275
47,396
jbundle/webapp
base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java
HttpServiceTracker.changeServletProperties
public boolean changeServletProperties(Servlet servlet, Dictionary<String, String> properties) { if (servlet instanceof WebappServlet) { Dictionary<String, String> dictionary = ((WebappServlet)servlet).getProperties(); properties = BaseBundleActivator.putAll(properties, dicti...
java
public boolean changeServletProperties(Servlet servlet, Dictionary<String, String> properties) { if (servlet instanceof WebappServlet) { Dictionary<String, String> dictionary = ((WebappServlet)servlet).getProperties(); properties = BaseBundleActivator.putAll(properties, dicti...
[ "public", "boolean", "changeServletProperties", "(", "Servlet", "servlet", ",", "Dictionary", "<", "String", ",", "String", ">", "properties", ")", "{", "if", "(", "servlet", "instanceof", "WebappServlet", ")", "{", "Dictionary", "<", "String", ",", "String", ...
Change the servlet properties to these properties. @param servlet @param properties @return
[ "Change", "the", "servlet", "properties", "to", "these", "properties", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java#L283-L291
47,397
jbundle/webapp
base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java
HttpServiceTracker.setServletProperties
public boolean setServletProperties(Servlet servlet, Dictionary<String, String> properties) { this.properties = properties; if (servlet instanceof WebappServlet) return ((WebappServlet)servlet).setProperties(properties); return true; // Success }
java
public boolean setServletProperties(Servlet servlet, Dictionary<String, String> properties) { this.properties = properties; if (servlet instanceof WebappServlet) return ((WebappServlet)servlet).setProperties(properties); return true; // Success }
[ "public", "boolean", "setServletProperties", "(", "Servlet", "servlet", ",", "Dictionary", "<", "String", ",", "String", ">", "properties", ")", "{", "this", ".", "properties", "=", "properties", ";", "if", "(", "servlet", "instanceof", "WebappServlet", ")", "...
Set the serlvlet's properties. @param servlet @param properties @return
[ "Set", "the", "serlvlet", "s", "properties", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java#L299-L305
47,398
jbundle/webapp
base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java
HttpServiceTracker.propertiesEqual
public static boolean propertiesEqual(Dictionary<String, String> properties, Dictionary<String, String> dictionary) { Enumeration<String> props = properties.keys(); while (props.hasMoreElements()) { String key = props.nextElement(); if (!properties.get(key).equals(dic...
java
public static boolean propertiesEqual(Dictionary<String, String> properties, Dictionary<String, String> dictionary) { Enumeration<String> props = properties.keys(); while (props.hasMoreElements()) { String key = props.nextElement(); if (!properties.get(key).equals(dic...
[ "public", "static", "boolean", "propertiesEqual", "(", "Dictionary", "<", "String", ",", "String", ">", "properties", ",", "Dictionary", "<", "String", ",", "String", ">", "dictionary", ")", "{", "Enumeration", "<", "String", ">", "props", "=", "properties", ...
Are these properties equal. @param properties @param dictionary @return
[ "Are", "these", "properties", "equal", "." ]
af2cf32bd92254073052f1f9b4bcd47c2f76ba7d
https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/HttpServiceTracker.java#L313-L330
47,399
jmchilton/galaxy-bootstrap
src/main/java/com/github/jmchilton/galaxybootstrap/BootStrapper.java
BootStrapper.buildLogPath
private String buildLogPath(File bootstrapLogDir, String logFileName) { return new File(bootstrapLogDir, logFileName).getAbsolutePath(); }
java
private String buildLogPath(File bootstrapLogDir, String logFileName) { return new File(bootstrapLogDir, logFileName).getAbsolutePath(); }
[ "private", "String", "buildLogPath", "(", "File", "bootstrapLogDir", ",", "String", "logFileName", ")", "{", "return", "new", "File", "(", "bootstrapLogDir", ",", "logFileName", ")", ".", "getAbsolutePath", "(", ")", ";", "}" ]
Constructs a path of a file under the bootstrap log directory. @param bootstrapLogDir The File defining the log directory. @param logFileName The name of the log file. @return The full path to the log file.
[ "Constructs", "a", "path", "of", "a", "file", "under", "the", "bootstrap", "log", "directory", "." ]
4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649
https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/BootStrapper.java#L71-L73