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
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/PathImpl.java
PathImpl.asString
public String asString() { final StringBuilder builder = new StringBuilder(); boolean first = true; for (int i = 1; i < this.nodeList.size(); i++) { final NodeImpl nodeImpl = (NodeImpl) this.nodeList.get(i); final String name = nodeImpl.asString(); if (name.isEmpty()) { // skip the node if it does not contribute to the string representation of the path, eg // class level constraints continue; } if (!first) { builder.append(PROPERTY_PATH_SEPARATOR); } builder.append(nodeImpl.asString()); first = false; } return builder.toString(); }
java
public String asString() { final StringBuilder builder = new StringBuilder(); boolean first = true; for (int i = 1; i < this.nodeList.size(); i++) { final NodeImpl nodeImpl = (NodeImpl) this.nodeList.get(i); final String name = nodeImpl.asString(); if (name.isEmpty()) { // skip the node if it does not contribute to the string representation of the path, eg // class level constraints continue; } if (!first) { builder.append(PROPERTY_PATH_SEPARATOR); } builder.append(nodeImpl.asString()); first = false; } return builder.toString(); }
[ "public", "String", "asString", "(", ")", "{", "final", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "boolean", "first", "=", "true", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "this", ".", "nodeList", ".", "size...
serialize as string. @return string value of the node
[ "serialize", "as", "string", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/PathImpl.java#L266-L287
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.create
@Override public <T extends BaseProxy> T create(final Class<T> clazz) { this.checkLocked(); final SimpleProxyId<T> id = this.state.requestFactory.allocateId(clazz); final AutoBean<T> created = this.createProxy(clazz, id, false); return this.takeOwnership(created); }
java
@Override public <T extends BaseProxy> T create(final Class<T> clazz) { this.checkLocked(); final SimpleProxyId<T> id = this.state.requestFactory.allocateId(clazz); final AutoBean<T> created = this.createProxy(clazz, id, false); return this.takeOwnership(created); }
[ "@", "Override", "public", "<", "T", "extends", "BaseProxy", ">", "T", "create", "(", "final", "Class", "<", "T", ">", "clazz", ")", "{", "this", ".", "checkLocked", "(", ")", ";", "final", "SimpleProxyId", "<", "T", ">", "id", "=", "this", ".", "s...
Create a new object, with an ephemeral id.
[ "Create", "a", "new", "object", "with", "an", "ephemeral", "id", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L559-L566
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.editProxy
public <T extends BaseProxy> T editProxy(final T object) { AutoBean<T> bean = this.checkStreamsNotCrossed(object); this.checkLocked(); @SuppressWarnings("unchecked") final AutoBean<T> previouslySeen = (AutoBean<T>) this.state.editedProxies.get(BaseProxyCategory.stableId(bean)); if (previouslySeen != null && !previouslySeen.isFrozen()) { /* * If we've seen the object before, it might be because it was passed in as a method argument. * This does not guarantee its mutability, so check that here before returning the cached * object. */ return previouslySeen.as(); } // Create editable copies final AutoBean<T> parent = bean; bean = this.cloneBeanAndCollections(bean); bean.setTag(Constants.PARENT_OBJECT, parent); return bean.as(); }
java
public <T extends BaseProxy> T editProxy(final T object) { AutoBean<T> bean = this.checkStreamsNotCrossed(object); this.checkLocked(); @SuppressWarnings("unchecked") final AutoBean<T> previouslySeen = (AutoBean<T>) this.state.editedProxies.get(BaseProxyCategory.stableId(bean)); if (previouslySeen != null && !previouslySeen.isFrozen()) { /* * If we've seen the object before, it might be because it was passed in as a method argument. * This does not guarantee its mutability, so check that here before returning the cached * object. */ return previouslySeen.as(); } // Create editable copies final AutoBean<T> parent = bean; bean = this.cloneBeanAndCollections(bean); bean.setTag(Constants.PARENT_OBJECT, parent); return bean.as(); }
[ "public", "<", "T", "extends", "BaseProxy", ">", "T", "editProxy", "(", "final", "T", "object", ")", "{", "AutoBean", "<", "T", ">", "bean", "=", "this", ".", "checkStreamsNotCrossed", "(", "object", ")", ";", "this", ".", "checkLocked", "(", ")", ";",...
Take ownership of a proxy instance and make it editable.
[ "Take", "ownership", "of", "a", "proxy", "instance", "and", "make", "it", "editable", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L576-L597
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.fire
@Override public void fire() { boolean needsReceiver = true; for (final AbstractRequest<?, ?> request : this.state.invocations) { if (request.hasReceiver()) { needsReceiver = false; break; } } if (needsReceiver) { this.doFire(new Receiver<Void>() { @Override public void onSuccess(final Void response) { // Don't care } }); } else { this.doFire(null); } }
java
@Override public void fire() { boolean needsReceiver = true; for (final AbstractRequest<?, ?> request : this.state.invocations) { if (request.hasReceiver()) { needsReceiver = false; break; } } if (needsReceiver) { this.doFire(new Receiver<Void>() { @Override public void onSuccess(final Void response) { // Don't care } }); } else { this.doFire(null); } }
[ "@", "Override", "public", "void", "fire", "(", ")", "{", "boolean", "needsReceiver", "=", "true", ";", "for", "(", "final", "AbstractRequest", "<", "?", ",", "?", ">", "request", ":", "this", ".", "state", ".", "invocations", ")", "{", "if", "(", "r...
Make sure there's a default receiver so errors don't get dropped. This behavior should be revisited when chaining is supported, depending on whether or not chained invocations can fail independently.
[ "Make", "sure", "there", "s", "a", "default", "receiver", "so", "errors", "don", "t", "get", "dropped", ".", "This", "behavior", "should", "be", "revisited", "when", "chaining", "is", "supported", "depending", "on", "whether", "or", "not", "chained", "invoca...
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L620-L640
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.createProxy
protected <T extends BaseProxy> AutoBean<T> createProxy(final Class<T> clazz, final SimpleProxyId<T> id, final boolean useAppendedContexts) { AutoBean<T> created = null; if (useAppendedContexts) { for (final AbstractRequestContext ctx : this.state.appendedContexts) { created = ctx.getAutoBeanFactory().create(clazz); if (created != null) { break; } } } else { created = this.getAutoBeanFactory().create(clazz); } if (created != null) { created.setTag(STABLE_ID, id); return created; } throw new IllegalArgumentException("Unknown proxy type " + clazz.getName()); }
java
protected <T extends BaseProxy> AutoBean<T> createProxy(final Class<T> clazz, final SimpleProxyId<T> id, final boolean useAppendedContexts) { AutoBean<T> created = null; if (useAppendedContexts) { for (final AbstractRequestContext ctx : this.state.appendedContexts) { created = ctx.getAutoBeanFactory().create(clazz); if (created != null) { break; } } } else { created = this.getAutoBeanFactory().create(clazz); } if (created != null) { created.setTag(STABLE_ID, id); return created; } throw new IllegalArgumentException("Unknown proxy type " + clazz.getName()); }
[ "protected", "<", "T", "extends", "BaseProxy", ">", "AutoBean", "<", "T", ">", "createProxy", "(", "final", "Class", "<", "T", ">", "clazz", ",", "final", "SimpleProxyId", "<", "T", ">", "id", ",", "final", "boolean", "useAppendedContexts", ")", "{", "Au...
Creates a new proxy with an assigned ID. @param clazz The proxy type @param id The id to be assigned to the new proxy @param useAppendedContexts if {@code true} use the AutoBeanFactory types associated with any contexts that have been passed into {@link #append(RequestContext)}. If {@code false}, this method will only create proxy types reachable from the implemented RequestContext interface. @throws IllegalArgumentException if the requested proxy type cannot be created
[ "Creates", "a", "new", "proxy", "with", "an", "assigned", "ID", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L759-L777
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.getId
SimpleProxyId<BaseProxy> getId(final IdMessage op) { if (Strength.SYNTHETIC.equals(op.getStrength())) { return this.allocateSyntheticId(op.getTypeToken(), op.getSyntheticId()); } return this.state.requestFactory.getId(op.getTypeToken(), op.getServerId(), op.getClientId()); }
java
SimpleProxyId<BaseProxy> getId(final IdMessage op) { if (Strength.SYNTHETIC.equals(op.getStrength())) { return this.allocateSyntheticId(op.getTypeToken(), op.getSyntheticId()); } return this.state.requestFactory.getId(op.getTypeToken(), op.getServerId(), op.getClientId()); }
[ "SimpleProxyId", "<", "BaseProxy", ">", "getId", "(", "final", "IdMessage", "op", ")", "{", "if", "(", "Strength", ".", "SYNTHETIC", ".", "equals", "(", "op", ".", "getStrength", "(", ")", ")", ")", "{", "return", "this", ".", "allocateSyntheticId", "(",...
Resolves an IdMessage into an SimpleProxyId.
[ "Resolves", "an", "IdMessage", "into", "an", "SimpleProxyId", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L855-L860
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.getProxyForReturnPayloadGraph
<Q extends BaseProxy> AutoBean<Q> getProxyForReturnPayloadGraph(final SimpleProxyId<Q> id) { @SuppressWarnings("unchecked") AutoBean<Q> bean = (AutoBean<Q>) this.state.returnedProxies.get(id); if (bean == null) { final Class<Q> proxyClass = id.getProxyClass(); bean = this.createProxy(proxyClass, id, true); this.state.returnedProxies.put(id, bean); } return bean; }
java
<Q extends BaseProxy> AutoBean<Q> getProxyForReturnPayloadGraph(final SimpleProxyId<Q> id) { @SuppressWarnings("unchecked") AutoBean<Q> bean = (AutoBean<Q>) this.state.returnedProxies.get(id); if (bean == null) { final Class<Q> proxyClass = id.getProxyClass(); bean = this.createProxy(proxyClass, id, true); this.state.returnedProxies.put(id, bean); } return bean; }
[ "<", "Q", "extends", "BaseProxy", ">", "AutoBean", "<", "Q", ">", "getProxyForReturnPayloadGraph", "(", "final", "SimpleProxyId", "<", "Q", ">", "id", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "AutoBean", "<", "Q", ">", "bean", "=", "("...
Creates or retrieves a new canonical AutoBean to represent the given id in the returned payload.
[ "Creates", "or", "retrieves", "a", "new", "canonical", "AutoBean", "to", "represent", "the", "given", "id", "in", "the", "returned", "payload", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L866-L876
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.makeOperationMessage
AutoBean<OperationMessage> makeOperationMessage(final SimpleProxyId<BaseProxy> stableId, final AutoBean<?> proxyBean, final boolean useDelta) { // The OperationMessages describes operations on exactly one entity final AutoBean<OperationMessage> toReturn = MessageFactoryHolder.FACTORY.operation(); final OperationMessage operation = toReturn.as(); operation.setTypeToken(this.state.requestFactory.getTypeToken(stableId.getProxyClass())); // Find the object to compare against AutoBean<?> parent; if (stableId.isEphemeral()) { // Newly-created object, use a blank object to compare against parent = this.createProxy(stableId.getProxyClass(), stableId, true); // Newly-created objects go into the persist operation bucket operation.setOperation(WriteOperation.PERSIST); // The ephemeral id is passed to the server operation.setClientId(stableId.getClientId()); operation.setStrength(Strength.EPHEMERAL); } else if (stableId.isSynthetic()) { // Newly-created object, use a blank object to compare against parent = this.createProxy(stableId.getProxyClass(), stableId, true); // Newly-created objects go into the persist operation bucket operation.setOperation(WriteOperation.PERSIST); // The ephemeral id is passed to the server operation.setSyntheticId(stableId.getSyntheticId()); operation.setStrength(Strength.SYNTHETIC); } else { parent = proxyBean.getTag(Constants.PARENT_OBJECT); // Requests involving existing objects use the persisted id operation.setServerId(stableId.getServerId()); operation.setOperation(WriteOperation.UPDATE); } assert !useDelta || parent != null; // Send our version number to the server to cut down on future payloads final String version = proxyBean.getTag(Constants.VERSION_PROPERTY_B64); if (version != null) { operation.setVersion(version); } Map<String, Object> diff = Collections.emptyMap(); if (this.isEntityType(stableId.getProxyClass())) { // Compute what's changed on the client diff = useDelta ? AutoBeanUtils.diff(parent, proxyBean) : AutoBeanUtils.getAllProperties(proxyBean); } else if (this.isValueType(stableId.getProxyClass())) { // Send everything diff = AutoBeanUtils.getAllProperties(proxyBean); } if (!diff.isEmpty()) { final Map<String, Splittable> propertyMap = new HashMap<>(); for (final Map.Entry<String, Object> entry : diff.entrySet()) { propertyMap.put(entry.getKey(), EntityCodex.encode(this, entry.getValue())); } operation.setPropertyMap(propertyMap); } return toReturn; }
java
AutoBean<OperationMessage> makeOperationMessage(final SimpleProxyId<BaseProxy> stableId, final AutoBean<?> proxyBean, final boolean useDelta) { // The OperationMessages describes operations on exactly one entity final AutoBean<OperationMessage> toReturn = MessageFactoryHolder.FACTORY.operation(); final OperationMessage operation = toReturn.as(); operation.setTypeToken(this.state.requestFactory.getTypeToken(stableId.getProxyClass())); // Find the object to compare against AutoBean<?> parent; if (stableId.isEphemeral()) { // Newly-created object, use a blank object to compare against parent = this.createProxy(stableId.getProxyClass(), stableId, true); // Newly-created objects go into the persist operation bucket operation.setOperation(WriteOperation.PERSIST); // The ephemeral id is passed to the server operation.setClientId(stableId.getClientId()); operation.setStrength(Strength.EPHEMERAL); } else if (stableId.isSynthetic()) { // Newly-created object, use a blank object to compare against parent = this.createProxy(stableId.getProxyClass(), stableId, true); // Newly-created objects go into the persist operation bucket operation.setOperation(WriteOperation.PERSIST); // The ephemeral id is passed to the server operation.setSyntheticId(stableId.getSyntheticId()); operation.setStrength(Strength.SYNTHETIC); } else { parent = proxyBean.getTag(Constants.PARENT_OBJECT); // Requests involving existing objects use the persisted id operation.setServerId(stableId.getServerId()); operation.setOperation(WriteOperation.UPDATE); } assert !useDelta || parent != null; // Send our version number to the server to cut down on future payloads final String version = proxyBean.getTag(Constants.VERSION_PROPERTY_B64); if (version != null) { operation.setVersion(version); } Map<String, Object> diff = Collections.emptyMap(); if (this.isEntityType(stableId.getProxyClass())) { // Compute what's changed on the client diff = useDelta ? AutoBeanUtils.diff(parent, proxyBean) : AutoBeanUtils.getAllProperties(proxyBean); } else if (this.isValueType(stableId.getProxyClass())) { // Send everything diff = AutoBeanUtils.getAllProperties(proxyBean); } if (!diff.isEmpty()) { final Map<String, Splittable> propertyMap = new HashMap<>(); for (final Map.Entry<String, Object> entry : diff.entrySet()) { propertyMap.put(entry.getKey(), EntityCodex.encode(this, entry.getValue())); } operation.setPropertyMap(propertyMap); } return toReturn; }
[ "AutoBean", "<", "OperationMessage", ">", "makeOperationMessage", "(", "final", "SimpleProxyId", "<", "BaseProxy", ">", "stableId", ",", "final", "AutoBean", "<", "?", ">", "proxyBean", ",", "final", "boolean", "useDelta", ")", "{", "// The OperationMessages describ...
Create a single OperationMessage that encapsulates the state of a proxy AutoBean.
[ "Create", "a", "single", "OperationMessage", "that", "encapsulates", "the", "state", "of", "a", "proxy", "AutoBean", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L900-L960
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.processReturnOperation
<Q extends BaseProxy> Q processReturnOperation(final SimpleProxyId<Q> id, final OperationMessage op, final WriteOperation... operations) { final AutoBean<Q> toMutate = this.getProxyForReturnPayloadGraph(id); toMutate.setTag(Constants.VERSION_PROPERTY_B64, op.getVersion()); final Map<String, Splittable> properties = op.getPropertyMap(); if (properties != null) { // Apply updates toMutate.accept(new AutoBeanVisitor() { @Override public boolean visitReferenceProperty(final String propertyName, final AutoBean<?> value, final PropertyContext ctx) { if (ctx.canSet()) { if (properties.containsKey(propertyName)) { final Splittable raw = properties.get(propertyName); Object decoded = null; if (ctx.getType() == Map.class) { final MapPropertyContext mapCtx = (MapPropertyContext) ctx; final Class<?> keyType = mapCtx.getKeyType(); final Class<?> valueType = mapCtx.getValueType(); decoded = EntityCodex.decode(AbstractRequestContext.this, mapCtx.getType(), keyType, valueType, raw); } else { final Class<?> elementType = ctx instanceof CollectionPropertyContext ? ((CollectionPropertyContext) ctx).getElementType() : null; decoded = EntityCodex.decode(AbstractRequestContext.this, ctx.getType(), elementType, raw); } ctx.set(decoded); } } return false; } @Override public boolean visitValueProperty(final String propertyName, final Object value, final PropertyContext ctx) { if (ctx.canSet()) { if (properties.containsKey(propertyName)) { final Splittable raw = properties.get(propertyName); Object decoded = ValueCodex.decode(ctx.getType(), raw); /* * Hack for Date subtypes, consider generalizing for "custom serializers" */ if (decoded != null && Date.class.equals(ctx.getType())) { decoded = new DatePoser((Date) decoded); } ctx.set(decoded); } } return false; } }); } // Finished applying updates, freeze the bean this.makeImmutable(toMutate); final Q proxy = toMutate.as(); /* * Notify subscribers if the object differs from when it first came into the RequestContext. */ if (operations != null && this.state.requestFactory.isEntityType(id.getProxyClass())) { for (final WriteOperation writeOperation : operations) { if (writeOperation.equals(WriteOperation.UPDATE) && !this.state.requestFactory.hasVersionChanged(id, op.getVersion())) { // No updates if the server reports no change continue; } this.state.requestFactory.getEventBus().fireEventFromSource( new EntityProxyChange<>((EntityProxy) proxy, writeOperation), id.getProxyClass()); } } return proxy; }
java
<Q extends BaseProxy> Q processReturnOperation(final SimpleProxyId<Q> id, final OperationMessage op, final WriteOperation... operations) { final AutoBean<Q> toMutate = this.getProxyForReturnPayloadGraph(id); toMutate.setTag(Constants.VERSION_PROPERTY_B64, op.getVersion()); final Map<String, Splittable> properties = op.getPropertyMap(); if (properties != null) { // Apply updates toMutate.accept(new AutoBeanVisitor() { @Override public boolean visitReferenceProperty(final String propertyName, final AutoBean<?> value, final PropertyContext ctx) { if (ctx.canSet()) { if (properties.containsKey(propertyName)) { final Splittable raw = properties.get(propertyName); Object decoded = null; if (ctx.getType() == Map.class) { final MapPropertyContext mapCtx = (MapPropertyContext) ctx; final Class<?> keyType = mapCtx.getKeyType(); final Class<?> valueType = mapCtx.getValueType(); decoded = EntityCodex.decode(AbstractRequestContext.this, mapCtx.getType(), keyType, valueType, raw); } else { final Class<?> elementType = ctx instanceof CollectionPropertyContext ? ((CollectionPropertyContext) ctx).getElementType() : null; decoded = EntityCodex.decode(AbstractRequestContext.this, ctx.getType(), elementType, raw); } ctx.set(decoded); } } return false; } @Override public boolean visitValueProperty(final String propertyName, final Object value, final PropertyContext ctx) { if (ctx.canSet()) { if (properties.containsKey(propertyName)) { final Splittable raw = properties.get(propertyName); Object decoded = ValueCodex.decode(ctx.getType(), raw); /* * Hack for Date subtypes, consider generalizing for "custom serializers" */ if (decoded != null && Date.class.equals(ctx.getType())) { decoded = new DatePoser((Date) decoded); } ctx.set(decoded); } } return false; } }); } // Finished applying updates, freeze the bean this.makeImmutable(toMutate); final Q proxy = toMutate.as(); /* * Notify subscribers if the object differs from when it first came into the RequestContext. */ if (operations != null && this.state.requestFactory.isEntityType(id.getProxyClass())) { for (final WriteOperation writeOperation : operations) { if (writeOperation.equals(WriteOperation.UPDATE) && !this.state.requestFactory.hasVersionChanged(id, op.getVersion())) { // No updates if the server reports no change continue; } this.state.requestFactory.getEventBus().fireEventFromSource( new EntityProxyChange<>((EntityProxy) proxy, writeOperation), id.getProxyClass()); } } return proxy; }
[ "<", "Q", "extends", "BaseProxy", ">", "Q", "processReturnOperation", "(", "final", "SimpleProxyId", "<", "Q", ">", "id", ",", "final", "OperationMessage", "op", ",", "final", "WriteOperation", "...", "operations", ")", "{", "final", "AutoBean", "<", "Q", ">...
Create a new EntityProxy from a snapshot in the return payload. @param id the EntityProxyId of the object @param returnRecord the JSON map containing property/value pairs @param operations the WriteOperation eventns to broadcast over the EventBus
[ "Create", "a", "new", "EntityProxy", "from", "a", "snapshot", "in", "the", "return", "payload", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L969-L1045
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.allocateSyntheticId
private <Q extends BaseProxy> SimpleProxyId<Q> allocateSyntheticId(final String typeToken, final int syntheticId) { @SuppressWarnings("unchecked") SimpleProxyId<Q> toReturn = (SimpleProxyId<Q>) this.state.syntheticIds.get(syntheticId); if (toReturn == null) { toReturn = this.state.requestFactory .allocateId(this.state.requestFactory.<Q>getTypeFromToken(typeToken)); this.state.syntheticIds.put(syntheticId, toReturn); } return toReturn; }
java
private <Q extends BaseProxy> SimpleProxyId<Q> allocateSyntheticId(final String typeToken, final int syntheticId) { @SuppressWarnings("unchecked") SimpleProxyId<Q> toReturn = (SimpleProxyId<Q>) this.state.syntheticIds.get(syntheticId); if (toReturn == null) { toReturn = this.state.requestFactory .allocateId(this.state.requestFactory.<Q>getTypeFromToken(typeToken)); this.state.syntheticIds.put(syntheticId, toReturn); } return toReturn; }
[ "private", "<", "Q", "extends", "BaseProxy", ">", "SimpleProxyId", "<", "Q", ">", "allocateSyntheticId", "(", "final", "String", "typeToken", ",", "final", "int", "syntheticId", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "SimpleProxyId", "<", ...
Get-or-create method for synthetic ids. @see #syntheticIds
[ "Get", "-", "or", "-", "create", "method", "for", "synthetic", "ids", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L1052-L1062
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.checkStreamsNotCrossed
private <T> AutoBean<T> checkStreamsNotCrossed(final T object) { final AutoBean<T> bean = AutoBeanUtils.getAutoBean(object); if (bean == null) { // Unexpected; some kind of foreign implementation? throw new IllegalArgumentException(object.getClass().getName()); } final State otherState = bean.getTag(REQUEST_CONTEXT_STATE); if (!bean.isFrozen() && otherState != this.state) { /* * This means something is way off in the weeds. If a bean is editable, it's supposed to be * associated with a RequestContext. */ assert otherState != null : "Unfrozen bean with null RequestContext"; /* * Already editing the object in another context or it would have been in the editing map. */ throw new IllegalArgumentException( "Attempting to edit an EntityProxy" + " previously edited by another RequestContext"); } return bean; }
java
private <T> AutoBean<T> checkStreamsNotCrossed(final T object) { final AutoBean<T> bean = AutoBeanUtils.getAutoBean(object); if (bean == null) { // Unexpected; some kind of foreign implementation? throw new IllegalArgumentException(object.getClass().getName()); } final State otherState = bean.getTag(REQUEST_CONTEXT_STATE); if (!bean.isFrozen() && otherState != this.state) { /* * This means something is way off in the weeds. If a bean is editable, it's supposed to be * associated with a RequestContext. */ assert otherState != null : "Unfrozen bean with null RequestContext"; /* * Already editing the object in another context or it would have been in the editing map. */ throw new IllegalArgumentException( "Attempting to edit an EntityProxy" + " previously edited by another RequestContext"); } return bean; }
[ "private", "<", "T", ">", "AutoBean", "<", "T", ">", "checkStreamsNotCrossed", "(", "final", "T", "object", ")", "{", "final", "AutoBean", "<", "T", ">", "bean", "=", "AutoBeanUtils", ".", "getAutoBean", "(", "object", ")", ";", "if", "(", "bean", "=="...
This method checks that a proxy object is either immutable, or already edited by this context.
[ "This", "method", "checks", "that", "a", "proxy", "object", "is", "either", "immutable", "or", "already", "edited", "by", "this", "context", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L1073-L1095
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.freezeEntities
private void freezeEntities(final boolean frozen) { for (final AutoBean<?> bean : this.state.editedProxies.values()) { bean.setFrozen(frozen); } }
java
private void freezeEntities(final boolean frozen) { for (final AutoBean<?> bean : this.state.editedProxies.values()) { bean.setFrozen(frozen); } }
[ "private", "void", "freezeEntities", "(", "final", "boolean", "frozen", ")", "{", "for", "(", "final", "AutoBean", "<", "?", ">", "bean", ":", "this", ".", "state", ".", "editedProxies", ".", "values", "(", ")", ")", "{", "bean", ".", "setFrozen", "(",...
Set the frozen status of all EntityProxies owned by this context.
[ "Set", "the", "frozen", "status", "of", "all", "EntityProxies", "owned", "by", "this", "context", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L1222-L1226
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.makeImmutable
private void makeImmutable(final AutoBean<? extends BaseProxy> toMutate) { // Always diff'ed against itself, producing a no-op toMutate.setTag(Constants.PARENT_OBJECT, toMutate); // Act with entity-identity semantics toMutate.setTag(REQUEST_CONTEXT_STATE, null); toMutate.setFrozen(true); }
java
private void makeImmutable(final AutoBean<? extends BaseProxy> toMutate) { // Always diff'ed against itself, producing a no-op toMutate.setTag(Constants.PARENT_OBJECT, toMutate); // Act with entity-identity semantics toMutate.setTag(REQUEST_CONTEXT_STATE, null); toMutate.setFrozen(true); }
[ "private", "void", "makeImmutable", "(", "final", "AutoBean", "<", "?", "extends", "BaseProxy", ">", "toMutate", ")", "{", "// Always diff'ed against itself, producing a no-op", "toMutate", ".", "setTag", "(", "Constants", ".", "PARENT_OBJECT", ",", "toMutate", ")", ...
Make an EntityProxy immutable.
[ "Make", "an", "EntityProxy", "immutable", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L1231-L1237
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.makePayloadInvocations
private List<InvocationMessage> makePayloadInvocations() { final MessageFactory f = MessageFactoryHolder.FACTORY; final List<InvocationMessage> invocationMessages = new ArrayList<>(); for (final AbstractRequest<?, ?> invocation : this.state.invocations) { // RequestData is produced by the generated subclass final RequestData data = invocation.getRequestData(); final InvocationMessage message = f.invocation().as(); // Operation; essentially a method descriptor message.setOperation(data.getOperation()); // The arguments to the with() calls final Set<String> refsToSend = data.getPropertyRefs(); if (!refsToSend.isEmpty()) { message.setPropertyRefs(refsToSend); } // Parameter values or references final List<Splittable> parameters = new ArrayList<>(data.getOrderedParameters().length); for (final Object param : data.getOrderedParameters()) { parameters.add(EntityCodex.encode(this, param)); } if (!parameters.isEmpty()) { message.setParameters(parameters); } invocationMessages.add(message); } return invocationMessages; }
java
private List<InvocationMessage> makePayloadInvocations() { final MessageFactory f = MessageFactoryHolder.FACTORY; final List<InvocationMessage> invocationMessages = new ArrayList<>(); for (final AbstractRequest<?, ?> invocation : this.state.invocations) { // RequestData is produced by the generated subclass final RequestData data = invocation.getRequestData(); final InvocationMessage message = f.invocation().as(); // Operation; essentially a method descriptor message.setOperation(data.getOperation()); // The arguments to the with() calls final Set<String> refsToSend = data.getPropertyRefs(); if (!refsToSend.isEmpty()) { message.setPropertyRefs(refsToSend); } // Parameter values or references final List<Splittable> parameters = new ArrayList<>(data.getOrderedParameters().length); for (final Object param : data.getOrderedParameters()) { parameters.add(EntityCodex.encode(this, param)); } if (!parameters.isEmpty()) { message.setParameters(parameters); } invocationMessages.add(message); } return invocationMessages; }
[ "private", "List", "<", "InvocationMessage", ">", "makePayloadInvocations", "(", ")", "{", "final", "MessageFactory", "f", "=", "MessageFactoryHolder", ".", "FACTORY", ";", "final", "List", "<", "InvocationMessage", ">", "invocationMessages", "=", "new", "ArrayList"...
Create an InvocationMessage for each remote method call being made by the context.
[ "Create", "an", "InvocationMessage", "for", "each", "remote", "method", "call", "being", "made", "by", "the", "context", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L1242-L1272
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.processReturnOperations
private void processReturnOperations(final ResponseMessage response) { final List<OperationMessage> ops = response.getOperations(); // If there are no observable effects, this will be null if (ops == null) { return; } for (final OperationMessage op : ops) { final SimpleProxyId<?> id = this.getId(op); WriteOperation[] toPropagate = null; // May be null if the server is returning an unpersisted object final WriteOperation effect = op.getOperation(); if (effect != null) { switch (effect) { case DELETE: toPropagate = DELETE_ONLY; break; case PERSIST: toPropagate = PERSIST_AND_UPDATE; break; case UPDATE: toPropagate = UPDATE_ONLY; break; default: // Should never reach here throw new RuntimeException(effect.toString()); } } this.processReturnOperation(id, op, toPropagate); } assert this.state.returnedProxies.size() == ops.size(); }
java
private void processReturnOperations(final ResponseMessage response) { final List<OperationMessage> ops = response.getOperations(); // If there are no observable effects, this will be null if (ops == null) { return; } for (final OperationMessage op : ops) { final SimpleProxyId<?> id = this.getId(op); WriteOperation[] toPropagate = null; // May be null if the server is returning an unpersisted object final WriteOperation effect = op.getOperation(); if (effect != null) { switch (effect) { case DELETE: toPropagate = DELETE_ONLY; break; case PERSIST: toPropagate = PERSIST_AND_UPDATE; break; case UPDATE: toPropagate = UPDATE_ONLY; break; default: // Should never reach here throw new RuntimeException(effect.toString()); } } this.processReturnOperation(id, op, toPropagate); } assert this.state.returnedProxies.size() == ops.size(); }
[ "private", "void", "processReturnOperations", "(", "final", "ResponseMessage", "response", ")", "{", "final", "List", "<", "OperationMessage", ">", "ops", "=", "response", ".", "getOperations", "(", ")", ";", "// If there are no observable effects, this will be null", "...
Process an array of OperationMessages.
[ "Process", "an", "array", "of", "OperationMessages", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L1303-L1337
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.retainArg
private void retainArg(final Object arg) { if (arg instanceof Iterable<?>) { for (final Object o : (Iterable<?>) arg) { this.retainArg(o); } } else if (arg instanceof BaseProxy) { // Calling edit will validate and set up the tracking we need this.edit((BaseProxy) arg); } }
java
private void retainArg(final Object arg) { if (arg instanceof Iterable<?>) { for (final Object o : (Iterable<?>) arg) { this.retainArg(o); } } else if (arg instanceof BaseProxy) { // Calling edit will validate and set up the tracking we need this.edit((BaseProxy) arg); } }
[ "private", "void", "retainArg", "(", "final", "Object", "arg", ")", "{", "if", "(", "arg", "instanceof", "Iterable", "<", "?", ">", ")", "{", "for", "(", "final", "Object", "o", ":", "(", "Iterable", "<", "?", ">", ")", "arg", ")", "{", "this", "...
Ensures that any method arguments are retained in the context's sphere of influence.
[ "Ensures", "that", "any", "method", "arguments", "are", "retained", "in", "the", "context", "s", "sphere", "of", "influence", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L1342-L1351
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java
AbstractRequestContext.takeOwnership
private <T extends BaseProxy> T takeOwnership(final AutoBean<T> bean) { this.state.editedProxies.put(stableId(bean), bean); bean.setTag(REQUEST_CONTEXT_STATE, this.state); return bean.as(); }
java
private <T extends BaseProxy> T takeOwnership(final AutoBean<T> bean) { this.state.editedProxies.put(stableId(bean), bean); bean.setTag(REQUEST_CONTEXT_STATE, this.state); return bean.as(); }
[ "private", "<", "T", "extends", "BaseProxy", ">", "T", "takeOwnership", "(", "final", "AutoBean", "<", "T", ">", "bean", ")", "{", "this", ".", "state", ".", "editedProxies", ".", "put", "(", "stableId", "(", "bean", ")", ",", "bean", ")", ";", "bean...
Make the EnityProxy bean edited and owned by this RequestContext.
[ "Make", "the", "EnityProxy", "bean", "edited", "and", "owned", "by", "this", "RequestContext", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#L1369-L1373
train
ManfredTremmel/gwt-bean-validators
gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/ValueBoxBaseWithEditorErrors.java
ValueBoxBaseWithEditorErrors.showErrors
public void showErrors(final Set<String> messages) { final InputElement inputElement = this.getInputElement(); if (messages.isEmpty()) { if (FeatureCheck.supportCustomValidity(inputElement)) { inputElement.setCustomValidity(StringUtils.EMPTY); } if (this.validationMessageElement == null) { inputElement.setTitle(StringUtils.EMPTY); } else { this.validationMessageElement.getElement().removeAllChildren(); } } else { final String messagesAsString = ErrorMessageFormater.messagesToString(messages); if (FeatureCheck.supportCustomValidity(inputElement)) { inputElement.setCustomValidity(messagesAsString); } if (this.validationMessageElement == null) { inputElement.setTitle(messagesAsString); } else { this.validationMessageElement.getElement() .setInnerSafeHtml(ErrorMessageFormater.messagesToList(messages)); } } }
java
public void showErrors(final Set<String> messages) { final InputElement inputElement = this.getInputElement(); if (messages.isEmpty()) { if (FeatureCheck.supportCustomValidity(inputElement)) { inputElement.setCustomValidity(StringUtils.EMPTY); } if (this.validationMessageElement == null) { inputElement.setTitle(StringUtils.EMPTY); } else { this.validationMessageElement.getElement().removeAllChildren(); } } else { final String messagesAsString = ErrorMessageFormater.messagesToString(messages); if (FeatureCheck.supportCustomValidity(inputElement)) { inputElement.setCustomValidity(messagesAsString); } if (this.validationMessageElement == null) { inputElement.setTitle(messagesAsString); } else { this.validationMessageElement.getElement() .setInnerSafeHtml(ErrorMessageFormater.messagesToList(messages)); } } }
[ "public", "void", "showErrors", "(", "final", "Set", "<", "String", ">", "messages", ")", "{", "final", "InputElement", "inputElement", "=", "this", ".", "getInputElement", "(", ")", ";", "if", "(", "messages", ".", "isEmpty", "(", ")", ")", "{", "if", ...
show error messages. @param messages set of messages
[ "show", "error", "messages", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/ValueBoxBaseWithEditorErrors.java#L74-L97
train
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/java/de/knightsoftnet/gwtp/spring/client/GwtpSpringSession.java
GwtpSpringSession.readSessionData
@Override public void readSessionData() { this.dispatcher.execute(this.userService.isCurrentUserLoggedIn(), new AbstractSimpleRestCallback<GwtpSpringSession<T>, Boolean, HttpMessages>(this, this) { @Override public void onSuccess(final Boolean presult) { if (BooleanUtils.isTrue(presult)) { // we do have a logged in user, read it GwtpSpringSession.this.dispatcher.execute( GwtpSpringSession.this.userService.getCurrentUser(), new AbstractSimpleRestCallback<GwtpSpringSession<T>, T, HttpMessages>( GwtpSpringSession.this, GwtpSpringSession.this) { @Override public void onSuccess(final T presult) { GwtpSpringSession.this.setUser(presult); } }); } else { GwtpSpringSession.this.setUser(null); } } }); }
java
@Override public void readSessionData() { this.dispatcher.execute(this.userService.isCurrentUserLoggedIn(), new AbstractSimpleRestCallback<GwtpSpringSession<T>, Boolean, HttpMessages>(this, this) { @Override public void onSuccess(final Boolean presult) { if (BooleanUtils.isTrue(presult)) { // we do have a logged in user, read it GwtpSpringSession.this.dispatcher.execute( GwtpSpringSession.this.userService.getCurrentUser(), new AbstractSimpleRestCallback<GwtpSpringSession<T>, T, HttpMessages>( GwtpSpringSession.this, GwtpSpringSession.this) { @Override public void onSuccess(final T presult) { GwtpSpringSession.this.setUser(presult); } }); } else { GwtpSpringSession.this.setUser(null); } } }); }
[ "@", "Override", "public", "void", "readSessionData", "(", ")", "{", "this", ".", "dispatcher", ".", "execute", "(", "this", ".", "userService", ".", "isCurrentUserLoggedIn", "(", ")", ",", "new", "AbstractSimpleRestCallback", "<", "GwtpSpringSession", "<", "T",...
read session data.
[ "read", "session", "data", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/java/de/knightsoftnet/gwtp/spring/client/GwtpSpringSession.java#L59-L84
train
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/CollectionUtils.java
CollectionUtils.findValueOfType
@GwtIncompatible("incompatible method") @SuppressWarnings("unchecked") @Nullable public static <T> T findValueOfType(final Collection<?> collection, @Nullable final Class<T> type) { if (CollectionUtils.isEmpty(collection)) { return null; } T value = null; for (final Object element : collection) { if (type == null || type.isInstance(element)) { if (value != null) { // More than one value found... no clear single value. return null; } value = (T) element; } } return value; }
java
@GwtIncompatible("incompatible method") @SuppressWarnings("unchecked") @Nullable public static <T> T findValueOfType(final Collection<?> collection, @Nullable final Class<T> type) { if (CollectionUtils.isEmpty(collection)) { return null; } T value = null; for (final Object element : collection) { if (type == null || type.isInstance(element)) { if (value != null) { // More than one value found... no clear single value. return null; } value = (T) element; } } return value; }
[ "@", "GwtIncompatible", "(", "\"incompatible method\"", ")", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Nullable", "public", "static", "<", "T", ">", "T", "findValueOfType", "(", "final", "Collection", "<", "?", ">", "collection", ",", "@", "Nul...
Find a single value of the given type in the given Collection. @param collection the Collection to search @param type the type to look for @return a value of the given type found if there is a clear match, or {@code null} if none or more than one such value found
[ "Find", "a", "single", "value", "of", "the", "given", "type", "in", "the", "given", "Collection", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/CollectionUtils.java#L242-L261
train
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/CollectionUtils.java
CollectionUtils.lastElement
@Nullable public static <T> T lastElement(@Nullable final List<T> list) { if (CollectionUtils.isEmpty(list)) { return null; } return list.get(list.size() - 1); }
java
@Nullable public static <T> T lastElement(@Nullable final List<T> list) { if (CollectionUtils.isEmpty(list)) { return null; } return list.get(list.size() - 1); }
[ "@", "Nullable", "public", "static", "<", "T", ">", "T", "lastElement", "(", "@", "Nullable", "final", "List", "<", "T", ">", "list", ")", "{", "if", "(", "CollectionUtils", ".", "isEmpty", "(", "list", ")", ")", "{", "return", "null", ";", "}", "r...
Retrieve the last element of the given List, accessing the highest index. @param list the List to check (may be {@code null} or empty) @return the last element, or {@code null} if none @since 5.0.3
[ "Retrieve", "the", "last", "element", "of", "the", "given", "List", "accessing", "the", "highest", "index", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/CollectionUtils.java#L372-L378
train
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/CollectionUtils.java
CollectionUtils.unmodifiableMultiValueMap
@SuppressWarnings("unchecked") public static <K, V> MultiValueMap<K, V> unmodifiableMultiValueMap( final MultiValueMap<? extends K, ? extends V> map) { Assert.notNull(map, "'map' must not be null"); final Map<K, List<V>> result = new LinkedHashMap<>(map.size()); map.forEach((key, value) -> { final List<? extends V> values = Collections.unmodifiableList(value); result.put(key, (List<V>) values); }); final Map<K, List<V>> unmodifiableMap = Collections.unmodifiableMap(result); return CollectionUtils.toMultiValueMap(unmodifiableMap); }
java
@SuppressWarnings("unchecked") public static <K, V> MultiValueMap<K, V> unmodifiableMultiValueMap( final MultiValueMap<? extends K, ? extends V> map) { Assert.notNull(map, "'map' must not be null"); final Map<K, List<V>> result = new LinkedHashMap<>(map.size()); map.forEach((key, value) -> { final List<? extends V> values = Collections.unmodifiableList(value); result.put(key, (List<V>) values); }); final Map<K, List<V>> unmodifiableMap = Collections.unmodifiableMap(result); return CollectionUtils.toMultiValueMap(unmodifiableMap); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "K", ",", "V", ">", "MultiValueMap", "<", "K", ",", "V", ">", "unmodifiableMultiValueMap", "(", "final", "MultiValueMap", "<", "?", "extends", "K", ",", "?", "extends", "V", ">", ...
Return an unmodifiable view of the specified multi-value map. @param map the map for which an unmodifiable view is to be returned. @return an unmodifiable view of the specified multi-value map. @since 3.1
[ "Return", "an", "unmodifiable", "view", "of", "the", "specified", "multi", "-", "value", "map", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/CollectionUtils.java#L421-L432
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/BeanHelperCache.java
BeanHelperCache.createHelper
BeanHelper createHelper(final JClassType pjtype, final TreeLogger plogger, final GeneratorContext pcontext) throws UnableToCompleteException { final JClassType erasedType = pjtype.getErasedType(); try { final Class<?> clazz = Class.forName(erasedType.getQualifiedBinaryName()); return doCreateHelper(clazz, erasedType, plogger, pcontext); } catch (final ClassNotFoundException e) { plogger.log(TreeLogger.ERROR, "Unable to create BeanHelper for " + erasedType, e); throw new UnableToCompleteException(); // NOPMD } }
java
BeanHelper createHelper(final JClassType pjtype, final TreeLogger plogger, final GeneratorContext pcontext) throws UnableToCompleteException { final JClassType erasedType = pjtype.getErasedType(); try { final Class<?> clazz = Class.forName(erasedType.getQualifiedBinaryName()); return doCreateHelper(clazz, erasedType, plogger, pcontext); } catch (final ClassNotFoundException e) { plogger.log(TreeLogger.ERROR, "Unable to create BeanHelper for " + erasedType, e); throw new UnableToCompleteException(); // NOPMD } }
[ "BeanHelper", "createHelper", "(", "final", "JClassType", "pjtype", ",", "final", "TreeLogger", "plogger", ",", "final", "GeneratorContext", "pcontext", ")", "throws", "UnableToCompleteException", "{", "final", "JClassType", "erasedType", "=", "pjtype", ".", "getErase...
Creates a BeanHelper and writes an interface containing its instance. Also, recursively creates any BeanHelpers on its constrained properties.
[ "Creates", "a", "BeanHelper", "and", "writes", "an", "interface", "containing", "its", "instance", ".", "Also", "recursively", "creates", "any", "BeanHelpers", "on", "its", "constrained", "properties", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/BeanHelperCache.java#L84-L94
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/BeanHelperCache.java
BeanHelperCache.doCreateHelperForProp
private void doCreateHelperForProp(final PropertyDescriptor propertyDescriptor, final BeanHelper parent, final TreeLogger logger, final GeneratorContext context) throws UnableToCompleteException { final Class<?> elementClass = propertyDescriptor.getElementClass(); if (GwtSpecificValidatorCreator.isIterableOrMap(elementClass)) { if (parent.hasField(propertyDescriptor)) { final JClassType type = parent.getAssociationType(propertyDescriptor, true); this.createHelper(type.getErasedType(), logger, context); } if (parent.hasGetter(propertyDescriptor)) { final JClassType type = parent.getAssociationType(propertyDescriptor, false); this.createHelper(type.getErasedType(), logger, context); } } else { if (serverSideValidator.getConstraintsForClass(elementClass).isBeanConstrained()) { this.createHelper(elementClass, logger, context); } } }
java
private void doCreateHelperForProp(final PropertyDescriptor propertyDescriptor, final BeanHelper parent, final TreeLogger logger, final GeneratorContext context) throws UnableToCompleteException { final Class<?> elementClass = propertyDescriptor.getElementClass(); if (GwtSpecificValidatorCreator.isIterableOrMap(elementClass)) { if (parent.hasField(propertyDescriptor)) { final JClassType type = parent.getAssociationType(propertyDescriptor, true); this.createHelper(type.getErasedType(), logger, context); } if (parent.hasGetter(propertyDescriptor)) { final JClassType type = parent.getAssociationType(propertyDescriptor, false); this.createHelper(type.getErasedType(), logger, context); } } else { if (serverSideValidator.getConstraintsForClass(elementClass).isBeanConstrained()) { this.createHelper(elementClass, logger, context); } } }
[ "private", "void", "doCreateHelperForProp", "(", "final", "PropertyDescriptor", "propertyDescriptor", ",", "final", "BeanHelper", "parent", ",", "final", "TreeLogger", "logger", ",", "final", "GeneratorContext", "context", ")", "throws", "UnableToCompleteException", "{", ...
Creates the appropriate BeanHelper for a property on a bean.
[ "Creates", "the", "appropriate", "BeanHelper", "for", "a", "property", "on", "a", "bean", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/BeanHelperCache.java#L140-L160
train
ManfredTremmel/gwt-bean-validators
gwtp-dynamic-navigation/src/main/java/de/knightsoftnet/navigation/client/ui/navigation/AbstractNavigationStructure.java
AbstractNavigationStructure.generateMapRecursive
private void generateMapRecursive(final List<NavigationEntryInterface> pnavigationEntries) { for (final NavigationEntryInterface entryToAdd : pnavigationEntries) { String token = entryToAdd.getToken(); if (entryToAdd.getMenuValue() != null && token != null) { if (token.endsWith("/" + StringUtils.removeStart(loginToken, "/"))) { token = loginToken; } if (!placeMap.containsKey(token)) { placeMap.put(token, entryToAdd); } } if (entryToAdd instanceof NavigationEntryFolder) { generateMapRecursive(((NavigationEntryFolder) entryToAdd).getSubEntries()); } } }
java
private void generateMapRecursive(final List<NavigationEntryInterface> pnavigationEntries) { for (final NavigationEntryInterface entryToAdd : pnavigationEntries) { String token = entryToAdd.getToken(); if (entryToAdd.getMenuValue() != null && token != null) { if (token.endsWith("/" + StringUtils.removeStart(loginToken, "/"))) { token = loginToken; } if (!placeMap.containsKey(token)) { placeMap.put(token, entryToAdd); } } if (entryToAdd instanceof NavigationEntryFolder) { generateMapRecursive(((NavigationEntryFolder) entryToAdd).getSubEntries()); } } }
[ "private", "void", "generateMapRecursive", "(", "final", "List", "<", "NavigationEntryInterface", ">", "pnavigationEntries", ")", "{", "for", "(", "final", "NavigationEntryInterface", "entryToAdd", ":", "pnavigationEntries", ")", "{", "String", "token", "=", "entryToA...
create map out of the navigation list. @param pnavigationEntries list of navigation entries
[ "create", "map", "out", "of", "the", "navigation", "list", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-dynamic-navigation/src/main/java/de/knightsoftnet/navigation/client/ui/navigation/AbstractNavigationStructure.java#L118-L133
train
ManfredTremmel/gwt-bean-validators
gwtp-dynamic-navigation/src/main/java/de/knightsoftnet/navigation/client/ui/navigation/AbstractNavigationStructure.java
AbstractNavigationStructure.recursiveGetEntries
private List<NavigationEntryInterface> recursiveGetEntries( final List<NavigationEntryInterface> pnavigationEntries) { if (pnavigationEntries == null) { return Collections.emptyList(); } return pnavigationEntries.stream().filter(entry -> entry.canReveal()).map(entry -> { if (entry instanceof NavigationEntryFolder) { return new NavigationEntryFolder(entry.getMenuValue(), entry.isOpenOnStartup(), recursiveGetEntries(((NavigationEntryFolder) entry).getSubEntries())); } else { return entry; } }).collect(Collectors.toList()); }
java
private List<NavigationEntryInterface> recursiveGetEntries( final List<NavigationEntryInterface> pnavigationEntries) { if (pnavigationEntries == null) { return Collections.emptyList(); } return pnavigationEntries.stream().filter(entry -> entry.canReveal()).map(entry -> { if (entry instanceof NavigationEntryFolder) { return new NavigationEntryFolder(entry.getMenuValue(), entry.isOpenOnStartup(), recursiveGetEntries(((NavigationEntryFolder) entry).getSubEntries())); } else { return entry; } }).collect(Collectors.toList()); }
[ "private", "List", "<", "NavigationEntryInterface", ">", "recursiveGetEntries", "(", "final", "List", "<", "NavigationEntryInterface", ">", "pnavigationEntries", ")", "{", "if", "(", "pnavigationEntries", "==", "null", ")", "{", "return", "Collections", ".", "emptyL...
get all navigation entries that can be displayed by a given user. @param pnavigationEntries entries to test @param puser the user to test @return the navigationEntries
[ "get", "all", "navigation", "entries", "that", "can", "be", "displayed", "by", "a", "given", "user", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-dynamic-navigation/src/main/java/de/knightsoftnet/navigation/client/ui/navigation/AbstractNavigationStructure.java#L142-L155
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/ConstraintViolationImpl.java
ConstraintViolationImpl.forReturnValueValidation
public static <T> ConstraintViolation<T> forReturnValueValidation(final String messageTemplate, final Map<String, Object> messageParameters, final Map<String, Object> expressionVariables, final String interpolatedMessage, final Class<T> rootBeanClass, final T rootBean, final Object leafBeanInstance, final Object value, final Path propertyPath, final ConstraintDescriptor<?> constraintDescriptor, final ElementType elementType, final Object executableReturnValue, final Object dynamicPayload) { return new ConstraintViolationImpl<>(messageTemplate, messageParameters, expressionVariables, interpolatedMessage, rootBeanClass, rootBean, leafBeanInstance, value, propertyPath, constraintDescriptor, elementType, null, executableReturnValue, dynamicPayload); }
java
public static <T> ConstraintViolation<T> forReturnValueValidation(final String messageTemplate, final Map<String, Object> messageParameters, final Map<String, Object> expressionVariables, final String interpolatedMessage, final Class<T> rootBeanClass, final T rootBean, final Object leafBeanInstance, final Object value, final Path propertyPath, final ConstraintDescriptor<?> constraintDescriptor, final ElementType elementType, final Object executableReturnValue, final Object dynamicPayload) { return new ConstraintViolationImpl<>(messageTemplate, messageParameters, expressionVariables, interpolatedMessage, rootBeanClass, rootBean, leafBeanInstance, value, propertyPath, constraintDescriptor, elementType, null, executableReturnValue, dynamicPayload); }
[ "public", "static", "<", "T", ">", "ConstraintViolation", "<", "T", ">", "forReturnValueValidation", "(", "final", "String", "messageTemplate", ",", "final", "Map", "<", "String", ",", "Object", ">", "messageParameters", ",", "final", "Map", "<", "String", ","...
create ConstraintViolation for return value validation.
[ "create", "ConstraintViolation", "for", "return", "value", "validation", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/ConstraintViolationImpl.java#L81-L90
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/ConstraintViolationImpl.java
ConstraintViolationImpl.createHashCode
private int createHashCode() { return Objects.hash(this.interpolatedMessage, this.propertyPath, this.rootBean, this.leafBeanInstance, this.value, this.constraintDescriptor, this.messageTemplate, this.elementType); }
java
private int createHashCode() { return Objects.hash(this.interpolatedMessage, this.propertyPath, this.rootBean, this.leafBeanInstance, this.value, this.constraintDescriptor, this.messageTemplate, this.elementType); }
[ "private", "int", "createHashCode", "(", ")", "{", "return", "Objects", ".", "hash", "(", "this", ".", "interpolatedMessage", ",", "this", ".", "propertyPath", ",", "this", ".", "rootBean", ",", "this", ".", "leafBeanInstance", ",", "this", ".", "value", "...
create hash code. @see #equals(Object) on which fields are taken into account.
[ "create", "hash", "code", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/ConstraintViolationImpl.java#L253-L257
train
omgnuts/JCropImageView
project/mod_library/src/main/java/com.github.jimcoven/view/JCropImageView.java
JCropImageView.initFromAttributes
private void initFromAttributes(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { // Read and apply provided attributes TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.JCropImageView, defStyleAttr, defStyleRes); mCropType = a.getInt(R.styleable.JCropImageView_cropType, mCropType); mCropAlign = a.getInt(R.styleable.JCropImageView_cropAlign, mCropAlign); a.recycle(); setCropType(mCropType); }
java
private void initFromAttributes(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { // Read and apply provided attributes TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.JCropImageView, defStyleAttr, defStyleRes); mCropType = a.getInt(R.styleable.JCropImageView_cropType, mCropType); mCropAlign = a.getInt(R.styleable.JCropImageView_cropAlign, mCropAlign); a.recycle(); setCropType(mCropType); }
[ "private", "void", "initFromAttributes", "(", "Context", "context", ",", "AttributeSet", "attrs", ",", "int", "defStyleAttr", ",", "int", "defStyleRes", ")", "{", "// Read and apply provided attributes", "TypedArray", "a", "=", "context", ".", "obtainStyledAttributes", ...
Initialize the attributes for JCropImageView @param context The Context the view is running in, through which it can access the current theme, resources, etc. @param attrs The attributes of the XML tag that is inflating the view. @param defStyleAttr An attribute in the current theme that contains a reference to a style resource that supplies default values for the view. Can be 0 to not look for defaults. @param defStyleRes A resource identifier of a style resource that supplies default values for the view, used only if defStyleAttr is 0 or can not be found in the theme. Can be 0 to not look for defaults. @see @link android.view.View(Context, AttributeSet, int)
[ "Initialize", "the", "attributes", "for", "JCropImageView" ]
fda5dd5924b00c8c930d31edb0e7dd1ed1e3952d
https://github.com/omgnuts/JCropImageView/blob/fda5dd5924b00c8c930d31edb0e7dd1ed1e3952d/project/mod_library/src/main/java/com.github.jimcoven/view/JCropImageView.java#L100-L110
train
neoremind/navi
navi/src/main/java/com/baidu/beidou/navi/server/callback/CallFuture.java
CallFuture.await
public void await(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException { if (!latch.await(timeout, unit)) { throw new TimeoutException(); } }
java
public void await(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException { if (!latch.await(timeout, unit)) { throw new TimeoutException(); } }
[ "public", "void", "await", "(", "long", "timeout", ",", "TimeUnit", "unit", ")", "throws", "InterruptedException", ",", "TimeoutException", "{", "if", "(", "!", "latch", ".", "await", "(", "timeout", ",", "unit", ")", ")", "{", "throw", "new", "TimeoutExce...
Waits for the CallFuture to complete without returning the result. @param timeout the maximum time to wait. @param unit the time unit of the timeout argument. @throws InterruptedException if interrupted. @throws TimeoutException if the wait timed out.
[ "Waits", "for", "the", "CallFuture", "to", "complete", "without", "returning", "the", "result", "." ]
d37e4b46ef07d124be2740ad3d85d87e939acc84
https://github.com/neoremind/navi/blob/d37e4b46ef07d124be2740ad3d85d87e939acc84/navi/src/main/java/com/baidu/beidou/navi/server/callback/CallFuture.java#L136-L140
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/util/CollectionHelper.java
CollectionHelper.newHashSet
public static <T> HashSet<T> newHashSet(final Iterable<? extends T> iterable) { final HashSet<T> set = newHashSet(); for (final T t : iterable) { set.add(t); } return set; }
java
public static <T> HashSet<T> newHashSet(final Iterable<? extends T> iterable) { final HashSet<T> set = newHashSet(); for (final T t : iterable) { set.add(t); } return set; }
[ "public", "static", "<", "T", ">", "HashSet", "<", "T", ">", "newHashSet", "(", "final", "Iterable", "<", "?", "extends", "T", ">", "iterable", ")", "{", "final", "HashSet", "<", "T", ">", "set", "=", "newHashSet", "(", ")", ";", "for", "(", "final...
new has set from iterable. @param iterable iterable to add to hash set @return hash set
[ "new", "has", "set", "from", "iterable", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/util/CollectionHelper.java#L69-L75
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/util/CollectionHelper.java
CollectionHelper.newArrayList
@SafeVarargs public static <T> ArrayList<T> newArrayList(final Iterable<T>... iterables) { final ArrayList<T> resultList = newArrayList(); for (final Iterable<T> oneIterable : iterables) { for (final T oneElement : oneIterable) { resultList.add(oneElement); } } return resultList; }
java
@SafeVarargs public static <T> ArrayList<T> newArrayList(final Iterable<T>... iterables) { final ArrayList<T> resultList = newArrayList(); for (final Iterable<T> oneIterable : iterables) { for (final T oneElement : oneIterable) { resultList.add(oneElement); } } return resultList; }
[ "@", "SafeVarargs", "public", "static", "<", "T", ">", "ArrayList", "<", "T", ">", "newArrayList", "(", "final", "Iterable", "<", "T", ">", "...", "iterables", ")", "{", "final", "ArrayList", "<", "T", ">", "resultList", "=", "newArrayList", "(", ")", ...
new array list from iterable. @param iterables iterables to add to array list @return hash set
[ "new", "array", "list", "from", "iterable", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/util/CollectionHelper.java#L91-L100
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/util/CollectionHelper.java
CollectionHelper.toImmutableList
public static <T> List<T> toImmutableList(final List<? extends T> list) { switch (list.size()) { case 0: return Collections.emptyList(); case 1: return Collections.singletonList(list.get(0)); default: return Collections.unmodifiableList(list); } }
java
public static <T> List<T> toImmutableList(final List<? extends T> list) { switch (list.size()) { case 0: return Collections.emptyList(); case 1: return Collections.singletonList(list.get(0)); default: return Collections.unmodifiableList(list); } }
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "toImmutableList", "(", "final", "List", "<", "?", "extends", "T", ">", "list", ")", "{", "switch", "(", "list", ".", "size", "(", ")", ")", "{", "case", "0", ":", "return", "Collections", ...
list to imuteable list. @param list list to convert @return imuteable list
[ "list", "to", "imuteable", "list", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/util/CollectionHelper.java#L113-L122
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/util/CollectionHelper.java
CollectionHelper.toImmutableSet
public static <T> Set<T> toImmutableSet(final Set<? extends T> set) { switch (set.size()) { case 0: return Collections.emptySet(); case 1: return Collections.singleton(set.iterator().next()); default: return Collections.unmodifiableSet(set); } }
java
public static <T> Set<T> toImmutableSet(final Set<? extends T> set) { switch (set.size()) { case 0: return Collections.emptySet(); case 1: return Collections.singleton(set.iterator().next()); default: return Collections.unmodifiableSet(set); } }
[ "public", "static", "<", "T", ">", "Set", "<", "T", ">", "toImmutableSet", "(", "final", "Set", "<", "?", "extends", "T", ">", "set", ")", "{", "switch", "(", "set", ".", "size", "(", ")", ")", "{", "case", "0", ":", "return", "Collections", ".",...
list to imuteable set. @param set set to convert @return imuteable set
[ "list", "to", "imuteable", "set", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/util/CollectionHelper.java#L130-L139
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/util/CollectionHelper.java
CollectionHelper.toImmutableMap
public static <K, V> Map<K, V> toImmutableMap(final Map<K, V> map) { switch (map.size()) { case 0: return Collections.emptyMap(); case 1: final Entry<K, V> entry = map.entrySet().iterator().next(); return Collections.singletonMap(entry.getKey(), entry.getValue()); default: return Collections.unmodifiableMap(map); } }
java
public static <K, V> Map<K, V> toImmutableMap(final Map<K, V> map) { switch (map.size()) { case 0: return Collections.emptyMap(); case 1: final Entry<K, V> entry = map.entrySet().iterator().next(); return Collections.singletonMap(entry.getKey(), entry.getValue()); default: return Collections.unmodifiableMap(map); } }
[ "public", "static", "<", "K", ",", "V", ">", "Map", "<", "K", ",", "V", ">", "toImmutableMap", "(", "final", "Map", "<", "K", ",", "V", ">", "map", ")", "{", "switch", "(", "map", ".", "size", "(", ")", ")", "{", "case", "0", ":", "return", ...
list to imuteable map. @param map map to convert @return imuteable map
[ "list", "to", "imuteable", "map", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/util/CollectionHelper.java#L147-L157
train
ManfredTremmel/gwt-bean-validators
mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/data/AbstractCreateClass.java
AbstractCreateClass.createPhoneCountryConstants
protected static PhoneCountryConstantsImpl createPhoneCountryConstants(final Locale plocale) { final Map<String, String> phoneCountryNames = CreatePhoneCountryConstantsClass.readPhoneCountryNames(plocale); final Map<String, String> phoneCountryCodes = CreatePhoneCountryConstantsClass.readPhoneCountryCodes(plocale); final Set<PhoneCountryCodeData> countryCodeData = readPhoneCountryProperties(plocale, phoneCountryNames, phoneCountryCodes); return new PhoneCountryConstantsImpl(countryCodeData, createMapFromPhoneCountry(plocale, countryCodeData, phoneCountryNames, phoneCountryCodes)); }
java
protected static PhoneCountryConstantsImpl createPhoneCountryConstants(final Locale plocale) { final Map<String, String> phoneCountryNames = CreatePhoneCountryConstantsClass.readPhoneCountryNames(plocale); final Map<String, String> phoneCountryCodes = CreatePhoneCountryConstantsClass.readPhoneCountryCodes(plocale); final Set<PhoneCountryCodeData> countryCodeData = readPhoneCountryProperties(plocale, phoneCountryNames, phoneCountryCodes); return new PhoneCountryConstantsImpl(countryCodeData, createMapFromPhoneCountry(plocale, countryCodeData, phoneCountryNames, phoneCountryCodes)); }
[ "protected", "static", "PhoneCountryConstantsImpl", "createPhoneCountryConstants", "(", "final", "Locale", "plocale", ")", "{", "final", "Map", "<", "String", ",", "String", ">", "phoneCountryNames", "=", "CreatePhoneCountryConstantsClass", ".", "readPhoneCountryNames", "...
NOPMD, can't include abstract static methods
[ "NOPMD", "can", "t", "include", "abstract", "static", "methods" ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/data/AbstractCreateClass.java#L37-L46
train
ddf-project/DDF
core/src/main/java/io/ddf/etl/TransformationHandler.java
TransformationHandler.RToSqlUdf
public static String RToSqlUdf(List<String> RExps, List<String> selectedColumns, List<Column> existingColumns) { List<String> udfs = Lists.newArrayList(); Map<String, String> newColToDef = new HashMap<String, String>(); boolean updateOnConflict = (selectedColumns == null || selectedColumns.isEmpty()); String dupColExp = "%s duplicates another column name"; if (updateOnConflict) { if (existingColumns != null && !existingColumns.isEmpty()) { for (Column c : existingColumns) { udfs.add(c.getName()); } } } else { for (String c : selectedColumns) { udfs.add(c); } } Set<String> newColsInRExp = new HashSet<String>(); for (String str : RExps) { int index = str.indexOf("=") > str.indexOf("~") ? str.indexOf("=") : str.indexOf("~"); String[] udf = new String[2]; if (index == -1) { udf[0] = str; } else { udf[0] = str.substring(0,index); udf[1] = str.substring(index + 1); } // String[] udf = str.split("[=~](?![^()]*+\\))"); String newCol = (index != -1) ? udf[0].trim().replaceAll("\\W", "") : udf[0].trim(); if (newColsInRExp.contains(newCol)) { throw new RuntimeException(String.format(dupColExp, newCol)); } String newDef = (index != -1) ? udf[1].trim() : null; if (!udfs.contains(newCol)) { udfs.add(newCol); } else if (!updateOnConflict) { throw new RuntimeException(String.format(dupColExp,newCol)); } if (newDef != null && !newDef.isEmpty()) { newColToDef.put(newCol.replaceAll("\\W", ""), newDef); } newColsInRExp.add(newCol); } String selectStr = ""; for (String udf : udfs) { String exp = newColToDef.containsKey(udf) ? String.format("%s as %s", newColToDef.get(udf), udf) : String.format("%s", udf); selectStr += (exp + ","); } return selectStr.substring(0, selectStr.length() - 1); }
java
public static String RToSqlUdf(List<String> RExps, List<String> selectedColumns, List<Column> existingColumns) { List<String> udfs = Lists.newArrayList(); Map<String, String> newColToDef = new HashMap<String, String>(); boolean updateOnConflict = (selectedColumns == null || selectedColumns.isEmpty()); String dupColExp = "%s duplicates another column name"; if (updateOnConflict) { if (existingColumns != null && !existingColumns.isEmpty()) { for (Column c : existingColumns) { udfs.add(c.getName()); } } } else { for (String c : selectedColumns) { udfs.add(c); } } Set<String> newColsInRExp = new HashSet<String>(); for (String str : RExps) { int index = str.indexOf("=") > str.indexOf("~") ? str.indexOf("=") : str.indexOf("~"); String[] udf = new String[2]; if (index == -1) { udf[0] = str; } else { udf[0] = str.substring(0,index); udf[1] = str.substring(index + 1); } // String[] udf = str.split("[=~](?![^()]*+\\))"); String newCol = (index != -1) ? udf[0].trim().replaceAll("\\W", "") : udf[0].trim(); if (newColsInRExp.contains(newCol)) { throw new RuntimeException(String.format(dupColExp, newCol)); } String newDef = (index != -1) ? udf[1].trim() : null; if (!udfs.contains(newCol)) { udfs.add(newCol); } else if (!updateOnConflict) { throw new RuntimeException(String.format(dupColExp,newCol)); } if (newDef != null && !newDef.isEmpty()) { newColToDef.put(newCol.replaceAll("\\W", ""), newDef); } newColsInRExp.add(newCol); } String selectStr = ""; for (String udf : udfs) { String exp = newColToDef.containsKey(udf) ? String.format("%s as %s", newColToDef.get(udf), udf) : String.format("%s", udf); selectStr += (exp + ","); } return selectStr.substring(0, selectStr.length() - 1); }
[ "public", "static", "String", "RToSqlUdf", "(", "List", "<", "String", ">", "RExps", ",", "List", "<", "String", ">", "selectedColumns", ",", "List", "<", "Column", ">", "existingColumns", ")", "{", "List", "<", "String", ">", "udfs", "=", "Lists", ".", ...
Parse R transform expression to Hive equivalent @param RExps : e.g: "foobar = arrtime - crsarrtime, speed = distance / airtime" @return "(arrtime - crsarrtime) as foobar, (distance / airtime) as speed
[ "Parse", "R", "transform", "expression", "to", "Hive", "equivalent" ]
e4e68315dcec1ed8b287bf1ee73baa88e7e41eba
https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/etl/TransformationHandler.java#L143-L205
train
couchbaselabs/couchbase-lite-java-forestdb
src/main/java/com/couchbase/lite/store/ForestBridge.java
ForestBridge.getCurrentRevisionIDs
public static List<String> getCurrentRevisionIDs(Document doc) throws ForestException { List<String> currentRevIDs = new ArrayList<String>(); do { currentRevIDs.add(doc.getSelectedRevID()); } while (doc.selectNextLeaf(false, false)); return currentRevIDs; }
java
public static List<String> getCurrentRevisionIDs(Document doc) throws ForestException { List<String> currentRevIDs = new ArrayList<String>(); do { currentRevIDs.add(doc.getSelectedRevID()); } while (doc.selectNextLeaf(false, false)); return currentRevIDs; }
[ "public", "static", "List", "<", "String", ">", "getCurrentRevisionIDs", "(", "Document", "doc", ")", "throws", "ForestException", "{", "List", "<", "String", ">", "currentRevIDs", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "do", "{", "cur...
Not include deleted leaf node
[ "Not", "include", "deleted", "leaf", "node" ]
fd806b251dd7dcc7a76ab7a8db618e30c3419f06
https://github.com/couchbaselabs/couchbase-lite-java-forestdb/blob/fd806b251dd7dcc7a76ab7a8db618e30c3419f06/src/main/java/com/couchbase/lite/store/ForestBridge.java#L103-L109
train
ManfredTremmel/gwt-bean-validators
gwtp-dynamic-navigation/src/main/java/de/knightsoftnet/navigation/client/ui/navigation/NavigationEntryFolder.java
NavigationEntryFolder.addSubEntries
public final void addSubEntries(final Collection<NavigationEntryInterface> psubEntries) { if (!CollectionUtils.isEmpty(psubEntries)) { subEntries.addAll(psubEntries); subEntries.forEach(subEntry -> subEntry.setParentEntry(this)); } }
java
public final void addSubEntries(final Collection<NavigationEntryInterface> psubEntries) { if (!CollectionUtils.isEmpty(psubEntries)) { subEntries.addAll(psubEntries); subEntries.forEach(subEntry -> subEntry.setParentEntry(this)); } }
[ "public", "final", "void", "addSubEntries", "(", "final", "Collection", "<", "NavigationEntryInterface", ">", "psubEntries", ")", "{", "if", "(", "!", "CollectionUtils", ".", "isEmpty", "(", "psubEntries", ")", ")", "{", "subEntries", ".", "addAll", "(", "psub...
add a menu sub entries. @param psubEntries the sub entries to add
[ "add", "a", "menu", "sub", "entries", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-dynamic-navigation/src/main/java/de/knightsoftnet/navigation/client/ui/navigation/NavigationEntryFolder.java#L130-L135
train
ManfredTremmel/gwt-bean-validators
mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/LocaleUtil.java
LocaleUtil.convertLanguageToLocale
public static Locale convertLanguageToLocale(final String planguage) { final Locale locale; if (planguage == null) { locale = null; } else { final String localeStringUp = planguage.toUpperCase().replace('-', '_'); if (LocaleUtil.DEFAULT_MAP.containsKey(localeStringUp)) { locale = LocaleUtil.DEFAULT_MAP.get(localeStringUp); } else if (localeStringUp.contains("_")) { final String[] lcoaleSplitted = localeStringUp.split("_"); if (lcoaleSplitted.length > 2) { locale = new Locale(lcoaleSplitted[0].toLowerCase(), lcoaleSplitted[1], lcoaleSplitted[2]); } else { locale = new Locale(lcoaleSplitted[0].toLowerCase(), lcoaleSplitted[1]); } } else { locale = new Locale(planguage); } } return locale; }
java
public static Locale convertLanguageToLocale(final String planguage) { final Locale locale; if (planguage == null) { locale = null; } else { final String localeStringUp = planguage.toUpperCase().replace('-', '_'); if (LocaleUtil.DEFAULT_MAP.containsKey(localeStringUp)) { locale = LocaleUtil.DEFAULT_MAP.get(localeStringUp); } else if (localeStringUp.contains("_")) { final String[] lcoaleSplitted = localeStringUp.split("_"); if (lcoaleSplitted.length > 2) { locale = new Locale(lcoaleSplitted[0].toLowerCase(), lcoaleSplitted[1], lcoaleSplitted[2]); } else { locale = new Locale(lcoaleSplitted[0].toLowerCase(), lcoaleSplitted[1]); } } else { locale = new Locale(planguage); } } return locale; }
[ "public", "static", "Locale", "convertLanguageToLocale", "(", "final", "String", "planguage", ")", "{", "final", "Locale", "locale", ";", "if", "(", "planguage", "==", "null", ")", "{", "locale", "=", "null", ";", "}", "else", "{", "final", "String", "loca...
convert language string to Locale. @param planguage string with language value @return Locale for the language
[ "convert", "language", "string", "to", "Locale", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/LocaleUtil.java#L53-L74
train
ddf-project/DDF
core/src/main/java/io/ddf/util/Utils.java
Utils.locateDirectory
public static String locateDirectory(String dirName) throws IOException { if (Utils.dirExists(dirName)) return dirName; String path = null; String curDir = new File(".").getCanonicalPath(); // Go for at most 10 levels up for (int i = 0; i < 10; i++) { path = String.format("%s/%s", curDir, dirName); if (Utils.dirExists(path)) break; curDir = String.format("%s/..", curDir); } if (path != null) { File file = new File(path); path = file.getCanonicalPath(); if (!Utils.dirExists(path)) path = null; } return path; }
java
public static String locateDirectory(String dirName) throws IOException { if (Utils.dirExists(dirName)) return dirName; String path = null; String curDir = new File(".").getCanonicalPath(); // Go for at most 10 levels up for (int i = 0; i < 10; i++) { path = String.format("%s/%s", curDir, dirName); if (Utils.dirExists(path)) break; curDir = String.format("%s/..", curDir); } if (path != null) { File file = new File(path); path = file.getCanonicalPath(); if (!Utils.dirExists(path)) path = null; } return path; }
[ "public", "static", "String", "locateDirectory", "(", "String", "dirName", ")", "throws", "IOException", "{", "if", "(", "Utils", ".", "dirExists", "(", "dirName", ")", ")", "return", "dirName", ";", "String", "path", "=", "null", ";", "String", "curDir", ...
Locates the given dirName as a full path, in the current directory or in successively higher parent directory above. @param dirName @return @throws IOException
[ "Locates", "the", "given", "dirName", "as", "a", "full", "path", "in", "the", "current", "directory", "or", "in", "successively", "higher", "parent", "directory", "above", "." ]
e4e68315dcec1ed8b287bf1ee73baa88e7e41eba
https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/util/Utils.java#L114-L135
train
ManfredTremmel/gwt-bean-validators
mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/IbanUtil.java
IbanUtil.getBankNumberOfIban
public static String getBankNumberOfIban(final String pstring) { final String compressedIban = ibanCompress(pstring); final String country = StringUtils.substring(compressedIban, 0, 2); final IbanLengthDefinition length = IBAN_LENGTH_MAP.ibanLengths().get(country); return length == null ? null : StringUtils.substring(compressedIban, length.getBankNumberStart(), length.getBankNumberEnd()); }
java
public static String getBankNumberOfIban(final String pstring) { final String compressedIban = ibanCompress(pstring); final String country = StringUtils.substring(compressedIban, 0, 2); final IbanLengthDefinition length = IBAN_LENGTH_MAP.ibanLengths().get(country); return length == null ? null : StringUtils.substring(compressedIban, length.getBankNumberStart(), length.getBankNumberEnd()); }
[ "public", "static", "String", "getBankNumberOfIban", "(", "final", "String", "pstring", ")", "{", "final", "String", "compressedIban", "=", "ibanCompress", "(", "pstring", ")", ";", "final", "String", "country", "=", "StringUtils", ".", "substring", "(", "compre...
get bank number of iban. @param pstring string with iban @return bank number
[ "get", "bank", "number", "of", "iban", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/IbanUtil.java#L123-L130
train
ManfredTremmel/gwt-bean-validators
mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/IbanUtil.java
IbanUtil.getAccountNumberOfIban
public static String getAccountNumberOfIban(final String pstring) { final String compressedIban = ibanCompress(pstring); final String country = StringUtils.substring(compressedIban, 0, 2); final IbanLengthDefinition length = IBAN_LENGTH_MAP.ibanLengths().get(country); return length == null ? null : StringUtils.substring(compressedIban, length.getAccountNumberStart(), length.getAccountNumberEnd()); }
java
public static String getAccountNumberOfIban(final String pstring) { final String compressedIban = ibanCompress(pstring); final String country = StringUtils.substring(compressedIban, 0, 2); final IbanLengthDefinition length = IBAN_LENGTH_MAP.ibanLengths().get(country); return length == null ? null : StringUtils.substring(compressedIban, length.getAccountNumberStart(), length.getAccountNumberEnd()); }
[ "public", "static", "String", "getAccountNumberOfIban", "(", "final", "String", "pstring", ")", "{", "final", "String", "compressedIban", "=", "ibanCompress", "(", "pstring", ")", ";", "final", "String", "country", "=", "StringUtils", ".", "substring", "(", "com...
get account number of iban. @param pstring string with iban @return account number
[ "get", "account", "number", "of", "iban", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/IbanUtil.java#L138-L145
train
ManfredTremmel/gwt-bean-validators
mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/IbanUtil.java
IbanUtil.getBicOfIban
public static String getBicOfIban(final String pstring) { final String country = StringUtils.substring(pstring, 0, 2); final String bankNumber = getBankNumberOfIban(pstring); return BANK_ACCOINT_BIC_MAP.bankAccounts().get(new CountryBankAccountData(country, bankNumber)); }
java
public static String getBicOfIban(final String pstring) { final String country = StringUtils.substring(pstring, 0, 2); final String bankNumber = getBankNumberOfIban(pstring); return BANK_ACCOINT_BIC_MAP.bankAccounts().get(new CountryBankAccountData(country, bankNumber)); }
[ "public", "static", "String", "getBicOfIban", "(", "final", "String", "pstring", ")", "{", "final", "String", "country", "=", "StringUtils", ".", "substring", "(", "pstring", ",", "0", ",", "2", ")", ";", "final", "String", "bankNumber", "=", "getBankNumberO...
get bic of iban. @param pstring string with iban @return bic
[ "get", "bic", "of", "iban", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/util/IbanUtil.java#L153-L157
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/java/net/URLClassLoader.java
URLClassLoader.addURL
protected void addURL(final URL url) { final URL[] newUrls = new URL[this.urls.length + 1]; System.arraycopy(url, 0, newUrls, 0, this.urls.length); newUrls[this.urls.length] = url; this.urls = newUrls; }
java
protected void addURL(final URL url) { final URL[] newUrls = new URL[this.urls.length + 1]; System.arraycopy(url, 0, newUrls, 0, this.urls.length); newUrls[this.urls.length] = url; this.urls = newUrls; }
[ "protected", "void", "addURL", "(", "final", "URL", "url", ")", "{", "final", "URL", "[", "]", "newUrls", "=", "new", "URL", "[", "this", ".", "urls", ".", "length", "+", "1", "]", ";", "System", ".", "arraycopy", "(", "url", ",", "0", ",", "newU...
Included here so attempts at reflection succeed
[ "Included", "here", "so", "attempts", "at", "reflection", "succeed" ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/java/net/URLClassLoader.java#L30-L35
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/GwtSpecificValidatorCreator.java
GwtSpecificValidatorCreator.asLiteral
public static String asLiteral(final Object value) throws IllegalArgumentException { final Class<?> clazz = value.getClass(); if (clazz.isArray()) { final StringBuilder sb = new StringBuilder(); final Object[] array = (Object[]) value; sb.append("new " + clazz.getComponentType().getCanonicalName() + "[] {"); boolean first = true; for (final Object object : array) { if (first) { first = false; } else { sb.append(','); } sb.append(asLiteral(object)); } sb.append('}'); return sb.toString(); } if (value instanceof Boolean) { return JBooleanLiteral.get(((Boolean) value).booleanValue()).toSource(); } else if (value instanceof Byte) { return JIntLiteral.get(((Byte) value).byteValue()).toSource(); } else if (value instanceof Character) { return JCharLiteral.get(((Character) value).charValue()).toSource(); } else if (value instanceof Class<?>) { return ((Class<?>) (Class<?>) value).getCanonicalName() + ".class"; } else if (value instanceof Double) { return JDoubleLiteral.get(((Double) value).doubleValue()).toSource(); } else if (value instanceof Enum) { return value.getClass().getCanonicalName() + "." + ((Enum<?>) value).name(); } else if (value instanceof Float) { return JFloatLiteral.get(((Float) value).floatValue()).toSource(); } else if (value instanceof Integer) { return JIntLiteral.get(((Integer) value).intValue()).toSource(); } else if (value instanceof Long) { return JLongLiteral.get(((Long) value).longValue()).toSource(); } else if (value instanceof String) { return '"' + Generator.escape((String) value) + '"'; } else { // TODO(nchalko) handle Annotation types throw new IllegalArgumentException( value.getClass() + " can not be represented as a Java Literal."); } }
java
public static String asLiteral(final Object value) throws IllegalArgumentException { final Class<?> clazz = value.getClass(); if (clazz.isArray()) { final StringBuilder sb = new StringBuilder(); final Object[] array = (Object[]) value; sb.append("new " + clazz.getComponentType().getCanonicalName() + "[] {"); boolean first = true; for (final Object object : array) { if (first) { first = false; } else { sb.append(','); } sb.append(asLiteral(object)); } sb.append('}'); return sb.toString(); } if (value instanceof Boolean) { return JBooleanLiteral.get(((Boolean) value).booleanValue()).toSource(); } else if (value instanceof Byte) { return JIntLiteral.get(((Byte) value).byteValue()).toSource(); } else if (value instanceof Character) { return JCharLiteral.get(((Character) value).charValue()).toSource(); } else if (value instanceof Class<?>) { return ((Class<?>) (Class<?>) value).getCanonicalName() + ".class"; } else if (value instanceof Double) { return JDoubleLiteral.get(((Double) value).doubleValue()).toSource(); } else if (value instanceof Enum) { return value.getClass().getCanonicalName() + "." + ((Enum<?>) value).name(); } else if (value instanceof Float) { return JFloatLiteral.get(((Float) value).floatValue()).toSource(); } else if (value instanceof Integer) { return JIntLiteral.get(((Integer) value).intValue()).toSource(); } else if (value instanceof Long) { return JLongLiteral.get(((Long) value).longValue()).toSource(); } else if (value instanceof String) { return '"' + Generator.escape((String) value) + '"'; } else { // TODO(nchalko) handle Annotation types throw new IllegalArgumentException( value.getClass() + " can not be represented as a Java Literal."); } }
[ "public", "static", "String", "asLiteral", "(", "final", "Object", "value", ")", "throws", "IllegalArgumentException", "{", "final", "Class", "<", "?", ">", "clazz", "=", "value", ".", "getClass", "(", ")", ";", "if", "(", "clazz", ".", "isArray", "(", "...
Returns the literal value of an object that is suitable for inclusion in Java Source code. <p> Supports all types that {@link Annotation} value can have. </p> @param value the object to handle @return string of the literal @throws IllegalArgumentException if the type of the object does not have a java literal form.
[ "Returns", "the", "literal", "value", "of", "an", "object", "that", "is", "suitable", "for", "inclusion", "in", "Java", "Source", "code", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/GwtSpecificValidatorCreator.java#L137-L183
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/GwtSpecificValidatorCreator.java
GwtSpecificValidatorCreator.isIterableOrMap
public static boolean isIterableOrMap(final Class<?> elementClass) { // TODO(nchalko) handle iterables everywhere this is called. return elementClass.isArray() || Iterable.class.isAssignableFrom(elementClass) || Map.class.isAssignableFrom(elementClass); }
java
public static boolean isIterableOrMap(final Class<?> elementClass) { // TODO(nchalko) handle iterables everywhere this is called. return elementClass.isArray() || Iterable.class.isAssignableFrom(elementClass) || Map.class.isAssignableFrom(elementClass); }
[ "public", "static", "boolean", "isIterableOrMap", "(", "final", "Class", "<", "?", ">", "elementClass", ")", "{", "// TODO(nchalko) handle iterables everywhere this is called.", "return", "elementClass", ".", "isArray", "(", ")", "||", "Iterable", ".", "class", ".", ...
check if elementClass is iterable. @param elementClass class to check @return true if iterable, otherwise false
[ "check", "if", "elementClass", "is", "iterable", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/GwtSpecificValidatorCreator.java#L191-L195
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/GwtSpecificValidatorCreator.java
GwtSpecificValidatorCreator.getTypeOfConstraintValidator
static <T extends Annotation> Class<?> getTypeOfConstraintValidator( final Class<? extends ConstraintValidator<T, ?>> constraintClass) { int candidateCount = 0; Class<?> result = null; for (final Method method : constraintClass.getMethods()) { if (method.getName().equals("isValid") && method.getParameterTypes().length == 2 && method.getReturnType().isAssignableFrom(Boolean.TYPE)) { final Class<?> firstArgType = method.getParameterTypes()[0]; if (result == null || result.isAssignableFrom(firstArgType)) { result = firstArgType; } candidateCount++; } } if (candidateCount == 0) { throw new IllegalStateException("ConstraintValidators must have a isValid method"); } else if (candidateCount > 2) { throw new IllegalStateException( "ConstraintValidators must have no more than two isValid methods"); } return result; }
java
static <T extends Annotation> Class<?> getTypeOfConstraintValidator( final Class<? extends ConstraintValidator<T, ?>> constraintClass) { int candidateCount = 0; Class<?> result = null; for (final Method method : constraintClass.getMethods()) { if (method.getName().equals("isValid") && method.getParameterTypes().length == 2 && method.getReturnType().isAssignableFrom(Boolean.TYPE)) { final Class<?> firstArgType = method.getParameterTypes()[0]; if (result == null || result.isAssignableFrom(firstArgType)) { result = firstArgType; } candidateCount++; } } if (candidateCount == 0) { throw new IllegalStateException("ConstraintValidators must have a isValid method"); } else if (candidateCount > 2) { throw new IllegalStateException( "ConstraintValidators must have no more than two isValid methods"); } return result; }
[ "static", "<", "T", "extends", "Annotation", ">", "Class", "<", "?", ">", "getTypeOfConstraintValidator", "(", "final", "Class", "<", "?", "extends", "ConstraintValidator", "<", "T", ",", "?", ">", ">", "constraintClass", ")", "{", "int", "candidateCount", "...
Finds the type that a constraint validator will check. <p> This type comes from the first parameter of the isValid() method on the constraint validator. However, this is a bit tricky because ConstraintValidator has a parameterized type. When using Java reflection, we will see multiple isValid() methods, including one that checks java.lang.Object. </p> <p> Strategy: for now, assume there are at most two isValid() methods. If there are two, assume one of them has a type that is assignable from the other. (Most likely, one of them will be java.lang.Object.) </p> @throws IllegalStateException if there isn't any isValid() method or there are more than two.
[ "Finds", "the", "type", "that", "a", "constraint", "validator", "will", "check", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/GwtSpecificValidatorCreator.java#L215-L239
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/GwtSpecificValidatorCreator.java
GwtSpecificValidatorCreator.writeValidatorCall
private void writeValidatorCall(final SourceWriter sw, final Class<?> type, final Stage stage, final PropertyDescriptor ppropertyDescription, final boolean expandDefaultGroupSequence, final String groupsVarName) throws UnableToCompleteException { if (cache.isClassConstrained(type) && !isIterableOrMap(type)) { final BeanHelper helper = this.createBeanHelper(type); beansToValidate.add(helper); switch (stage) { case OBJECT: // myValidator sw.print(helper.getValidatorInstanceName()); if (expandDefaultGroupSequence) { // .expandDefaultAndValidateClassGroups(context,object,violations,groups); sw.println(".expandDefaultAndValidateClassGroups(context, object, violations, " + groupsVarName + ");"); } else { // .validateClassGroups(context,object,violations,groups); sw.println(".validateClassGroups(context, object, violations, " + groupsVarName + ");"); } break; case PROPERTY: if (this.isPropertyConstrained(helper, ppropertyDescription)) { // myValidator.validatePropertyGroups(context,object // ,propertyName, violations, groups); sw.print(helper.getValidatorInstanceName()); sw.print(".validatePropertyGroups(context, object,"); sw.println(" propertyName, violations, " + groupsVarName + ");"); } break; case VALUE: if (this.isPropertyConstrained(helper, ppropertyDescription)) { // myValidator.validateValueGroups(context,beanType // ,propertyName, value, violations, groups); sw.print(helper.getValidatorInstanceName()); sw.print(".validateValueGroups(context, "); sw.print(helper.getTypeCanonicalName()); sw.println(".class, propertyName, value, violations, " + groupsVarName + ");"); } break; default: throw new IllegalStateException(); } } }
java
private void writeValidatorCall(final SourceWriter sw, final Class<?> type, final Stage stage, final PropertyDescriptor ppropertyDescription, final boolean expandDefaultGroupSequence, final String groupsVarName) throws UnableToCompleteException { if (cache.isClassConstrained(type) && !isIterableOrMap(type)) { final BeanHelper helper = this.createBeanHelper(type); beansToValidate.add(helper); switch (stage) { case OBJECT: // myValidator sw.print(helper.getValidatorInstanceName()); if (expandDefaultGroupSequence) { // .expandDefaultAndValidateClassGroups(context,object,violations,groups); sw.println(".expandDefaultAndValidateClassGroups(context, object, violations, " + groupsVarName + ");"); } else { // .validateClassGroups(context,object,violations,groups); sw.println(".validateClassGroups(context, object, violations, " + groupsVarName + ");"); } break; case PROPERTY: if (this.isPropertyConstrained(helper, ppropertyDescription)) { // myValidator.validatePropertyGroups(context,object // ,propertyName, violations, groups); sw.print(helper.getValidatorInstanceName()); sw.print(".validatePropertyGroups(context, object,"); sw.println(" propertyName, violations, " + groupsVarName + ");"); } break; case VALUE: if (this.isPropertyConstrained(helper, ppropertyDescription)) { // myValidator.validateValueGroups(context,beanType // ,propertyName, value, violations, groups); sw.print(helper.getValidatorInstanceName()); sw.print(".validateValueGroups(context, "); sw.print(helper.getTypeCanonicalName()); sw.println(".class, propertyName, value, violations, " + groupsVarName + ");"); } break; default: throw new IllegalStateException(); } } }
[ "private", "void", "writeValidatorCall", "(", "final", "SourceWriter", "sw", ",", "final", "Class", "<", "?", ">", "type", ",", "final", "Stage", "stage", ",", "final", "PropertyDescriptor", "ppropertyDescription", ",", "final", "boolean", "expandDefaultGroupSequenc...
write validator call. @param ppropertyDescription Only used if writing a call to validate a property - otherwise can be null. @param expandDefaultGroupSequence Only used if writing a call to validate a bean. @param groupsVarName The name of the variable containing the groups.
[ "write", "validator", "call", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/rebind/GwtSpecificValidatorCreator.java#L2044-L2086
train
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/ObjectUtils.java
ObjectUtils.containsElement
public static boolean containsElement(@Nullable final Object[] array, final Object element) { if (array == null) { return false; } for (final Object arrayEle : array) { if (ObjectUtils.nullSafeEquals(arrayEle, element)) { return true; } } return false; }
java
public static boolean containsElement(@Nullable final Object[] array, final Object element) { if (array == null) { return false; } for (final Object arrayEle : array) { if (ObjectUtils.nullSafeEquals(arrayEle, element)) { return true; } } return false; }
[ "public", "static", "boolean", "containsElement", "(", "@", "Nullable", "final", "Object", "[", "]", "array", ",", "final", "Object", "element", ")", "{", "if", "(", "array", "==", "null", ")", "{", "return", "false", ";", "}", "for", "(", "final", "Ob...
Check whether the given array contains the given element. @param array the array to check (may be {@code null}, in which case the return value will always be {@code false}) @param element the element to check for @return whether the element has been found in the given array
[ "Check", "whether", "the", "given", "array", "contains", "the", "given", "element", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/ObjectUtils.java#L198-L208
train
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/ObjectUtils.java
ObjectUtils.containsConstant
public static boolean containsConstant(final Enum<?>[] enumValues, final String constant) { return ObjectUtils.containsConstant(enumValues, constant, false); }
java
public static boolean containsConstant(final Enum<?>[] enumValues, final String constant) { return ObjectUtils.containsConstant(enumValues, constant, false); }
[ "public", "static", "boolean", "containsConstant", "(", "final", "Enum", "<", "?", ">", "[", "]", "enumValues", ",", "final", "String", "constant", ")", "{", "return", "ObjectUtils", ".", "containsConstant", "(", "enumValues", ",", "constant", ",", "false", ...
Check whether the given array of enum constants contains a constant with the given name, ignoring case when determining a match. @param enumValues the enum values to check, typically the product of a call to MyEnum.values() @param constant the constant name to find (must not be null or empty string) @return whether the constant has been found in the given array
[ "Check", "whether", "the", "given", "array", "of", "enum", "constants", "contains", "a", "constant", "with", "the", "given", "name", "ignoring", "case", "when", "determining", "a", "match", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/ObjectUtils.java#L218-L220
train
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/ObjectUtils.java
ObjectUtils.containsConstant
public static boolean containsConstant(final Enum<?>[] enumValues, final String constant, final boolean caseSensitive) { for (final Enum<?> candidate : enumValues) { if (caseSensitive ? candidate.toString().equals(constant) : candidate.toString().equalsIgnoreCase(constant)) { return true; } } return false; }
java
public static boolean containsConstant(final Enum<?>[] enumValues, final String constant, final boolean caseSensitive) { for (final Enum<?> candidate : enumValues) { if (caseSensitive ? candidate.toString().equals(constant) : candidate.toString().equalsIgnoreCase(constant)) { return true; } } return false; }
[ "public", "static", "boolean", "containsConstant", "(", "final", "Enum", "<", "?", ">", "[", "]", "enumValues", ",", "final", "String", "constant", ",", "final", "boolean", "caseSensitive", ")", "{", "for", "(", "final", "Enum", "<", "?", ">", "candidate",...
Check whether the given array of enum constants contains a constant with the given name. @param enumValues the enum values to check, typically the product of a call to MyEnum.values() @param constant the constant name to find (must not be null or empty string) @param caseSensitive whether case is significant in determining a match @return whether the constant has been found in the given array
[ "Check", "whether", "the", "given", "array", "of", "enum", "constants", "contains", "a", "constant", "with", "the", "given", "name", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/ObjectUtils.java#L230-L239
train
ddf-project/DDF
core/src/main/java/io/ddf/content/Schema.java
Schema.removeColumn
public boolean removeColumn(String name) { if (getColumnIndex(name) < 0) return false; this.mColumns.remove(getColumnIndex(name)); return true; }
java
public boolean removeColumn(String name) { if (getColumnIndex(name) < 0) return false; this.mColumns.remove(getColumnIndex(name)); return true; }
[ "public", "boolean", "removeColumn", "(", "String", "name", ")", "{", "if", "(", "getColumnIndex", "(", "name", ")", "<", "0", ")", "return", "false", ";", "this", ".", "mColumns", ".", "remove", "(", "getColumnIndex", "(", "name", ")", ")", ";", "retu...
Remove a column by its name @param name Column name @return true if succeed
[ "Remove", "a", "column", "by", "its", "name" ]
e4e68315dcec1ed8b287bf1ee73baa88e7e41eba
https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/content/Schema.java#L268-L273
train
ddf-project/DDF
core/src/main/java/io/ddf/content/Schema.java
Schema.removeColumn
public boolean removeColumn(int i) { if (getColumn(i) == null) return false; this.mColumns.remove(i); return true; }
java
public boolean removeColumn(int i) { if (getColumn(i) == null) return false; this.mColumns.remove(i); return true; }
[ "public", "boolean", "removeColumn", "(", "int", "i", ")", "{", "if", "(", "getColumn", "(", "i", ")", "==", "null", ")", "return", "false", ";", "this", ".", "mColumns", ".", "remove", "(", "i", ")", ";", "return", "true", ";", "}" ]
Remove a column by its index @param i Column index @return true if succeed
[ "Remove", "a", "column", "by", "its", "index" ]
e4e68315dcec1ed8b287bf1ee73baa88e7e41eba
https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/content/Schema.java#L281-L286
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/decorators/AbstractDecoratorWithLabel.java
AbstractDecoratorWithLabel.setChildLabel
@UiChild(limit = 1, tagname = "label") public void setChildLabel(final Widget plabel) { label = plabel; getLayout().add(label); }
java
@UiChild(limit = 1, tagname = "label") public void setChildLabel(final Widget plabel) { label = plabel; getLayout().add(label); }
[ "@", "UiChild", "(", "limit", "=", "1", ",", "tagname", "=", "\"label\"", ")", "public", "void", "setChildLabel", "(", "final", "Widget", "plabel", ")", "{", "label", "=", "plabel", ";", "getLayout", "(", ")", ".", "add", "(", "label", ")", ";", "}" ...
Set the label of widget. @param plabel a label widget
[ "Set", "the", "label", "of", "widget", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/decorators/AbstractDecoratorWithLabel.java#L74-L78
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/editor/impl/ListValidationEditor.java
ListValidationEditor.of
public static <T, E extends Editor<? super T>> ListValidationEditor<T, E> of( // NOPMD final EditorSource<E> source) { return new ListValidationEditor<>(source); }
java
public static <T, E extends Editor<? super T>> ListValidationEditor<T, E> of( // NOPMD final EditorSource<E> source) { return new ListValidationEditor<>(source); }
[ "public", "static", "<", "T", ",", "E", "extends", "Editor", "<", "?", "super", "T", ">", ">", "ListValidationEditor", "<", "T", ",", "E", ">", "of", "(", "// NOPMD", "final", "EditorSource", "<", "E", ">", "source", ")", "{", "return", "new", "ListV...
Create a ListEditor backed by an EditorSource. @param <T> The type of data being managed @param <E> The type of Editor @param source the EditorSource which will create sub-Editors @return a new instance of ListEditor
[ "Create", "a", "ListEditor", "backed", "by", "an", "EditorSource", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/editor/impl/ListValidationEditor.java#L56-L59
train
shillner/maven-cdi-plugin-utils
src/main/java/com/itemis/maven/plugins/cdi/internal/util/CDIUtil.java
CDIUtil.getAllBeansOfType
public static <T> Collection<T> getAllBeansOfType(WeldContainer weldContainer, Class<T> type) { Collection<T> beans = Lists.newArrayList(); Set<Bean<?>> cdiBeans = weldContainer.getBeanManager().getBeans(type, AnyLiteral.INSTANCE); // searches all beans for beans that have the matching goal name, ... for (Bean<?> b : cdiBeans) { @SuppressWarnings("unchecked") Bean<T> b2 = (Bean<T>) b; CreationalContext<T> creationalContext = weldContainer.getBeanManager().createCreationalContext(b2); T bean = b2.create(creationalContext); beans.add(bean); } return beans; }
java
public static <T> Collection<T> getAllBeansOfType(WeldContainer weldContainer, Class<T> type) { Collection<T> beans = Lists.newArrayList(); Set<Bean<?>> cdiBeans = weldContainer.getBeanManager().getBeans(type, AnyLiteral.INSTANCE); // searches all beans for beans that have the matching goal name, ... for (Bean<?> b : cdiBeans) { @SuppressWarnings("unchecked") Bean<T> b2 = (Bean<T>) b; CreationalContext<T> creationalContext = weldContainer.getBeanManager().createCreationalContext(b2); T bean = b2.create(creationalContext); beans.add(bean); } return beans; }
[ "public", "static", "<", "T", ">", "Collection", "<", "T", ">", "getAllBeansOfType", "(", "WeldContainer", "weldContainer", ",", "Class", "<", "T", ">", "type", ")", "{", "Collection", "<", "T", ">", "beans", "=", "Lists", ".", "newArrayList", "(", ")", ...
Searches the container for all beans of a certain type without respecting qualifiers. @param weldContainer the container providing the beans. @param type the type of the beans to search for. @return a collection of all found beans of the specified type.
[ "Searches", "the", "container", "for", "all", "beans", "of", "a", "certain", "type", "without", "respecting", "qualifiers", "." ]
61b7f3ce9a198bde80d690ce23e384b7c195a13d
https://github.com/shillner/maven-cdi-plugin-utils/blob/61b7f3ce9a198bde80d690ce23e384b7c195a13d/src/main/java/com/itemis/maven/plugins/cdi/internal/util/CDIUtil.java#L63-L75
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/java/org/hibernate/validator/engine/PathImpl_CustomFieldSerializer.java
PathImpl_CustomFieldSerializer.instantiate
public static PathImpl instantiate(final SerializationStreamReader streamReader) throws SerializationException { final String propertyPath = streamReader.readString(); return PathImpl.createPathFromString(propertyPath); }
java
public static PathImpl instantiate(final SerializationStreamReader streamReader) throws SerializationException { final String propertyPath = streamReader.readString(); return PathImpl.createPathFromString(propertyPath); }
[ "public", "static", "PathImpl", "instantiate", "(", "final", "SerializationStreamReader", "streamReader", ")", "throws", "SerializationException", "{", "final", "String", "propertyPath", "=", "streamReader", ".", "readString", "(", ")", ";", "return", "PathImpl", ".",...
instantiate a path implementation. @param streamReader serialization stream reader @return path implementation @throws SerializationException when deserialization fails
[ "instantiate", "a", "path", "implementation", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/org/hibernate/validator/engine/PathImpl_CustomFieldSerializer.java#L42-L47
train
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/StringUtils.java
StringUtils.delete
public static String delete(final String inString, final String pattern) { return StringUtils.replace(inString, pattern, ""); }
java
public static String delete(final String inString, final String pattern) { return StringUtils.replace(inString, pattern, ""); }
[ "public", "static", "String", "delete", "(", "final", "String", "inString", ",", "final", "String", "pattern", ")", "{", "return", "StringUtils", ".", "replace", "(", "inString", ",", "pattern", ",", "\"\"", ")", ";", "}" ]
Delete all occurrences of the given substring. @param inString the original {@code String} @param pattern the pattern to delete all occurrences of @return the resulting {@code String}
[ "Delete", "all", "occurrences", "of", "the", "given", "substring", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/StringUtils.java#L456-L458
train
ManfredTremmel/gwt-bean-validators
gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/InputLabel.java
InputLabel.setFor
public void setFor(final IsWidget target) { if (init) { return; } init = true; // final InputElement input = getInputElement(target.asWidget()); if (input != null) { if (!input.hasAttribute("id")) { input.setId(DOM.createUniqueId()); } getElement().setAttribute("for", input.getId()); } }
java
public void setFor(final IsWidget target) { if (init) { return; } init = true; // final InputElement input = getInputElement(target.asWidget()); if (input != null) { if (!input.hasAttribute("id")) { input.setId(DOM.createUniqueId()); } getElement().setAttribute("for", input.getId()); } }
[ "public", "void", "setFor", "(", "final", "IsWidget", "target", ")", "{", "if", "(", "init", ")", "{", "return", ";", "}", "init", "=", "true", ";", "//", "final", "InputElement", "input", "=", "getInputElement", "(", "target", ".", "asWidget", "(", ")...
set widget to reference to. @param target reference field
[ "set", "widget", "to", "reference", "to", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/InputLabel.java#L95-L109
train
jpmml/jpmml-cascading
pmml-cascading/src/main/java/org/jpmml/cascading/PMMLPlanner.java
PMMLPlanner.setRetainOnlyActiveFields
public PMMLPlanner setRetainOnlyActiveFields(){ Evaluator evaluator = getEvaluator(); Fields incomingFields = new Fields() .append(FieldsUtil.getActiveFields(evaluator)) .append(FieldsUtil.getGroupFields(evaluator)); return setRetainedFields(incomingFields); }
java
public PMMLPlanner setRetainOnlyActiveFields(){ Evaluator evaluator = getEvaluator(); Fields incomingFields = new Fields() .append(FieldsUtil.getActiveFields(evaluator)) .append(FieldsUtil.getGroupFields(evaluator)); return setRetainedFields(incomingFields); }
[ "public", "PMMLPlanner", "setRetainOnlyActiveFields", "(", ")", "{", "Evaluator", "evaluator", "=", "getEvaluator", "(", ")", ";", "Fields", "incomingFields", "=", "new", "Fields", "(", ")", ".", "append", "(", "FieldsUtil", ".", "getActiveFields", "(", "evaluat...
Orders the retention of only those incoming fields that represent PMML function argument fields. @see #setRetainedFields(Fields)
[ "Orders", "the", "retention", "of", "only", "those", "incoming", "fields", "that", "represent", "PMML", "function", "argument", "fields", "." ]
9ba38ddfa132f517cf0a09ea5e2a9470024f312b
https://github.com/jpmml/jpmml-cascading/blob/9ba38ddfa132f517cf0a09ea5e2a9470024f312b/pmml-cascading/src/main/java/org/jpmml/cascading/PMMLPlanner.java#L235-L243
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/impl/ConstraintValidatorContextImpl.java
ConstraintValidatorContextImpl.getMessageAndPaths
public Set<MessageAndPath> getMessageAndPaths() { if (!this.disableDefault) { this.messages .add(new MessageAndPath(this.basePath, this.getDefaultConstraintMessageTemplate())); } return this.messages; }
java
public Set<MessageAndPath> getMessageAndPaths() { if (!this.disableDefault) { this.messages .add(new MessageAndPath(this.basePath, this.getDefaultConstraintMessageTemplate())); } return this.messages; }
[ "public", "Set", "<", "MessageAndPath", ">", "getMessageAndPaths", "(", ")", "{", "if", "(", "!", "this", ".", "disableDefault", ")", "{", "this", ".", "messages", ".", "add", "(", "new", "MessageAndPath", "(", "this", ".", "basePath", ",", "this", ".", ...
getter for message and path. @return set which includes message and path
[ "getter", "for", "message", "and", "path", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/impl/ConstraintValidatorContextImpl.java#L346-L352
train
ManfredTremmel/gwt-bean-validators
gwtp-dynamic-navigation/src/main/java/com/gwtplatform/mvp/shared/proxy/OwnRouteTokenFormatter.java
OwnRouteTokenFormatter.parseQueryString
Map<String, String> parseQueryString(final String queryString, final Map<String, String> into) { final Map<String, String> result = (into == null) ? new HashMap<>() : into; if (StringUtils.isNotEmpty(queryString)) { for (final String keyValuePair : queryString.split("&")) { final String[] keyValue = keyValuePair.split("=", 2); if (keyValue.length > 1) { result.put(keyValue[0], urlUtils.decodeQueryString(keyValue[1])); } else { result.put(keyValue[0], StringUtils.EMPTY); } } } return result; }
java
Map<String, String> parseQueryString(final String queryString, final Map<String, String> into) { final Map<String, String> result = (into == null) ? new HashMap<>() : into; if (StringUtils.isNotEmpty(queryString)) { for (final String keyValuePair : queryString.split("&")) { final String[] keyValue = keyValuePair.split("=", 2); if (keyValue.length > 1) { result.put(keyValue[0], urlUtils.decodeQueryString(keyValue[1])); } else { result.put(keyValue[0], StringUtils.EMPTY); } } } return result; }
[ "Map", "<", "String", ",", "String", ">", "parseQueryString", "(", "final", "String", "queryString", ",", "final", "Map", "<", "String", ",", "String", ">", "into", ")", "{", "final", "Map", "<", "String", ",", "String", ">", "result", "=", "(", "into"...
Parse the given query-string and store all parameters into a map. @param queryString The query-string. @param into The map to use. If the given map is <code>null</code> a new map will be created. @return A map containing all keys value pairs of the query-string.
[ "Parse", "the", "given", "query", "-", "string", "and", "store", "all", "parameters", "into", "a", "map", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-dynamic-navigation/src/main/java/com/gwtplatform/mvp/shared/proxy/OwnRouteTokenFormatter.java#L305-L320
train
ManfredTremmel/gwt-bean-validators
gwtp-dynamic-navigation/src/main/java/de/knightsoftnet/navigation/client/version/AbstractVersionInfo.java
AbstractVersionInfo.parseAndFormatDate
protected final String parseAndFormatDate(final String pversionDate) { Date date; if (StringUtils.isEmpty(pversionDate)) { date = new Date(); } else { try { date = versionDateFormat.parse(pversionDate); } catch (final IllegalArgumentException e) { date = new Date(); } } return dateFormatDisplay.format(date); }
java
protected final String parseAndFormatDate(final String pversionDate) { Date date; if (StringUtils.isEmpty(pversionDate)) { date = new Date(); } else { try { date = versionDateFormat.parse(pversionDate); } catch (final IllegalArgumentException e) { date = new Date(); } } return dateFormatDisplay.format(date); }
[ "protected", "final", "String", "parseAndFormatDate", "(", "final", "String", "pversionDate", ")", "{", "Date", "date", ";", "if", "(", "StringUtils", ".", "isEmpty", "(", "pversionDate", ")", ")", "{", "date", "=", "new", "Date", "(", ")", ";", "}", "el...
parse and format a date string. @param pversionDate string with date in versionDateFormat @return the same date formated as dateFormatDisplay
[ "parse", "and", "format", "a", "date", "string", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-dynamic-navigation/src/main/java/de/knightsoftnet/navigation/client/version/AbstractVersionInfo.java#L56-L68
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators-restygwt-jaxrs/src/main/java/de/knightsoftnet/validators/client/rest/helper/FutureResult.java
FutureResult.get
public T get() throws IllegalStateException { switch (this.state) { case INCOMPLETE: // Do not block browser so just throw ex throw new IllegalStateException("The server response did not yet recieved."); case FAILED: throw new IllegalStateException(this.error); case SUCCEEDED: return this.value; default: throw new IllegalStateException("Something very unclear"); } }
java
public T get() throws IllegalStateException { switch (this.state) { case INCOMPLETE: // Do not block browser so just throw ex throw new IllegalStateException("The server response did not yet recieved."); case FAILED: throw new IllegalStateException(this.error); case SUCCEEDED: return this.value; default: throw new IllegalStateException("Something very unclear"); } }
[ "public", "T", "get", "(", ")", "throws", "IllegalStateException", "{", "switch", "(", "this", ".", "state", ")", "{", "case", "INCOMPLETE", ":", "// Do not block browser so just throw ex", "throw", "new", "IllegalStateException", "(", "\"The server response did not yet...
get result of the call. @return result of call @throws IllegalStateException if call isn't done.
[ "get", "result", "of", "the", "call", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators-restygwt-jaxrs/src/main/java/de/knightsoftnet/validators/client/rest/helper/FutureResult.java#L48-L60
train
ManfredTremmel/gwt-bean-validators
gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/helper/SuggestBoxValueBoxEditor.java
SuggestBoxValueBoxEditor.getTextBox
@Ignore public TextBoxBase getTextBox() { if (getTakesValues() instanceof SuggestBox) { return (TextBoxBase) ((SuggestBox) getTakesValues()).getValueBox(); } return null; }
java
@Ignore public TextBoxBase getTextBox() { if (getTakesValues() instanceof SuggestBox) { return (TextBoxBase) ((SuggestBox) getTakesValues()).getValueBox(); } return null; }
[ "@", "Ignore", "public", "TextBoxBase", "getTextBox", "(", ")", "{", "if", "(", "getTakesValues", "(", ")", "instanceof", "SuggestBox", ")", "{", "return", "(", "TextBoxBase", ")", "(", "(", "SuggestBox", ")", "getTakesValues", "(", ")", ")", ".", "getValu...
get text box. @return text box base of the widget
[ "get", "text", "box", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/helper/SuggestBoxValueBoxEditor.java#L21-L27
train
ManfredTremmel/gwt-bean-validators
gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/helper/SuggestBoxValueBoxEditor.java
SuggestBoxValueBoxEditor.getValueBox
@Ignore public ValueBoxBase<String> getValueBox() { if (getTakesValues() instanceof SuggestBox) { return ((SuggestBox) getTakesValues()).getValueBox(); } return null; }
java
@Ignore public ValueBoxBase<String> getValueBox() { if (getTakesValues() instanceof SuggestBox) { return ((SuggestBox) getTakesValues()).getValueBox(); } return null; }
[ "@", "Ignore", "public", "ValueBoxBase", "<", "String", ">", "getValueBox", "(", ")", "{", "if", "(", "getTakesValues", "(", ")", "instanceof", "SuggestBox", ")", "{", "return", "(", "(", "SuggestBox", ")", "getTakesValues", "(", ")", ")", ".", "getValueBo...
get value box base. @return value box base of the widget
[ "get", "value", "box", "base", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/helper/SuggestBoxValueBoxEditor.java#L34-L40
train
neoremind/navi
navi/src/main/java/com/baidu/beidou/navi/util/MethodUtil.java
MethodUtil.getArgsTypeNameArray
public static String[] getArgsTypeNameArray(Class<?>[] argsTypes) { String[] argsTypeArray = null; if (argsTypes != null) { argsTypeArray = new String[argsTypes.length]; for (int i = 0; i < argsTypes.length; i++) { argsTypeArray[i] = argsTypes[i].getName(); } } return argsTypeArray; }
java
public static String[] getArgsTypeNameArray(Class<?>[] argsTypes) { String[] argsTypeArray = null; if (argsTypes != null) { argsTypeArray = new String[argsTypes.length]; for (int i = 0; i < argsTypes.length; i++) { argsTypeArray[i] = argsTypes[i].getName(); } } return argsTypeArray; }
[ "public", "static", "String", "[", "]", "getArgsTypeNameArray", "(", "Class", "<", "?", ">", "[", "]", "argsTypes", ")", "{", "String", "[", "]", "argsTypeArray", "=", "null", ";", "if", "(", "argsTypes", "!=", "null", ")", "{", "argsTypeArray", "=", "...
Get parameter type name array from a method @param argsTypes @return
[ "Get", "parameter", "type", "name", "array", "from", "a", "method" ]
d37e4b46ef07d124be2740ad3d85d87e939acc84
https://github.com/neoremind/navi/blob/d37e4b46ef07d124be2740ad3d85d87e939acc84/navi/src/main/java/com/baidu/beidou/navi/util/MethodUtil.java#L39-L48
train
neoremind/navi
navi/src/main/java/com/baidu/beidou/navi/util/MethodUtil.java
MethodUtil.getArgsTypeName
public static String getArgsTypeName(String[] argTypes) { if (argTypes != null) { return StringUtil.join(argTypes, ','); } return StringUtil.EMPTY; }
java
public static String getArgsTypeName(String[] argTypes) { if (argTypes != null) { return StringUtil.join(argTypes, ','); } return StringUtil.EMPTY; }
[ "public", "static", "String", "getArgsTypeName", "(", "String", "[", "]", "argTypes", ")", "{", "if", "(", "argTypes", "!=", "null", ")", "{", "return", "StringUtil", ".", "join", "(", "argTypes", ",", "'", "'", ")", ";", "}", "return", "StringUtil", "...
Get parameter type name string from a arg types string array @param argTypes @return
[ "Get", "parameter", "type", "name", "string", "from", "a", "arg", "types", "string", "array" ]
d37e4b46ef07d124be2740ad3d85d87e939acc84
https://github.com/neoremind/navi/blob/d37e4b46ef07d124be2740ad3d85d87e939acc84/navi/src/main/java/com/baidu/beidou/navi/util/MethodUtil.java#L56-L61
train
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/java/de/knightsoftnet/gwtp/spring/client/converter/ValidationResultDataConverter.java
ValidationResultDataConverter.convert
@SuppressWarnings("unchecked") public Iterable<ConstraintViolation<?>> convert(final ValidationResultInterface psource, final E pbean) { if (psource == null) { return null; } return psource.getValidationErrorSet().stream() .map(violation -> ConstraintViolationImpl.forBeanValidation( // null, // Collections.emptyMap(), // Collections.emptyMap(), // violation.getMessage(), // (Class<E>) (pbean == null ? null : pbean.getClass()), // pbean, // null, // null, // PathImpl.createPathFromString(violation.getPropertyPath()), // null, // null, // null)) .collect(Collectors.toList()); }
java
@SuppressWarnings("unchecked") public Iterable<ConstraintViolation<?>> convert(final ValidationResultInterface psource, final E pbean) { if (psource == null) { return null; } return psource.getValidationErrorSet().stream() .map(violation -> ConstraintViolationImpl.forBeanValidation( // null, // Collections.emptyMap(), // Collections.emptyMap(), // violation.getMessage(), // (Class<E>) (pbean == null ? null : pbean.getClass()), // pbean, // null, // null, // PathImpl.createPathFromString(violation.getPropertyPath()), // null, // null, // null)) .collect(Collectors.toList()); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "Iterable", "<", "ConstraintViolation", "<", "?", ">", ">", "convert", "(", "final", "ValidationResultInterface", "psource", ",", "final", "E", "pbean", ")", "{", "if", "(", "psource", "==", "null",...
convert ValidationResultData from server to a ArrayList&lt;ConstraintViolation&lt;?&gt;&gt; which can be handled by gwt. @param psource ValidationResultData to convert @param pbean the validated bean (which is not transfered back to client) @return ArrayList&lt;ConstraintViolation&lt;?&gt;&gt;
[ "convert", "ValidationResultData", "from", "server", "to", "a", "ArrayList&lt", ";", "ConstraintViolation&lt", ";", "?&gt", ";", "&gt", ";", "which", "can", "be", "handled", "by", "gwt", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/java/de/knightsoftnet/gwtp/spring/client/converter/ValidationResultDataConverter.java#L53-L74
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/messageinterpolation/util/InterpolationHelper.java
InterpolationHelper.escapeMessageParameter
public static String escapeMessageParameter(final String messageParameter) { if (messageParameter == null) { return null; } return ESCAPE_MESSAGE_PARAMETER_PATTERN.replace(messageParameter, String.valueOf(ESCAPE_CHARACTER) + "$1"); // NOPMD }
java
public static String escapeMessageParameter(final String messageParameter) { if (messageParameter == null) { return null; } return ESCAPE_MESSAGE_PARAMETER_PATTERN.replace(messageParameter, String.valueOf(ESCAPE_CHARACTER) + "$1"); // NOPMD }
[ "public", "static", "String", "escapeMessageParameter", "(", "final", "String", "messageParameter", ")", "{", "if", "(", "messageParameter", "==", "null", ")", "{", "return", "null", ";", "}", "return", "ESCAPE_MESSAGE_PARAMETER_PATTERN", ".", "replace", "(", "mes...
escape message parameter. @param messageParameter parameter to escape @return escaped string
[ "escape", "message", "parameter", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/messageinterpolation/util/InterpolationHelper.java#L35-L41
train
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/java/de/knightsoftnet/gwtp/spring/client/rest/helper/CachedSyncHttpGetCall.java
CachedSyncHttpGetCall.syncRestCall
public static String syncRestCall(final String purl) { try { return CACHE.get(purl); } catch (final ExecutionException e) { GWT.log(e.getMessage(), e); return null; } }
java
public static String syncRestCall(final String purl) { try { return CACHE.get(purl); } catch (final ExecutionException e) { GWT.log(e.getMessage(), e); return null; } }
[ "public", "static", "String", "syncRestCall", "(", "final", "String", "purl", ")", "{", "try", "{", "return", "CACHE", ".", "get", "(", "purl", ")", ";", "}", "catch", "(", "final", "ExecutionException", "e", ")", "{", "GWT", ".", "log", "(", "e", "....
start get rest call with given url. @param purl url to read @return result of the call, has to be interpreted
[ "start", "get", "rest", "call", "with", "given", "url", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/java/de/knightsoftnet/gwtp/spring/client/rest/helper/CachedSyncHttpGetCall.java#L61-L68
train
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/java/de/knightsoftnet/gwtp/spring/client/rest/helper/CachedSyncHttpGetCall.java
CachedSyncHttpGetCall.syncRestNativeCall
private static String syncRestNativeCall(final String purl) { final XMLHttpRequest xmlHttp = Browser.getWindow().newXMLHttpRequest(); xmlHttp.open("GET", purl, false); // false for synchronous request xmlHttp.send(); return xmlHttp.getResponseText(); }
java
private static String syncRestNativeCall(final String purl) { final XMLHttpRequest xmlHttp = Browser.getWindow().newXMLHttpRequest(); xmlHttp.open("GET", purl, false); // false for synchronous request xmlHttp.send(); return xmlHttp.getResponseText(); }
[ "private", "static", "String", "syncRestNativeCall", "(", "final", "String", "purl", ")", "{", "final", "XMLHttpRequest", "xmlHttp", "=", "Browser", ".", "getWindow", "(", ")", ".", "newXMLHttpRequest", "(", ")", ";", "xmlHttp", ".", "open", "(", "\"GET\"", ...
simple synchronous rest get call
[ "simple", "synchronous", "rest", "get", "call" ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/java/de/knightsoftnet/gwtp/spring/client/rest/helper/CachedSyncHttpGetCall.java#L71-L76
train
ddf-project/DDF
core/src/main/java/io/ddf/ml/MLSupporter.java
MLSupporter.train
@Override public IModel train(String trainMethodName, Object... paramArgs) throws DDFException { /** * Example signatures we must support: * <p/> * Unsupervised Training * <p/> * <code> * Kmeans.train(data: RDD[Array[Double]], k: Int, maxIterations: Int, runs: Int, initializationMode: String) * </code> * <p/> * Supervised Training * <p/> * <code> * LogisticRegressionWithSGD.train(input: RDD[LabeledPoint], numIterations: Int, stepSize: Double, miniBatchFraction: * Double, initialWeights: Array[Double]) * * SVM.train(input: RDD[LabeledPoint], numIterations: Int, stepSize: Double, regParam: Double, miniBatchFraction: * Double) * </code> */ // Build the argument type array if (paramArgs == null) paramArgs = new Object[0]; // Locate the training method String mappedName = Config.getValueWithGlobalDefault(this.getEngine(), trainMethodName); if (!Strings.isNullOrEmpty(mappedName)) trainMethodName = mappedName; TrainMethod trainMethod = new TrainMethod(trainMethodName, MLClassMethods.DEFAULT_TRAIN_METHOD_NAME, paramArgs); if (trainMethod.getMethod() == null) { throw new DDFException(String.format("Cannot locate method specified by %s", trainMethodName)); } // Now we need to map the DDF and its column specs to the input format expected by the method we're invoking Object[] allArgs = this.buildArgsForMethod(trainMethod.getMethod(), paramArgs); // Invoke the training method Object rawModel = trainMethod.classInvoke(allArgs); List<Schema.Column> columns = this.getDDF().getSchemaHandler().getColumns(); String[] trainedColumns = new String[columns.size()]; for (int i = 0; i < columns.size(); i++) { trainedColumns[i] = columns.get(i).getName(); } for (String col : trainedColumns) { mLog.info(">>>>>> trainedCol = " + col); } IModel model = this.newModel(rawModel); model.setTrainedColumns(trainedColumns); mLog.info(">>>> modelID = " + model.getName()); this.getManager().addModel(model); return model; }
java
@Override public IModel train(String trainMethodName, Object... paramArgs) throws DDFException { /** * Example signatures we must support: * <p/> * Unsupervised Training * <p/> * <code> * Kmeans.train(data: RDD[Array[Double]], k: Int, maxIterations: Int, runs: Int, initializationMode: String) * </code> * <p/> * Supervised Training * <p/> * <code> * LogisticRegressionWithSGD.train(input: RDD[LabeledPoint], numIterations: Int, stepSize: Double, miniBatchFraction: * Double, initialWeights: Array[Double]) * * SVM.train(input: RDD[LabeledPoint], numIterations: Int, stepSize: Double, regParam: Double, miniBatchFraction: * Double) * </code> */ // Build the argument type array if (paramArgs == null) paramArgs = new Object[0]; // Locate the training method String mappedName = Config.getValueWithGlobalDefault(this.getEngine(), trainMethodName); if (!Strings.isNullOrEmpty(mappedName)) trainMethodName = mappedName; TrainMethod trainMethod = new TrainMethod(trainMethodName, MLClassMethods.DEFAULT_TRAIN_METHOD_NAME, paramArgs); if (trainMethod.getMethod() == null) { throw new DDFException(String.format("Cannot locate method specified by %s", trainMethodName)); } // Now we need to map the DDF and its column specs to the input format expected by the method we're invoking Object[] allArgs = this.buildArgsForMethod(trainMethod.getMethod(), paramArgs); // Invoke the training method Object rawModel = trainMethod.classInvoke(allArgs); List<Schema.Column> columns = this.getDDF().getSchemaHandler().getColumns(); String[] trainedColumns = new String[columns.size()]; for (int i = 0; i < columns.size(); i++) { trainedColumns[i] = columns.get(i).getName(); } for (String col : trainedColumns) { mLog.info(">>>>>> trainedCol = " + col); } IModel model = this.newModel(rawModel); model.setTrainedColumns(trainedColumns); mLog.info(">>>> modelID = " + model.getName()); this.getManager().addModel(model); return model; }
[ "@", "Override", "public", "IModel", "train", "(", "String", "trainMethodName", ",", "Object", "...", "paramArgs", ")", "throws", "DDFException", "{", "/**\n * Example signatures we must support:\n * <p/>\n * Unsupervised Training\n * <p/>\n * <code>\n * Kmean...
Runs a training algorithm on the entire DDF dataset. @param trainMethodName @param args @return @throws DDFException
[ "Runs", "a", "training", "algorithm", "on", "the", "entire", "DDF", "dataset", "." ]
e4e68315dcec1ed8b287bf1ee73baa88e7e41eba
https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/ml/MLSupporter.java#L74-L131
train
ManfredTremmel/gwt-bean-validators
gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/handler/ValueBoxFromEvent.java
ValueBoxFromEvent.getTextBoxFromEvent
@SuppressWarnings("unchecked") protected ValueBoxBase<E> getTextBoxFromEvent(final GwtEvent<?> pevent) { final ValueBoxBase<E> ptextBox; if (pevent.getSource() instanceof SuggestBox) { ptextBox = (ValueBoxBase<E>) ((SuggestBox) pevent.getSource()).getValueBox(); } else if (pevent.getSource() instanceof ValueBoxBase<?>) { ptextBox = (ValueBoxBase<E>) pevent.getSource(); } else { throw new RuntimeException("Widget type not supported!"); } return ptextBox; }
java
@SuppressWarnings("unchecked") protected ValueBoxBase<E> getTextBoxFromEvent(final GwtEvent<?> pevent) { final ValueBoxBase<E> ptextBox; if (pevent.getSource() instanceof SuggestBox) { ptextBox = (ValueBoxBase<E>) ((SuggestBox) pevent.getSource()).getValueBox(); } else if (pevent.getSource() instanceof ValueBoxBase<?>) { ptextBox = (ValueBoxBase<E>) pevent.getSource(); } else { throw new RuntimeException("Widget type not supported!"); } return ptextBox; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "ValueBoxBase", "<", "E", ">", "getTextBoxFromEvent", "(", "final", "GwtEvent", "<", "?", ">", "pevent", ")", "{", "final", "ValueBoxBase", "<", "E", ">", "ptextBox", ";", "if", "(", "pevent", ...
get ValueBoxBase which produced the event. @param pevent event to get box from @return ValueBoxBase
[ "get", "ValueBoxBase", "which", "produced", "the", "event", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/handler/ValueBoxFromEvent.java#L36-L47
train
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/java/de/knightsoftnet/gwtp/spring/server/security/LoggedInChecker.java
LoggedInChecker.getLoggedInUser
public User getLoggedInUser() { User user = null; final Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { final Object principal = authentication.getPrincipal(); // principal can be "anonymousUser" (String) if (principal instanceof UserDetails) { user = userDetailsConverter.convert((UserDetails) principal); } } return user; }
java
public User getLoggedInUser() { User user = null; final Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { final Object principal = authentication.getPrincipal(); // principal can be "anonymousUser" (String) if (principal instanceof UserDetails) { user = userDetailsConverter.convert((UserDetails) principal); } } return user; }
[ "public", "User", "getLoggedInUser", "(", ")", "{", "User", "user", "=", "null", ";", "final", "Authentication", "authentication", "=", "SecurityContextHolder", ".", "getContext", "(", ")", ".", "getAuthentication", "(", ")", ";", "if", "(", "authentication", ...
get logged in user. @return UserData or null if no one is logged in
[ "get", "logged", "in", "user", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/java/de/knightsoftnet/gwtp/spring/server/security/LoggedInChecker.java#L49-L62
train
ddf-project/DDF
core/src/main/java/io/ddf/util/ConfigHandler.java
ConfigHandler.loadConfig
@Override public Configuration loadConfig() throws ConfigurationException, IOException { Configuration resultConfig = new Configuration(); if (!Utils.localFileExists(this.getConfigFileName())) { // String configFileName = System.getenv(ConfigConstant.DDF_INI_ENV_VAR.getValue()); File file = new File(this.locateConfigFileName(this.getConfigDir(), this.getConfigFileName())); mConfigDir = file.getParentFile().getName(); mConfigFileName = file.getCanonicalPath(); } if (!Utils.localFileExists(this.getConfigFileName())) return null; HierarchicalINIConfiguration config = new HierarchicalINIConfiguration(this.getConfigFileName()); @SuppressWarnings("unchecked") Set<String> sectionNames = config.getSections(); for (String sectionName : sectionNames) { SubnodeConfiguration section = config.getSection(sectionName); if (section != null) { Configuration.Section resultSection = resultConfig.getSection(sectionName); @SuppressWarnings("unchecked") Iterator<String> keys = section.getKeys(); while (keys.hasNext()) { String key = keys.next(); String value = section.getString(key); if (value != null) { resultSection.set(key, value); } } } } mConfig = resultConfig; return mConfig; }
java
@Override public Configuration loadConfig() throws ConfigurationException, IOException { Configuration resultConfig = new Configuration(); if (!Utils.localFileExists(this.getConfigFileName())) { // String configFileName = System.getenv(ConfigConstant.DDF_INI_ENV_VAR.getValue()); File file = new File(this.locateConfigFileName(this.getConfigDir(), this.getConfigFileName())); mConfigDir = file.getParentFile().getName(); mConfigFileName = file.getCanonicalPath(); } if (!Utils.localFileExists(this.getConfigFileName())) return null; HierarchicalINIConfiguration config = new HierarchicalINIConfiguration(this.getConfigFileName()); @SuppressWarnings("unchecked") Set<String> sectionNames = config.getSections(); for (String sectionName : sectionNames) { SubnodeConfiguration section = config.getSection(sectionName); if (section != null) { Configuration.Section resultSection = resultConfig.getSection(sectionName); @SuppressWarnings("unchecked") Iterator<String> keys = section.getKeys(); while (keys.hasNext()) { String key = keys.next(); String value = section.getString(key); if (value != null) { resultSection.set(key, value); } } } } mConfig = resultConfig; return mConfig; }
[ "@", "Override", "public", "Configuration", "loadConfig", "(", ")", "throws", "ConfigurationException", ",", "IOException", "{", "Configuration", "resultConfig", "=", "new", "Configuration", "(", ")", ";", "if", "(", "!", "Utils", ".", "localFileExists", "(", "t...
Load configuration from ddf.ini, or the file name specified by the environment variable DDF_INI. @return the {@link Configuration} object loaded @throws Exception @throws ConfigurationException , {@link IOException}
[ "Load", "configuration", "from", "ddf", ".", "ini", "or", "the", "file", "name", "specified", "by", "the", "environment", "variable", "DDF_INI", "." ]
e4e68315dcec1ed8b287bf1ee73baa88e7e41eba
https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/util/ConfigHandler.java#L151-L188
train
ddf-project/DDF
core/src/main/java/io/ddf/util/ConfigHandler.java
ConfigHandler.locateConfigFileName
private String locateConfigFileName(String configDir, String configFileName) throws IOException { String curDir = new File(".").getCanonicalPath(); String path = null; // Go for at most 10 levels up for (int i = 0; i < 10; i++) { path = String.format("%s/%s", curDir, configFileName); if (Utils.localFileExists(path)) break; String dir = String.format("%s/%s", curDir, configDir); if (Utils.dirExists(dir)) { path = String.format("%s/%s", dir, configFileName); if (Utils.localFileExists(path)) break; } curDir = String.format("%s/..", curDir); } mSource = path; if (Strings.isNullOrEmpty(path)) throw new IOException(String.format("Cannot locate DDF configuration file %s", configFileName)); mLog.debug(String.format("Using config file found at %s\n", path)); return path; }
java
private String locateConfigFileName(String configDir, String configFileName) throws IOException { String curDir = new File(".").getCanonicalPath(); String path = null; // Go for at most 10 levels up for (int i = 0; i < 10; i++) { path = String.format("%s/%s", curDir, configFileName); if (Utils.localFileExists(path)) break; String dir = String.format("%s/%s", curDir, configDir); if (Utils.dirExists(dir)) { path = String.format("%s/%s", dir, configFileName); if (Utils.localFileExists(path)) break; } curDir = String.format("%s/..", curDir); } mSource = path; if (Strings.isNullOrEmpty(path)) throw new IOException(String.format("Cannot locate DDF configuration file %s", configFileName)); mLog.debug(String.format("Using config file found at %s\n", path)); return path; }
[ "private", "String", "locateConfigFileName", "(", "String", "configDir", ",", "String", "configFileName", ")", "throws", "IOException", "{", "String", "curDir", "=", "new", "File", "(", "\".\"", ")", ".", "getCanonicalPath", "(", ")", ";", "String", "path", "=...
Search in current dir and working up, looking for the config file @return @throws IOException
[ "Search", "in", "current", "dir", "and", "working", "up", "looking", "for", "the", "config", "file" ]
e4e68315dcec1ed8b287bf1ee73baa88e7e41eba
https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/util/ConfigHandler.java#L201-L227
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/impl/metadata/ValidationGroupsMetadata.java
ValidationGroupsMetadata.findAllExtendedGroups
public Set<Class<?>> findAllExtendedGroups(final Collection<Class<?>> baseGroups) throws IllegalArgumentException { final Set<Class<?>> found = new HashSet<>(); final Stack<Class<?>> remaining = new Stack<>(); // initialize baseGroups.forEach(group -> { if (!inheritanceMapping.containsKey(group)) { throw new IllegalArgumentException("The collection of groups contains a group which" + " was not added to the map. Be sure to call addGroup() for all groups first."); } remaining.push(group); }); // traverse while (!remaining.isEmpty()) { final Class<?> current = remaining.pop(); found.add(current); inheritanceMapping.get(current).forEach(parent -> { if (!found.contains(parent)) { remaining.push(parent); } }); } return found; }
java
public Set<Class<?>> findAllExtendedGroups(final Collection<Class<?>> baseGroups) throws IllegalArgumentException { final Set<Class<?>> found = new HashSet<>(); final Stack<Class<?>> remaining = new Stack<>(); // initialize baseGroups.forEach(group -> { if (!inheritanceMapping.containsKey(group)) { throw new IllegalArgumentException("The collection of groups contains a group which" + " was not added to the map. Be sure to call addGroup() for all groups first."); } remaining.push(group); }); // traverse while (!remaining.isEmpty()) { final Class<?> current = remaining.pop(); found.add(current); inheritanceMapping.get(current).forEach(parent -> { if (!found.contains(parent)) { remaining.push(parent); } }); } return found; }
[ "public", "Set", "<", "Class", "<", "?", ">", ">", "findAllExtendedGroups", "(", "final", "Collection", "<", "Class", "<", "?", ">", ">", "baseGroups", ")", "throws", "IllegalArgumentException", "{", "final", "Set", "<", "Class", "<", "?", ">", ">", "fou...
Finds all of the validation groups extended by an intial set of groups. @param baseGroups The initial set of groups to find parents of. These groups must have been added to the inheritance map already. @return A unified set of groups and their parents. @throws IllegalArgumentException If an initial group has not been added to the map before calling this method.
[ "Finds", "all", "of", "the", "validation", "groups", "extended", "by", "an", "intial", "set", "of", "groups", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/java/de/knightsoftnet/validators/client/impl/metadata/ValidationGroupsMetadata.java#L129-L152
train
neoremind/navi
navi/src/main/java/com/baidu/beidou/navi/client/NaviRpcServerListListener.java
NaviRpcServerListListener.updateServiceLocalCache
private void updateServiceLocalCache() { try { LOG.info("Update local cache now..."); zkClient.getChildren(NaviCommonConstant.ZOOKEEPER_BASE_PATH); LOG.info("Zookeeper global root path is " + NaviCommonConstant.ZOOKEEPER_BASE_PATH); ServiceLocalCache.prepare(); if (ArrayUtil.isEmpty(RpcClientConf.ZK_WATCH_NAMESPACE_PATHS)) { LOG.info("Zookeeper watched name space is empty"); return; } LOG.info("Zookeeper watched name spaces are " + Arrays.toString(RpcClientConf.ZK_WATCH_NAMESPACE_PATHS)); for (String watchedNameSpacePath : RpcClientConf.ZK_WATCH_NAMESPACE_PATHS) { try { List<String> serviceChildren = zkClient.getChildren(ZkPathUtil.buildPath( NaviCommonConstant.ZOOKEEPER_BASE_PATH, watchedNameSpacePath)); LOG.info("======>Find " + serviceChildren.size() + " interfaces under service path - " + ZkPathUtil.buildPath(NaviCommonConstant.ZOOKEEPER_BASE_PATH, watchedNameSpacePath)); if (CollectionUtil.isNotEmpty(serviceChildren)) { for (String service : serviceChildren) { String servicePath = ZkPathUtil.buildPath( NaviCommonConstant.ZOOKEEPER_BASE_PATH, watchedNameSpacePath, service); List<String> serverList = zkClient.getChildren(servicePath); LOG.info(serverList.size() + " servers available for " + servicePath + ", server list = " + Arrays.toString(serverList.toArray(new String[] {}))); if (CollectionUtil.isNotEmpty(serverList)) { Collections.sort(serverList); // order by natural ServiceLocalCache.set(servicePath, serverList); } } } else { LOG.warn("No services registered"); } } catch (NoAuthException e) { LOG.error( "[FATAL ERROR]No auth error! Please check zookeeper digest auth code!!! " + e.getMessage(), e); } catch (NoNodeException e) { LOG.error("Node not found, " + e.getMessage()); } } ServiceLocalCache.switchCache(); } catch (Exception e) { LOG.error(e.getMessage(), e); } finally { try { ServiceLocalCache.done(); } catch (Exception e2) { LOG.error(e2.getMessage(), e2); } } }
java
private void updateServiceLocalCache() { try { LOG.info("Update local cache now..."); zkClient.getChildren(NaviCommonConstant.ZOOKEEPER_BASE_PATH); LOG.info("Zookeeper global root path is " + NaviCommonConstant.ZOOKEEPER_BASE_PATH); ServiceLocalCache.prepare(); if (ArrayUtil.isEmpty(RpcClientConf.ZK_WATCH_NAMESPACE_PATHS)) { LOG.info("Zookeeper watched name space is empty"); return; } LOG.info("Zookeeper watched name spaces are " + Arrays.toString(RpcClientConf.ZK_WATCH_NAMESPACE_PATHS)); for (String watchedNameSpacePath : RpcClientConf.ZK_WATCH_NAMESPACE_PATHS) { try { List<String> serviceChildren = zkClient.getChildren(ZkPathUtil.buildPath( NaviCommonConstant.ZOOKEEPER_BASE_PATH, watchedNameSpacePath)); LOG.info("======>Find " + serviceChildren.size() + " interfaces under service path - " + ZkPathUtil.buildPath(NaviCommonConstant.ZOOKEEPER_BASE_PATH, watchedNameSpacePath)); if (CollectionUtil.isNotEmpty(serviceChildren)) { for (String service : serviceChildren) { String servicePath = ZkPathUtil.buildPath( NaviCommonConstant.ZOOKEEPER_BASE_PATH, watchedNameSpacePath, service); List<String> serverList = zkClient.getChildren(servicePath); LOG.info(serverList.size() + " servers available for " + servicePath + ", server list = " + Arrays.toString(serverList.toArray(new String[] {}))); if (CollectionUtil.isNotEmpty(serverList)) { Collections.sort(serverList); // order by natural ServiceLocalCache.set(servicePath, serverList); } } } else { LOG.warn("No services registered"); } } catch (NoAuthException e) { LOG.error( "[FATAL ERROR]No auth error! Please check zookeeper digest auth code!!! " + e.getMessage(), e); } catch (NoNodeException e) { LOG.error("Node not found, " + e.getMessage()); } } ServiceLocalCache.switchCache(); } catch (Exception e) { LOG.error(e.getMessage(), e); } finally { try { ServiceLocalCache.done(); } catch (Exception e2) { LOG.error(e2.getMessage(), e2); } } }
[ "private", "void", "updateServiceLocalCache", "(", ")", "{", "try", "{", "LOG", ".", "info", "(", "\"Update local cache now...\"", ")", ";", "zkClient", ".", "getChildren", "(", "NaviCommonConstant", ".", "ZOOKEEPER_BASE_PATH", ")", ";", "LOG", ".", "info", "(",...
Refresh all service info in local cache
[ "Refresh", "all", "service", "info", "in", "local", "cache" ]
d37e4b46ef07d124be2740ad3d85d87e939acc84
https://github.com/neoremind/navi/blob/d37e4b46ef07d124be2740ad3d85d87e939acc84/navi/src/main/java/com/baidu/beidou/navi/client/NaviRpcServerListListener.java#L61-L117
train
neoremind/navi
navi/src/main/java/com/baidu/beidou/navi/client/NaviRpcServerListListener.java
NaviRpcServerListListener.doConnect
private void doConnect() { try { LOG.info("Connecting to zookeeper server - " + RpcClientConf.ZK_SERVER_LIST); zkClient = new SimpleZooKeeperClient(RpcClientConf.ZK_SERVER_LIST, RpcClientConf.ZK_DIGEST_AUTH, new ServiceWatcher()); updateServiceLocalCache(); } catch (Exception e) { LOG.error("Zookeeper client initialization failed, " + e.getMessage(), e); } }
java
private void doConnect() { try { LOG.info("Connecting to zookeeper server - " + RpcClientConf.ZK_SERVER_LIST); zkClient = new SimpleZooKeeperClient(RpcClientConf.ZK_SERVER_LIST, RpcClientConf.ZK_DIGEST_AUTH, new ServiceWatcher()); updateServiceLocalCache(); } catch (Exception e) { LOG.error("Zookeeper client initialization failed, " + e.getMessage(), e); } }
[ "private", "void", "doConnect", "(", ")", "{", "try", "{", "LOG", ".", "info", "(", "\"Connecting to zookeeper server - \"", "+", "RpcClientConf", ".", "ZK_SERVER_LIST", ")", ";", "zkClient", "=", "new", "SimpleZooKeeperClient", "(", "RpcClientConf", ".", "ZK_SERV...
Connect to zookeeper server
[ "Connect", "to", "zookeeper", "server" ]
d37e4b46ef07d124be2740ad3d85d87e939acc84
https://github.com/neoremind/navi/blob/d37e4b46ef07d124be2740ad3d85d87e939acc84/navi/src/main/java/com/baidu/beidou/navi/client/NaviRpcServerListListener.java#L122-L131
train
neoremind/navi
navi/src/main/java/com/baidu/beidou/navi/client/NaviRpcServerListListener.java
NaviRpcServerListListener.isInZkWathcedNamespacePaths
private boolean isInZkWathcedNamespacePaths(String path) { if (StringUtil.isEmpty(path)) { return false; } for (String watchNamespacePath : RpcClientConf.ZK_WATCH_NAMESPACE_PATHS) { if (StringUtil.isEmpty(watchNamespacePath)) { continue; } if (path.contains(watchNamespacePath)) { return true; } } return false; }
java
private boolean isInZkWathcedNamespacePaths(String path) { if (StringUtil.isEmpty(path)) { return false; } for (String watchNamespacePath : RpcClientConf.ZK_WATCH_NAMESPACE_PATHS) { if (StringUtil.isEmpty(watchNamespacePath)) { continue; } if (path.contains(watchNamespacePath)) { return true; } } return false; }
[ "private", "boolean", "isInZkWathcedNamespacePaths", "(", "String", "path", ")", "{", "if", "(", "StringUtil", ".", "isEmpty", "(", "path", ")", ")", "{", "return", "false", ";", "}", "for", "(", "String", "watchNamespacePath", ":", "RpcClientConf", ".", "ZK...
Check if the changed path is in the watched paths that the client should care @param path @return
[ "Check", "if", "the", "changed", "path", "is", "in", "the", "watched", "paths", "that", "the", "client", "should", "care" ]
d37e4b46ef07d124be2740ad3d85d87e939acc84
https://github.com/neoremind/navi/blob/d37e4b46ef07d124be2740ad3d85d87e939acc84/navi/src/main/java/com/baidu/beidou/navi/client/NaviRpcServerListListener.java#L139-L152
train
ManfredTremmel/gwt-bean-validators
mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/TaxNumberValidator.java
TaxNumberValidator.checkDeTaxNumber
private boolean checkDeTaxNumber(final String ptaxNumber) { final int fa = Integer.parseInt(StringUtils.substring(ptaxNumber, 2, 4)); final int sb = Integer.parseInt(StringUtils.substring(ptaxNumber, 5, 8)); final int checkSum = ptaxNumber.charAt(12) - '0'; if (StringUtils.startsWith(ptaxNumber, "11")) { // Berlin final int calculatedCheckSum; if (fa >= 27 && fa <= 30 // || fa < 31 && (sb < 201 || sb > 693) // || fa == 19 && (sb < 200 || sb > 639 && sb < 680 || sb > 680 && sb < 684 || sb > 684) // || fa == 37) { calculatedCheckSum = ((ptaxNumber.charAt(5) - '0') * 7 // + (ptaxNumber.charAt(6) - '0') * 6 // + (ptaxNumber.charAt(7) - '0') * 5 // + (ptaxNumber.charAt(8) - '0') * 8 // + (ptaxNumber.charAt(9) - '0') * 4 // + (ptaxNumber.charAt(10) - '0') * 3 // + (ptaxNumber.charAt(11) - '0') * 2) // % MODULO_11; } else { calculatedCheckSum = ((ptaxNumber.charAt(2) - '0') * 3 // + (ptaxNumber.charAt(3) - '0') * 2 // + (ptaxNumber.charAt(4) - '0') * 9 // + (ptaxNumber.charAt(5) - '0') * 8 // + (ptaxNumber.charAt(6) - '0') * 7 // + (ptaxNumber.charAt(7) - '0') * 6 // + (ptaxNumber.charAt(8) - '0') * 5 // + (ptaxNumber.charAt(9) - '0') * 4 // + (ptaxNumber.charAt(10) - '0') * 3 // + (ptaxNumber.charAt(11) - '0') * 2) // % MODULO_11; } return checkSum == calculatedCheckSum; } // TODO find checksum calculation routines for the rest return true; }
java
private boolean checkDeTaxNumber(final String ptaxNumber) { final int fa = Integer.parseInt(StringUtils.substring(ptaxNumber, 2, 4)); final int sb = Integer.parseInt(StringUtils.substring(ptaxNumber, 5, 8)); final int checkSum = ptaxNumber.charAt(12) - '0'; if (StringUtils.startsWith(ptaxNumber, "11")) { // Berlin final int calculatedCheckSum; if (fa >= 27 && fa <= 30 // || fa < 31 && (sb < 201 || sb > 693) // || fa == 19 && (sb < 200 || sb > 639 && sb < 680 || sb > 680 && sb < 684 || sb > 684) // || fa == 37) { calculatedCheckSum = ((ptaxNumber.charAt(5) - '0') * 7 // + (ptaxNumber.charAt(6) - '0') * 6 // + (ptaxNumber.charAt(7) - '0') * 5 // + (ptaxNumber.charAt(8) - '0') * 8 // + (ptaxNumber.charAt(9) - '0') * 4 // + (ptaxNumber.charAt(10) - '0') * 3 // + (ptaxNumber.charAt(11) - '0') * 2) // % MODULO_11; } else { calculatedCheckSum = ((ptaxNumber.charAt(2) - '0') * 3 // + (ptaxNumber.charAt(3) - '0') * 2 // + (ptaxNumber.charAt(4) - '0') * 9 // + (ptaxNumber.charAt(5) - '0') * 8 // + (ptaxNumber.charAt(6) - '0') * 7 // + (ptaxNumber.charAt(7) - '0') * 6 // + (ptaxNumber.charAt(8) - '0') * 5 // + (ptaxNumber.charAt(9) - '0') * 4 // + (ptaxNumber.charAt(10) - '0') * 3 // + (ptaxNumber.charAt(11) - '0') * 2) // % MODULO_11; } return checkSum == calculatedCheckSum; } // TODO find checksum calculation routines for the rest return true; }
[ "private", "boolean", "checkDeTaxNumber", "(", "final", "String", "ptaxNumber", ")", "{", "final", "int", "fa", "=", "Integer", ".", "parseInt", "(", "StringUtils", ".", "substring", "(", "ptaxNumber", ",", "2", ",", "4", ")", ")", ";", "final", "int", "...
check the Tax Identification Number number, country version for Germany. @param ptaxNumber vat id to check @return true if checksum is ok
[ "check", "the", "Tax", "Identification", "Number", "number", "country", "version", "for", "Germany", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/TaxNumberValidator.java#L184-L220
train
domgold/asciidoctor-gherkin-extension
src/main/java/com/github/domgold/doctools/asciidoctor/gherkin/MapFormatter.java
MapFormatter.parse
public static Map<String, Object> parse(String fileContent) { MapFormatter f = new MapFormatter(); Parser p = new Parser(f); p.parse(fileContent, "feature", 0); return f.getFeature(); }
java
public static Map<String, Object> parse(String fileContent) { MapFormatter f = new MapFormatter(); Parser p = new Parser(f); p.parse(fileContent, "feature", 0); return f.getFeature(); }
[ "public", "static", "Map", "<", "String", ",", "Object", ">", "parse", "(", "String", "fileContent", ")", "{", "MapFormatter", "f", "=", "new", "MapFormatter", "(", ")", ";", "Parser", "p", "=", "new", "Parser", "(", "f", ")", ";", "p", ".", "parse",...
Parse the content of a feature file. @param fileContent the feature file's content as {@link String}. @return a Map representing the feature file's content.
[ "Parse", "the", "content", "of", "a", "feature", "file", "." ]
8f5bd70c4a2286940cd133835f5c04f1ffe45892
https://github.com/domgold/asciidoctor-gherkin-extension/blob/8f5bd70c4a2286940cd133835f5c04f1ffe45892/src/main/java/com/github/domgold/doctools/asciidoctor/gherkin/MapFormatter.java#L50-L55
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/de/knightsoftnet/validators/server/data/CreatePhoneCountryConstantsClass.java
CreatePhoneCountryConstantsClass.readPhoneCountryNames
public static Map<String, String> readPhoneCountryNames(final Locale plocale) { final PhoneCountryNameConstants phoneCountryNames = GWT.create(PhoneCountryNameConstants.class); return phoneCountryNames.phoneCountryNames(); }
java
public static Map<String, String> readPhoneCountryNames(final Locale plocale) { final PhoneCountryNameConstants phoneCountryNames = GWT.create(PhoneCountryNameConstants.class); return phoneCountryNames.phoneCountryNames(); }
[ "public", "static", "Map", "<", "String", ",", "String", ">", "readPhoneCountryNames", "(", "final", "Locale", "plocale", ")", "{", "final", "PhoneCountryNameConstants", "phoneCountryNames", "=", "GWT", ".", "create", "(", "PhoneCountryNameConstants", ".", "class", ...
read phone country names. @return map of country code and name
[ "read", "phone", "country", "names", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/de/knightsoftnet/validators/server/data/CreatePhoneCountryConstantsClass.java#L293-L296
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/de/knightsoftnet/validators/server/data/CreatePhoneCountryConstantsClass.java
CreatePhoneCountryConstantsClass.readPhoneCountryCodes
public static Map<String, String> readPhoneCountryCodes(final Locale plocale) { final PhoneCountryCodeConstants phoneCountryCodes = GWT.create(PhoneCountryCodeConstants.class); return phoneCountryCodes.phoneCountryCodes(); }
java
public static Map<String, String> readPhoneCountryCodes(final Locale plocale) { final PhoneCountryCodeConstants phoneCountryCodes = GWT.create(PhoneCountryCodeConstants.class); return phoneCountryCodes.phoneCountryCodes(); }
[ "public", "static", "Map", "<", "String", ",", "String", ">", "readPhoneCountryCodes", "(", "final", "Locale", "plocale", ")", "{", "final", "PhoneCountryCodeConstants", "phoneCountryCodes", "=", "GWT", ".", "create", "(", "PhoneCountryCodeConstants", ".", "class", ...
read phone country codes and country iso codes. @return map of phone country code and country iso code
[ "read", "phone", "country", "codes", "and", "country", "iso", "codes", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/de/knightsoftnet/validators/server/data/CreatePhoneCountryConstantsClass.java#L303-L306
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/de/knightsoftnet/validators/server/data/CreatePhoneCountryConstantsClass.java
CreatePhoneCountryConstantsClass.readPhoneTrunkAndExitCodes
public static Map<String, String> readPhoneTrunkAndExitCodes(final Locale plocale) { final PhoneCountryTrunkAndExitCodesConstants phoneTrunkAndExitCodes = GWT.create(PhoneCountryTrunkAndExitCodesConstants.class); return phoneTrunkAndExitCodes.phoneTrunkAndExitCodes(); }
java
public static Map<String, String> readPhoneTrunkAndExitCodes(final Locale plocale) { final PhoneCountryTrunkAndExitCodesConstants phoneTrunkAndExitCodes = GWT.create(PhoneCountryTrunkAndExitCodesConstants.class); return phoneTrunkAndExitCodes.phoneTrunkAndExitCodes(); }
[ "public", "static", "Map", "<", "String", ",", "String", ">", "readPhoneTrunkAndExitCodes", "(", "final", "Locale", "plocale", ")", "{", "final", "PhoneCountryTrunkAndExitCodesConstants", "phoneTrunkAndExitCodes", "=", "GWT", ".", "create", "(", "PhoneCountryTrunkAndExi...
read phone trunk an exit code map from property file. @return map of country code and combined string of trunk an exit code
[ "read", "phone", "trunk", "an", "exit", "code", "map", "from", "property", "file", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/de/knightsoftnet/validators/server/data/CreatePhoneCountryConstantsClass.java#L1432-L1436
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java
NodeImpl.createContainerElementNode
public static NodeImpl createContainerElementNode(final String name, final NodeImpl parent) { return new NodeImpl( // name, // parent, // false, // null, // null, // ElementKind.CONTAINER_ELEMENT, // EMPTY_CLASS_ARRAY, // null, // null, // null, // null // ); }
java
public static NodeImpl createContainerElementNode(final String name, final NodeImpl parent) { return new NodeImpl( // name, // parent, // false, // null, // null, // ElementKind.CONTAINER_ELEMENT, // EMPTY_CLASS_ARRAY, // null, // null, // null, // null // ); }
[ "public", "static", "NodeImpl", "createContainerElementNode", "(", "final", "String", "name", ",", "final", "NodeImpl", "parent", ")", "{", "return", "new", "NodeImpl", "(", "//", "name", ",", "//", "parent", ",", "//", "false", ",", "//", "null", ",", "//...
create container element node. @param name name of the node @param parent parent node @return new node implementation
[ "create", "container", "element", "node", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L127-L141
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java
NodeImpl.createParameterNode
public static NodeImpl createParameterNode(final String name, final NodeImpl parent, final int parameterIndex) { return new NodeImpl( // name, // parent, // false, // null, // null, // ElementKind.PARAMETER, // EMPTY_CLASS_ARRAY, // parameterIndex, // null, // null, // null // ); }
java
public static NodeImpl createParameterNode(final String name, final NodeImpl parent, final int parameterIndex) { return new NodeImpl( // name, // parent, // false, // null, // null, // ElementKind.PARAMETER, // EMPTY_CLASS_ARRAY, // parameterIndex, // null, // null, // null // ); }
[ "public", "static", "NodeImpl", "createParameterNode", "(", "final", "String", "name", ",", "final", "NodeImpl", "parent", ",", "final", "int", "parameterIndex", ")", "{", "return", "new", "NodeImpl", "(", "//", "name", ",", "//", "parent", ",", "//", "false...
create parameter node. @param name name of the node @param parent parent node @return new node implementation
[ "create", "parameter", "node", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L150-L165
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java
NodeImpl.createCrossParameterNode
public static NodeImpl createCrossParameterNode(final NodeImpl parent) { return new NodeImpl( // CROSS_PARAMETER_NODE_NAME, // parent, // false, // null, // null, // ElementKind.CROSS_PARAMETER, // EMPTY_CLASS_ARRAY, // null, // null, // null, // null // ); }
java
public static NodeImpl createCrossParameterNode(final NodeImpl parent) { return new NodeImpl( // CROSS_PARAMETER_NODE_NAME, // parent, // false, // null, // null, // ElementKind.CROSS_PARAMETER, // EMPTY_CLASS_ARRAY, // null, // null, // null, // null // ); }
[ "public", "static", "NodeImpl", "createCrossParameterNode", "(", "final", "NodeImpl", "parent", ")", "{", "return", "new", "NodeImpl", "(", "//", "CROSS_PARAMETER_NODE_NAME", ",", "//", "parent", ",", "//", "false", ",", "//", "null", ",", "//", "null", ",", ...
create cross parameter node node. @param parent parent node @return new node implementation
[ "create", "cross", "parameter", "node", "node", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L173-L187
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java
NodeImpl.createMethodNode
public static NodeImpl createMethodNode(final String name, final NodeImpl parent, final Class<?>[] parameterTypes) { return new NodeImpl( // name, // parent, // false, // null, // null, // ElementKind.METHOD, // parameterTypes, // null, // null, // null, // null // ); }
java
public static NodeImpl createMethodNode(final String name, final NodeImpl parent, final Class<?>[] parameterTypes) { return new NodeImpl( // name, // parent, // false, // null, // null, // ElementKind.METHOD, // parameterTypes, // null, // null, // null, // null // ); }
[ "public", "static", "NodeImpl", "createMethodNode", "(", "final", "String", "name", ",", "final", "NodeImpl", "parent", ",", "final", "Class", "<", "?", ">", "[", "]", "parameterTypes", ")", "{", "return", "new", "NodeImpl", "(", "//", "name", ",", "//", ...
create method node. @param name name of the node @param parent parent node @param parameterTypes parameter types @return new node implementation
[ "create", "method", "node", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L197-L212
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java
NodeImpl.createConstructorNode
public static NodeImpl createConstructorNode(final String name, final NodeImpl parent, final Class<?>[] parameterTypes) { return new NodeImpl( // name, // parent, // false, // null, // null, // ElementKind.CONSTRUCTOR, // parameterTypes, // null, // null, // null, // null // ); }
java
public static NodeImpl createConstructorNode(final String name, final NodeImpl parent, final Class<?>[] parameterTypes) { return new NodeImpl( // name, // parent, // false, // null, // null, // ElementKind.CONSTRUCTOR, // parameterTypes, // null, // null, // null, // null // ); }
[ "public", "static", "NodeImpl", "createConstructorNode", "(", "final", "String", "name", ",", "final", "NodeImpl", "parent", ",", "final", "Class", "<", "?", ">", "[", "]", "parameterTypes", ")", "{", "return", "new", "NodeImpl", "(", "//", "name", ",", "/...
create constructor node. @param name name of the node @param parent parent node @param parameterTypes parameter types @return new node implementation
[ "create", "constructor", "node", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L222-L237
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java
NodeImpl.createBeanNode
public static NodeImpl createBeanNode(final NodeImpl parent) { return new NodeImpl( // null, // parent, // false, // null, // null, // ElementKind.BEAN, EMPTY_CLASS_ARRAY, // null, // null, // null, // null // ); }
java
public static NodeImpl createBeanNode(final NodeImpl parent) { return new NodeImpl( // null, // parent, // false, // null, // null, // ElementKind.BEAN, EMPTY_CLASS_ARRAY, // null, // null, // null, // null // ); }
[ "public", "static", "NodeImpl", "createBeanNode", "(", "final", "NodeImpl", "parent", ")", "{", "return", "new", "NodeImpl", "(", "//", "null", ",", "//", "parent", ",", "//", "false", ",", "//", "null", ",", "//", "null", ",", "//", "ElementKind", ".", ...
create bean node. @param parent parent node @return new node implementation
[ "create", "bean", "node", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L245-L258
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java
NodeImpl.createReturnValue
public static NodeImpl createReturnValue(final NodeImpl parent) { return new NodeImpl( // RETURN_VALUE_NODE_NAME, // parent, // false, // null, // null, // ElementKind.RETURN_VALUE, // EMPTY_CLASS_ARRAY, // null, // null, // null, // null // ); }
java
public static NodeImpl createReturnValue(final NodeImpl parent) { return new NodeImpl( // RETURN_VALUE_NODE_NAME, // parent, // false, // null, // null, // ElementKind.RETURN_VALUE, // EMPTY_CLASS_ARRAY, // null, // null, // null, // null // ); }
[ "public", "static", "NodeImpl", "createReturnValue", "(", "final", "NodeImpl", "parent", ")", "{", "return", "new", "NodeImpl", "(", "//", "RETURN_VALUE_NODE_NAME", ",", "//", "parent", ",", "//", "false", ",", "//", "null", ",", "//", "null", ",", "//", "...
create return node. @param parent parent node @return new node implementation
[ "create", "return", "node", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L266-L280
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java
NodeImpl.makeIterable
public static NodeImpl makeIterable(final NodeImpl node) { return new NodeImpl( // node.name, // node.parent, // true, // null, // null, // node.kind, // node.parameterTypes, // node.parameterIndex, // node.value, // node.containerClass, // node.typeArgumentIndex // ); }
java
public static NodeImpl makeIterable(final NodeImpl node) { return new NodeImpl( // node.name, // node.parent, // true, // null, // null, // node.kind, // node.parameterTypes, // node.parameterIndex, // node.value, // node.containerClass, // node.typeArgumentIndex // ); }
[ "public", "static", "NodeImpl", "makeIterable", "(", "final", "NodeImpl", "node", ")", "{", "return", "new", "NodeImpl", "(", "//", "node", ".", "name", ",", "//", "node", ".", "parent", ",", "//", "true", ",", "//", "null", ",", "//", "null", ",", "...
make it iterable. @param node node to build @return iterable node implementation
[ "make", "it", "iterable", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L288-L302
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java
NodeImpl.makeIterableAndSetIndex
public static NodeImpl makeIterableAndSetIndex(final NodeImpl node, final Integer index) { return new NodeImpl( // node.name, // node.parent, // true, // index, // null, // node.kind, // node.parameterTypes, // node.parameterIndex, // node.value, // node.containerClass, // node.typeArgumentIndex // ); }
java
public static NodeImpl makeIterableAndSetIndex(final NodeImpl node, final Integer index) { return new NodeImpl( // node.name, // node.parent, // true, // index, // null, // node.kind, // node.parameterTypes, // node.parameterIndex, // node.value, // node.containerClass, // node.typeArgumentIndex // ); }
[ "public", "static", "NodeImpl", "makeIterableAndSetIndex", "(", "final", "NodeImpl", "node", ",", "final", "Integer", "index", ")", "{", "return", "new", "NodeImpl", "(", "//", "node", ".", "name", ",", "//", "node", ".", "parent", ",", "//", "true", ",", ...
make it iterable and set index. @param node node to build @param index index to set @return iterable node implementation
[ "make", "it", "iterable", "and", "set", "index", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L311-L325
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java
NodeImpl.makeIterableAndSetMapKey
public static NodeImpl makeIterableAndSetMapKey(final NodeImpl node, final Object key) { return new NodeImpl( // node.name, // node.parent, // true, // null, // key, // node.kind, // node.parameterTypes, // node.parameterIndex, // node.value, // node.containerClass, // node.typeArgumentIndex // ); }
java
public static NodeImpl makeIterableAndSetMapKey(final NodeImpl node, final Object key) { return new NodeImpl( // node.name, // node.parent, // true, // null, // key, // node.kind, // node.parameterTypes, // node.parameterIndex, // node.value, // node.containerClass, // node.typeArgumentIndex // ); }
[ "public", "static", "NodeImpl", "makeIterableAndSetMapKey", "(", "final", "NodeImpl", "node", ",", "final", "Object", "key", ")", "{", "return", "new", "NodeImpl", "(", "//", "node", ".", "name", ",", "//", "node", ".", "parent", ",", "//", "true", ",", ...
make it iterable and set map key. @param node node to build @param key map key to est @return iterable node implementation
[ "make", "it", "iterable", "and", "set", "map", "key", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L334-L348
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java
NodeImpl.setPropertyValue
public static NodeImpl setPropertyValue(final NodeImpl node, final Object value) { return new NodeImpl( // node.name, // node.parent, // node.isIterableValue, // node.index, // node.key, // node.kind, // node.parameterTypes, // node.parameterIndex, // value, // node.containerClass, // node.typeArgumentIndex // ); }
java
public static NodeImpl setPropertyValue(final NodeImpl node, final Object value) { return new NodeImpl( // node.name, // node.parent, // node.isIterableValue, // node.index, // node.key, // node.kind, // node.parameterTypes, // node.parameterIndex, // value, // node.containerClass, // node.typeArgumentIndex // ); }
[ "public", "static", "NodeImpl", "setPropertyValue", "(", "final", "NodeImpl", "node", ",", "final", "Object", "value", ")", "{", "return", "new", "NodeImpl", "(", "//", "node", ".", "name", ",", "//", "node", ".", "parent", ",", "//", "node", ".", "isIte...
set property value to a copied node. @param node node to build @param value value to set @return new created node implementation
[ "set", "property", "value", "to", "a", "copied", "node", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L357-L371
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java
NodeImpl.setTypeParameter
public static NodeImpl setTypeParameter(final NodeImpl node, final Class<?> containerClass, final Integer typeArgumentIndex) { return new NodeImpl( // node.name, // node.parent, // node.isIterableValue, // node.index, // node.key, // node.kind, // node.parameterTypes, // node.parameterIndex, // node.value, // containerClass, // typeArgumentIndex // ); }
java
public static NodeImpl setTypeParameter(final NodeImpl node, final Class<?> containerClass, final Integer typeArgumentIndex) { return new NodeImpl( // node.name, // node.parent, // node.isIterableValue, // node.index, // node.key, // node.kind, // node.parameterTypes, // node.parameterIndex, // node.value, // containerClass, // typeArgumentIndex // ); }
[ "public", "static", "NodeImpl", "setTypeParameter", "(", "final", "NodeImpl", "node", ",", "final", "Class", "<", "?", ">", "containerClass", ",", "final", "Integer", "typeArgumentIndex", ")", "{", "return", "new", "NodeImpl", "(", "//", "node", ".", "name", ...
set type parameter to a copied node. @param node node to build @param containerClass container class to set @param typeArgumentIndex type argument index to set @return new created node implementation
[ "set", "type", "parameter", "to", "a", "copied", "node", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L381-L396
train
ManfredTremmel/gwt-bean-validators
gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java
NodeImpl.buildHashCode
public final int buildHashCode() { return Objects.hash(this.index, this.isIterableValue, this.key, this.kind, this.name, this.parameterIndex, this.parameterTypes, this.parent, this.containerClass, this.typeArgumentIndex); }
java
public final int buildHashCode() { return Objects.hash(this.index, this.isIterableValue, this.key, this.kind, this.name, this.parameterIndex, this.parameterTypes, this.parent, this.containerClass, this.typeArgumentIndex); }
[ "public", "final", "int", "buildHashCode", "(", ")", "{", "return", "Objects", ".", "hash", "(", "this", ".", "index", ",", "this", ".", "isIterableValue", ",", "this", ".", "key", ",", "this", ".", "kind", ",", "this", ".", "name", ",", "this", ".",...
build hash code. @return created hash code
[ "build", "hash", "code", "." ]
cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L567-L571
train