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
partition
stringclasses
1 value
Ellzord/JALSE
src/main/java/jalse/entities/DefaultEntity.java
DefaultEntity.addContainerTags
protected void addContainerTags() { // Only add root if we aren't it final RootContainer rc = getRootContainer(container); if (rc != null) { tags.add(rc); } final TreeDepth parentDepth = getTreeDepth(container); tags.add(parentDepth != null ? parentDepth.increment() : TreeDepth.ROOT); }
java
protected void addContainerTags() { // Only add root if we aren't it final RootContainer rc = getRootContainer(container); if (rc != null) { tags.add(rc); } final TreeDepth parentDepth = getTreeDepth(container); tags.add(parentDepth != null ? parentDepth.increment() : TreeDepth.ROOT); }
[ "protected", "void", "addContainerTags", "(", ")", "{", "// Only add root if we aren't it", "final", "RootContainer", "rc", "=", "getRootContainer", "(", "container", ")", ";", "if", "(", "rc", "!=", "null", ")", "{", "tags", ".", "add", "(", "rc", ")", ";",...
Adds tree based tags for when a non-null container is set. @see RootContainer @see TreeDepth
[ "Adds", "tree", "based", "tags", "for", "when", "a", "non", "-", "null", "container", "is", "set", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/entities/DefaultEntity.java#L127-L136
train
Ellzord/JALSE
src/main/java/jalse/entities/DefaultEntity.java
DefaultEntity.removeContainerTags
protected void removeContainerTags() { tags.removeOfType(TreeMember.class); tags.removeOfType(RootContainer.class); tags.removeOfType(TreeDepth.class); }
java
protected void removeContainerTags() { tags.removeOfType(TreeMember.class); tags.removeOfType(RootContainer.class); tags.removeOfType(TreeDepth.class); }
[ "protected", "void", "removeContainerTags", "(", ")", "{", "tags", ".", "removeOfType", "(", "TreeMember", ".", "class", ")", ";", "tags", ".", "removeOfType", "(", "RootContainer", ".", "class", ")", ";", "tags", ".", "removeOfType", "(", "TreeDepth", ".", ...
Removes tree based tags for when a null container is set. @see TreeMember @see RootContainer @see TreeDepth
[ "Removes", "tree", "based", "tags", "for", "when", "a", "null", "container", "is", "set", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/entities/DefaultEntity.java#L407-L411
train
Ellzord/JALSE
src/main/java/jalse/entities/DefaultEntity.java
DefaultEntity.setContainer
protected void setContainer(final EntityContainer container) { if (!Objects.equals(this.container, container)) { this.container = container; if (!isAlive()) { return; } // Fix container based tags if (container == null) { removeContainerTags(); } else { addContainerTags(); } } }
java
protected void setContainer(final EntityContainer container) { if (!Objects.equals(this.container, container)) { this.container = container; if (!isAlive()) { return; } // Fix container based tags if (container == null) { removeContainerTags(); } else { addContainerTags(); } } }
[ "protected", "void", "setContainer", "(", "final", "EntityContainer", "container", ")", "{", "if", "(", "!", "Objects", ".", "equals", "(", "this", ".", "container", ",", "container", ")", ")", "{", "this", ".", "container", "=", "container", ";", "if", ...
Sets the parent container for the entity. @param container New parent container (can be null);
[ "Sets", "the", "parent", "container", "for", "the", "entity", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/entities/DefaultEntity.java#L463-L476
train
Ellzord/JALSE
src/main/java/jalse/entities/DefaultEntityProxyFactory.java
DefaultEntityProxyFactory.uncacheProxyOfEntity
public void uncacheProxyOfEntity(final Entity e, final Class<? extends Entity> type) { cache.invalidateType(e, type); }
java
public void uncacheProxyOfEntity(final Entity e, final Class<? extends Entity> type) { cache.invalidateType(e, type); }
[ "public", "void", "uncacheProxyOfEntity", "(", "final", "Entity", "e", ",", "final", "Class", "<", "?", "extends", "Entity", ">", "type", ")", "{", "cache", ".", "invalidateType", "(", "e", ",", "type", ")", ";", "}" ]
Uncaches the specific type proxy for an entity. @param e Entity to uncache for. @param type Proxy type.
[ "Uncaches", "the", "specific", "type", "proxy", "for", "an", "entity", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/entities/DefaultEntityProxyFactory.java#L277-L279
train
linkedin/linkedin-zookeeper
org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/tracker/ZooKeeperTreeTracker.java
ZooKeeperTreeTracker.trackNode
private Map<String, TrackedNode<T>> trackNode(String path, Map<String, TrackedNode<T>> tree, Collection<NodeEvent<T>> events, int depth) throws InterruptedException, KeeperException { if(depth > _depth) { if(log.isDebugEnabled()) log.debug(logString(path, "max depth reached ${depth}")); return tree; } TrackedNode<T> oldTrackedNode = tree.get(path); try { ZKData<T> res = _zkDataReader.readData(_zk, path, _treeWacher); TrackedNode<T> newTrackedNode = new TrackedNode<T>(path, res.getData(), res.getStat(), depth); if(oldTrackedNode != null) { if(!_zkDataReader.isEqual(oldTrackedNode.getData(), newTrackedNode.getData())) { events.add(new NodeEvent<T>(NodeEventType.UPDATED, newTrackedNode)); } } else { events.add(new NodeEvent<T>(NodeEventType.ADDED, newTrackedNode)); } tree.put(path, newTrackedNode); if(depth < _depth) { ZKChildren children = _zk.getZKChildren(path, _treeWacher); // the stat may change between the 2 calls if(!newTrackedNode.getStat().equals(children.getStat())) newTrackedNode.setStat(children.getStat()); Collections.sort(children.getChildren()); for(String child : children.getChildren()) { String childPath = PathUtils.addPaths(path, child); if(!tree.containsKey(childPath)) trackNode(childPath, tree, events, depth + 1); } } _lastZkTxId = Math.max(_lastZkTxId, newTrackedNode.getZkTxId()); _lock.notifyAll(); if(log.isDebugEnabled()) log.debug(logString(path, "start tracking " + (depth < _depth ? "": "leaf ") + "node zkTxId=" + newTrackedNode.getZkTxId())); } catch (KeeperException.NoNodeException e) { // this is a race condition which could happen between the moment the event is received // and this call if(log.isDebugEnabled()) log.debug(logString(path, "no such node")); // it means that the node has disappeared tree.remove(path); if(oldTrackedNode != null) { events.add(new NodeEvent<T>(NodeEventType.DELETED, oldTrackedNode)); } } return tree; }
java
private Map<String, TrackedNode<T>> trackNode(String path, Map<String, TrackedNode<T>> tree, Collection<NodeEvent<T>> events, int depth) throws InterruptedException, KeeperException { if(depth > _depth) { if(log.isDebugEnabled()) log.debug(logString(path, "max depth reached ${depth}")); return tree; } TrackedNode<T> oldTrackedNode = tree.get(path); try { ZKData<T> res = _zkDataReader.readData(_zk, path, _treeWacher); TrackedNode<T> newTrackedNode = new TrackedNode<T>(path, res.getData(), res.getStat(), depth); if(oldTrackedNode != null) { if(!_zkDataReader.isEqual(oldTrackedNode.getData(), newTrackedNode.getData())) { events.add(new NodeEvent<T>(NodeEventType.UPDATED, newTrackedNode)); } } else { events.add(new NodeEvent<T>(NodeEventType.ADDED, newTrackedNode)); } tree.put(path, newTrackedNode); if(depth < _depth) { ZKChildren children = _zk.getZKChildren(path, _treeWacher); // the stat may change between the 2 calls if(!newTrackedNode.getStat().equals(children.getStat())) newTrackedNode.setStat(children.getStat()); Collections.sort(children.getChildren()); for(String child : children.getChildren()) { String childPath = PathUtils.addPaths(path, child); if(!tree.containsKey(childPath)) trackNode(childPath, tree, events, depth + 1); } } _lastZkTxId = Math.max(_lastZkTxId, newTrackedNode.getZkTxId()); _lock.notifyAll(); if(log.isDebugEnabled()) log.debug(logString(path, "start tracking " + (depth < _depth ? "": "leaf ") + "node zkTxId=" + newTrackedNode.getZkTxId())); } catch (KeeperException.NoNodeException e) { // this is a race condition which could happen between the moment the event is received // and this call if(log.isDebugEnabled()) log.debug(logString(path, "no such node")); // it means that the node has disappeared tree.remove(path); if(oldTrackedNode != null) { events.add(new NodeEvent<T>(NodeEventType.DELETED, oldTrackedNode)); } } return tree; }
[ "private", "Map", "<", "String", ",", "TrackedNode", "<", "T", ">", ">", "trackNode", "(", "String", "path", ",", "Map", "<", "String", ",", "TrackedNode", "<", "T", ">", ">", "tree", ",", "Collection", "<", "NodeEvent", "<", "T", ">", ">", "events",...
Must be called from a synchronized section
[ "Must", "be", "called", "from", "a", "synchronized", "section" ]
600b1d01318594ed425ede566bbbdc94b026a53e
https://github.com/linkedin/linkedin-zookeeper/blob/600b1d01318594ed425ede566bbbdc94b026a53e/org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/tracker/ZooKeeperTreeTracker.java#L262-L341
train
Ellzord/JALSE
src/main/java/jalse/attributes/Attributes.java
Attributes.newNamedTypeOf
public static <T> NamedAttributeType<T> newNamedTypeOf(final String name, final Class<T> type) { return new NamedAttributeType<>(name, newTypeOf(type)); }
java
public static <T> NamedAttributeType<T> newNamedTypeOf(final String name, final Class<T> type) { return new NamedAttributeType<>(name, newTypeOf(type)); }
[ "public", "static", "<", "T", ">", "NamedAttributeType", "<", "T", ">", "newNamedTypeOf", "(", "final", "String", "name", ",", "final", "Class", "<", "T", ">", "type", ")", "{", "return", "new", "NamedAttributeType", "<>", "(", "name", ",", "newTypeOf", ...
Creates a new named type of the supplied simple type. @param name Name of the attribute type. @param type Simple type. @return New named attribute type. @see #newTypeOf(Class)
[ "Creates", "a", "new", "named", "type", "of", "the", "supplied", "simple", "type", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/attributes/Attributes.java#L219-L221
train
Ellzord/JALSE
src/main/java/jalse/attributes/Attributes.java
Attributes.newNamedUnknownType
public static NamedAttributeType<Object> newNamedUnknownType(final String name, final Type type) { return new NamedAttributeType<>(name, new AttributeType<Object>(type) {}); }
java
public static NamedAttributeType<Object> newNamedUnknownType(final String name, final Type type) { return new NamedAttributeType<>(name, new AttributeType<Object>(type) {}); }
[ "public", "static", "NamedAttributeType", "<", "Object", ">", "newNamedUnknownType", "(", "final", "String", "name", ",", "final", "Type", "type", ")", "{", "return", "new", "NamedAttributeType", "<>", "(", "name", ",", "new", "AttributeType", "<", "Object", "...
Creates a new named unknown type. @param name Attribute type name. @param type Unknown type. @return New named unknown type.
[ "Creates", "a", "new", "named", "unknown", "type", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/attributes/Attributes.java#L232-L234
train
Ellzord/JALSE
src/main/java/jalse/attributes/Attributes.java
Attributes.newTypeOf
public static <T> AttributeType<T> newTypeOf(final Class<T> type) { return new AttributeType<T>(type) {}; }
java
public static <T> AttributeType<T> newTypeOf(final Class<T> type) { return new AttributeType<T>(type) {}; }
[ "public", "static", "<", "T", ">", "AttributeType", "<", "T", ">", "newTypeOf", "(", "final", "Class", "<", "T", ">", "type", ")", "{", "return", "new", "AttributeType", "<", "T", ">", "(", "type", ")", "{", "}", ";", "}" ]
Creates a new attribute type of the supplied simple type. @param type Simple type. @return Newly created simple type. @see AttributeType
[ "Creates", "a", "new", "attribute", "type", "of", "the", "supplied", "simple", "type", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/attributes/Attributes.java#L245-L247
train
Ellzord/JALSE
src/main/java/jalse/attributes/Attributes.java
Attributes.requireNotEmpty
public static String requireNotEmpty(final String str) throws NullPointerException, IllegalArgumentException { if (str.length() == 0) { throw new IllegalArgumentException(); } return str; }
java
public static String requireNotEmpty(final String str) throws NullPointerException, IllegalArgumentException { if (str.length() == 0) { throw new IllegalArgumentException(); } return str; }
[ "public", "static", "String", "requireNotEmpty", "(", "final", "String", "str", ")", "throws", "NullPointerException", ",", "IllegalArgumentException", "{", "if", "(", "str", ".", "length", "(", ")", "==", "0", ")", "{", "throw", "new", "IllegalArgumentException...
Ensures the String is not null or empty. @param str String to check. @return The string. @throws IllegalArgumentException If the string was null or empty.
[ "Ensures", "the", "String", "is", "not", "null", "or", "empty", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/attributes/Attributes.java#L270-L275
train
Ellzord/JALSE
src/main/java/jalse/actions/ManualWorkQueue.java
ManualWorkQueue.addWaitingWork
public boolean addWaitingWork(final T context) { write.lock(); try { boolean result = !waitingWork.contains(context); if (result) { waitingWork.add(context); workChanged.signalAll(); // Wake up! } return result; } finally { write.unlock(); } }
java
public boolean addWaitingWork(final T context) { write.lock(); try { boolean result = !waitingWork.contains(context); if (result) { waitingWork.add(context); workChanged.signalAll(); // Wake up! } return result; } finally { write.unlock(); } }
[ "public", "boolean", "addWaitingWork", "(", "final", "T", "context", ")", "{", "write", ".", "lock", "(", ")", ";", "try", "{", "boolean", "result", "=", "!", "waitingWork", ".", "contains", "(", "context", ")", ";", "if", "(", "result", ")", "{", "w...
Adds work to the queue. @param context Work to add. @return Whether the work was not previously within the queue.
[ "Adds", "work", "to", "the", "queue", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/actions/ManualWorkQueue.java#L50-L62
train
Ellzord/JALSE
src/main/java/jalse/actions/ManualWorkQueue.java
ManualWorkQueue.isWaitingWork
public boolean isWaitingWork(final T context) { read.lock(); try { return waitingWork.contains(context); } finally { read.unlock(); } }
java
public boolean isWaitingWork(final T context) { read.lock(); try { return waitingWork.contains(context); } finally { read.unlock(); } }
[ "public", "boolean", "isWaitingWork", "(", "final", "T", "context", ")", "{", "read", ".", "lock", "(", ")", ";", "try", "{", "return", "waitingWork", ".", "contains", "(", "context", ")", ";", "}", "finally", "{", "read", ".", "unlock", "(", ")", ";...
Whether the work is contained in the queue. @param context Work to check. @return Whether the work was already waiting.
[ "Whether", "the", "work", "is", "contained", "in", "the", "queue", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/actions/ManualWorkQueue.java#L111-L118
train
Ellzord/JALSE
src/main/java/jalse/actions/ManualWorkQueue.java
ManualWorkQueue.removeWaitingWork
public boolean removeWaitingWork(final T context) { write.lock(); try { boolean result = waitingWork.remove(context); if (result) { workChanged.signalAll(); } return result; } finally { write.unlock(); } }
java
public boolean removeWaitingWork(final T context) { write.lock(); try { boolean result = waitingWork.remove(context); if (result) { workChanged.signalAll(); } return result; } finally { write.unlock(); } }
[ "public", "boolean", "removeWaitingWork", "(", "final", "T", "context", ")", "{", "write", ".", "lock", "(", ")", ";", "try", "{", "boolean", "result", "=", "waitingWork", ".", "remove", "(", "context", ")", ";", "if", "(", "result", ")", "{", "workCha...
Removes work from the queue. @param context Work to remove. @return Whether the work was already in the queue.
[ "Removes", "work", "from", "the", "queue", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/actions/ManualWorkQueue.java#L177-L188
train
Ellzord/JALSE
src/main/java/jalse/entities/functions/EntityFunctionResolver.java
EntityFunctionResolver.unresolveType
public boolean unresolveType(final Class<? extends Entity> type) { return resolved.remove(Objects.requireNonNull(type)) != null; }
java
public boolean unresolveType(final Class<? extends Entity> type) { return resolved.remove(Objects.requireNonNull(type)) != null; }
[ "public", "boolean", "unresolveType", "(", "final", "Class", "<", "?", "extends", "Entity", ">", "type", ")", "{", "return", "resolved", ".", "remove", "(", "Objects", ".", "requireNonNull", "(", "type", ")", ")", "!=", "null", ";", "}" ]
Uncaches a resolved type. @param type Type to uncache. @return Whether the type was present in the resolver.
[ "Uncaches", "a", "resolved", "type", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/entities/functions/EntityFunctionResolver.java#L224-L226
train
linkedin/linkedin-zookeeper
org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/client/AbstractZKClient.java
AbstractZKClient.exists
@Override public Stat exists(String path) throws InterruptedException, KeeperException { return exists(path, false); }
java
@Override public Stat exists(String path) throws InterruptedException, KeeperException { return exists(path, false); }
[ "@", "Override", "public", "Stat", "exists", "(", "String", "path", ")", "throws", "InterruptedException", ",", "KeeperException", "{", "return", "exists", "(", "path", ",", "false", ")", ";", "}" ]
ZooKeeper convenient calls
[ "ZooKeeper", "convenient", "calls" ]
600b1d01318594ed425ede566bbbdc94b026a53e
https://github.com/linkedin/linkedin-zookeeper/blob/600b1d01318594ed425ede566bbbdc94b026a53e/org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/client/AbstractZKClient.java#L51-L55
train
linkedin/linkedin-zookeeper
org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/client/AbstractZKClient.java
AbstractZKClient.getZKStringData
@Override public ZKData<String> getZKStringData(String path) throws InterruptedException, KeeperException { return getZKStringData(path, null); }
java
@Override public ZKData<String> getZKStringData(String path) throws InterruptedException, KeeperException { return getZKStringData(path, null); }
[ "@", "Override", "public", "ZKData", "<", "String", ">", "getZKStringData", "(", "String", "path", ")", "throws", "InterruptedException", ",", "KeeperException", "{", "return", "getZKStringData", "(", "path", ",", "null", ")", ";", "}" ]
Returns both the data as a string as well as the stat
[ "Returns", "both", "the", "data", "as", "a", "string", "as", "well", "as", "the", "stat" ]
600b1d01318594ed425ede566bbbdc94b026a53e
https://github.com/linkedin/linkedin-zookeeper/blob/600b1d01318594ed425ede566bbbdc94b026a53e/org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/client/AbstractZKClient.java#L176-L180
train
linkedin/linkedin-zookeeper
org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/client/AbstractZKClient.java
AbstractZKClient.createOrSetWithParents
@Override public Stat createOrSetWithParents(String path, String data, List<ACL> acl, CreateMode createMode) throws InterruptedException, KeeperException { if(exists(path) != null) return setData(path, data); try { createWithParents(path, data, acl, createMode); return null; } catch(KeeperException.NodeExistsException e) { // this should not happen very often (race condition) return setData(path, data); } }
java
@Override public Stat createOrSetWithParents(String path, String data, List<ACL> acl, CreateMode createMode) throws InterruptedException, KeeperException { if(exists(path) != null) return setData(path, data); try { createWithParents(path, data, acl, createMode); return null; } catch(KeeperException.NodeExistsException e) { // this should not happen very often (race condition) return setData(path, data); } }
[ "@", "Override", "public", "Stat", "createOrSetWithParents", "(", "String", "path", ",", "String", "data", ",", "List", "<", "ACL", ">", "acl", ",", "CreateMode", "createMode", ")", "throws", "InterruptedException", ",", "KeeperException", "{", "if", "(", "exi...
Tries to create first and if the node exists, then does a setData. @return <code>null</code> if create worked, otherwise the result of setData
[ "Tries", "to", "create", "first", "and", "if", "the", "node", "exists", "then", "does", "a", "setData", "." ]
600b1d01318594ed425ede566bbbdc94b026a53e
https://github.com/linkedin/linkedin-zookeeper/blob/600b1d01318594ed425ede566bbbdc94b026a53e/org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/client/AbstractZKClient.java#L233-L251
train
linkedin/linkedin-zookeeper
org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/client/AbstractZKClient.java
AbstractZKClient.deleteWithChildren
@Override public void deleteWithChildren(String path) throws InterruptedException, KeeperException { List<String> allChildren = findAllChildren(path); for(String child : allChildren) { delete(PathUtils.addPaths(path, child)); } delete(path); }
java
@Override public void deleteWithChildren(String path) throws InterruptedException, KeeperException { List<String> allChildren = findAllChildren(path); for(String child : allChildren) { delete(PathUtils.addPaths(path, child)); } delete(path); }
[ "@", "Override", "public", "void", "deleteWithChildren", "(", "String", "path", ")", "throws", "InterruptedException", ",", "KeeperException", "{", "List", "<", "String", ">", "allChildren", "=", "findAllChildren", "(", "path", ")", ";", "for", "(", "String", ...
delete all the children if they exist
[ "delete", "all", "the", "children", "if", "they", "exist" ]
600b1d01318594ed425ede566bbbdc94b026a53e
https://github.com/linkedin/linkedin-zookeeper/blob/600b1d01318594ed425ede566bbbdc94b026a53e/org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/client/AbstractZKClient.java#L262-L273
train
linkedin/linkedin-zookeeper
org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/server/StandaloneZooKeeperServer.java
StandaloneZooKeeperServer.waitForShutdown
@Override public void waitForShutdown(Object timeout) throws InterruptedException, IllegalStateException, TimeoutException { if(!_shutdown) throw new IllegalStateException("call shutdown first"); ConcurrentUtils.joinFor(clock, _mainThread, timeout); }
java
@Override public void waitForShutdown(Object timeout) throws InterruptedException, IllegalStateException, TimeoutException { if(!_shutdown) throw new IllegalStateException("call shutdown first"); ConcurrentUtils.joinFor(clock, _mainThread, timeout); }
[ "@", "Override", "public", "void", "waitForShutdown", "(", "Object", "timeout", ")", "throws", "InterruptedException", ",", "IllegalStateException", ",", "TimeoutException", "{", "if", "(", "!", "_shutdown", ")", "throw", "new", "IllegalStateException", "(", "\"call...
Waits for shutdown to be completed. After calling shutdown, there may still be some pending work that needs to be accomplised. This method will block until it is done but no longer than the timeout. @param timeout how long to wait maximum for the shutdown (see {@link ClockUtils#toTimespan(Object)}) @throws InterruptedException if interrupted while waiting @throws IllegalStateException if shutdown has not been called @throws TimeoutException if shutdown still not complete after timeout
[ "Waits", "for", "shutdown", "to", "be", "completed", ".", "After", "calling", "shutdown", "there", "may", "still", "be", "some", "pending", "work", "that", "needs", "to", "be", "accomplised", ".", "This", "method", "will", "block", "until", "it", "is", "do...
600b1d01318594ed425ede566bbbdc94b026a53e
https://github.com/linkedin/linkedin-zookeeper/blob/600b1d01318594ed425ede566bbbdc94b026a53e/org.linkedin.zookeeper-impl/src/main/java/org/linkedin/zookeeper/server/StandaloneZooKeeperServer.java#L219-L227
train
Ellzord/JALSE
src/main/java/jalse/actions/ForkJoinActionEngine.java
ForkJoinActionEngine.addWork
protected boolean addWork(final ForkJoinContext<?> context) { requireNotStopped(this); final boolean result = workQueue.addWaitingWork(context); if (result) { addWorkerIfNeeded(); } return result; }
java
protected boolean addWork(final ForkJoinContext<?> context) { requireNotStopped(this); final boolean result = workQueue.addWaitingWork(context); if (result) { addWorkerIfNeeded(); } return result; }
[ "protected", "boolean", "addWork", "(", "final", "ForkJoinContext", "<", "?", ">", "context", ")", "{", "requireNotStopped", "(", "this", ")", ";", "final", "boolean", "result", "=", "workQueue", ".", "addWaitingWork", "(", "context", ")", ";", "if", "(", ...
Adds work to the engine. @param context Work to add. @return Whether the work was not already in the queue. @see Actions#requireNotStopped(ActionEngine)
[ "Adds", "work", "to", "the", "engine", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/actions/ForkJoinActionEngine.java#L167-L176
train
cvut/JCOP
src/main/java/cz/cvut/felk/cig/jcop/result/render/JFreeChartRender.java
JFreeChartRender.setDomainAxis
public JFreeChartRender setDomainAxis(double lowerBound, double upperBound) { ValueAxis valueAxis = getPlot().getDomainAxis(); valueAxis.setUpperBound(upperBound); valueAxis.setLowerBound(lowerBound); return this; }
java
public JFreeChartRender setDomainAxis(double lowerBound, double upperBound) { ValueAxis valueAxis = getPlot().getDomainAxis(); valueAxis.setUpperBound(upperBound); valueAxis.setLowerBound(lowerBound); return this; }
[ "public", "JFreeChartRender", "setDomainAxis", "(", "double", "lowerBound", ",", "double", "upperBound", ")", "{", "ValueAxis", "valueAxis", "=", "getPlot", "(", ")", ".", "getDomainAxis", "(", ")", ";", "valueAxis", ".", "setUpperBound", "(", "upperBound", ")",...
Sets bounds for domain axis. @param lowerBound lower domain bound @param upperBound upper domain bound @return itself (fluent interface)
[ "Sets", "bounds", "for", "domain", "axis", "." ]
2ec18315a9a452e5f4e3d07cccfde0310adc465a
https://github.com/cvut/JCOP/blob/2ec18315a9a452e5f4e3d07cccfde0310adc465a/src/main/java/cz/cvut/felk/cig/jcop/result/render/JFreeChartRender.java#L259-L264
train
cvut/JCOP
src/main/java/cz/cvut/felk/cig/jcop/result/render/JFreeChartRender.java
JFreeChartRender.setRangeAxis
public JFreeChartRender setRangeAxis(double lowerBound, double upperBound) { ValueAxis valueAxis = getPlot().getRangeAxis(); valueAxis.setUpperBound(upperBound); valueAxis.setLowerBound(lowerBound); return this; }
java
public JFreeChartRender setRangeAxis(double lowerBound, double upperBound) { ValueAxis valueAxis = getPlot().getRangeAxis(); valueAxis.setUpperBound(upperBound); valueAxis.setLowerBound(lowerBound); return this; }
[ "public", "JFreeChartRender", "setRangeAxis", "(", "double", "lowerBound", ",", "double", "upperBound", ")", "{", "ValueAxis", "valueAxis", "=", "getPlot", "(", ")", ".", "getRangeAxis", "(", ")", ";", "valueAxis", ".", "setUpperBound", "(", "upperBound", ")", ...
Sets bounds for range axis. @param lowerBound lower range bound @param upperBound upper range bound @return itself (fluent interface)
[ "Sets", "bounds", "for", "range", "axis", "." ]
2ec18315a9a452e5f4e3d07cccfde0310adc465a
https://github.com/cvut/JCOP/blob/2ec18315a9a452e5f4e3d07cccfde0310adc465a/src/main/java/cz/cvut/felk/cig/jcop/result/render/JFreeChartRender.java#L273-L278
train
cvut/JCOP
src/main/java/cz/cvut/felk/cig/jcop/result/render/JFreeChartRender.java
JFreeChartRender.setStyle
public JFreeChartRender setStyle(int style) { switch (style) { case JFreeChartRender.STYLE_THESIS: return this.setBaseShapesVisible(true). setBaseShapesFilled(false). setBaseLinesVisible(false). setLegendItemFont(new Font("Dialog", Font.PLAIN, 9)). setBackgroundPaint(Color.white). setGridPaint(Color.gray). setInsertLast(false). removeLegend(); case JFreeChartRender.STYLE_THESIS_LEGEND: return this.setBaseShapesVisible(true). setBaseShapesFilled(false). setBaseLinesVisible(false). setLegendItemFont(new Font("Dialog", Font.PLAIN, 9)). setBackgroundPaint(Color.white). setGridPaint(Color.gray). setInsertLast(false); default: return this; } }
java
public JFreeChartRender setStyle(int style) { switch (style) { case JFreeChartRender.STYLE_THESIS: return this.setBaseShapesVisible(true). setBaseShapesFilled(false). setBaseLinesVisible(false). setLegendItemFont(new Font("Dialog", Font.PLAIN, 9)). setBackgroundPaint(Color.white). setGridPaint(Color.gray). setInsertLast(false). removeLegend(); case JFreeChartRender.STYLE_THESIS_LEGEND: return this.setBaseShapesVisible(true). setBaseShapesFilled(false). setBaseLinesVisible(false). setLegendItemFont(new Font("Dialog", Font.PLAIN, 9)). setBackgroundPaint(Color.white). setGridPaint(Color.gray). setInsertLast(false); default: return this; } }
[ "public", "JFreeChartRender", "setStyle", "(", "int", "style", ")", "{", "switch", "(", "style", ")", "{", "case", "JFreeChartRender", ".", "STYLE_THESIS", ":", "return", "this", ".", "setBaseShapesVisible", "(", "true", ")", ".", "setBaseShapesFilled", "(", "...
Applies prepared style to a chart. Recognizes {@link JFreeChartRender#STYLE_THESIS} and {@link JFreeChartRender#STYLE_THESIS_LEGEND}. @param style code of style @return updated chart
[ "Applies", "prepared", "style", "to", "a", "chart", "." ]
2ec18315a9a452e5f4e3d07cccfde0310adc465a
https://github.com/cvut/JCOP/blob/2ec18315a9a452e5f4e3d07cccfde0310adc465a/src/main/java/cz/cvut/felk/cig/jcop/result/render/JFreeChartRender.java#L288-L310
train
bozaro/git-lfs-java
gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/internal/BatchWorker.java
BatchWorker.enqueue
@NotNull protected CompletableFuture<R> enqueue(@NotNull final Meta meta, @NotNull final T context) { State<T, R> state = objectQueue.get(meta.getOid()); if (state != null) { if (state.future.isCancelled()) { objectQueue.remove(meta.getOid(), state); state = null; } } if (state == null) { final State<T, R> newState = new State<>(meta, context); state = objectQueue.putIfAbsent(meta.getOid(), newState); if (state == null) { state = newState; stateEnqueue(true); } } return state.future; }
java
@NotNull protected CompletableFuture<R> enqueue(@NotNull final Meta meta, @NotNull final T context) { State<T, R> state = objectQueue.get(meta.getOid()); if (state != null) { if (state.future.isCancelled()) { objectQueue.remove(meta.getOid(), state); state = null; } } if (state == null) { final State<T, R> newState = new State<>(meta, context); state = objectQueue.putIfAbsent(meta.getOid(), newState); if (state == null) { state = newState; stateEnqueue(true); } } return state.future; }
[ "@", "NotNull", "protected", "CompletableFuture", "<", "R", ">", "enqueue", "(", "@", "NotNull", "final", "Meta", "meta", ",", "@", "NotNull", "final", "T", "context", ")", "{", "State", "<", "T", ",", "R", ">", "state", "=", "objectQueue", ".", "get",...
This method start send object metadata to server. @param context Object worker context. @param meta Object metadata. @return Return future with result. For same objects can return same future.
[ "This", "method", "start", "send", "object", "metadata", "to", "server", "." ]
ee05bf0472ee61bf362cf93d283e5ee5d44ef685
https://github.com/bozaro/git-lfs-java/blob/ee05bf0472ee61bf362cf93d283e5ee5d44ef685/gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/internal/BatchWorker.java#L73-L91
train
bozaro/git-lfs-java
gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/Client.java
Client.postBatch
@NotNull public BatchRes postBatch(@NotNull final BatchReq batchReq) throws IOException { return doWork(auth -> doRequest(auth, new JsonPost<>(batchReq, BatchRes.class), AuthHelper.join(auth.getHref(), PATH_BATCH)), batchReq.getOperation()); }
java
@NotNull public BatchRes postBatch(@NotNull final BatchReq batchReq) throws IOException { return doWork(auth -> doRequest(auth, new JsonPost<>(batchReq, BatchRes.class), AuthHelper.join(auth.getHref(), PATH_BATCH)), batchReq.getOperation()); }
[ "@", "NotNull", "public", "BatchRes", "postBatch", "(", "@", "NotNull", "final", "BatchReq", "batchReq", ")", "throws", "IOException", "{", "return", "doWork", "(", "auth", "->", "doRequest", "(", "auth", ",", "new", "JsonPost", "<>", "(", "batchReq", ",", ...
Send batch request to the LFS-server. @param batchReq Batch request. @return Object metadata. @throws IOException
[ "Send", "batch", "request", "to", "the", "LFS", "-", "server", "." ]
ee05bf0472ee61bf362cf93d283e5ee5d44ef685
https://github.com/bozaro/git-lfs-java/blob/ee05bf0472ee61bf362cf93d283e5ee5d44ef685/gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/Client.java#L116-L119
train
bozaro/git-lfs-java
gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/Client.java
Client.getObject
@NotNull public <T> T getObject(@NotNull final String hash, @NotNull final StreamHandler<T> handler) throws IOException { return doWork(auth -> { final ObjectRes links = doRequest(auth, new MetaGet(), AuthHelper.join(auth.getHref(), PATH_OBJECTS + "/" + hash)); if (links == null) { throw new FileNotFoundException(); } return getObject(new Meta(hash, -1), links, handler); }, Operation.Download); }
java
@NotNull public <T> T getObject(@NotNull final String hash, @NotNull final StreamHandler<T> handler) throws IOException { return doWork(auth -> { final ObjectRes links = doRequest(auth, new MetaGet(), AuthHelper.join(auth.getHref(), PATH_OBJECTS + "/" + hash)); if (links == null) { throw new FileNotFoundException(); } return getObject(new Meta(hash, -1), links, handler); }, Operation.Download); }
[ "@", "NotNull", "public", "<", "T", ">", "T", "getObject", "(", "@", "NotNull", "final", "String", "hash", ",", "@", "NotNull", "final", "StreamHandler", "<", "T", ">", "handler", ")", "throws", "IOException", "{", "return", "doWork", "(", "auth", "->", ...
Download object by hash. @param hash Object hash. @param handler Stream handler. @return Stream handler result. @throws FileNotFoundException File not found exception if object don't exists on LFS server. @throws IOException On some errors.
[ "Download", "object", "by", "hash", "." ]
ee05bf0472ee61bf362cf93d283e5ee5d44ef685
https://github.com/bozaro/git-lfs-java/blob/ee05bf0472ee61bf362cf93d283e5ee5d44ef685/gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/Client.java#L130-L139
train
bozaro/git-lfs-java
gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/Client.java
Client.getObject
@NotNull public <T> T getObject(@Nullable final Meta meta, @NotNull final Links links, @NotNull final StreamHandler<T> handler) throws IOException { final Link link = links.getLinks().get(LinkType.Download); if (link == null) { throw new FileNotFoundException(); } return doRequest(link, new ObjectGet<>(inputStream -> handler.accept(meta != null ? new InputStreamValidator(inputStream, meta) : inputStream)), link.getHref()); }
java
@NotNull public <T> T getObject(@Nullable final Meta meta, @NotNull final Links links, @NotNull final StreamHandler<T> handler) throws IOException { final Link link = links.getLinks().get(LinkType.Download); if (link == null) { throw new FileNotFoundException(); } return doRequest(link, new ObjectGet<>(inputStream -> handler.accept(meta != null ? new InputStreamValidator(inputStream, meta) : inputStream)), link.getHref()); }
[ "@", "NotNull", "public", "<", "T", ">", "T", "getObject", "(", "@", "Nullable", "final", "Meta", "meta", ",", "@", "NotNull", "final", "Links", "links", ",", "@", "NotNull", "final", "StreamHandler", "<", "T", ">", "handler", ")", "throws", "IOException...
Download object by metadata. @param meta Object metadata for stream validation. @param links Object links. @param handler Stream handler. @return Stream handler result. @throws FileNotFoundException File not found exception if object don't exists on LFS server. @throws IOException On some errors.
[ "Download", "object", "by", "metadata", "." ]
ee05bf0472ee61bf362cf93d283e5ee5d44ef685
https://github.com/bozaro/git-lfs-java/blob/ee05bf0472ee61bf362cf93d283e5ee5d44ef685/gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/Client.java#L151-L158
train
bozaro/git-lfs-java
gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/Client.java
Client.generateMeta
public static Meta generateMeta(@NotNull final StreamProvider streamProvider) throws IOException { final MessageDigest digest = sha256(); final byte[] buffer = new byte[0x10000]; long size = 0; try (InputStream stream = streamProvider.getStream()) { while (true) { int read = stream.read(buffer); if (read <= 0) break; digest.update(buffer, 0, read); size += read; } } return new Meta(new String(Hex.encodeHex(digest.digest())), size); }
java
public static Meta generateMeta(@NotNull final StreamProvider streamProvider) throws IOException { final MessageDigest digest = sha256(); final byte[] buffer = new byte[0x10000]; long size = 0; try (InputStream stream = streamProvider.getStream()) { while (true) { int read = stream.read(buffer); if (read <= 0) break; digest.update(buffer, 0, read); size += read; } } return new Meta(new String(Hex.encodeHex(digest.digest())), size); }
[ "public", "static", "Meta", "generateMeta", "(", "@", "NotNull", "final", "StreamProvider", "streamProvider", ")", "throws", "IOException", "{", "final", "MessageDigest", "digest", "=", "sha256", "(", ")", ";", "final", "byte", "[", "]", "buffer", "=", "new", ...
Generate object metadata. @param streamProvider Object stream provider. @return Return object metadata. @throws IOException On some errors.
[ "Generate", "object", "metadata", "." ]
ee05bf0472ee61bf362cf93d283e5ee5d44ef685
https://github.com/bozaro/git-lfs-java/blob/ee05bf0472ee61bf362cf93d283e5ee5d44ef685/gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/Client.java#L178-L191
train
bozaro/git-lfs-java
gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/Client.java
Client.putObject
public boolean putObject(@NotNull final StreamProvider streamProvider, @NotNull final Meta meta, @NotNull final Links links) throws IOException { if (links.getLinks().containsKey(LinkType.Download)) { return false; } final Link uploadLink = links.getLinks().get(LinkType.Upload); if (uploadLink == null) { throw new IOException("Upload link not found"); } doRequest(uploadLink, new ObjectPut(streamProvider, meta.getSize()), uploadLink.getHref()); final Link verifyLink = links.getLinks().get(LinkType.Verify); if (verifyLink != null) { doRequest(verifyLink, new ObjectVerify(meta), verifyLink.getHref()); } return true; }
java
public boolean putObject(@NotNull final StreamProvider streamProvider, @NotNull final Meta meta, @NotNull final Links links) throws IOException { if (links.getLinks().containsKey(LinkType.Download)) { return false; } final Link uploadLink = links.getLinks().get(LinkType.Upload); if (uploadLink == null) { throw new IOException("Upload link not found"); } doRequest(uploadLink, new ObjectPut(streamProvider, meta.getSize()), uploadLink.getHref()); final Link verifyLink = links.getLinks().get(LinkType.Verify); if (verifyLink != null) { doRequest(verifyLink, new ObjectVerify(meta), verifyLink.getHref()); } return true; }
[ "public", "boolean", "putObject", "(", "@", "NotNull", "final", "StreamProvider", "streamProvider", ",", "@", "NotNull", "final", "Meta", "meta", ",", "@", "NotNull", "final", "Links", "links", ")", "throws", "IOException", "{", "if", "(", "links", ".", "get...
Upload object by metadata. @param links Object links. @param streamProvider Object stream provider. @param meta Object metadata. @return Return true is object is uploaded successfully and false if object is already uploaded. @throws IOException On some errors.
[ "Upload", "object", "by", "metadata", "." ]
ee05bf0472ee61bf362cf93d283e5ee5d44ef685
https://github.com/bozaro/git-lfs-java/blob/ee05bf0472ee61bf362cf93d283e5ee5d44ef685/gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/Client.java#L230-L245
train
cvut/JCOP
src/main/java/cz/cvut/felk/cig/jcop/problem/knapsack/Knapsack.java
Knapsack.getPrice
public long getPrice(Configuration configuration) { long total = 0; for (KnapsackItem knapsackItem : getKnapsackItems()) { if (configuration.valueAt(knapsackItem.getIndex()) == 1) { total += knapsackItem.getPrice(); } } return total; }
java
public long getPrice(Configuration configuration) { long total = 0; for (KnapsackItem knapsackItem : getKnapsackItems()) { if (configuration.valueAt(knapsackItem.getIndex()) == 1) { total += knapsackItem.getPrice(); } } return total; }
[ "public", "long", "getPrice", "(", "Configuration", "configuration", ")", "{", "long", "total", "=", "0", ";", "for", "(", "KnapsackItem", "knapsackItem", ":", "getKnapsackItems", "(", ")", ")", "{", "if", "(", "configuration", ".", "valueAt", "(", "knapsack...
Returns price of items in given configuration. Does not check for capacity. @param configuration configuration to calculate price of @return price of configuration
[ "Returns", "price", "of", "items", "in", "given", "configuration", "." ]
2ec18315a9a452e5f4e3d07cccfde0310adc465a
https://github.com/cvut/JCOP/blob/2ec18315a9a452e5f4e3d07cccfde0310adc465a/src/main/java/cz/cvut/felk/cig/jcop/problem/knapsack/Knapsack.java#L197-L205
train
cvut/JCOP
src/main/java/cz/cvut/felk/cig/jcop/problem/tsp/City.java
City.addDistance
public City addDistance(City city, Integer distance) { this.distances.put(city, distance); return this; }
java
public City addDistance(City city, Integer distance) { this.distances.put(city, distance); return this; }
[ "public", "City", "addDistance", "(", "City", "city", ",", "Integer", "distance", ")", "{", "this", ".", "distances", ".", "put", "(", "city", ",", "distance", ")", ";", "return", "this", ";", "}" ]
Adds new distance to city. @param city target city @param distance distance to city @return self, fluent interface
[ "Adds", "new", "distance", "to", "city", "." ]
2ec18315a9a452e5f4e3d07cccfde0310adc465a
https://github.com/cvut/JCOP/blob/2ec18315a9a452e5f4e3d07cccfde0310adc465a/src/main/java/cz/cvut/felk/cig/jcop/problem/tsp/City.java#L67-L70
train
cvut/JCOP
src/main/java/cz/cvut/felk/cig/jcop/problem/jobshop/JobShopIterator.java
JobShopIterator.counterToOperation
protected MoveOperation counterToOperation(int counter) { int jobIndex = counter / (this.problem.machines - 1); int machineIndex = counter % (this.problem.machines - 1); if (machineIndex >= this.configuration.valueAt(jobIndex)) machineIndex++; return this.problem.moveOperations.get(jobIndex).get(machineIndex); }
java
protected MoveOperation counterToOperation(int counter) { int jobIndex = counter / (this.problem.machines - 1); int machineIndex = counter % (this.problem.machines - 1); if (machineIndex >= this.configuration.valueAt(jobIndex)) machineIndex++; return this.problem.moveOperations.get(jobIndex).get(machineIndex); }
[ "protected", "MoveOperation", "counterToOperation", "(", "int", "counter", ")", "{", "int", "jobIndex", "=", "counter", "/", "(", "this", ".", "problem", ".", "machines", "-", "1", ")", ";", "int", "machineIndex", "=", "counter", "%", "(", "this", ".", "...
Returns operation for given counter. @param counter counter to return operation for @return operation for this counter
[ "Returns", "operation", "for", "given", "counter", "." ]
2ec18315a9a452e5f4e3d07cccfde0310adc465a
https://github.com/cvut/JCOP/blob/2ec18315a9a452e5f4e3d07cccfde0310adc465a/src/main/java/cz/cvut/felk/cig/jcop/problem/jobshop/JobShopIterator.java#L53-L59
train
cvut/JCOP
src/main/java/cz/cvut/felk/cig/jcop/problem/tspfast/TSPPaths.java
TSPPaths.randomPathFast
public static void randomPathFast(int[] result, int size) { //Random generator = new Random(); for (int i = 0; i < size; i++) result[i] = i; for (int k = size - 1; k > 0; k--) { int w = (int)Math.floor(Math.random() * (k+1)); int temp = result[w]; result[w] = result[k]; result[k] = temp; } }
java
public static void randomPathFast(int[] result, int size) { //Random generator = new Random(); for (int i = 0; i < size; i++) result[i] = i; for (int k = size - 1; k > 0; k--) { int w = (int)Math.floor(Math.random() * (k+1)); int temp = result[w]; result[w] = result[k]; result[k] = temp; } }
[ "public", "static", "void", "randomPathFast", "(", "int", "[", "]", "result", ",", "int", "size", ")", "{", "//Random generator = new Random();", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "result", "[", "i", "]", "...
generates random permutation of cities
[ "generates", "random", "permutation", "of", "cities" ]
2ec18315a9a452e5f4e3d07cccfde0310adc465a
https://github.com/cvut/JCOP/blob/2ec18315a9a452e5f4e3d07cccfde0310adc465a/src/main/java/cz/cvut/felk/cig/jcop/problem/tspfast/TSPPaths.java#L13-L23
train
bozaro/git-lfs-java
gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/BatchUploader.java
BatchUploader.upload
@NotNull public CompletableFuture<Meta> upload(@NotNull final StreamProvider streamProvider) { final CompletableFuture<Meta> future = new CompletableFuture<>(); getPool().submit(() -> { try { future.complete(Client.generateMeta(streamProvider)); } catch (Throwable e) { future.completeExceptionally(e); } }); return future.thenCompose(meta -> upload(meta, streamProvider)); }
java
@NotNull public CompletableFuture<Meta> upload(@NotNull final StreamProvider streamProvider) { final CompletableFuture<Meta> future = new CompletableFuture<>(); getPool().submit(() -> { try { future.complete(Client.generateMeta(streamProvider)); } catch (Throwable e) { future.completeExceptionally(e); } }); return future.thenCompose(meta -> upload(meta, streamProvider)); }
[ "@", "NotNull", "public", "CompletableFuture", "<", "Meta", ">", "upload", "(", "@", "NotNull", "final", "StreamProvider", "streamProvider", ")", "{", "final", "CompletableFuture", "<", "Meta", ">", "future", "=", "new", "CompletableFuture", "<>", "(", ")", ";...
This method computes stream metadata and upload object. @param streamProvider Stream provider. @return Return future with upload result.
[ "This", "method", "computes", "stream", "metadata", "and", "upload", "object", "." ]
ee05bf0472ee61bf362cf93d283e5ee5d44ef685
https://github.com/bozaro/git-lfs-java/blob/ee05bf0472ee61bf362cf93d283e5ee5d44ef685/gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/BatchUploader.java#L36-L47
train
bozaro/git-lfs-java
gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/BatchUploader.java
BatchUploader.upload
@NotNull public CompletableFuture<Meta> upload(@NotNull final Meta meta, @NotNull final StreamProvider streamProvider) { return enqueue(meta, streamProvider); }
java
@NotNull public CompletableFuture<Meta> upload(@NotNull final Meta meta, @NotNull final StreamProvider streamProvider) { return enqueue(meta, streamProvider); }
[ "@", "NotNull", "public", "CompletableFuture", "<", "Meta", ">", "upload", "(", "@", "NotNull", "final", "Meta", "meta", ",", "@", "NotNull", "final", "StreamProvider", "streamProvider", ")", "{", "return", "enqueue", "(", "meta", ",", "streamProvider", ")", ...
This method start uploading object to server. @param meta Object metadata. @param streamProvider Stream provider. @return Return future with upload result. For same objects can return same future.
[ "This", "method", "start", "uploading", "object", "to", "server", "." ]
ee05bf0472ee61bf362cf93d283e5ee5d44ef685
https://github.com/bozaro/git-lfs-java/blob/ee05bf0472ee61bf362cf93d283e5ee5d44ef685/gitlfs-client/src/main/java/ru/bozaro/gitlfs/client/BatchUploader.java#L56-L59
train
orientechnologies/orientdb-etl
src/main/java/com/orientechnologies/orient/etl/OETLProcessor.java
OETLProcessor.parse
public OETLProcessor parse(final Collection<ODocument> iBeginBlocks, final ODocument iSource, final ODocument iExtractor, final Collection<ODocument> iTransformers, final ODocument iLoader, final Collection<ODocument> iEndBlocks, final OCommandContext iContext) { if (iExtractor == null) throw new IllegalArgumentException("No Extractor configured"); context = iContext != null ? iContext : createDefaultContext(); init(); try { String name; // BEGIN BLOCKS beginBlocks = new ArrayList<OBlock>(); if (iBeginBlocks != null) for (ODocument block : iBeginBlocks) { name = block.fieldNames()[0]; final OBlock b = factory.getBlock(name); beginBlocks.add(b); configureComponent(b, (ODocument) block.field(name), iContext); } if (iSource != null) { // SOURCE name = iSource.fieldNames()[0]; source = factory.getSource(name); configureComponent(source, (ODocument) iSource.field(name), iContext); } else source = factory.getSource("input"); // EXTRACTOR name = iExtractor.fieldNames()[0]; extractor = factory.getExtractor(name); configureComponent(extractor, (ODocument) iExtractor.field(name), iContext); if (iLoader != null) { // LOADER name = iLoader.fieldNames()[0]; loader = factory.getLoader(name); configureComponent(loader, (ODocument) iLoader.field(name), iContext); } else loader = factory.getLoader("output"); // TRANSFORMERS transformers = new ArrayList<OTransformer>(); if (iTransformers != null) for (ODocument t : iTransformers) { name = t.fieldNames()[0]; final OTransformer tr = factory.getTransformer(name); transformers.add(tr); configureComponent(tr, (ODocument) t.field(name), iContext); } // END BLOCKS endBlocks = new ArrayList<OBlock>(); if (iEndBlocks != null) for (ODocument block : iEndBlocks) { name = block.fieldNames()[0]; final OBlock b = factory.getBlock(name); endBlocks.add(b); configureComponent(b, (ODocument) block.field(name), iContext); } // analyzeFlow(); } catch (Exception e) { throw new OConfigurationException("Error on creating ETL processor", e); } return this; }
java
public OETLProcessor parse(final Collection<ODocument> iBeginBlocks, final ODocument iSource, final ODocument iExtractor, final Collection<ODocument> iTransformers, final ODocument iLoader, final Collection<ODocument> iEndBlocks, final OCommandContext iContext) { if (iExtractor == null) throw new IllegalArgumentException("No Extractor configured"); context = iContext != null ? iContext : createDefaultContext(); init(); try { String name; // BEGIN BLOCKS beginBlocks = new ArrayList<OBlock>(); if (iBeginBlocks != null) for (ODocument block : iBeginBlocks) { name = block.fieldNames()[0]; final OBlock b = factory.getBlock(name); beginBlocks.add(b); configureComponent(b, (ODocument) block.field(name), iContext); } if (iSource != null) { // SOURCE name = iSource.fieldNames()[0]; source = factory.getSource(name); configureComponent(source, (ODocument) iSource.field(name), iContext); } else source = factory.getSource("input"); // EXTRACTOR name = iExtractor.fieldNames()[0]; extractor = factory.getExtractor(name); configureComponent(extractor, (ODocument) iExtractor.field(name), iContext); if (iLoader != null) { // LOADER name = iLoader.fieldNames()[0]; loader = factory.getLoader(name); configureComponent(loader, (ODocument) iLoader.field(name), iContext); } else loader = factory.getLoader("output"); // TRANSFORMERS transformers = new ArrayList<OTransformer>(); if (iTransformers != null) for (ODocument t : iTransformers) { name = t.fieldNames()[0]; final OTransformer tr = factory.getTransformer(name); transformers.add(tr); configureComponent(tr, (ODocument) t.field(name), iContext); } // END BLOCKS endBlocks = new ArrayList<OBlock>(); if (iEndBlocks != null) for (ODocument block : iEndBlocks) { name = block.fieldNames()[0]; final OBlock b = factory.getBlock(name); endBlocks.add(b); configureComponent(b, (ODocument) block.field(name), iContext); } // analyzeFlow(); } catch (Exception e) { throw new OConfigurationException("Error on creating ETL processor", e); } return this; }
[ "public", "OETLProcessor", "parse", "(", "final", "Collection", "<", "ODocument", ">", "iBeginBlocks", ",", "final", "ODocument", "iSource", ",", "final", "ODocument", "iExtractor", ",", "final", "Collection", "<", "ODocument", ">", "iTransformers", ",", "final", ...
Creates an ETL processor by setting the configuration of each component. @param iBeginBlocks List of Block configurations to execute at the beginning of processing @param iSource Source component configuration @param iExtractor Extractor component configuration @param iTransformers List of Transformer configurations @param iLoader Loader component configuration @param iEndBlocks List of Block configurations to execute at the end of processing @param iContext Execution Context @return Current OETProcessor instance
[ "Creates", "an", "ETL", "processor", "by", "setting", "the", "configuration", "of", "each", "component", "." ]
ce082edb0e7e1b804e8aaf24298aeaef4fb9fdd4
https://github.com/orientechnologies/orientdb-etl/blob/ce082edb0e7e1b804e8aaf24298aeaef4fb9fdd4/src/main/java/com/orientechnologies/orient/etl/OETLProcessor.java#L183-L252
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Shape.java
Shape.fill
protected boolean fill(final Context2D context, final Attributes attr, double alpha) { final boolean filled = attr.hasFill(); if ((filled) || (attr.isFillShapeForSelection())) { alpha = alpha * attr.getFillAlpha(); if (alpha <= 0) { return false; } if (context.isSelection()) { final String color = getColorKey(); if (null == color) { return false; } context.save(); context.setFillColor(color); context.fill(); context.restore(); return true; } if (false == filled) { return false; } context.save(); if (attr.hasShadow()) { doApplyShadow(context, attr); } context.setGlobalAlpha(alpha); final String fill = attr.getFillColor(); if (null != fill) { context.setFillColor(fill); context.fill(); context.restore(); return true; } final FillGradient grad = attr.getFillGradient(); if (null != grad) { final String type = grad.getType(); if (LinearGradient.TYPE.equals(type)) { context.setFillGradient(grad.asLinearGradient()); context.fill(); context.restore(); return true; } else if (RadialGradient.TYPE.equals(type)) { context.setFillGradient(grad.asRadialGradient()); context.fill(); context.restore(); return true; } else if (PatternGradient.TYPE.equals(type)) { context.setFillGradient(grad.asPatternGradient()); context.fill(); context.restore(); return true; } } context.restore(); } return false; }
java
protected boolean fill(final Context2D context, final Attributes attr, double alpha) { final boolean filled = attr.hasFill(); if ((filled) || (attr.isFillShapeForSelection())) { alpha = alpha * attr.getFillAlpha(); if (alpha <= 0) { return false; } if (context.isSelection()) { final String color = getColorKey(); if (null == color) { return false; } context.save(); context.setFillColor(color); context.fill(); context.restore(); return true; } if (false == filled) { return false; } context.save(); if (attr.hasShadow()) { doApplyShadow(context, attr); } context.setGlobalAlpha(alpha); final String fill = attr.getFillColor(); if (null != fill) { context.setFillColor(fill); context.fill(); context.restore(); return true; } final FillGradient grad = attr.getFillGradient(); if (null != grad) { final String type = grad.getType(); if (LinearGradient.TYPE.equals(type)) { context.setFillGradient(grad.asLinearGradient()); context.fill(); context.restore(); return true; } else if (RadialGradient.TYPE.equals(type)) { context.setFillGradient(grad.asRadialGradient()); context.fill(); context.restore(); return true; } else if (PatternGradient.TYPE.equals(type)) { context.setFillGradient(grad.asPatternGradient()); context.fill(); context.restore(); return true; } } context.restore(); } return false; }
[ "protected", "boolean", "fill", "(", "final", "Context2D", "context", ",", "final", "Attributes", "attr", ",", "double", "alpha", ")", "{", "final", "boolean", "filled", "=", "attr", ".", "hasFill", "(", ")", ";", "if", "(", "(", "filled", ")", "||", "...
Fills the Shape using the passed attributes. This method will silently also fill the Shape to its unique rgb color if the context is a buffer. @param context @param attr
[ "Fills", "the", "Shape", "using", "the", "passed", "attributes", ".", "This", "method", "will", "silently", "also", "fill", "the", "Shape", "to", "its", "unique", "rgb", "color", "if", "the", "context", "is", "a", "buffer", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L286-L380
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Shape.java
Shape.setStrokeParams
protected boolean setStrokeParams(final Context2D context, final Attributes attr, double alpha, final boolean filled) { double width = attr.getStrokeWidth(); String color = attr.getStrokeColor(); if (null == color) { if (width > 0) { color = LienzoCore.get().getDefaultStrokeColor(); } } else if (width <= 0) { width = LienzoCore.get().getDefaultStrokeWidth(); } if ((null == color) && (width <= 0)) { if (filled) { return false; } color = LienzoCore.get().getDefaultStrokeColor(); width = LienzoCore.get().getDefaultStrokeWidth(); } alpha = alpha * attr.getStrokeAlpha(); if (alpha <= 0) { return false; } double offset = 0; if (context.isSelection()) { color = getColorKey(); if (null == color) { return false; } context.save(); offset = getSelectionStrokeOffset(); } else { context.save(); context.setGlobalAlpha(alpha); } context.setStrokeColor(color); context.setStrokeWidth(width + offset); if (false == attr.hasExtraStrokeAttributes()) { return true; } boolean isdashed = false; if (attr.isDefined(Attribute.DASH_ARRAY)) { if (LienzoCore.get().isLineDashSupported()) { final DashArray dash = attr.getDashArray(); if ((null != dash) && (dash.size() > 0)) { context.setLineDash(dash); if (attr.isDefined(Attribute.DASH_OFFSET)) { context.setLineDashOffset(attr.getDashOffset()); } isdashed = true; } } } if ((isdashed) || (doStrokeExtraProperties())) { if (attr.isDefined(Attribute.LINE_JOIN)) { context.setLineJoin(attr.getLineJoin()); } if (attr.isDefined(Attribute.LINE_CAP)) { context.setLineCap(attr.getLineCap()); } if (attr.isDefined(Attribute.MITER_LIMIT)) { context.setMiterLimit(attr.getMiterLimit()); } } return true; }
java
protected boolean setStrokeParams(final Context2D context, final Attributes attr, double alpha, final boolean filled) { double width = attr.getStrokeWidth(); String color = attr.getStrokeColor(); if (null == color) { if (width > 0) { color = LienzoCore.get().getDefaultStrokeColor(); } } else if (width <= 0) { width = LienzoCore.get().getDefaultStrokeWidth(); } if ((null == color) && (width <= 0)) { if (filled) { return false; } color = LienzoCore.get().getDefaultStrokeColor(); width = LienzoCore.get().getDefaultStrokeWidth(); } alpha = alpha * attr.getStrokeAlpha(); if (alpha <= 0) { return false; } double offset = 0; if (context.isSelection()) { color = getColorKey(); if (null == color) { return false; } context.save(); offset = getSelectionStrokeOffset(); } else { context.save(); context.setGlobalAlpha(alpha); } context.setStrokeColor(color); context.setStrokeWidth(width + offset); if (false == attr.hasExtraStrokeAttributes()) { return true; } boolean isdashed = false; if (attr.isDefined(Attribute.DASH_ARRAY)) { if (LienzoCore.get().isLineDashSupported()) { final DashArray dash = attr.getDashArray(); if ((null != dash) && (dash.size() > 0)) { context.setLineDash(dash); if (attr.isDefined(Attribute.DASH_OFFSET)) { context.setLineDashOffset(attr.getDashOffset()); } isdashed = true; } } } if ((isdashed) || (doStrokeExtraProperties())) { if (attr.isDefined(Attribute.LINE_JOIN)) { context.setLineJoin(attr.getLineJoin()); } if (attr.isDefined(Attribute.LINE_CAP)) { context.setLineCap(attr.getLineCap()); } if (attr.isDefined(Attribute.MITER_LIMIT)) { context.setMiterLimit(attr.getMiterLimit()); } } return true; }
[ "protected", "boolean", "setStrokeParams", "(", "final", "Context2D", "context", ",", "final", "Attributes", "attr", ",", "double", "alpha", ",", "final", "boolean", "filled", ")", "{", "double", "width", "=", "attr", ".", "getStrokeWidth", "(", ")", ";", "S...
Sets the Shape Stroke parameters. @param context @param attr @return boolean
[ "Sets", "the", "Shape", "Stroke", "parameters", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L525-L622
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Shape.java
Shape.doApplyShadow
protected final void doApplyShadow(final Context2D context, final Attributes attr) { if ((false == isAppliedShadow()) && (attr.hasShadow())) { setAppliedShadow(true); final Shadow shadow = attr.getShadow(); if (null != shadow) { context.setShadow(shadow); } } }
java
protected final void doApplyShadow(final Context2D context, final Attributes attr) { if ((false == isAppliedShadow()) && (attr.hasShadow())) { setAppliedShadow(true); final Shadow shadow = attr.getShadow(); if (null != shadow) { context.setShadow(shadow); } } }
[ "protected", "final", "void", "doApplyShadow", "(", "final", "Context2D", "context", ",", "final", "Attributes", "attr", ")", "{", "if", "(", "(", "false", "==", "isAppliedShadow", "(", ")", ")", "&&", "(", "attr", ".", "hasShadow", "(", ")", ")", ")", ...
Applies this shape's Shadow. @param context @param attr @return boolean
[ "Applies", "this", "shape", "s", "Shadow", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L670-L683
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Shape.java
Shape.setDashArray
public T setDashArray(final double dash, final double... dashes) { getAttributes().setDashArray(new DashArray(dash, dashes)); return cast(); }
java
public T setDashArray(final double dash, final double... dashes) { getAttributes().setDashArray(new DashArray(dash, dashes)); return cast(); }
[ "public", "T", "setDashArray", "(", "final", "double", "dash", ",", "final", "double", "...", "dashes", ")", "{", "getAttributes", "(", ")", ".", "setDashArray", "(", "new", "DashArray", "(", "dash", ",", "dashes", ")", ")", ";", "return", "cast", "(", ...
Sets the dash array with individual dash lengths. @param dash length of dash @param dashes if specified, length of remaining dashes @return this Line
[ "Sets", "the", "dash", "array", "with", "individual", "dash", "lengths", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L755-L760
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Shape.java
Shape.moveUp
@SuppressWarnings("unchecked") @Override public T moveUp() { final Node<?> parent = getParent(); if (null != parent) { final IContainer<?, IPrimitive<?>> container = (IContainer<?, IPrimitive<?>>) parent.asContainer(); if (null != container) { container.moveUp(this); } } return cast(); }
java
@SuppressWarnings("unchecked") @Override public T moveUp() { final Node<?> parent = getParent(); if (null != parent) { final IContainer<?, IPrimitive<?>> container = (IContainer<?, IPrimitive<?>>) parent.asContainer(); if (null != container) { container.moveUp(this); } } return cast(); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "T", "moveUp", "(", ")", "{", "final", "Node", "<", "?", ">", "parent", "=", "getParent", "(", ")", ";", "if", "(", "null", "!=", "parent", ")", "{", "final", "IContainer", ...
Moves this shape one layer up. @return T
[ "Moves", "this", "shape", "one", "layer", "up", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L842-L858
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Shape.java
Shape.setScale
@Override public T setScale(final double x, final double y) { getAttributes().setScale(x, y); return cast(); }
java
@Override public T setScale(final double x, final double y) { getAttributes().setScale(x, y); return cast(); }
[ "@", "Override", "public", "T", "setScale", "(", "final", "double", "x", ",", "final", "double", "y", ")", "{", "getAttributes", "(", ")", ".", "setScale", "(", "x", ",", "y", ")", ";", "return", "cast", "(", ")", ";", "}" ]
Sets this shape's scale, starting at the given x and y @param x @param y @return T
[ "Sets", "this", "shape", "s", "scale", "starting", "at", "the", "given", "x", "and", "y" ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L1154-L1160
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Shape.java
Shape.setShear
@Override public T setShear(final double x, final double y) { getAttributes().setShear(x, y); return cast(); }
java
@Override public T setShear(final double x, final double y) { getAttributes().setShear(x, y); return cast(); }
[ "@", "Override", "public", "T", "setShear", "(", "final", "double", "x", ",", "final", "double", "y", ")", "{", "getAttributes", "(", ")", ".", "setShear", "(", "x", ",", "y", ")", ";", "return", "cast", "(", ")", ";", "}" ]
Sets this shape's shear @param offset @return T
[ "Sets", "this", "shape", "s", "shear" ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L1243-L1249
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Shape.java
Shape.setOffset
@Override public T setOffset(final double x, final double y) { getAttributes().setOffset(x, y); return cast(); }
java
@Override public T setOffset(final double x, final double y) { getAttributes().setOffset(x, y); return cast(); }
[ "@", "Override", "public", "T", "setOffset", "(", "final", "double", "x", ",", "final", "double", "y", ")", "{", "getAttributes", "(", ")", ".", "setOffset", "(", "x", ",", "y", ")", ";", "return", "cast", "(", ")", ";", "}" ]
Sets this shape's offset, at the given x and y coordinates. @param x @param y @return T
[ "Sets", "this", "shape", "s", "offset", "at", "the", "given", "x", "and", "y", "coordinates", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L1297-L1303
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Shape.java
Shape.setFillColor
public T setFillColor(final IColor color) { return setFillColor(null == color ? null : color.getColorString()); }
java
public T setFillColor(final IColor color) { return setFillColor(null == color ? null : color.getColorString()); }
[ "public", "T", "setFillColor", "(", "final", "IColor", "color", ")", "{", "return", "setFillColor", "(", "null", "==", "color", "?", "null", ":", "color", ".", "getColorString", "(", ")", ")", ";", "}" ]
Sets the fill color. @param color ColorName @return T
[ "Sets", "the", "fill", "color", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L1473-L1476
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Shape.java
Shape.setStrokeColor
public T setStrokeColor(final IColor color) { return setStrokeColor(null == color ? null : color.getColorString()); }
java
public T setStrokeColor(final IColor color) { return setStrokeColor(null == color ? null : color.getColorString()); }
[ "public", "T", "setStrokeColor", "(", "final", "IColor", "color", ")", "{", "return", "setStrokeColor", "(", "null", "==", "color", "?", "null", ":", "color", ".", "getColorString", "(", ")", ")", ";", "}" ]
Sets the stroke color. @param color Color or ColorName @return T
[ "Sets", "the", "stroke", "color", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L1558-L1561
train
mqlight/java-mqlight
mqlight/src/main/java/com/ibm/mqlight/api/impl/network/NettyNetworkService.java
NettyNetworkService.decrementUseCount
private static synchronized void decrementUseCount() { final String methodName = "decrementUseCount"; logger.entry(methodName); --useCount; if (useCount <= 0) { if (bootstrap != null) { bootstrap.group().shutdownGracefully(0, 500, TimeUnit.MILLISECONDS); } bootstrap = null; useCount = 0; } logger.exit(methodName); }
java
private static synchronized void decrementUseCount() { final String methodName = "decrementUseCount"; logger.entry(methodName); --useCount; if (useCount <= 0) { if (bootstrap != null) { bootstrap.group().shutdownGracefully(0, 500, TimeUnit.MILLISECONDS); } bootstrap = null; useCount = 0; } logger.exit(methodName); }
[ "private", "static", "synchronized", "void", "decrementUseCount", "(", ")", "{", "final", "String", "methodName", "=", "\"decrementUseCount\"", ";", "logger", ".", "entry", "(", "methodName", ")", ";", "--", "useCount", ";", "if", "(", "useCount", "<=", "0", ...
Decrement the use count of the workerGroup and request a graceful shutdown once it is no longer being used by anyone.
[ "Decrement", "the", "use", "count", "of", "the", "workerGroup", "and", "request", "a", "graceful", "shutdown", "once", "it", "is", "no", "longer", "being", "used", "by", "anyone", "." ]
a565dfa6044050826d1221697da9e3268b557aeb
https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/impl/network/NettyNetworkService.java#L475-L489
train
mqlight/java-mqlight
mqlight/src/main/java/com/ibm/mqlight/api/impl/network/NettyNetworkService.java
NettyNetworkService.awaitTermination
public boolean awaitTermination(long timeout) throws InterruptedException { final String methodName = "awaitTermination"; logger.entry(methodName); final boolean terminated; if (bootstrap != null) { terminated = bootstrap.group().awaitTermination(timeout, TimeUnit.SECONDS); } else { terminated = true; } logger.exit(methodName, terminated); return terminated; }
java
public boolean awaitTermination(long timeout) throws InterruptedException { final String methodName = "awaitTermination"; logger.entry(methodName); final boolean terminated; if (bootstrap != null) { terminated = bootstrap.group().awaitTermination(timeout, TimeUnit.SECONDS); } else { terminated = true; } logger.exit(methodName, terminated); return terminated; }
[ "public", "boolean", "awaitTermination", "(", "long", "timeout", ")", "throws", "InterruptedException", "{", "final", "String", "methodName", "=", "\"awaitTermination\"", ";", "logger", ".", "entry", "(", "methodName", ")", ";", "final", "boolean", "terminated", "...
Waits for the underlying network service to terminate. @param timeout Maximum time to wait in seconds. @return {@code true} if the underlying network service has terminated, {@code false} if the underlying network service is still active after waiting the specified time. @throws InterruptedException if the thread performing the operation is interrupted.
[ "Waits", "for", "the", "underlying", "network", "service", "to", "terminate", "." ]
a565dfa6044050826d1221697da9e3268b557aeb
https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/impl/network/NettyNetworkService.java#L499-L513
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/json/validators/ValidationContext.java
ValidationContext.getDebugString
public String getDebugString() { final StringBuilder b = new StringBuilder(); boolean first = true; for (final ValidationError e : m_errors) { if (first) { first = false; } else { b.append("\n"); } b.append(e.getContext()).append(" - ").append(e.getMessage()); } return b.toString(); }
java
public String getDebugString() { final StringBuilder b = new StringBuilder(); boolean first = true; for (final ValidationError e : m_errors) { if (first) { first = false; } else { b.append("\n"); } b.append(e.getContext()).append(" - ").append(e.getMessage()); } return b.toString(); }
[ "public", "String", "getDebugString", "(", ")", "{", "final", "StringBuilder", "b", "=", "new", "StringBuilder", "(", ")", ";", "boolean", "first", "=", "true", ";", "for", "(", "final", "ValidationError", "e", ":", "m_errors", ")", "{", "if", "(", "firs...
Returns a string with all error messages for debugging purposes. @return String
[ "Returns", "a", "string", "with", "all", "error", "messages", "for", "debugging", "purposes", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/json/validators/ValidationContext.java#L289-L308
train
fabric8io/fabric8-forge
addons/utils/src/main/java/io/fabric8/forge/addon/utils/JavaHelper.java
JavaHelper.removeJavaPackageName
public static String removeJavaPackageName(String className) { int idx = className.lastIndexOf('.'); if (idx >= 0) { return className.substring(idx + 1); } else { return className; } }
java
public static String removeJavaPackageName(String className) { int idx = className.lastIndexOf('.'); if (idx >= 0) { return className.substring(idx + 1); } else { return className; } }
[ "public", "static", "String", "removeJavaPackageName", "(", "String", "className", ")", "{", "int", "idx", "=", "className", ".", "lastIndexOf", "(", "'", "'", ")", ";", "if", "(", "idx", ">=", "0", ")", "{", "return", "className", ".", "substring", "(",...
Removes the package from the type name from the given type
[ "Removes", "the", "package", "from", "the", "type", "name", "from", "the", "given", "type" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/JavaHelper.java#L29-L36
train
fabric8io/fabric8-forge
addons/utils/src/main/java/io/fabric8/forge/addon/utils/JavaHelper.java
JavaHelper.loadProjectClass
public static Class<?> loadProjectClass(Project project, String className) { URLClassLoader classLoader = getProjectClassLoader(project); if (classLoader != null ){ try { return classLoader.loadClass(className); } catch (ClassNotFoundException e) { // ignore } finally { try { classLoader.close(); } catch (IOException e) { // ignore } } } return null; }
java
public static Class<?> loadProjectClass(Project project, String className) { URLClassLoader classLoader = getProjectClassLoader(project); if (classLoader != null ){ try { return classLoader.loadClass(className); } catch (ClassNotFoundException e) { // ignore } finally { try { classLoader.close(); } catch (IOException e) { // ignore } } } return null; }
[ "public", "static", "Class", "<", "?", ">", "loadProjectClass", "(", "Project", "project", ",", "String", "className", ")", "{", "URLClassLoader", "classLoader", "=", "getProjectClassLoader", "(", "project", ")", ";", "if", "(", "classLoader", "!=", "null", ")...
Loads a class of the given name from the project class loader or returns null if its not found
[ "Loads", "a", "class", "of", "the", "given", "name", "from", "the", "project", "class", "loader", "or", "returns", "null", "if", "its", "not", "found" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/JavaHelper.java#L64-L80
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/QuadraticCurve.java
QuadraticCurve.prepare
@Override protected boolean prepare(final Context2D context, final Attributes attr, final double alpha) { final Point2DArray points = attr.getControlPoints(); if ((points != null) && (points.size() == 3)) { context.beginPath(); final Point2D p0 = points.get(0); final Point2D p1 = points.get(1); final Point2D p2 = points.get(2); context.moveTo(p0.getX(), p0.getY()); context.quadraticCurveTo(p1.getX(), p1.getY(), p2.getX(), p2.getY()); return true; } return false; }
java
@Override protected boolean prepare(final Context2D context, final Attributes attr, final double alpha) { final Point2DArray points = attr.getControlPoints(); if ((points != null) && (points.size() == 3)) { context.beginPath(); final Point2D p0 = points.get(0); final Point2D p1 = points.get(1); final Point2D p2 = points.get(2); context.moveTo(p0.getX(), p0.getY()); context.quadraticCurveTo(p1.getX(), p1.getY(), p2.getX(), p2.getY()); return true; } return false; }
[ "@", "Override", "protected", "boolean", "prepare", "(", "final", "Context2D", "context", ",", "final", "Attributes", "attr", ",", "final", "double", "alpha", ")", "{", "final", "Point2DArray", "points", "=", "attr", ".", "getControlPoints", "(", ")", ";", "...
Draws this quadratic curve @param context
[ "Draws", "this", "quadratic", "curve" ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/QuadraticCurve.java#L91-L113
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/types/ImageData.java
ImageData.copy
public final ImageData copy() { final Context2D context = new ScratchPad(getWidth(), getHeight()).getContext(); context.putImageData(this, 0, 0); return context.getImageData(0, 0, getWidth(), getHeight()); }
java
public final ImageData copy() { final Context2D context = new ScratchPad(getWidth(), getHeight()).getContext(); context.putImageData(this, 0, 0); return context.getImageData(0, 0, getWidth(), getHeight()); }
[ "public", "final", "ImageData", "copy", "(", ")", "{", "final", "Context2D", "context", "=", "new", "ScratchPad", "(", "getWidth", "(", ")", ",", "getHeight", "(", ")", ")", ".", "getContext", "(", ")", ";", "context", ".", "putImageData", "(", "this", ...
ImageData can't be cloned or deep-copied, it's an internal data structure and has some CRAZY crap in it, this is cheeeeeezy, but hey, it works, and it's portable!!!
[ "ImageData", "can", "t", "be", "cloned", "or", "deep", "-", "copied", "it", "s", "an", "internal", "data", "structure", "and", "has", "some", "CRAZY", "crap", "in", "it", "this", "is", "cheeeeeezy", "but", "hey", "it", "works", "and", "it", "s", "porta...
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/types/ImageData.java#L51-L58
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Star.java
Star.prepare
@Override protected boolean prepare(final Context2D context, final Attributes attr, final double alpha) { if (m_list.size() < 1) { if (false == parse(attr)) { return false; } } if (m_list.size() < 1) { return false; } context.path(m_list); return true; }
java
@Override protected boolean prepare(final Context2D context, final Attributes attr, final double alpha) { if (m_list.size() < 1) { if (false == parse(attr)) { return false; } } if (m_list.size() < 1) { return false; } context.path(m_list); return true; }
[ "@", "Override", "protected", "boolean", "prepare", "(", "final", "Context2D", "context", ",", "final", "Attributes", "attr", ",", "final", "double", "alpha", ")", "{", "if", "(", "m_list", ".", "size", "(", ")", "<", "1", ")", "{", "if", "(", "false",...
Draws this star. @param context
[ "Draws", "this", "star", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Star.java#L84-L101
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Circle.java
Circle.prepare
@Override protected boolean prepare(final Context2D context, final Attributes attr, final double alpha) { final double r = attr.getRadius(); if (r > 0) { context.beginPath(); context.arc(0, 0, r, 0, Math.PI * 2, true); context.closePath(); return true; } return false; }
java
@Override protected boolean prepare(final Context2D context, final Attributes attr, final double alpha) { final double r = attr.getRadius(); if (r > 0) { context.beginPath(); context.arc(0, 0, r, 0, Math.PI * 2, true); context.closePath(); return true; } return false; }
[ "@", "Override", "protected", "boolean", "prepare", "(", "final", "Context2D", "context", ",", "final", "Attributes", "attr", ",", "final", "double", "alpha", ")", "{", "final", "double", "r", "=", "attr", ".", "getRadius", "(", ")", ";", "if", "(", "r",...
Draws this circle @param context the {@link Context2D} used to draw this circle.
[ "Draws", "this", "circle" ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Circle.java#L64-L80
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Node.java
Node.getLayer
@Override public Layer getLayer() { final Node<?> parent = getParent();// change, no iteration, no testing, no casting, recurses upwards to a Layer, and Layer returns itself, CYCLES!!! if (null != parent) { return parent.getLayer(); } return null; }
java
@Override public Layer getLayer() { final Node<?> parent = getParent();// change, no iteration, no testing, no casting, recurses upwards to a Layer, and Layer returns itself, CYCLES!!! if (null != parent) { return parent.getLayer(); } return null; }
[ "@", "Override", "public", "Layer", "getLayer", "(", ")", "{", "final", "Node", "<", "?", ">", "parent", "=", "getParent", "(", ")", ";", "// change, no iteration, no testing, no casting, recurses upwards to a Layer, and Layer returns itself, CYCLES!!!", "if", "(", "null"...
Returns the Layer that this Node is on. @return {@link Layer}
[ "Returns", "the", "Layer", "that", "this", "Node", "is", "on", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Node.java#L381-L391
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Node.java
Node.getScene
@Override public Scene getScene() { final Node<?> parent = getParent();// change, no iteration, no testing, no casting, recurses upwards to a Scene, and Scene returns itself, CYCLES!!! if (null != parent) { return parent.getScene(); } return null; }
java
@Override public Scene getScene() { final Node<?> parent = getParent();// change, no iteration, no testing, no casting, recurses upwards to a Scene, and Scene returns itself, CYCLES!!! if (null != parent) { return parent.getScene(); } return null; }
[ "@", "Override", "public", "Scene", "getScene", "(", ")", "{", "final", "Node", "<", "?", ">", "parent", "=", "getParent", "(", ")", ";", "// change, no iteration, no testing, no casting, recurses upwards to a Scene, and Scene returns itself, CYCLES!!!", "if", "(", "null"...
Returns the Scene that this Node is on. @return Scene
[ "Returns", "the", "Scene", "that", "this", "Node", "is", "on", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Node.java#L398-L408
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Node.java
Node.getViewport
@Override public Viewport getViewport() { final Node<?> parent = getParent();// change, no iteration, no testing, no casting, recurses upwards to a Viewport, and Viewport returns itself, CYCLES!!! if (null != parent) { return parent.getViewport(); } return null; }
java
@Override public Viewport getViewport() { final Node<?> parent = getParent();// change, no iteration, no testing, no casting, recurses upwards to a Viewport, and Viewport returns itself, CYCLES!!! if (null != parent) { return parent.getViewport(); } return null; }
[ "@", "Override", "public", "Viewport", "getViewport", "(", ")", "{", "final", "Node", "<", "?", ">", "parent", "=", "getParent", "(", ")", ";", "// change, no iteration, no testing, no casting, recurses upwards to a Viewport, and Viewport returns itself, CYCLES!!!", "if", "...
Returns the Viewport that this Node is on.
[ "Returns", "the", "Viewport", "that", "this", "Node", "is", "on", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Node.java#L413-L423
train
fabric8io/fabric8-forge
addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java
MavenHelpers.findPlugin
public static Plugin findPlugin(List<Plugin> plugins, String artifactId) { if (plugins != null) { for (Plugin plugin : plugins) { String groupId = plugin.getGroupId(); if (Strings.isNullOrBlank(groupId) || Objects.equal(groupId, mavenPluginsGroupId)) { if (Objects.equal(artifactId, plugin.getArtifactId())) { return plugin; } } } } return null; }
java
public static Plugin findPlugin(List<Plugin> plugins, String artifactId) { if (plugins != null) { for (Plugin plugin : plugins) { String groupId = plugin.getGroupId(); if (Strings.isNullOrBlank(groupId) || Objects.equal(groupId, mavenPluginsGroupId)) { if (Objects.equal(artifactId, plugin.getArtifactId())) { return plugin; } } } } return null; }
[ "public", "static", "Plugin", "findPlugin", "(", "List", "<", "Plugin", ">", "plugins", ",", "String", "artifactId", ")", "{", "if", "(", "plugins", "!=", "null", ")", "{", "for", "(", "Plugin", "plugin", ":", "plugins", ")", "{", "String", "groupId", ...
Returns the maven plugin for the given artifact id or returns null if it cannot be found
[ "Returns", "the", "maven", "plugin", "for", "the", "given", "artifact", "id", "or", "returns", "null", "if", "it", "cannot", "be", "found" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java#L64-L76
train
fabric8io/fabric8-forge
addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java
MavenHelpers.findProfile
public static Profile findProfile(Model mavenModel, String profileId) { List<Profile> profiles = mavenModel.getProfiles(); if (profiles != null) { for (Profile profile : profiles) { if (Objects.equal(profile.getId(), profileId)) { return profile; } } } return null; }
java
public static Profile findProfile(Model mavenModel, String profileId) { List<Profile> profiles = mavenModel.getProfiles(); if (profiles != null) { for (Profile profile : profiles) { if (Objects.equal(profile.getId(), profileId)) { return profile; } } } return null; }
[ "public", "static", "Profile", "findProfile", "(", "Model", "mavenModel", ",", "String", "profileId", ")", "{", "List", "<", "Profile", ">", "profiles", "=", "mavenModel", ".", "getProfiles", "(", ")", ";", "if", "(", "profiles", "!=", "null", ")", "{", ...
Returns the profile for the given id or null if it could not be found
[ "Returns", "the", "profile", "for", "the", "given", "id", "or", "null", "if", "it", "could", "not", "be", "found" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java#L106-L116
train
fabric8io/fabric8-forge
addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java
MavenHelpers.ensureMavenDependencyAdded
public static boolean ensureMavenDependencyAdded(Project project, DependencyInstaller dependencyInstaller, String groupId, String artifactId, String scope) { List<Dependency> dependencies = project.getFacet(DependencyFacet.class).getEffectiveDependencies(); for (Dependency d : dependencies) { if (groupId.equals(d.getCoordinate().getGroupId()) && artifactId.equals(d.getCoordinate().getArtifactId())) { getLOG().debug("Project already includes: " + groupId + ":" + artifactId + " for version: " + d.getCoordinate().getVersion()); return false; } } DependencyBuilder component = DependencyBuilder.create(). setGroupId(groupId). setArtifactId(artifactId); if (scope != null) { component.setScopeType(scope); } String version = MavenHelpers.getVersion(groupId, artifactId); if (Strings.isNotBlank(version)) { component = component.setVersion(version); getLOG().debug("Adding pom.xml dependency: " + groupId + ":" + artifactId + " version: " + version + " scope: " + scope); } else { getLOG().debug("No version could be found for: " + groupId + ":" + artifactId); } dependencyInstaller.install(project, component); return true; }
java
public static boolean ensureMavenDependencyAdded(Project project, DependencyInstaller dependencyInstaller, String groupId, String artifactId, String scope) { List<Dependency> dependencies = project.getFacet(DependencyFacet.class).getEffectiveDependencies(); for (Dependency d : dependencies) { if (groupId.equals(d.getCoordinate().getGroupId()) && artifactId.equals(d.getCoordinate().getArtifactId())) { getLOG().debug("Project already includes: " + groupId + ":" + artifactId + " for version: " + d.getCoordinate().getVersion()); return false; } } DependencyBuilder component = DependencyBuilder.create(). setGroupId(groupId). setArtifactId(artifactId); if (scope != null) { component.setScopeType(scope); } String version = MavenHelpers.getVersion(groupId, artifactId); if (Strings.isNotBlank(version)) { component = component.setVersion(version); getLOG().debug("Adding pom.xml dependency: " + groupId + ":" + artifactId + " version: " + version + " scope: " + scope); } else { getLOG().debug("No version could be found for: " + groupId + ":" + artifactId); } dependencyInstaller.install(project, component); return true; }
[ "public", "static", "boolean", "ensureMavenDependencyAdded", "(", "Project", "project", ",", "DependencyInstaller", "dependencyInstaller", ",", "String", "groupId", ",", "String", "artifactId", ",", "String", "scope", ")", "{", "List", "<", "Dependency", ">", "depen...
Returns true if the dependency was added or false if its already there
[ "Returns", "true", "if", "the", "dependency", "was", "added", "or", "false", "if", "its", "already", "there" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java#L121-L147
train
fabric8io/fabric8-forge
addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java
MavenHelpers.hasDependency
public static boolean hasDependency(Model pom, String groupId, String artifactId) { if (pom != null) { List<org.apache.maven.model.Dependency> dependencies = pom.getDependencies(); return hasDependency(dependencies, groupId, artifactId); } return false; }
java
public static boolean hasDependency(Model pom, String groupId, String artifactId) { if (pom != null) { List<org.apache.maven.model.Dependency> dependencies = pom.getDependencies(); return hasDependency(dependencies, groupId, artifactId); } return false; }
[ "public", "static", "boolean", "hasDependency", "(", "Model", "pom", ",", "String", "groupId", ",", "String", "artifactId", ")", "{", "if", "(", "pom", "!=", "null", ")", "{", "List", "<", "org", ".", "apache", ".", "maven", ".", "model", ".", "Depende...
Returns true if the pom has the given dependency
[ "Returns", "true", "if", "the", "pom", "has", "the", "given", "dependency" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java#L221-L227
train
fabric8io/fabric8-forge
addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java
MavenHelpers.hasDependency
public static boolean hasDependency(List<org.apache.maven.model.Dependency> dependencies, String groupId, String artifactId) { if (dependencies != null) { for (org.apache.maven.model.Dependency dependency : dependencies) { if (Objects.equal(groupId, dependency.getGroupId()) && Objects.equal(artifactId, dependency.getArtifactId())) { return true; } } } return false; }
java
public static boolean hasDependency(List<org.apache.maven.model.Dependency> dependencies, String groupId, String artifactId) { if (dependencies != null) { for (org.apache.maven.model.Dependency dependency : dependencies) { if (Objects.equal(groupId, dependency.getGroupId()) && Objects.equal(artifactId, dependency.getArtifactId())) { return true; } } } return false; }
[ "public", "static", "boolean", "hasDependency", "(", "List", "<", "org", ".", "apache", ".", "maven", ".", "model", ".", "Dependency", ">", "dependencies", ",", "String", "groupId", ",", "String", "artifactId", ")", "{", "if", "(", "dependencies", "!=", "n...
Returns true if the list has the given dependency
[ "Returns", "true", "if", "the", "list", "has", "the", "given", "dependency" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java#L232-L241
train
fabric8io/fabric8-forge
addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java
MavenHelpers.hasManagedDependency
public static boolean hasManagedDependency(Model pom, String groupId, String artifactId) { if (pom != null) { DependencyManagement dependencyManagement = pom.getDependencyManagement(); if (dependencyManagement != null) { return hasDependency(dependencyManagement.getDependencies(), groupId, artifactId); } } return false; }
java
public static boolean hasManagedDependency(Model pom, String groupId, String artifactId) { if (pom != null) { DependencyManagement dependencyManagement = pom.getDependencyManagement(); if (dependencyManagement != null) { return hasDependency(dependencyManagement.getDependencies(), groupId, artifactId); } } return false; }
[ "public", "static", "boolean", "hasManagedDependency", "(", "Model", "pom", ",", "String", "groupId", ",", "String", "artifactId", ")", "{", "if", "(", "pom", "!=", "null", ")", "{", "DependencyManagement", "dependencyManagement", "=", "pom", ".", "getDependency...
Returns true if the pom has the given managed dependency
[ "Returns", "true", "if", "the", "pom", "has", "the", "given", "managed", "dependency" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java#L246-L254
train
fabric8io/fabric8-forge
addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java
MavenHelpers.updatePomProperty
public static boolean updatePomProperty(Properties properties, String name, Object value, boolean updated) { if (value != null) { Object oldValue = properties.get(name); if (!Objects.equal(oldValue, value)) { getLOG().debug("Updating pom.xml property: " + name + " to " + value); properties.put(name, value); return true; } } return updated; }
java
public static boolean updatePomProperty(Properties properties, String name, Object value, boolean updated) { if (value != null) { Object oldValue = properties.get(name); if (!Objects.equal(oldValue, value)) { getLOG().debug("Updating pom.xml property: " + name + " to " + value); properties.put(name, value); return true; } } return updated; }
[ "public", "static", "boolean", "updatePomProperty", "(", "Properties", "properties", ",", "String", "name", ",", "Object", "value", ",", "boolean", "updated", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "Object", "oldValue", "=", "properties", ".",...
Updates the given maven property value if value is not null and returns true if the pom has been changed @return true if the value changed and was non null or updated was true
[ "Updates", "the", "given", "maven", "property", "value", "if", "value", "is", "not", "null", "and", "returns", "true", "if", "the", "pom", "has", "been", "changed" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/MavenHelpers.java#L261-L272
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Ellipse.java
Ellipse.prepare
@Override protected boolean prepare(final Context2D context, final Attributes attr, final double alpha) { final double w = attr.getWidth(); final double h = attr.getHeight(); if ((w > 0) && (h > 0)) { context.beginPath(); context.ellipse(0, 0, w / 2, h / 2, 0, 0, Math.PI * 2, true); context.closePath(); return true; } return false; }
java
@Override protected boolean prepare(final Context2D context, final Attributes attr, final double alpha) { final double w = attr.getWidth(); final double h = attr.getHeight(); if ((w > 0) && (h > 0)) { context.beginPath(); context.ellipse(0, 0, w / 2, h / 2, 0, 0, Math.PI * 2, true); context.closePath(); return true; } return false; }
[ "@", "Override", "protected", "boolean", "prepare", "(", "final", "Context2D", "context", ",", "final", "Attributes", "attr", ",", "final", "double", "alpha", ")", "{", "final", "double", "w", "=", "attr", ".", "getWidth", "(", ")", ";", "final", "double",...
Draws this ellipse. @param context the {@link Context2D} used to draw this ellipse.
[ "Draws", "this", "ellipse", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Ellipse.java#L77-L95
train
fabric8io/fabric8-forge
addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCommandsHelper.java
CamelCommandsHelper.loadCamelComponentDetails
public static Result loadCamelComponentDetails(CamelCatalog camelCatalog, String camelComponentName, CamelComponentDetails details) { String json = camelCatalog.componentJSonSchema(camelComponentName); if (json == null) { return Results.fail("Could not find catalog entry for component name: " + camelComponentName); } List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("component", json, false); for (Map<String, String> row : data) { String javaType = row.get("javaType"); if (!Strings.isNullOrEmpty(javaType)) { details.setComponentClassQName(javaType); } String groupId = row.get("groupId"); if (!Strings.isNullOrEmpty(groupId)) { details.setGroupId(groupId); } String artifactId = row.get("artifactId"); if (!Strings.isNullOrEmpty(artifactId)) { details.setArtifactId(artifactId); } String version = row.get("version"); if (!Strings.isNullOrEmpty(version)) { details.setVersion(version); } } if (Strings.isNullOrEmpty(details.getComponentClassQName())) { return Results.fail("Could not find fully qualified class name in catalog for component name: " + camelComponentName); } return null; }
java
public static Result loadCamelComponentDetails(CamelCatalog camelCatalog, String camelComponentName, CamelComponentDetails details) { String json = camelCatalog.componentJSonSchema(camelComponentName); if (json == null) { return Results.fail("Could not find catalog entry for component name: " + camelComponentName); } List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("component", json, false); for (Map<String, String> row : data) { String javaType = row.get("javaType"); if (!Strings.isNullOrEmpty(javaType)) { details.setComponentClassQName(javaType); } String groupId = row.get("groupId"); if (!Strings.isNullOrEmpty(groupId)) { details.setGroupId(groupId); } String artifactId = row.get("artifactId"); if (!Strings.isNullOrEmpty(artifactId)) { details.setArtifactId(artifactId); } String version = row.get("version"); if (!Strings.isNullOrEmpty(version)) { details.setVersion(version); } } if (Strings.isNullOrEmpty(details.getComponentClassQName())) { return Results.fail("Could not find fully qualified class name in catalog for component name: " + camelComponentName); } return null; }
[ "public", "static", "Result", "loadCamelComponentDetails", "(", "CamelCatalog", "camelCatalog", ",", "String", "camelComponentName", ",", "CamelComponentDetails", "details", ")", "{", "String", "json", "=", "camelCatalog", ".", "componentJSonSchema", "(", "camelComponentN...
Populates the details for the given component, returning a Result if it fails.
[ "Populates", "the", "details", "for", "the", "given", "component", "returning", "a", "Result", "if", "it", "fails", "." ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCommandsHelper.java#L125-L154
train
fabric8io/fabric8-forge
addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCommandsHelper.java
CamelCommandsHelper.loadValidInputTypes
public static Class<Object> loadValidInputTypes(String javaType, String type) { // we have generics in the javatype, if so remove it so its loadable from a classloader int idx = javaType.indexOf('<'); if (idx > 0) { javaType = javaType.substring(0, idx); } try { Class<Object> clazz = getPrimitiveWrapperClassType(type); if (clazz == null) { clazz = loadPrimitiveWrapperType(javaType); } if (clazz == null) { clazz = loadStringSupportedType(javaType); } if (clazz == null) { try { clazz = (Class<Object>) Class.forName(javaType); } catch (Throwable e) { // its a custom java type so use String as the input type, so you can refer to it using # lookup if ("object".equals(type)) { clazz = loadPrimitiveWrapperType("java.lang.String"); } } } // favor specialized UI for these types if (clazz != null && (clazz.equals(String.class) || clazz.equals(Date.class) || clazz.equals(Boolean.class) || clazz.isPrimitive() || Number.class.isAssignableFrom(clazz))) { return clazz; } // its a custom java type so use String as the input type, so you can refer to it using # lookup if ("object".equals(type)) { clazz = loadPrimitiveWrapperType("java.lang.String"); return clazz; } } catch (Throwable e) { // ignore errors } return null; }
java
public static Class<Object> loadValidInputTypes(String javaType, String type) { // we have generics in the javatype, if so remove it so its loadable from a classloader int idx = javaType.indexOf('<'); if (idx > 0) { javaType = javaType.substring(0, idx); } try { Class<Object> clazz = getPrimitiveWrapperClassType(type); if (clazz == null) { clazz = loadPrimitiveWrapperType(javaType); } if (clazz == null) { clazz = loadStringSupportedType(javaType); } if (clazz == null) { try { clazz = (Class<Object>) Class.forName(javaType); } catch (Throwable e) { // its a custom java type so use String as the input type, so you can refer to it using # lookup if ("object".equals(type)) { clazz = loadPrimitiveWrapperType("java.lang.String"); } } } // favor specialized UI for these types if (clazz != null && (clazz.equals(String.class) || clazz.equals(Date.class) || clazz.equals(Boolean.class) || clazz.isPrimitive() || Number.class.isAssignableFrom(clazz))) { return clazz; } // its a custom java type so use String as the input type, so you can refer to it using # lookup if ("object".equals(type)) { clazz = loadPrimitiveWrapperType("java.lang.String"); return clazz; } } catch (Throwable e) { // ignore errors } return null; }
[ "public", "static", "Class", "<", "Object", ">", "loadValidInputTypes", "(", "String", "javaType", ",", "String", "type", ")", "{", "// we have generics in the javatype, if so remove it so its loadable from a classloader", "int", "idx", "=", "javaType", ".", "indexOf", "(...
Converts a java type as a string to a valid input type and returns the class or null if its not supported
[ "Converts", "a", "java", "type", "as", "a", "string", "to", "a", "valid", "input", "type", "and", "returns", "the", "class", "or", "null", "if", "its", "not", "supported" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCommandsHelper.java#L280-L322
train
fabric8io/fabric8-forge
addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCommandsHelper.java
CamelCommandsHelper.getPrimitiveWrapperClassType
public static Class getPrimitiveWrapperClassType(String name) { if ("string".equals(name)) { return String.class; } else if ("boolean".equals(name)) { return Boolean.class; } else if ("integer".equals(name)) { return Integer.class; } else if ("number".equals(name)) { return Float.class; } return null; }
java
public static Class getPrimitiveWrapperClassType(String name) { if ("string".equals(name)) { return String.class; } else if ("boolean".equals(name)) { return Boolean.class; } else if ("integer".equals(name)) { return Integer.class; } else if ("number".equals(name)) { return Float.class; } return null; }
[ "public", "static", "Class", "getPrimitiveWrapperClassType", "(", "String", "name", ")", "{", "if", "(", "\"string\"", ".", "equals", "(", "name", ")", ")", "{", "return", "String", ".", "class", ";", "}", "else", "if", "(", "\"boolean\"", ".", "equals", ...
Gets the JSon schema primitive type. @param name the json type @return the primitive Java Class type
[ "Gets", "the", "JSon", "schema", "primitive", "type", "." ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCommandsHelper.java#L341-L353
train
fabric8io/fabric8-forge
fabric8-forge-core/src/main/java/io/fabric8/forge/rest/dto/ValidationResult.java
ValidationResult.addValidationError
public void addValidationError(String message) { messages.add(new UIMessageDTO(message, null, UIMessage.Severity.ERROR)); valid = false; canExecute = false; }
java
public void addValidationError(String message) { messages.add(new UIMessageDTO(message, null, UIMessage.Severity.ERROR)); valid = false; canExecute = false; }
[ "public", "void", "addValidationError", "(", "String", "message", ")", "{", "messages", ".", "add", "(", "new", "UIMessageDTO", "(", "message", ",", "null", ",", "UIMessage", ".", "Severity", ".", "ERROR", ")", ")", ";", "valid", "=", "false", ";", "canE...
Adds an extra validation error
[ "Adds", "an", "extra", "validation", "error" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/dto/ValidationResult.java#L105-L109
train
fabric8io/fabric8-forge
addons/camel-tooling-util/src/main/java/io/fabric8/camel/tooling/util/XmlModel.java
XmlModel.marshalRootElement
public Object marshalRootElement() { if (justRoutes) { RoutesDefinition routes = new RoutesDefinition(); routes.setRoutes(contextElement.getRoutes()); return routes; } else { return contextElement; } }
java
public Object marshalRootElement() { if (justRoutes) { RoutesDefinition routes = new RoutesDefinition(); routes.setRoutes(contextElement.getRoutes()); return routes; } else { return contextElement; } }
[ "public", "Object", "marshalRootElement", "(", ")", "{", "if", "(", "justRoutes", ")", "{", "RoutesDefinition", "routes", "=", "new", "RoutesDefinition", "(", ")", ";", "routes", ".", "setRoutes", "(", "contextElement", ".", "getRoutes", "(", ")", ")", ";", ...
Returns the root element to be marshalled as XML @return
[ "Returns", "the", "root", "element", "to", "be", "marshalled", "as", "XML" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel-tooling-util/src/main/java/io/fabric8/camel/tooling/util/XmlModel.java#L99-L107
train
fabric8io/fabric8-forge
addons/camel-tooling-util/src/main/java/io/fabric8/camel/tooling/util/XmlModel.java
XmlModel.endpointUris
public Set<String> endpointUris() { try { // we must use reflection for now until Camel supports the getEndpoints() method // https://issues.apache.org/jira/browse/CAMEL-3644 // ... // the above is no longer valid since Camel 2.7.0 List<CamelEndpointFactoryBean> endpoints = contextElement.getEndpoints(); List<String> uris = new LinkedList<String>(); if (endpoints != null) { for (CamelEndpointFactoryBean cefb : endpoints) { uris.add(cefb.getUri()); } } // lets detect any drools endpoints... List<Node> sessions = nodesByNamespace(doc, droolsNamespace.getURI(), "ksession"); if (sessions != null) { for (Node session : sessions) { if (session instanceof Element) { Element e = (Element) session; String node = e.getAttributeValue("node"); String sid = e.getAttributeValue("id"); if (node != null && node.length() > 0 && sid != null && sid.length() > 0) { String du = "drools:" + node + "/" + sid; boolean exists = false; for (String uri : uris) { if (uri.startsWith(du)) { exists = true; } } if (!exists) { uris.add(du); } } } } } return new TreeSet<String>(uris); } catch (Exception e) { LOG.error(e.getMessage(), e); return new HashSet<String>(); } }
java
public Set<String> endpointUris() { try { // we must use reflection for now until Camel supports the getEndpoints() method // https://issues.apache.org/jira/browse/CAMEL-3644 // ... // the above is no longer valid since Camel 2.7.0 List<CamelEndpointFactoryBean> endpoints = contextElement.getEndpoints(); List<String> uris = new LinkedList<String>(); if (endpoints != null) { for (CamelEndpointFactoryBean cefb : endpoints) { uris.add(cefb.getUri()); } } // lets detect any drools endpoints... List<Node> sessions = nodesByNamespace(doc, droolsNamespace.getURI(), "ksession"); if (sessions != null) { for (Node session : sessions) { if (session instanceof Element) { Element e = (Element) session; String node = e.getAttributeValue("node"); String sid = e.getAttributeValue("id"); if (node != null && node.length() > 0 && sid != null && sid.length() > 0) { String du = "drools:" + node + "/" + sid; boolean exists = false; for (String uri : uris) { if (uri.startsWith(du)) { exists = true; } } if (!exists) { uris.add(du); } } } } } return new TreeSet<String>(uris); } catch (Exception e) { LOG.error(e.getMessage(), e); return new HashSet<String>(); } }
[ "public", "Set", "<", "String", ">", "endpointUris", "(", ")", "{", "try", "{", "// we must use reflection for now until Camel supports the getEndpoints() method", "// https://issues.apache.org/jira/browse/CAMEL-3644", "// ...", "// the above is no longer valid since Camel 2.7.0", "Lis...
Returns the endpoint URIs used in the context @return
[ "Returns", "the", "endpoint", "URIs", "used", "in", "the", "context" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel-tooling-util/src/main/java/io/fabric8/camel/tooling/util/XmlModel.java#L146-L188
train
fabric8io/fabric8-forge
fabric8-forge-core/src/main/java/io/fabric8/forge/rest/CommandsResource.java
CommandsResource.isValidCommandName
protected boolean isValidCommandName(String name) { if (Strings.isNullOrBlank(name) || ignoreCommands.contains(name)) { return false; } for (String prefix : ignoreCommandPrefixes) { if (name.startsWith(prefix)) { return false; } } return true; }
java
protected boolean isValidCommandName(String name) { if (Strings.isNullOrBlank(name) || ignoreCommands.contains(name)) { return false; } for (String prefix : ignoreCommandPrefixes) { if (name.startsWith(prefix)) { return false; } } return true; }
[ "protected", "boolean", "isValidCommandName", "(", "String", "name", ")", "{", "if", "(", "Strings", ".", "isNullOrBlank", "(", "name", ")", "||", "ignoreCommands", ".", "contains", "(", "name", ")", ")", "{", "return", "false", ";", "}", "for", "(", "St...
Returns true if the name is valid. Lets filter out commands which are not suitable to run inside fabric8-forge
[ "Returns", "true", "if", "the", "name", "is", "valid", ".", "Lets", "filter", "out", "commands", "which", "are", "not", "suitable", "to", "run", "inside", "fabric8", "-", "forge" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/CommandsResource.java#L608-L618
train
fabric8io/fabric8-forge
addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/ConfigureEipPropertiesStep.java
ConfigureEipPropertiesStep.mandatoryAttributeValue
public static String mandatoryAttributeValue(Map<Object, Object> attributeMap, String name) { Object value = attributeMap.get(name); if (value != null) { String text = value.toString(); if (!Strings.isBlank(text)) { return text; } } throw new IllegalArgumentException("The attribute value '" + name + "' did not get passed on from the previous wizard page"); }
java
public static String mandatoryAttributeValue(Map<Object, Object> attributeMap, String name) { Object value = attributeMap.get(name); if (value != null) { String text = value.toString(); if (!Strings.isBlank(text)) { return text; } } throw new IllegalArgumentException("The attribute value '" + name + "' did not get passed on from the previous wizard page"); }
[ "public", "static", "String", "mandatoryAttributeValue", "(", "Map", "<", "Object", ",", "Object", ">", "attributeMap", ",", "String", "name", ")", "{", "Object", "value", "=", "attributeMap", ".", "get", "(", "name", ")", ";", "if", "(", "value", "!=", ...
Returns the mandatory String value of the given name @throws IllegalArgumentException if the value is not available in the given attribute map
[ "Returns", "the", "mandatory", "String", "value", "of", "the", "given", "name" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/ConfigureEipPropertiesStep.java#L319-L328
train
fabric8io/fabric8-forge
addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/completer/XmlFileCompleter.java
XmlFileCompleter.validateFileDoesNotExist
public void validateFileDoesNotExist(UIInput<String> directory, UIInput<String> fileName, UIValidationContext validator) { String resourcePath = CamelXmlHelper.createFileName(directory, fileName); if (files.contains(resourcePath)) { validator.addValidationError(fileName, "A file with that name already exists!"); } }
java
public void validateFileDoesNotExist(UIInput<String> directory, UIInput<String> fileName, UIValidationContext validator) { String resourcePath = CamelXmlHelper.createFileName(directory, fileName); if (files.contains(resourcePath)) { validator.addValidationError(fileName, "A file with that name already exists!"); } }
[ "public", "void", "validateFileDoesNotExist", "(", "UIInput", "<", "String", ">", "directory", ",", "UIInput", "<", "String", ">", "fileName", ",", "UIValidationContext", "validator", ")", "{", "String", "resourcePath", "=", "CamelXmlHelper", ".", "createFileName", ...
Validates that the given selected directory and fileName are valid and that the file doesn't already exist
[ "Validates", "that", "the", "given", "selected", "directory", "and", "fileName", "are", "valid", "and", "that", "the", "file", "doesn", "t", "already", "exist" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/completer/XmlFileCompleter.java#L78-L83
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/Chord.java
Chord.prepare
@Override protected boolean prepare(final Context2D context, final Attributes attr, final double alpha) { final double r = attr.getRadius(); final double beg = attr.getStartAngle(); final double end = attr.getEndAngle(); if (r > 0) { context.beginPath(); if (beg == end) { context.arc(0, 0, r, 0, Math.PI * 2, true); } else { context.arc(0, 0, r, beg, end, attr.isCounterClockwise()); } context.closePath(); return true; } return false; }
java
@Override protected boolean prepare(final Context2D context, final Attributes attr, final double alpha) { final double r = attr.getRadius(); final double beg = attr.getStartAngle(); final double end = attr.getEndAngle(); if (r > 0) { context.beginPath(); if (beg == end) { context.arc(0, 0, r, 0, Math.PI * 2, true); } else { context.arc(0, 0, r, beg, end, attr.isCounterClockwise()); } context.closePath(); return true; } return false; }
[ "@", "Override", "protected", "boolean", "prepare", "(", "final", "Context2D", "context", ",", "final", "Attributes", "attr", ",", "final", "double", "alpha", ")", "{", "final", "double", "r", "=", "attr", ".", "getRadius", "(", ")", ";", "final", "double"...
Draws this chord. @param context
[ "Draws", "this", "chord", "." ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Chord.java#L82-L108
train
mqlight/java-mqlight
mqlight/src/main/java/com/ibm/mqlight/api/impl/engine/Engine.java
Engine.writeToNetwork
private void writeToNetwork(EngineConnection engineConnection) { final String methodName = "writeToNetwork"; logger.entry(this, methodName, engineConnection); if (engineConnection.transport.pending() > 0) { ByteBuffer head = engineConnection.transport.head(); int amount = head.remaining(); engineConnection.channel.write(head, new NetworkWritePromiseImpl(this, amount, engineConnection)); engineConnection.transport.pop(amount); engineConnection.transport.tick(System.currentTimeMillis()); } logger.exit(this, methodName); }
java
private void writeToNetwork(EngineConnection engineConnection) { final String methodName = "writeToNetwork"; logger.entry(this, methodName, engineConnection); if (engineConnection.transport.pending() > 0) { ByteBuffer head = engineConnection.transport.head(); int amount = head.remaining(); engineConnection.channel.write(head, new NetworkWritePromiseImpl(this, amount, engineConnection)); engineConnection.transport.pop(amount); engineConnection.transport.tick(System.currentTimeMillis()); } logger.exit(this, methodName); }
[ "private", "void", "writeToNetwork", "(", "EngineConnection", "engineConnection", ")", "{", "final", "String", "methodName", "=", "\"writeToNetwork\"", ";", "logger", ".", "entry", "(", "this", ",", "methodName", ",", "engineConnection", ")", ";", "if", "(", "en...
Drains any pending data from a Proton transport object onto the network
[ "Drains", "any", "pending", "data", "from", "a", "Proton", "transport", "object", "onto", "the", "network" ]
a565dfa6044050826d1221697da9e3268b557aeb
https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/impl/engine/Engine.java#L440-L453
train
mqlight/java-mqlight
mqlight/src/main/java/com/ibm/mqlight/api/impl/engine/Engine.java
Engine.resetReceiveIdleTimer
private void resetReceiveIdleTimer(Event event) { final String methodName = "resetReceiveIdleTimer"; logger.entry(this, methodName, event); if (receiveScheduledFuture != null) { receiveScheduledFuture.cancel(false); } final Transport transport = event.getTransport(); if (transport != null) { final int localIdleTimeOut = transport.getIdleTimeout(); if (localIdleTimeOut > 0) { Runnable receiveTimeout = new Runnable() { @Override public void run() { final String methodName = "run"; logger.entry(this, methodName); transport.process(); transport.tick(System.currentTimeMillis()); logger.exit(methodName); } }; receiveScheduledFuture = scheduler.schedule(receiveTimeout, localIdleTimeOut, TimeUnit.MILLISECONDS); } } logger.exit(this, methodName); }
java
private void resetReceiveIdleTimer(Event event) { final String methodName = "resetReceiveIdleTimer"; logger.entry(this, methodName, event); if (receiveScheduledFuture != null) { receiveScheduledFuture.cancel(false); } final Transport transport = event.getTransport(); if (transport != null) { final int localIdleTimeOut = transport.getIdleTimeout(); if (localIdleTimeOut > 0) { Runnable receiveTimeout = new Runnable() { @Override public void run() { final String methodName = "run"; logger.entry(this, methodName); transport.process(); transport.tick(System.currentTimeMillis()); logger.exit(methodName); } }; receiveScheduledFuture = scheduler.schedule(receiveTimeout, localIdleTimeOut, TimeUnit.MILLISECONDS); } } logger.exit(this, methodName); }
[ "private", "void", "resetReceiveIdleTimer", "(", "Event", "event", ")", "{", "final", "String", "methodName", "=", "\"resetReceiveIdleTimer\"", ";", "logger", ".", "entry", "(", "this", ",", "methodName", ",", "event", ")", ";", "if", "(", "receiveScheduledFutur...
Reset the local idle timers, now that we have received some data. If we have set an idle timeout the client must send some data at least that often, we double the timeout before checking.
[ "Reset", "the", "local", "idle", "timers", "now", "that", "we", "have", "received", "some", "data", "." ]
a565dfa6044050826d1221697da9e3268b557aeb
https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/impl/engine/Engine.java#L466-L493
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/wires/handlers/impl/WiresDockingControlImpl.java
WiresDockingControlImpl.getCloserMagnet
private WiresMagnet getCloserMagnet(final WiresShape shape, final WiresContainer parent, final boolean allowOverlap) { final WiresShape parentShape = (WiresShape) parent; final MagnetManager.Magnets magnets = parentShape.getMagnets(); final Point2D shapeLocation = shape.getComputedLocation(); final Point2D shapeCenter = Geometry.findCenter(shape.getPath().getBoundingBox()); final double shapeX = shapeCenter.getX() + shapeLocation.getX(); final double shapeY = shapeCenter.getX() + shapeLocation.getY(); int magnetIndex = -1; Double minDistance = null; //not considering the zero magnet, that is the center. for (int i = 1; i < magnets.size(); i++) { final WiresMagnet magnet = magnets.getMagnet(i); //skip magnet that has shape over it if (allowOverlap || !hasShapeOnMagnet(magnet, parentShape)) { final double magnetX = magnet.getControl().getLocation().getX(); final double magnetY = magnet.getControl().getLocation().getY(); final double distance = Geometry.distance(magnetX, magnetY, shapeX, shapeY); //getting shorter distance if ((minDistance == null) || (distance < minDistance)) { minDistance = distance; magnetIndex = i; } } } return (magnetIndex > 0 ? magnets.getMagnet(magnetIndex) : null); }
java
private WiresMagnet getCloserMagnet(final WiresShape shape, final WiresContainer parent, final boolean allowOverlap) { final WiresShape parentShape = (WiresShape) parent; final MagnetManager.Magnets magnets = parentShape.getMagnets(); final Point2D shapeLocation = shape.getComputedLocation(); final Point2D shapeCenter = Geometry.findCenter(shape.getPath().getBoundingBox()); final double shapeX = shapeCenter.getX() + shapeLocation.getX(); final double shapeY = shapeCenter.getX() + shapeLocation.getY(); int magnetIndex = -1; Double minDistance = null; //not considering the zero magnet, that is the center. for (int i = 1; i < magnets.size(); i++) { final WiresMagnet magnet = magnets.getMagnet(i); //skip magnet that has shape over it if (allowOverlap || !hasShapeOnMagnet(magnet, parentShape)) { final double magnetX = magnet.getControl().getLocation().getX(); final double magnetY = magnet.getControl().getLocation().getY(); final double distance = Geometry.distance(magnetX, magnetY, shapeX, shapeY); //getting shorter distance if ((minDistance == null) || (distance < minDistance)) { minDistance = distance; magnetIndex = i; } } } return (magnetIndex > 0 ? magnets.getMagnet(magnetIndex) : null); }
[ "private", "WiresMagnet", "getCloserMagnet", "(", "final", "WiresShape", "shape", ",", "final", "WiresContainer", "parent", ",", "final", "boolean", "allowOverlap", ")", "{", "final", "WiresShape", "parentShape", "=", "(", "WiresShape", ")", "parent", ";", "final"...
Reurn the closer magnet @param shape @param parent @param allowOverlap should allow overlapping docked shape or not @return closer magnet or null if none are available
[ "Reurn", "the", "closer", "magnet" ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/wires/handlers/impl/WiresDockingControlImpl.java#L215-L245
train
mqlight/java-mqlight
mqlight/src/main/java/com/ibm/mqlight/api/impl/logging/logback/LogbackLoggingImpl.java
LogbackLoggingImpl.stop
public static void stop() { final ILoggerFactory loggerFactory = org.slf4j.LoggerFactory.getILoggerFactory(); if (loggerFactory instanceof LoggerContext) { final LoggerContext context = (LoggerContext) loggerFactory; context.stop(); } setup.getAndSet(false); }
java
public static void stop() { final ILoggerFactory loggerFactory = org.slf4j.LoggerFactory.getILoggerFactory(); if (loggerFactory instanceof LoggerContext) { final LoggerContext context = (LoggerContext) loggerFactory; context.stop(); } setup.getAndSet(false); }
[ "public", "static", "void", "stop", "(", ")", "{", "final", "ILoggerFactory", "loggerFactory", "=", "org", ".", "slf4j", ".", "LoggerFactory", ".", "getILoggerFactory", "(", ")", ";", "if", "(", "loggerFactory", "instanceof", "LoggerContext", ")", "{", "final"...
Stops the logging.
[ "Stops", "the", "logging", "." ]
a565dfa6044050826d1221697da9e3268b557aeb
https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/impl/logging/logback/LogbackLoggingImpl.java#L484-L491
train
ahome-it/lienzo-core
src/main/java/com/ait/lienzo/client/core/shape/wires/handlers/impl/WiresConnectorControlImpl.java
WiresConnectorControlImpl.move
@Override public void move(final double dx, final double dy, final boolean midPointsOnly, final boolean moveLinePoints) { final IControlHandleList handles = m_connector.getPointHandles(); int start = 0; int end = handles.size(); if (midPointsOnly) { if (m_connector.getHeadConnection().getMagnet() != null) { start++; } if (m_connector.getTailConnection().getMagnet() != null) { end--; } } final Point2DArray points = m_connector.getLine().getPoint2DArray(); for (int i = start, j = (start == 0) ? start : 2; i < end; i++, j += 2) { if (moveLinePoints) { final Point2D p = points.get(i); p.setX(m_startPoints.get(j) + dx); p.setY(m_startPoints.get(j + 1) + dy); } final IControlHandle h = handles.getHandle(i); final IPrimitive<?> prim = h.getControl(); prim.setX(m_startPoints.get(j) + dx); prim.setY(m_startPoints.get(j + 1) + dy); } if (moveLinePoints) { m_connector.getLine().refresh(); } m_wiresManager.getLayer().getLayer().batch(); }
java
@Override public void move(final double dx, final double dy, final boolean midPointsOnly, final boolean moveLinePoints) { final IControlHandleList handles = m_connector.getPointHandles(); int start = 0; int end = handles.size(); if (midPointsOnly) { if (m_connector.getHeadConnection().getMagnet() != null) { start++; } if (m_connector.getTailConnection().getMagnet() != null) { end--; } } final Point2DArray points = m_connector.getLine().getPoint2DArray(); for (int i = start, j = (start == 0) ? start : 2; i < end; i++, j += 2) { if (moveLinePoints) { final Point2D p = points.get(i); p.setX(m_startPoints.get(j) + dx); p.setY(m_startPoints.get(j + 1) + dy); } final IControlHandle h = handles.getHandle(i); final IPrimitive<?> prim = h.getControl(); prim.setX(m_startPoints.get(j) + dx); prim.setY(m_startPoints.get(j + 1) + dy); } if (moveLinePoints) { m_connector.getLine().refresh(); } m_wiresManager.getLayer().getLayer().batch(); }
[ "@", "Override", "public", "void", "move", "(", "final", "double", "dx", ",", "final", "double", "dy", ",", "final", "boolean", "midPointsOnly", ",", "final", "boolean", "moveLinePoints", ")", "{", "final", "IControlHandleList", "handles", "=", "m_connector", ...
See class javadocs to explain why we have these booleans
[ "See", "class", "javadocs", "to", "explain", "why", "we", "have", "these", "booleans" ]
8e03723700dec366f77064d12fb8676d8cd6be99
https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/wires/handlers/impl/WiresConnectorControlImpl.java#L137-L182
train
mqlight/java-mqlight
mqlight/src/main/java/com/ibm/mqlight/api/impl/logging/Version.java
Version.getVersion
public static String getVersion() { String version = "unknown"; final URLClassLoader cl = (URLClassLoader)cclass.getClassLoader(); try { final URL url = cl.findResource("META-INF/MANIFEST.MF"); final Manifest manifest = new Manifest(url.openStream()); for (Entry<Object,Object> entry : manifest.getMainAttributes().entrySet()) { final Attributes.Name key = (Attributes.Name)entry.getKey(); if(Attributes.Name.IMPLEMENTATION_VERSION.equals(key)) { version = (String)entry.getValue(); } } } catch (IOException e) { logger.error("Unable to determine the product version due to error", e); } return version; }
java
public static String getVersion() { String version = "unknown"; final URLClassLoader cl = (URLClassLoader)cclass.getClassLoader(); try { final URL url = cl.findResource("META-INF/MANIFEST.MF"); final Manifest manifest = new Manifest(url.openStream()); for (Entry<Object,Object> entry : manifest.getMainAttributes().entrySet()) { final Attributes.Name key = (Attributes.Name)entry.getKey(); if(Attributes.Name.IMPLEMENTATION_VERSION.equals(key)) { version = (String)entry.getValue(); } } } catch (IOException e) { logger.error("Unable to determine the product version due to error", e); } return version; }
[ "public", "static", "String", "getVersion", "(", ")", "{", "String", "version", "=", "\"unknown\"", ";", "final", "URLClassLoader", "cl", "=", "(", "URLClassLoader", ")", "cclass", ".", "getClassLoader", "(", ")", ";", "try", "{", "final", "URL", "url", "=...
obtains the MQ Light version information from the manifest. @return The MQ Light version.
[ "obtains", "the", "MQ", "Light", "version", "information", "from", "the", "manifest", "." ]
a565dfa6044050826d1221697da9e3268b557aeb
https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/impl/logging/Version.java#L46-L62
train
fabric8io/fabric8-forge
addons/devops/src/main/java/io/fabric8/forge/devops/springboot/SpringBootVersionHelper.java
SpringBootVersionHelper.after
public static String after(String text, String after) { if (!text.contains(after)) { return null; } return text.substring(text.indexOf(after) + after.length()); }
java
public static String after(String text, String after) { if (!text.contains(after)) { return null; } return text.substring(text.indexOf(after) + after.length()); }
[ "public", "static", "String", "after", "(", "String", "text", ",", "String", "after", ")", "{", "if", "(", "!", "text", ".", "contains", "(", "after", ")", ")", "{", "return", "null", ";", "}", "return", "text", ".", "substring", "(", "text", ".", ...
Returns the string after the given token @param text the text @param after the token @return the text after the token, or <tt>null</tt> if text does not contain the token
[ "Returns", "the", "string", "after", "the", "given", "token" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/devops/src/main/java/io/fabric8/forge/devops/springboot/SpringBootVersionHelper.java#L42-L47
train
fabric8io/fabric8-forge
addons/devops/src/main/java/io/fabric8/forge/devops/springboot/SpringBootVersionHelper.java
SpringBootVersionHelper.before
public static String before(String text, String before) { if (!text.contains(before)) { return null; } return text.substring(0, text.indexOf(before)); }
java
public static String before(String text, String before) { if (!text.contains(before)) { return null; } return text.substring(0, text.indexOf(before)); }
[ "public", "static", "String", "before", "(", "String", "text", ",", "String", "before", ")", "{", "if", "(", "!", "text", ".", "contains", "(", "before", ")", ")", "{", "return", "null", ";", "}", "return", "text", ".", "substring", "(", "0", ",", ...
Returns the string before the given token @param text the text @param before the token @return the text before the token, or <tt>null</tt> if text does not contain the token
[ "Returns", "the", "string", "before", "the", "given", "token" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/devops/src/main/java/io/fabric8/forge/devops/springboot/SpringBootVersionHelper.java#L56-L61
train
fabric8io/fabric8-forge
addons/devops/src/main/java/io/fabric8/forge/devops/springboot/SpringBootVersionHelper.java
SpringBootVersionHelper.between
public static String between(String text, String after, String before) { text = after(text, after); if (text == null) { return null; } return before(text, before); }
java
public static String between(String text, String after, String before) { text = after(text, after); if (text == null) { return null; } return before(text, before); }
[ "public", "static", "String", "between", "(", "String", "text", ",", "String", "after", ",", "String", "before", ")", "{", "text", "=", "after", "(", "text", ",", "after", ")", ";", "if", "(", "text", "==", "null", ")", "{", "return", "null", ";", ...
Returns the string between the given tokens @param text the text @param after the before token @param before the after token @return the text between the tokens, or <tt>null</tt> if text does not contain the tokens
[ "Returns", "the", "string", "between", "the", "given", "tokens" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/devops/src/main/java/io/fabric8/forge/devops/springboot/SpringBootVersionHelper.java#L71-L77
train
fabric8io/fabric8-forge
addons/utils/src/main/java/io/fabric8/forge/addon/utils/CommandHelpers.java
CommandHelpers.addInputComponents
public static List<InputComponent> addInputComponents(UIBuilder builder, InputComponent... components) { List<InputComponent> inputComponents = new ArrayList<>(); for (InputComponent component : components) { builder.add(component); inputComponents.add(component); } return inputComponents; }
java
public static List<InputComponent> addInputComponents(UIBuilder builder, InputComponent... components) { List<InputComponent> inputComponents = new ArrayList<>(); for (InputComponent component : components) { builder.add(component); inputComponents.add(component); } return inputComponents; }
[ "public", "static", "List", "<", "InputComponent", ">", "addInputComponents", "(", "UIBuilder", "builder", ",", "InputComponent", "...", "components", ")", "{", "List", "<", "InputComponent", ">", "inputComponents", "=", "new", "ArrayList", "<>", "(", ")", ";", ...
A helper function to add the components to the builder and return a list of all the components
[ "A", "helper", "function", "to", "add", "the", "components", "to", "the", "builder", "and", "return", "a", "list", "of", "all", "the", "components" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/CommandHelpers.java#L49-L56
train
fabric8io/fabric8-forge
addons/utils/src/main/java/io/fabric8/forge/addon/utils/CommandHelpers.java
CommandHelpers.setInitialComponentValue
public static <T> void setInitialComponentValue(UIInput<T> inputComponent, T value) { if (value != null) { inputComponent.setValue(value); } }
java
public static <T> void setInitialComponentValue(UIInput<T> inputComponent, T value) { if (value != null) { inputComponent.setValue(value); } }
[ "public", "static", "<", "T", ">", "void", "setInitialComponentValue", "(", "UIInput", "<", "T", ">", "inputComponent", ",", "T", "value", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "inputComponent", ".", "setValue", "(", "value", ")", ";", ...
If the initial value is not blank lets set the value on the underlying component
[ "If", "the", "initial", "value", "is", "not", "blank", "lets", "set", "the", "value", "on", "the", "underlying", "component" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/utils/src/main/java/io/fabric8/forge/addon/utils/CommandHelpers.java#L74-L78
train
fabric8io/fabric8-forge
fabric8-forge-core/src/main/java/io/fabric8/forge/rest/dto/ExecutionRequest.java
ExecutionRequest.createCommitMessage
public static String createCommitMessage(String name, ExecutionRequest executionRequest) { StringBuilder builder = new StringBuilder(name); List<Map<String, Object>> inputList = executionRequest.getInputList(); for (Map<String, Object> map : inputList) { Set<Map.Entry<String, Object>> entries = map.entrySet(); for (Map.Entry<String, Object> entry : entries) { String key = entry.getKey(); String textValue = null; Object value = entry.getValue(); if (value != null) { textValue = value.toString(); } if (!Strings.isNullOrEmpty(textValue) && !textValue.equals("0") && !textValue.toLowerCase().equals("false")) { builder.append(" --"); builder.append(key); builder.append("="); builder.append(textValue); } } } return builder.toString(); }
java
public static String createCommitMessage(String name, ExecutionRequest executionRequest) { StringBuilder builder = new StringBuilder(name); List<Map<String, Object>> inputList = executionRequest.getInputList(); for (Map<String, Object> map : inputList) { Set<Map.Entry<String, Object>> entries = map.entrySet(); for (Map.Entry<String, Object> entry : entries) { String key = entry.getKey(); String textValue = null; Object value = entry.getValue(); if (value != null) { textValue = value.toString(); } if (!Strings.isNullOrEmpty(textValue) && !textValue.equals("0") && !textValue.toLowerCase().equals("false")) { builder.append(" --"); builder.append(key); builder.append("="); builder.append(textValue); } } } return builder.toString(); }
[ "public", "static", "String", "createCommitMessage", "(", "String", "name", ",", "ExecutionRequest", "executionRequest", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", "name", ")", ";", "List", "<", "Map", "<", "String", ",", "Object", ...
Lets generate a commit message with the command name and all the parameters we specify
[ "Lets", "generate", "a", "commit", "message", "with", "the", "command", "name", "and", "all", "the", "parameters", "we", "specify" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/dto/ExecutionRequest.java#L52-L73
train
fabric8io/fabric8-forge
fabric8-forge-core/src/main/java/io/fabric8/forge/rest/model/Models.java
Models.createObjectMapper
public static ObjectMapper createObjectMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.enable(SerializationFeature.INDENT_OUTPUT); return mapper; }
java
public static ObjectMapper createObjectMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.enable(SerializationFeature.INDENT_OUTPUT); return mapper; }
[ "public", "static", "ObjectMapper", "createObjectMapper", "(", ")", "{", "ObjectMapper", "mapper", "=", "new", "ObjectMapper", "(", ")", ";", "mapper", ".", "enable", "(", "SerializationFeature", ".", "INDENT_OUTPUT", ")", ";", "return", "mapper", ";", "}" ]
Creates a configured Jackson object mapper for parsing JSON
[ "Creates", "a", "configured", "Jackson", "object", "mapper", "for", "parsing", "JSON" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/model/Models.java#L36-L40
train
fabric8io/fabric8-forge
addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java
CamelCatalogHelper.asTitleCase
public static String asTitleCase(String text) { StringBuilder sb = new StringBuilder(); boolean next = true; for (char c : text.toCharArray()) { if (Character.isSpaceChar(c)) { next = true; } else if (next) { c = Character.toTitleCase(c); next = false; } sb.append(c); } return sb.toString(); }
java
public static String asTitleCase(String text) { StringBuilder sb = new StringBuilder(); boolean next = true; for (char c : text.toCharArray()) { if (Character.isSpaceChar(c)) { next = true; } else if (next) { c = Character.toTitleCase(c); next = false; } sb.append(c); } return sb.toString(); }
[ "public", "static", "String", "asTitleCase", "(", "String", "text", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "boolean", "next", "=", "true", ";", "for", "(", "char", "c", ":", "text", ".", "toCharArray", "(", ")", ")...
Returns the text in title case
[ "Returns", "the", "text", "in", "title", "case" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java#L36-L51
train
fabric8io/fabric8-forge
addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java
CamelCatalogHelper.isDefaultValue
public static boolean isDefaultValue(CamelCatalog camelCatalog, String scheme, String key, String value) { // use the camel catalog String json = camelCatalog.componentJSonSchema(scheme); if (json == null) { throw new IllegalArgumentException("Could not find catalog entry for component name: " + scheme); } List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("properties", json, true); if (data != null) { for (Map<String, String> propertyMap : data) { String name = propertyMap.get("name"); String defaultValue = propertyMap.get("defaultValue"); if (key.equals(name)) { return value.equalsIgnoreCase(defaultValue); } } } return false; }
java
public static boolean isDefaultValue(CamelCatalog camelCatalog, String scheme, String key, String value) { // use the camel catalog String json = camelCatalog.componentJSonSchema(scheme); if (json == null) { throw new IllegalArgumentException("Could not find catalog entry for component name: " + scheme); } List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("properties", json, true); if (data != null) { for (Map<String, String> propertyMap : data) { String name = propertyMap.get("name"); String defaultValue = propertyMap.get("defaultValue"); if (key.equals(name)) { return value.equalsIgnoreCase(defaultValue); } } } return false; }
[ "public", "static", "boolean", "isDefaultValue", "(", "CamelCatalog", "camelCatalog", ",", "String", "scheme", ",", "String", "key", ",", "String", "value", ")", "{", "// use the camel catalog", "String", "json", "=", "camelCatalog", ".", "componentJSonSchema", "(",...
Checks whether the given value is matching the default value from the given component. @param scheme the component name @param key the option key @param value the option value @return <tt>true</tt> if matching the default value, <tt>false</tt> otherwise
[ "Checks", "whether", "the", "given", "value", "is", "matching", "the", "default", "value", "from", "the", "given", "component", "." ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java#L152-L170
train
fabric8io/fabric8-forge
addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java
CamelCatalogHelper.isModelDefaultValue
public static boolean isModelDefaultValue(CamelCatalog camelCatalog, String modelName, String key, String value) { // use the camel catalog String json = camelCatalog.modelJSonSchema(modelName); if (json == null) { throw new IllegalArgumentException("Could not find catalog entry for model name: " + modelName); } List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("properties", json, true); if (data != null) { for (Map<String, String> propertyMap : data) { String name = propertyMap.get("name"); String defaultValue = propertyMap.get("defaultValue"); if (key.equals(name)) { return value.equalsIgnoreCase(defaultValue); } } } return false; }
java
public static boolean isModelDefaultValue(CamelCatalog camelCatalog, String modelName, String key, String value) { // use the camel catalog String json = camelCatalog.modelJSonSchema(modelName); if (json == null) { throw new IllegalArgumentException("Could not find catalog entry for model name: " + modelName); } List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("properties", json, true); if (data != null) { for (Map<String, String> propertyMap : data) { String name = propertyMap.get("name"); String defaultValue = propertyMap.get("defaultValue"); if (key.equals(name)) { return value.equalsIgnoreCase(defaultValue); } } } return false; }
[ "public", "static", "boolean", "isModelDefaultValue", "(", "CamelCatalog", "camelCatalog", ",", "String", "modelName", ",", "String", "key", ",", "String", "value", ")", "{", "// use the camel catalog", "String", "json", "=", "camelCatalog", ".", "modelJSonSchema", ...
Checks whether the given value is matching the default value from the given model. @param modelName the model name @param key the option key @param value the option value @return <tt>true</tt> if matching the default value, <tt>false</tt> otherwise
[ "Checks", "whether", "the", "given", "value", "is", "matching", "the", "default", "value", "from", "the", "given", "model", "." ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java#L352-L370
train
fabric8io/fabric8-forge
addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java
CamelCatalogHelper.getModelJavaType
public static String getModelJavaType(CamelCatalog camelCatalog, String modelName) { // use the camel catalog String json = camelCatalog.modelJSonSchema(modelName); if (json == null) { throw new IllegalArgumentException("Could not find catalog entry for model name: " + modelName); } List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("model", json, false); if (data != null) { for (Map<String, String> propertyMap : data) { String javaType = propertyMap.get("javaType"); if (javaType != null) { return javaType; } } } return null; }
java
public static String getModelJavaType(CamelCatalog camelCatalog, String modelName) { // use the camel catalog String json = camelCatalog.modelJSonSchema(modelName); if (json == null) { throw new IllegalArgumentException("Could not find catalog entry for model name: " + modelName); } List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("model", json, false); if (data != null) { for (Map<String, String> propertyMap : data) { String javaType = propertyMap.get("javaType"); if (javaType != null) { return javaType; } } } return null; }
[ "public", "static", "String", "getModelJavaType", "(", "CamelCatalog", "camelCatalog", ",", "String", "modelName", ")", "{", "// use the camel catalog", "String", "json", "=", "camelCatalog", ".", "modelJSonSchema", "(", "modelName", ")", ";", "if", "(", "json", "...
Gets the java type of the given model @param modelName the model name @return the java type
[ "Gets", "the", "java", "type", "of", "the", "given", "model" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java#L404-L421
train
fabric8io/fabric8-forge
addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java
CamelCatalogHelper.isModelSupportOutput
public static boolean isModelSupportOutput(CamelCatalog camelCatalog, String modelName) { // use the camel catalog String json = camelCatalog.modelJSonSchema(modelName); if (json == null) { throw new IllegalArgumentException("Could not find catalog entry for model name: " + modelName); } List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("model", json, false); if (data != null) { for (Map<String, String> propertyMap : data) { String output = propertyMap.get("output"); if (output != null) { return "true".equals(output); } } } return false; }
java
public static boolean isModelSupportOutput(CamelCatalog camelCatalog, String modelName) { // use the camel catalog String json = camelCatalog.modelJSonSchema(modelName); if (json == null) { throw new IllegalArgumentException("Could not find catalog entry for model name: " + modelName); } List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("model", json, false); if (data != null) { for (Map<String, String> propertyMap : data) { String output = propertyMap.get("output"); if (output != null) { return "true".equals(output); } } } return false; }
[ "public", "static", "boolean", "isModelSupportOutput", "(", "CamelCatalog", "camelCatalog", ",", "String", "modelName", ")", "{", "// use the camel catalog", "String", "json", "=", "camelCatalog", ".", "modelJSonSchema", "(", "modelName", ")", ";", "if", "(", "json"...
Whether the EIP supports outputs @param modelName the model name @return <tt>true</tt> if output supported, <tt>false</tt> otherwise
[ "Whether", "the", "EIP", "supports", "outputs" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java#L429-L446
train
fabric8io/fabric8-forge
addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java
CamelCatalogHelper.isComponentConsumerOnly
public static boolean isComponentConsumerOnly(CamelCatalog camelCatalog, String scheme) { // use the camel catalog String json = camelCatalog.componentJSonSchema(scheme); if (json == null) { return false; } List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("component", json, false); if (data != null) { for (Map<String, String> propertyMap : data) { String consumerOnly = propertyMap.get("consumerOnly"); if (consumerOnly != null) { return true; } } } return false; }
java
public static boolean isComponentConsumerOnly(CamelCatalog camelCatalog, String scheme) { // use the camel catalog String json = camelCatalog.componentJSonSchema(scheme); if (json == null) { return false; } List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("component", json, false); if (data != null) { for (Map<String, String> propertyMap : data) { String consumerOnly = propertyMap.get("consumerOnly"); if (consumerOnly != null) { return true; } } } return false; }
[ "public", "static", "boolean", "isComponentConsumerOnly", "(", "CamelCatalog", "camelCatalog", ",", "String", "scheme", ")", "{", "// use the camel catalog", "String", "json", "=", "camelCatalog", ".", "componentJSonSchema", "(", "scheme", ")", ";", "if", "(", "json...
Whether the component is consumer only
[ "Whether", "the", "component", "is", "consumer", "only" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java#L451-L468
train
fabric8io/fabric8-forge
fabric8-forge-core/src/main/java/io/fabric8/forge/rest/git/GitContext.java
GitContext.commitMessage
public GitContext commitMessage(String message) { if (commitMessage.length() == 0) { commitMessage.append(message + "\n"); } else { commitMessage.append("\n- " + message); } return this; }
java
public GitContext commitMessage(String message) { if (commitMessage.length() == 0) { commitMessage.append(message + "\n"); } else { commitMessage.append("\n- " + message); } return this; }
[ "public", "GitContext", "commitMessage", "(", "String", "message", ")", "{", "if", "(", "commitMessage", ".", "length", "(", ")", "==", "0", ")", "{", "commitMessage", ".", "append", "(", "message", "+", "\"\\n\"", ")", ";", "}", "else", "{", "commitMess...
Append the commit message.
[ "Append", "the", "commit", "message", "." ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/git/GitContext.java#L84-L91
train
mqlight/java-mqlight
mqlight/src/main/java/com/ibm/mqlight/api/security/PemFile.java
PemFile.getCertificates
public List<Certificate> getCertificates() throws CertificateException, IOException { final String methodName = "getCertificates"; logger.entry(this, methodName); final String fileData = getPemFileData(); final List<ByteBuf> certDataList = new ArrayList<ByteBuf>(); final Matcher m = CERTIFICATE_PATTERN.matcher(fileData); int start = 0; while (m.find(start)) { final ByteBuf base64CertData = Unpooled.copiedBuffer(m.group(1), Charset.forName("US-ASCII")); final ByteBuf certData = Base64.decode(base64CertData); base64CertData.release(); certDataList.add(certData); start = m.end(); } if (certDataList.isEmpty()) { final CertificateException exception = new CertificateException("No certificates found in PEM file: " + pemFile); logger.throwing(this, methodName, exception); throw exception; } final CertificateFactory cf = CertificateFactory.getInstance("X.509"); final List<Certificate> certificates = new ArrayList<Certificate>(); try { for (ByteBuf certData: certDataList) { certificates.add(cf.generateCertificate(new ByteBufInputStream(certData))); } } finally { for (ByteBuf certData: certDataList) certData.release(); } logger.exit(this, methodName, certificates); return certificates; }
java
public List<Certificate> getCertificates() throws CertificateException, IOException { final String methodName = "getCertificates"; logger.entry(this, methodName); final String fileData = getPemFileData(); final List<ByteBuf> certDataList = new ArrayList<ByteBuf>(); final Matcher m = CERTIFICATE_PATTERN.matcher(fileData); int start = 0; while (m.find(start)) { final ByteBuf base64CertData = Unpooled.copiedBuffer(m.group(1), Charset.forName("US-ASCII")); final ByteBuf certData = Base64.decode(base64CertData); base64CertData.release(); certDataList.add(certData); start = m.end(); } if (certDataList.isEmpty()) { final CertificateException exception = new CertificateException("No certificates found in PEM file: " + pemFile); logger.throwing(this, methodName, exception); throw exception; } final CertificateFactory cf = CertificateFactory.getInstance("X.509"); final List<Certificate> certificates = new ArrayList<Certificate>(); try { for (ByteBuf certData: certDataList) { certificates.add(cf.generateCertificate(new ByteBufInputStream(certData))); } } finally { for (ByteBuf certData: certDataList) certData.release(); } logger.exit(this, methodName, certificates); return certificates; }
[ "public", "List", "<", "Certificate", ">", "getCertificates", "(", ")", "throws", "CertificateException", ",", "IOException", "{", "final", "String", "methodName", "=", "\"getCertificates\"", ";", "logger", ".", "entry", "(", "this", ",", "methodName", ")", ";",...
Obtains the list of certificates stored in the PEM file. @return The list of certificates stored in the PEM file. @throws CertificateException If a parsing error occurs. @throws IOException If the PEM file cannot be read for any reason.
[ "Obtains", "the", "list", "of", "certificates", "stored", "in", "the", "PEM", "file", "." ]
a565dfa6044050826d1221697da9e3268b557aeb
https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/security/PemFile.java#L91-L128
train
mqlight/java-mqlight
mqlight/src/main/java/com/ibm/mqlight/api/security/PemFile.java
PemFile.getPemFileData
private String getPemFileData() throws IOException { final String methodName = "getPemFileData"; logger.entry(this, methodName); if (pemFileData != null) { logger.exit(this, methodName, pemFileData); return pemFileData; } final StringBuilder sb = new StringBuilder(); final InputStreamReader isr = new InputStreamReader(new FileInputStream(pemFile), "US-ASCII"); try { int ch; while ((ch = isr.read()) != -1) { sb.append((char)ch); } } finally { try { isr.close(); } catch (IOException e) { logger.data(this, methodName, "Failed to close input stream reader. Reason: ", e); } } pemFileData = sb.toString(); logger.exit(this, methodName, pemFileData); return pemFileData; }
java
private String getPemFileData() throws IOException { final String methodName = "getPemFileData"; logger.entry(this, methodName); if (pemFileData != null) { logger.exit(this, methodName, pemFileData); return pemFileData; } final StringBuilder sb = new StringBuilder(); final InputStreamReader isr = new InputStreamReader(new FileInputStream(pemFile), "US-ASCII"); try { int ch; while ((ch = isr.read()) != -1) { sb.append((char)ch); } } finally { try { isr.close(); } catch (IOException e) { logger.data(this, methodName, "Failed to close input stream reader. Reason: ", e); } } pemFileData = sb.toString(); logger.exit(this, methodName, pemFileData); return pemFileData; }
[ "private", "String", "getPemFileData", "(", ")", "throws", "IOException", "{", "final", "String", "methodName", "=", "\"getPemFileData\"", ";", "logger", ".", "entry", "(", "this", ",", "methodName", ")", ";", "if", "(", "pemFileData", "!=", "null", ")", "{"...
Read the PEM file data, caching it locally, such that the file is only read on first use. @return The PEM file data are a String. @throws IOException If the PEM file cannot be read for any reason.
[ "Read", "the", "PEM", "file", "data", "caching", "it", "locally", "such", "that", "the", "file", "is", "only", "read", "on", "first", "use", "." ]
a565dfa6044050826d1221697da9e3268b557aeb
https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/security/PemFile.java#L201-L230
train
fabric8io/fabric8-forge
addons/introspection/src/main/java/io/fabric8/forge/introspection/util/ReflectionHelper.java
ReflectionHelper.newInstance
public static <T> T newInstance(Class<T> type) { try { return type.newInstance(); } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } }
java
public static <T> T newInstance(Class<T> type) { try { return type.newInstance(); } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } }
[ "public", "static", "<", "T", ">", "T", "newInstance", "(", "Class", "<", "T", ">", "type", ")", "{", "try", "{", "return", "type", ".", "newInstance", "(", ")", ";", "}", "catch", "(", "InstantiationException", "e", ")", "{", "throw", "new", "Runtim...
A helper method to create a new instance of a type using the default constructor arguments.
[ "A", "helper", "method", "to", "create", "a", "new", "instance", "of", "a", "type", "using", "the", "default", "constructor", "arguments", "." ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/introspection/src/main/java/io/fabric8/forge/introspection/util/ReflectionHelper.java#L14-L22
train
fabric8io/fabric8-forge
addons/introspection/src/main/java/io/fabric8/forge/introspection/util/ReflectionHelper.java
ReflectionHelper.hasMethodWithAnnotation
public static boolean hasMethodWithAnnotation(Class<?> type, Class<? extends Annotation> annotationType, boolean checkMetaAnnotations) { try { do { Method[] methods = type.getDeclaredMethods(); for (Method method : methods) { if (hasAnnotation(method, annotationType, checkMetaAnnotations)) { return true; } } type = type.getSuperclass(); } while (type != null); } catch (Throwable e) { // ignore a class loading issue } return false; }
java
public static boolean hasMethodWithAnnotation(Class<?> type, Class<? extends Annotation> annotationType, boolean checkMetaAnnotations) { try { do { Method[] methods = type.getDeclaredMethods(); for (Method method : methods) { if (hasAnnotation(method, annotationType, checkMetaAnnotations)) { return true; } } type = type.getSuperclass(); } while (type != null); } catch (Throwable e) { // ignore a class loading issue } return false; }
[ "public", "static", "boolean", "hasMethodWithAnnotation", "(", "Class", "<", "?", ">", "type", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotationType", ",", "boolean", "checkMetaAnnotations", ")", "{", "try", "{", "do", "{", "Method", "[", "]"...
Returns true if the given type has a method with the given annotation
[ "Returns", "true", "if", "the", "given", "type", "has", "a", "method", "with", "the", "given", "annotation" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/introspection/src/main/java/io/fabric8/forge/introspection/util/ReflectionHelper.java#L49-L66
train
fabric8io/fabric8-forge
addons/introspection/src/main/java/io/fabric8/forge/introspection/util/ReflectionHelper.java
ReflectionHelper.hasAnnotation
public static boolean hasAnnotation(AnnotatedElement elem, Class<? extends Annotation> annotationType, boolean checkMetaAnnotations) { if (elem.isAnnotationPresent(annotationType)) { return true; } if (checkMetaAnnotations) { for (Annotation a : elem.getAnnotations()) { for (Annotation meta : a.annotationType().getAnnotations()) { if (meta.annotationType().getName().equals(annotationType.getName())) { return true; } } } } return false; }
java
public static boolean hasAnnotation(AnnotatedElement elem, Class<? extends Annotation> annotationType, boolean checkMetaAnnotations) { if (elem.isAnnotationPresent(annotationType)) { return true; } if (checkMetaAnnotations) { for (Annotation a : elem.getAnnotations()) { for (Annotation meta : a.annotationType().getAnnotations()) { if (meta.annotationType().getName().equals(annotationType.getName())) { return true; } } } } return false; }
[ "public", "static", "boolean", "hasAnnotation", "(", "AnnotatedElement", "elem", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotationType", ",", "boolean", "checkMetaAnnotations", ")", "{", "if", "(", "elem", ".", "isAnnotationPresent", "(", "annotati...
Checks if a Class or Method are annotated with the given annotation @param elem the Class or Method to reflect on @param annotationType the annotation type @param checkMetaAnnotations check for meta annotations @return true if annotations is present
[ "Checks", "if", "a", "Class", "or", "Method", "are", "annotated", "with", "the", "given", "annotation" ]
a59871bae4d5c5d3ece10f1e8758e73663087f19
https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/introspection/src/main/java/io/fabric8/forge/introspection/util/ReflectionHelper.java#L76-L91
train