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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
gsi-upm/BeastTool | beast-tool/src/main/java/es/upm/dit/gsi/beast/platform/jadex/JadexAgentIntrospector.java | JadexAgentIntrospector.getAgentGoals | public IGoal[] getAgentGoals(final String agent_name, Connector connector) {
((IExternalAccess) connector.getAgentsExternalAccess(agent_name))
.scheduleStep(new IComponentStep<Plan>() {
public IFuture<Plan> execute(IInternalAccess ia) {
IBDIInternalAc... | java | public IGoal[] getAgentGoals(final String agent_name, Connector connector) {
((IExternalAccess) connector.getAgentsExternalAccess(agent_name))
.scheduleStep(new IComponentStep<Plan>() {
public IFuture<Plan> execute(IInternalAccess ia) {
IBDIInternalAc... | [
"public",
"IGoal",
"[",
"]",
"getAgentGoals",
"(",
"final",
"String",
"agent_name",
",",
"Connector",
"connector",
")",
"{",
"(",
"(",
"IExternalAccess",
")",
"connector",
".",
"getAgentsExternalAccess",
"(",
"agent_name",
")",
")",
".",
"scheduleStep",
"(",
"... | This method prints goal information of an agent through its external
access. It can be used to check the correct behaviour of the agent.
@param agent_name
The name of the agent
@param connector
The connector to get the external access
@return goals the IGoal[] with all the information, so the tester can
look for infor... | [
"This",
"method",
"prints",
"goal",
"information",
"of",
"an",
"agent",
"through",
"its",
"external",
"access",
".",
"It",
"can",
"be",
"used",
"to",
"check",
"the",
"correct",
"behaviour",
"of",
"the",
"agent",
"."
] | cc7fdc75cb818c5d60802aaf32c27829e0ca144c | https://github.com/gsi-upm/BeastTool/blob/cc7fdc75cb818c5d60802aaf32c27829e0ca144c/beast-tool/src/main/java/es/upm/dit/gsi/beast/platform/jadex/JadexAgentIntrospector.java#L143-L156 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/ConnectionManagerImpl.java | ConnectionManagerImpl.localBegin | public void localBegin()
{
if (this.isInLocalTransaction)
{
throw new TransactionInProgressException("Connection is already in transaction");
}
Connection connection = null;
try
{
connection = this.getConnection();
}
... | java | public void localBegin()
{
if (this.isInLocalTransaction)
{
throw new TransactionInProgressException("Connection is already in transaction");
}
Connection connection = null;
try
{
connection = this.getConnection();
}
... | [
"public",
"void",
"localBegin",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isInLocalTransaction",
")",
"{",
"throw",
"new",
"TransactionInProgressException",
"(",
"\"Connection is already in transaction\"",
")",
";",
"}",
"Connection",
"connection",
"=",
"null",
";",
... | Start transaction on the underlying connection. | [
"Start",
"transaction",
"on",
"the",
"underlying",
"connection",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ConnectionManagerImpl.java#L154-L189 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/ConnectionManagerImpl.java | ConnectionManagerImpl.localCommit | public void localCommit()
{
if (log.isDebugEnabled()) log.debug("commit was called");
if (!this.isInLocalTransaction)
{
throw new TransactionNotInProgressException("Not in transaction, call begin() before commit()");
}
try
{
if(!broker... | java | public void localCommit()
{
if (log.isDebugEnabled()) log.debug("commit was called");
if (!this.isInLocalTransaction)
{
throw new TransactionNotInProgressException("Not in transaction, call begin() before commit()");
}
try
{
if(!broker... | [
"public",
"void",
"localCommit",
"(",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"log",
".",
"debug",
"(",
"\"commit was called\"",
")",
";",
"if",
"(",
"!",
"this",
".",
"isInLocalTransaction",
")",
"{",
"throw",
"new",
"Transacti... | Call commit on the underlying connection. | [
"Call",
"commit",
"on",
"the",
"underlying",
"connection",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ConnectionManagerImpl.java#L194-L232 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/ConnectionManagerImpl.java | ConnectionManagerImpl.localRollback | public void localRollback()
{
log.info("Rollback was called, do rollback on current connection " + con);
if (!this.isInLocalTransaction)
{
throw new PersistenceBrokerException("Not in transaction, cannot abort");
}
try
{
//truncate the... | java | public void localRollback()
{
log.info("Rollback was called, do rollback on current connection " + con);
if (!this.isInLocalTransaction)
{
throw new PersistenceBrokerException("Not in transaction, cannot abort");
}
try
{
//truncate the... | [
"public",
"void",
"localRollback",
"(",
")",
"{",
"log",
".",
"info",
"(",
"\"Rollback was called, do rollback on current connection \"",
"+",
"con",
")",
";",
"if",
"(",
"!",
"this",
".",
"isInLocalTransaction",
")",
"{",
"throw",
"new",
"PersistenceBrokerException... | Call rollback on the underlying connection. | [
"Call",
"rollback",
"on",
"the",
"underlying",
"connection",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ConnectionManagerImpl.java#L237-L281 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/ConnectionManagerImpl.java | ConnectionManagerImpl.restoreAutoCommitState | protected void restoreAutoCommitState()
{
try
{
if(!broker.isManaged())
{
if (jcd.getUseAutoCommit() == JdbcConnectionDescriptor.AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
&& originalAutoCommitState == true && con != null && !con.i... | java | protected void restoreAutoCommitState()
{
try
{
if(!broker.isManaged())
{
if (jcd.getUseAutoCommit() == JdbcConnectionDescriptor.AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
&& originalAutoCommitState == true && con != null && !con.i... | [
"protected",
"void",
"restoreAutoCommitState",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"broker",
".",
"isManaged",
"(",
")",
")",
"{",
"if",
"(",
"jcd",
".",
"getUseAutoCommit",
"(",
")",
"==",
"JdbcConnectionDescriptor",
".",
"AUTO_COMMIT_SET_TRUE_AND_TEMP... | Reset autoCommit state. | [
"Reset",
"autoCommit",
"state",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ConnectionManagerImpl.java#L286-L309 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/ConnectionManagerImpl.java | ConnectionManagerImpl.isAlive | public boolean isAlive(Connection conn)
{
try
{
return con != null ? !con.isClosed() : false;
}
catch (SQLException e)
{
log.error("IsAlive check failed, running connection was invalid!!", e);
return false;
}
} | java | public boolean isAlive(Connection conn)
{
try
{
return con != null ? !con.isClosed() : false;
}
catch (SQLException e)
{
log.error("IsAlive check failed, running connection was invalid!!", e);
return false;
}
} | [
"public",
"boolean",
"isAlive",
"(",
"Connection",
"conn",
")",
"{",
"try",
"{",
"return",
"con",
"!=",
"null",
"?",
"!",
"con",
".",
"isClosed",
"(",
")",
":",
"false",
";",
"}",
"catch",
"(",
"SQLException",
"e",
")",
"{",
"log",
".",
"error",
"(... | Check if underlying connection was alive. | [
"Check",
"if",
"underlying",
"connection",
"was",
"alive",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ConnectionManagerImpl.java#L314-L325 | train |
gsi-upm/BeastTool | beast-tool/src/main/java/es/upm/dit/gsi/beast/mock/jade/common/AgentRegistration.java | AgentRegistration.registerAgent | public static void registerAgent(Agent agent, String serviceName, String serviceType) throws FIPAException{
DFAgentDescription dfd = new DFAgentDescription();
ServiceDescription sd = new ServiceDescription();
sd.setType(serviceType);
sd.setName(serviceName);
//N... | java | public static void registerAgent(Agent agent, String serviceName, String serviceType) throws FIPAException{
DFAgentDescription dfd = new DFAgentDescription();
ServiceDescription sd = new ServiceDescription();
sd.setType(serviceType);
sd.setName(serviceName);
//N... | [
"public",
"static",
"void",
"registerAgent",
"(",
"Agent",
"agent",
",",
"String",
"serviceName",
",",
"String",
"serviceType",
")",
"throws",
"FIPAException",
"{",
"DFAgentDescription",
"dfd",
"=",
"new",
"DFAgentDescription",
"(",
")",
";",
"ServiceDescription",
... | Register the agent in the platform
@param agent_name
The name of the agent to be registered
@param agent
The agent to register.
@throws FIPAException | [
"Register",
"the",
"agent",
"in",
"the",
"platform"
] | cc7fdc75cb818c5d60802aaf32c27829e0ca144c | https://github.com/gsi-upm/BeastTool/blob/cc7fdc75cb818c5d60802aaf32c27829e0ca144c/beast-tool/src/main/java/es/upm/dit/gsi/beast/mock/jade/common/AgentRegistration.java#L34-L56 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/interceptor/InterceptorFactory.java | InterceptorFactory.getInstance | public static InterceptorFactory getInstance()
{
if (instance == null)
{
instance = new InterceptorFactory();
OjbConfigurator.getInstance().configure(instance);
}
return instance;
} | java | public static InterceptorFactory getInstance()
{
if (instance == null)
{
instance = new InterceptorFactory();
OjbConfigurator.getInstance().configure(instance);
}
return instance;
} | [
"public",
"static",
"InterceptorFactory",
"getInstance",
"(",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"instance",
"=",
"new",
"InterceptorFactory",
"(",
")",
";",
"OjbConfigurator",
".",
"getInstance",
"(",
")",
".",
"configure",
"(",
"insta... | Returns the instance.
@return InterceptorFactory | [
"Returns",
"the",
"instance",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/interceptor/InterceptorFactory.java#L52-L60 | train |
kuali/ojb-1.0.4 | src/tools/org/apache/ojb/tools/mapping/reversedb2/dnd2/DropTargetHelper.java | DropTargetHelper.registerDropPasteWorker | public void registerDropPasteWorker(DropPasteWorkerInterface worker)
{
this.dropPasteWorkerSet.add(worker);
defaultDropTarget.setDefaultActions(
defaultDropTarget.getDefaultActions()
| worker.getAcceptableActions(defaultDropTarget.getComponent())
... | java | public void registerDropPasteWorker(DropPasteWorkerInterface worker)
{
this.dropPasteWorkerSet.add(worker);
defaultDropTarget.setDefaultActions(
defaultDropTarget.getDefaultActions()
| worker.getAcceptableActions(defaultDropTarget.getComponent())
... | [
"public",
"void",
"registerDropPasteWorker",
"(",
"DropPasteWorkerInterface",
"worker",
")",
"{",
"this",
".",
"dropPasteWorkerSet",
".",
"add",
"(",
"worker",
")",
";",
"defaultDropTarget",
".",
"setDefaultActions",
"(",
"defaultDropTarget",
".",
"getDefaultActions",
... | Register a new DropPasteWorkerInterface.
@param worker The new worker | [
"Register",
"a",
"new",
"DropPasteWorkerInterface",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/tools/org/apache/ojb/tools/mapping/reversedb2/dnd2/DropTargetHelper.java#L99-L106 | train |
kuali/ojb-1.0.4 | src/tools/org/apache/ojb/tools/mapping/reversedb2/dnd2/DropTargetHelper.java | DropTargetHelper.removeDropPasteWorker | public void removeDropPasteWorker(DropPasteWorkerInterface worker)
{
this.dropPasteWorkerSet.remove(worker);
java.util.Iterator it = this.dropPasteWorkerSet.iterator();
int newDefaultActions = 0;
while (it.hasNext())
newDefaultActions |= ((DropPasteWorkerInterface)i... | java | public void removeDropPasteWorker(DropPasteWorkerInterface worker)
{
this.dropPasteWorkerSet.remove(worker);
java.util.Iterator it = this.dropPasteWorkerSet.iterator();
int newDefaultActions = 0;
while (it.hasNext())
newDefaultActions |= ((DropPasteWorkerInterface)i... | [
"public",
"void",
"removeDropPasteWorker",
"(",
"DropPasteWorkerInterface",
"worker",
")",
"{",
"this",
".",
"dropPasteWorkerSet",
".",
"remove",
"(",
"worker",
")",
";",
"java",
".",
"util",
".",
"Iterator",
"it",
"=",
"this",
".",
"dropPasteWorkerSet",
".",
... | Remove a DropPasteWorker from the helper.
@param worker the worker that should be removed | [
"Remove",
"a",
"DropPasteWorker",
"from",
"the",
"helper",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/tools/org/apache/ojb/tools/mapping/reversedb2/dnd2/DropTargetHelper.java#L111-L119 | train |
Axway/Grapes | commons/src/main/java/org/axway/grapes/commons/utils/JsonUtils.java | JsonUtils.serialize | public static String serialize(final Object obj) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
return mapper.writeValueAsString(obj);
} | java | public static String serialize(final Object obj) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
return mapper.writeValueAsString(obj);
} | [
"public",
"static",
"String",
"serialize",
"(",
"final",
"Object",
"obj",
")",
"throws",
"IOException",
"{",
"final",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"mapper",
".",
"disable",
"(",
"MapperFeature",
".",
"USE_GETTERS_AS_SETTER... | Serialize an object with Json
@param obj Object
@return String
@throws IOException | [
"Serialize",
"an",
"object",
"with",
"Json"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/commons/src/main/java/org/axway/grapes/commons/utils/JsonUtils.java#L37-L42 | train |
Axway/Grapes | commons/src/main/java/org/axway/grapes/commons/utils/JsonUtils.java | JsonUtils.unserializeOrganization | public static Organization unserializeOrganization(final String organization) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
return mapper.readValue(organization, Organization.class);
} | java | public static Organization unserializeOrganization(final String organization) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
return mapper.readValue(organization, Organization.class);
} | [
"public",
"static",
"Organization",
"unserializeOrganization",
"(",
"final",
"String",
"organization",
")",
"throws",
"IOException",
"{",
"final",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"mapper",
".",
"disable",
"(",
"MapperFeature",
... | Un-serialize a Json into Organization
@param organization String
@return Organization
@throws IOException | [
"Un",
"-",
"serialize",
"a",
"Json",
"into",
"Organization"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/commons/src/main/java/org/axway/grapes/commons/utils/JsonUtils.java#L50-L54 | train |
Axway/Grapes | commons/src/main/java/org/axway/grapes/commons/utils/JsonUtils.java | JsonUtils.unserializeModule | public static Module unserializeModule(final String module) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
return mapper.readValue(module, Module.class);
} | java | public static Module unserializeModule(final String module) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
return mapper.readValue(module, Module.class);
} | [
"public",
"static",
"Module",
"unserializeModule",
"(",
"final",
"String",
"module",
")",
"throws",
"IOException",
"{",
"final",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"mapper",
".",
"disable",
"(",
"MapperFeature",
".",
"USE_GETTER... | Un-serialize a Json into Module
@param module String
@return Module
@throws IOException | [
"Un",
"-",
"serialize",
"a",
"Json",
"into",
"Module"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/commons/src/main/java/org/axway/grapes/commons/utils/JsonUtils.java#L62-L66 | train |
Axway/Grapes | commons/src/main/java/org/axway/grapes/commons/utils/JsonUtils.java | JsonUtils.unserializeBuildInfo | public static Map<String,String> unserializeBuildInfo(final String buildInfo) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
return mapper.readValue(buildInfo, new TypeReference<Map<String, Object>>(){});
} | java | public static Map<String,String> unserializeBuildInfo(final String buildInfo) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
return mapper.readValue(buildInfo, new TypeReference<Map<String, Object>>(){});
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"unserializeBuildInfo",
"(",
"final",
"String",
"buildInfo",
")",
"throws",
"IOException",
"{",
"final",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"mapper",
".",
"disable"... | Un-serialize a Json into BuildInfo
@param buildInfo String
@return Map<String,String>
@throws IOException | [
"Un",
"-",
"serialize",
"a",
"Json",
"into",
"BuildInfo"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/commons/src/main/java/org/axway/grapes/commons/utils/JsonUtils.java#L74-L78 | train |
geomajas/geomajas-project-server | impl/src/main/java/org/geomajas/spring/ThreadScope.java | ThreadScope.get | public Object get(String name, ObjectFactory<?> factory) {
ThreadScopeContext context = ThreadScopeContextHolder.getContext();
Object result = context.getBean(name);
if (null == result) {
result = factory.getObject();
context.setBean(name, result);
}
return result;
} | java | public Object get(String name, ObjectFactory<?> factory) {
ThreadScopeContext context = ThreadScopeContextHolder.getContext();
Object result = context.getBean(name);
if (null == result) {
result = factory.getObject();
context.setBean(name, result);
}
return result;
} | [
"public",
"Object",
"get",
"(",
"String",
"name",
",",
"ObjectFactory",
"<",
"?",
">",
"factory",
")",
"{",
"ThreadScopeContext",
"context",
"=",
"ThreadScopeContextHolder",
".",
"getContext",
"(",
")",
";",
"Object",
"result",
"=",
"context",
".",
"getBean",
... | Get bean for given name in the "thread" scope.
@param name name of bean
@param factory factory for new instances
@return bean for this scope | [
"Get",
"bean",
"for",
"given",
"name",
"in",
"the",
"thread",
"scope",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/spring/ThreadScope.java#L38-L47 | train |
geomajas/geomajas-project-server | impl/src/main/java/org/geomajas/spring/ThreadScope.java | ThreadScope.remove | public Object remove(String name) {
ThreadScopeContext context = ThreadScopeContextHolder.getContext();
return context.remove(name);
} | java | public Object remove(String name) {
ThreadScopeContext context = ThreadScopeContextHolder.getContext();
return context.remove(name);
} | [
"public",
"Object",
"remove",
"(",
"String",
"name",
")",
"{",
"ThreadScopeContext",
"context",
"=",
"ThreadScopeContextHolder",
".",
"getContext",
"(",
")",
";",
"return",
"context",
".",
"remove",
"(",
"name",
")",
";",
"}"
] | Removes bean from scope.
@param name bean name
@return previous value | [
"Removes",
"bean",
"from",
"scope",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/spring/ThreadScope.java#L55-L58 | train |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/JobLogger.java | JobLogger.addItemsHandled | public static void addItemsHandled(String handledItemsType, int handledItemsNumber) {
JobLogger jobLogger = (JobLogger) getInstance();
if (jobLogger == null) {
return;
}
jobLogger.addItemsHandledInstance(handledItemsType, handledItemsNumber);
} | java | public static void addItemsHandled(String handledItemsType, int handledItemsNumber) {
JobLogger jobLogger = (JobLogger) getInstance();
if (jobLogger == null) {
return;
}
jobLogger.addItemsHandledInstance(handledItemsType, handledItemsNumber);
} | [
"public",
"static",
"void",
"addItemsHandled",
"(",
"String",
"handledItemsType",
",",
"int",
"handledItemsNumber",
")",
"{",
"JobLogger",
"jobLogger",
"=",
"(",
"JobLogger",
")",
"getInstance",
"(",
")",
";",
"if",
"(",
"jobLogger",
"==",
"null",
")",
"{",
... | Number of failed actions in scheduler | [
"Number",
"of",
"failed",
"actions",
"in",
"scheduler"
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/JobLogger.java#L9-L16 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java | ConnectionFactoryDBCPImpl.getDataSource | protected DataSource getDataSource(JdbcConnectionDescriptor jcd)
throws LookupException
{
final PBKey key = jcd.getPBKey();
DataSource ds = (DataSource) dsMap.get(key);
if (ds == null)
{
// Found no pool for PBKey
try
{
... | java | protected DataSource getDataSource(JdbcConnectionDescriptor jcd)
throws LookupException
{
final PBKey key = jcd.getPBKey();
DataSource ds = (DataSource) dsMap.get(key);
if (ds == null)
{
// Found no pool for PBKey
try
{
... | [
"protected",
"DataSource",
"getDataSource",
"(",
"JdbcConnectionDescriptor",
"jcd",
")",
"throws",
"LookupException",
"{",
"final",
"PBKey",
"key",
"=",
"jcd",
".",
"getPBKey",
"(",
")",
";",
"DataSource",
"ds",
"=",
"(",
"DataSource",
")",
"dsMap",
".",
"get"... | Returns the DBCP DataSource for the specified connection descriptor,
after creating a new DataSource if needed.
@param jcd the descriptor for which to return a DataSource
@return a DataSource, after creating a new pool if needed.
Guaranteed to never be null.
@throws LookupException if pool is not in cache and cannot be... | [
"Returns",
"the",
"DBCP",
"DataSource",
"for",
"the",
"specified",
"connection",
"descriptor",
"after",
"creating",
"a",
"new",
"DataSource",
"if",
"needed",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java#L144-L171 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java | ConnectionFactoryDBCPImpl.setupPool | protected ObjectPool setupPool(JdbcConnectionDescriptor jcd)
{
log.info("Create new ObjectPool for DBCP connections:" + jcd);
try
{
ClassHelper.newInstance(jcd.getDriver());
}
catch (InstantiationException e)
{
log.fatal("Unable to i... | java | protected ObjectPool setupPool(JdbcConnectionDescriptor jcd)
{
log.info("Create new ObjectPool for DBCP connections:" + jcd);
try
{
ClassHelper.newInstance(jcd.getDriver());
}
catch (InstantiationException e)
{
log.fatal("Unable to i... | [
"protected",
"ObjectPool",
"setupPool",
"(",
"JdbcConnectionDescriptor",
"jcd",
")",
"{",
"log",
".",
"info",
"(",
"\"Create new ObjectPool for DBCP connections:\"",
"+",
"jcd",
")",
";",
"try",
"{",
"ClassHelper",
".",
"newInstance",
"(",
"jcd",
".",
"getDriver",
... | Returns a new ObjectPool for the specified connection descriptor.
Override this method to setup your own pool.
@param jcd the connection descriptor for which to set up the pool
@return a newly created object pool | [
"Returns",
"a",
"new",
"ObjectPool",
"for",
"the",
"specified",
"connection",
"descriptor",
".",
"Override",
"this",
"method",
"to",
"setup",
"your",
"own",
"pool",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java#L179-L238 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java | ConnectionFactoryDBCPImpl.wrapAsDataSource | protected DataSource wrapAsDataSource(JdbcConnectionDescriptor jcd,
ObjectPool connectionPool)
{
final boolean allowConnectionUnwrap;
if (jcd == null)
{
allowConnectionUnwrap = false;
}
else
{
... | java | protected DataSource wrapAsDataSource(JdbcConnectionDescriptor jcd,
ObjectPool connectionPool)
{
final boolean allowConnectionUnwrap;
if (jcd == null)
{
allowConnectionUnwrap = false;
}
else
{
... | [
"protected",
"DataSource",
"wrapAsDataSource",
"(",
"JdbcConnectionDescriptor",
"jcd",
",",
"ObjectPool",
"connectionPool",
")",
"{",
"final",
"boolean",
"allowConnectionUnwrap",
";",
"if",
"(",
"jcd",
"==",
"null",
")",
"{",
"allowConnectionUnwrap",
"=",
"false",
"... | Wraps the specified object pool for connections as a DataSource.
@param jcd the OJB connection descriptor for the pool to be wrapped
@param connectionPool the connection pool to be wrapped
@return a DataSource attached to the connection pool.
Connections will be wrapped using DBCP PoolGuard, that will not allow
unwrap... | [
"Wraps",
"the",
"specified",
"object",
"pool",
"for",
"connections",
"as",
"a",
"DataSource",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java#L306-L336 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/SelectionCriteria.java | SelectionCriteria.setAlias | public void setAlias(String alias)
{
m_alias = alias;
String attributePath = (String)getAttribute();
boolean allPathsAliased = true;
m_userAlias = new UserAlias(alias, attributePath, allPathsAliased);
} | java | public void setAlias(String alias)
{
m_alias = alias;
String attributePath = (String)getAttribute();
boolean allPathsAliased = true;
m_userAlias = new UserAlias(alias, attributePath, allPathsAliased);
} | [
"public",
"void",
"setAlias",
"(",
"String",
"alias",
")",
"{",
"m_alias",
"=",
"alias",
";",
"String",
"attributePath",
"=",
"(",
"String",
")",
"getAttribute",
"(",
")",
";",
"boolean",
"allPathsAliased",
"=",
"true",
";",
"m_userAlias",
"=",
"new",
"Use... | Sets the alias. By default the entire attribute path participates in the alias
@param alias The name of the alias to set | [
"Sets",
"the",
"alias",
".",
"By",
"default",
"the",
"entire",
"attribute",
"path",
"participates",
"in",
"the",
"alias"
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/SelectionCriteria.java#L215-L222 | train |
foundation-runtime/logging | logging-log4j/src/main/java/com/cisco/oss/foundation/logging/appender/TimeBasedRollEnforcer.java | TimeBasedRollEnforcer.begin | final void begin() {
if (this.properties.isDateRollEnforced()) {
final Thread thread = new Thread(this,
"Log4J Time-based File-roll Enforcer");
thread.setDaemon(true);
thread.start();
this.threadRef = thread;
}
} | java | final void begin() {
if (this.properties.isDateRollEnforced()) {
final Thread thread = new Thread(this,
"Log4J Time-based File-roll Enforcer");
thread.setDaemon(true);
thread.start();
this.threadRef = thread;
}
} | [
"final",
"void",
"begin",
"(",
")",
"{",
"if",
"(",
"this",
".",
"properties",
".",
"isDateRollEnforced",
"(",
")",
")",
"{",
"final",
"Thread",
"thread",
"=",
"new",
"Thread",
"(",
"this",
",",
"\"Log4J Time-based File-roll Enforcer\"",
")",
";",
"thread",
... | Starts the enforcer. | [
"Starts",
"the",
"enforcer",
"."
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-log4j/src/main/java/com/cisco/oss/foundation/logging/appender/TimeBasedRollEnforcer.java#L75-L83 | train |
geomajas/geomajas-project-server | command/src/main/java/org/geomajas/command/configuration/GetMapConfigurationCommand.java | GetMapConfigurationCommand.securityClone | public Map<String, ClientWidgetInfo> securityClone(Map<String, ClientWidgetInfo> widgetInfo) {
Map<String, ClientWidgetInfo> res = new HashMap<String, ClientWidgetInfo>();
for (Map.Entry<String, ClientWidgetInfo> entry : widgetInfo.entrySet()) {
ClientWidgetInfo value = entry.getValue();
if (!(value instanceo... | java | public Map<String, ClientWidgetInfo> securityClone(Map<String, ClientWidgetInfo> widgetInfo) {
Map<String, ClientWidgetInfo> res = new HashMap<String, ClientWidgetInfo>();
for (Map.Entry<String, ClientWidgetInfo> entry : widgetInfo.entrySet()) {
ClientWidgetInfo value = entry.getValue();
if (!(value instanceo... | [
"public",
"Map",
"<",
"String",
",",
"ClientWidgetInfo",
">",
"securityClone",
"(",
"Map",
"<",
"String",
",",
"ClientWidgetInfo",
">",
"widgetInfo",
")",
"{",
"Map",
"<",
"String",
",",
"ClientWidgetInfo",
">",
"res",
"=",
"new",
"HashMap",
"<",
"String",
... | Clone a widget info map considering what may be copied to the client.
@param widgetInfo widget info map
@return cloned copy including only records which are not {@link ServerSideOnlyInfo} | [
"Clone",
"a",
"widget",
"info",
"map",
"considering",
"what",
"may",
"be",
"copied",
"to",
"the",
"client",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/command/src/main/java/org/geomajas/command/configuration/GetMapConfigurationCommand.java#L140-L149 | train |
geomajas/geomajas-project-server | command/src/main/java/org/geomajas/command/configuration/GetMapConfigurationCommand.java | GetMapConfigurationCommand.securityClone | public ClientLayerInfo securityClone(ClientLayerInfo original) {
// the data is explicitly copied as this assures the security is considered when copying.
if (null == original) {
return null;
}
ClientLayerInfo client = null;
String layerId = original.getServerLayerId();
if (securityContext.isLayerVisible... | java | public ClientLayerInfo securityClone(ClientLayerInfo original) {
// the data is explicitly copied as this assures the security is considered when copying.
if (null == original) {
return null;
}
ClientLayerInfo client = null;
String layerId = original.getServerLayerId();
if (securityContext.isLayerVisible... | [
"public",
"ClientLayerInfo",
"securityClone",
"(",
"ClientLayerInfo",
"original",
")",
"{",
"// the data is explicitly copied as this assures the security is considered when copying.",
"if",
"(",
"null",
"==",
"original",
")",
"{",
"return",
"null",
";",
"}",
"ClientLayerInfo... | Clone layer information considering what may be copied to the client.
@param original layer info
@return cloned copy including only allowed information | [
"Clone",
"layer",
"information",
"considering",
"what",
"may",
"be",
"copied",
"to",
"the",
"client",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/command/src/main/java/org/geomajas/command/configuration/GetMapConfigurationCommand.java#L174-L204 | train |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/LoggingKeysHandler.java | LoggingKeysHandler.getKeyValue | public String getKeyValue(String key){
String keyName = keysMap.get(key);
if (keyName != null){
return keyName;
}
return ""; //key wasn't defined in keys properties file
} | java | public String getKeyValue(String key){
String keyName = keysMap.get(key);
if (keyName != null){
return keyName;
}
return ""; //key wasn't defined in keys properties file
} | [
"public",
"String",
"getKeyValue",
"(",
"String",
"key",
")",
"{",
"String",
"keyName",
"=",
"keysMap",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"keyName",
"!=",
"null",
")",
"{",
"return",
"keyName",
";",
"}",
"return",
"\"\"",
";",
"//key wasn't ... | get the key name to use in log from the logging keys map | [
"get",
"the",
"key",
"name",
"to",
"use",
"in",
"log",
"from",
"the",
"logging",
"keys",
"map"
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/LoggingKeysHandler.java#L43-L49 | train |
Axway/Grapes | commons/src/main/java/org/axway/grapes/commons/utils/FileUtils.java | FileUtils.serialize | public static void serialize(final File folder, final String content, final String fileName) throws IOException {
if (!folder.exists()) {
folder.mkdirs();
}
final File output = new File(folder, fileName);
try (
final FileWriter writer = new FileWriter(output... | java | public static void serialize(final File folder, final String content, final String fileName) throws IOException {
if (!folder.exists()) {
folder.mkdirs();
}
final File output = new File(folder, fileName);
try (
final FileWriter writer = new FileWriter(output... | [
"public",
"static",
"void",
"serialize",
"(",
"final",
"File",
"folder",
",",
"final",
"String",
"content",
",",
"final",
"String",
"fileName",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"folder",
".",
"exists",
"(",
")",
")",
"{",
"folder",
".",... | Serialize a content into a targeted file, checking that the parent directory exists.
@param folder File
@param content String
@param fileName String | [
"Serialize",
"a",
"content",
"into",
"a",
"targeted",
"file",
"checking",
"that",
"the",
"parent",
"directory",
"exists",
"."
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/commons/src/main/java/org/axway/grapes/commons/utils/FileUtils.java#L25-L40 | train |
Axway/Grapes | commons/src/main/java/org/axway/grapes/commons/utils/FileUtils.java | FileUtils.read | public static String read(final File file) throws IOException {
final StringBuilder sb = new StringBuilder();
try (
final FileReader fr = new FileReader(file);
final BufferedReader br = new BufferedReader(fr);
) {
String sCurrentLine;
wh... | java | public static String read(final File file) throws IOException {
final StringBuilder sb = new StringBuilder();
try (
final FileReader fr = new FileReader(file);
final BufferedReader br = new BufferedReader(fr);
) {
String sCurrentLine;
wh... | [
"public",
"static",
"String",
"read",
"(",
"final",
"File",
"file",
")",
"throws",
"IOException",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"(",
"final",
"FileReader",
"fr",
"=",
"new",
"FileReader",
"(",
"file... | Reads a file and returns the result in a String
@param file File
@return String
@throws IOException | [
"Reads",
"a",
"file",
"and",
"returns",
"the",
"result",
"in",
"a",
"String"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/commons/src/main/java/org/axway/grapes/commons/utils/FileUtils.java#L49-L65 | train |
Axway/Grapes | commons/src/main/java/org/axway/grapes/commons/utils/FileUtils.java | FileUtils.getSize | public static Long getSize(final File file){
if ( file!=null && file.exists() ){
return file.length();
}
return null;
} | java | public static Long getSize(final File file){
if ( file!=null && file.exists() ){
return file.length();
}
return null;
} | [
"public",
"static",
"Long",
"getSize",
"(",
"final",
"File",
"file",
")",
"{",
"if",
"(",
"file",
"!=",
"null",
"&&",
"file",
".",
"exists",
"(",
")",
")",
"{",
"return",
"file",
".",
"length",
"(",
")",
";",
"}",
"return",
"null",
";",
"}"
] | Get file size
@return Long | [
"Get",
"file",
"size"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/commons/src/main/java/org/axway/grapes/commons/utils/FileUtils.java#L73-L78 | train |
Axway/Grapes | commons/src/main/java/org/axway/grapes/commons/utils/FileUtils.java | FileUtils.touch | public static void touch(final File folder , final String fileName) throws IOException {
if(!folder.exists()){
folder.mkdirs();
}
final File touchedFile = new File(folder, fileName);
// The JVM will only 'touch' the file if you instantiate a
// FileOutputStream inst... | java | public static void touch(final File folder , final String fileName) throws IOException {
if(!folder.exists()){
folder.mkdirs();
}
final File touchedFile = new File(folder, fileName);
// The JVM will only 'touch' the file if you instantiate a
// FileOutputStream inst... | [
"public",
"static",
"void",
"touch",
"(",
"final",
"File",
"folder",
",",
"final",
"String",
"fileName",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"folder",
".",
"exists",
"(",
")",
")",
"{",
"folder",
".",
"mkdirs",
"(",
")",
";",
"}",
"fin... | Creates a file
@param folder File
@param fileName String
@throws IOException | [
"Creates",
"a",
"file"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/commons/src/main/java/org/axway/grapes/commons/utils/FileUtils.java#L87-L107 | train |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/LicenseHandler.java | LicenseHandler.init | private void init(final List<DbLicense> licenses) {
licensesRegexp.clear();
for (final DbLicense license : licenses) {
if (license.getRegexp() == null ||
license.getRegexp().isEmpty()) {
licensesRegexp.put(license.getName(), license);
} else {... | java | private void init(final List<DbLicense> licenses) {
licensesRegexp.clear();
for (final DbLicense license : licenses) {
if (license.getRegexp() == null ||
license.getRegexp().isEmpty()) {
licensesRegexp.put(license.getName(), license);
} else {... | [
"private",
"void",
"init",
"(",
"final",
"List",
"<",
"DbLicense",
">",
"licenses",
")",
"{",
"licensesRegexp",
".",
"clear",
"(",
")",
";",
"for",
"(",
"final",
"DbLicense",
"license",
":",
"licenses",
")",
"{",
"if",
"(",
"license",
".",
"getRegexp",
... | Init the licenses cache
@param licenses | [
"Init",
"the",
"licenses",
"cache"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/LicenseHandler.java#L54-L65 | train |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/LicenseHandler.java | LicenseHandler.getLicense | public DbLicense getLicense(final String name) {
final DbLicense license = repoHandler.getLicense(name);
if (license == null) {
throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND)
.entity("License " + name + " does not exist.").build());
... | java | public DbLicense getLicense(final String name) {
final DbLicense license = repoHandler.getLicense(name);
if (license == null) {
throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND)
.entity("License " + name + " does not exist.").build());
... | [
"public",
"DbLicense",
"getLicense",
"(",
"final",
"String",
"name",
")",
"{",
"final",
"DbLicense",
"license",
"=",
"repoHandler",
".",
"getLicense",
"(",
"name",
")",
";",
"if",
"(",
"license",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationExcepti... | Return a html view that contains the targeted license
@param name String
@return DbLicense | [
"Return",
"a",
"html",
"view",
"that",
"contains",
"the",
"targeted",
"license"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/LicenseHandler.java#L94-L103 | train |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/LicenseHandler.java | LicenseHandler.deleteLicense | public void deleteLicense(final String licName) {
final DbLicense dbLicense = getLicense(licName);
repoHandler.deleteLicense(dbLicense.getName());
final FiltersHolder filters = new FiltersHolder();
final LicenseIdFilter licenseIdFilter = new LicenseIdFilter(licName);
filters.ad... | java | public void deleteLicense(final String licName) {
final DbLicense dbLicense = getLicense(licName);
repoHandler.deleteLicense(dbLicense.getName());
final FiltersHolder filters = new FiltersHolder();
final LicenseIdFilter licenseIdFilter = new LicenseIdFilter(licName);
filters.ad... | [
"public",
"void",
"deleteLicense",
"(",
"final",
"String",
"licName",
")",
"{",
"final",
"DbLicense",
"dbLicense",
"=",
"getLicense",
"(",
"licName",
")",
";",
"repoHandler",
".",
"deleteLicense",
"(",
"dbLicense",
".",
"getName",
"(",
")",
")",
";",
"final"... | Delete a license from the repository
@param licName The name of the license to remove | [
"Delete",
"a",
"license",
"from",
"the",
"repository"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/LicenseHandler.java#L110-L122 | train |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/LicenseHandler.java | LicenseHandler.resolve | public DbLicense resolve(final String licenseId) {
for (final Entry<String, DbLicense> regexp : licensesRegexp.entrySet()) {
try {
if (licenseId.matches(regexp.getKey())) {
return regexp.getValue();
}
} catch (PatternSyntaxException e)... | java | public DbLicense resolve(final String licenseId) {
for (final Entry<String, DbLicense> regexp : licensesRegexp.entrySet()) {
try {
if (licenseId.matches(regexp.getKey())) {
return regexp.getValue();
}
} catch (PatternSyntaxException e)... | [
"public",
"DbLicense",
"resolve",
"(",
"final",
"String",
"licenseId",
")",
"{",
"for",
"(",
"final",
"Entry",
"<",
"String",
",",
"DbLicense",
">",
"regexp",
":",
"licensesRegexp",
".",
"entrySet",
"(",
")",
")",
"{",
"try",
"{",
"if",
"(",
"licenseId",... | Resolve the targeted license thanks to the license ID
Return null if no license is matching the licenseId
@param licenseId
@return DbLicense | [
"Resolve",
"the",
"targeted",
"license",
"thanks",
"to",
"the",
"license",
"ID",
"Return",
"null",
"if",
"no",
"license",
"is",
"matching",
"the",
"licenseId"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/LicenseHandler.java#L143-L160 | train |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/LicenseHandler.java | LicenseHandler.resolveLicenses | public Set<DbLicense> resolveLicenses(List<String> licStrings) {
Set<DbLicense> result = new HashSet<>();
licStrings
.stream()
.map(this::getMatchingLicenses)
.forEach(result::addAll);
return result;
} | java | public Set<DbLicense> resolveLicenses(List<String> licStrings) {
Set<DbLicense> result = new HashSet<>();
licStrings
.stream()
.map(this::getMatchingLicenses)
.forEach(result::addAll);
return result;
} | [
"public",
"Set",
"<",
"DbLicense",
">",
"resolveLicenses",
"(",
"List",
"<",
"String",
">",
"licStrings",
")",
"{",
"Set",
"<",
"DbLicense",
">",
"result",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"licStrings",
".",
"stream",
"(",
")",
".",
"map",
... | Turns a series of strings into their corresponding license entities
by using regular expressions
@param licStrings The list of license strings
@return A set of license entities | [
"Turns",
"a",
"series",
"of",
"strings",
"into",
"their",
"corresponding",
"license",
"entities",
"by",
"using",
"regular",
"expressions"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/LicenseHandler.java#L183-L192 | train |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/LicenseHandler.java | LicenseHandler.verityLicenseIsConflictFree | private void verityLicenseIsConflictFree(final DbLicense newComer) {
if(newComer.getRegexp() == null || newComer.getRegexp().isEmpty()) {
return;
}
final DbLicense existing = repoHandler.getLicense(newComer.getName());
final List<DbLicense> licenses = repoHandler.getAllLicen... | java | private void verityLicenseIsConflictFree(final DbLicense newComer) {
if(newComer.getRegexp() == null || newComer.getRegexp().isEmpty()) {
return;
}
final DbLicense existing = repoHandler.getLicense(newComer.getName());
final List<DbLicense> licenses = repoHandler.getAllLicen... | [
"private",
"void",
"verityLicenseIsConflictFree",
"(",
"final",
"DbLicense",
"newComer",
")",
"{",
"if",
"(",
"newComer",
".",
"getRegexp",
"(",
")",
"==",
"null",
"||",
"newComer",
".",
"getRegexp",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
... | Check if new license pattern is valid and doesn't match any existing one
@param newComer License being added or edited
@throws WebApplicationException if conflicts involving the newComer are detected | [
"Check",
"if",
"new",
"license",
"pattern",
"is",
"valid",
"and",
"doesn",
"t",
"match",
"any",
"existing",
"one"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/LicenseHandler.java#L214-L279 | train |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/DependencyHandler.java | DependencyHandler.getModuleDependencies | public List<Dependency> getModuleDependencies(final String moduleId, final FiltersHolder filters){
final DbModule module = moduleHandler.getModule(moduleId);
final DbOrganization organization = moduleHandler.getOrganization(module);
filters.setCorporateFilter(new CorporateFilter(organization));
... | java | public List<Dependency> getModuleDependencies(final String moduleId, final FiltersHolder filters){
final DbModule module = moduleHandler.getModule(moduleId);
final DbOrganization organization = moduleHandler.getOrganization(module);
filters.setCorporateFilter(new CorporateFilter(organization));
... | [
"public",
"List",
"<",
"Dependency",
">",
"getModuleDependencies",
"(",
"final",
"String",
"moduleId",
",",
"final",
"FiltersHolder",
"filters",
")",
"{",
"final",
"DbModule",
"module",
"=",
"moduleHandler",
".",
"getModule",
"(",
"moduleId",
")",
";",
"final",
... | Returns the list of module dependencies regarding the provided filters
@param moduleId String
@param filters FiltersHolder
@return List<Dependency> | [
"Returns",
"the",
"list",
"of",
"module",
"dependencies",
"regarding",
"the",
"provided",
"filters"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/DependencyHandler.java#L52-L58 | train |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/DependencyHandler.java | DependencyHandler.getDependencyReport | public DependencyReport getDependencyReport(final String moduleId, final FiltersHolder filters) {
final DbModule module = moduleHandler.getModule(moduleId);
final DbOrganization organization = moduleHandler.getOrganization(module);
filters.setCorporateFilter(new CorporateFilter(organization));
... | java | public DependencyReport getDependencyReport(final String moduleId, final FiltersHolder filters) {
final DbModule module = moduleHandler.getModule(moduleId);
final DbOrganization organization = moduleHandler.getOrganization(module);
filters.setCorporateFilter(new CorporateFilter(organization));
... | [
"public",
"DependencyReport",
"getDependencyReport",
"(",
"final",
"String",
"moduleId",
",",
"final",
"FiltersHolder",
"filters",
")",
"{",
"final",
"DbModule",
"module",
"=",
"moduleHandler",
".",
"getModule",
"(",
"moduleId",
")",
";",
"final",
"DbOrganization",
... | Generate a report about the targeted module dependencies
@param moduleId String
@param filters FiltersHolder
@return DependencyReport | [
"Generate",
"a",
"report",
"about",
"the",
"targeted",
"module",
"dependencies"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/DependencyHandler.java#L92-L106 | train |
foundation-runtime/logging | logging-log4j/src/main/java/com/cisco/oss/foundation/logging/appender/CompositeRoller.java | CompositeRoller.roll | public final boolean roll(final LoggingEvent loggingEvent) {
for (int i = 0; i < this.fileRollables.length; i++) {
if (this.fileRollables[i].roll(loggingEvent)) {
return true;
}
}
return false;
} | java | public final boolean roll(final LoggingEvent loggingEvent) {
for (int i = 0; i < this.fileRollables.length; i++) {
if (this.fileRollables[i].roll(loggingEvent)) {
return true;
}
}
return false;
} | [
"public",
"final",
"boolean",
"roll",
"(",
"final",
"LoggingEvent",
"loggingEvent",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"fileRollables",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"this",
".",
"fileRollabl... | Delegates file rolling to composed objects.
@see FileRollable#roll(org.apache.log4j.spi.LoggingEvent) | [
"Delegates",
"file",
"rolling",
"to",
"composed",
"objects",
"."
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-log4j/src/main/java/com/cisco/oss/foundation/logging/appender/CompositeRoller.java#L51-L58 | train |
geomajas/geomajas-project-server | command/src/main/java/org/geomajas/command/dto/GetVectorTileRequest.java | GetVectorTileRequest.isPartOf | public boolean isPartOf(GetVectorTileRequest request) {
if (Math.abs(request.scale - scale) > EQUALS_DELTA) { return false; }
if (code != null ? !code.equals(request.code) : request.code != null) { return false; }
if (crs != null ? !crs.equals(request.crs) : request.crs != null) { return false; }
if (filter != ... | java | public boolean isPartOf(GetVectorTileRequest request) {
if (Math.abs(request.scale - scale) > EQUALS_DELTA) { return false; }
if (code != null ? !code.equals(request.code) : request.code != null) { return false; }
if (crs != null ? !crs.equals(request.crs) : request.crs != null) { return false; }
if (filter != ... | [
"public",
"boolean",
"isPartOf",
"(",
"GetVectorTileRequest",
"request",
")",
"{",
"if",
"(",
"Math",
".",
"abs",
"(",
"request",
".",
"scale",
"-",
"scale",
")",
">",
"EQUALS_DELTA",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"code",
"!=",
"nul... | Check if this request is part of the specified request. This is the case if both requests have equal properties
and the specified request is asking for the same or more paint operations than this one.
@param request another request
@return true if the current request is contained in the specified request
@since 1.10.0 | [
"Check",
"if",
"this",
"request",
"is",
"part",
"of",
"the",
"specified",
"request",
".",
"This",
"is",
"the",
"case",
"if",
"both",
"requests",
"have",
"equal",
"properties",
"and",
"the",
"specified",
"request",
"is",
"asking",
"for",
"the",
"same",
"or"... | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/command/src/main/java/org/geomajas/command/dto/GetVectorTileRequest.java#L343-L354 | train |
geomajas/geomajas-project-server | impl/src/main/java/org/geomajas/spring/DependencyCheckPostProcessor.java | DependencyCheckPostProcessor.checkPluginDependencies | @PostConstruct
protected void checkPluginDependencies() throws GeomajasException {
if ("true".equals(System.getProperty("skipPluginDependencyCheck"))) {
return;
}
if (null == declaredPlugins) {
return;
}
// start by going through all plug-ins to build a map of versions for plug-in keys
// includes ... | java | @PostConstruct
protected void checkPluginDependencies() throws GeomajasException {
if ("true".equals(System.getProperty("skipPluginDependencyCheck"))) {
return;
}
if (null == declaredPlugins) {
return;
}
// start by going through all plug-ins to build a map of versions for plug-in keys
// includes ... | [
"@",
"PostConstruct",
"protected",
"void",
"checkPluginDependencies",
"(",
")",
"throws",
"GeomajasException",
"{",
"if",
"(",
"\"true\"",
".",
"equals",
"(",
"System",
".",
"getProperty",
"(",
"\"skipPluginDependencyCheck\"",
")",
")",
")",
"{",
"return",
";",
... | Finish initializing.
@throws GeomajasException oops | [
"Finish",
"initializing",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/spring/DependencyCheckPostProcessor.java#L55-L117 | train |
geomajas/geomajas-project-server | impl/src/main/java/org/geomajas/spring/DependencyCheckPostProcessor.java | DependencyCheckPostProcessor.checkVersion | String checkVersion(String pluginName, String dependency, String requestedVersion, String availableVersion) {
if (null == availableVersion) {
return "Dependency " + dependency + " not found for " + pluginName + ", version " + requestedVersion +
" or higher needed.\n";
}
if (requestedVersion.startsWith(EXP... | java | String checkVersion(String pluginName, String dependency, String requestedVersion, String availableVersion) {
if (null == availableVersion) {
return "Dependency " + dependency + " not found for " + pluginName + ", version " + requestedVersion +
" or higher needed.\n";
}
if (requestedVersion.startsWith(EXP... | [
"String",
"checkVersion",
"(",
"String",
"pluginName",
",",
"String",
"dependency",
",",
"String",
"requestedVersion",
",",
"String",
"availableVersion",
")",
"{",
"if",
"(",
"null",
"==",
"availableVersion",
")",
"{",
"return",
"\"Dependency \"",
"+",
"dependency... | Check the version to assure it is allowed.
@param pluginName plugin name which needs the dependency
@param dependency dependency which needs to be verified
@param requestedVersion requested/minimum version
@param availableVersion available version
@return version check problem or empty string when all is fine | [
"Check",
"the",
"version",
"to",
"assure",
"it",
"is",
"allowed",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/spring/DependencyCheckPostProcessor.java#L128-L148 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java | ClassDescriptorConstraints.check | public void check(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
ensureNoTableInfoIfNoRepositoryInfo(classDef, checkLevel);
checkModifications(classDef, checkLevel);
checkExtents(classDef, checkLevel);
ensureTableIfNecessary(classDef, checkLevel);
... | java | public void check(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
ensureNoTableInfoIfNoRepositoryInfo(classDef, checkLevel);
checkModifications(classDef, checkLevel);
checkExtents(classDef, checkLevel);
ensureTableIfNecessary(classDef, checkLevel);
... | [
"public",
"void",
"check",
"(",
"ClassDescriptorDef",
"classDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"ensureNoTableInfoIfNoRepositoryInfo",
"(",
"classDef",
",",
"checkLevel",
")",
";",
"checkModifications",
"(",
"classDef",
",",
"... | Checks the given class descriptor.
@param classDef The class descriptor
@param checkLevel The amount of checks to perform
@exception ConstraintException If a constraint has been violated | [
"Checks",
"the",
"given",
"class",
"descriptor",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java#L45-L58 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java | ClassDescriptorConstraints.ensureNoTableInfoIfNoRepositoryInfo | private void ensureNoTableInfoIfNoRepositoryInfo(ClassDescriptorDef classDef, String checkLevel)
{
if (!classDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_GENERATE_REPOSITORY_INFO, true))
{
classDef.setProperty(PropertyHelper.OJB_PROPERTY_GENERATE_TABLE_INFO, "false");
... | java | private void ensureNoTableInfoIfNoRepositoryInfo(ClassDescriptorDef classDef, String checkLevel)
{
if (!classDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_GENERATE_REPOSITORY_INFO, true))
{
classDef.setProperty(PropertyHelper.OJB_PROPERTY_GENERATE_TABLE_INFO, "false");
... | [
"private",
"void",
"ensureNoTableInfoIfNoRepositoryInfo",
"(",
"ClassDescriptorDef",
"classDef",
",",
"String",
"checkLevel",
")",
"{",
"if",
"(",
"!",
"classDef",
".",
"getBooleanProperty",
"(",
"PropertyHelper",
".",
"OJB_PROPERTY_GENERATE_REPOSITORY_INFO",
",",
"true",... | Ensures that generate-table-info is set to false if generate-repository-info is set to false.
@param classDef The class descriptor
@param checkLevel The current check level (this constraint is checked in all levels) | [
"Ensures",
"that",
"generate",
"-",
"table",
"-",
"info",
"is",
"set",
"to",
"false",
"if",
"generate",
"-",
"repository",
"-",
"info",
"is",
"set",
"to",
"false",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java#L66-L72 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java | ClassDescriptorConstraints.checkModifications | private void checkModifications(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
HashMap features = new HashMap();
FeatureDescriptorDef def;
for (Itera... | java | private void checkModifications(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
HashMap features = new HashMap();
FeatureDescriptorDef def;
for (Itera... | [
"private",
"void",
"checkModifications",
"(",
"ClassDescriptorDef",
"classDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"CHECKLEVEL_NONE",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",
"HashMap",
... | Checks that the modified features exist.
@param classDef The class descriptor
@param checkLevel The current check level (this constraint is checked in basic and strict)
@exception ConstraintException If the constraint has been violated | [
"Checks",
"that",
"the",
"modified",
"features",
"exist",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java#L81-L135 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java | ClassDescriptorConstraints.checkExtents | private void checkExtents(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
HashMap processedClasses = new HashMap();
InheritanceHelper helper = new Inher... | java | private void checkExtents(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
HashMap processedClasses = new HashMap();
InheritanceHelper helper = new Inher... | [
"private",
"void",
"checkExtents",
"(",
"ClassDescriptorDef",
"classDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"CHECKLEVEL_NONE",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",
"HashMap",
"proce... | Checks the extents specifications and removes unnecessary entries.
@param classDef The class descriptor
@param checkLevel The current check level (this constraint is checked in basic and strict)
@exception ConstraintException If the constraint has been violated | [
"Checks",
"the",
"extents",
"specifications",
"and",
"removes",
"unnecessary",
"entries",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java#L144-L197 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java | ClassDescriptorConstraints.checkInitializationMethod | private void checkInitializationMethod(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (!CHECKLEVEL_STRICT.equals(checkLevel))
{
return;
}
String initMethodName = classDef.getProperty(PropertyHelper.OJB_PROPERTY_INITIALIZATI... | java | private void checkInitializationMethod(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (!CHECKLEVEL_STRICT.equals(checkLevel))
{
return;
}
String initMethodName = classDef.getProperty(PropertyHelper.OJB_PROPERTY_INITIALIZATI... | [
"private",
"void",
"checkInitializationMethod",
"(",
"ClassDescriptorDef",
"classDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"!",
"CHECKLEVEL_STRICT",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",... | Checks the initialization-method of given class descriptor.
@param classDef The class descriptor
@param checkLevel The current check level (this constraint is only checked in strict)
@exception ConstraintException If the constraint has been violated | [
"Checks",
"the",
"initialization",
"-",
"method",
"of",
"given",
"class",
"descriptor",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java#L321-L381 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java | ClassDescriptorConstraints.checkPrimaryKey | private void checkPrimaryKey(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
if (classDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_GENERATE_TABLE_INFO, true) &&
cla... | java | private void checkPrimaryKey(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
if (classDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_GENERATE_TABLE_INFO, true) &&
cla... | [
"private",
"void",
"checkPrimaryKey",
"(",
"ClassDescriptorDef",
"classDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"CHECKLEVEL_NONE",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"... | Checks whether given class descriptor has a primary key.
@param classDef The class descriptor
@param checkLevel The current check level (this constraint is only checked in strict)
@exception ConstraintException If the constraint has been violated | [
"Checks",
"whether",
"given",
"class",
"descriptor",
"has",
"a",
"primary",
"key",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java#L390-L405 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java | ClassDescriptorConstraints.checkRowReader | private void checkRowReader(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (!CHECKLEVEL_STRICT.equals(checkLevel))
{
return;
}
String rowReaderName = classDef.getProperty(PropertyHelper.OJB_PROPERTY_ROW_READER);
... | java | private void checkRowReader(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (!CHECKLEVEL_STRICT.equals(checkLevel))
{
return;
}
String rowReaderName = classDef.getProperty(PropertyHelper.OJB_PROPERTY_ROW_READER);
... | [
"private",
"void",
"checkRowReader",
"(",
"ClassDescriptorDef",
"classDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"!",
"CHECKLEVEL_STRICT",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",
"String"... | Checks the given class descriptor for correct row-reader setting.
@param classDef The class descriptor
@param checkLevel The current check level (this constraint is only checked in strict)
@exception ConstraintException If the constraint has been violated | [
"Checks",
"the",
"given",
"class",
"descriptor",
"for",
"correct",
"row",
"-",
"reader",
"setting",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java#L414-L441 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java | ClassDescriptorConstraints.checkObjectCache | private void checkObjectCache(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (!CHECKLEVEL_STRICT.equals(checkLevel))
{
return;
}
ObjectCacheDef objCacheDef = classDef.getObjectCache();
if (objCacheDef == null)
... | java | private void checkObjectCache(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (!CHECKLEVEL_STRICT.equals(checkLevel))
{
return;
}
ObjectCacheDef objCacheDef = classDef.getObjectCache();
if (objCacheDef == null)
... | [
"private",
"void",
"checkObjectCache",
"(",
"ClassDescriptorDef",
"classDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"!",
"CHECKLEVEL_STRICT",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",
"Objec... | Checks the given class descriptor for correct object cache setting.
@param classDef The class descriptor
@param checkLevel The current check level (this constraint is only checked in strict)
@exception ConstraintException If the constraint has been violated | [
"Checks",
"the",
"given",
"class",
"descriptor",
"for",
"correct",
"object",
"cache",
"setting",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java#L450-L484 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java | ClassDescriptorConstraints.checkProcedures | private void checkProcedures(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
ProcedureDef procDef;
String type;
String name;
String fieldN... | java | private void checkProcedures(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
ProcedureDef procDef;
String type;
String name;
String fieldN... | [
"private",
"void",
"checkProcedures",
"(",
"ClassDescriptorDef",
"classDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"CHECKLEVEL_NONE",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",
"ProcedureDef",
... | Checks the given class descriptor for correct procedure settings.
@param classDef The class descriptor
@param checkLevel The current check level (this constraint is checked in basic and strict)
@exception ConstraintException If the constraint has been violated | [
"Checks",
"the",
"given",
"class",
"descriptor",
"for",
"correct",
"procedure",
"settings",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ClassDescriptorConstraints.java#L493-L551 | train |
kuali/ojb-1.0.4 | src/jca/org/apache/ojb/otm/connector/OTMJCAManagedConnection.java | OTMJCAManagedConnection.getConnection | OTMConnection getConnection()
{
if (m_connection == null)
{
OTMConnectionRuntimeException ex = new OTMConnectionRuntimeException("Connection is null.");
sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex, null);
}
return m_connection;
} | java | OTMConnection getConnection()
{
if (m_connection == null)
{
OTMConnectionRuntimeException ex = new OTMConnectionRuntimeException("Connection is null.");
sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex, null);
}
return m_connection;
} | [
"OTMConnection",
"getConnection",
"(",
")",
"{",
"if",
"(",
"m_connection",
"==",
"null",
")",
"{",
"OTMConnectionRuntimeException",
"ex",
"=",
"new",
"OTMConnectionRuntimeException",
"(",
"\"Connection is null.\"",
")",
";",
"sendEvents",
"(",
"ConnectionEvent",
".",... | get the underlying wrapped connection
@return OTMConnection raw connection to the OTM. | [
"get",
"the",
"underlying",
"wrapped",
"connection"
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/jca/org/apache/ojb/otm/connector/OTMJCAManagedConnection.java#L73-L81 | train |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/version/Version.java | Version.getReleaseId | private Integer getReleaseId() {
final String[] versionParts = stringVersion.split("-");
if(isBranch() && versionParts.length >= 3){
return Integer.valueOf(versionParts[2]);
}
else if(versionParts.length >= 2){
return Integer.valueOf(versionParts[1]);
}
return 0;
} | java | private Integer getReleaseId() {
final String[] versionParts = stringVersion.split("-");
if(isBranch() && versionParts.length >= 3){
return Integer.valueOf(versionParts[2]);
}
else if(versionParts.length >= 2){
return Integer.valueOf(versionParts[1]);
}
return 0;
} | [
"private",
"Integer",
"getReleaseId",
"(",
")",
"{",
"final",
"String",
"[",
"]",
"versionParts",
"=",
"stringVersion",
".",
"split",
"(",
"\"-\"",
")",
";",
"if",
"(",
"isBranch",
"(",
")",
"&&",
"versionParts",
".",
"length",
">=",
"3",
")",
"{",
"re... | Return the releaseId
@return releaseId | [
"Return",
"the",
"releaseId"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/version/Version.java#L96-L107 | train |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/version/Version.java | Version.compare | public int compare(final Version other) throws IncomparableException{
// Cannot compare branch versions and others
if(!isBranch().equals(other.isBranch())){
throw new IncomparableException();
}
// Compare digits
final int minDigitSize = getDigitsSize() < other.getDigitsSize()? getDigitsSize(): other.ge... | java | public int compare(final Version other) throws IncomparableException{
// Cannot compare branch versions and others
if(!isBranch().equals(other.isBranch())){
throw new IncomparableException();
}
// Compare digits
final int minDigitSize = getDigitsSize() < other.getDigitsSize()? getDigitsSize(): other.ge... | [
"public",
"int",
"compare",
"(",
"final",
"Version",
"other",
")",
"throws",
"IncomparableException",
"{",
"// Cannot compare branch versions and others ",
"if",
"(",
"!",
"isBranch",
"(",
")",
".",
"equals",
"(",
"other",
".",
"isBranch",
"(",
")",
")",
")",
... | Compare two versions
@param other
@return an integer: 0 if equals, -1 if older, 1 if newer
@throws IncomparableException is thrown when two versions are not coparable | [
"Compare",
"two",
"versions"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/version/Version.java#L125-L164 | train |
geomajas/geomajas-project-server | plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/impl/PrintComponentImpl.java | PrintComponentImpl.calculateSize | public void calculateSize(PdfContext context) {
float width = 0;
float height = 0;
for (PrintComponent<?> child : children) {
child.calculateSize(context);
float cw = child.getBounds().getWidth() + 2 * child.getConstraint().getMarginX();
float ch = child.getBounds().getHeight() + 2 * child.getConstraint(... | java | public void calculateSize(PdfContext context) {
float width = 0;
float height = 0;
for (PrintComponent<?> child : children) {
child.calculateSize(context);
float cw = child.getBounds().getWidth() + 2 * child.getConstraint().getMarginX();
float ch = child.getBounds().getHeight() + 2 * child.getConstraint(... | [
"public",
"void",
"calculateSize",
"(",
"PdfContext",
"context",
")",
"{",
"float",
"width",
"=",
"0",
";",
"float",
"height",
"=",
"0",
";",
"for",
"(",
"PrintComponent",
"<",
"?",
">",
"child",
":",
"children",
")",
"{",
"child",
".",
"calculateSize",
... | Calculates the size based constraint width and height if present, otherwise from children sizes. | [
"Calculates",
"the",
"size",
"based",
"constraint",
"width",
"and",
"height",
"if",
"present",
"otherwise",
"from",
"children",
"sizes",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/impl/PrintComponentImpl.java#L139-L170 | train |
geomajas/geomajas-project-server | plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/impl/PrintComponentImpl.java | PrintComponentImpl.setChildren | public void setChildren(List<PrintComponent<?>> children) {
this.children = children;
// needed for Json unmarshall !!!!
for (PrintComponent<?> child : children) {
child.setParent(this);
}
} | java | public void setChildren(List<PrintComponent<?>> children) {
this.children = children;
// needed for Json unmarshall !!!!
for (PrintComponent<?> child : children) {
child.setParent(this);
}
} | [
"public",
"void",
"setChildren",
"(",
"List",
"<",
"PrintComponent",
"<",
"?",
">",
">",
"children",
")",
"{",
"this",
".",
"children",
"=",
"children",
";",
"// needed for Json unmarshall !!!!",
"for",
"(",
"PrintComponent",
"<",
"?",
">",
"child",
":",
"ch... | Set child components.
@param children
children | [
"Set",
"child",
"components",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/impl/PrintComponentImpl.java#L354-L360 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/cache/ObjectCacheDefaultImpl.java | ObjectCacheDefaultImpl.remove | public void remove(Identity oid)
{
//processQueue();
if(oid != null)
{
removeTracedIdentity(oid);
objectTable.remove(buildKey(oid));
if(log.isDebugEnabled()) log.debug("Remove object " + oid);
}
} | java | public void remove(Identity oid)
{
//processQueue();
if(oid != null)
{
removeTracedIdentity(oid);
objectTable.remove(buildKey(oid));
if(log.isDebugEnabled()) log.debug("Remove object " + oid);
}
} | [
"public",
"void",
"remove",
"(",
"Identity",
"oid",
")",
"{",
"//processQueue();\r",
"if",
"(",
"oid",
"!=",
"null",
")",
"{",
"removeTracedIdentity",
"(",
"oid",
")",
";",
"objectTable",
".",
"remove",
"(",
"buildKey",
"(",
"oid",
")",
")",
";",
"if",
... | Removes an Object from the cache. | [
"Removes",
"an",
"Object",
"from",
"the",
"cache",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/cache/ObjectCacheDefaultImpl.java#L295-L304 | train |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/CommentHandler.java | CommentHandler.getComments | public List<DbComment> getComments(String entityId, String entityType) {
return repositoryHandler.getComments(entityId, entityType);
} | java | public List<DbComment> getComments(String entityId, String entityType) {
return repositoryHandler.getComments(entityId, entityType);
} | [
"public",
"List",
"<",
"DbComment",
">",
"getComments",
"(",
"String",
"entityId",
",",
"String",
"entityType",
")",
"{",
"return",
"repositoryHandler",
".",
"getComments",
"(",
"entityId",
",",
"entityType",
")",
";",
"}"
] | Get a list of comments made for a particular entity
@param entityId - id of the commented entity
@param entityType - type of the entity
@return list of comments | [
"Get",
"a",
"list",
"of",
"comments",
"made",
"for",
"a",
"particular",
"entity"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/CommentHandler.java#L40-L42 | train |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/CommentHandler.java | CommentHandler.store | public void store(String gavc,
String action,
String commentText,
DbCredential credential,
String entityType) {
DbComment comment = new DbComment();
comment.setEntityId(gavc);
comment.setEntityType(entityType... | java | public void store(String gavc,
String action,
String commentText,
DbCredential credential,
String entityType) {
DbComment comment = new DbComment();
comment.setEntityId(gavc);
comment.setEntityType(entityType... | [
"public",
"void",
"store",
"(",
"String",
"gavc",
",",
"String",
"action",
",",
"String",
"commentText",
",",
"DbCredential",
"credential",
",",
"String",
"entityType",
")",
"{",
"DbComment",
"comment",
"=",
"new",
"DbComment",
"(",
")",
";",
"comment",
".",... | Store a comment based on comment text, gavc and user information
@param gavc - entity id
@param commentText - comment text
@param credential - user credentials
@param entityType - type of the entity | [
"Store",
"a",
"comment",
"based",
"on",
"comment",
"text",
"gavc",
"and",
"user",
"information"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/CommentHandler.java#L52-L70 | train |
foundation-runtime/logging | logging-log4j/src/main/java/com/cisco/oss/foundation/logging/appender/HistoryLogFileScavenger.java | HistoryLogFileScavenger.relevant | private boolean relevant(File currentLogFile, GregorianCalendar lastRelevantDate) {
String fileName=currentLogFile.getName();
Pattern p = Pattern.compile(APPENER_DATE_DEFAULT_PATTERN);
Matcher m = p.matcher(fileName);
if(m.find()){
int year=Integer.parseInt(m.group(1));
int month=Integer.parseInt(m.group(... | java | private boolean relevant(File currentLogFile, GregorianCalendar lastRelevantDate) {
String fileName=currentLogFile.getName();
Pattern p = Pattern.compile(APPENER_DATE_DEFAULT_PATTERN);
Matcher m = p.matcher(fileName);
if(m.find()){
int year=Integer.parseInt(m.group(1));
int month=Integer.parseInt(m.group(... | [
"private",
"boolean",
"relevant",
"(",
"File",
"currentLogFile",
",",
"GregorianCalendar",
"lastRelevantDate",
")",
"{",
"String",
"fileName",
"=",
"currentLogFile",
".",
"getName",
"(",
")",
";",
"Pattern",
"p",
"=",
"Pattern",
".",
"compile",
"(",
"APPENER_DAT... | Get a log file and last relevant date, and check if the log file is relevant
@param currentLogFile The log file
@param lastRelevantDate The last date which files should be keeping since
@return false if the file should be deleted, true if it does not. | [
"Get",
"a",
"log",
"file",
"and",
"last",
"relevant",
"date",
"and",
"check",
"if",
"the",
"log",
"file",
"is",
"relevant"
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-log4j/src/main/java/com/cisco/oss/foundation/logging/appender/HistoryLogFileScavenger.java#L95-L110 | train |
foundation-runtime/logging | logging-log4j/src/main/java/com/cisco/oss/foundation/logging/appender/HistoryLogFileScavenger.java | HistoryLogFileScavenger.getLastReleventDate | private GregorianCalendar getLastReleventDate(GregorianCalendar currentDate) {
int age=this.getProperties().getMaxFileAge();
GregorianCalendar result=new GregorianCalendar(currentDate.get(Calendar.YEAR),currentDate.get(Calendar.MONTH),currentDate.get(Calendar.DAY_OF_MONTH));
result.add(Calendar.DAY_OF_MONTH, -age... | java | private GregorianCalendar getLastReleventDate(GregorianCalendar currentDate) {
int age=this.getProperties().getMaxFileAge();
GregorianCalendar result=new GregorianCalendar(currentDate.get(Calendar.YEAR),currentDate.get(Calendar.MONTH),currentDate.get(Calendar.DAY_OF_MONTH));
result.add(Calendar.DAY_OF_MONTH, -age... | [
"private",
"GregorianCalendar",
"getLastReleventDate",
"(",
"GregorianCalendar",
"currentDate",
")",
"{",
"int",
"age",
"=",
"this",
".",
"getProperties",
"(",
")",
".",
"getMaxFileAge",
"(",
")",
";",
"GregorianCalendar",
"result",
"=",
"new",
"GregorianCalendar",
... | Get the last date to keep logs from, by a given current date.
@param currentDate the date of today
@return the last date to keep log files from. | [
"Get",
"the",
"last",
"date",
"to",
"keep",
"logs",
"from",
"by",
"a",
"given",
"current",
"date",
"."
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-log4j/src/main/java/com/cisco/oss/foundation/logging/appender/HistoryLogFileScavenger.java#L117-L122 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java | TorqueModelDef.addColumnFor | private ColumnDef addColumnFor(FieldDescriptorDef fieldDef, TableDef tableDef)
{
String name = fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_COLUMN);
ColumnDef columnDef = tableDef.getColumn(name);
if (columnDef == null)
{
columnDef = new ColumnDef(name... | java | private ColumnDef addColumnFor(FieldDescriptorDef fieldDef, TableDef tableDef)
{
String name = fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_COLUMN);
ColumnDef columnDef = tableDef.getColumn(name);
if (columnDef == null)
{
columnDef = new ColumnDef(name... | [
"private",
"ColumnDef",
"addColumnFor",
"(",
"FieldDescriptorDef",
"fieldDef",
",",
"TableDef",
"tableDef",
")",
"{",
"String",
"name",
"=",
"fieldDef",
".",
"getProperty",
"(",
"PropertyHelper",
".",
"OJB_PROPERTY_COLUMN",
")",
";",
"ColumnDef",
"columnDef",
"=",
... | Generates a column for the given field and adds it to the table.
@param fieldDef The field
@param tableDef The table
@return The column def | [
"Generates",
"a",
"column",
"for",
"the",
"given",
"field",
"and",
"adds",
"it",
"to",
"the",
"table",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java#L149-L190 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java | TorqueModelDef.getColumns | private List getColumns(List fields)
{
ArrayList columns = new ArrayList();
for (Iterator it = fields.iterator(); it.hasNext();)
{
FieldDescriptorDef fieldDef = (FieldDescriptorDef)it.next();
columns.add(fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_COLUM... | java | private List getColumns(List fields)
{
ArrayList columns = new ArrayList();
for (Iterator it = fields.iterator(); it.hasNext();)
{
FieldDescriptorDef fieldDef = (FieldDescriptorDef)it.next();
columns.add(fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_COLUM... | [
"private",
"List",
"getColumns",
"(",
"List",
"fields",
")",
"{",
"ArrayList",
"columns",
"=",
"new",
"ArrayList",
"(",
")",
";",
"for",
"(",
"Iterator",
"it",
"=",
"fields",
".",
"iterator",
"(",
")",
";",
"it",
".",
"hasNext",
"(",
")",
";",
")",
... | Extracts the list of columns from the given field list.
@param fields The fields
@return The corresponding columns | [
"Extracts",
"the",
"list",
"of",
"columns",
"from",
"the",
"given",
"field",
"list",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java#L338-L349 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java | TorqueModelDef.containsCollectionAndMapsToDifferentTable | private boolean containsCollectionAndMapsToDifferentTable(CollectionDescriptorDef origCollDef, TableDef origTableDef, ClassDescriptorDef classDef)
{
if (classDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_GENERATE_TABLE_INFO, true) &&
!origTableDef.getName().equals(classDef.getProperty(Pr... | java | private boolean containsCollectionAndMapsToDifferentTable(CollectionDescriptorDef origCollDef, TableDef origTableDef, ClassDescriptorDef classDef)
{
if (classDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_GENERATE_TABLE_INFO, true) &&
!origTableDef.getName().equals(classDef.getProperty(Pr... | [
"private",
"boolean",
"containsCollectionAndMapsToDifferentTable",
"(",
"CollectionDescriptorDef",
"origCollDef",
",",
"TableDef",
"origTableDef",
",",
"ClassDescriptorDef",
"classDef",
")",
"{",
"if",
"(",
"classDef",
".",
"getBooleanProperty",
"(",
"PropertyHelper",
".",
... | Checks whether the given class maps to a different table but also has the given collection.
@param origCollDef The original collection to search for
@param origTableDef The original table
@param classDef The class descriptor to test
@return <code>true</code> if the class maps to a different table and has the coll... | [
"Checks",
"whether",
"the",
"given",
"class",
"maps",
"to",
"a",
"different",
"table",
"but",
"also",
"has",
"the",
"given",
"collection",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java#L359-L373 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java | TorqueModelDef.getHierarchyTable | private String getHierarchyTable(ClassDescriptorDef classDef)
{
ArrayList queue = new ArrayList();
String tableName = null;
queue.add(classDef);
while (!queue.isEmpty())
{
ClassDescriptorDef curClassDef = (ClassDescriptorDef)queue.get(0);
... | java | private String getHierarchyTable(ClassDescriptorDef classDef)
{
ArrayList queue = new ArrayList();
String tableName = null;
queue.add(classDef);
while (!queue.isEmpty())
{
ClassDescriptorDef curClassDef = (ClassDescriptorDef)queue.get(0);
... | [
"private",
"String",
"getHierarchyTable",
"(",
"ClassDescriptorDef",
"classDef",
")",
"{",
"ArrayList",
"queue",
"=",
"new",
"ArrayList",
"(",
")",
";",
"String",
"tableName",
"=",
"null",
";",
"queue",
".",
"add",
"(",
"classDef",
")",
";",
"while",
"(",
... | Tries to return the single table to which all classes in the hierarchy with the given
class as the root map.
@param classDef The root class of the hierarchy
@return The table name or <code>null</code> if the classes map to more than one table
or no class in the hierarchy maps to a table | [
"Tries",
"to",
"return",
"the",
"single",
"table",
"to",
"which",
"all",
"classes",
"in",
"the",
"hierarchy",
"with",
"the",
"given",
"class",
"as",
"the",
"root",
"map",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java#L442-L480 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java | TorqueModelDef.addIndex | private void addIndex(IndexDescriptorDef indexDescDef, TableDef tableDef)
{
IndexDef indexDef = tableDef.getIndex(indexDescDef.getName());
if (indexDef == null)
{
indexDef = new IndexDef(indexDescDef.getName(),
indexDescDef.getBooleanPr... | java | private void addIndex(IndexDescriptorDef indexDescDef, TableDef tableDef)
{
IndexDef indexDef = tableDef.getIndex(indexDescDef.getName());
if (indexDef == null)
{
indexDef = new IndexDef(indexDescDef.getName(),
indexDescDef.getBooleanPr... | [
"private",
"void",
"addIndex",
"(",
"IndexDescriptorDef",
"indexDescDef",
",",
"TableDef",
"tableDef",
")",
"{",
"IndexDef",
"indexDef",
"=",
"tableDef",
".",
"getIndex",
"(",
"indexDescDef",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"indexDef",
"==",
"... | Adds an index to the table for the given index descriptor.
@param indexDescDef The index descriptor
@param tableDef The table | [
"Adds",
"an",
"index",
"to",
"the",
"table",
"for",
"the",
"given",
"index",
"descriptor",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java#L488-L515 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java | TorqueModelDef.addTable | private void addTable(TableDef table)
{
table.setOwner(this);
_tableDefs.put(table.getName(), table);
} | java | private void addTable(TableDef table)
{
table.setOwner(this);
_tableDefs.put(table.getName(), table);
} | [
"private",
"void",
"addTable",
"(",
"TableDef",
"table",
")",
"{",
"table",
".",
"setOwner",
"(",
"this",
")",
";",
"_tableDefs",
".",
"put",
"(",
"table",
".",
"getName",
"(",
")",
",",
"table",
")",
";",
"}"
] | Adds a table to this model.
@param table The table | [
"Adds",
"a",
"table",
"to",
"this",
"model",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java#L669-L673 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/InheritanceHelper.java | InheritanceHelper.getClass | public static Class getClass(String name) throws ClassNotFoundException
{
try
{
return Class.forName(name);
}
catch (ClassNotFoundException ex)
{
throw new ClassNotFoundException(name);
}
} | java | public static Class getClass(String name) throws ClassNotFoundException
{
try
{
return Class.forName(name);
}
catch (ClassNotFoundException ex)
{
throw new ClassNotFoundException(name);
}
} | [
"public",
"static",
"Class",
"getClass",
"(",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"try",
"{",
"return",
"Class",
".",
"forName",
"(",
"name",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"ex",
")",
"{",
"throw",
"new",
... | Retrieves the class object for the class with the given name.
@param name The class name
@return The class object
@throws ClassNotFoundException If the class is not on the classpath (the exception message contains the class name) | [
"Retrieves",
"the",
"class",
"object",
"for",
"the",
"class",
"with",
"the",
"given",
"name",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/InheritanceHelper.java#L38-L48 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/cache/AbstractMetaCache.java | AbstractMetaCache.cache | public void cache(Identity oid, Object obj)
{
if (oid != null && obj != null)
{
ObjectCache cache = getCache(oid, obj, METHOD_CACHE);
if (cache != null)
{
cache.cache(oid, obj);
}
}
} | java | public void cache(Identity oid, Object obj)
{
if (oid != null && obj != null)
{
ObjectCache cache = getCache(oid, obj, METHOD_CACHE);
if (cache != null)
{
cache.cache(oid, obj);
}
}
} | [
"public",
"void",
"cache",
"(",
"Identity",
"oid",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"oid",
"!=",
"null",
"&&",
"obj",
"!=",
"null",
")",
"{",
"ObjectCache",
"cache",
"=",
"getCache",
"(",
"oid",
",",
"obj",
",",
"METHOD_CACHE",
")",
";",
... | Caches the given object using the given Identity as key
@param oid The Identity key
@param obj The object o cache | [
"Caches",
"the",
"given",
"object",
"using",
"the",
"given",
"Identity",
"as",
"key"
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/cache/AbstractMetaCache.java#L55-L65 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/cache/AbstractMetaCache.java | AbstractMetaCache.lookup | public Object lookup(Identity oid)
{
Object ret = null;
if (oid != null)
{
ObjectCache cache = getCache(oid, null, METHOD_LOOKUP);
if (cache != null)
{
ret = cache.lookup(oid);
}
}
return ret;
} | java | public Object lookup(Identity oid)
{
Object ret = null;
if (oid != null)
{
ObjectCache cache = getCache(oid, null, METHOD_LOOKUP);
if (cache != null)
{
ret = cache.lookup(oid);
}
}
return ret;
} | [
"public",
"Object",
"lookup",
"(",
"Identity",
"oid",
")",
"{",
"Object",
"ret",
"=",
"null",
";",
"if",
"(",
"oid",
"!=",
"null",
")",
"{",
"ObjectCache",
"cache",
"=",
"getCache",
"(",
"oid",
",",
"null",
",",
"METHOD_LOOKUP",
")",
";",
"if",
"(",
... | Looks up the object from the cache
@param oid The Identity to look up the object for
@return The object if found, otherwise null | [
"Looks",
"up",
"the",
"object",
"from",
"the",
"cache"
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/cache/AbstractMetaCache.java#L84-L96 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/cache/AbstractMetaCache.java | AbstractMetaCache.remove | public void remove(Identity oid)
{
if (oid == null) return;
ObjectCache cache = getCache(oid, null, METHOD_REMOVE);
if (cache != null)
{
cache.remove(oid);
}
} | java | public void remove(Identity oid)
{
if (oid == null) return;
ObjectCache cache = getCache(oid, null, METHOD_REMOVE);
if (cache != null)
{
cache.remove(oid);
}
} | [
"public",
"void",
"remove",
"(",
"Identity",
"oid",
")",
"{",
"if",
"(",
"oid",
"==",
"null",
")",
"return",
";",
"ObjectCache",
"cache",
"=",
"getCache",
"(",
"oid",
",",
"null",
",",
"METHOD_REMOVE",
")",
";",
"if",
"(",
"cache",
"!=",
"null",
")",... | Removes the given object from the cache
@param oid oid of the object to remove | [
"Removes",
"the",
"given",
"object",
"from",
"the",
"cache"
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/cache/AbstractMetaCache.java#L103-L112 | train |
geomajas/geomajas-project-server | plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/ComponentUtil.java | ComponentUtil.getCurrentResourceBundle | public static ResourceBundle getCurrentResourceBundle(String locale) {
try {
if (null != locale && !locale.isEmpty()) {
return getCurrentResourceBundle(LocaleUtils.toLocale(locale));
}
} catch (IllegalArgumentException ex) {
// do nothing
}
return getCurrentResourceBundle((Locale) null);
} | java | public static ResourceBundle getCurrentResourceBundle(String locale) {
try {
if (null != locale && !locale.isEmpty()) {
return getCurrentResourceBundle(LocaleUtils.toLocale(locale));
}
} catch (IllegalArgumentException ex) {
// do nothing
}
return getCurrentResourceBundle((Locale) null);
} | [
"public",
"static",
"ResourceBundle",
"getCurrentResourceBundle",
"(",
"String",
"locale",
")",
"{",
"try",
"{",
"if",
"(",
"null",
"!=",
"locale",
"&&",
"!",
"locale",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"getCurrentResourceBundle",
"(",
"LocaleUtils... | Returns the resource bundle for current Locale, i.e. locale set in the PageComponent.
Always create a new instance, this avoids getting the incorrect locale information.
@return resourcebundle for internationalized messages | [
"Returns",
"the",
"resource",
"bundle",
"for",
"current",
"Locale",
"i",
".",
"e",
".",
"locale",
"set",
"in",
"the",
"PageComponent",
".",
"Always",
"create",
"a",
"new",
"instance",
"this",
"avoids",
"getting",
"the",
"incorrect",
"locale",
"information",
... | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/ComponentUtil.java#L41-L50 | train |
geomajas/geomajas-project-server | plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/CriteriaVisitor.java | CriteriaVisitor.getPropertyName | private String getPropertyName(Expression expression) {
if (!(expression instanceof PropertyName)) {
throw new IllegalArgumentException("Expression " + expression + " is not a PropertyName.");
}
String name = ((PropertyName) expression).getPropertyName();
if (name.endsWith(FilterService.ATTRIBUTE_ID)) {
/... | java | private String getPropertyName(Expression expression) {
if (!(expression instanceof PropertyName)) {
throw new IllegalArgumentException("Expression " + expression + " is not a PropertyName.");
}
String name = ((PropertyName) expression).getPropertyName();
if (name.endsWith(FilterService.ATTRIBUTE_ID)) {
/... | [
"private",
"String",
"getPropertyName",
"(",
"Expression",
"expression",
")",
"{",
"if",
"(",
"!",
"(",
"expression",
"instanceof",
"PropertyName",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Expression \"",
"+",
"expression",
"+",
"\" is no... | Get the property name from the expression.
@param expression expression
@return property name | [
"Get",
"the",
"property",
"name",
"from",
"the",
"expression",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/CriteriaVisitor.java#L499-L509 | train |
geomajas/geomajas-project-server | plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/CriteriaVisitor.java | CriteriaVisitor.getLiteralValue | private Object getLiteralValue(Expression expression) {
if (!(expression instanceof Literal)) {
throw new IllegalArgumentException("Expression " + expression + " is not a Literal.");
}
return ((Literal) expression).getValue();
} | java | private Object getLiteralValue(Expression expression) {
if (!(expression instanceof Literal)) {
throw new IllegalArgumentException("Expression " + expression + " is not a Literal.");
}
return ((Literal) expression).getValue();
} | [
"private",
"Object",
"getLiteralValue",
"(",
"Expression",
"expression",
")",
"{",
"if",
"(",
"!",
"(",
"expression",
"instanceof",
"Literal",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Expression \"",
"+",
"expression",
"+",
"\" is not a L... | Get the literal value for an expression.
@param expression expression
@return literal value | [
"Get",
"the",
"literal",
"value",
"for",
"an",
"expression",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/CriteriaVisitor.java#L517-L522 | train |
geomajas/geomajas-project-server | plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/CriteriaVisitor.java | CriteriaVisitor.parsePropertyName | private String parsePropertyName(String orgPropertyName, Object userData) {
// try to assure the correct separator is used
String propertyName = orgPropertyName.replace(HibernateLayerUtil.XPATH_SEPARATOR, HibernateLayerUtil.SEPARATOR);
// split the path (separator is defined in the HibernateLayerUtil)
String[]... | java | private String parsePropertyName(String orgPropertyName, Object userData) {
// try to assure the correct separator is used
String propertyName = orgPropertyName.replace(HibernateLayerUtil.XPATH_SEPARATOR, HibernateLayerUtil.SEPARATOR);
// split the path (separator is defined in the HibernateLayerUtil)
String[]... | [
"private",
"String",
"parsePropertyName",
"(",
"String",
"orgPropertyName",
",",
"Object",
"userData",
")",
"{",
"// try to assure the correct separator is used",
"String",
"propertyName",
"=",
"orgPropertyName",
".",
"replace",
"(",
"HibernateLayerUtil",
".",
"XPATH_SEPARA... | Go through the property name to see if it is a complex one. If it is, aliases must be declared.
@param orgPropertyName
The propertyName. Can be complex.
@param userData
The userData object that is passed in each method of the FilterVisitor. Should always be of the info
"Criteria".
@return property name | [
"Go",
"through",
"the",
"property",
"name",
"to",
"see",
"if",
"it",
"is",
"a",
"complex",
"one",
".",
"If",
"it",
"is",
"aliases",
"must",
"be",
"declared",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/CriteriaVisitor.java#L534-L562 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/J2EETransactionImpl.java | J2EETransactionImpl.afterCompletion | public void afterCompletion(int status)
{
if(afterCompletionCall) return;
log.info("Method afterCompletion was called");
try
{
switch(status)
{
case Status.STATUS_COMMITTED:
if(log.isDebugEnabled())
... | java | public void afterCompletion(int status)
{
if(afterCompletionCall) return;
log.info("Method afterCompletion was called");
try
{
switch(status)
{
case Status.STATUS_COMMITTED:
if(log.isDebugEnabled())
... | [
"public",
"void",
"afterCompletion",
"(",
"int",
"status",
")",
"{",
"if",
"(",
"afterCompletionCall",
")",
"return",
";",
"log",
".",
"info",
"(",
"\"Method afterCompletion was called\"",
")",
";",
"try",
"{",
"switch",
"(",
"status",
")",
"{",
"case",
"Sta... | FOR internal use. This method was called after the external transaction was completed.
@see javax.transaction.Synchronization | [
"FOR",
"internal",
"use",
".",
"This",
"method",
"was",
"called",
"after",
"the",
"external",
"transaction",
"was",
"completed",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/J2EETransactionImpl.java#L84-L110 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/J2EETransactionImpl.java | J2EETransactionImpl.beforeCompletion | public void beforeCompletion()
{
// avoid redundant calls
if(beforeCompletionCall) return;
log.info("Method beforeCompletion was called");
int status = Status.STATUS_UNKNOWN;
try
{
JTATxManager mgr = (JTATxManager) getImplementation().getTxManage... | java | public void beforeCompletion()
{
// avoid redundant calls
if(beforeCompletionCall) return;
log.info("Method beforeCompletion was called");
int status = Status.STATUS_UNKNOWN;
try
{
JTATxManager mgr = (JTATxManager) getImplementation().getTxManage... | [
"public",
"void",
"beforeCompletion",
"(",
")",
"{",
"// avoid redundant calls\r",
"if",
"(",
"beforeCompletionCall",
")",
"return",
";",
"log",
".",
"info",
"(",
"\"Method beforeCompletion was called\"",
")",
";",
"int",
"status",
"=",
"Status",
".",
"STATUS_UNKNOW... | FOR internal use. This method was called before the external transaction was completed.
This method was called by the JTA-TxManager before the JTA-tx prepare call. Within this method
we prepare odmg for commit and pass all modified persistent objects to DB and release/close the used
connection. We have to close the co... | [
"FOR",
"internal",
"use",
".",
"This",
"method",
"was",
"called",
"before",
"the",
"external",
"transaction",
"was",
"completed",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/J2EETransactionImpl.java#L122-L182 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/J2EETransactionImpl.java | J2EETransactionImpl.internalCleanup | private void internalCleanup()
{
if(hasBroker())
{
PersistenceBroker broker = getBroker();
if(log.isDebugEnabled())
{
log.debug("Do internal cleanup and close the internal used connection without" +
" closing the use... | java | private void internalCleanup()
{
if(hasBroker())
{
PersistenceBroker broker = getBroker();
if(log.isDebugEnabled())
{
log.debug("Do internal cleanup and close the internal used connection without" +
" closing the use... | [
"private",
"void",
"internalCleanup",
"(",
")",
"{",
"if",
"(",
"hasBroker",
"(",
")",
")",
"{",
"PersistenceBroker",
"broker",
"=",
"getBroker",
"(",
")",
";",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\... | In managed environment do internal close the used connection | [
"In",
"managed",
"environment",
"do",
"internal",
"close",
"the",
"used",
"connection"
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/J2EETransactionImpl.java#L187-L211 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/states/StateOldDirty.java | StateOldDirty.checkpoint | public void checkpoint(ObjectEnvelope mod)
throws org.apache.ojb.broker.PersistenceBrokerException
{
mod.doUpdate();
} | java | public void checkpoint(ObjectEnvelope mod)
throws org.apache.ojb.broker.PersistenceBrokerException
{
mod.doUpdate();
} | [
"public",
"void",
"checkpoint",
"(",
"ObjectEnvelope",
"mod",
")",
"throws",
"org",
".",
"apache",
".",
"ojb",
".",
"broker",
".",
"PersistenceBrokerException",
"{",
"mod",
".",
"doUpdate",
"(",
")",
";",
"}"
] | checkpoint the transaction | [
"checkpoint",
"the",
"transaction"
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/states/StateOldDirty.java#L86-L90 | train |
geomajas/geomajas-project-server | plugin/layer-geotools/geotools/src/main/java/org/geomajas/layer/shapeinmem/ShapeInMemLayer.java | ShapeInMemLayer.setUrl | @Api
public void setUrl(String url) throws LayerException {
try {
this.url = url;
Map<String, Object> params = new HashMap<String, Object>();
params.put("url", url);
DataStore store = DataStoreFactory.create(params);
setDataStore(store);
} catch (IOException ioe) {
throw new LayerException(ioe, E... | java | @Api
public void setUrl(String url) throws LayerException {
try {
this.url = url;
Map<String, Object> params = new HashMap<String, Object>();
params.put("url", url);
DataStore store = DataStoreFactory.create(params);
setDataStore(store);
} catch (IOException ioe) {
throw new LayerException(ioe, E... | [
"@",
"Api",
"public",
"void",
"setUrl",
"(",
"String",
"url",
")",
"throws",
"LayerException",
"{",
"try",
"{",
"this",
".",
"url",
"=",
"url",
";",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Objec... | Set the url for the shape file.
@param url shape file url
@throws LayerException file cannot be accessed
@since 1.7.1 | [
"Set",
"the",
"url",
"for",
"the",
"shape",
"file",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-geotools/geotools/src/main/java/org/geomajas/layer/shapeinmem/ShapeInMemLayer.java#L133-L144 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/ImplementationJTAImpl.java | ImplementationJTAImpl.beginInternTransaction | private void beginInternTransaction()
{
if (log.isDebugEnabled()) log.debug("beginInternTransaction was called");
J2EETransactionImpl tx = (J2EETransactionImpl) super.currentTransaction();
if (tx == null) tx = newInternTransaction();
if (!tx.isOpen())
{
// ... | java | private void beginInternTransaction()
{
if (log.isDebugEnabled()) log.debug("beginInternTransaction was called");
J2EETransactionImpl tx = (J2EETransactionImpl) super.currentTransaction();
if (tx == null) tx = newInternTransaction();
if (!tx.isOpen())
{
// ... | [
"private",
"void",
"beginInternTransaction",
"(",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"log",
".",
"debug",
"(",
"\"beginInternTransaction was called\"",
")",
";",
"J2EETransactionImpl",
"tx",
"=",
"(",
"J2EETransactionImpl",
")",
"s... | Here we start a intern odmg-Transaction to hide transaction demarcation
This method could be invoked several times within a transaction, but only
the first call begin a intern odmg transaction | [
"Here",
"we",
"start",
"a",
"intern",
"odmg",
"-",
"Transaction",
"to",
"hide",
"transaction",
"demarcation",
"This",
"method",
"could",
"be",
"invoked",
"several",
"times",
"within",
"a",
"transaction",
"but",
"only",
"the",
"first",
"call",
"begin",
"a",
"... | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/ImplementationJTAImpl.java#L105-L116 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/ImplementationJTAImpl.java | ImplementationJTAImpl.newInternTransaction | private J2EETransactionImpl newInternTransaction()
{
if (log.isDebugEnabled()) log.debug("obtain new intern odmg-transaction");
J2EETransactionImpl tx = new J2EETransactionImpl(this);
try
{
getConfigurator().configure(tx);
}
catch (ConfigurationExc... | java | private J2EETransactionImpl newInternTransaction()
{
if (log.isDebugEnabled()) log.debug("obtain new intern odmg-transaction");
J2EETransactionImpl tx = new J2EETransactionImpl(this);
try
{
getConfigurator().configure(tx);
}
catch (ConfigurationExc... | [
"private",
"J2EETransactionImpl",
"newInternTransaction",
"(",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"log",
".",
"debug",
"(",
"\"obtain new intern odmg-transaction\"",
")",
";",
"J2EETransactionImpl",
"tx",
"=",
"new",
"J2EETransactionIm... | Returns a new intern odmg-transaction for the current database. | [
"Returns",
"a",
"new",
"intern",
"odmg",
"-",
"transaction",
"for",
"the",
"current",
"database",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/ImplementationJTAImpl.java#L121-L134 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/ReferencePrefetcher.java | ReferencePrefetcher.associateBatched | protected void associateBatched(Collection owners, Collection children)
{
ObjectReferenceDescriptor ord = getObjectReferenceDescriptor();
ClassDescriptor cld = getOwnerClassDescriptor();
Object owner;
Object relatedObject;
Object fkValues[];
Identity id;
... | java | protected void associateBatched(Collection owners, Collection children)
{
ObjectReferenceDescriptor ord = getObjectReferenceDescriptor();
ClassDescriptor cld = getOwnerClassDescriptor();
Object owner;
Object relatedObject;
Object fkValues[];
Identity id;
... | [
"protected",
"void",
"associateBatched",
"(",
"Collection",
"owners",
",",
"Collection",
"children",
")",
"{",
"ObjectReferenceDescriptor",
"ord",
"=",
"getObjectReferenceDescriptor",
"(",
")",
";",
"ClassDescriptor",
"cld",
"=",
"getOwnerClassDescriptor",
"(",
")",
"... | Associate the batched Children with their owner object.
Loop over owners | [
"Associate",
"the",
"batched",
"Children",
"with",
"their",
"owner",
"object",
".",
"Loop",
"over",
"owners"
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/ReferencePrefetcher.java#L56-L89 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/collections/DListImpl.java | DListImpl.existsElement | public boolean existsElement(String predicate) throws org.odmg.QueryInvalidException
{
DList results = (DList) this.query(predicate);
if (results == null || results.size() == 0)
return false;
else
return true;
} | java | public boolean existsElement(String predicate) throws org.odmg.QueryInvalidException
{
DList results = (DList) this.query(predicate);
if (results == null || results.size() == 0)
return false;
else
return true;
} | [
"public",
"boolean",
"existsElement",
"(",
"String",
"predicate",
")",
"throws",
"org",
".",
"odmg",
".",
"QueryInvalidException",
"{",
"DList",
"results",
"=",
"(",
"DList",
")",
"this",
".",
"query",
"(",
"predicate",
")",
";",
"if",
"(",
"results",
"=="... | Determines whether there is an element of the collection that evaluates to true
for the predicate.
@param predicate An OQL boolean query predicate.
@return True if there is an element of the collection that evaluates to true
for the predicate, otherwise false.
@exception org.odmg.QueryInvalidException The query predica... | [
"Determines",
"whether",
"there",
"is",
"an",
"element",
"of",
"the",
"collection",
"that",
"evaluates",
"to",
"true",
"for",
"the",
"predicate",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/collections/DListImpl.java#L266-L273 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/collections/DListImpl.java | DListImpl.select | public Iterator select(String predicate) throws org.odmg.QueryInvalidException
{
return this.query(predicate).iterator();
} | java | public Iterator select(String predicate) throws org.odmg.QueryInvalidException
{
return this.query(predicate).iterator();
} | [
"public",
"Iterator",
"select",
"(",
"String",
"predicate",
")",
"throws",
"org",
".",
"odmg",
".",
"QueryInvalidException",
"{",
"return",
"this",
".",
"query",
"(",
"predicate",
")",
".",
"iterator",
"(",
")",
";",
"}"
] | Access all of the elements of the collection that evaluate to true for the
provided query predicate.
@param predicate An OQL boolean query predicate.
@return An iterator used to iterate over the elements that evaluated true for the predicate.
@exception org.odmg.QueryInvalidException The query predicate is invalid. | [
"Access",
"all",
"of",
"the",
"elements",
"of",
"the",
"collection",
"that",
"evaluate",
"to",
"true",
"for",
"the",
"provided",
"query",
"predicate",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/collections/DListImpl.java#L495-L498 | train |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/collections/DListImpl.java | DListImpl.selectElement | public Object selectElement(String predicate) throws org.odmg.QueryInvalidException
{
return ((DList) this.query(predicate)).get(0);
} | java | public Object selectElement(String predicate) throws org.odmg.QueryInvalidException
{
return ((DList) this.query(predicate)).get(0);
} | [
"public",
"Object",
"selectElement",
"(",
"String",
"predicate",
")",
"throws",
"org",
".",
"odmg",
".",
"QueryInvalidException",
"{",
"return",
"(",
"(",
"DList",
")",
"this",
".",
"query",
"(",
"predicate",
")",
")",
".",
"get",
"(",
"0",
")",
";",
"... | Selects the single element of the collection for which the provided OQL query
predicate is true.
@param predicate An OQL boolean query predicate.
@return The element that evaluates to true for the predicate. If no element
evaluates to true, null is returned.
@exception org.odmg.QueryInvalidException The query predicate... | [
"Selects",
"the",
"single",
"element",
"of",
"the",
"collection",
"for",
"which",
"the",
"provided",
"OQL",
"query",
"predicate",
"is",
"true",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/collections/DListImpl.java#L508-L511 | train |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/CommaListIterator.java | CommaListIterator.sameLists | public static boolean sameLists(String list1, String list2)
{
return new CommaListIterator(list1).equals(new CommaListIterator(list2));
} | java | public static boolean sameLists(String list1, String list2)
{
return new CommaListIterator(list1).equals(new CommaListIterator(list2));
} | [
"public",
"static",
"boolean",
"sameLists",
"(",
"String",
"list1",
",",
"String",
"list2",
")",
"{",
"return",
"new",
"CommaListIterator",
"(",
"list1",
")",
".",
"equals",
"(",
"new",
"CommaListIterator",
"(",
"list2",
")",
")",
";",
"}"
] | Compares the two comma-separated lists.
@param list1 The first list
@param list2 The second list
@return <code>true</code> if the lists are equal | [
"Compares",
"the",
"two",
"comma",
"-",
"separated",
"lists",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/CommaListIterator.java#L143-L146 | train |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.startTimer | public static void startTimer(final String type) {
TransactionLogger instance = getInstance();
if (instance == null) {
return;
}
instance.components.putIfAbsent(type, new Component(type));
instance.components.get(type).startTimer();
} | java | public static void startTimer(final String type) {
TransactionLogger instance = getInstance();
if (instance == null) {
return;
}
instance.components.putIfAbsent(type, new Component(type));
instance.components.get(type).startTimer();
} | [
"public",
"static",
"void",
"startTimer",
"(",
"final",
"String",
"type",
")",
"{",
"TransactionLogger",
"instance",
"=",
"getInstance",
"(",
")",
";",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"return",
";",
"}",
"instance",
".",
"components",
".",
... | Start component timer for current instance
@param type - of component | [
"Start",
"component",
"timer",
"for",
"current",
"instance"
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L84-L92 | train |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.pauseTimer | public static void pauseTimer(final String type) {
TransactionLogger instance = getInstance();
if (instance == null) {
return;
}
instance.components.get(type).pauseTimer();
} | java | public static void pauseTimer(final String type) {
TransactionLogger instance = getInstance();
if (instance == null) {
return;
}
instance.components.get(type).pauseTimer();
} | [
"public",
"static",
"void",
"pauseTimer",
"(",
"final",
"String",
"type",
")",
"{",
"TransactionLogger",
"instance",
"=",
"getInstance",
"(",
")",
";",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"return",
";",
"}",
"instance",
".",
"components",
".",
... | Pause component timer for current instance
@param type - of component | [
"Pause",
"component",
"timer",
"for",
"current",
"instance"
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L103-L110 | train |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.getComponentsMultiThread | public static ComponentsMultiThread getComponentsMultiThread() {
TransactionLogger instance = getInstance();
if (instance == null) {
return null;
}
return instance.componentsMultiThread;
} | java | public static ComponentsMultiThread getComponentsMultiThread() {
TransactionLogger instance = getInstance();
if (instance == null) {
return null;
}
return instance.componentsMultiThread;
} | [
"public",
"static",
"ComponentsMultiThread",
"getComponentsMultiThread",
"(",
")",
"{",
"TransactionLogger",
"instance",
"=",
"getInstance",
"(",
")",
";",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"instance",
".",
"c... | Get ComponentsMultiThread of current instance
@return componentsMultiThread | [
"Get",
"ComponentsMultiThread",
"of",
"current",
"instance"
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L150-L157 | train |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.getComponentsList | public static Collection<Component> getComponentsList() {
TransactionLogger instance = getInstance();
if (instance == null) {
return null;
}
return instance.components.values();
} | java | public static Collection<Component> getComponentsList() {
TransactionLogger instance = getInstance();
if (instance == null) {
return null;
}
return instance.components.values();
} | [
"public",
"static",
"Collection",
"<",
"Component",
">",
"getComponentsList",
"(",
")",
"{",
"TransactionLogger",
"instance",
"=",
"getInstance",
"(",
")",
";",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"instance",
... | Get components list for current instance
@return components | [
"Get",
"components",
"list",
"for",
"current",
"instance"
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L163-L170 | train |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.getFlowContext | public static String getFlowContext() {
TransactionLogger instance = getInstance();
if (instance == null) {
return null;
}
return instance.flowContext;
} | java | public static String getFlowContext() {
TransactionLogger instance = getInstance();
if (instance == null) {
return null;
}
return instance.flowContext;
} | [
"public",
"static",
"String",
"getFlowContext",
"(",
")",
"{",
"TransactionLogger",
"instance",
"=",
"getInstance",
"(",
")",
";",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"instance",
".",
"flowContext",
";",
"}"... | Get string value of flow context for current instance
@return string value of flow context | [
"Get",
"string",
"value",
"of",
"flow",
"context",
"for",
"current",
"instance"
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L176-L183 | train |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.createLoggingAction | protected static boolean createLoggingAction(final Logger logger, final Logger auditor, final TransactionLogger instance) {
TransactionLogger oldInstance = getInstance();
if (oldInstance == null || oldInstance.finished) {
if(loggingKeys == null) {
synchronized (TransactionLogger.class) {
... | java | protected static boolean createLoggingAction(final Logger logger, final Logger auditor, final TransactionLogger instance) {
TransactionLogger oldInstance = getInstance();
if (oldInstance == null || oldInstance.finished) {
if(loggingKeys == null) {
synchronized (TransactionLogger.class) {
... | [
"protected",
"static",
"boolean",
"createLoggingAction",
"(",
"final",
"Logger",
"logger",
",",
"final",
"Logger",
"auditor",
",",
"final",
"TransactionLogger",
"instance",
")",
"{",
"TransactionLogger",
"oldInstance",
"=",
"getInstance",
"(",
")",
";",
"if",
"(",... | Create new logging action
This method check if there is an old instance for this thread-local
If not - Initialize new instance and set it as this thread-local's instance
@param logger
@param auditor
@param instance
@return whether new instance was set to thread-local | [
"Create",
"new",
"logging",
"action",
"This",
"method",
"check",
"if",
"there",
"is",
"an",
"old",
"instance",
"for",
"this",
"thread",
"-",
"local",
"If",
"not",
"-",
"Initialize",
"new",
"instance",
"and",
"set",
"it",
"as",
"this",
"thread",
"-",
"loc... | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L264-L280 | train |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.addPropertiesStart | protected void addPropertiesStart(String type) {
putProperty(PropertyKey.Host.name(), IpUtils.getHostName());
putProperty(PropertyKey.Type.name(), type);
putProperty(PropertyKey.Status.name(), Status.Start.name());
} | java | protected void addPropertiesStart(String type) {
putProperty(PropertyKey.Host.name(), IpUtils.getHostName());
putProperty(PropertyKey.Type.name(), type);
putProperty(PropertyKey.Status.name(), Status.Start.name());
} | [
"protected",
"void",
"addPropertiesStart",
"(",
"String",
"type",
")",
"{",
"putProperty",
"(",
"PropertyKey",
".",
"Host",
".",
"name",
"(",
")",
",",
"IpUtils",
".",
"getHostName",
"(",
")",
")",
";",
"putProperty",
"(",
"PropertyKey",
".",
"Type",
".",
... | Add properties to 'properties' map on transaction start
@param type - of transaction | [
"Add",
"properties",
"to",
"properties",
"map",
"on",
"transaction",
"start"
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L299-L303 | train |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.writePropertiesToLog | protected void writePropertiesToLog(Logger logger, Level level) {
writeToLog(logger, level, getMapAsString(this.properties, separator), null);
if (this.exception != null) {
writeToLog(this.logger, Level.ERROR, "Error:", this.exception);
}
} | java | protected void writePropertiesToLog(Logger logger, Level level) {
writeToLog(logger, level, getMapAsString(this.properties, separator), null);
if (this.exception != null) {
writeToLog(this.logger, Level.ERROR, "Error:", this.exception);
}
} | [
"protected",
"void",
"writePropertiesToLog",
"(",
"Logger",
"logger",
",",
"Level",
"level",
")",
"{",
"writeToLog",
"(",
"logger",
",",
"level",
",",
"getMapAsString",
"(",
"this",
".",
"properties",
",",
"separator",
")",
",",
"null",
")",
";",
"if",
"("... | Write 'properties' map to given log in given level - with pipe separator between each entry
Write exception stack trace to 'logger' in 'error' level, if not empty
@param logger
@param level - of logging | [
"Write",
"properties",
"map",
"to",
"given",
"log",
"in",
"given",
"level",
"-",
"with",
"pipe",
"separator",
"between",
"each",
"entry",
"Write",
"exception",
"stack",
"trace",
"to",
"logger",
"in",
"error",
"level",
"if",
"not",
"empty"
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L363-L369 | train |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.initInstance | private static void initInstance(final TransactionLogger instance, final Logger logger, final Logger auditor) {
instance.logger = logger;
instance.auditor = auditor;
instance.components = new LinkedHashMap<>();
instance.properties = new LinkedHashMap<>();
instance.total = new Component(TOTAL_COMPONE... | java | private static void initInstance(final TransactionLogger instance, final Logger logger, final Logger auditor) {
instance.logger = logger;
instance.auditor = auditor;
instance.components = new LinkedHashMap<>();
instance.properties = new LinkedHashMap<>();
instance.total = new Component(TOTAL_COMPONE... | [
"private",
"static",
"void",
"initInstance",
"(",
"final",
"TransactionLogger",
"instance",
",",
"final",
"Logger",
"logger",
",",
"final",
"Logger",
"auditor",
")",
"{",
"instance",
".",
"logger",
"=",
"logger",
";",
"instance",
".",
"auditor",
"=",
"auditor"... | Initialize new instance
@param instance
@param logger
@param auditor | [
"Initialize",
"new",
"instance"
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L413-L422 | train |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.writeToLog | private static void writeToLog(Logger logger, Level level, String pattern, Exception exception) {
if (level == Level.ERROR) {
logger.error(pattern, exception);
} else if (level == Level.INFO) {
logger.info(pattern);
} else if (level == Level.DEBUG) {
logger.debug(pattern);
}
} | java | private static void writeToLog(Logger logger, Level level, String pattern, Exception exception) {
if (level == Level.ERROR) {
logger.error(pattern, exception);
} else if (level == Level.INFO) {
logger.info(pattern);
} else if (level == Level.DEBUG) {
logger.debug(pattern);
}
} | [
"private",
"static",
"void",
"writeToLog",
"(",
"Logger",
"logger",
",",
"Level",
"level",
",",
"String",
"pattern",
",",
"Exception",
"exception",
")",
"{",
"if",
"(",
"level",
"==",
"Level",
".",
"ERROR",
")",
"{",
"logger",
".",
"error",
"(",
"pattern... | Write the given pattern to given log in given logging level
@param logger
@param level
@param pattern
@param exception | [
"Write",
"the",
"given",
"pattern",
"to",
"given",
"log",
"in",
"given",
"logging",
"level"
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L431-L439 | train |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.addTimePerComponent | private static void addTimePerComponent(HashMap<String, Long> mapComponentTimes, Component component) {
Long currentTimeOfComponent = 0L;
String key = component.getComponentType();
if (mapComponentTimes.containsKey(key)) {
currentTimeOfComponent = mapComponentTimes.get(key);
}
//when transacti... | java | private static void addTimePerComponent(HashMap<String, Long> mapComponentTimes, Component component) {
Long currentTimeOfComponent = 0L;
String key = component.getComponentType();
if (mapComponentTimes.containsKey(key)) {
currentTimeOfComponent = mapComponentTimes.get(key);
}
//when transacti... | [
"private",
"static",
"void",
"addTimePerComponent",
"(",
"HashMap",
"<",
"String",
",",
"Long",
">",
"mapComponentTimes",
",",
"Component",
"component",
")",
"{",
"Long",
"currentTimeOfComponent",
"=",
"0L",
";",
"String",
"key",
"=",
"component",
".",
"getCompo... | Add component processing time to given map
@param mapComponentTimes
@param component | [
"Add",
"component",
"processing",
"time",
"to",
"given",
"map"
] | cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6 | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L446-L456 | train |
geomajas/geomajas-project-server | plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/filter/ExtendedLikeFilterImpl.java | ExtendedLikeFilterImpl.convertToSQL92 | public static String convertToSQL92(char escape, char multi, char single, String pattern)
throws IllegalArgumentException {
if ((escape == '\'') || (multi == '\'') || (single == '\'')) {
throw new IllegalArgumentException("do not use single quote (') as special char!");
}
StringBuilder result = new Strin... | java | public static String convertToSQL92(char escape, char multi, char single, String pattern)
throws IllegalArgumentException {
if ((escape == '\'') || (multi == '\'') || (single == '\'')) {
throw new IllegalArgumentException("do not use single quote (') as special char!");
}
StringBuilder result = new Strin... | [
"public",
"static",
"String",
"convertToSQL92",
"(",
"char",
"escape",
",",
"char",
"multi",
",",
"char",
"single",
",",
"String",
"pattern",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"(",
"escape",
"==",
"'",
"'",
")",
"||",
"(",
"multi",... | Given OGC PropertyIsLike Filter information, construct an SQL-compatible 'like' pattern.
SQL % --> match any number of characters _ --> match a single character
NOTE; the SQL command is 'string LIKE pattern [ESCAPE escape-character]' We could re-define the escape character,
but I'm not doing to do that in this code s... | [
"Given",
"OGC",
"PropertyIsLike",
"Filter",
"information",
"construct",
"an",
"SQL",
"-",
"compatible",
"like",
"pattern",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/filter/ExtendedLikeFilterImpl.java#L86-L116 | train |
geomajas/geomajas-project-server | plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/filter/ExtendedLikeFilterImpl.java | ExtendedLikeFilterImpl.getSQL92LikePattern | public String getSQL92LikePattern() throws IllegalArgumentException {
if (escape.length() != 1) {
throw new IllegalArgumentException("Like Pattern --> escape char should be of length exactly 1");
}
if (wildcardSingle.length() != 1) {
throw new IllegalArgumentException("Like Pattern --> wildcardSingle char s... | java | public String getSQL92LikePattern() throws IllegalArgumentException {
if (escape.length() != 1) {
throw new IllegalArgumentException("Like Pattern --> escape char should be of length exactly 1");
}
if (wildcardSingle.length() != 1) {
throw new IllegalArgumentException("Like Pattern --> wildcardSingle char s... | [
"public",
"String",
"getSQL92LikePattern",
"(",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"escape",
".",
"length",
"(",
")",
"!=",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Like Pattern --> escape char should be of length exactl... | See convertToSQL92.
@return SQL like sub-expression
@throws IllegalArgumentException oops | [
"See",
"convertToSQL92",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/filter/ExtendedLikeFilterImpl.java#L124-L136 | train |
geomajas/geomajas-project-server | plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/filter/ExtendedLikeFilterImpl.java | ExtendedLikeFilterImpl.evaluate | public boolean evaluate(Object feature) {
// Checks to ensure that the attribute has been set
if (attribute == null) {
return false;
}
// Note that this converts the attribute to a string
// for comparison. Unlike the math or geometry filters, which
// require specific types to function correctly, this f... | java | public boolean evaluate(Object feature) {
// Checks to ensure that the attribute has been set
if (attribute == null) {
return false;
}
// Note that this converts the attribute to a string
// for comparison. Unlike the math or geometry filters, which
// require specific types to function correctly, this f... | [
"public",
"boolean",
"evaluate",
"(",
"Object",
"feature",
")",
"{",
"// Checks to ensure that the attribute has been set",
"if",
"(",
"attribute",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"// Note that this converts the attribute to a string",
"// for compariso... | Determines whether or not a given feature matches this pattern.
@param feature
Specified feature to examine.
@return Flag confirming whether or not this feature is inside the filter. | [
"Determines",
"whether",
"or",
"not",
"a",
"given",
"feature",
"matches",
"this",
"pattern",
"."
] | 904b7d7deed1350d28955589098dd1e0a786d76e | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/filter/ExtendedLikeFilterImpl.java#L375-L399 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.