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
kuali/ojb-1.0.4
src/java/org/apache/ojb/otm/OTMKit.java
OTMKit.acquireConnection
public OTMConnection acquireConnection(PBKey pbKey) { TransactionFactory txFactory = getTransactionFactory(); return txFactory.acquireConnection(pbKey); }
java
public OTMConnection acquireConnection(PBKey pbKey) { TransactionFactory txFactory = getTransactionFactory(); return txFactory.acquireConnection(pbKey); }
[ "public", "OTMConnection", "acquireConnection", "(", "PBKey", "pbKey", ")", "{", "TransactionFactory", "txFactory", "=", "getTransactionFactory", "(", ")", ";", "return", "txFactory", ".", "acquireConnection", "(", "pbKey", ")", ";", "}" ]
Obtain an OTMConnection for the given persistence broker key
[ "Obtain", "an", "OTMConnection", "for", "the", "given", "persistence", "broker", "key" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/otm/OTMKit.java#L40-L44
train
gsi-upm/BeastTool
beast-tool/src/main/java/es/upm/dit/gsi/beast/platform/jadex/JadexMessenger.java
JadexMessenger.sendMessageToAgents
public void sendMessageToAgents(String[] agent_name, String msgtype, Object message_content, Connector connector) { HashMap<String, Object> hm = new HashMap<String, Object>(); hm.put("performative", msgtype); hm.put(SFipa.CONTENT, message_content); IComponentIdentifier[] ici ...
java
public void sendMessageToAgents(String[] agent_name, String msgtype, Object message_content, Connector connector) { HashMap<String, Object> hm = new HashMap<String, Object>(); hm.put("performative", msgtype); hm.put(SFipa.CONTENT, message_content); IComponentIdentifier[] ici ...
[ "public", "void", "sendMessageToAgents", "(", "String", "[", "]", "agent_name", ",", "String", "msgtype", ",", "Object", "message_content", ",", "Connector", "connector", ")", "{", "HashMap", "<", "String", ",", "Object", ">", "hm", "=", "new", "HashMap", "<...
This method sends the same message to many agents. @param agent_name The id of the agents that receive the message @param msgtype @param message_content The content of the message @param connector The connector to get the external access
[ "This", "method", "sends", "the", "same", "message", "to", "many", "agents", "." ]
cc7fdc75cb818c5d60802aaf32c27829e0ca144c
https://github.com/gsi-upm/BeastTool/blob/cc7fdc75cb818c5d60802aaf32c27829e0ca144c/beast-tool/src/main/java/es/upm/dit/gsi/beast/platform/jadex/JadexMessenger.java#L54-L65
train
gsi-upm/BeastTool
beast-tool/src/main/java/es/upm/dit/gsi/beast/platform/jadex/JadexMessenger.java
JadexMessenger.sendMessageToAgentsWithExtraProperties
public void sendMessageToAgentsWithExtraProperties(String[] agent_name, String msgtype, Object message_content, ArrayList<Object> properties, Connector connector) { HashMap<String, Object> hm = new HashMap<String, Object>(); hm.put("performative", msgtype); hm.put(SFipa.C...
java
public void sendMessageToAgentsWithExtraProperties(String[] agent_name, String msgtype, Object message_content, ArrayList<Object> properties, Connector connector) { HashMap<String, Object> hm = new HashMap<String, Object>(); hm.put("performative", msgtype); hm.put(SFipa.C...
[ "public", "void", "sendMessageToAgentsWithExtraProperties", "(", "String", "[", "]", "agent_name", ",", "String", "msgtype", ",", "Object", "message_content", ",", "ArrayList", "<", "Object", ">", "properties", ",", "Connector", "connector", ")", "{", "HashMap", "...
This method works as the one above, adding some properties to the message @param agent_name The id of the agents that receive the message @param msgtype @param message_content The content of the message @param properties to be added to the message @param connector The connector to get the external access
[ "This", "method", "works", "as", "the", "one", "above", "adding", "some", "properties", "to", "the", "message" ]
cc7fdc75cb818c5d60802aaf32c27829e0ca144c
https://github.com/gsi-upm/BeastTool/blob/cc7fdc75cb818c5d60802aaf32c27829e0ca144c/beast-tool/src/main/java/es/upm/dit/gsi/beast/platform/jadex/JadexMessenger.java#L80-L99
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/TransactionImpl.java
TransactionImpl.lock
public void lock(Object obj, int lockMode) throws LockNotGrantedException { if (log.isDebugEnabled()) log.debug("lock object was called on tx " + this + ", object is " + obj.toString()); checkOpen(); RuntimeObject rtObject = new RuntimeObject(obj, this); lockAndRegister(rtObject...
java
public void lock(Object obj, int lockMode) throws LockNotGrantedException { if (log.isDebugEnabled()) log.debug("lock object was called on tx " + this + ", object is " + obj.toString()); checkOpen(); RuntimeObject rtObject = new RuntimeObject(obj, this); lockAndRegister(rtObject...
[ "public", "void", "lock", "(", "Object", "obj", ",", "int", "lockMode", ")", "throws", "LockNotGrantedException", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "log", ".", "debug", "(", "\"lock object was called on tx \"", "+", "this", "+", "\...
Upgrade the lock on the given object to the given lock mode. The call has no effect if the object's current lock is already at or above that level of lock mode. @param obj object to acquire a lock on. @param lockMode lock mode to acquire. The lock modes are <code>READ</code> , <code>UPGRADE</code> , and <code...
[ "Upgrade", "the", "lock", "on", "the", "given", "object", "to", "the", "given", "lock", "mode", ".", "The", "call", "has", "no", "effect", "if", "the", "object", "s", "current", "lock", "is", "already", "at", "or", "above", "that", "level", "of", "lock...
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L224-L231
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/TransactionImpl.java
TransactionImpl.doWriteObjects
protected synchronized void doWriteObjects(boolean isFlush) throws TransactionAbortedException, LockNotGrantedException { /* arminw: if broker isn't in PB-tx, start tx */ if (!getBroker().isInTransaction()) { if (log.isDebugEnabled()) log.debug("ca...
java
protected synchronized void doWriteObjects(boolean isFlush) throws TransactionAbortedException, LockNotGrantedException { /* arminw: if broker isn't in PB-tx, start tx */ if (!getBroker().isInTransaction()) { if (log.isDebugEnabled()) log.debug("ca...
[ "protected", "synchronized", "void", "doWriteObjects", "(", "boolean", "isFlush", ")", "throws", "TransactionAbortedException", ",", "LockNotGrantedException", "{", "/*\r\n arminw:\r\n if broker isn't in PB-tx, start tx\r\n */", "if", "(", "!", "getBroker", "...
Write objects to data store, but don't release the locks. I don't know what we should do if we are in a checkpoint and we need to abort.
[ "Write", "objects", "to", "data", "store", "but", "don", "t", "release", "the", "locks", ".", "I", "don", "t", "know", "what", "we", "should", "do", "if", "we", "are", "in", "a", "checkpoint", "and", "we", "need", "to", "abort", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L387-L408
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/TransactionImpl.java
TransactionImpl.doClose
protected synchronized void doClose() { try { LockManager lm = getImplementation().getLockManager(); Enumeration en = objectEnvelopeTable.elements(); while (en.hasMoreElements()) { ObjectEnvelope oe = (ObjectEnvelope) en.nextEle...
java
protected synchronized void doClose() { try { LockManager lm = getImplementation().getLockManager(); Enumeration en = objectEnvelopeTable.elements(); while (en.hasMoreElements()) { ObjectEnvelope oe = (ObjectEnvelope) en.nextEle...
[ "protected", "synchronized", "void", "doClose", "(", ")", "{", "try", "{", "LockManager", "lm", "=", "getImplementation", "(", ")", ".", "getLockManager", "(", ")", ";", "Enumeration", "en", "=", "objectEnvelopeTable", ".", "elements", "(", ")", ";", "while"...
Close a transaction and do all the cleanup associated with it.
[ "Close", "a", "transaction", "and", "do", "all", "the", "cleanup", "associated", "with", "it", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L430-L465
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/TransactionImpl.java
TransactionImpl.refresh
protected void refresh() { if (log.isDebugEnabled()) log.debug("Refresh this transaction for reuse: " + this); try { // we reuse ObjectEnvelopeTable instance objectEnvelopeTable.refresh(); } catch (Exception e) { ...
java
protected void refresh() { if (log.isDebugEnabled()) log.debug("Refresh this transaction for reuse: " + this); try { // we reuse ObjectEnvelopeTable instance objectEnvelopeTable.refresh(); } catch (Exception e) { ...
[ "protected", "void", "refresh", "(", ")", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "log", ".", "debug", "(", "\"Refresh this transaction for reuse: \"", "+", "this", ")", ";", "try", "{", "// we reuse ObjectEnvelopeTable instance\r", "objectEnv...
cleanup tx and prepare for reuse
[ "cleanup", "tx", "and", "prepare", "for", "reuse" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L470-L495
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/TransactionImpl.java
TransactionImpl.abort
public void abort() { /* do nothing if already rolledback */ if (txStatus == Status.STATUS_NO_TRANSACTION || txStatus == Status.STATUS_UNKNOWN || txStatus == Status.STATUS_ROLLEDBACK) { log.info("Nothing to abort, tx is not...
java
public void abort() { /* do nothing if already rolledback */ if (txStatus == Status.STATUS_NO_TRANSACTION || txStatus == Status.STATUS_UNKNOWN || txStatus == Status.STATUS_ROLLEDBACK) { log.info("Nothing to abort, tx is not...
[ "public", "void", "abort", "(", ")", "{", "/*\r\n do nothing if already rolledback\r\n */", "if", "(", "txStatus", "==", "Status", ".", "STATUS_NO_TRANSACTION", "||", "txStatus", "==", "Status", ".", "STATUS_UNKNOWN", "||", "txStatus", "==", "Status", "....
Abort and close the transaction. Calling abort abandons all persistent object modifications and releases the associated locks. Aborting a transaction does not restore the state of modified transient objects
[ "Abort", "and", "close", "the", "transaction", ".", "Calling", "abort", "abandons", "all", "persistent", "object", "modifications", "and", "releases", "the", "associated", "locks", ".", "Aborting", "a", "transaction", "does", "not", "restore", "the", "state", "o...
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L778-L832
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/TransactionImpl.java
TransactionImpl.getObjectByIdentity
public Object getObjectByIdentity(Identity id) throws PersistenceBrokerException { checkOpen(); ObjectEnvelope envelope = objectEnvelopeTable.getByIdentity(id); if (envelope != null) { return (envelope.needsDelete() ? null : envelope.getObject()); ...
java
public Object getObjectByIdentity(Identity id) throws PersistenceBrokerException { checkOpen(); ObjectEnvelope envelope = objectEnvelopeTable.getByIdentity(id); if (envelope != null) { return (envelope.needsDelete() ? null : envelope.getObject()); ...
[ "public", "Object", "getObjectByIdentity", "(", "Identity", "id", ")", "throws", "PersistenceBrokerException", "{", "checkOpen", "(", ")", ";", "ObjectEnvelope", "envelope", "=", "objectEnvelopeTable", ".", "getByIdentity", "(", "id", ")", ";", "if", "(", "envelop...
Get object by identity. First lookup among objects registered in the transaction, then in persistent storage. @param id The identity @return The object @throws PersistenceBrokerException
[ "Get", "object", "by", "identity", ".", "First", "lookup", "among", "objects", "registered", "in", "the", "transaction", "then", "in", "persistent", "storage", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L884-L897
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/TransactionImpl.java
TransactionImpl.lockAndRegisterReferences
private void lockAndRegisterReferences(ClassDescriptor cld, Object sourceObject, int lockMode, List registeredObjects) throws LockNotGrantedException { if (implicitLocking) { Iterator i = cld.getObjectReferenceDescriptors(true).iterator(); while (i.hasNext()) ...
java
private void lockAndRegisterReferences(ClassDescriptor cld, Object sourceObject, int lockMode, List registeredObjects) throws LockNotGrantedException { if (implicitLocking) { Iterator i = cld.getObjectReferenceDescriptors(true).iterator(); while (i.hasNext()) ...
[ "private", "void", "lockAndRegisterReferences", "(", "ClassDescriptor", "cld", ",", "Object", "sourceObject", ",", "int", "lockMode", ",", "List", "registeredObjects", ")", "throws", "LockNotGrantedException", "{", "if", "(", "implicitLocking", ")", "{", "Iterator", ...
we only use the registrationList map if the object is not a proxy. During the reference locking, we will materialize objects and they will enter the registered for lock map.
[ "we", "only", "use", "the", "registrationList", "map", "if", "the", "object", "is", "not", "a", "proxy", ".", "During", "the", "reference", "locking", "we", "will", "materialize", "objects", "and", "they", "will", "enter", "the", "registered", "for", "lock",...
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L983-L1003
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/TransactionImpl.java
TransactionImpl.afterMaterialization
public void afterMaterialization(IndirectionHandler handler, Object materializedObject) { try { Identity oid = handler.getIdentity(); if (log.isDebugEnabled()) log.debug("deferred registration: " + oid); if(!isOpen()) { ...
java
public void afterMaterialization(IndirectionHandler handler, Object materializedObject) { try { Identity oid = handler.getIdentity(); if (log.isDebugEnabled()) log.debug("deferred registration: " + oid); if(!isOpen()) { ...
[ "public", "void", "afterMaterialization", "(", "IndirectionHandler", "handler", ",", "Object", "materializedObject", ")", "{", "try", "{", "Identity", "oid", "=", "handler", ".", "getIdentity", "(", ")", ";", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ...
this callback is invoked after an Object is materialized within an IndirectionHandler. this callback allows to defer registration of objects until it's really neccessary. @param handler the invoking handler @param materializedObject the materialized Object
[ "this", "callback", "is", "invoked", "after", "an", "Object", "is", "materialized", "within", "an", "IndirectionHandler", ".", "this", "callback", "allows", "to", "defer", "registration", "of", "objects", "until", "it", "s", "really", "neccessary", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L1091-L1116
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/TransactionImpl.java
TransactionImpl.afterLoading
public void afterLoading(CollectionProxyDefaultImpl colProxy) { if (log.isDebugEnabled()) log.debug("loading a proxied collection a collection: " + colProxy); Collection data = colProxy.getData(); for (Iterator iterator = data.iterator(); iterator.hasNext();) { Obje...
java
public void afterLoading(CollectionProxyDefaultImpl colProxy) { if (log.isDebugEnabled()) log.debug("loading a proxied collection a collection: " + colProxy); Collection data = colProxy.getData(); for (Iterator iterator = data.iterator(); iterator.hasNext();) { Obje...
[ "public", "void", "afterLoading", "(", "CollectionProxyDefaultImpl", "colProxy", ")", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "log", ".", "debug", "(", "\"loading a proxied collection a collection: \"", "+", "colProxy", ")", ";", "Collection", ...
Remove colProxy from list of pending collections and register its contents with the transaction.
[ "Remove", "colProxy", "from", "list", "of", "pending", "collections", "and", "register", "its", "contents", "with", "the", "transaction", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L1259-L1282
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/TransactionImpl.java
TransactionImpl.isTransient
protected boolean isTransient(ClassDescriptor cld, Object obj, Identity oid) { // if the Identity is transient we assume a non-persistent object boolean isNew = oid != null && oid.isTransient(); /* detection of new objects is costly (select of ID in DB to check if object ...
java
protected boolean isTransient(ClassDescriptor cld, Object obj, Identity oid) { // if the Identity is transient we assume a non-persistent object boolean isNew = oid != null && oid.isTransient(); /* detection of new objects is costly (select of ID in DB to check if object ...
[ "protected", "boolean", "isTransient", "(", "ClassDescriptor", "cld", ",", "Object", "obj", ",", "Identity", "oid", ")", "{", "// if the Identity is transient we assume a non-persistent object\r", "boolean", "isNew", "=", "oid", "!=", "null", "&&", "oid", ".", "isTran...
Detect new objects.
[ "Detect", "new", "objects", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/TransactionImpl.java#L1344-L1385
train
Axway/Grapes
server/src/main/java/org/axway/grapes/server/webapp/views/DependencyListView.java
DependencyListView.getLicense
private License getLicense(final String licenseId) { License result = null; final Set<DbLicense> matchingLicenses = licenseMatcher.getMatchingLicenses(licenseId); if (matchingLicenses.isEmpty()) { result = DataModelFactory.createLicense("#" + licenseId + "# (to be identified)", NOT_...
java
private License getLicense(final String licenseId) { License result = null; final Set<DbLicense> matchingLicenses = licenseMatcher.getMatchingLicenses(licenseId); if (matchingLicenses.isEmpty()) { result = DataModelFactory.createLicense("#" + licenseId + "# (to be identified)", NOT_...
[ "private", "License", "getLicense", "(", "final", "String", "licenseId", ")", "{", "License", "result", "=", "null", ";", "final", "Set", "<", "DbLicense", ">", "matchingLicenses", "=", "licenseMatcher", ".", "getMatchingLicenses", "(", "licenseId", ")", ";", ...
Returns a licenses regarding its Id and a fake on if no license exist with such an Id @param licenseId String @return License
[ "Returns", "a", "licenses", "regarding", "its", "Id", "and", "a", "fake", "on", "if", "no", "license", "exist", "with", "such", "an", "Id" ]
ce9cc73d85f83eaa5fbc991abb593915a8c8374e
https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/views/DependencyListView.java#L163-L181
train
Axway/Grapes
server/src/main/java/org/axway/grapes/server/webapp/views/DependencyListView.java
DependencyListView.getHeaders
private String[] getHeaders() { final List<String> headers = new ArrayList<>(); if(decorator.getShowSources()){ headers.add(SOURCE_FIELD); } if(decorator.getShowSourcesVersion()){ headers.add(SOURCE_VERSION_FIELD); } if(decorator.getShowTargets(...
java
private String[] getHeaders() { final List<String> headers = new ArrayList<>(); if(decorator.getShowSources()){ headers.add(SOURCE_FIELD); } if(decorator.getShowSourcesVersion()){ headers.add(SOURCE_VERSION_FIELD); } if(decorator.getShowTargets(...
[ "private", "String", "[", "]", "getHeaders", "(", ")", "{", "final", "List", "<", "String", ">", "headers", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "decorator", ".", "getShowSources", "(", ")", ")", "{", "headers", ".", "add", "(", ...
Init the headers of the table regarding the filters @return String[]
[ "Init", "the", "headers", "of", "the", "table", "regarding", "the", "filters" ]
ce9cc73d85f83eaa5fbc991abb593915a8c8374e
https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/views/DependencyListView.java#L188-L232
train
geomajas/geomajas-project-server
plugin/layer-common/layer-common/src/main/java/org/geomajas/layer/common/proxy/CachingLayerHttpService.java
CachingLayerHttpService.getStream
public InputStream getStream(String url, RasterLayer layer) throws IOException { if (layer instanceof ProxyLayerSupport) { ProxyLayerSupport proxyLayer = (ProxyLayerSupport) layer; if (proxyLayer.isUseCache() && null != cacheManagerService) { Object cachedObject = cacheManagerService.get(proxyLayer, CacheCa...
java
public InputStream getStream(String url, RasterLayer layer) throws IOException { if (layer instanceof ProxyLayerSupport) { ProxyLayerSupport proxyLayer = (ProxyLayerSupport) layer; if (proxyLayer.isUseCache() && null != cacheManagerService) { Object cachedObject = cacheManagerService.get(proxyLayer, CacheCa...
[ "public", "InputStream", "getStream", "(", "String", "url", ",", "RasterLayer", "layer", ")", "throws", "IOException", "{", "if", "(", "layer", "instanceof", "ProxyLayerSupport", ")", "{", "ProxyLayerSupport", "proxyLayer", "=", "(", "ProxyLayerSupport", ")", "lay...
Get the contents from the request URL. @param url URL to get the response from @param layer the raster layer @return {@link InputStream} with the content @throws IOException cannot get content
[ "Get", "the", "contents", "from", "the", "request", "URL", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-common/layer-common/src/main/java/org/geomajas/layer/common/proxy/CachingLayerHttpService.java#L69-L92
train
geomajas/geomajas-project-server
plugin/layer-common/layer-common/src/main/java/org/geomajas/layer/common/proxy/CachingLayerHttpService.java
CachingLayerHttpService.getLayerEnvelope
private Envelope getLayerEnvelope(ProxyLayerSupport layer) { Bbox bounds = layer.getLayerInfo().getMaxExtent(); return new Envelope(bounds.getX(), bounds.getMaxX(), bounds.getY(), bounds.getMaxY()); }
java
private Envelope getLayerEnvelope(ProxyLayerSupport layer) { Bbox bounds = layer.getLayerInfo().getMaxExtent(); return new Envelope(bounds.getX(), bounds.getMaxX(), bounds.getY(), bounds.getMaxY()); }
[ "private", "Envelope", "getLayerEnvelope", "(", "ProxyLayerSupport", "layer", ")", "{", "Bbox", "bounds", "=", "layer", ".", "getLayerInfo", "(", ")", ".", "getMaxExtent", "(", ")", ";", "return", "new", "Envelope", "(", "bounds", ".", "getX", "(", ")", ",...
Return the max bounds of the layer as envelope. @param layer the layer to get envelope from @return Envelope the envelope
[ "Return", "the", "max", "bounds", "of", "the", "layer", "as", "envelope", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-common/layer-common/src/main/java/org/geomajas/layer/common/proxy/CachingLayerHttpService.java#L100-L103
train
Axway/Grapes
server/src/main/java/org/axway/grapes/server/webapp/resources/PromotionReportTranslator.java
PromotionReportTranslator.buildErrorMsg
private static String buildErrorMsg(List<String> dependencies, String message) { final StringBuilder buffer = new StringBuilder(); boolean isFirstElement = true; for (String dependency : dependencies) { if (!isFirstElement) { buffer.append(", "); } ...
java
private static String buildErrorMsg(List<String> dependencies, String message) { final StringBuilder buffer = new StringBuilder(); boolean isFirstElement = true; for (String dependency : dependencies) { if (!isFirstElement) { buffer.append(", "); } ...
[ "private", "static", "String", "buildErrorMsg", "(", "List", "<", "String", ">", "dependencies", ",", "String", "message", ")", "{", "final", "StringBuilder", "buffer", "=", "new", "StringBuilder", "(", ")", ";", "boolean", "isFirstElement", "=", "true", ";", ...
Get the error message with the dependencies appended @param dependencies - the list with dependencies to be attached to the message @param message - the custom error message to be displayed to the user @return String
[ "Get", "the", "error", "message", "with", "the", "dependencies", "appended" ]
ce9cc73d85f83eaa5fbc991abb593915a8c8374e
https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/resources/PromotionReportTranslator.java#L161-L174
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/CollectionPrefetcher.java
CollectionPrefetcher.buildPrefetchQuery
protected Query buildPrefetchQuery(Collection ids) { CollectionDescriptor cds = getCollectionDescriptor(); QueryByCriteria query = buildPrefetchQuery(ids, cds.getForeignKeyFieldDescriptors(getItemClassDescriptor())); // check if collection must be ordered if (!cds.getOrderBy()...
java
protected Query buildPrefetchQuery(Collection ids) { CollectionDescriptor cds = getCollectionDescriptor(); QueryByCriteria query = buildPrefetchQuery(ids, cds.getForeignKeyFieldDescriptors(getItemClassDescriptor())); // check if collection must be ordered if (!cds.getOrderBy()...
[ "protected", "Query", "buildPrefetchQuery", "(", "Collection", "ids", ")", "{", "CollectionDescriptor", "cds", "=", "getCollectionDescriptor", "(", ")", ";", "QueryByCriteria", "query", "=", "buildPrefetchQuery", "(", "ids", ",", "cds", ".", "getForeignKeyFieldDescrip...
Build the query to perform a batched read get orderBy settings from CollectionDescriptor @param ids Collection containing all identities of objects of the ONE side
[ "Build", "the", "query", "to", "perform", "a", "batched", "read", "get", "orderBy", "settings", "from", "CollectionDescriptor" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/CollectionPrefetcher.java#L110-L126
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/CollectionPrefetcher.java
CollectionPrefetcher.associateBatched
protected void associateBatched(Collection owners, Collection children) { CollectionDescriptor cds = getCollectionDescriptor(); PersistentField field = cds.getPersistentField(); PersistenceBroker pb = getBroker(); Class ownerTopLevelClass = pb.getTopLevelClass(getOwnerClassDescr...
java
protected void associateBatched(Collection owners, Collection children) { CollectionDescriptor cds = getCollectionDescriptor(); PersistentField field = cds.getPersistentField(); PersistenceBroker pb = getBroker(); Class ownerTopLevelClass = pb.getTopLevelClass(getOwnerClassDescr...
[ "protected", "void", "associateBatched", "(", "Collection", "owners", ",", "Collection", "children", ")", "{", "CollectionDescriptor", "cds", "=", "getCollectionDescriptor", "(", ")", ";", "PersistentField", "field", "=", "cds", ".", "getPersistentField", "(", ")", ...
associate the batched Children with their owner object loop over children
[ "associate", "the", "batched", "Children", "with", "their", "owner", "object", "loop", "over", "children" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/CollectionPrefetcher.java#L131-L202
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/CollectionPrefetcher.java
CollectionPrefetcher.createCollection
protected ManageableCollection createCollection(CollectionDescriptor desc, Class collectionClass) { Class fieldType = desc.getPersistentField().getType(); ManageableCollection col; if (collectionClass == null) { if (ManageableCollection.class.isAssi...
java
protected ManageableCollection createCollection(CollectionDescriptor desc, Class collectionClass) { Class fieldType = desc.getPersistentField().getType(); ManageableCollection col; if (collectionClass == null) { if (ManageableCollection.class.isAssi...
[ "protected", "ManageableCollection", "createCollection", "(", "CollectionDescriptor", "desc", ",", "Class", "collectionClass", ")", "{", "Class", "fieldType", "=", "desc", ".", "getPersistentField", "(", ")", ".", "getType", "(", ")", ";", "ManageableCollection", "c...
Create a collection object of the given collection type. If none has been given, OJB uses RemovalAwareList, RemovalAwareSet, or RemovalAwareCollection depending on the field type. @param desc The collection descriptor @param collectionClass The collection class specified in the collection-descriptor @return...
[ "Create", "a", "collection", "object", "of", "the", "given", "collection", "type", ".", "If", "none", "has", "been", "given", "OJB", "uses", "RemovalAwareList", "RemovalAwareSet", "or", "RemovalAwareCollection", "depending", "on", "the", "field", "type", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/CollectionPrefetcher.java#L213-L260
train
geomajas/geomajas-project-server
plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/HibernateLayer.java
HibernateLayer.setFeatureModel
@Api public void setFeatureModel(FeatureModel featureModel) throws LayerException { this.featureModel = featureModel; if (null != getLayerInfo()) { featureModel.setLayerInfo(getLayerInfo()); } filterService.registerFeatureModel(featureModel); }
java
@Api public void setFeatureModel(FeatureModel featureModel) throws LayerException { this.featureModel = featureModel; if (null != getLayerInfo()) { featureModel.setLayerInfo(getLayerInfo()); } filterService.registerFeatureModel(featureModel); }
[ "@", "Api", "public", "void", "setFeatureModel", "(", "FeatureModel", "featureModel", ")", "throws", "LayerException", "{", "this", ".", "featureModel", "=", "featureModel", ";", "if", "(", "null", "!=", "getLayerInfo", "(", ")", ")", "{", "featureModel", ".",...
Set the featureModel. @param featureModel feature model @throws LayerException problem setting the feature model @since 1.8.0
[ "Set", "the", "featureModel", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/HibernateLayer.java#L208-L215
train
geomajas/geomajas-project-server
plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/HibernateLayer.java
HibernateLayer.update
public void update(Object feature) throws LayerException { Session session = getSessionFactory().getCurrentSession(); session.update(feature); }
java
public void update(Object feature) throws LayerException { Session session = getSessionFactory().getCurrentSession(); session.update(feature); }
[ "public", "void", "update", "(", "Object", "feature", ")", "throws", "LayerException", "{", "Session", "session", "=", "getSessionFactory", "(", ")", ".", "getCurrentSession", "(", ")", ";", "session", ".", "update", "(", "feature", ")", ";", "}" ]
Update a feature object in the Hibernate session. @param feature feature object @throws LayerException oops
[ "Update", "a", "feature", "object", "in", "the", "Hibernate", "session", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/HibernateLayer.java#L313-L316
train
geomajas/geomajas-project-server
plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/HibernateLayer.java
HibernateLayer.enforceSrid
private void enforceSrid(Object feature) throws LayerException { Geometry geom = getFeatureModel().getGeometry(feature); if (null != geom) { geom.setSRID(srid); getFeatureModel().setGeometry(feature, geom); } }
java
private void enforceSrid(Object feature) throws LayerException { Geometry geom = getFeatureModel().getGeometry(feature); if (null != geom) { geom.setSRID(srid); getFeatureModel().setGeometry(feature, geom); } }
[ "private", "void", "enforceSrid", "(", "Object", "feature", ")", "throws", "LayerException", "{", "Geometry", "geom", "=", "getFeatureModel", "(", ")", ".", "getGeometry", "(", "feature", ")", ";", "if", "(", "null", "!=", "geom", ")", "{", "geom", ".", ...
Enforces the correct srid on incoming features. @param feature object to enforce srid on @throws LayerException problem getting or setting srid
[ "Enforces", "the", "correct", "srid", "on", "incoming", "features", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/HibernateLayer.java#L467-L473
train
geomajas/geomajas-project-server
plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/HibernateLayer.java
HibernateLayer.getBoundsLocal
private Envelope getBoundsLocal(Filter filter) throws LayerException { try { Session session = getSessionFactory().getCurrentSession(); Criteria criteria = session.createCriteria(getFeatureInfo().getDataSourceName()); CriteriaVisitor visitor = new CriteriaVisitor((HibernateFeatureModel) getFeatureModel(), da...
java
private Envelope getBoundsLocal(Filter filter) throws LayerException { try { Session session = getSessionFactory().getCurrentSession(); Criteria criteria = session.createCriteria(getFeatureInfo().getDataSourceName()); CriteriaVisitor visitor = new CriteriaVisitor((HibernateFeatureModel) getFeatureModel(), da...
[ "private", "Envelope", "getBoundsLocal", "(", "Filter", "filter", ")", "throws", "LayerException", "{", "try", "{", "Session", "session", "=", "getSessionFactory", "(", ")", ".", "getCurrentSession", "(", ")", ";", "Criteria", "criteria", "=", "session", ".", ...
Bounds are calculated locally, can use any filter, but slower than native. @param filter filter which needs to be applied @return the bounds of the specified features @throws LayerException oops
[ "Bounds", "are", "calculated", "locally", "can", "use", "any", "filter", "but", "slower", "than", "native", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/HibernateLayer.java#L484-L507
train
geomajas/geomajas-project-server
impl/src/main/java/org/geomajas/spring/ThreadScopeContext.java
ThreadScopeContext.getBean
public Object getBean(String name) { Bean bean = beans.get(name); if (null == bean) { return null; } return bean.object; }
java
public Object getBean(String name) { Bean bean = beans.get(name); if (null == bean) { return null; } return bean.object; }
[ "public", "Object", "getBean", "(", "String", "name", ")", "{", "Bean", "bean", "=", "beans", ".", "get", "(", "name", ")", ";", "if", "(", "null", "==", "bean", ")", "{", "return", "null", ";", "}", "return", "bean", ".", "object", ";", "}" ]
Get a bean value from the context. @param name bean name @return bean value or null
[ "Get", "a", "bean", "value", "from", "the", "context", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/spring/ThreadScopeContext.java#L33-L39
train
geomajas/geomajas-project-server
impl/src/main/java/org/geomajas/spring/ThreadScopeContext.java
ThreadScopeContext.setBean
public void setBean(String name, Object object) { Bean bean = beans.get(name); if (null == bean) { bean = new Bean(); beans.put(name, bean); } bean.object = object; }
java
public void setBean(String name, Object object) { Bean bean = beans.get(name); if (null == bean) { bean = new Bean(); beans.put(name, bean); } bean.object = object; }
[ "public", "void", "setBean", "(", "String", "name", ",", "Object", "object", ")", "{", "Bean", "bean", "=", "beans", ".", "get", "(", "name", ")", ";", "if", "(", "null", "==", "bean", ")", "{", "bean", "=", "new", "Bean", "(", ")", ";", "beans",...
Set a bean in the context. @param name bean name @param object bean value
[ "Set", "a", "bean", "in", "the", "context", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/spring/ThreadScopeContext.java#L47-L54
train
geomajas/geomajas-project-server
impl/src/main/java/org/geomajas/spring/ThreadScopeContext.java
ThreadScopeContext.remove
public Object remove(String name) { Bean bean = beans.get(name); if (null != bean) { beans.remove(name); bean.destructionCallback.run(); return bean.object; } return null; }
java
public Object remove(String name) { Bean bean = beans.get(name); if (null != bean) { beans.remove(name); bean.destructionCallback.run(); return bean.object; } return null; }
[ "public", "Object", "remove", "(", "String", "name", ")", "{", "Bean", "bean", "=", "beans", ".", "get", "(", "name", ")", ";", "if", "(", "null", "!=", "bean", ")", "{", "beans", ".", "remove", "(", "name", ")", ";", "bean", ".", "destructionCallb...
Remove a bean from the context, calling the destruction callback if any. @param name bean name @return previous value
[ "Remove", "a", "bean", "from", "the", "context", "calling", "the", "destruction", "callback", "if", "any", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/spring/ThreadScopeContext.java#L62-L70
train
geomajas/geomajas-project-server
impl/src/main/java/org/geomajas/spring/ThreadScopeContext.java
ThreadScopeContext.registerDestructionCallback
public void registerDestructionCallback(String name, Runnable callback) { Bean bean = beans.get(name); if (null == bean) { bean = new Bean(); beans.put(name, bean); } bean.destructionCallback = callback; }
java
public void registerDestructionCallback(String name, Runnable callback) { Bean bean = beans.get(name); if (null == bean) { bean = new Bean(); beans.put(name, bean); } bean.destructionCallback = callback; }
[ "public", "void", "registerDestructionCallback", "(", "String", "name", ",", "Runnable", "callback", ")", "{", "Bean", "bean", "=", "beans", ".", "get", "(", "name", ")", ";", "if", "(", "null", "==", "bean", ")", "{", "bean", "=", "new", "Bean", "(", ...
Register the given callback as to be executed after request completion. @param name The name of the bean. @param callback The callback of the bean to be executed for destruction.
[ "Register", "the", "given", "callback", "as", "to", "be", "executed", "after", "request", "completion", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/spring/ThreadScopeContext.java#L78-L85
train
geomajas/geomajas-project-server
impl/src/main/java/org/geomajas/spring/ThreadScopeContext.java
ThreadScopeContext.clear
public void clear() { for (Bean bean : beans.values()) { if (null != bean.destructionCallback) { bean.destructionCallback.run(); } } beans.clear(); }
java
public void clear() { for (Bean bean : beans.values()) { if (null != bean.destructionCallback) { bean.destructionCallback.run(); } } beans.clear(); }
[ "public", "void", "clear", "(", ")", "{", "for", "(", "Bean", "bean", ":", "beans", ".", "values", "(", ")", ")", "{", "if", "(", "null", "!=", "bean", ".", "destructionCallback", ")", "{", "bean", ".", "destructionCallback", ".", "run", "(", ")", ...
Clear all beans and call the destruction callback.
[ "Clear", "all", "beans", "and", "call", "the", "destruction", "callback", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/spring/ThreadScopeContext.java#L88-L95
train
geomajas/geomajas-project-server
plugin/layer-wms/wms/src/main/java/org/geomajas/layer/wms/mvc/WmsProxyController.java
WmsProxyController.parseLayerId
private String parseLayerId(HttpServletRequest request) { StringTokenizer tokenizer = new StringTokenizer(request.getRequestURI(), "/"); String token = ""; while (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); } return token; }
java
private String parseLayerId(HttpServletRequest request) { StringTokenizer tokenizer = new StringTokenizer(request.getRequestURI(), "/"); String token = ""; while (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); } return token; }
[ "private", "String", "parseLayerId", "(", "HttpServletRequest", "request", ")", "{", "StringTokenizer", "tokenizer", "=", "new", "StringTokenizer", "(", "request", ".", "getRequestURI", "(", ")", ",", "\"/\"", ")", ";", "String", "token", "=", "\"\"", ";", "wh...
Get the layer ID out of the request URL. @param request servlet request @return layer id
[ "Get", "the", "layer", "ID", "out", "of", "the", "request", "URL", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-wms/wms/src/main/java/org/geomajas/layer/wms/mvc/WmsProxyController.java#L129-L136
train
geomajas/geomajas-project-server
plugin/layer-wms/wms/src/main/java/org/geomajas/layer/wms/mvc/WmsProxyController.java
WmsProxyController.getLayer
private WmsLayer getLayer(String layerId) { RasterLayer layer = configurationService.getRasterLayer(layerId); if (layer instanceof WmsLayer) { return (WmsLayer) layer; } return null; }
java
private WmsLayer getLayer(String layerId) { RasterLayer layer = configurationService.getRasterLayer(layerId); if (layer instanceof WmsLayer) { return (WmsLayer) layer; } return null; }
[ "private", "WmsLayer", "getLayer", "(", "String", "layerId", ")", "{", "RasterLayer", "layer", "=", "configurationService", ".", "getRasterLayer", "(", "layerId", ")", ";", "if", "(", "layer", "instanceof", "WmsLayer", ")", "{", "return", "(", "WmsLayer", ")",...
Given a layer ID, search for the WMS layer. @param layerId layer id @return WMS layer or null if layer is not a WMS layer
[ "Given", "a", "layer", "ID", "search", "for", "the", "WMS", "layer", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-wms/wms/src/main/java/org/geomajas/layer/wms/mvc/WmsProxyController.java#L144-L150
train
geomajas/geomajas-project-server
plugin/layer-wms/wms/src/main/java/org/geomajas/layer/wms/mvc/WmsProxyController.java
WmsProxyController.createErrorImage
private byte[] createErrorImage(int width, int height, Exception e) throws IOException { String error = e.getMessage(); if (null == error) { Writer result = new StringWriter(); PrintWriter printWriter = new PrintWriter(result); e.printStackTrace(printWriter); error = result.toString(); } BufferedIm...
java
private byte[] createErrorImage(int width, int height, Exception e) throws IOException { String error = e.getMessage(); if (null == error) { Writer result = new StringWriter(); PrintWriter printWriter = new PrintWriter(result); e.printStackTrace(printWriter); error = result.toString(); } BufferedIm...
[ "private", "byte", "[", "]", "createErrorImage", "(", "int", "width", ",", "int", "height", ",", "Exception", "e", ")", "throws", "IOException", "{", "String", "error", "=", "e", ".", "getMessage", "(", ")", ";", "if", "(", "null", "==", "error", ")", ...
Create an error image should an error occur while fetching a WMS map. @param width image width @param height image height @param e exception @return error image @throws java.io.IOException oops
[ "Create", "an", "error", "image", "should", "an", "error", "occur", "while", "fetching", "a", "WMS", "map", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-wms/wms/src/main/java/org/geomajas/layer/wms/mvc/WmsProxyController.java#L161-L183
train
foundation-runtime/logging
logging-log4j/src/main/java/com/cisco/oss/foundation/logging/LoggingHelper.java
LoggingHelper.formatConnectionEstablishmentMessage
public static String formatConnectionEstablishmentMessage(final String connectionName, final String host, final String connectionReason) { return CON_ESTABLISHMENT_FORMAT.format(new Object[] { connectionName, host, connectionReason }); }
java
public static String formatConnectionEstablishmentMessage(final String connectionName, final String host, final String connectionReason) { return CON_ESTABLISHMENT_FORMAT.format(new Object[] { connectionName, host, connectionReason }); }
[ "public", "static", "String", "formatConnectionEstablishmentMessage", "(", "final", "String", "connectionName", ",", "final", "String", "host", ",", "final", "String", "connectionReason", ")", "{", "return", "CON_ESTABLISHMENT_FORMAT", ".", "format", "(", "new", "Obje...
Helper method for formatting connection establishment messages. @param connectionName The name of the connection @param host The remote host @param connectionReason The reason for establishing the connection @return A formatted message in the format: "[&lt;connectionName&gt;] remote host[&lt;host&gt;] &lt;connectionRe...
[ "Helper", "method", "for", "formatting", "connection", "establishment", "messages", "." ]
cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6
https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-log4j/src/main/java/com/cisco/oss/foundation/logging/LoggingHelper.java#L465-L467
train
foundation-runtime/logging
logging-log4j/src/main/java/com/cisco/oss/foundation/logging/LoggingHelper.java
LoggingHelper.formatConnectionTerminationMessage
public static String formatConnectionTerminationMessage(final String connectionName, final String host, final String connectionReason, final String terminationReason) { return CON_TERMINATION_FORMAT.format(new Object[] { connectionName, host, connectionReason, terminationReason }); }
java
public static String formatConnectionTerminationMessage(final String connectionName, final String host, final String connectionReason, final String terminationReason) { return CON_TERMINATION_FORMAT.format(new Object[] { connectionName, host, connectionReason, terminationReason }); }
[ "public", "static", "String", "formatConnectionTerminationMessage", "(", "final", "String", "connectionName", ",", "final", "String", "host", ",", "final", "String", "connectionReason", ",", "final", "String", "terminationReason", ")", "{", "return", "CON_TERMINATION_FO...
Helper method for formatting connection termination messages. @param connectionName The name of the connection @param host The remote host @param connectionReason The reason for establishing the connection @param terminationReason The reason for terminating the connection @return A formatted message in the format: "[&...
[ "Helper", "method", "for", "formatting", "connection", "termination", "messages", "." ]
cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6
https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-log4j/src/main/java/com/cisco/oss/foundation/logging/LoggingHelper.java#L486-L488
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/JdbcMetadataUtils.java
JdbcMetadataUtils.findPlatformFor
public String findPlatformFor(String jdbcSubProtocol, String jdbcDriver) { String platform = (String)jdbcSubProtocolToPlatform.get(jdbcSubProtocol); if (platform == null) { platform = (String)jdbcDriverToPlatform.get(jdbcDriver); } return platform; }
java
public String findPlatformFor(String jdbcSubProtocol, String jdbcDriver) { String platform = (String)jdbcSubProtocolToPlatform.get(jdbcSubProtocol); if (platform == null) { platform = (String)jdbcDriverToPlatform.get(jdbcDriver); } return platform; }
[ "public", "String", "findPlatformFor", "(", "String", "jdbcSubProtocol", ",", "String", "jdbcDriver", ")", "{", "String", "platform", "=", "(", "String", ")", "jdbcSubProtocolToPlatform", ".", "get", "(", "jdbcSubProtocol", ")", ";", "if", "(", "platform", "==",...
Derives the OJB platform to use for a database that is connected via a url using the specified subprotocol, and where the specified jdbc driver is used. @param jdbcSubProtocol The JDBC subprotocol used to connect to the database @param jdbcDriver The JDBC driver used to connect to the database @return The platfor...
[ "Derives", "the", "OJB", "platform", "to", "use", "for", "a", "database", "that", "is", "connected", "via", "a", "url", "using", "the", "specified", "subprotocol", "and", "where", "the", "specified", "jdbc", "driver", "is", "used", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/JdbcMetadataUtils.java#L391-L400
train
Axway/Grapes
server/src/main/java/org/axway/grapes/server/webapp/DataValidator.java
DataValidator.validate
public static void validate(final License license) { // A license should have a name if(license.getName() == null || license.getName().isEmpty()){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity("License name should n...
java
public static void validate(final License license) { // A license should have a name if(license.getName() == null || license.getName().isEmpty()){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity("License name should n...
[ "public", "static", "void", "validate", "(", "final", "License", "license", ")", "{", "// A license should have a name", "if", "(", "license", ".", "getName", "(", ")", "==", "null", "||", "license", ".", "getName", "(", ")", ".", "isEmpty", "(", ")", ")",...
Checks if the provided license is valid and could be stored into the database @param license the license to test @throws WebApplicationException if the data is corrupted
[ "Checks", "if", "the", "provided", "license", "is", "valid", "and", "could", "be", "stored", "into", "the", "database" ]
ce9cc73d85f83eaa5fbc991abb593915a8c8374e
https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/DataValidator.java#L88-L123
train
Axway/Grapes
server/src/main/java/org/axway/grapes/server/webapp/DataValidator.java
DataValidator.validate
public static void validate(final Module module) { if (null == module) { throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity("Module cannot be null!") .build()); } if(module.getName() == null || module...
java
public static void validate(final Module module) { if (null == module) { throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity("Module cannot be null!") .build()); } if(module.getName() == null || module...
[ "public", "static", "void", "validate", "(", "final", "Module", "module", ")", "{", "if", "(", "null", "==", "module", ")", "{", "throw", "new", "WebApplicationException", "(", "Response", ".", "status", "(", "Response", ".", "Status", ".", "BAD_REQUEST", ...
Checks if the provided module is valid and could be stored into the database @param module the module to test @throws WebApplicationException if the data is corrupted
[ "Checks", "if", "the", "provided", "module", "is", "valid", "and", "could", "be", "stored", "into", "the", "database" ]
ce9cc73d85f83eaa5fbc991abb593915a8c8374e
https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/DataValidator.java#L131-L159
train
Axway/Grapes
server/src/main/java/org/axway/grapes/server/webapp/DataValidator.java
DataValidator.validate
public static void validate(final Organization organization) { if(organization.getName() == null || organization.getName().isEmpty()){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity("Organization name cannot be null or empty...
java
public static void validate(final Organization organization) { if(organization.getName() == null || organization.getName().isEmpty()){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity("Organization name cannot be null or empty...
[ "public", "static", "void", "validate", "(", "final", "Organization", "organization", ")", "{", "if", "(", "organization", ".", "getName", "(", ")", "==", "null", "||", "organization", ".", "getName", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "throw"...
Checks if the provided organization is valid and could be stored into the database @param organization Organization @throws WebApplicationException if the data is corrupted
[ "Checks", "if", "the", "provided", "organization", "is", "valid", "and", "could", "be", "stored", "into", "the", "database" ]
ce9cc73d85f83eaa5fbc991abb593915a8c8374e
https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/DataValidator.java#L167-L174
train
Axway/Grapes
server/src/main/java/org/axway/grapes/server/webapp/DataValidator.java
DataValidator.validate
public static void validate(final ArtifactQuery artifactQuery) { final Pattern invalidChars = Pattern.compile("[^A-Fa-f0-9]"); if(artifactQuery.getUser() == null || artifactQuery.getUser().isEmpty()){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) ...
java
public static void validate(final ArtifactQuery artifactQuery) { final Pattern invalidChars = Pattern.compile("[^A-Fa-f0-9]"); if(artifactQuery.getUser() == null || artifactQuery.getUser().isEmpty()){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) ...
[ "public", "static", "void", "validate", "(", "final", "ArtifactQuery", "artifactQuery", ")", "{", "final", "Pattern", "invalidChars", "=", "Pattern", ".", "compile", "(", "\"[^A-Fa-f0-9]\"", ")", ";", "if", "(", "artifactQuery", ".", "getUser", "(", ")", "==",...
Checks if the provided artifactQuery is valid @param artifactQuery ArtifactQuery @throws WebApplicationException if the data is corrupted
[ "Checks", "if", "the", "provided", "artifactQuery", "is", "valid" ]
ce9cc73d85f83eaa5fbc991abb593915a8c8374e
https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/DataValidator.java#L182-L218
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNextValImpl.java
SequenceManagerNextValImpl.getUniqueLong
protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException { long result; // lookup sequence name String sequenceName = calculateSequenceName(field); try { result = buildNextSequence(field.getClassDescriptor(), sequenceName); ...
java
protected long getUniqueLong(FieldDescriptor field) throws SequenceManagerException { long result; // lookup sequence name String sequenceName = calculateSequenceName(field); try { result = buildNextSequence(field.getClassDescriptor(), sequenceName); ...
[ "protected", "long", "getUniqueLong", "(", "FieldDescriptor", "field", ")", "throws", "SequenceManagerException", "{", "long", "result", ";", "// lookup sequence name\r", "String", "sequenceName", "=", "calculateSequenceName", "(", "field", ")", ";", "try", "{", "resu...
returns a unique long value for class clazz and field fieldName. the returned number is unique accross all tables in the extent of clazz.
[ "returns", "a", "unique", "long", "value", "for", "class", "clazz", "and", "field", "fieldName", ".", "the", "returned", "number", "is", "unique", "accross", "all", "tables", "in", "the", "extent", "of", "clazz", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/sequence/SequenceManagerNextValImpl.java#L118-L155
train
kuali/ojb-1.0.4
src/jdori/org/apache/ojb/jdori/sql/OjbExtent.java
OjbExtent.provideStateManagers
protected Collection provideStateManagers(Collection pojos) { PersistenceCapable pc; int [] fieldNums; Iterator iter = pojos.iterator(); Collection result = new ArrayList(); while (iter.hasNext()) { // obtain a StateManager pc = (PersistenceCapable) iter.nex...
java
protected Collection provideStateManagers(Collection pojos) { PersistenceCapable pc; int [] fieldNums; Iterator iter = pojos.iterator(); Collection result = new ArrayList(); while (iter.hasNext()) { // obtain a StateManager pc = (PersistenceCapable) iter.nex...
[ "protected", "Collection", "provideStateManagers", "(", "Collection", "pojos", ")", "{", "PersistenceCapable", "pc", ";", "int", "[", "]", "fieldNums", ";", "Iterator", "iter", "=", "pojos", ".", "iterator", "(", ")", ";", "Collection", "result", "=", "new", ...
This methods enhances the objects loaded by a broker query with a JDO StateManager an brings them under JDO control. @param pojos the OJB pojos as obtained by the broker @return the collection of JDO PersistenceCapable instances
[ "This", "methods", "enhances", "the", "objects", "loaded", "by", "a", "broker", "query", "with", "a", "JDO", "StateManager", "an", "brings", "them", "under", "JDO", "control", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/jdori/org/apache/ojb/jdori/sql/OjbExtent.java#L120-L147
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/otm/copy/ReflectiveObjectCopyStrategy.java
ReflectiveObjectCopyStrategy.copy
public final Object copy(final Object toCopy, PersistenceBroker broker) { return clone(toCopy, IdentityMapFactory.getIdentityMap(), new HashMap()); }
java
public final Object copy(final Object toCopy, PersistenceBroker broker) { return clone(toCopy, IdentityMapFactory.getIdentityMap(), new HashMap()); }
[ "public", "final", "Object", "copy", "(", "final", "Object", "toCopy", ",", "PersistenceBroker", "broker", ")", "{", "return", "clone", "(", "toCopy", ",", "IdentityMapFactory", ".", "getIdentityMap", "(", ")", ",", "new", "HashMap", "(", ")", ")", ";", "}...
makes a deep clone of the object, using reflection. @param toCopy the object you want to copy @return
[ "makes", "a", "deep", "clone", "of", "the", "object", "using", "reflection", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/otm/copy/ReflectiveObjectCopyStrategy.java#L61-L64
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/otm/copy/ReflectiveObjectCopyStrategy.java
ReflectiveObjectCopyStrategy.setFields
private static void setFields(final Object from, final Object to, final Field[] fields, final boolean accessible, final Map objMap, final Map metadataMap) { for (int f = 0, fieldsLength = fields.length; f < fieldsLength; ++f) { final Field fiel...
java
private static void setFields(final Object from, final Object to, final Field[] fields, final boolean accessible, final Map objMap, final Map metadataMap) { for (int f = 0, fieldsLength = fields.length; f < fieldsLength; ++f) { final Field fiel...
[ "private", "static", "void", "setFields", "(", "final", "Object", "from", ",", "final", "Object", "to", ",", "final", "Field", "[", "]", "fields", ",", "final", "boolean", "accessible", ",", "final", "Map", "objMap", ",", "final", "Map", "metadataMap", ")"...
copy all fields from the "from" object to the "to" object. @param from source object @param to from's clone @param fields fields to be populated @param accessible 'true' if all 'fields' have been made accessible during traversal
[ "copy", "all", "fields", "from", "the", "from", "object", "to", "the", "to", "object", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/otm/copy/ReflectiveObjectCopyStrategy.java#L239-L270
train
kuali/ojb-1.0.4
src/tools/org/apache/ojb/tools/mapping/reversedb2/dnd2/DragHelper.java
DragHelper.registerComponent
public void registerComponent(java.awt.Component c) { unregisterComponent(c); if (recognizerAbstractClass == null) { hmDragGestureRecognizers.put(c, dragSource.createDefaultDragGestureRecognizer(c, dragWorker.getAcceptableActions(c), ...
java
public void registerComponent(java.awt.Component c) { unregisterComponent(c); if (recognizerAbstractClass == null) { hmDragGestureRecognizers.put(c, dragSource.createDefaultDragGestureRecognizer(c, dragWorker.getAcceptableActions(c), ...
[ "public", "void", "registerComponent", "(", "java", ".", "awt", ".", "Component", "c", ")", "{", "unregisterComponent", "(", "c", ")", ";", "if", "(", "recognizerAbstractClass", "==", "null", ")", "{", "hmDragGestureRecognizers", ".", "put", "(", "c", ",", ...
add a Component to this Worker. After the call dragging is enabled for this Component. @param c the Component to register
[ "add", "a", "Component", "to", "this", "Worker", ".", "After", "the", "call", "dragging", "is", "enabled", "for", "this", "Component", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/tools/org/apache/ojb/tools/mapping/reversedb2/dnd2/DragHelper.java#L108-L125
train
kuali/ojb-1.0.4
src/tools/org/apache/ojb/tools/mapping/reversedb2/dnd2/DragHelper.java
DragHelper.unregisterComponent
public void unregisterComponent(java.awt.Component c) { java.awt.dnd.DragGestureRecognizer recognizer = (java.awt.dnd.DragGestureRecognizer)this.hmDragGestureRecognizers.remove(c); if (recognizer != null) recognizer.setComponent(null); }
java
public void unregisterComponent(java.awt.Component c) { java.awt.dnd.DragGestureRecognizer recognizer = (java.awt.dnd.DragGestureRecognizer)this.hmDragGestureRecognizers.remove(c); if (recognizer != null) recognizer.setComponent(null); }
[ "public", "void", "unregisterComponent", "(", "java", ".", "awt", ".", "Component", "c", ")", "{", "java", ".", "awt", ".", "dnd", ".", "DragGestureRecognizer", "recognizer", "=", "(", "java", ".", "awt", ".", "dnd", ".", "DragGestureRecognizer", ")", "thi...
remove drag support from the given Component. @param c the Component to remove
[ "remove", "drag", "support", "from", "the", "given", "Component", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/tools/org/apache/ojb/tools/mapping/reversedb2/dnd2/DragHelper.java#L130-L136
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/interceptor/Interceptor.java
Interceptor.doInvoke
protected Object doInvoke(Object proxy, Method methodToBeInvoked, Object[] args) throws Throwable { Method m = getRealSubject().getClass().getMethod( methodToBeInvoked.getName(), methodToBeInvoked.getParameterTypes()); return m.invoke(getRealSubject(), args); }
java
protected Object doInvoke(Object proxy, Method methodToBeInvoked, Object[] args) throws Throwable { Method m = getRealSubject().getClass().getMethod( methodToBeInvoked.getName(), methodToBeInvoked.getParameterTypes()); return m.invoke(getRealSubject(), args); }
[ "protected", "Object", "doInvoke", "(", "Object", "proxy", ",", "Method", "methodToBeInvoked", ",", "Object", "[", "]", "args", ")", "throws", "Throwable", "{", "Method", "m", "=", "getRealSubject", "(", ")", ".", "getClass", "(", ")", ".", "getMethod", "(...
this method will be invoked after methodToBeInvoked is invoked
[ "this", "method", "will", "be", "invoked", "after", "methodToBeInvoked", "is", "invoked" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/interceptor/Interceptor.java#L62-L70
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/ChainingIterator.java
ChainingIterator.addIterator
public void addIterator(OJBIterator iterator) { /** * only add iterators that are not null and non-empty. */ if (iterator != null) { if (iterator.hasNext()) { setNextIterator(); m_rsIterators.add(iterator); ...
java
public void addIterator(OJBIterator iterator) { /** * only add iterators that are not null and non-empty. */ if (iterator != null) { if (iterator.hasNext()) { setNextIterator(); m_rsIterators.add(iterator); ...
[ "public", "void", "addIterator", "(", "OJBIterator", "iterator", ")", "{", "/**\r\n * only add iterators that are not null and non-empty.\r\n */", "if", "(", "iterator", "!=", "null", ")", "{", "if", "(", "iterator", ".", "hasNext", "(", ")", ")", "{",...
use this method to construct the ChainingIterator iterator by iterator.
[ "use", "this", "method", "to", "construct", "the", "ChainingIterator", "iterator", "by", "iterator", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ChainingIterator.java#L90-L103
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/ChainingIterator.java
ChainingIterator.absolute
public boolean absolute(int row) throws PersistenceBrokerException { // 1. handle the special cases first. if (row == 0) { return true; } if (row == 1) { m_activeIteratorIndex = 0; m_activeIterator = (OJBIterator) m_rsIt...
java
public boolean absolute(int row) throws PersistenceBrokerException { // 1. handle the special cases first. if (row == 0) { return true; } if (row == 1) { m_activeIteratorIndex = 0; m_activeIterator = (OJBIterator) m_rsIt...
[ "public", "boolean", "absolute", "(", "int", "row", ")", "throws", "PersistenceBrokerException", "{", "// 1. handle the special cases first.\r", "if", "(", "row", "==", "0", ")", "{", "return", "true", ";", "}", "if", "(", "row", "==", "1", ")", "{", "m_acti...
the absolute and relative calls are the trickiest parts. We have to move across cursor boundaries potentially. a + row value indexes from beginning of resultset a - row value indexes from the end of th resulset. Calling absolute(1) is the same as calling first(). Calling absolute(-1) is the same as calling last().
[ "the", "absolute", "and", "relative", "calls", "are", "the", "trickiest", "parts", ".", "We", "have", "to", "move", "across", "cursor", "boundaries", "potentially", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ChainingIterator.java#L144-L219
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/ChainingIterator.java
ChainingIterator.releaseDbResources
public void releaseDbResources() { Iterator it = m_rsIterators.iterator(); while (it.hasNext()) { ((OJBIterator) it.next()).releaseDbResources(); } }
java
public void releaseDbResources() { Iterator it = m_rsIterators.iterator(); while (it.hasNext()) { ((OJBIterator) it.next()).releaseDbResources(); } }
[ "public", "void", "releaseDbResources", "(", ")", "{", "Iterator", "it", "=", "m_rsIterators", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "(", "(", "OJBIterator", ")", "it", ".", "next", "(", ")", ")", "...
delegate to each contained OJBIterator and release its resources.
[ "delegate", "to", "each", "contained", "OJBIterator", "and", "release", "its", "resources", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ChainingIterator.java#L288-L295
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/ChainingIterator.java
ChainingIterator.setNextIterator
private boolean setNextIterator() { boolean retval = false; // first, check if the activeIterator is null, and set it. if (m_activeIterator == null) { if (m_rsIterators.size() > 0) { m_activeIteratorIndex = 0; m_current...
java
private boolean setNextIterator() { boolean retval = false; // first, check if the activeIterator is null, and set it. if (m_activeIterator == null) { if (m_rsIterators.size() > 0) { m_activeIteratorIndex = 0; m_current...
[ "private", "boolean", "setNextIterator", "(", ")", "{", "boolean", "retval", "=", "false", ";", "// first, check if the activeIterator is null, and set it.\r", "if", "(", "m_activeIterator", "==", "null", ")", "{", "if", "(", "m_rsIterators", ".", "size", "(", ")", ...
Convenience routine to move to the next iterator if needed. @return true if the iterator is changed, false if no changes.
[ "Convenience", "routine", "to", "move", "to", "the", "next", "iterator", "if", "needed", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ChainingIterator.java#L338-L366
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/ChainingIterator.java
ChainingIterator.containsIteratorForTable
public boolean containsIteratorForTable(String aTable) { boolean result = false; if (m_rsIterators != null) { for (int i = 0; i < m_rsIterators.size(); i++) { OJBIterator it = (OJBIterator) m_rsIterators.get(i); if (it instanc...
java
public boolean containsIteratorForTable(String aTable) { boolean result = false; if (m_rsIterators != null) { for (int i = 0; i < m_rsIterators.size(); i++) { OJBIterator it = (OJBIterator) m_rsIterators.get(i); if (it instanc...
[ "public", "boolean", "containsIteratorForTable", "(", "String", "aTable", ")", "{", "boolean", "result", "=", "false", ";", "if", "(", "m_rsIterators", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "m_rsIterators", ".", "size",...
Answer true if an Iterator for a Table is already available @param aTable @return
[ "Answer", "true", "if", "an", "Iterator", "for", "a", "Table", "is", "already", "available" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ChainingIterator.java#L373-L398
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/query/QueryByIdentity.java
QueryByIdentity.getSearchClass
public Class getSearchClass() { Object obj = getExampleObject(); if (obj instanceof Identity) { return ((Identity) obj).getObjectsTopLevelClass(); } else { return obj.getClass(); } }
java
public Class getSearchClass() { Object obj = getExampleObject(); if (obj instanceof Identity) { return ((Identity) obj).getObjectsTopLevelClass(); } else { return obj.getClass(); } }
[ "public", "Class", "getSearchClass", "(", ")", "{", "Object", "obj", "=", "getExampleObject", "(", ")", ";", "if", "(", "obj", "instanceof", "Identity", ")", "{", "return", "(", "(", "Identity", ")", "obj", ")", ".", "getObjectsTopLevelClass", "(", ")", ...
Answer the search class. This is the class of the example object or the class represented by Identity. @return Class
[ "Answer", "the", "search", "class", ".", "This", "is", "the", "class", "of", "the", "example", "object", "or", "the", "class", "represented", "by", "Identity", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/QueryByIdentity.java#L87-L99
train
geomajas/geomajas-project-server
impl/src/main/java/org/geomajas/internal/service/ConfigurationServiceImpl.java
ConfigurationServiceImpl.getBeanOrNull
private <T> T getBeanOrNull(String name, Class<T> requiredType) { if (name == null || !applicationContext.containsBean(name)) { return null; } else { try { return applicationContext.getBean(name, requiredType); } catch (BeansException be) { log.error("Error during getBeanOrNull, not rethrown, " + b...
java
private <T> T getBeanOrNull(String name, Class<T> requiredType) { if (name == null || !applicationContext.containsBean(name)) { return null; } else { try { return applicationContext.getBean(name, requiredType); } catch (BeansException be) { log.error("Error during getBeanOrNull, not rethrown, " + b...
[ "private", "<", "T", ">", "T", "getBeanOrNull", "(", "String", "name", ",", "Class", "<", "T", ">", "requiredType", ")", "{", "if", "(", "name", "==", "null", "||", "!", "applicationContext", ".", "containsBean", "(", "name", ")", ")", "{", "return", ...
Get a bean from the application context. Returns null if the bean does not exist. @param name name of bean @param requiredType type of bean @return the bean or null
[ "Get", "a", "bean", "from", "the", "application", "context", ".", "Returns", "null", "if", "the", "bean", "does", "not", "exist", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/internal/service/ConfigurationServiceImpl.java#L105-L116
train
geomajas/geomajas-project-server
plugin/cache/cache/src/main/java/org/geomajas/plugin/caching/service/CachingSupportServiceSecurityContextAdderImpl.java
CachingSupportServiceSecurityContextAdderImpl.restoreSecurityContext
public void restoreSecurityContext(CacheContext context) { SavedAuthorization cached = context.get(CacheContext.SECURITY_CONTEXT_KEY, SavedAuthorization.class); if (cached != null) { log.debug("Restoring security context {}", cached); securityManager.restoreSecurityContext(cached); } else { securityManag...
java
public void restoreSecurityContext(CacheContext context) { SavedAuthorization cached = context.get(CacheContext.SECURITY_CONTEXT_KEY, SavedAuthorization.class); if (cached != null) { log.debug("Restoring security context {}", cached); securityManager.restoreSecurityContext(cached); } else { securityManag...
[ "public", "void", "restoreSecurityContext", "(", "CacheContext", "context", ")", "{", "SavedAuthorization", "cached", "=", "context", ".", "get", "(", "CacheContext", ".", "SECURITY_CONTEXT_KEY", ",", "SavedAuthorization", ".", "class", ")", ";", "if", "(", "cache...
Puts the cached security context in the thread local. @param context the cache context
[ "Puts", "the", "cached", "security", "context", "in", "the", "thread", "local", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/cache/cache/src/main/java/org/geomajas/plugin/caching/service/CachingSupportServiceSecurityContextAdderImpl.java#L42-L50
train
foundation-runtime/logging
logging-log4j/src/main/java/com/cisco/oss/foundation/logging/appender/LogFileList.java
LogFileList.sortFileList
private void sortFileList() { if (this.size() > 1) { Collections.sort(this.fileList, new Comparator() { public final int compare(final Object o1, final Object o2) { final File f1 = (File) o1; final File f2 = (File) o2; final Object[] f1TimeAndCount = backupSuffixHelper ...
java
private void sortFileList() { if (this.size() > 1) { Collections.sort(this.fileList, new Comparator() { public final int compare(final Object o1, final Object o2) { final File f1 = (File) o1; final File f2 = (File) o2; final Object[] f1TimeAndCount = backupSuffixHelper ...
[ "private", "void", "sortFileList", "(", ")", "{", "if", "(", "this", ".", "size", "(", ")", ">", "1", ")", "{", "Collections", ".", "sort", "(", "this", ".", "fileList", ",", "new", "Comparator", "(", ")", "{", "public", "final", "int", "compare", ...
Sort by time bucket, then backup count, and by compression state.
[ "Sort", "by", "time", "bucket", "then", "backup", "count", "and", "by", "compression", "state", "." ]
cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6
https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-log4j/src/main/java/com/cisco/oss/foundation/logging/appender/LogFileList.java#L125-L175
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.getRealClassDescriptor
private ClassDescriptor getRealClassDescriptor(ClassDescriptor aCld, Object anObj) { ClassDescriptor result; if(aCld.getClassOfObject() == ProxyHelper.getRealClass(anObj)) { result = aCld; } else { result = aCld.getRepository().getDe...
java
private ClassDescriptor getRealClassDescriptor(ClassDescriptor aCld, Object anObj) { ClassDescriptor result; if(aCld.getClassOfObject() == ProxyHelper.getRealClass(anObj)) { result = aCld; } else { result = aCld.getRepository().getDe...
[ "private", "ClassDescriptor", "getRealClassDescriptor", "(", "ClassDescriptor", "aCld", ",", "Object", "anObj", ")", "{", "ClassDescriptor", "result", ";", "if", "(", "aCld", ".", "getClassOfObject", "(", ")", "==", "ProxyHelper", ".", "getRealClass", "(", "anObj"...
Answer the real ClassDescriptor for anObj ie. aCld may be an Interface of anObj, so the cld for anObj is returned
[ "Answer", "the", "real", "ClassDescriptor", "for", "anObj", "ie", ".", "aCld", "may", "be", "an", "Interface", "of", "anObj", "so", "the", "cld", "for", "anObj", "is", "returned" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L141-L155
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.getKeyValues
public ValueContainer[] getKeyValues(ClassDescriptor cld, Object objectOrProxy, boolean convertToSql) throws PersistenceBrokerException { IndirectionHandler handler = ProxyHelper.getIndirectionHandler(objectOrProxy); if(handler != null) { return getKeyValues(cld, handler.g...
java
public ValueContainer[] getKeyValues(ClassDescriptor cld, Object objectOrProxy, boolean convertToSql) throws PersistenceBrokerException { IndirectionHandler handler = ProxyHelper.getIndirectionHandler(objectOrProxy); if(handler != null) { return getKeyValues(cld, handler.g...
[ "public", "ValueContainer", "[", "]", "getKeyValues", "(", "ClassDescriptor", "cld", ",", "Object", "objectOrProxy", ",", "boolean", "convertToSql", ")", "throws", "PersistenceBrokerException", "{", "IndirectionHandler", "handler", "=", "ProxyHelper", ".", "getIndirecti...
Returns an Array with an Objects PK VALUES if convertToSql is true, any associated java-to-sql conversions are applied. If the Object is a Proxy or a VirtualProxy NO conversion is necessary. @param objectOrProxy @param convertToSql @return Object[] @throws PersistenceBrokerException
[ "Returns", "an", "Array", "with", "an", "Objects", "PK", "VALUES", "if", "convertToSql", "is", "true", "any", "associated", "java", "-", "to", "-", "sql", "conversions", "are", "applied", ".", "If", "the", "Object", "is", "a", "Proxy", "or", "a", "Virtua...
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L167-L180
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.getKeyValues
public ValueContainer[] getKeyValues(ClassDescriptor cld, Identity oid) throws PersistenceBrokerException { return getKeyValues(cld, oid, true); }
java
public ValueContainer[] getKeyValues(ClassDescriptor cld, Identity oid) throws PersistenceBrokerException { return getKeyValues(cld, oid, true); }
[ "public", "ValueContainer", "[", "]", "getKeyValues", "(", "ClassDescriptor", "cld", ",", "Identity", "oid", ")", "throws", "PersistenceBrokerException", "{", "return", "getKeyValues", "(", "cld", ",", "oid", ",", "true", ")", ";", "}" ]
Return primary key values of given Identity object. @param cld @param oid @return Object[] @throws PersistenceBrokerException
[ "Return", "primary", "key", "values", "of", "given", "Identity", "object", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L190-L193
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.getKeyValues
public ValueContainer[] getKeyValues(ClassDescriptor cld, Identity oid, boolean convertToSql) throws PersistenceBrokerException { FieldDescriptor[] pkFields = cld.getPkFields(); ValueContainer[] result = new ValueContainer[pkFields.length]; Object[] pkValues = oid.getPrimaryKeyValues(); ...
java
public ValueContainer[] getKeyValues(ClassDescriptor cld, Identity oid, boolean convertToSql) throws PersistenceBrokerException { FieldDescriptor[] pkFields = cld.getPkFields(); ValueContainer[] result = new ValueContainer[pkFields.length]; Object[] pkValues = oid.getPrimaryKeyValues(); ...
[ "public", "ValueContainer", "[", "]", "getKeyValues", "(", "ClassDescriptor", "cld", ",", "Identity", "oid", ",", "boolean", "convertToSql", ")", "throws", "PersistenceBrokerException", "{", "FieldDescriptor", "[", "]", "pkFields", "=", "cld", ".", "getPkFields", ...
Return key Values of an Identity @param cld @param oid @param convertToSql @return Object[] @throws PersistenceBrokerException
[ "Return", "key", "Values", "of", "an", "Identity" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L203-L228
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.getKeyValues
public ValueContainer[] getKeyValues(ClassDescriptor cld, Object objectOrProxy) throws PersistenceBrokerException { return getKeyValues(cld, objectOrProxy, true); }
java
public ValueContainer[] getKeyValues(ClassDescriptor cld, Object objectOrProxy) throws PersistenceBrokerException { return getKeyValues(cld, objectOrProxy, true); }
[ "public", "ValueContainer", "[", "]", "getKeyValues", "(", "ClassDescriptor", "cld", ",", "Object", "objectOrProxy", ")", "throws", "PersistenceBrokerException", "{", "return", "getKeyValues", "(", "cld", ",", "objectOrProxy", ",", "true", ")", ";", "}" ]
returns an Array with an Objects PK VALUES, with any java-to-sql FieldConversion applied. If the Object is a Proxy or a VirtualProxy NO conversion is necessary. @param objectOrProxy @return Object[] @throws PersistenceBrokerException
[ "returns", "an", "Array", "with", "an", "Objects", "PK", "VALUES", "with", "any", "java", "-", "to", "-", "sql", "FieldConversion", "applied", ".", "If", "the", "Object", "is", "a", "Proxy", "or", "a", "VirtualProxy", "NO", "conversion", "is", "necessary",...
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L239-L242
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.hasNullPKField
public boolean hasNullPKField(ClassDescriptor cld, Object obj) { FieldDescriptor[] fields = cld.getPkFields(); boolean hasNull = false; // an unmaterialized proxy object can never have nullified PK's IndirectionHandler handler = ProxyHelper.getIndirectionHandler(obj); i...
java
public boolean hasNullPKField(ClassDescriptor cld, Object obj) { FieldDescriptor[] fields = cld.getPkFields(); boolean hasNull = false; // an unmaterialized proxy object can never have nullified PK's IndirectionHandler handler = ProxyHelper.getIndirectionHandler(obj); i...
[ "public", "boolean", "hasNullPKField", "(", "ClassDescriptor", "cld", ",", "Object", "obj", ")", "{", "FieldDescriptor", "[", "]", "fields", "=", "cld", ".", "getPkFields", "(", ")", ";", "boolean", "hasNull", "=", "false", ";", "// an unmaterialized proxy objec...
Detect if the given object has a PK field represents a 'null' value.
[ "Detect", "if", "the", "given", "object", "has", "a", "PK", "field", "represents", "a", "null", "value", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L286-L304
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.getValuesForObject
public ValueContainer[] getValuesForObject(FieldDescriptor[] fields, Object obj, boolean convertToSql, boolean assignAutoincrement) throws PersistenceBrokerException { ValueContainer[] result = new ValueContainer[fields.length]; for(int i = 0; i < fields.length; i++) { Fie...
java
public ValueContainer[] getValuesForObject(FieldDescriptor[] fields, Object obj, boolean convertToSql, boolean assignAutoincrement) throws PersistenceBrokerException { ValueContainer[] result = new ValueContainer[fields.length]; for(int i = 0; i < fields.length; i++) { Fie...
[ "public", "ValueContainer", "[", "]", "getValuesForObject", "(", "FieldDescriptor", "[", "]", "fields", ",", "Object", "obj", ",", "boolean", "convertToSql", ",", "boolean", "assignAutoincrement", ")", "throws", "PersistenceBrokerException", "{", "ValueContainer", "["...
Get the values of the fields for an obj Autoincrement values are automatically set. @param fields @param obj @throws PersistenceBrokerException
[ "Get", "the", "values", "of", "the", "fields", "for", "an", "obj", "Autoincrement", "values", "are", "automatically", "set", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L349-L384
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.assertValidPkForDelete
public boolean assertValidPkForDelete(ClassDescriptor cld, Object obj) { if(!ProxyHelper.isProxy(obj)) { FieldDescriptor fieldDescriptors[] = cld.getPkFields(); int fieldDescriptorSize = fieldDescriptors.length; for(int i = 0; i < fieldDescriptorSize; i++) ...
java
public boolean assertValidPkForDelete(ClassDescriptor cld, Object obj) { if(!ProxyHelper.isProxy(obj)) { FieldDescriptor fieldDescriptors[] = cld.getPkFields(); int fieldDescriptorSize = fieldDescriptors.length; for(int i = 0; i < fieldDescriptorSize; i++) ...
[ "public", "boolean", "assertValidPkForDelete", "(", "ClassDescriptor", "cld", ",", "Object", "obj", ")", "{", "if", "(", "!", "ProxyHelper", ".", "isProxy", "(", "obj", ")", ")", "{", "FieldDescriptor", "fieldDescriptors", "[", "]", "=", "cld", ".", "getPkFi...
returns true if the primary key fields are valid for delete, else false. PK fields are valid if each of them contains a valid non-null value @param cld the ClassDescriptor @param obj the object @return boolean
[ "returns", "true", "if", "the", "primary", "key", "fields", "are", "valid", "for", "delete", "else", "false", ".", "PK", "fields", "are", "valid", "if", "each", "of", "them", "contains", "a", "valid", "non", "-", "null", "value" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L475-L492
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.getCountQuery
public Query getCountQuery(Query aQuery) { if(aQuery instanceof QueryBySQL) { return getQueryBySqlCount((QueryBySQL) aQuery); } else if(aQuery instanceof ReportQueryByCriteria) { return getReportQueryByCriteriaCount((ReportQueryByCriteria) aQue...
java
public Query getCountQuery(Query aQuery) { if(aQuery instanceof QueryBySQL) { return getQueryBySqlCount((QueryBySQL) aQuery); } else if(aQuery instanceof ReportQueryByCriteria) { return getReportQueryByCriteriaCount((ReportQueryByCriteria) aQue...
[ "public", "Query", "getCountQuery", "(", "Query", "aQuery", ")", "{", "if", "(", "aQuery", "instanceof", "QueryBySQL", ")", "{", "return", "getQueryBySqlCount", "(", "(", "QueryBySQL", ")", "aQuery", ")", ";", "}", "else", "if", "(", "aQuery", "instanceof", ...
Build a Count-Query based on aQuery @param aQuery @return The count query
[ "Build", "a", "Count", "-", "Query", "based", "on", "aQuery" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L499-L513
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.getQueryBySqlCount
private Query getQueryBySqlCount(QueryBySQL aQuery) { String countSql = aQuery.getSql(); int fromPos = countSql.toUpperCase().indexOf(" FROM "); if(fromPos >= 0) { countSql = "select count(*)" + countSql.substring(fromPos); } int orderPos = cou...
java
private Query getQueryBySqlCount(QueryBySQL aQuery) { String countSql = aQuery.getSql(); int fromPos = countSql.toUpperCase().indexOf(" FROM "); if(fromPos >= 0) { countSql = "select count(*)" + countSql.substring(fromPos); } int orderPos = cou...
[ "private", "Query", "getQueryBySqlCount", "(", "QueryBySQL", "aQuery", ")", "{", "String", "countSql", "=", "aQuery", ".", "getSql", "(", ")", ";", "int", "fromPos", "=", "countSql", ".", "toUpperCase", "(", ")", ".", "indexOf", "(", "\" FROM \"", ")", ";"...
Create a Count-Query for QueryBySQL @param aQuery @return The count query
[ "Create", "a", "Count", "-", "Query", "for", "QueryBySQL" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L521-L538
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.getQueryByCriteriaCount
private Query getQueryByCriteriaCount(QueryByCriteria aQuery) { Class searchClass = aQuery.getSearchClass(); ReportQueryByCriteria countQuery = null; Criteria countCrit = null; String[] columns = new String[1]; // BRJ: ...
java
private Query getQueryByCriteriaCount(QueryByCriteria aQuery) { Class searchClass = aQuery.getSearchClass(); ReportQueryByCriteria countQuery = null; Criteria countCrit = null; String[] columns = new String[1]; // BRJ: ...
[ "private", "Query", "getQueryByCriteriaCount", "(", "QueryByCriteria", "aQuery", ")", "{", "Class", "searchClass", "=", "aQuery", ".", "getSearchClass", "(", ")", ";", "ReportQueryByCriteria", "countQuery", "=", "null", ";", "Criteria", "countCrit", "=", "null", "...
Create a Count-Query for QueryByCriteria
[ "Create", "a", "Count", "-", "Query", "for", "QueryByCriteria" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L543-L659
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.getReportQueryByCriteriaCount
private Query getReportQueryByCriteriaCount(ReportQueryByCriteria aQuery) { ReportQueryByCriteria countQuery = (ReportQueryByCriteria) getQueryByCriteriaCount(aQuery); // BRJ: keep the original columns to build the Join countQuery.setJoinAttributes(aQuery.getAttributes()); /...
java
private Query getReportQueryByCriteriaCount(ReportQueryByCriteria aQuery) { ReportQueryByCriteria countQuery = (ReportQueryByCriteria) getQueryByCriteriaCount(aQuery); // BRJ: keep the original columns to build the Join countQuery.setJoinAttributes(aQuery.getAttributes()); /...
[ "private", "Query", "getReportQueryByCriteriaCount", "(", "ReportQueryByCriteria", "aQuery", ")", "{", "ReportQueryByCriteria", "countQuery", "=", "(", "ReportQueryByCriteria", ")", "getQueryByCriteriaCount", "(", "aQuery", ")", ";", "// BRJ: keep the original columns to build ...
Create a Count-Query for ReportQueryByCriteria
[ "Create", "a", "Count", "-", "Query", "for", "ReportQueryByCriteria" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L664-L679
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.unlink
public boolean unlink(Object source, String attributeName, Object target) { return linkOrUnlink(false, source, attributeName, false); }
java
public boolean unlink(Object source, String attributeName, Object target) { return linkOrUnlink(false, source, attributeName, false); }
[ "public", "boolean", "unlink", "(", "Object", "source", ",", "String", "attributeName", ",", "Object", "target", ")", "{", "return", "linkOrUnlink", "(", "false", ",", "source", ",", "attributeName", ",", "false", ")", ";", "}" ]
Unlink the specified reference object. More info see OJB doc. @param source The source object with the specified reference field. @param attributeName The field name of the reference to unlink. @param target The referenced object to unlink.
[ "Unlink", "the", "specified", "reference", "object", ".", "More", "info", "see", "OJB", "doc", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L876-L879
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/BrokerHelper.java
BrokerHelper.unlink
public void unlink(Object obj, ObjectReferenceDescriptor ord, boolean insert) { linkOrUnlink(false, obj, ord, insert); }
java
public void unlink(Object obj, ObjectReferenceDescriptor ord, boolean insert) { linkOrUnlink(false, obj, ord, insert); }
[ "public", "void", "unlink", "(", "Object", "obj", ",", "ObjectReferenceDescriptor", "ord", ",", "boolean", "insert", ")", "{", "linkOrUnlink", "(", "false", ",", "obj", ",", "ord", ",", "insert", ")", ";", "}" ]
Unlink the specified reference from this object. More info see OJB doc. @param obj Object with reference @param ord the ObjectReferenceDescriptor of the reference @param insert flag signals insert operation
[ "Unlink", "the", "specified", "reference", "from", "this", "object", ".", "More", "info", "see", "OJB", "doc", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L900-L903
train
kuali/ojb-1.0.4
src/tools/org/apache/ojb/tools/mapping/reversedb2/dbmetatreemodel/DBMetaCatalogNode.java
DBMetaCatalogNode._load
protected boolean _load () { java.sql.ResultSet rs = null; try { // This synchronization is necessary for Oracle JDBC drivers 8.1.7, 9.0.1, 9.2.0.1 // The documentation says synchronization is done within the driver, but they // must h...
java
protected boolean _load () { java.sql.ResultSet rs = null; try { // This synchronization is necessary for Oracle JDBC drivers 8.1.7, 9.0.1, 9.2.0.1 // The documentation says synchronization is done within the driver, but they // must h...
[ "protected", "boolean", "_load", "(", ")", "{", "java", ".", "sql", ".", "ResultSet", "rs", "=", "null", ";", "try", "{", "// This synchronization is necessary for Oracle JDBC drivers 8.1.7, 9.0.1, 9.2.0.1\r", "// The documentation says synchronization is done within the driver, ...
Loads the schemas associated to this catalog.
[ "Loads", "the", "schemas", "associated", "to", "this", "catalog", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/tools/org/apache/ojb/tools/mapping/reversedb2/dbmetatreemodel/DBMetaCatalogNode.java#L93-L149
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/ConnectionRepository.java
ConnectionRepository.removeDescriptor
public void removeDescriptor(Object validKey) { PBKey pbKey; if (validKey instanceof PBKey) { pbKey = (PBKey) validKey; } else if (validKey instanceof JdbcConnectionDescriptor) { pbKey = ((JdbcConnectionDescriptor) validKey).getPBKey()...
java
public void removeDescriptor(Object validKey) { PBKey pbKey; if (validKey instanceof PBKey) { pbKey = (PBKey) validKey; } else if (validKey instanceof JdbcConnectionDescriptor) { pbKey = ((JdbcConnectionDescriptor) validKey).getPBKey()...
[ "public", "void", "removeDescriptor", "(", "Object", "validKey", ")", "{", "PBKey", "pbKey", ";", "if", "(", "validKey", "instanceof", "PBKey", ")", "{", "pbKey", "=", "(", "PBKey", ")", "validKey", ";", "}", "else", "if", "(", "validKey", "instanceof", ...
Remove a descriptor. @param validKey This could be the {@link JdbcConnectionDescriptor} itself, or the associated {@link JdbcConnectionDescriptor#getPBKey PBKey}.
[ "Remove", "a", "descriptor", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/ConnectionRepository.java#L226-L249
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/core/IdentityFactoryImpl.java
IdentityFactoryImpl.findIndexForName
private int findIndexForName(String[] fieldNames, String searchName) { for(int i = 0; i < fieldNames.length; i++) { if(searchName.equals(fieldNames[i])) { return i; } } throw new PersistenceBrokerException("Can't find field...
java
private int findIndexForName(String[] fieldNames, String searchName) { for(int i = 0; i < fieldNames.length; i++) { if(searchName.equals(fieldNames[i])) { return i; } } throw new PersistenceBrokerException("Can't find field...
[ "private", "int", "findIndexForName", "(", "String", "[", "]", "fieldNames", ",", "String", "searchName", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fieldNames", ".", "length", ";", "i", "++", ")", "{", "if", "(", "searchName", ".", ...
Find the index of the specified name in field name array.
[ "Find", "the", "index", "of", "the", "specified", "name", "in", "field", "name", "array", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/IdentityFactoryImpl.java#L203-L214
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/core/IdentityFactoryImpl.java
IdentityFactoryImpl.isOrdered
private boolean isOrdered(FieldDescriptor[] flds, String[] pkFieldNames) { if((flds.length > 1 && pkFieldNames == null) || flds.length != pkFieldNames.length) { throw new PersistenceBrokerException("pkFieldName length does not match number of defined PK fields." + ...
java
private boolean isOrdered(FieldDescriptor[] flds, String[] pkFieldNames) { if((flds.length > 1 && pkFieldNames == null) || flds.length != pkFieldNames.length) { throw new PersistenceBrokerException("pkFieldName length does not match number of defined PK fields." + ...
[ "private", "boolean", "isOrdered", "(", "FieldDescriptor", "[", "]", "flds", ",", "String", "[", "]", "pkFieldNames", ")", "{", "if", "(", "(", "flds", ".", "length", ">", "1", "&&", "pkFieldNames", "==", "null", ")", "||", "flds", ".", "length", "!=",...
Checks length and compare order of field names with declared PK fields in metadata.
[ "Checks", "length", "and", "compare", "order", "of", "field", "names", "with", "declared", "PK", "fields", "in", "metadata", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/IdentityFactoryImpl.java#L217-L232
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/core/IdentityFactoryImpl.java
IdentityFactoryImpl.createException
private PersistenceBrokerException createException(final Exception ex, String message, final Object objectToIdentify, Class topLevelClass, Class realClass, Object[] pks) { final String eol = SystemUtils.LINE_SEPARATOR; StringBuffer msg = new StringBuffer(); if(message == null) {...
java
private PersistenceBrokerException createException(final Exception ex, String message, final Object objectToIdentify, Class topLevelClass, Class realClass, Object[] pks) { final String eol = SystemUtils.LINE_SEPARATOR; StringBuffer msg = new StringBuffer(); if(message == null) {...
[ "private", "PersistenceBrokerException", "createException", "(", "final", "Exception", "ex", ",", "String", "message", ",", "final", "Object", "objectToIdentify", ",", "Class", "topLevelClass", ",", "Class", "realClass", ",", "Object", "[", "]", "pks", ")", "{", ...
Helper method which supports creation of proper error messages. @param ex An exception to include or <em>null</em>. @param message The error message or <em>null</em>. @param objectToIdentify The current used object or <em>null</em>. @param topLevelClass The object top-level class or <em>null</em>. @param realClass The...
[ "Helper", "method", "which", "supports", "creation", "of", "proper", "error", "messages", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/IdentityFactoryImpl.java#L263-L296
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/ObjectEnvelopeOrdering.java
ObjectEnvelopeOrdering.addEdgesForVertex
private void addEdgesForVertex(Vertex vertex) { ClassDescriptor cld = vertex.getEnvelope().getClassDescriptor(); Iterator rdsIter = cld.getObjectReferenceDescriptors(true).iterator(); while (rdsIter.hasNext()) { ObjectReferenceDescriptor rds = (ObjectReferenceDescri...
java
private void addEdgesForVertex(Vertex vertex) { ClassDescriptor cld = vertex.getEnvelope().getClassDescriptor(); Iterator rdsIter = cld.getObjectReferenceDescriptors(true).iterator(); while (rdsIter.hasNext()) { ObjectReferenceDescriptor rds = (ObjectReferenceDescri...
[ "private", "void", "addEdgesForVertex", "(", "Vertex", "vertex", ")", "{", "ClassDescriptor", "cld", "=", "vertex", ".", "getEnvelope", "(", ")", ".", "getClassDescriptor", "(", ")", ";", "Iterator", "rdsIter", "=", "cld", ".", "getObjectReferenceDescriptors", "...
Adds all edges for a given object envelope vertex. All edges are added to the edgeList map. @param vertex the Vertex object to find edges for
[ "Adds", "all", "edges", "for", "a", "given", "object", "envelope", "vertex", ".", "All", "edges", "are", "added", "to", "the", "edgeList", "map", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/ObjectEnvelopeOrdering.java#L261-L276
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/ObjectEnvelopeOrdering.java
ObjectEnvelopeOrdering.addObjectReferenceEdges
private void addObjectReferenceEdges(Vertex vertex, ObjectReferenceDescriptor rds) { Object refObject = rds.getPersistentField().get(vertex.getEnvelope().getRealObject()); Class refClass = rds.getItemClass(); for (int i = 0; i < vertices.length; i++) { Edge edge = n...
java
private void addObjectReferenceEdges(Vertex vertex, ObjectReferenceDescriptor rds) { Object refObject = rds.getPersistentField().get(vertex.getEnvelope().getRealObject()); Class refClass = rds.getItemClass(); for (int i = 0; i < vertices.length; i++) { Edge edge = n...
[ "private", "void", "addObjectReferenceEdges", "(", "Vertex", "vertex", ",", "ObjectReferenceDescriptor", "rds", ")", "{", "Object", "refObject", "=", "rds", ".", "getPersistentField", "(", ")", ".", "get", "(", "vertex", ".", "getEnvelope", "(", ")", ".", "get...
Finds edges based to a specific object reference descriptor and adds them to the edge map. @param vertex the object envelope vertex holding the object reference @param rds the object reference descriptor
[ "Finds", "edges", "based", "to", "a", "specific", "object", "reference", "descriptor", "and", "adds", "them", "to", "the", "edge", "map", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/ObjectEnvelopeOrdering.java#L284-L314
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/ObjectEnvelopeOrdering.java
ObjectEnvelopeOrdering.containsObject
private static boolean containsObject(Object searchFor, Object[] searchIn) { for (int i = 0; i < searchIn.length; i++) { if (searchFor == searchIn[i]) { return true; } } return false; }
java
private static boolean containsObject(Object searchFor, Object[] searchIn) { for (int i = 0; i < searchIn.length; i++) { if (searchFor == searchIn[i]) { return true; } } return false; }
[ "private", "static", "boolean", "containsObject", "(", "Object", "searchFor", ",", "Object", "[", "]", "searchIn", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "searchIn", ".", "length", ";", "i", "++", ")", "{", "if", "(", "searchFor",...
Helper method that searches an object array for the occurence of a specific object based on reference equality @param searchFor the object to search for @param searchIn the array to search in @return true if the object is found, otherwise false
[ "Helper", "method", "that", "searches", "an", "object", "array", "for", "the", "occurence", "of", "a", "specific", "object", "based", "on", "reference", "equality" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/ObjectEnvelopeOrdering.java#L389-L399
train
foundation-runtime/logging
logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/HttpSpringLogger.java
HttpSpringLogger.getHeadersAsMap
protected static Map<String, String> getHeadersAsMap(ResponseEntity response) { Map<String, List<String>> headers = new HashMap<>(response.getHeaders()); Map<String, String> map = new HashMap<>(); for ( Map.Entry<String, List<String>> header :headers.entrySet() ) { String headerVal...
java
protected static Map<String, String> getHeadersAsMap(ResponseEntity response) { Map<String, List<String>> headers = new HashMap<>(response.getHeaders()); Map<String, String> map = new HashMap<>(); for ( Map.Entry<String, List<String>> header :headers.entrySet() ) { String headerVal...
[ "protected", "static", "Map", "<", "String", ",", "String", ">", "getHeadersAsMap", "(", "ResponseEntity", "response", ")", "{", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "headers", "=", "new", "HashMap", "<>", "(", "response", ".", "ge...
Flat the map of list of string to map of strings, with theoriginal values, seperated by comma
[ "Flat", "the", "map", "of", "list", "of", "string", "to", "map", "of", "strings", "with", "theoriginal", "values", "seperated", "by", "comma" ]
cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6
https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/HttpSpringLogger.java#L263-L274
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/ConnectionPoolDescriptor.java
ConnectionPoolDescriptor.init
private void init() { jdbcProperties = new Properties(); dbcpProperties = new Properties(); setFetchSize(0); this.setTestOnBorrow(true); this.setTestOnReturn(false); this.setTestWhileIdle(false); this.setLogAbandoned(false); this.setRemoveAban...
java
private void init() { jdbcProperties = new Properties(); dbcpProperties = new Properties(); setFetchSize(0); this.setTestOnBorrow(true); this.setTestOnReturn(false); this.setTestWhileIdle(false); this.setLogAbandoned(false); this.setRemoveAban...
[ "private", "void", "init", "(", ")", "{", "jdbcProperties", "=", "new", "Properties", "(", ")", ";", "dbcpProperties", "=", "new", "Properties", "(", ")", ";", "setFetchSize", "(", "0", ")", ";", "this", ".", "setTestOnBorrow", "(", "true", ")", ";", "...
Set some initial values.
[ "Set", "some", "initial", "values", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/ConnectionPoolDescriptor.java#L72-L82
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/ConnectionPoolDescriptor.java
ConnectionPoolDescriptor.addAttribute
public void addAttribute(String attributeName, String attributeValue) { if (attributeName != null && attributeName.startsWith(JDBC_PROPERTY_NAME_PREFIX)) { final String jdbcPropertyName = attributeName.substring(JDBC_PROPERTY_NAME_LENGTH); jdbcProperties.setProperty(jdbc...
java
public void addAttribute(String attributeName, String attributeValue) { if (attributeName != null && attributeName.startsWith(JDBC_PROPERTY_NAME_PREFIX)) { final String jdbcPropertyName = attributeName.substring(JDBC_PROPERTY_NAME_LENGTH); jdbcProperties.setProperty(jdbc...
[ "public", "void", "addAttribute", "(", "String", "attributeName", ",", "String", "attributeValue", ")", "{", "if", "(", "attributeName", "!=", "null", "&&", "attributeName", ".", "startsWith", "(", "JDBC_PROPERTY_NAME_PREFIX", ")", ")", "{", "final", "String", "...
Sets a custom configuration attribute. @param attributeName the attribute name. Names starting with {@link #JDBC_PROPERTY_NAME_PREFIX} will be used (without the prefix) by the ConnectionFactory when creating connections from DriverManager (not used for external DataSource connections). Names starting with {@link #DBCP_...
[ "Sets", "a", "custom", "configuration", "attribute", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/ConnectionPoolDescriptor.java#L143-L159
train
geomajas/geomajas-project-server
impl/src/main/java/org/geomajas/internal/security/DefaultSecurityContext.java
DefaultSecurityContext.userInfoInit
private void userInfoInit() { boolean first = true; userId = null; userLocale = null; userName = null; userOrganization = null; userDivision = null; if (null != authentications) { for (Authentication auth : authentications) { userId = combine(userId, auth.getUserId()); userName = combine(userNa...
java
private void userInfoInit() { boolean first = true; userId = null; userLocale = null; userName = null; userOrganization = null; userDivision = null; if (null != authentications) { for (Authentication auth : authentications) { userId = combine(userId, auth.getUserId()); userName = combine(userNa...
[ "private", "void", "userInfoInit", "(", ")", "{", "boolean", "first", "=", "true", ";", "userId", "=", "null", ";", "userLocale", "=", "null", ";", "userName", "=", "null", ";", "userOrganization", "=", "null", ";", "userDivision", "=", "null", ";", "if"...
Calculate UserInfo strings.
[ "Calculate", "UserInfo", "strings", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/internal/security/DefaultSecurityContext.java#L186-L244
train
geomajas/geomajas-project-server
impl/src/main/java/org/geomajas/internal/security/DefaultSecurityContext.java
DefaultSecurityContext.restoreSecurityContext
@Api public void restoreSecurityContext(SavedAuthorization savedAuthorization) { List<Authentication> auths = new ArrayList<Authentication>(); if (null != savedAuthorization) { for (SavedAuthentication sa : savedAuthorization.getAuthentications()) { Authentication auth = new Authentication(); auth.setSe...
java
@Api public void restoreSecurityContext(SavedAuthorization savedAuthorization) { List<Authentication> auths = new ArrayList<Authentication>(); if (null != savedAuthorization) { for (SavedAuthentication sa : savedAuthorization.getAuthentications()) { Authentication auth = new Authentication(); auth.setSe...
[ "@", "Api", "public", "void", "restoreSecurityContext", "(", "SavedAuthorization", "savedAuthorization", ")", "{", "List", "<", "Authentication", ">", "auths", "=", "new", "ArrayList", "<", "Authentication", ">", "(", ")", ";", "if", "(", "null", "!=", "savedA...
Restore authentications from persisted state. @param savedAuthorization saved authorizations
[ "Restore", "authentications", "from", "persisted", "state", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/internal/security/DefaultSecurityContext.java#L655-L668
train
Axway/Grapes
server/src/main/java/org/axway/grapes/server/reports/workers/DeliveryArtifactsPicker.java
DeliveryArtifactsPicker.work
public void work(RepositoryHandler repoHandler, DbProduct product) { if (!product.getDeliveries().isEmpty()) { product.getDeliveries().forEach(delivery -> { final Set<Artifact> artifacts = new HashSet<>(); final DataFetchingUtils utils = new DataFetchingUtils(); ...
java
public void work(RepositoryHandler repoHandler, DbProduct product) { if (!product.getDeliveries().isEmpty()) { product.getDeliveries().forEach(delivery -> { final Set<Artifact> artifacts = new HashSet<>(); final DataFetchingUtils utils = new DataFetchingUtils(); ...
[ "public", "void", "work", "(", "RepositoryHandler", "repoHandler", ",", "DbProduct", "product", ")", "{", "if", "(", "!", "product", ".", "getDeliveries", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "product", ".", "getDeliveries", "(", ")", ".", "forE...
refresh all deliveries dependencies for a particular product
[ "refresh", "all", "deliveries", "dependencies", "for", "a", "particular", "product" ]
ce9cc73d85f83eaa5fbc991abb593915a8c8374e
https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/reports/workers/DeliveryArtifactsPicker.java#L36-L72
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java
SqlSelectStatement.getMultiJoinedClassDescriptors
private ClassDescriptor[] getMultiJoinedClassDescriptors(ClassDescriptor cld) { DescriptorRepository repository = cld.getRepository(); Class[] multiJoinedClasses = repository.getSubClassesMultipleJoinedTables(cld, true); ClassDescriptor[] result = new ClassDescriptor[multiJoinedClasses.l...
java
private ClassDescriptor[] getMultiJoinedClassDescriptors(ClassDescriptor cld) { DescriptorRepository repository = cld.getRepository(); Class[] multiJoinedClasses = repository.getSubClassesMultipleJoinedTables(cld, true); ClassDescriptor[] result = new ClassDescriptor[multiJoinedClasses.l...
[ "private", "ClassDescriptor", "[", "]", "getMultiJoinedClassDescriptors", "(", "ClassDescriptor", "cld", ")", "{", "DescriptorRepository", "repository", "=", "cld", ".", "getRepository", "(", ")", ";", "Class", "[", "]", "multiJoinedClasses", "=", "repository", ".",...
Get MultiJoined ClassDescriptors @param cld
[ "Get", "MultiJoined", "ClassDescriptors" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java#L128-L140
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java
SqlSelectStatement.appendClazzColumnForSelect
private void appendClazzColumnForSelect(StringBuffer buf) { ClassDescriptor cld = getSearchClassDescriptor(); ClassDescriptor[] clds = getMultiJoinedClassDescriptors(cld); if (clds.length == 0) { return; } buf.append(",CASE"); ...
java
private void appendClazzColumnForSelect(StringBuffer buf) { ClassDescriptor cld = getSearchClassDescriptor(); ClassDescriptor[] clds = getMultiJoinedClassDescriptors(cld); if (clds.length == 0) { return; } buf.append(",CASE"); ...
[ "private", "void", "appendClazzColumnForSelect", "(", "StringBuffer", "buf", ")", "{", "ClassDescriptor", "cld", "=", "getSearchClassDescriptor", "(", ")", ";", "ClassDescriptor", "[", "]", "clds", "=", "getMultiJoinedClassDescriptors", "(", "cld", ")", ";", "if", ...
Create the OJB_CLAZZ pseudo column based on CASE WHEN. This column defines the Class to be instantiated. @param buf
[ "Create", "the", "OJB_CLAZZ", "pseudo", "column", "based", "on", "CASE", "WHEN", ".", "This", "column", "defines", "the", "Class", "to", "be", "instantiated", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java#L147-L181
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/NamedRootsMap.java
NamedRootsMap.lookup
Object lookup(String key) throws ObjectNameNotFoundException { Object result = null; NamedEntry entry = localLookup(key); // can't find local bound object if(entry == null) { try { PersistenceBroker broker = tx.getBroker(); ...
java
Object lookup(String key) throws ObjectNameNotFoundException { Object result = null; NamedEntry entry = localLookup(key); // can't find local bound object if(entry == null) { try { PersistenceBroker broker = tx.getBroker(); ...
[ "Object", "lookup", "(", "String", "key", ")", "throws", "ObjectNameNotFoundException", "{", "Object", "result", "=", "null", ";", "NamedEntry", "entry", "=", "localLookup", "(", "key", ")", ";", "// can't find local bound object\r", "if", "(", "entry", "==", "n...
Return a named object associated with the specified key.
[ "Return", "a", "named", "object", "associated", "with", "the", "specified", "key", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/NamedRootsMap.java#L153-L196
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/odmg/NamedRootsMap.java
NamedRootsMap.unbind
void unbind(String key) { NamedEntry entry = new NamedEntry(key, null, false); localUnbind(key); addForDeletion(entry); }
java
void unbind(String key) { NamedEntry entry = new NamedEntry(key, null, false); localUnbind(key); addForDeletion(entry); }
[ "void", "unbind", "(", "String", "key", ")", "{", "NamedEntry", "entry", "=", "new", "NamedEntry", "(", "key", ",", "null", ",", "false", ")", ";", "localUnbind", "(", "key", ")", ";", "addForDeletion", "(", "entry", ")", ";", "}" ]
Remove a named object
[ "Remove", "a", "named", "object" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/NamedRootsMap.java#L201-L206
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/MetadataManager.java
MetadataManager.readDescriptorRepository
public DescriptorRepository readDescriptorRepository(String fileName) { try { RepositoryPersistor persistor = new RepositoryPersistor(); return persistor.readDescriptorRepository(fileName); } catch (Exception e) { throw new Metadat...
java
public DescriptorRepository readDescriptorRepository(String fileName) { try { RepositoryPersistor persistor = new RepositoryPersistor(); return persistor.readDescriptorRepository(fileName); } catch (Exception e) { throw new Metadat...
[ "public", "DescriptorRepository", "readDescriptorRepository", "(", "String", "fileName", ")", "{", "try", "{", "RepositoryPersistor", "persistor", "=", "new", "RepositoryPersistor", "(", ")", ";", "return", "persistor", ".", "readDescriptorRepository", "(", "fileName", ...
Read ClassDescriptors from the given repository file. @see #mergeDescriptorRepository
[ "Read", "ClassDescriptors", "from", "the", "given", "repository", "file", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/MetadataManager.java#L334-L345
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/MetadataManager.java
MetadataManager.readDescriptorRepository
public DescriptorRepository readDescriptorRepository(InputStream inst) { try { RepositoryPersistor persistor = new RepositoryPersistor(); return persistor.readDescriptorRepository(inst); } catch (Exception e) { throw new MetadataEx...
java
public DescriptorRepository readDescriptorRepository(InputStream inst) { try { RepositoryPersistor persistor = new RepositoryPersistor(); return persistor.readDescriptorRepository(inst); } catch (Exception e) { throw new MetadataEx...
[ "public", "DescriptorRepository", "readDescriptorRepository", "(", "InputStream", "inst", ")", "{", "try", "{", "RepositoryPersistor", "persistor", "=", "new", "RepositoryPersistor", "(", ")", ";", "return", "persistor", ".", "readDescriptorRepository", "(", "inst", "...
Read ClassDescriptors from the given InputStream. @see #mergeDescriptorRepository
[ "Read", "ClassDescriptors", "from", "the", "given", "InputStream", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/MetadataManager.java#L351-L362
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/MetadataManager.java
MetadataManager.readConnectionRepository
public ConnectionRepository readConnectionRepository(String fileName) { try { RepositoryPersistor persistor = new RepositoryPersistor(); return persistor.readConnectionRepository(fileName); } catch (Exception e) { throw new Metadat...
java
public ConnectionRepository readConnectionRepository(String fileName) { try { RepositoryPersistor persistor = new RepositoryPersistor(); return persistor.readConnectionRepository(fileName); } catch (Exception e) { throw new Metadat...
[ "public", "ConnectionRepository", "readConnectionRepository", "(", "String", "fileName", ")", "{", "try", "{", "RepositoryPersistor", "persistor", "=", "new", "RepositoryPersistor", "(", ")", ";", "return", "persistor", ".", "readConnectionRepository", "(", "fileName", ...
Read JdbcConnectionDescriptors from the given repository file. @see #mergeConnectionRepository
[ "Read", "JdbcConnectionDescriptors", "from", "the", "given", "repository", "file", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/MetadataManager.java#L369-L380
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/MetadataManager.java
MetadataManager.readConnectionRepository
public ConnectionRepository readConnectionRepository(InputStream inst) { try { RepositoryPersistor persistor = new RepositoryPersistor(); return persistor.readConnectionRepository(inst); } catch (Exception e) { throw new MetadataEx...
java
public ConnectionRepository readConnectionRepository(InputStream inst) { try { RepositoryPersistor persistor = new RepositoryPersistor(); return persistor.readConnectionRepository(inst); } catch (Exception e) { throw new MetadataEx...
[ "public", "ConnectionRepository", "readConnectionRepository", "(", "InputStream", "inst", ")", "{", "try", "{", "RepositoryPersistor", "persistor", "=", "new", "RepositoryPersistor", "(", ")", ";", "return", "persistor", ".", "readConnectionRepository", "(", "inst", "...
Read JdbcConnectionDescriptors from this InputStream. @see #mergeConnectionRepository
[ "Read", "JdbcConnectionDescriptors", "from", "this", "InputStream", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/MetadataManager.java#L387-L398
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/MetadataManager.java
MetadataManager.addProfile
public void addProfile(Object key, DescriptorRepository repository) { if (metadataProfiles.contains(key)) { throw new MetadataException("Duplicate profile key. Key '" + key + "' already exists."); } metadataProfiles.put(key, repository); }
java
public void addProfile(Object key, DescriptorRepository repository) { if (metadataProfiles.contains(key)) { throw new MetadataException("Duplicate profile key. Key '" + key + "' already exists."); } metadataProfiles.put(key, repository); }
[ "public", "void", "addProfile", "(", "Object", "key", ",", "DescriptorRepository", "repository", ")", "{", "if", "(", "metadataProfiles", ".", "contains", "(", "key", ")", ")", "{", "throw", "new", "MetadataException", "(", "\"Duplicate profile key. Key '\"", "+",...
Add a metadata profile. @see #loadProfile
[ "Add", "a", "metadata", "profile", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/MetadataManager.java#L488-L495
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/MetadataManager.java
MetadataManager.loadProfile
public void loadProfile(Object key) { if (!isEnablePerThreadChanges()) { throw new MetadataException("Can not load profile with disabled per thread mode"); } DescriptorRepository rep = (DescriptorRepository) metadataProfiles.get(key); if (rep == null) ...
java
public void loadProfile(Object key) { if (!isEnablePerThreadChanges()) { throw new MetadataException("Can not load profile with disabled per thread mode"); } DescriptorRepository rep = (DescriptorRepository) metadataProfiles.get(key); if (rep == null) ...
[ "public", "void", "loadProfile", "(", "Object", "key", ")", "{", "if", "(", "!", "isEnablePerThreadChanges", "(", ")", ")", "{", "throw", "new", "MetadataException", "(", "\"Can not load profile with disabled per thread mode\"", ")", ";", "}", "DescriptorRepository", ...
Load the given metadata profile for the current thread.
[ "Load", "the", "given", "metadata", "profile", "for", "the", "current", "thread", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/MetadataManager.java#L501-L514
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/metadata/MetadataManager.java
MetadataManager.buildDefaultKey
private PBKey buildDefaultKey() { List descriptors = connectionRepository().getAllDescriptor(); JdbcConnectionDescriptor descriptor; PBKey result = null; for (Iterator iterator = descriptors.iterator(); iterator.hasNext();) { descriptor = (JdbcConnectionDes...
java
private PBKey buildDefaultKey() { List descriptors = connectionRepository().getAllDescriptor(); JdbcConnectionDescriptor descriptor; PBKey result = null; for (Iterator iterator = descriptors.iterator(); iterator.hasNext();) { descriptor = (JdbcConnectionDes...
[ "private", "PBKey", "buildDefaultKey", "(", ")", "{", "List", "descriptors", "=", "connectionRepository", "(", ")", ".", "getAllDescriptor", "(", ")", ";", "JdbcConnectionDescriptor", "descriptor", ";", "PBKey", "result", "=", "null", ";", "for", "(", "Iterator"...
Try to build an default PBKey for convenience PB create method. @return PBKey or <code>null</code> if default key was not declared in metadata
[ "Try", "to", "build", "an", "default", "PBKey", "for", "convenience", "PB", "create", "method", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/MetadataManager.java#L608-L639
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/ReferenceMap.java
ReferenceMap.toReference
private Object toReference(int type, Object referent, int hash) { switch (type) { case HARD: return referent; case SOFT: return new SoftRef(hash, referent, queue); case WEAK: return new WeakRef(hash, referen...
java
private Object toReference(int type, Object referent, int hash) { switch (type) { case HARD: return referent; case SOFT: return new SoftRef(hash, referent, queue); case WEAK: return new WeakRef(hash, referen...
[ "private", "Object", "toReference", "(", "int", "type", ",", "Object", "referent", ",", "int", "hash", ")", "{", "switch", "(", "type", ")", "{", "case", "HARD", ":", "return", "referent", ";", "case", "SOFT", ":", "return", "new", "SoftRef", "(", "has...
Constructs a reference of the given type to the given referent. The reference is registered with the queue for later purging. @param type HARD, SOFT or WEAK @param referent the object to refer to @param hash the hash code of the <I>key</I> of the mapping; this number might be different from referent.hashCode() if ...
[ "Constructs", "a", "reference", "of", "the", "given", "type", "to", "the", "given", "referent", ".", "The", "reference", "is", "registered", "with", "the", "queue", "for", "later", "purging", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/ReferenceMap.java#L343-L356
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/ReferenceMap.java
ReferenceMap.getEntry
private Entry getEntry(Object key) { if (key == null) return null; int hash = hashCode(key); int index = indexFor(hash); for (Entry entry = table[index]; entry != null; entry = entry.next) { if ((entry.hash == hash) && equals(key, entry.getKey())) ...
java
private Entry getEntry(Object key) { if (key == null) return null; int hash = hashCode(key); int index = indexFor(hash); for (Entry entry = table[index]; entry != null; entry = entry.next) { if ((entry.hash == hash) && equals(key, entry.getKey())) ...
[ "private", "Entry", "getEntry", "(", "Object", "key", ")", "{", "if", "(", "key", "==", "null", ")", "return", "null", ";", "int", "hash", "=", "hashCode", "(", "key", ")", ";", "int", "index", "=", "indexFor", "(", "hash", ")", ";", "for", "(", ...
Returns the entry associated with the given key. @param key the key of the entry to look up @return the entry associated with that key, or null if the key is not in this map
[ "Returns", "the", "entry", "associated", "with", "the", "given", "key", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/ReferenceMap.java#L365-L378
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/ReferenceMap.java
ReferenceMap.indexFor
private int indexFor(int hash) { // mix the bits to avoid bucket collisions... hash += ~(hash << 15); hash ^= (hash >>> 10); hash += (hash << 3); hash ^= (hash >>> 6); hash += ~(hash << 11); hash ^= (hash >>> 16); return hash & (table.length -...
java
private int indexFor(int hash) { // mix the bits to avoid bucket collisions... hash += ~(hash << 15); hash ^= (hash >>> 10); hash += (hash << 3); hash ^= (hash >>> 6); hash += ~(hash << 11); hash ^= (hash >>> 16); return hash & (table.length -...
[ "private", "int", "indexFor", "(", "int", "hash", ")", "{", "// mix the bits to avoid bucket collisions...\r", "hash", "+=", "~", "(", "hash", "<<", "15", ")", ";", "hash", "^=", "(", "hash", ">>>", "10", ")", ";", "hash", "+=", "(", "hash", "<<", "3", ...
Converts the given hash code into an index into the hash table.
[ "Converts", "the", "given", "hash", "code", "into", "an", "index", "into", "the", "hash", "table", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/ReferenceMap.java#L385-L395
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/ReferenceMap.java
ReferenceMap.get
public Object get(Object key) { purge(); Entry entry = getEntry(key); if (entry == null) return null; return entry.getValue(); }
java
public Object get(Object key) { purge(); Entry entry = getEntry(key); if (entry == null) return null; return entry.getValue(); }
[ "public", "Object", "get", "(", "Object", "key", ")", "{", "purge", "(", ")", ";", "Entry", "entry", "=", "getEntry", "(", "key", ")", ";", "if", "(", "entry", "==", "null", ")", "return", "null", ";", "return", "entry", ".", "getValue", "(", ")", ...
Returns the value associated with the given key, if any. @return the value associated with the given key, or <Code>null</Code> if the key maps to no value
[ "Returns", "the", "value", "associated", "with", "the", "given", "key", "if", "any", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/ReferenceMap.java#L521-L527
train
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/util/ReferenceMap.java
ReferenceMap.remove
public Object remove(Object key) { if (key == null) return null; purge(); int hash = hashCode(key); int index = indexFor(hash); Entry previous = null; Entry entry = table[index]; while (entry != null) { if ((hash == entry.hash) &&...
java
public Object remove(Object key) { if (key == null) return null; purge(); int hash = hashCode(key); int index = indexFor(hash); Entry previous = null; Entry entry = table[index]; while (entry != null) { if ((hash == entry.hash) &&...
[ "public", "Object", "remove", "(", "Object", "key", ")", "{", "if", "(", "key", "==", "null", ")", "return", "null", ";", "purge", "(", ")", ";", "int", "hash", "=", "hashCode", "(", "key", ")", ";", "int", "index", "=", "indexFor", "(", "hash", ...
Removes the key and its associated value from this map. @param key the key to remove @return the value associated with that key, or null if the key was not in the map
[ "Removes", "the", "key", "and", "its", "associated", "value", "from", "this", "map", "." ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/ReferenceMap.java#L578-L602
train