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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
carewebframework/carewebframework-core | org.carewebframework.messaging-parent/org.carewebframework.messaging.amqp-parent/org.carewebframework.messaging.amqp.rabbitmq/src/main/java/org/carewebframework/messaging/amqp/rabbitmq/Broker.java | Broker.sendMessage | public void sendMessage(String channel, Message message) {
ensureChannel(channel);
admin.getRabbitTemplate().convertAndSend(exchange.getName(), channel, message);
} | java | public void sendMessage(String channel, Message message) {
ensureChannel(channel);
admin.getRabbitTemplate().convertAndSend(exchange.getName(), channel, message);
} | [
"public",
"void",
"sendMessage",
"(",
"String",
"channel",
",",
"Message",
"message",
")",
"{",
"ensureChannel",
"(",
"channel",
")",
";",
"admin",
".",
"getRabbitTemplate",
"(",
")",
".",
"convertAndSend",
"(",
"exchange",
".",
"getName",
"(",
")",
",",
"... | Sends an event to the default exchange.
@param channel Name of the channel.
@param message Message to send. | [
"Sends",
"an",
"event",
"to",
"the",
"default",
"exchange",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.messaging-parent/org.carewebframework.messaging.amqp-parent/org.carewebframework.messaging.amqp.rabbitmq/src/main/java/org/carewebframework/messaging/amqp/rabbitmq/Broker.java#L104-L107 | train |
DDTH/ddth-queue | ddth-queue-core/src/main/java/com/github/ddth/queue/impl/ActiveMqQueue.java | ActiveMqQueue.putToQueue | protected boolean putToQueue(IQueueMessage<ID, DATA> msg) {
try {
BytesMessage message = getProducerSession().createBytesMessage();
message.writeBytes(serialize(msg));
getMessageProducer().send(message);
return true;
} catch (Exception e) {
throw e instanceof QueueException ? (QueueException) e : new QueueException(e);
}
} | java | protected boolean putToQueue(IQueueMessage<ID, DATA> msg) {
try {
BytesMessage message = getProducerSession().createBytesMessage();
message.writeBytes(serialize(msg));
getMessageProducer().send(message);
return true;
} catch (Exception e) {
throw e instanceof QueueException ? (QueueException) e : new QueueException(e);
}
} | [
"protected",
"boolean",
"putToQueue",
"(",
"IQueueMessage",
"<",
"ID",
",",
"DATA",
">",
"msg",
")",
"{",
"try",
"{",
"BytesMessage",
"message",
"=",
"getProducerSession",
"(",
")",
".",
"createBytesMessage",
"(",
")",
";",
"message",
".",
"writeBytes",
"(",... | Puts a message to ActiveMQ queue.
@param msg
@return | [
"Puts",
"a",
"message",
"to",
"ActiveMQ",
"queue",
"."
] | b20776850d23111d3d71fc8ed6023c590bc3621f | https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/impl/ActiveMqQueue.java#L304-L313 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/CompositeException.java | CompositeException.hasException | public boolean hasException(Class<? extends Throwable> type) {
for (Throwable exception : exceptions) {
if (type.isInstance(exception)) {
return true;
}
}
return false;
} | java | public boolean hasException(Class<? extends Throwable> type) {
for (Throwable exception : exceptions) {
if (type.isInstance(exception)) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"hasException",
"(",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"type",
")",
"{",
"for",
"(",
"Throwable",
"exception",
":",
"exceptions",
")",
"{",
"if",
"(",
"type",
".",
"isInstance",
"(",
"exception",
")",
")",
"{",
"return"... | Returns true if this instance contains an exception of the given type.
@param type The exception class sought.
@return True if the exception class is present. | [
"Returns",
"true",
"if",
"this",
"instance",
"contains",
"an",
"exception",
"of",
"the",
"given",
"type",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/CompositeException.java#L70-L78 | train |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/CompositeException.java | CompositeException.getStackTrace | @Override
public StackTraceElement[] getStackTrace() {
ArrayList<StackTraceElement> stackTrace = new ArrayList<>();
for (Throwable exception : exceptions) {
stackTrace.addAll(Arrays.asList(exception.getStackTrace()));
}
return stackTrace.toArray(new StackTraceElement[stackTrace.size()]);
} | java | @Override
public StackTraceElement[] getStackTrace() {
ArrayList<StackTraceElement> stackTrace = new ArrayList<>();
for (Throwable exception : exceptions) {
stackTrace.addAll(Arrays.asList(exception.getStackTrace()));
}
return stackTrace.toArray(new StackTraceElement[stackTrace.size()]);
} | [
"@",
"Override",
"public",
"StackTraceElement",
"[",
"]",
"getStackTrace",
"(",
")",
"{",
"ArrayList",
"<",
"StackTraceElement",
">",
"stackTrace",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Throwable",
"exception",
":",
"exceptions",
")",
"{... | Returns the stack trace, which is the union of all stack traces of contained exceptions. | [
"Returns",
"the",
"stack",
"trace",
"which",
"is",
"the",
"union",
"of",
"all",
"stack",
"traces",
"of",
"contained",
"exceptions",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/CompositeException.java#L129-L138 | train |
mgormley/prim | src/main/java_generated/edu/jhu/prim/vector/LongIntSortedVector.java | LongIntSortedVector.dot | public int dot(int[] other) {
int dot = 0;
for (int c = 0; c < used && indices[c] < other.length; c++) {
if (indices[c] > Integer.MAX_VALUE) {
break;
}
dot += values[c] * other[SafeCast.safeLongToInt(indices[c])];
}
return dot;
} | java | public int dot(int[] other) {
int dot = 0;
for (int c = 0; c < used && indices[c] < other.length; c++) {
if (indices[c] > Integer.MAX_VALUE) {
break;
}
dot += values[c] * other[SafeCast.safeLongToInt(indices[c])];
}
return dot;
} | [
"public",
"int",
"dot",
"(",
"int",
"[",
"]",
"other",
")",
"{",
"int",
"dot",
"=",
"0",
";",
"for",
"(",
"int",
"c",
"=",
"0",
";",
"c",
"<",
"used",
"&&",
"indices",
"[",
"c",
"]",
"<",
"other",
".",
"length",
";",
"c",
"++",
")",
"{",
... | Computes the dot product of this vector with the given vector. | [
"Computes",
"the",
"dot",
"product",
"of",
"this",
"vector",
"with",
"the",
"given",
"vector",
"."
] | 5dce5e1ae94a9ae558a6262fc246e1a24f56686c | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/vector/LongIntSortedVector.java#L101-L110 | train |
mgormley/prim | src/main/java_generated/edu/jhu/prim/vector/LongIntSortedVector.java | LongIntSortedVector.dot | public int dot(int[][] matrix, int col) {
int ret = 0;
for (int c = 0; c < used && indices[c] < matrix.length; c++) {
if (indices[c] > Integer.MAX_VALUE) {
break;
}
ret += values[c] * matrix[SafeCast.safeLongToInt(indices[c])][col];
}
return ret;
} | java | public int dot(int[][] matrix, int col) {
int ret = 0;
for (int c = 0; c < used && indices[c] < matrix.length; c++) {
if (indices[c] > Integer.MAX_VALUE) {
break;
}
ret += values[c] * matrix[SafeCast.safeLongToInt(indices[c])][col];
}
return ret;
} | [
"public",
"int",
"dot",
"(",
"int",
"[",
"]",
"[",
"]",
"matrix",
",",
"int",
"col",
")",
"{",
"int",
"ret",
"=",
"0",
";",
"for",
"(",
"int",
"c",
"=",
"0",
";",
"c",
"<",
"used",
"&&",
"indices",
"[",
"c",
"]",
"<",
"matrix",
".",
"length... | Computes the dot product of this vector with the column of the given matrix. | [
"Computes",
"the",
"dot",
"product",
"of",
"this",
"vector",
"with",
"the",
"column",
"of",
"the",
"given",
"matrix",
"."
] | 5dce5e1ae94a9ae558a6262fc246e1a24f56686c | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/vector/LongIntSortedVector.java#L113-L122 | train |
xiaosunzhu/resource-utils | src/main/java/net/sunyijun/resource/ResourceUtil.java | ResourceUtil.copyResourceToFile | public static void copyResourceToFile(String resourceAbsoluteClassPath, File targetFile) throws IOException {
InputStream is = ResourceUtil.class.getResourceAsStream(resourceAbsoluteClassPath);
if (is == null) {
throw new IOException("Resource not found! " + resourceAbsoluteClassPath);
}
OutputStream os = null;
try {
os = new FileOutputStream(targetFile);
byte[] buffer = new byte[2048];
int length;
while ((length = is.read(buffer)) != -1) {
os.write(buffer, 0, length);
}
os.flush();
} finally {
try {
is.close();
if (os != null) {
os.close();
}
} catch (Exception ignore) {
// ignore
}
}
} | java | public static void copyResourceToFile(String resourceAbsoluteClassPath, File targetFile) throws IOException {
InputStream is = ResourceUtil.class.getResourceAsStream(resourceAbsoluteClassPath);
if (is == null) {
throw new IOException("Resource not found! " + resourceAbsoluteClassPath);
}
OutputStream os = null;
try {
os = new FileOutputStream(targetFile);
byte[] buffer = new byte[2048];
int length;
while ((length = is.read(buffer)) != -1) {
os.write(buffer, 0, length);
}
os.flush();
} finally {
try {
is.close();
if (os != null) {
os.close();
}
} catch (Exception ignore) {
// ignore
}
}
} | [
"public",
"static",
"void",
"copyResourceToFile",
"(",
"String",
"resourceAbsoluteClassPath",
",",
"File",
"targetFile",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"ResourceUtil",
".",
"class",
".",
"getResourceAsStream",
"(",
"resourceAbsoluteClassPat... | Copy resources to file system.
@param resourceAbsoluteClassPath resource's absolute class path, start with "/"
@param targetFile target file
@throws java.io.IOException | [
"Copy",
"resources",
"to",
"file",
"system",
"."
] | 4f2bf3f36df10195a978f122ed682ba1eb0462b5 | https://github.com/xiaosunzhu/resource-utils/blob/4f2bf3f36df10195a978f122ed682ba1eb0462b5/src/main/java/net/sunyijun/resource/ResourceUtil.java#L39-L63 | train |
xiaosunzhu/resource-utils | src/main/java/net/sunyijun/resource/ResourceUtil.java | ResourceUtil.getAbsolutePath | public static String getAbsolutePath(String classPath) {
URL configUrl = Thread.currentThread().getContextClassLoader().getResource(classPath.substring(1));
if (configUrl == null) {
configUrl = ResourceUtil.class.getResource(classPath);
}
if (configUrl == null) {
return null;
}
try {
return configUrl.toURI().getPath();
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
} | java | public static String getAbsolutePath(String classPath) {
URL configUrl = Thread.currentThread().getContextClassLoader().getResource(classPath.substring(1));
if (configUrl == null) {
configUrl = ResourceUtil.class.getResource(classPath);
}
if (configUrl == null) {
return null;
}
try {
return configUrl.toURI().getPath();
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"String",
"getAbsolutePath",
"(",
"String",
"classPath",
")",
"{",
"URL",
"configUrl",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
".",
"getResource",
"(",
"classPath",
".",
"substring",
"(",
"1",
... | Get absolute path in file system from a classPath. If this resource not exists, return null. | [
"Get",
"absolute",
"path",
"in",
"file",
"system",
"from",
"a",
"classPath",
".",
"If",
"this",
"resource",
"not",
"exists",
"return",
"null",
"."
] | 4f2bf3f36df10195a978f122ed682ba1eb0462b5 | https://github.com/xiaosunzhu/resource-utils/blob/4f2bf3f36df10195a978f122ed682ba1eb0462b5/src/main/java/net/sunyijun/resource/ResourceUtil.java#L68-L81 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/designer/PropertyEditorBoolean.java | PropertyEditorBoolean.setFocus | @Override
public void setFocus() {
Radiobutton radio = editor.getSelected();
if (radio == null) {
radio = (Radiobutton) editor.getChildren().get(0);
}
radio.setFocus(true);
} | java | @Override
public void setFocus() {
Radiobutton radio = editor.getSelected();
if (radio == null) {
radio = (Radiobutton) editor.getChildren().get(0);
}
radio.setFocus(true);
} | [
"@",
"Override",
"public",
"void",
"setFocus",
"(",
")",
"{",
"Radiobutton",
"radio",
"=",
"editor",
".",
"getSelected",
"(",
")",
";",
"if",
"(",
"radio",
"==",
"null",
")",
"{",
"radio",
"=",
"(",
"Radiobutton",
")",
"editor",
".",
"getChildren",
"("... | Sets focus to the selected radio button. | [
"Sets",
"focus",
"to",
"the",
"selected",
"radio",
"button",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/designer/PropertyEditorBoolean.java#L69-L78 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/designer/DesignContextMenu.java | DesignContextMenu.getInstance | public static DesignContextMenu getInstance() {
Page page = ExecutionContext.getPage();
DesignContextMenu contextMenu = page.getAttribute(DesignConstants.ATTR_DESIGN_MENU, DesignContextMenu.class);
if (contextMenu == null) {
contextMenu = create();
page.setAttribute(DesignConstants.ATTR_DESIGN_MENU, contextMenu);
}
return contextMenu;
} | java | public static DesignContextMenu getInstance() {
Page page = ExecutionContext.getPage();
DesignContextMenu contextMenu = page.getAttribute(DesignConstants.ATTR_DESIGN_MENU, DesignContextMenu.class);
if (contextMenu == null) {
contextMenu = create();
page.setAttribute(DesignConstants.ATTR_DESIGN_MENU, contextMenu);
}
return contextMenu;
} | [
"public",
"static",
"DesignContextMenu",
"getInstance",
"(",
")",
"{",
"Page",
"page",
"=",
"ExecutionContext",
".",
"getPage",
"(",
")",
";",
"DesignContextMenu",
"contextMenu",
"=",
"page",
".",
"getAttribute",
"(",
"DesignConstants",
".",
"ATTR_DESIGN_MENU",
",... | Returns an instance of the design context menu. This is a singleton with the page scope and
is cached once created.
@return The design context menu for the active page. | [
"Returns",
"an",
"instance",
"of",
"the",
"design",
"context",
"menu",
".",
"This",
"is",
"a",
"singleton",
"with",
"the",
"page",
"scope",
"and",
"is",
"cached",
"once",
"created",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/designer/DesignContextMenu.java#L90-L100 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/designer/DesignContextMenu.java | DesignContextMenu.create | public static DesignContextMenu create() {
return PageUtil.createPage(DesignConstants.RESOURCE_PREFIX + "designContextMenu.fsp", ExecutionContext.getPage())
.get(0).getAttribute("controller", DesignContextMenu.class);
} | java | public static DesignContextMenu create() {
return PageUtil.createPage(DesignConstants.RESOURCE_PREFIX + "designContextMenu.fsp", ExecutionContext.getPage())
.get(0).getAttribute("controller", DesignContextMenu.class);
} | [
"public",
"static",
"DesignContextMenu",
"create",
"(",
")",
"{",
"return",
"PageUtil",
".",
"createPage",
"(",
"DesignConstants",
".",
"RESOURCE_PREFIX",
"+",
"\"designContextMenu.fsp\"",
",",
"ExecutionContext",
".",
"getPage",
"(",
")",
")",
".",
"get",
"(",
... | Creates an instance of the design context menu.
@return New design context menu. | [
"Creates",
"an",
"instance",
"of",
"the",
"design",
"context",
"menu",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/designer/DesignContextMenu.java#L107-L110 | train |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/designer/DesignContextMenu.java | DesignContextMenu.disable | private void disable(IDisable comp, boolean disabled) {
if (comp != null) {
comp.setDisabled(disabled);
if (comp instanceof BaseUIComponent) {
((BaseUIComponent) comp).addStyle("opacity", disabled ? ".2" : "1");
}
}
} | java | private void disable(IDisable comp, boolean disabled) {
if (comp != null) {
comp.setDisabled(disabled);
if (comp instanceof BaseUIComponent) {
((BaseUIComponent) comp).addStyle("opacity", disabled ? ".2" : "1");
}
}
} | [
"private",
"void",
"disable",
"(",
"IDisable",
"comp",
",",
"boolean",
"disabled",
")",
"{",
"if",
"(",
"comp",
"!=",
"null",
")",
"{",
"comp",
".",
"setDisabled",
"(",
"disabled",
")",
";",
"if",
"(",
"comp",
"instanceof",
"BaseUIComponent",
")",
"{",
... | Sets the disabled state of the specified component.
@param comp The component.
@param disabled The disabled state. | [
"Sets",
"the",
"disabled",
"state",
"of",
"the",
"specified",
"component",
"."
] | fa3252d4f7541dbe151b92c3d4f6f91433cd1673 | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/designer/DesignContextMenu.java#L151-L159 | train |
mgormley/prim | src/main/java/edu/jhu/prim/util/math/FastMath.java | FastMath.logAdd | public static double logAdd(double x, double y) {
if (FastMath.useLogAddTable) {
return SmoothedLogAddTable.logAdd(x,y);
} else {
return FastMath.logAddExact(x,y);
}
} | java | public static double logAdd(double x, double y) {
if (FastMath.useLogAddTable) {
return SmoothedLogAddTable.logAdd(x,y);
} else {
return FastMath.logAddExact(x,y);
}
} | [
"public",
"static",
"double",
"logAdd",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"if",
"(",
"FastMath",
".",
"useLogAddTable",
")",
"{",
"return",
"SmoothedLogAddTable",
".",
"logAdd",
"(",
"x",
",",
"y",
")",
";",
"}",
"else",
"{",
"return",
... | Adds two probabilities that are stored as log probabilities.
@param x log(p)
@param y log(q)
@return log(p + q) = log(exp(x) + exp(y)) | [
"Adds",
"two",
"probabilities",
"that",
"are",
"stored",
"as",
"log",
"probabilities",
"."
] | 5dce5e1ae94a9ae558a6262fc246e1a24f56686c | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/util/math/FastMath.java#L27-L33 | train |
mgormley/prim | src/main/java/edu/jhu/prim/util/math/FastMath.java | FastMath.mod | public static int mod(int val, int mod) {
val = val % mod;
if (val < 0) {
val += mod;
}
return val;
} | java | public static int mod(int val, int mod) {
val = val % mod;
if (val < 0) {
val += mod;
}
return val;
} | [
"public",
"static",
"int",
"mod",
"(",
"int",
"val",
",",
"int",
"mod",
")",
"{",
"val",
"=",
"val",
"%",
"mod",
";",
"if",
"(",
"val",
"<",
"0",
")",
"{",
"val",
"+=",
"mod",
";",
"}",
"return",
"val",
";",
"}"
] | Modulo operator where all numbers evaluate to a positive remainder.
@param val The value to mod.
@param mod The mod.
@return val modulo mod | [
"Modulo",
"operator",
"where",
"all",
"numbers",
"evaluate",
"to",
"a",
"positive",
"remainder",
"."
] | 5dce5e1ae94a9ae558a6262fc246e1a24f56686c | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/util/math/FastMath.java#L186-L192 | train |
dashorst/wicket-stuff-markup-validator | isorelax/src/main/java/org/iso_relax/verifier/impl/VerifierImpl.java | VerifierImpl.prepareXMLReader | protected void prepareXMLReader() throws VerifierConfigurationException {
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
reader = factory.newSAXParser().getXMLReader();
} catch( SAXException e ) {
throw new VerifierConfigurationException(e);
} catch( ParserConfigurationException pce ) {
throw new VerifierConfigurationException(pce);
}
} | java | protected void prepareXMLReader() throws VerifierConfigurationException {
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
reader = factory.newSAXParser().getXMLReader();
} catch( SAXException e ) {
throw new VerifierConfigurationException(e);
} catch( ParserConfigurationException pce ) {
throw new VerifierConfigurationException(pce);
}
} | [
"protected",
"void",
"prepareXMLReader",
"(",
")",
"throws",
"VerifierConfigurationException",
"{",
"try",
"{",
"SAXParserFactory",
"factory",
"=",
"SAXParserFactory",
".",
"newInstance",
"(",
")",
";",
"factory",
".",
"setNamespaceAware",
"(",
"true",
")",
";",
"... | Creates and sets a sole instance of XMLReader which will be used
by this verifier. | [
"Creates",
"and",
"sets",
"a",
"sole",
"instance",
"of",
"XMLReader",
"which",
"will",
"be",
"used",
"by",
"this",
"verifier",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/isorelax/src/main/java/org/iso_relax/verifier/impl/VerifierImpl.java#L52-L62 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/SchemaImpl.java | SchemaImpl.makeBuiltinMode | private Mode makeBuiltinMode(String name, Class cls) {
// lookup/create a mode with the given name.
Mode mode = lookupCreateMode(name);
// Init the element action set for this mode.
ActionSet actions = new ActionSet();
// from the current mode we will use further the built in mode.
ModeUsage modeUsage = new ModeUsage(Mode.CURRENT, mode);
// Add the action corresponding to the built in mode.
if (cls == AttachAction.class)
actions.setResultAction(new AttachAction(modeUsage));
else if (cls == AllowAction.class)
actions.addNoResultAction(new AllowAction(modeUsage));
else if (cls == UnwrapAction.class)
actions.setResultAction(new UnwrapAction(modeUsage));
else
actions.addNoResultAction(new RejectAction(modeUsage));
// set the actions on any namespace.
mode.bindElement(NamespaceSpecification.ANY_NAMESPACE, NamespaceSpecification.DEFAULT_WILDCARD, actions);
// the mode is not defined in the script explicitelly
mode.noteDefined(null);
// creates attribute actions
AttributeActionSet attributeActions = new AttributeActionSet();
// if we have a schema for attributes then in the built in modes
// we reject attributes by default
// otherwise we attach attributes by default in the built in modes
if (attributesSchema)
attributeActions.setReject(true);
else
attributeActions.setAttach(true);
// set the attribute actions on any namespace
mode.bindAttribute(NamespaceSpecification.ANY_NAMESPACE, NamespaceSpecification.DEFAULT_WILDCARD, attributeActions);
return mode;
} | java | private Mode makeBuiltinMode(String name, Class cls) {
// lookup/create a mode with the given name.
Mode mode = lookupCreateMode(name);
// Init the element action set for this mode.
ActionSet actions = new ActionSet();
// from the current mode we will use further the built in mode.
ModeUsage modeUsage = new ModeUsage(Mode.CURRENT, mode);
// Add the action corresponding to the built in mode.
if (cls == AttachAction.class)
actions.setResultAction(new AttachAction(modeUsage));
else if (cls == AllowAction.class)
actions.addNoResultAction(new AllowAction(modeUsage));
else if (cls == UnwrapAction.class)
actions.setResultAction(new UnwrapAction(modeUsage));
else
actions.addNoResultAction(new RejectAction(modeUsage));
// set the actions on any namespace.
mode.bindElement(NamespaceSpecification.ANY_NAMESPACE, NamespaceSpecification.DEFAULT_WILDCARD, actions);
// the mode is not defined in the script explicitelly
mode.noteDefined(null);
// creates attribute actions
AttributeActionSet attributeActions = new AttributeActionSet();
// if we have a schema for attributes then in the built in modes
// we reject attributes by default
// otherwise we attach attributes by default in the built in modes
if (attributesSchema)
attributeActions.setReject(true);
else
attributeActions.setAttach(true);
// set the attribute actions on any namespace
mode.bindAttribute(NamespaceSpecification.ANY_NAMESPACE, NamespaceSpecification.DEFAULT_WILDCARD, attributeActions);
return mode;
} | [
"private",
"Mode",
"makeBuiltinMode",
"(",
"String",
"name",
",",
"Class",
"cls",
")",
"{",
"// lookup/create a mode with the given name.",
"Mode",
"mode",
"=",
"lookupCreateMode",
"(",
"name",
")",
";",
"// Init the element action set for this mode.",
"ActionSet",
"actio... | Makes a built in mode.
@param name The mode name.
@param cls The action class.
@return A Mode object. | [
"Makes",
"a",
"built",
"in",
"mode",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/SchemaImpl.java#L1170-L1202 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/SchemaImpl.java | SchemaImpl.installHandlers | SchemaFuture installHandlers(XMLReader in, SchemaReceiverImpl sr) {
Handler h = new Handler(sr);
in.setContentHandler(h);
return h;
} | java | SchemaFuture installHandlers(XMLReader in, SchemaReceiverImpl sr) {
Handler h = new Handler(sr);
in.setContentHandler(h);
return h;
} | [
"SchemaFuture",
"installHandlers",
"(",
"XMLReader",
"in",
",",
"SchemaReceiverImpl",
"sr",
")",
"{",
"Handler",
"h",
"=",
"new",
"Handler",
"(",
"sr",
")",
";",
"in",
".",
"setContentHandler",
"(",
"h",
")",
";",
"return",
"h",
";",
"}"
] | Installs the schema handler on the reader.
@param in The reader.
@param sr The schema receiver.
@return The installed handler that implements also SchemaFuture. | [
"Installs",
"the",
"schema",
"handler",
"on",
"the",
"reader",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/SchemaImpl.java#L1211-L1215 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/SchemaImpl.java | SchemaImpl.getModeAttribute | private Mode getModeAttribute(Attributes attributes, String localName) {
return lookupCreateMode(attributes.getValue("", localName));
} | java | private Mode getModeAttribute(Attributes attributes, String localName) {
return lookupCreateMode(attributes.getValue("", localName));
} | [
"private",
"Mode",
"getModeAttribute",
"(",
"Attributes",
"attributes",
",",
"String",
"localName",
")",
"{",
"return",
"lookupCreateMode",
"(",
"attributes",
".",
"getValue",
"(",
"\"\"",
",",
"localName",
")",
")",
";",
"}"
] | Get the mode specified by an attribute from no namespace.
@param attributes The attributes.
@param localName The attribute name.
@return The mode refered by the licanName attribute. | [
"Get",
"the",
"mode",
"specified",
"by",
"an",
"attribute",
"from",
"no",
"namespace",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/SchemaImpl.java#L1233-L1235 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/SchemaImpl.java | SchemaImpl.lookupCreateMode | private Mode lookupCreateMode(String name) {
if (name == null)
return null;
name = name.trim();
Mode mode = (Mode)modeMap.get(name);
if (mode == null) {
mode = new Mode(name, defaultBaseMode);
modeMap.put(name, mode);
}
return mode;
} | java | private Mode lookupCreateMode(String name) {
if (name == null)
return null;
name = name.trim();
Mode mode = (Mode)modeMap.get(name);
if (mode == null) {
mode = new Mode(name, defaultBaseMode);
modeMap.put(name, mode);
}
return mode;
} | [
"private",
"Mode",
"lookupCreateMode",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"return",
"null",
";",
"name",
"=",
"name",
".",
"trim",
"(",
")",
";",
"Mode",
"mode",
"=",
"(",
"Mode",
")",
"modeMap",
".",
"get",
"(",... | Gets a mode with the given name from the mode map.
If not present then it creates a new mode extending the default base mode.
@param name The mode to look for or create if it does not exist.
@return Always a not null mode. | [
"Gets",
"a",
"mode",
"with",
"the",
"given",
"name",
"from",
"the",
"mode",
"map",
".",
"If",
"not",
"present",
"then",
"it",
"creates",
"a",
"new",
"mode",
"extending",
"the",
"default",
"base",
"mode",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/SchemaImpl.java#L1244-L1254 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/impl/triggers/DailyTimeIntervalTrigger.java | DailyTimeIntervalTrigger._advanceToNextDayOfWeekIfNecessary | private Date _advanceToNextDayOfWeekIfNecessary (final Date aFireTime, final boolean forceToAdvanceNextDay)
{
// a. Advance or adjust to next dayOfWeek if need to first, starting next
// day with startTimeOfDay.
Date fireTime = aFireTime;
final TimeOfDay sTimeOfDay = getStartTimeOfDay ();
final Date fireTimeStartDate = sTimeOfDay.getTimeOfDayForDate (fireTime);
final Calendar fireTimeStartDateCal = _createCalendarTime (fireTimeStartDate);
int nDayOfWeekOfFireTime = fireTimeStartDateCal.get (Calendar.DAY_OF_WEEK);
final int nCalDay = nDayOfWeekOfFireTime;
DayOfWeek eDayOfWeekOfFireTime = PDTHelper.getAsDayOfWeek (nCalDay);
// b2. We need to advance to another day if isAfterTimePassEndTimeOfDay is
// true, or dayOfWeek is not set.
final Set <DayOfWeek> daysOfWeekToFire = getDaysOfWeek ();
if (forceToAdvanceNextDay || !daysOfWeekToFire.contains (eDayOfWeekOfFireTime))
{
// Advance one day at a time until next available date.
for (int i = 1; i <= 7; i++)
{
fireTimeStartDateCal.add (Calendar.DATE, 1);
nDayOfWeekOfFireTime = fireTimeStartDateCal.get (Calendar.DAY_OF_WEEK);
final int nCalDay1 = nDayOfWeekOfFireTime;
eDayOfWeekOfFireTime = PDTHelper.getAsDayOfWeek (nCalDay1);
if (daysOfWeekToFire.contains (eDayOfWeekOfFireTime))
{
fireTime = fireTimeStartDateCal.getTime ();
break;
}
}
}
// Check fireTime not pass the endTime
final Date eTime = getEndTime ();
if (eTime != null && fireTime.getTime () > eTime.getTime ())
{
return null;
}
return fireTime;
} | java | private Date _advanceToNextDayOfWeekIfNecessary (final Date aFireTime, final boolean forceToAdvanceNextDay)
{
// a. Advance or adjust to next dayOfWeek if need to first, starting next
// day with startTimeOfDay.
Date fireTime = aFireTime;
final TimeOfDay sTimeOfDay = getStartTimeOfDay ();
final Date fireTimeStartDate = sTimeOfDay.getTimeOfDayForDate (fireTime);
final Calendar fireTimeStartDateCal = _createCalendarTime (fireTimeStartDate);
int nDayOfWeekOfFireTime = fireTimeStartDateCal.get (Calendar.DAY_OF_WEEK);
final int nCalDay = nDayOfWeekOfFireTime;
DayOfWeek eDayOfWeekOfFireTime = PDTHelper.getAsDayOfWeek (nCalDay);
// b2. We need to advance to another day if isAfterTimePassEndTimeOfDay is
// true, or dayOfWeek is not set.
final Set <DayOfWeek> daysOfWeekToFire = getDaysOfWeek ();
if (forceToAdvanceNextDay || !daysOfWeekToFire.contains (eDayOfWeekOfFireTime))
{
// Advance one day at a time until next available date.
for (int i = 1; i <= 7; i++)
{
fireTimeStartDateCal.add (Calendar.DATE, 1);
nDayOfWeekOfFireTime = fireTimeStartDateCal.get (Calendar.DAY_OF_WEEK);
final int nCalDay1 = nDayOfWeekOfFireTime;
eDayOfWeekOfFireTime = PDTHelper.getAsDayOfWeek (nCalDay1);
if (daysOfWeekToFire.contains (eDayOfWeekOfFireTime))
{
fireTime = fireTimeStartDateCal.getTime ();
break;
}
}
}
// Check fireTime not pass the endTime
final Date eTime = getEndTime ();
if (eTime != null && fireTime.getTime () > eTime.getTime ())
{
return null;
}
return fireTime;
} | [
"private",
"Date",
"_advanceToNextDayOfWeekIfNecessary",
"(",
"final",
"Date",
"aFireTime",
",",
"final",
"boolean",
"forceToAdvanceNextDay",
")",
"{",
"// a. Advance or adjust to next dayOfWeek if need to first, starting next",
"// day with startTimeOfDay.",
"Date",
"fireTime",
"=... | Given fireTime time determine if it is on a valid day of week. If so,
simply return it unaltered, if not, advance to the next valid week day, and
set the time of day to the start time of day
@param aFireTime
- given next fireTime.
@param forceToAdvanceNextDay
- flag to whether to advance day without check existing week day.
This scenario can happen when a caller determine fireTime has passed
the endTimeOfDay that fireTime should move to next day anyway.
@return a next day fireTime. | [
"Given",
"fireTime",
"time",
"determine",
"if",
"it",
"is",
"on",
"a",
"valid",
"day",
"of",
"week",
".",
"If",
"so",
"simply",
"return",
"it",
"unaltered",
"if",
"not",
"advance",
"to",
"the",
"next",
"valid",
"week",
"day",
"and",
"set",
"the",
"time... | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/impl/triggers/DailyTimeIntervalTrigger.java#L831-L871 | train |
phax/ph-schedule | ph-schedule/src/main/java/com/helger/schedule/quartz/QuartzSchedulerHelper.java | QuartzSchedulerHelper.getScheduler | @Nonnull
public static IScheduler getScheduler (final boolean bStartAutomatically)
{
try
{
// Don't try to use a name - results in NPE
final IScheduler aScheduler = s_aSchedulerFactory.getScheduler ();
if (bStartAutomatically && !aScheduler.isStarted ())
aScheduler.start ();
return aScheduler;
}
catch (final SchedulerException ex)
{
throw new IllegalStateException ("Failed to create" +
(bStartAutomatically ? " and start" : "") +
" scheduler!",
ex);
}
} | java | @Nonnull
public static IScheduler getScheduler (final boolean bStartAutomatically)
{
try
{
// Don't try to use a name - results in NPE
final IScheduler aScheduler = s_aSchedulerFactory.getScheduler ();
if (bStartAutomatically && !aScheduler.isStarted ())
aScheduler.start ();
return aScheduler;
}
catch (final SchedulerException ex)
{
throw new IllegalStateException ("Failed to create" +
(bStartAutomatically ? " and start" : "") +
" scheduler!",
ex);
}
} | [
"@",
"Nonnull",
"public",
"static",
"IScheduler",
"getScheduler",
"(",
"final",
"boolean",
"bStartAutomatically",
")",
"{",
"try",
"{",
"// Don't try to use a name - results in NPE",
"final",
"IScheduler",
"aScheduler",
"=",
"s_aSchedulerFactory",
".",
"getScheduler",
"("... | Get the underlying Quartz scheduler
@param bStartAutomatically
If <code>true</code> the returned scheduler is automatically
started. If <code>false</code> the state is not changed.
@return The underlying Quartz scheduler. Never <code>null</code>. | [
"Get",
"the",
"underlying",
"Quartz",
"scheduler"
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-schedule/src/main/java/com/helger/schedule/quartz/QuartzSchedulerHelper.java#L71-L89 | train |
phax/ph-schedule | ph-schedule/src/main/java/com/helger/schedule/quartz/QuartzSchedulerHelper.java | QuartzSchedulerHelper.getSchedulerMetaData | @Nonnull
public static SchedulerMetaData getSchedulerMetaData ()
{
try
{
// Get the scheduler without starting it
return s_aSchedulerFactory.getScheduler ().getMetaData ();
}
catch (final SchedulerException ex)
{
throw new IllegalStateException ("Failed to get scheduler metadata", ex);
}
} | java | @Nonnull
public static SchedulerMetaData getSchedulerMetaData ()
{
try
{
// Get the scheduler without starting it
return s_aSchedulerFactory.getScheduler ().getMetaData ();
}
catch (final SchedulerException ex)
{
throw new IllegalStateException ("Failed to get scheduler metadata", ex);
}
} | [
"@",
"Nonnull",
"public",
"static",
"SchedulerMetaData",
"getSchedulerMetaData",
"(",
")",
"{",
"try",
"{",
"// Get the scheduler without starting it",
"return",
"s_aSchedulerFactory",
".",
"getScheduler",
"(",
")",
".",
"getMetaData",
"(",
")",
";",
"}",
"catch",
"... | Get the metadata of the scheduler. The state of the scheduler is not
changed within this method.
@return The metadata of the underlying scheduler. | [
"Get",
"the",
"metadata",
"of",
"the",
"scheduler",
".",
"The",
"state",
"of",
"the",
"scheduler",
"is",
"not",
"changed",
"within",
"this",
"method",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-schedule/src/main/java/com/helger/schedule/quartz/QuartzSchedulerHelper.java#L97-L109 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/impl/calendar/CronCalendar.java | CronCalendar.setCronExpression | public void setCronExpression (@Nonnull final String expression) throws ParseException
{
final CronExpression newExp = new CronExpression (expression);
setCronExpression (newExp);
} | java | public void setCronExpression (@Nonnull final String expression) throws ParseException
{
final CronExpression newExp = new CronExpression (expression);
setCronExpression (newExp);
} | [
"public",
"void",
"setCronExpression",
"(",
"@",
"Nonnull",
"final",
"String",
"expression",
")",
"throws",
"ParseException",
"{",
"final",
"CronExpression",
"newExp",
"=",
"new",
"CronExpression",
"(",
"expression",
")",
";",
"setCronExpression",
"(",
"newExp",
"... | Sets the cron expression for the calendar to a new value
@param expression
the new string value to build a cron expression from
@throws ParseException
if the string expression cannot be parsed | [
"Sets",
"the",
"cron",
"expression",
"for",
"the",
"calendar",
"to",
"a",
"new",
"value"
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/impl/calendar/CronCalendar.java#L249-L254 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/impl/matchers/GroupMatcher.java | GroupMatcher.groupEquals | public static <T extends Key <T>> GroupMatcher <T> groupEquals (final String compareTo)
{
return new GroupMatcher <> (compareTo, StringOperatorName.EQUALS);
} | java | public static <T extends Key <T>> GroupMatcher <T> groupEquals (final String compareTo)
{
return new GroupMatcher <> (compareTo, StringOperatorName.EQUALS);
} | [
"public",
"static",
"<",
"T",
"extends",
"Key",
"<",
"T",
">",
">",
"GroupMatcher",
"<",
"T",
">",
"groupEquals",
"(",
"final",
"String",
"compareTo",
")",
"{",
"return",
"new",
"GroupMatcher",
"<>",
"(",
"compareTo",
",",
"StringOperatorName",
".",
"EQUAL... | Create a GroupMatcher that matches groups equaling the given string. | [
"Create",
"a",
"GroupMatcher",
"that",
"matches",
"groups",
"equaling",
"the",
"given",
"string",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/impl/matchers/GroupMatcher.java#L40-L43 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/impl/matchers/GroupMatcher.java | GroupMatcher.groupStartsWith | public static <T extends Key <T>> GroupMatcher <T> groupStartsWith (final String compareTo)
{
return new GroupMatcher <> (compareTo, StringOperatorName.STARTS_WITH);
} | java | public static <T extends Key <T>> GroupMatcher <T> groupStartsWith (final String compareTo)
{
return new GroupMatcher <> (compareTo, StringOperatorName.STARTS_WITH);
} | [
"public",
"static",
"<",
"T",
"extends",
"Key",
"<",
"T",
">",
">",
"GroupMatcher",
"<",
"T",
">",
"groupStartsWith",
"(",
"final",
"String",
"compareTo",
")",
"{",
"return",
"new",
"GroupMatcher",
"<>",
"(",
"compareTo",
",",
"StringOperatorName",
".",
"S... | Create a GroupMatcher that matches groups starting with the given string. | [
"Create",
"a",
"GroupMatcher",
"that",
"matches",
"groups",
"starting",
"with",
"the",
"given",
"string",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/impl/matchers/GroupMatcher.java#L65-L68 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/impl/matchers/GroupMatcher.java | GroupMatcher.groupEndsWith | public static <T extends Key <T>> GroupMatcher <T> groupEndsWith (final String compareTo)
{
return new GroupMatcher <> (compareTo, StringOperatorName.ENDS_WITH);
} | java | public static <T extends Key <T>> GroupMatcher <T> groupEndsWith (final String compareTo)
{
return new GroupMatcher <> (compareTo, StringOperatorName.ENDS_WITH);
} | [
"public",
"static",
"<",
"T",
"extends",
"Key",
"<",
"T",
">",
">",
"GroupMatcher",
"<",
"T",
">",
"groupEndsWith",
"(",
"final",
"String",
"compareTo",
")",
"{",
"return",
"new",
"GroupMatcher",
"<>",
"(",
"compareTo",
",",
"StringOperatorName",
".",
"END... | Create a GroupMatcher that matches groups ending with the given string. | [
"Create",
"a",
"GroupMatcher",
"that",
"matches",
"groups",
"ending",
"with",
"the",
"given",
"string",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/impl/matchers/GroupMatcher.java#L91-L94 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/impl/matchers/GroupMatcher.java | GroupMatcher.groupContains | public static <T extends Key <T>> GroupMatcher <T> groupContains (final String compareTo)
{
return new GroupMatcher <> (compareTo, StringOperatorName.CONTAINS);
} | java | public static <T extends Key <T>> GroupMatcher <T> groupContains (final String compareTo)
{
return new GroupMatcher <> (compareTo, StringOperatorName.CONTAINS);
} | [
"public",
"static",
"<",
"T",
"extends",
"Key",
"<",
"T",
">",
">",
"GroupMatcher",
"<",
"T",
">",
"groupContains",
"(",
"final",
"String",
"compareTo",
")",
"{",
"return",
"new",
"GroupMatcher",
"<>",
"(",
"compareTo",
",",
"StringOperatorName",
".",
"CON... | Create a GroupMatcher that matches groups containing the given string. | [
"Create",
"a",
"GroupMatcher",
"that",
"matches",
"groups",
"containing",
"the",
"given",
"string",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/impl/matchers/GroupMatcher.java#L116-L119 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/impl/matchers/KeyMatcher.java | KeyMatcher.keyEquals | public static <U extends Key <U>> KeyMatcher <U> keyEquals (final U compareTo)
{
return new KeyMatcher <> (compareTo);
} | java | public static <U extends Key <U>> KeyMatcher <U> keyEquals (final U compareTo)
{
return new KeyMatcher <> (compareTo);
} | [
"public",
"static",
"<",
"U",
"extends",
"Key",
"<",
"U",
">",
">",
"KeyMatcher",
"<",
"U",
">",
"keyEquals",
"(",
"final",
"U",
"compareTo",
")",
"{",
"return",
"new",
"KeyMatcher",
"<>",
"(",
"compareTo",
")",
";",
"}"
] | Create a KeyMatcher that matches Keys that equal the given key. | [
"Create",
"a",
"KeyMatcher",
"that",
"matches",
"Keys",
"that",
"equal",
"the",
"given",
"key",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/impl/matchers/KeyMatcher.java#L46-L49 | train |
codegist/crest | core/src/main/java/org/codegist/crest/util/ComponentFactory.java | ComponentFactory.instantiate | public static <T> T instantiate(Class<T> clazz, CRestConfig crestConfig) throws InvocationTargetException, IllegalAccessException, InstantiationException, NoSuchMethodException {
try {
return accessible(clazz.getDeclaredConstructor(CRestConfig.class)).newInstance(crestConfig);
} catch (NoSuchMethodException e) {
return accessible(clazz.getDeclaredConstructor()).newInstance();
}
} | java | public static <T> T instantiate(Class<T> clazz, CRestConfig crestConfig) throws InvocationTargetException, IllegalAccessException, InstantiationException, NoSuchMethodException {
try {
return accessible(clazz.getDeclaredConstructor(CRestConfig.class)).newInstance(crestConfig);
} catch (NoSuchMethodException e) {
return accessible(clazz.getDeclaredConstructor()).newInstance();
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"instantiate",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"CRestConfig",
"crestConfig",
")",
"throws",
"InvocationTargetException",
",",
"IllegalAccessException",
",",
"InstantiationException",
",",
"NoSuchMethodException",
"{... | Instanciate the given component class passing the CRestConfig to the constructor if available, otherwise uses the default empty constructor.
@param clazz the component class to instanciate
@param crestConfig the CRestConfig to pass if the component is CRestConfig aware
@param <T> Type of the component
@return the component instance
@throws InvocationTargetException
@throws IllegalAccessException
@throws InstantiationException
@throws NoSuchMethodException | [
"Instanciate",
"the",
"given",
"component",
"class",
"passing",
"the",
"CRestConfig",
"to",
"the",
"constructor",
"if",
"available",
"otherwise",
"uses",
"the",
"default",
"empty",
"constructor",
"."
] | e99ba7728b27d2ddb2c247261350f1b6fa7a6698 | https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/util/ComponentFactory.java#L54-L60 | train |
joachimvda/jtransfo | core/src/main/java/org/jtransfo/AbstractSetTypeConverter.java | AbstractSetTypeConverter.doReverseOne | public Object doReverseOne(
JTransfo jTransfo, Object domainObject, SyntheticField toField, Class<?> toType, String... tags)
throws JTransfoException {
return jTransfo.convertTo(domainObject, jTransfo.getToSubType(toType, domainObject), tags);
} | java | public Object doReverseOne(
JTransfo jTransfo, Object domainObject, SyntheticField toField, Class<?> toType, String... tags)
throws JTransfoException {
return jTransfo.convertTo(domainObject, jTransfo.getToSubType(toType, domainObject), tags);
} | [
"public",
"Object",
"doReverseOne",
"(",
"JTransfo",
"jTransfo",
",",
"Object",
"domainObject",
",",
"SyntheticField",
"toField",
",",
"Class",
"<",
"?",
">",
"toType",
",",
"String",
"...",
"tags",
")",
"throws",
"JTransfoException",
"{",
"return",
"jTransfo",
... | Do the actual reverse conversion of one object.
@param jTransfo jTransfo instance in use
@param domainObject domain object
@param toField field definition on the transfer object
@param toType configured to type for list
@param tags tags which indicate which fields can be converted based on {@link MapOnly} annotations.
@return domain object
@throws JTransfoException oops, cannot convert | [
"Do",
"the",
"actual",
"reverse",
"conversion",
"of",
"one",
"object",
"."
] | eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8 | https://github.com/joachimvda/jtransfo/blob/eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8/core/src/main/java/org/jtransfo/AbstractSetTypeConverter.java#L114-L118 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/listeners/JobChainingJobListener.java | JobChainingJobListener.addJobChainLink | public void addJobChainLink (final JobKey firstJob, final JobKey secondJob)
{
ValueEnforcer.notNull (firstJob, "FirstJob");
ValueEnforcer.notNull (firstJob.getName (), "FirstJob.Name");
ValueEnforcer.notNull (secondJob, "SecondJob");
ValueEnforcer.notNull (secondJob.getName (), "SecondJob.Name");
m_aChainLinks.put (firstJob, secondJob);
} | java | public void addJobChainLink (final JobKey firstJob, final JobKey secondJob)
{
ValueEnforcer.notNull (firstJob, "FirstJob");
ValueEnforcer.notNull (firstJob.getName (), "FirstJob.Name");
ValueEnforcer.notNull (secondJob, "SecondJob");
ValueEnforcer.notNull (secondJob.getName (), "SecondJob.Name");
m_aChainLinks.put (firstJob, secondJob);
} | [
"public",
"void",
"addJobChainLink",
"(",
"final",
"JobKey",
"firstJob",
",",
"final",
"JobKey",
"secondJob",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"firstJob",
",",
"\"FirstJob\"",
")",
";",
"ValueEnforcer",
".",
"notNull",
"(",
"firstJob",
".",
"get... | Add a chain mapping - when the Job identified by the first key completes
the job identified by the second key will be triggered.
@param firstJob
a JobKey with the name and group of the first job
@param secondJob
a JobKey with the name and group of the follow-up job | [
"Add",
"a",
"chain",
"mapping",
"-",
"when",
"the",
"Job",
"identified",
"by",
"the",
"first",
"key",
"completes",
"the",
"job",
"identified",
"by",
"the",
"second",
"key",
"will",
"be",
"triggered",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/listeners/JobChainingJobListener.java#L87-L95 | train |
dashorst/wicket-stuff-markup-validator | whattf/src/main/java/org/whattf/datatype/SvgPathData.java | SvgPathData.checkM | private void checkM() throws DatatypeException, IOException {
if (context.length() == 0) {
appendToContext(current);
}
current = reader.read();
appendToContext(current);
skipSpaces();
checkArg('M', "x coordinate");
skipCommaSpaces();
checkArg('M', "y coordinate");
boolean expectNumber = skipCommaSpaces2();
_checkL('M', expectNumber);
} | java | private void checkM() throws DatatypeException, IOException {
if (context.length() == 0) {
appendToContext(current);
}
current = reader.read();
appendToContext(current);
skipSpaces();
checkArg('M', "x coordinate");
skipCommaSpaces();
checkArg('M', "y coordinate");
boolean expectNumber = skipCommaSpaces2();
_checkL('M', expectNumber);
} | [
"private",
"void",
"checkM",
"(",
")",
"throws",
"DatatypeException",
",",
"IOException",
"{",
"if",
"(",
"context",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"appendToContext",
"(",
"current",
")",
";",
"}",
"current",
"=",
"reader",
".",
"read",
... | Checks an 'M' command. | [
"Checks",
"an",
"M",
"command",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/whattf/src/main/java/org/whattf/datatype/SvgPathData.java#L187-L201 | train |
dashorst/wicket-stuff-markup-validator | whattf/src/main/java/org/whattf/datatype/SvgPathData.java | SvgPathData.checkC | private void checkC() throws DatatypeException, IOException {
if (context.length() == 0) {
appendToContext(current);
}
current = reader.read();
appendToContext(current);
skipSpaces();
boolean expectNumber = true;
for (;;) {
switch (current) {
default:
if (expectNumber)
reportNonNumber('C', current);
return;
case '+':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
break;
}
checkArg('C', "x1 coordinate");
skipCommaSpaces();
checkArg('C', "y1 coordinate");
skipCommaSpaces();
checkArg('C', "x2 coordinate");
skipCommaSpaces();
checkArg('C', "y2 coordinate");
skipCommaSpaces();
checkArg('C', "x coordinate");
skipCommaSpaces();
checkArg('C', "y coordinate");
expectNumber = skipCommaSpaces2();
}
} | java | private void checkC() throws DatatypeException, IOException {
if (context.length() == 0) {
appendToContext(current);
}
current = reader.read();
appendToContext(current);
skipSpaces();
boolean expectNumber = true;
for (;;) {
switch (current) {
default:
if (expectNumber)
reportNonNumber('C', current);
return;
case '+':
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
break;
}
checkArg('C', "x1 coordinate");
skipCommaSpaces();
checkArg('C', "y1 coordinate");
skipCommaSpaces();
checkArg('C', "x2 coordinate");
skipCommaSpaces();
checkArg('C', "y2 coordinate");
skipCommaSpaces();
checkArg('C', "x coordinate");
skipCommaSpaces();
checkArg('C', "y coordinate");
expectNumber = skipCommaSpaces2();
}
} | [
"private",
"void",
"checkC",
"(",
")",
"throws",
"DatatypeException",
",",
"IOException",
"{",
"if",
"(",
"context",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"appendToContext",
"(",
"current",
")",
";",
"}",
"current",
"=",
"reader",
".",
"read",
... | Checks a 'C' command. | [
"Checks",
"a",
"C",
"command",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/whattf/src/main/java/org/whattf/datatype/SvgPathData.java#L511-L557 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/TimeOfDay.java | TimeOfDay.before | public boolean before (final TimeOfDay timeOfDay)
{
if (timeOfDay.m_nHour > m_nHour)
return true;
if (timeOfDay.m_nHour < m_nHour)
return false;
if (timeOfDay.m_nMinute > m_nMinute)
return true;
if (timeOfDay.m_nMinute < m_nMinute)
return false;
if (timeOfDay.m_nSecond > m_nSecond)
return true;
if (timeOfDay.m_nSecond < m_nSecond)
return false;
return false; // must be equal...
} | java | public boolean before (final TimeOfDay timeOfDay)
{
if (timeOfDay.m_nHour > m_nHour)
return true;
if (timeOfDay.m_nHour < m_nHour)
return false;
if (timeOfDay.m_nMinute > m_nMinute)
return true;
if (timeOfDay.m_nMinute < m_nMinute)
return false;
if (timeOfDay.m_nSecond > m_nSecond)
return true;
if (timeOfDay.m_nSecond < m_nSecond)
return false;
return false; // must be equal...
} | [
"public",
"boolean",
"before",
"(",
"final",
"TimeOfDay",
"timeOfDay",
")",
"{",
"if",
"(",
"timeOfDay",
".",
"m_nHour",
">",
"m_nHour",
")",
"return",
"true",
";",
"if",
"(",
"timeOfDay",
".",
"m_nHour",
"<",
"m_nHour",
")",
"return",
"false",
";",
"if"... | Determine with this time of day is before the given time of day.
@return true this time of day is before the given time of day. | [
"Determine",
"with",
"this",
"time",
"of",
"day",
"is",
"before",
"the",
"given",
"time",
"of",
"day",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/TimeOfDay.java#L116-L134 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/TimeOfDay.java | TimeOfDay.getTimeOfDayForDate | @Nullable
public Date getTimeOfDayForDate (final Date dateTime)
{
if (dateTime == null)
return null;
final Calendar cal = PDTFactory.createCalendar ();
cal.setTime (dateTime);
cal.set (Calendar.HOUR_OF_DAY, m_nHour);
cal.set (Calendar.MINUTE, m_nMinute);
cal.set (Calendar.SECOND, m_nSecond);
cal.clear (Calendar.MILLISECOND);
return cal.getTime ();
} | java | @Nullable
public Date getTimeOfDayForDate (final Date dateTime)
{
if (dateTime == null)
return null;
final Calendar cal = PDTFactory.createCalendar ();
cal.setTime (dateTime);
cal.set (Calendar.HOUR_OF_DAY, m_nHour);
cal.set (Calendar.MINUTE, m_nMinute);
cal.set (Calendar.SECOND, m_nSecond);
cal.clear (Calendar.MILLISECOND);
return cal.getTime ();
} | [
"@",
"Nullable",
"public",
"Date",
"getTimeOfDayForDate",
"(",
"final",
"Date",
"dateTime",
")",
"{",
"if",
"(",
"dateTime",
"==",
"null",
")",
"return",
"null",
";",
"final",
"Calendar",
"cal",
"=",
"PDTFactory",
".",
"createCalendar",
"(",
")",
";",
"cal... | Return a date with time of day reset to this object values. The millisecond
value will be zero. | [
"Return",
"a",
"date",
"with",
"time",
"of",
"day",
"reset",
"to",
"this",
"object",
"values",
".",
"The",
"millisecond",
"value",
"will",
"be",
"zero",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/TimeOfDay.java#L158-L170 | train |
dashorst/wicket-stuff-markup-validator | isorelax/src/main/java/org/iso_relax/jaxp/ValidatingDocumentBuilder.java | ValidatingDocumentBuilder.parse | public Document parse(InputSource inputsource) throws SAXException, IOException
{
return verify(_WrappedBuilder.parse(inputsource));
} | java | public Document parse(InputSource inputsource) throws SAXException, IOException
{
return verify(_WrappedBuilder.parse(inputsource));
} | [
"public",
"Document",
"parse",
"(",
"InputSource",
"inputsource",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"return",
"verify",
"(",
"_WrappedBuilder",
".",
"parse",
"(",
"inputsource",
")",
")",
";",
"}"
] | Parses the given InputSource and validates the resulting DOM. | [
"Parses",
"the",
"given",
"InputSource",
"and",
"validates",
"the",
"resulting",
"DOM",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/isorelax/src/main/java/org/iso_relax/jaxp/ValidatingDocumentBuilder.java#L41-L44 | train |
dashorst/wicket-stuff-markup-validator | isorelax/src/main/java/org/iso_relax/jaxp/ValidatingDocumentBuilder.java | ValidatingDocumentBuilder.parse | public Document parse(File file) throws SAXException, IOException
{
return verify(_WrappedBuilder.parse(file));
} | java | public Document parse(File file) throws SAXException, IOException
{
return verify(_WrappedBuilder.parse(file));
} | [
"public",
"Document",
"parse",
"(",
"File",
"file",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"return",
"verify",
"(",
"_WrappedBuilder",
".",
"parse",
"(",
"file",
")",
")",
";",
"}"
] | Parses the given File and validates the resulting DOM. | [
"Parses",
"the",
"given",
"File",
"and",
"validates",
"the",
"resulting",
"DOM",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/isorelax/src/main/java/org/iso_relax/jaxp/ValidatingDocumentBuilder.java#L49-L52 | train |
dashorst/wicket-stuff-markup-validator | isorelax/src/main/java/org/iso_relax/jaxp/ValidatingDocumentBuilder.java | ValidatingDocumentBuilder.parse | public Document parse(InputStream strm) throws SAXException, IOException
{
return verify(_WrappedBuilder.parse(strm));
} | java | public Document parse(InputStream strm) throws SAXException, IOException
{
return verify(_WrappedBuilder.parse(strm));
} | [
"public",
"Document",
"parse",
"(",
"InputStream",
"strm",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"return",
"verify",
"(",
"_WrappedBuilder",
".",
"parse",
"(",
"strm",
")",
")",
";",
"}"
] | Parses the given InputStream and validates the resulting DOM. | [
"Parses",
"the",
"given",
"InputStream",
"and",
"validates",
"the",
"resulting",
"DOM",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/isorelax/src/main/java/org/iso_relax/jaxp/ValidatingDocumentBuilder.java#L57-L60 | train |
dashorst/wicket-stuff-markup-validator | isorelax/src/main/java/org/iso_relax/jaxp/ValidatingDocumentBuilder.java | ValidatingDocumentBuilder.parse | public Document parse(String url) throws SAXException, IOException
{
return verify(_WrappedBuilder.parse(url));
} | java | public Document parse(String url) throws SAXException, IOException
{
return verify(_WrappedBuilder.parse(url));
} | [
"public",
"Document",
"parse",
"(",
"String",
"url",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"return",
"verify",
"(",
"_WrappedBuilder",
".",
"parse",
"(",
"url",
")",
")",
";",
"}"
] | Parses the given url and validates the resulting DOM. | [
"Parses",
"the",
"given",
"url",
"and",
"validates",
"the",
"resulting",
"DOM",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/isorelax/src/main/java/org/iso_relax/jaxp/ValidatingDocumentBuilder.java#L73-L76 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/datatype/xsd/DatatypeBuilderImpl.java | DatatypeBuilderImpl.convertNonNegativeInteger | private int convertNonNegativeInteger(String str) {
str = str.trim();
DecimalDatatype decimal = new DecimalDatatype();
if (!decimal.lexicallyAllows(str))
return -1;
// Canonicalize the value
str = decimal.getValue(str, null).toString();
// Reject negative and fractional numbers
if (str.charAt(0) == '-' || str.indexOf('.') >= 0)
return -1;
try {
return Integer.parseInt(str);
}
catch (NumberFormatException e) {
// Map out of range integers to MAX_VALUE
return Integer.MAX_VALUE;
}
} | java | private int convertNonNegativeInteger(String str) {
str = str.trim();
DecimalDatatype decimal = new DecimalDatatype();
if (!decimal.lexicallyAllows(str))
return -1;
// Canonicalize the value
str = decimal.getValue(str, null).toString();
// Reject negative and fractional numbers
if (str.charAt(0) == '-' || str.indexOf('.') >= 0)
return -1;
try {
return Integer.parseInt(str);
}
catch (NumberFormatException e) {
// Map out of range integers to MAX_VALUE
return Integer.MAX_VALUE;
}
} | [
"private",
"int",
"convertNonNegativeInteger",
"(",
"String",
"str",
")",
"{",
"str",
"=",
"str",
".",
"trim",
"(",
")",
";",
"DecimalDatatype",
"decimal",
"=",
"new",
"DecimalDatatype",
"(",
")",
";",
"if",
"(",
"!",
"decimal",
".",
"lexicallyAllows",
"("... | Return Integer.MAX_VALUE for values that are too big | [
"Return",
"Integer",
".",
"MAX_VALUE",
"for",
"values",
"that",
"are",
"too",
"big"
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/datatype/xsd/DatatypeBuilderImpl.java#L166-L183 | train |
dashorst/wicket-stuff-markup-validator | whattf/src/main/java/org/whattf/checker/MicrodataChecker.java | MicrodataChecker.checkItem | private void checkItem(Element root, Deque<Element> parents) throws SAXException {
Deque<Element> pending = new ArrayDeque<Element>();
Set<Element> memory = new HashSet<Element>();
memory.add(root);
for (Element child : root.children) {
pending.push(child);
}
if (root.itemRef != null) {
for (String id : root.itemRef) {
Element refElm = idmap.get(id);
if (refElm != null) {
pending.push(refElm);
} else {
err("The \u201Citemref\u201D attribute referenced \u201C" + id + "\u201D, but there is no element with an \u201Cid\u201D attribute with that value.", root.locator);
}
}
}
boolean memoryError = false;
while (pending.size() > 0) {
Element current = pending.pop();
if (memory.contains(current)) {
memoryError = true;
continue;
}
memory.add(current);
if (!current.itemScope) {
for (Element child : current.children) {
pending.push(child);
}
}
if (current.itemProp != null) {
properties.remove(current);
if (current.itemScope) {
if (!parents.contains(current)) {
parents.push(root);
checkItem(current, parents);
parents.pop();
} else {
err("The \u201Citemref\u201D attribute created a circular reference with another item.", current.locator);
}
}
}
}
if (memoryError) {
err("The \u201Citemref\u201D attribute contained redundant references.", root.locator);
}
} | java | private void checkItem(Element root, Deque<Element> parents) throws SAXException {
Deque<Element> pending = new ArrayDeque<Element>();
Set<Element> memory = new HashSet<Element>();
memory.add(root);
for (Element child : root.children) {
pending.push(child);
}
if (root.itemRef != null) {
for (String id : root.itemRef) {
Element refElm = idmap.get(id);
if (refElm != null) {
pending.push(refElm);
} else {
err("The \u201Citemref\u201D attribute referenced \u201C" + id + "\u201D, but there is no element with an \u201Cid\u201D attribute with that value.", root.locator);
}
}
}
boolean memoryError = false;
while (pending.size() > 0) {
Element current = pending.pop();
if (memory.contains(current)) {
memoryError = true;
continue;
}
memory.add(current);
if (!current.itemScope) {
for (Element child : current.children) {
pending.push(child);
}
}
if (current.itemProp != null) {
properties.remove(current);
if (current.itemScope) {
if (!parents.contains(current)) {
parents.push(root);
checkItem(current, parents);
parents.pop();
} else {
err("The \u201Citemref\u201D attribute created a circular reference with another item.", current.locator);
}
}
}
}
if (memoryError) {
err("The \u201Citemref\u201D attribute contained redundant references.", root.locator);
}
} | [
"private",
"void",
"checkItem",
"(",
"Element",
"root",
",",
"Deque",
"<",
"Element",
">",
"parents",
")",
"throws",
"SAXException",
"{",
"Deque",
"<",
"Element",
">",
"pending",
"=",
"new",
"ArrayDeque",
"<",
"Element",
">",
"(",
")",
";",
"Set",
"<",
... | Check itemref constraints.
This mirrors the "the properties of an item" algorithm,
modified to recursively check sub-items.
http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html#the-properties-of-an-item | [
"Check",
"itemref",
"constraints",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/whattf/src/main/java/org/whattf/checker/MicrodataChecker.java#L236-L282 | train |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Contracts.java | Contracts.condition | public static <T> ContractCondition<T> condition(
final Predicate<T> condition,
final Function<T, String> describer)
{
return ContractCondition.of(condition, describer);
} | java | public static <T> ContractCondition<T> condition(
final Predicate<T> condition,
final Function<T, String> describer)
{
return ContractCondition.of(condition, describer);
} | [
"public",
"static",
"<",
"T",
">",
"ContractCondition",
"<",
"T",
">",
"condition",
"(",
"final",
"Predicate",
"<",
"T",
">",
"condition",
",",
"final",
"Function",
"<",
"T",
",",
"String",
">",
"describer",
")",
"{",
"return",
"ContractCondition",
".",
... | Construct a predicate from the given predicate function and describer.
@param condition The predicate function
@param describer The describer
@param <T> The type of values
@return A predicate | [
"Construct",
"a",
"predicate",
"from",
"the",
"given",
"predicate",
"function",
"and",
"describer",
"."
] | c97d246242d381e48832838737418cfe4cb57b4d | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Contracts.java#L51-L56 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/ITrigger.java | TriggerTimeComparator.compare | static int compare (final Date nextFireTime1,
final int priority1,
final TriggerKey key1,
final Date nextFireTime2,
final int priority2,
final TriggerKey key2)
{
if (nextFireTime1 != null || nextFireTime2 != null)
{
if (nextFireTime1 == null)
return 1;
if (nextFireTime2 == null)
return -1;
if (nextFireTime1.before (nextFireTime2))
return -1;
if (nextFireTime1.after (nextFireTime2))
return 1;
}
int comp = priority2 - priority1;
if (comp == 0)
comp = key1.compareTo (key2);
return comp;
} | java | static int compare (final Date nextFireTime1,
final int priority1,
final TriggerKey key1,
final Date nextFireTime2,
final int priority2,
final TriggerKey key2)
{
if (nextFireTime1 != null || nextFireTime2 != null)
{
if (nextFireTime1 == null)
return 1;
if (nextFireTime2 == null)
return -1;
if (nextFireTime1.before (nextFireTime2))
return -1;
if (nextFireTime1.after (nextFireTime2))
return 1;
}
int comp = priority2 - priority1;
if (comp == 0)
comp = key1.compareTo (key2);
return comp;
} | [
"static",
"int",
"compare",
"(",
"final",
"Date",
"nextFireTime1",
",",
"final",
"int",
"priority1",
",",
"final",
"TriggerKey",
"key1",
",",
"final",
"Date",
"nextFireTime2",
",",
"final",
"int",
"priority2",
",",
"final",
"TriggerKey",
"key2",
")",
"{",
"i... | This static method exists for comparator in TC clustered quartz | [
"This",
"static",
"method",
"exists",
"for",
"comparator",
"in",
"TC",
"clustered",
"quartz"
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/ITrigger.java#L316-L339 | train |
RestComm/mss-arquillian | mss-tomcat-embedded-7/src/main/java/org/jboss/arquillian/container/mobicents/servlet/sip/tomcat/embedded_7/MobicentsSipServletsEmbeddedImpl.java | MobicentsSipServletsEmbeddedImpl.getSipConnectors | @Override
public List<Connector> getSipConnectors() {
List<Connector> connectors = new ArrayList<Connector>();
Connector[] conns = service.findConnectors();
for (Connector conn : conns) {
if (conn.getProtocolHandler() instanceof SipProtocolHandler){
connectors.add(conn);
}
}
return connectors;
} | java | @Override
public List<Connector> getSipConnectors() {
List<Connector> connectors = new ArrayList<Connector>();
Connector[] conns = service.findConnectors();
for (Connector conn : conns) {
if (conn.getProtocolHandler() instanceof SipProtocolHandler){
connectors.add(conn);
}
}
return connectors;
} | [
"@",
"Override",
"public",
"List",
"<",
"Connector",
">",
"getSipConnectors",
"(",
")",
"{",
"List",
"<",
"Connector",
">",
"connectors",
"=",
"new",
"ArrayList",
"<",
"Connector",
">",
"(",
")",
";",
"Connector",
"[",
"]",
"conns",
"=",
"service",
".",
... | Return the SipConnectors | [
"Return",
"the",
"SipConnectors"
] | d217b4e53701282c6e7176365a03be6f898342be | https://github.com/RestComm/mss-arquillian/blob/d217b4e53701282c6e7176365a03be6f898342be/mss-tomcat-embedded-7/src/main/java/org/jboss/arquillian/container/mobicents/servlet/sip/tomcat/embedded_7/MobicentsSipServletsEmbeddedImpl.java#L666-L679 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/RejectAction.java | RejectAction.perform | void perform(SectionState state) throws SAXException {
final ModeUsage modeUsage = getModeUsage();
state.reject();
state.addChildMode(modeUsage, null);
state.addAttributeValidationModeUsage(modeUsage);
} | java | void perform(SectionState state) throws SAXException {
final ModeUsage modeUsage = getModeUsage();
state.reject();
state.addChildMode(modeUsage, null);
state.addAttributeValidationModeUsage(modeUsage);
} | [
"void",
"perform",
"(",
"SectionState",
"state",
")",
"throws",
"SAXException",
"{",
"final",
"ModeUsage",
"modeUsage",
"=",
"getModeUsage",
"(",
")",
";",
"state",
".",
"reject",
"(",
")",
";",
"state",
".",
"addChildMode",
"(",
"modeUsage",
",",
"null",
... | Perform this action on the session state.
@param state The section state. | [
"Perform",
"this",
"action",
"on",
"the",
"session",
"state",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/RejectAction.java#L21-L26 | train |
vnesek/nmote-xr | src/main/java/com/nmote/xr/MethodCall.java | MethodCall.getAttribute | public Object getAttribute(String key) {
Object result;
if (attributes == null) {
result = null;
} else {
result = attributes.get(key);
}
return result;
} | java | public Object getAttribute(String key) {
Object result;
if (attributes == null) {
result = null;
} else {
result = attributes.get(key);
}
return result;
} | [
"public",
"Object",
"getAttribute",
"(",
"String",
"key",
")",
"{",
"Object",
"result",
";",
"if",
"(",
"attributes",
"==",
"null",
")",
"{",
"result",
"=",
"null",
";",
"}",
"else",
"{",
"result",
"=",
"attributes",
".",
"get",
"(",
"key",
")",
";",... | Gets an attribute attached to a call. Attributes are arbitrary contextual
objects attached to a call.
@param key
attribute key/name
@return attached attribute or null if there is none | [
"Gets",
"an",
"attribute",
"attached",
"to",
"a",
"call",
".",
"Attributes",
"are",
"arbitrary",
"contextual",
"objects",
"attached",
"to",
"a",
"call",
"."
] | 6c584142a38a9dbc6401c75614d8d207f64f658d | https://github.com/vnesek/nmote-xr/blob/6c584142a38a9dbc6401c75614d8d207f64f658d/src/main/java/com/nmote/xr/MethodCall.java#L62-L70 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java | FilteredAttributes.reverseIndex | private int reverseIndex(int k) {
if (reverseIndexMap == null) {
reverseIndexMap = new int[attributes.getLength()];
for (int i = 0, len = indexSet.size(); i < len; i++)
reverseIndexMap[indexSet.get(i)] = i + 1;
}
return reverseIndexMap[k] - 1;
} | java | private int reverseIndex(int k) {
if (reverseIndexMap == null) {
reverseIndexMap = new int[attributes.getLength()];
for (int i = 0, len = indexSet.size(); i < len; i++)
reverseIndexMap[indexSet.get(i)] = i + 1;
}
return reverseIndexMap[k] - 1;
} | [
"private",
"int",
"reverseIndex",
"(",
"int",
"k",
")",
"{",
"if",
"(",
"reverseIndexMap",
"==",
"null",
")",
"{",
"reverseIndexMap",
"=",
"new",
"int",
"[",
"attributes",
".",
"getLength",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
... | Gets the index in the filtered set for a given real index.
If the reverseIndexMap is not computed it computes it,
otherwise it just uses the previously computed map.
@param k The index in the real attributes.
@return The index in the filtered attributes. | [
"Gets",
"the",
"index",
"in",
"the",
"filtered",
"set",
"for",
"a",
"given",
"real",
"index",
".",
"If",
"the",
"reverseIndexMap",
"is",
"not",
"computed",
"it",
"computes",
"it",
"otherwise",
"it",
"just",
"uses",
"the",
"previously",
"computed",
"map",
"... | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java#L51-L58 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java | FilteredAttributes.getURI | public String getURI(int index) {
if (index < 0 || index >= indexSet.size())
return null;
return attributes.getURI(indexSet.get(index));
} | java | public String getURI(int index) {
if (index < 0 || index >= indexSet.size())
return null;
return attributes.getURI(indexSet.get(index));
} | [
"public",
"String",
"getURI",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"indexSet",
".",
"size",
"(",
")",
")",
"return",
"null",
";",
"return",
"attributes",
".",
"getURI",
"(",
"indexSet",
".",
"get",
"(",
... | Get the URI for the index-th attribute. | [
"Get",
"the",
"URI",
"for",
"the",
"index",
"-",
"th",
"attribute",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java#L70-L74 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java | FilteredAttributes.getLocalName | public String getLocalName(int index) {
if (index < 0 || index >= indexSet.size())
return null;
return attributes.getLocalName(indexSet.get(index));
} | java | public String getLocalName(int index) {
if (index < 0 || index >= indexSet.size())
return null;
return attributes.getLocalName(indexSet.get(index));
} | [
"public",
"String",
"getLocalName",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"indexSet",
".",
"size",
"(",
")",
")",
"return",
"null",
";",
"return",
"attributes",
".",
"getLocalName",
"(",
"indexSet",
".",
"get... | Get the local name for the index-th attribute. | [
"Get",
"the",
"local",
"name",
"for",
"the",
"index",
"-",
"th",
"attribute",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java#L79-L83 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java | FilteredAttributes.getQName | public String getQName(int index) {
if (index < 0 || index >= indexSet.size())
return null;
return attributes.getQName(indexSet.get(index));
} | java | public String getQName(int index) {
if (index < 0 || index >= indexSet.size())
return null;
return attributes.getQName(indexSet.get(index));
} | [
"public",
"String",
"getQName",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"indexSet",
".",
"size",
"(",
")",
")",
"return",
"null",
";",
"return",
"attributes",
".",
"getQName",
"(",
"indexSet",
".",
"get",
"("... | Get the QName for the index-th attribute. | [
"Get",
"the",
"QName",
"for",
"the",
"index",
"-",
"th",
"attribute",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java#L88-L92 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java | FilteredAttributes.getType | public String getType(int index) {
if (index < 0 || index >= indexSet.size())
return null;
return attributes.getType(indexSet.get(index));
} | java | public String getType(int index) {
if (index < 0 || index >= indexSet.size())
return null;
return attributes.getType(indexSet.get(index));
} | [
"public",
"String",
"getType",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"indexSet",
".",
"size",
"(",
")",
")",
"return",
"null",
";",
"return",
"attributes",
".",
"getType",
"(",
"indexSet",
".",
"get",
"(",
... | Get the type for the index-th attribute. | [
"Get",
"the",
"type",
"for",
"the",
"index",
"-",
"th",
"attribute",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java#L97-L101 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java | FilteredAttributes.getValue | public String getValue(int index) {
if (index < 0 || index >= indexSet.size())
return null;
return attributes.getValue(indexSet.get(index));
} | java | public String getValue(int index) {
if (index < 0 || index >= indexSet.size())
return null;
return attributes.getValue(indexSet.get(index));
} | [
"public",
"String",
"getValue",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"indexSet",
".",
"size",
"(",
")",
")",
"return",
"null",
";",
"return",
"attributes",
".",
"getValue",
"(",
"indexSet",
".",
"get",
"("... | Get the value for the index-th attribute. | [
"Get",
"the",
"value",
"for",
"the",
"index",
"-",
"th",
"attribute",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java#L106-L110 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java | FilteredAttributes.getType | public String getType(String uri, String localName) {
return attributes.getType(getRealIndex(uri, localName));
} | java | public String getType(String uri, String localName) {
return attributes.getType(getRealIndex(uri, localName));
} | [
"public",
"String",
"getType",
"(",
"String",
"uri",
",",
"String",
"localName",
")",
"{",
"return",
"attributes",
".",
"getType",
"(",
"getRealIndex",
"(",
"uri",
",",
"localName",
")",
")",
";",
"}"
] | Get the type of the attribute.
@param uri The attribute uri.
@param localName The attribute local name. | [
"Get",
"the",
"type",
"of",
"the",
"attribute",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java#L158-L160 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java | FilteredAttributes.getValue | public String getValue(String uri, String localName) {
return attributes.getValue(getRealIndex(uri, localName));
} | java | public String getValue(String uri, String localName) {
return attributes.getValue(getRealIndex(uri, localName));
} | [
"public",
"String",
"getValue",
"(",
"String",
"uri",
",",
"String",
"localName",
")",
"{",
"return",
"attributes",
".",
"getValue",
"(",
"getRealIndex",
"(",
"uri",
",",
"localName",
")",
")",
";",
"}"
] | Get the value of the attribute.
@param uri The attribute uri.
@param localName The attribute local name. | [
"Get",
"the",
"value",
"of",
"the",
"attribute",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java#L167-L169 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/AllowAction.java | AllowAction.perform | void perform(SectionState state) {
state.addChildMode(getModeUsage(), null);
state.addAttributeValidationModeUsage(getModeUsage());
} | java | void perform(SectionState state) {
state.addChildMode(getModeUsage(), null);
state.addAttributeValidationModeUsage(getModeUsage());
} | [
"void",
"perform",
"(",
"SectionState",
"state",
")",
"{",
"state",
".",
"addChildMode",
"(",
"getModeUsage",
"(",
")",
",",
"null",
")",
";",
"state",
".",
"addAttributeValidationModeUsage",
"(",
"getModeUsage",
"(",
")",
")",
";",
"}"
] | Perform this action on the section state.
@param state The section state. | [
"Perform",
"this",
"action",
"on",
"the",
"section",
"state",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/AllowAction.java#L19-L22 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java | CalendarIntervalScheduleBuilder.withIntervalInSeconds | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInSeconds (final int intervalInSeconds)
{
_validateInterval (intervalInSeconds);
m_nInterval = intervalInSeconds;
m_eIntervalUnit = EIntervalUnit.SECOND;
return this;
} | java | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInSeconds (final int intervalInSeconds)
{
_validateInterval (intervalInSeconds);
m_nInterval = intervalInSeconds;
m_eIntervalUnit = EIntervalUnit.SECOND;
return this;
} | [
"@",
"Nonnull",
"public",
"CalendarIntervalScheduleBuilder",
"withIntervalInSeconds",
"(",
"final",
"int",
"intervalInSeconds",
")",
"{",
"_validateInterval",
"(",
"intervalInSeconds",
")",
";",
"m_nInterval",
"=",
"intervalInSeconds",
";",
"m_eIntervalUnit",
"=",
"EInter... | Specify an interval in the IntervalUnit.SECOND that the produced Trigger
will repeat at.
@param intervalInSeconds
the number of seconds at which the trigger should repeat.
@return the updated CalendarIntervalScheduleBuilder
@see ICalendarIntervalTrigger#getRepeatInterval()
@see ICalendarIntervalTrigger#getRepeatIntervalUnit() | [
"Specify",
"an",
"interval",
"in",
"the",
"IntervalUnit",
".",
"SECOND",
"that",
"the",
"produced",
"Trigger",
"will",
"repeat",
"at",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java#L134-L141 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java | CalendarIntervalScheduleBuilder.withIntervalInMinutes | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInMinutes (final int intervalInMinutes)
{
_validateInterval (intervalInMinutes);
m_nInterval = intervalInMinutes;
m_eIntervalUnit = EIntervalUnit.MINUTE;
return this;
} | java | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInMinutes (final int intervalInMinutes)
{
_validateInterval (intervalInMinutes);
m_nInterval = intervalInMinutes;
m_eIntervalUnit = EIntervalUnit.MINUTE;
return this;
} | [
"@",
"Nonnull",
"public",
"CalendarIntervalScheduleBuilder",
"withIntervalInMinutes",
"(",
"final",
"int",
"intervalInMinutes",
")",
"{",
"_validateInterval",
"(",
"intervalInMinutes",
")",
";",
"m_nInterval",
"=",
"intervalInMinutes",
";",
"m_eIntervalUnit",
"=",
"EInter... | Specify an interval in the IntervalUnit.MINUTE that the produced Trigger
will repeat at.
@param intervalInMinutes
the number of minutes at which the trigger should repeat.
@return the updated CalendarIntervalScheduleBuilder
@see ICalendarIntervalTrigger#getRepeatInterval()
@see ICalendarIntervalTrigger#getRepeatIntervalUnit() | [
"Specify",
"an",
"interval",
"in",
"the",
"IntervalUnit",
".",
"MINUTE",
"that",
"the",
"produced",
"Trigger",
"will",
"repeat",
"at",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java#L153-L160 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java | CalendarIntervalScheduleBuilder.withIntervalInHours | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInHours (final int intervalInHours)
{
_validateInterval (intervalInHours);
m_nInterval = intervalInHours;
m_eIntervalUnit = EIntervalUnit.HOUR;
return this;
} | java | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInHours (final int intervalInHours)
{
_validateInterval (intervalInHours);
m_nInterval = intervalInHours;
m_eIntervalUnit = EIntervalUnit.HOUR;
return this;
} | [
"@",
"Nonnull",
"public",
"CalendarIntervalScheduleBuilder",
"withIntervalInHours",
"(",
"final",
"int",
"intervalInHours",
")",
"{",
"_validateInterval",
"(",
"intervalInHours",
")",
";",
"m_nInterval",
"=",
"intervalInHours",
";",
"m_eIntervalUnit",
"=",
"EIntervalUnit"... | Specify an interval in the IntervalUnit.HOUR that the produced Trigger will
repeat at.
@param intervalInHours
the number of hours at which the trigger should repeat.
@return the updated CalendarIntervalScheduleBuilder
@see ICalendarIntervalTrigger#getRepeatInterval()
@see ICalendarIntervalTrigger#getRepeatIntervalUnit() | [
"Specify",
"an",
"interval",
"in",
"the",
"IntervalUnit",
".",
"HOUR",
"that",
"the",
"produced",
"Trigger",
"will",
"repeat",
"at",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java#L172-L179 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java | CalendarIntervalScheduleBuilder.withIntervalInDays | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInDays (final int intervalInDays)
{
_validateInterval (intervalInDays);
m_nInterval = intervalInDays;
m_eIntervalUnit = EIntervalUnit.DAY;
return this;
} | java | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInDays (final int intervalInDays)
{
_validateInterval (intervalInDays);
m_nInterval = intervalInDays;
m_eIntervalUnit = EIntervalUnit.DAY;
return this;
} | [
"@",
"Nonnull",
"public",
"CalendarIntervalScheduleBuilder",
"withIntervalInDays",
"(",
"final",
"int",
"intervalInDays",
")",
"{",
"_validateInterval",
"(",
"intervalInDays",
")",
";",
"m_nInterval",
"=",
"intervalInDays",
";",
"m_eIntervalUnit",
"=",
"EIntervalUnit",
... | Specify an interval in the IntervalUnit.DAY that the produced Trigger will
repeat at.
@param intervalInDays
the number of days at which the trigger should repeat.
@return the updated CalendarIntervalScheduleBuilder
@see ICalendarIntervalTrigger#getRepeatInterval()
@see ICalendarIntervalTrigger#getRepeatIntervalUnit() | [
"Specify",
"an",
"interval",
"in",
"the",
"IntervalUnit",
".",
"DAY",
"that",
"the",
"produced",
"Trigger",
"will",
"repeat",
"at",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java#L191-L198 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java | CalendarIntervalScheduleBuilder.withIntervalInWeeks | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInWeeks (final int intervalInWeeks)
{
_validateInterval (intervalInWeeks);
m_nInterval = intervalInWeeks;
m_eIntervalUnit = EIntervalUnit.WEEK;
return this;
} | java | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInWeeks (final int intervalInWeeks)
{
_validateInterval (intervalInWeeks);
m_nInterval = intervalInWeeks;
m_eIntervalUnit = EIntervalUnit.WEEK;
return this;
} | [
"@",
"Nonnull",
"public",
"CalendarIntervalScheduleBuilder",
"withIntervalInWeeks",
"(",
"final",
"int",
"intervalInWeeks",
")",
"{",
"_validateInterval",
"(",
"intervalInWeeks",
")",
";",
"m_nInterval",
"=",
"intervalInWeeks",
";",
"m_eIntervalUnit",
"=",
"EIntervalUnit"... | Specify an interval in the IntervalUnit.WEEK that the produced Trigger will
repeat at.
@param intervalInWeeks
the number of weeks at which the trigger should repeat.
@return the updated CalendarIntervalScheduleBuilder
@see ICalendarIntervalTrigger#getRepeatInterval()
@see ICalendarIntervalTrigger#getRepeatIntervalUnit() | [
"Specify",
"an",
"interval",
"in",
"the",
"IntervalUnit",
".",
"WEEK",
"that",
"the",
"produced",
"Trigger",
"will",
"repeat",
"at",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java#L210-L217 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java | CalendarIntervalScheduleBuilder.withIntervalInMonths | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInMonths (final int intervalInMonths)
{
_validateInterval (intervalInMonths);
m_nInterval = intervalInMonths;
m_eIntervalUnit = EIntervalUnit.MONTH;
return this;
} | java | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInMonths (final int intervalInMonths)
{
_validateInterval (intervalInMonths);
m_nInterval = intervalInMonths;
m_eIntervalUnit = EIntervalUnit.MONTH;
return this;
} | [
"@",
"Nonnull",
"public",
"CalendarIntervalScheduleBuilder",
"withIntervalInMonths",
"(",
"final",
"int",
"intervalInMonths",
")",
"{",
"_validateInterval",
"(",
"intervalInMonths",
")",
";",
"m_nInterval",
"=",
"intervalInMonths",
";",
"m_eIntervalUnit",
"=",
"EIntervalU... | Specify an interval in the IntervalUnit.MONTH that the produced Trigger
will repeat at.
@param intervalInMonths
the number of months at which the trigger should repeat.
@return the updated CalendarIntervalScheduleBuilder
@see ICalendarIntervalTrigger#getRepeatInterval()
@see ICalendarIntervalTrigger#getRepeatIntervalUnit() | [
"Specify",
"an",
"interval",
"in",
"the",
"IntervalUnit",
".",
"MONTH",
"that",
"the",
"produced",
"Trigger",
"will",
"repeat",
"at",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java#L229-L236 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java | CalendarIntervalScheduleBuilder.withIntervalInYears | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInYears (final int intervalInYears)
{
_validateInterval (intervalInYears);
m_nInterval = intervalInYears;
m_eIntervalUnit = EIntervalUnit.YEAR;
return this;
} | java | @Nonnull
public CalendarIntervalScheduleBuilder withIntervalInYears (final int intervalInYears)
{
_validateInterval (intervalInYears);
m_nInterval = intervalInYears;
m_eIntervalUnit = EIntervalUnit.YEAR;
return this;
} | [
"@",
"Nonnull",
"public",
"CalendarIntervalScheduleBuilder",
"withIntervalInYears",
"(",
"final",
"int",
"intervalInYears",
")",
"{",
"_validateInterval",
"(",
"intervalInYears",
")",
";",
"m_nInterval",
"=",
"intervalInYears",
";",
"m_eIntervalUnit",
"=",
"EIntervalUnit"... | Specify an interval in the IntervalUnit.YEAR that the produced Trigger will
repeat at.
@param intervalInYears
the number of years at which the trigger should repeat.
@return the updated CalendarIntervalScheduleBuilder
@see ICalendarIntervalTrigger#getRepeatInterval()
@see ICalendarIntervalTrigger#getRepeatIntervalUnit() | [
"Specify",
"an",
"interval",
"in",
"the",
"IntervalUnit",
".",
"YEAR",
"that",
"the",
"produced",
"Trigger",
"will",
"repeat",
"at",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/CalendarIntervalScheduleBuilder.java#L248-L255 | train |
jcuda/jcusolver | JCusolverJava/src/main/java/jcuda/jcusolver/JCusolver.java | JCusolver.checkResult | static int checkResult(int result)
{
if (exceptionsEnabled && result !=
cusolverStatus.CUSOLVER_STATUS_SUCCESS)
{
throw new CudaException(cusolverStatus.stringFor(result));
}
return result;
} | java | static int checkResult(int result)
{
if (exceptionsEnabled && result !=
cusolverStatus.CUSOLVER_STATUS_SUCCESS)
{
throw new CudaException(cusolverStatus.stringFor(result));
}
return result;
} | [
"static",
"int",
"checkResult",
"(",
"int",
"result",
")",
"{",
"if",
"(",
"exceptionsEnabled",
"&&",
"result",
"!=",
"cusolverStatus",
".",
"CUSOLVER_STATUS_SUCCESS",
")",
"{",
"throw",
"new",
"CudaException",
"(",
"cusolverStatus",
".",
"stringFor",
"(",
"resu... | If the given result is not cusolverStatus.CUSOLVER_STATUS_SUCCESS
and exceptions have been enabled, this method will throw a
CudaException with an error message that corresponds to the
given result code. Otherwise, the given result is simply
returned.
@param result The result to check
@return The result that was given as the parameter
@throws CudaException If exceptions have been enabled and
the given result code is not cusolverStatus.CUSOLVER_STATUS_SUCCESS | [
"If",
"the",
"given",
"result",
"is",
"not",
"cusolverStatus",
".",
"CUSOLVER_STATUS_SUCCESS",
"and",
"exceptions",
"have",
"been",
"enabled",
"this",
"method",
"will",
"throw",
"a",
"CudaException",
"with",
"an",
"error",
"message",
"that",
"corresponds",
"to",
... | 2600c7eca36a92a60ebcc78cae6e028e0c1d00b9 | https://github.com/jcuda/jcusolver/blob/2600c7eca36a92a60ebcc78cae6e028e0c1d00b9/JCusolverJava/src/main/java/jcuda/jcusolver/JCusolver.java#L131-L139 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/utils/PropertiesParser.java | PropertiesParser.getPropertyGroup | public NonBlockingProperties getPropertyGroup (final String sPrefix,
final boolean bStripPrefix,
final String [] excludedPrefixes)
{
final NonBlockingProperties group = new NonBlockingProperties ();
String prefix = sPrefix;
if (!prefix.endsWith ("."))
prefix += ".";
for (final String key : m_aProps.keySet ())
{
if (key.startsWith (prefix))
{
boolean bExclude = false;
if (excludedPrefixes != null)
{
for (int i = 0; i < excludedPrefixes.length && !bExclude; i++)
{
bExclude = key.startsWith (excludedPrefixes[i]);
}
}
if (!bExclude)
{
final String value = getStringProperty (key, "");
if (bStripPrefix)
group.put (key.substring (prefix.length ()), value);
else
group.put (key, value);
}
}
}
return group;
} | java | public NonBlockingProperties getPropertyGroup (final String sPrefix,
final boolean bStripPrefix,
final String [] excludedPrefixes)
{
final NonBlockingProperties group = new NonBlockingProperties ();
String prefix = sPrefix;
if (!prefix.endsWith ("."))
prefix += ".";
for (final String key : m_aProps.keySet ())
{
if (key.startsWith (prefix))
{
boolean bExclude = false;
if (excludedPrefixes != null)
{
for (int i = 0; i < excludedPrefixes.length && !bExclude; i++)
{
bExclude = key.startsWith (excludedPrefixes[i]);
}
}
if (!bExclude)
{
final String value = getStringProperty (key, "");
if (bStripPrefix)
group.put (key.substring (prefix.length ()), value);
else
group.put (key, value);
}
}
}
return group;
} | [
"public",
"NonBlockingProperties",
"getPropertyGroup",
"(",
"final",
"String",
"sPrefix",
",",
"final",
"boolean",
"bStripPrefix",
",",
"final",
"String",
"[",
"]",
"excludedPrefixes",
")",
"{",
"final",
"NonBlockingProperties",
"group",
"=",
"new",
"NonBlockingProper... | Get all properties that start with the given prefix.
@param sPrefix
The prefix for which to search. If it does not end in a "." then one
will be added to it for search purposes.
@param bStripPrefix
Whether to strip off the given <code>prefix</code> in the result's
keys.
@param excludedPrefixes
Optional array of fully qualified prefixes to exclude. For example
if <code>prefix</code> is "a.b.c", then
<code>excludedPrefixes</code> might be "a.b.c.ignore".
@return Group of <code>NonBlockingProperties</code> that start with the
given prefix, optionally have that prefix removed, and do not
include properties that start with one of the given excluded
prefixes. | [
"Get",
"all",
"properties",
"that",
"start",
"with",
"the",
"given",
"prefix",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/utils/PropertiesParser.java#L406-L441 | train |
BreizhBeans/ThriftMongoBridge | src/main/java/org/breizhbeans/thrift/tools/thriftmongobridge/TBSONDeserializer.java | TBSONDeserializer.partialDeserialize | public void partialDeserialize(TBase<?,?> base, DBObject dbObject, TFieldIdEnum... fieldIds) throws TException {
try {
protocol_.setDBOject(dbObject);
protocol_.setBaseObject( base );
protocol_.setFieldIdsFilter(base, fieldIds);
base.read(protocol_);
} finally {
protocol_.reset();
}
} | java | public void partialDeserialize(TBase<?,?> base, DBObject dbObject, TFieldIdEnum... fieldIds) throws TException {
try {
protocol_.setDBOject(dbObject);
protocol_.setBaseObject( base );
protocol_.setFieldIdsFilter(base, fieldIds);
base.read(protocol_);
} finally {
protocol_.reset();
}
} | [
"public",
"void",
"partialDeserialize",
"(",
"TBase",
"<",
"?",
",",
"?",
">",
"base",
",",
"DBObject",
"dbObject",
",",
"TFieldIdEnum",
"...",
"fieldIds",
")",
"throws",
"TException",
"{",
"try",
"{",
"protocol_",
".",
"setDBOject",
"(",
"dbObject",
")",
... | Deserialize only a single Thrift object
from a byte record.
@param base The object to read into
@param dbObject The serialized object to read from
@param fieldIds The FieldId's to extract
@throws TException | [
"Deserialize",
"only",
"a",
"single",
"Thrift",
"object",
"from",
"a",
"byte",
"record",
"."
] | 0b86606601a818b6c2489f6920c3780beda3e8c8 | https://github.com/BreizhBeans/ThriftMongoBridge/blob/0b86606601a818b6c2489f6920c3780beda3e8c8/src/main/java/org/breizhbeans/thrift/tools/thriftmongobridge/TBSONDeserializer.java#L62-L72 | train |
dashorst/wicket-stuff-markup-validator | isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java | VerifierFactory.newVerifier | public Verifier newVerifier(String uri)
throws VerifierConfigurationException, SAXException, IOException {
return compileSchema(uri).newVerifier();
} | java | public Verifier newVerifier(String uri)
throws VerifierConfigurationException, SAXException, IOException {
return compileSchema(uri).newVerifier();
} | [
"public",
"Verifier",
"newVerifier",
"(",
"String",
"uri",
")",
"throws",
"VerifierConfigurationException",
",",
"SAXException",
",",
"IOException",
"{",
"return",
"compileSchema",
"(",
"uri",
")",
".",
"newVerifier",
"(",
")",
";",
"}"
] | parses a schema at the specified location and returns a Verifier object
that validates documents by using that schema.
<p>
Some of XML parsers accepts filenames as well as URLs, while others
reject them. Therefore, to parse a file as a schema, you should use
a File object.
@param uri URI of a schema file | [
"parses",
"a",
"schema",
"at",
"the",
"specified",
"location",
"and",
"returns",
"a",
"Verifier",
"object",
"that",
"validates",
"documents",
"by",
"using",
"that",
"schema",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java#L42-L46 | train |
dashorst/wicket-stuff-markup-validator | isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java | VerifierFactory.newVerifier | public Verifier newVerifier(File file)
throws VerifierConfigurationException, SAXException, IOException {
return compileSchema(file).newVerifier();
} | java | public Verifier newVerifier(File file)
throws VerifierConfigurationException, SAXException, IOException {
return compileSchema(file).newVerifier();
} | [
"public",
"Verifier",
"newVerifier",
"(",
"File",
"file",
")",
"throws",
"VerifierConfigurationException",
",",
"SAXException",
",",
"IOException",
"{",
"return",
"compileSchema",
"(",
"file",
")",
".",
"newVerifier",
"(",
")",
";",
"}"
] | parses a schema from the specified file and returns a Verifier object
that validates documents by using that schema.
@param uri File of a schema file | [
"parses",
"a",
"schema",
"from",
"the",
"specified",
"file",
"and",
"returns",
"a",
"Verifier",
"object",
"that",
"validates",
"documents",
"by",
"using",
"that",
"schema",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java#L54-L58 | train |
dashorst/wicket-stuff-markup-validator | isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java | VerifierFactory.newVerifier | public Verifier newVerifier(InputSource source)
throws VerifierConfigurationException, SAXException, IOException {
return compileSchema(source).newVerifier();
} | java | public Verifier newVerifier(InputSource source)
throws VerifierConfigurationException, SAXException, IOException {
return compileSchema(source).newVerifier();
} | [
"public",
"Verifier",
"newVerifier",
"(",
"InputSource",
"source",
")",
"throws",
"VerifierConfigurationException",
",",
"SAXException",
",",
"IOException",
"{",
"return",
"compileSchema",
"(",
"source",
")",
".",
"newVerifier",
"(",
")",
";",
"}"
] | parses a schema from the specified InputSource and returns a Verifier object
that validates documents by using that schema.
@param source InputSource of a schema file | [
"parses",
"a",
"schema",
"from",
"the",
"specified",
"InputSource",
"and",
"returns",
"a",
"Verifier",
"object",
"that",
"validates",
"documents",
"by",
"using",
"that",
"schema",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java#L89-L93 | train |
dashorst/wicket-stuff-markup-validator | isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java | VerifierFactory.newInstance | public static VerifierFactory newInstance(String language,ClassLoader classLoader) throws VerifierConfigurationException {
Iterator itr = providers( VerifierFactoryLoader.class, classLoader );
while(itr.hasNext()) {
VerifierFactoryLoader loader = (VerifierFactoryLoader)itr.next();
try {
VerifierFactory factory = loader.createFactory(language);
if(factory!=null) return factory;
} catch (Throwable t) {} // ignore any error
}
throw new VerifierConfigurationException("no validation engine available for: "+language);
} | java | public static VerifierFactory newInstance(String language,ClassLoader classLoader) throws VerifierConfigurationException {
Iterator itr = providers( VerifierFactoryLoader.class, classLoader );
while(itr.hasNext()) {
VerifierFactoryLoader loader = (VerifierFactoryLoader)itr.next();
try {
VerifierFactory factory = loader.createFactory(language);
if(factory!=null) return factory;
} catch (Throwable t) {} // ignore any error
}
throw new VerifierConfigurationException("no validation engine available for: "+language);
} | [
"public",
"static",
"VerifierFactory",
"newInstance",
"(",
"String",
"language",
",",
"ClassLoader",
"classLoader",
")",
"throws",
"VerifierConfigurationException",
"{",
"Iterator",
"itr",
"=",
"providers",
"(",
"VerifierFactoryLoader",
".",
"class",
",",
"classLoader",... | Creates a new instance of a VerifierFactory for the specified schema language.
@param language
URI that specifies the schema language.
<p>
It is preferable to use the namespace URI of the schema language
to designate the schema language. For example,
<table><thead>
<tr>
<td>URI</td>
<td>language</td>
</tr>
</thead><tbody>
<tr>
<td><tt>http://relaxng.org/ns/structure/0.9</tt></td>
<td><a href="http://www.oasis-open.org/committees/relax-ng/">
RELAX NG
</a></td>
</tr><tr>
<td><tt>http://www.xml.gr.jp/xmlns/relaxCore</tt></td>
<td><a href="http://www.xml.gr.jp/relax">
RELAX Core
</a></td>
</tr><tr>
<td><tt>http://www.xml.gr.jp/xmlns/relaxNamespace</tt></td>
<td><a href="http://www.xml.gr.jp/relax">
RELAX Namespace
</a></td>
</tr><tr>
<td><tt>http://www.thaiopensource.com/trex</tt></td>
<td><a href="http://www.thaiopensource.com/trex">
TREX
</a></td>
</tr><tr>
<td><tt>http://www.w3.org/2001/XMLSchema</tt></td>
<td><a href="http://www.w3.org/TR/xmlschema-1">
W3C XML Schema
</a></td>
</tr><tr>
<td><tt>http://www.w3.org/XML/1998/namespace</tt></td>
<td><a href="http://www.w3.org/TR/REC-xml">
XML DTD
</a></td>
</tr>
</tbody></table>
@param classLoader
This class loader is used to search the available implementation.
@return
a non-null valid VerifierFactory instance.
@exception VerifierConfigurationException
if no implementation is available for the specified language. | [
"Creates",
"a",
"new",
"instance",
"of",
"a",
"VerifierFactory",
"for",
"the",
"specified",
"schema",
"language",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java#L323-L334 | train |
RestComm/mss-arquillian | mss-tomcat-embedded-7/src/main/java/org/jboss/arquillian/container/mobicents/servlet/sip/tomcat/embedded_7/MobicentsSipServletsContainer.java | MobicentsSipServletsContainer.deleteUnpackedWAR | @Override
public void deleteUnpackedWAR(StandardContext standardContext)
{
File unpackDir = new File(standardHost.getAppBase(), standardContext.getPath().substring(1));
if (unpackDir.exists())
{
ExpandWar.deleteDir(unpackDir);
}
} | java | @Override
public void deleteUnpackedWAR(StandardContext standardContext)
{
File unpackDir = new File(standardHost.getAppBase(), standardContext.getPath().substring(1));
if (unpackDir.exists())
{
ExpandWar.deleteDir(unpackDir);
}
} | [
"@",
"Override",
"public",
"void",
"deleteUnpackedWAR",
"(",
"StandardContext",
"standardContext",
")",
"{",
"File",
"unpackDir",
"=",
"new",
"File",
"(",
"standardHost",
".",
"getAppBase",
"(",
")",
",",
"standardContext",
".",
"getPath",
"(",
")",
".",
"subs... | Make sure an the unpacked WAR is not left behind
you would think Tomcat would cleanup an unpacked WAR, but it doesn't | [
"Make",
"sure",
"an",
"the",
"unpacked",
"WAR",
"is",
"not",
"left",
"behind",
"you",
"would",
"think",
"Tomcat",
"would",
"cleanup",
"an",
"unpacked",
"WAR",
"but",
"it",
"doesn",
"t"
] | d217b4e53701282c6e7176365a03be6f898342be | https://github.com/RestComm/mss-arquillian/blob/d217b4e53701282c6e7176365a03be6f898342be/mss-tomcat-embedded-7/src/main/java/org/jboss/arquillian/container/mobicents/servlet/sip/tomcat/embedded_7/MobicentsSipServletsContainer.java#L411-L419 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/datatype/xsd/DecimalDatatype.java | DecimalDatatype.sameValue | public boolean sameValue(Object value1, Object value2) {
return ((BigDecimal)value1).compareTo((BigDecimal)value2) == 0;
} | java | public boolean sameValue(Object value1, Object value2) {
return ((BigDecimal)value1).compareTo((BigDecimal)value2) == 0;
} | [
"public",
"boolean",
"sameValue",
"(",
"Object",
"value1",
",",
"Object",
"value2",
")",
"{",
"return",
"(",
"(",
"BigDecimal",
")",
"value1",
")",
".",
"compareTo",
"(",
"(",
"BigDecimal",
")",
"value2",
")",
"==",
"0",
";",
"}"
] | BigDecimal.equals considers objects distinct if they have the
different scales but the same mathematical value. Similarly
for hashCode. | [
"BigDecimal",
".",
"equals",
"considers",
"objects",
"distinct",
"if",
"they",
"have",
"the",
"different",
"scales",
"but",
"the",
"same",
"mathematical",
"value",
".",
"Similarly",
"for",
"hashCode",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/datatype/xsd/DecimalDatatype.java#L75-L77 | train |
dashorst/wicket-stuff-markup-validator | isorelax/src/main/java/org/iso_relax/dispatcher/impl/AbstractSchemaProviderImpl.java | AbstractSchemaProviderImpl.addSchema | public void addSchema( String uri, IslandSchema s ) {
if( schemata.containsKey(uri) )
throw new IllegalArgumentException();
schemata.put( uri, s );
} | java | public void addSchema( String uri, IslandSchema s ) {
if( schemata.containsKey(uri) )
throw new IllegalArgumentException();
schemata.put( uri, s );
} | [
"public",
"void",
"addSchema",
"(",
"String",
"uri",
",",
"IslandSchema",
"s",
")",
"{",
"if",
"(",
"schemata",
".",
"containsKey",
"(",
"uri",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"schemata",
".",
"put",
"(",
"uri",
",",
... | adds a new IslandSchema.
the caller should make sure that the given uri is not defined already. | [
"adds",
"a",
"new",
"IslandSchema",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/isorelax/src/main/java/org/iso_relax/dispatcher/impl/AbstractSchemaProviderImpl.java#L49-L53 | train |
RestComm/mss-arquillian | mss-arquillian-utilities-extension/src/main/java/org/jboss/arquillian/container/mss/extension/authentication/DigestServerAuthenticationMethod.java | DigestServerAuthenticationMethod.generateNonce | public String generateNonce() {
// Get the time of day and run MD5 over it.
Date date = new Date();
long time = date.getTime();
Random rand = new Random();
long pad = rand.nextLong();
String nonceString = (Long.valueOf(time)).toString()
+ (Long.valueOf(pad)).toString();
byte mdbytes[] = messageDigest.digest(nonceString.getBytes());
// Convert the mdbytes array into a hex string.
return toHexString(mdbytes);
} | java | public String generateNonce() {
// Get the time of day and run MD5 over it.
Date date = new Date();
long time = date.getTime();
Random rand = new Random();
long pad = rand.nextLong();
String nonceString = (Long.valueOf(time)).toString()
+ (Long.valueOf(pad)).toString();
byte mdbytes[] = messageDigest.digest(nonceString.getBytes());
// Convert the mdbytes array into a hex string.
return toHexString(mdbytes);
} | [
"public",
"String",
"generateNonce",
"(",
")",
"{",
"// Get the time of day and run MD5 over it.",
"Date",
"date",
"=",
"new",
"Date",
"(",
")",
";",
"long",
"time",
"=",
"date",
".",
"getTime",
"(",
")",
";",
"Random",
"rand",
"=",
"new",
"Random",
"(",
"... | Generate the challenge string.
@return a generated nonce. | [
"Generate",
"the",
"challenge",
"string",
"."
] | d217b4e53701282c6e7176365a03be6f898342be | https://github.com/RestComm/mss-arquillian/blob/d217b4e53701282c6e7176365a03be6f898342be/mss-arquillian-utilities-extension/src/main/java/org/jboss/arquillian/container/mss/extension/authentication/DigestServerAuthenticationMethod.java#L132-L143 | train |
KnisterPeter/Smaller | clients/common/src/main/java/de/matrixweb/smaller/clients/common/Util.java | Util.formatException | public static String formatException(final Exception e) {
final StringBuilder sb = new StringBuilder();
Throwable t = e;
while (t != null) {
sb.append(t.getMessage()).append("\n");
t = t.getCause();
}
return sb.toString();
} | java | public static String formatException(final Exception e) {
final StringBuilder sb = new StringBuilder();
Throwable t = e;
while (t != null) {
sb.append(t.getMessage()).append("\n");
t = t.getCause();
}
return sb.toString();
} | [
"public",
"static",
"String",
"formatException",
"(",
"final",
"Exception",
"e",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Throwable",
"t",
"=",
"e",
";",
"while",
"(",
"t",
"!=",
"null",
")",
"{",
"sb",
"."... | Formats the given exception in a multiline error message with all causes.
@param e
Exception for format as error message
@return Returns an error string | [
"Formats",
"the",
"given",
"exception",
"in",
"a",
"multiline",
"error",
"message",
"with",
"all",
"causes",
"."
] | 2bd6d3422a251fe1ed203e829fd2b1024d728bed | https://github.com/KnisterPeter/Smaller/blob/2bd6d3422a251fe1ed203e829fd2b1024d728bed/clients/common/src/main/java/de/matrixweb/smaller/clients/common/Util.java#L221-L229 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/DailyTimeIntervalScheduleBuilder.java | DailyTimeIntervalScheduleBuilder.onDaysOfTheWeek | public DailyTimeIntervalScheduleBuilder onDaysOfTheWeek (final Set <DayOfWeek> onDaysOfWeek)
{
ValueEnforcer.notEmpty (onDaysOfWeek, "OnDaysOfWeek");
m_aDaysOfWeek = onDaysOfWeek;
return this;
} | java | public DailyTimeIntervalScheduleBuilder onDaysOfTheWeek (final Set <DayOfWeek> onDaysOfWeek)
{
ValueEnforcer.notEmpty (onDaysOfWeek, "OnDaysOfWeek");
m_aDaysOfWeek = onDaysOfWeek;
return this;
} | [
"public",
"DailyTimeIntervalScheduleBuilder",
"onDaysOfTheWeek",
"(",
"final",
"Set",
"<",
"DayOfWeek",
">",
"onDaysOfWeek",
")",
"{",
"ValueEnforcer",
".",
"notEmpty",
"(",
"onDaysOfWeek",
",",
"\"OnDaysOfWeek\"",
")",
";",
"m_aDaysOfWeek",
"=",
"onDaysOfWeek",
";",
... | Set the trigger to fire on the given days of the week.
@param onDaysOfWeek
a Set containing the integers representing the days of the week, per
the values 1-7 as defined by {@link Calendar#SUNDAY} -
{@link Calendar#SATURDAY}.
@return the updated DailyTimeIntervalScheduleBuilder | [
"Set",
"the",
"trigger",
"to",
"fire",
"on",
"the",
"given",
"days",
"of",
"the",
"week",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/DailyTimeIntervalScheduleBuilder.java#L244-L250 | train |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/DailyTimeIntervalScheduleBuilder.java | DailyTimeIntervalScheduleBuilder.endingDailyAfterCount | public DailyTimeIntervalScheduleBuilder endingDailyAfterCount (final int count)
{
ValueEnforcer.isGT0 (count, "Count");
if (m_aStartTimeOfDay == null)
throw new IllegalArgumentException ("You must set the startDailyAt() before calling this endingDailyAfterCount()!");
final Date today = new Date ();
final Date startTimeOfDayDate = m_aStartTimeOfDay.getTimeOfDayForDate (today);
final Date maxEndTimeOfDayDate = TimeOfDay.hourMinuteAndSecondOfDay (23, 59, 59).getTimeOfDayForDate (today);
final long remainingMillisInDay = maxEndTimeOfDayDate.getTime () - startTimeOfDayDate.getTime ();
long intervalInMillis;
if (m_eIntervalUnit == EIntervalUnit.SECOND)
intervalInMillis = m_nInterval * CGlobal.MILLISECONDS_PER_SECOND;
else
if (m_eIntervalUnit == EIntervalUnit.MINUTE)
intervalInMillis = m_nInterval * CGlobal.MILLISECONDS_PER_MINUTE;
else
if (m_eIntervalUnit == EIntervalUnit.HOUR)
intervalInMillis = m_nInterval * DateBuilder.MILLISECONDS_IN_DAY;
else
throw new IllegalArgumentException ("The IntervalUnit: " + m_eIntervalUnit + " is invalid for this trigger.");
if (remainingMillisInDay - intervalInMillis <= 0)
throw new IllegalArgumentException ("The startTimeOfDay is too late with given Interval and IntervalUnit values.");
final long maxNumOfCount = (remainingMillisInDay / intervalInMillis);
if (count > maxNumOfCount)
throw new IllegalArgumentException ("The given count " +
count +
" is too large! The max you can set is " +
maxNumOfCount);
final long incrementInMillis = (count - 1) * intervalInMillis;
final Date endTimeOfDayDate = new Date (startTimeOfDayDate.getTime () + incrementInMillis);
if (endTimeOfDayDate.getTime () > maxEndTimeOfDayDate.getTime ())
throw new IllegalArgumentException ("The given count " +
count +
" is too large! The max you can set is " +
maxNumOfCount);
final Calendar cal = PDTFactory.createCalendar ();
cal.setTime (endTimeOfDayDate);
final int hour = cal.get (Calendar.HOUR_OF_DAY);
final int minute = cal.get (Calendar.MINUTE);
final int second = cal.get (Calendar.SECOND);
m_aEndTimeOfDay = TimeOfDay.hourMinuteAndSecondOfDay (hour, minute, second);
return this;
} | java | public DailyTimeIntervalScheduleBuilder endingDailyAfterCount (final int count)
{
ValueEnforcer.isGT0 (count, "Count");
if (m_aStartTimeOfDay == null)
throw new IllegalArgumentException ("You must set the startDailyAt() before calling this endingDailyAfterCount()!");
final Date today = new Date ();
final Date startTimeOfDayDate = m_aStartTimeOfDay.getTimeOfDayForDate (today);
final Date maxEndTimeOfDayDate = TimeOfDay.hourMinuteAndSecondOfDay (23, 59, 59).getTimeOfDayForDate (today);
final long remainingMillisInDay = maxEndTimeOfDayDate.getTime () - startTimeOfDayDate.getTime ();
long intervalInMillis;
if (m_eIntervalUnit == EIntervalUnit.SECOND)
intervalInMillis = m_nInterval * CGlobal.MILLISECONDS_PER_SECOND;
else
if (m_eIntervalUnit == EIntervalUnit.MINUTE)
intervalInMillis = m_nInterval * CGlobal.MILLISECONDS_PER_MINUTE;
else
if (m_eIntervalUnit == EIntervalUnit.HOUR)
intervalInMillis = m_nInterval * DateBuilder.MILLISECONDS_IN_DAY;
else
throw new IllegalArgumentException ("The IntervalUnit: " + m_eIntervalUnit + " is invalid for this trigger.");
if (remainingMillisInDay - intervalInMillis <= 0)
throw new IllegalArgumentException ("The startTimeOfDay is too late with given Interval and IntervalUnit values.");
final long maxNumOfCount = (remainingMillisInDay / intervalInMillis);
if (count > maxNumOfCount)
throw new IllegalArgumentException ("The given count " +
count +
" is too large! The max you can set is " +
maxNumOfCount);
final long incrementInMillis = (count - 1) * intervalInMillis;
final Date endTimeOfDayDate = new Date (startTimeOfDayDate.getTime () + incrementInMillis);
if (endTimeOfDayDate.getTime () > maxEndTimeOfDayDate.getTime ())
throw new IllegalArgumentException ("The given count " +
count +
" is too large! The max you can set is " +
maxNumOfCount);
final Calendar cal = PDTFactory.createCalendar ();
cal.setTime (endTimeOfDayDate);
final int hour = cal.get (Calendar.HOUR_OF_DAY);
final int minute = cal.get (Calendar.MINUTE);
final int second = cal.get (Calendar.SECOND);
m_aEndTimeOfDay = TimeOfDay.hourMinuteAndSecondOfDay (hour, minute, second);
return this;
} | [
"public",
"DailyTimeIntervalScheduleBuilder",
"endingDailyAfterCount",
"(",
"final",
"int",
"count",
")",
"{",
"ValueEnforcer",
".",
"isGT0",
"(",
"count",
",",
"\"Count\"",
")",
";",
"if",
"(",
"m_aStartTimeOfDay",
"==",
"null",
")",
"throw",
"new",
"IllegalArgum... | Calculate and set the endTimeOfDay using count, interval and starTimeOfDay.
This means that these must be set before this method is call.
@return the updated DailyTimeIntervalScheduleBuilder | [
"Calculate",
"and",
"set",
"the",
"endTimeOfDay",
"using",
"count",
"interval",
"and",
"starTimeOfDay",
".",
"This",
"means",
"that",
"these",
"must",
"be",
"set",
"before",
"this",
"method",
"is",
"call",
"."
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/DailyTimeIntervalScheduleBuilder.java#L331-L381 | train |
dashorst/wicket-stuff-markup-validator | htmlvalidator/src/main/java/org/wicketstuff/htmlvalidator/HtmlValidationResponseFilter.java | HtmlValidationResponseFilter.onValidMarkup | protected void onValidMarkup(AppendingStringBuffer responseBuffer,
ValidationReport report) {
IRequestablePage responsePage = getResponsePage();
DocType doctype = getDocType(responseBuffer);
log.info("Markup for {} is valid {}",
responsePage != null ? responsePage.getClass().getName()
: "<unable to determine page class>", doctype.name());
String head = report.getHeadMarkup();
String body = report.getBodyMarkup();
int indexOfHeadClose = responseBuffer.lastIndexOf("</head>");
responseBuffer.insert(indexOfHeadClose, head);
int indexOfBodyClose = responseBuffer.lastIndexOf("</body>");
responseBuffer.insert(indexOfBodyClose, body);
} | java | protected void onValidMarkup(AppendingStringBuffer responseBuffer,
ValidationReport report) {
IRequestablePage responsePage = getResponsePage();
DocType doctype = getDocType(responseBuffer);
log.info("Markup for {} is valid {}",
responsePage != null ? responsePage.getClass().getName()
: "<unable to determine page class>", doctype.name());
String head = report.getHeadMarkup();
String body = report.getBodyMarkup();
int indexOfHeadClose = responseBuffer.lastIndexOf("</head>");
responseBuffer.insert(indexOfHeadClose, head);
int indexOfBodyClose = responseBuffer.lastIndexOf("</body>");
responseBuffer.insert(indexOfBodyClose, body);
} | [
"protected",
"void",
"onValidMarkup",
"(",
"AppendingStringBuffer",
"responseBuffer",
",",
"ValidationReport",
"report",
")",
"{",
"IRequestablePage",
"responsePage",
"=",
"getResponsePage",
"(",
")",
";",
"DocType",
"doctype",
"=",
"getDocType",
"(",
"responseBuffer",
... | Called when the validated markup does not contain any errors.
@param responseBuffer
the validated response markup
@param report
the validation report | [
"Called",
"when",
"the",
"validated",
"markup",
"does",
"not",
"contain",
"any",
"errors",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/htmlvalidator/src/main/java/org/wicketstuff/htmlvalidator/HtmlValidationResponseFilter.java#L120-L137 | train |
dashorst/wicket-stuff-markup-validator | htmlvalidator/src/main/java/org/wicketstuff/htmlvalidator/HtmlValidationResponseFilter.java | HtmlValidationResponseFilter.onInvalidMarkup | protected void onInvalidMarkup(AppendingStringBuffer responseBuffer,
ValidationReport report) {
String head = report.getHeadMarkup();
String body = report.getBodyMarkup();
int indexOfHeadClose = responseBuffer.lastIndexOf("</head>");
responseBuffer.insert(indexOfHeadClose, head);
int indexOfBodyClose = responseBuffer.lastIndexOf("</body>");
responseBuffer.insert(indexOfBodyClose, body);
} | java | protected void onInvalidMarkup(AppendingStringBuffer responseBuffer,
ValidationReport report) {
String head = report.getHeadMarkup();
String body = report.getBodyMarkup();
int indexOfHeadClose = responseBuffer.lastIndexOf("</head>");
responseBuffer.insert(indexOfHeadClose, head);
int indexOfBodyClose = responseBuffer.lastIndexOf("</body>");
responseBuffer.insert(indexOfBodyClose, body);
} | [
"protected",
"void",
"onInvalidMarkup",
"(",
"AppendingStringBuffer",
"responseBuffer",
",",
"ValidationReport",
"report",
")",
"{",
"String",
"head",
"=",
"report",
".",
"getHeadMarkup",
"(",
")",
";",
"String",
"body",
"=",
"report",
".",
"getBodyMarkup",
"(",
... | Called when the validated markup contains errors.
@param responseBuffer
the validated response markup
@param report
the validation report containing the errors | [
"Called",
"when",
"the",
"validated",
"markup",
"contains",
"errors",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/htmlvalidator/src/main/java/org/wicketstuff/htmlvalidator/HtmlValidationResponseFilter.java#L147-L157 | train |
joachimvda/jtransfo | core/src/main/java/org/jtransfo/internal/ReflectionHelper.java | ReflectionHelper.loadClass | <T> Class<T> loadClass(String name) throws ClassNotFoundException {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (null == cl) {
cl = ToHelper.class.getClassLoader();
}
return (Class<T>) cl.loadClass(name);
} | java | <T> Class<T> loadClass(String name) throws ClassNotFoundException {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (null == cl) {
cl = ToHelper.class.getClassLoader();
}
return (Class<T>) cl.loadClass(name);
} | [
"<",
"T",
">",
"Class",
"<",
"T",
">",
"loadClass",
"(",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"ClassLoader",
"cl",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"if",
"(",
"null",
"... | Load class with given name from the correct class loader.
@param name name of class to load
@param <T> type of object to create
@return class instance
@throws ClassNotFoundException see {@link ClassLoader#loadClass(String)} | [
"Load",
"class",
"with",
"given",
"name",
"from",
"the",
"correct",
"class",
"loader",
"."
] | eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8 | https://github.com/joachimvda/jtransfo/blob/eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8/core/src/main/java/org/jtransfo/internal/ReflectionHelper.java#L75-L81 | train |
joachimvda/jtransfo | core/src/main/java/org/jtransfo/internal/ReflectionHelper.java | ReflectionHelper.getFields | List<Field> getFields(Class<?> clazz) {
List<Field> result = new ArrayList<>();
Set<String> fieldNames = new HashSet<>();
Class<?> searchType = clazz;
while (!Object.class.equals(searchType) && searchType != null) {
Field[] fields = searchType.getDeclaredFields();
for (Field field : fields) {
if (!fieldNames.contains(field.getName())) {
fieldNames.add(field.getName());
makeAccessible(field);
result.add(field);
}
}
searchType = searchType.getSuperclass();
}
return result;
} | java | List<Field> getFields(Class<?> clazz) {
List<Field> result = new ArrayList<>();
Set<String> fieldNames = new HashSet<>();
Class<?> searchType = clazz;
while (!Object.class.equals(searchType) && searchType != null) {
Field[] fields = searchType.getDeclaredFields();
for (Field field : fields) {
if (!fieldNames.contains(field.getName())) {
fieldNames.add(field.getName());
makeAccessible(field);
result.add(field);
}
}
searchType = searchType.getSuperclass();
}
return result;
} | [
"List",
"<",
"Field",
">",
"getFields",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"List",
"<",
"Field",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Set",
"<",
"String",
">",
"fieldNames",
"=",
"new",
"HashSet",
"<>",
"(",
... | Find all declared fields of a class. Fields which are hidden by a child class are not included.
@param clazz class to find fields for
@return list of fields | [
"Find",
"all",
"declared",
"fields",
"of",
"a",
"class",
".",
"Fields",
"which",
"are",
"hidden",
"by",
"a",
"child",
"class",
"are",
"not",
"included",
"."
] | eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8 | https://github.com/joachimvda/jtransfo/blob/eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8/core/src/main/java/org/jtransfo/internal/ReflectionHelper.java#L89-L105 | train |
joachimvda/jtransfo | core/src/main/java/org/jtransfo/internal/ReflectionHelper.java | ReflectionHelper.getMethod | Method getMethod(Class<?> type, Class<?> returnType, String name, Class<?>... parameters) {
Method method = null;
try {
// first try for public methods
method = type.getMethod(name, parameters);
if (null != returnType && !returnType.isAssignableFrom(method.getReturnType())) {
method = null;
}
} catch (NoSuchMethodException nsme) {
// ignore
log.trace(nsme.getMessage(), nsme);
}
if (null == method) {
method = getNonPublicMethod(type, returnType, name, parameters);
}
return method;
} | java | Method getMethod(Class<?> type, Class<?> returnType, String name, Class<?>... parameters) {
Method method = null;
try {
// first try for public methods
method = type.getMethod(name, parameters);
if (null != returnType && !returnType.isAssignableFrom(method.getReturnType())) {
method = null;
}
} catch (NoSuchMethodException nsme) {
// ignore
log.trace(nsme.getMessage(), nsme);
}
if (null == method) {
method = getNonPublicMethod(type, returnType, name, parameters);
}
return method;
} | [
"Method",
"getMethod",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Class",
"<",
"?",
">",
"returnType",
",",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"...",
"parameters",
")",
"{",
"Method",
"method",
"=",
"null",
";",
"try",
"{",
"// first try ... | Get method with given name and parameters and given return type.
@param type class on which method should be found
@param returnType required return type (or null for void or no check)
@param name method name
@param parameters method parameter types
@return method or null when method not found | [
"Get",
"method",
"with",
"given",
"name",
"and",
"parameters",
"and",
"given",
"return",
"type",
"."
] | eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8 | https://github.com/joachimvda/jtransfo/blob/eb1c72b64b09d6f3b6212bd3f1579cac5c983ea8/core/src/main/java/org/jtransfo/internal/ReflectionHelper.java#L178-L194 | train |
phax/ph-schedule | ph-schedule/src/main/java/com/helger/schedule/job/AbstractJob.java | AbstractJob.triggerCustomExceptionHandler | protected static void triggerCustomExceptionHandler (@Nonnull final Throwable t,
@Nullable final String sJobClassName,
@Nonnull final IJob aJob)
{
exceptionCallbacks ().forEach (x -> x.onScheduledJobException (t, sJobClassName, aJob));
} | java | protected static void triggerCustomExceptionHandler (@Nonnull final Throwable t,
@Nullable final String sJobClassName,
@Nonnull final IJob aJob)
{
exceptionCallbacks ().forEach (x -> x.onScheduledJobException (t, sJobClassName, aJob));
} | [
"protected",
"static",
"void",
"triggerCustomExceptionHandler",
"(",
"@",
"Nonnull",
"final",
"Throwable",
"t",
",",
"@",
"Nullable",
"final",
"String",
"sJobClassName",
",",
"@",
"Nonnull",
"final",
"IJob",
"aJob",
")",
"{",
"exceptionCallbacks",
"(",
")",
".",... | Called when an exception of the specified type occurred
@param t
The exception. Never <code>null</code>.
@param sJobClassName
The name of the job class
@param aJob
The {@link IJob} instance | [
"Called",
"when",
"an",
"exception",
"of",
"the",
"specified",
"type",
"occurred"
] | b000790b46a9f8d23ad44cc20591f753d07c0229 | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-schedule/src/main/java/com/helger/schedule/job/AbstractJob.java#L123-L128 | train |
codegist/crest | integration/server/src/main/java/org/codegist/crest/server/utils/AuthException.java | AuthException.toResponse | public static Response toResponse(Response.Status status, String wwwAuthHeader) {
Response.ResponseBuilder rb = Response.status(status);
if (wwwAuthHeader != null) {
rb.header("WWW-Authenticate", wwwAuthHeader);
}
return rb.build();
} | java | public static Response toResponse(Response.Status status, String wwwAuthHeader) {
Response.ResponseBuilder rb = Response.status(status);
if (wwwAuthHeader != null) {
rb.header("WWW-Authenticate", wwwAuthHeader);
}
return rb.build();
} | [
"public",
"static",
"Response",
"toResponse",
"(",
"Response",
".",
"Status",
"status",
",",
"String",
"wwwAuthHeader",
")",
"{",
"Response",
".",
"ResponseBuilder",
"rb",
"=",
"Response",
".",
"status",
"(",
"status",
")",
";",
"if",
"(",
"wwwAuthHeader",
"... | Maps this exception to a response object.
@return Response this exception maps to. | [
"Maps",
"this",
"exception",
"to",
"a",
"response",
"object",
"."
] | e99ba7728b27d2ddb2c247261350f1b6fa7a6698 | https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/integration/server/src/main/java/org/codegist/crest/server/utils/AuthException.java#L41-L47 | train |
brutusin/commons | src/main/java/org/brutusin/commons/concurrent/FifoTaskExecutor.java | FifoTaskExecutor.execute | public void execute(final FifoTask<E> task) throws InterruptedException {
final int id;
synchronized (this) {
id = idCounter++;
taskMap.put(id, task);
while (activeCounter >= maxThreads) {
wait();
}
activeCounter++;
}
this.threadPoolExecutor.execute(new Runnable() {
public void run() {
try {
try {
final E outcome = task.runParallel();
synchronized (resultMap) {
resultMap.put(id, new Result(outcome));
}
} catch (Throwable th) {
synchronized (resultMap) {
resultMap.put(id, new Result(null, th));
}
} finally {
processResults();
synchronized (FifoTaskExecutor.this) {
activeCounter--;
FifoTaskExecutor.this.notifyAll();
}
}
} catch (Exception ex) {
Logger.getLogger(FifoTaskExecutor.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
}
}
});
} | java | public void execute(final FifoTask<E> task) throws InterruptedException {
final int id;
synchronized (this) {
id = idCounter++;
taskMap.put(id, task);
while (activeCounter >= maxThreads) {
wait();
}
activeCounter++;
}
this.threadPoolExecutor.execute(new Runnable() {
public void run() {
try {
try {
final E outcome = task.runParallel();
synchronized (resultMap) {
resultMap.put(id, new Result(outcome));
}
} catch (Throwable th) {
synchronized (resultMap) {
resultMap.put(id, new Result(null, th));
}
} finally {
processResults();
synchronized (FifoTaskExecutor.this) {
activeCounter--;
FifoTaskExecutor.this.notifyAll();
}
}
} catch (Exception ex) {
Logger.getLogger(FifoTaskExecutor.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
}
}
});
} | [
"public",
"void",
"execute",
"(",
"final",
"FifoTask",
"<",
"E",
">",
"task",
")",
"throws",
"InterruptedException",
"{",
"final",
"int",
"id",
";",
"synchronized",
"(",
"this",
")",
"{",
"id",
"=",
"idCounter",
"++",
";",
"taskMap",
".",
"put",
"(",
"... | Executes the submitted task. If the maximum number of pooled threads is
in use, this method blocks until one of a them is available.
@param task
@throws InterruptedException | [
"Executes",
"the",
"submitted",
"task",
".",
"If",
"the",
"maximum",
"number",
"of",
"pooled",
"threads",
"is",
"in",
"use",
"this",
"method",
"blocks",
"until",
"one",
"of",
"a",
"them",
"is",
"available",
"."
] | 70685df2b2456d0bf1e6a4754d72c87bba4949df | https://github.com/brutusin/commons/blob/70685df2b2456d0bf1e6a4754d72c87bba4949df/src/main/java/org/brutusin/commons/concurrent/FifoTaskExecutor.java#L138-L173 | train |
brutusin/commons | src/main/java/org/brutusin/commons/utils/ProcessUtils.java | ProcessUtils.executeProcess | public static String executeProcess(Map<String, String> env, File workingFolder, String... command) throws ProcessException, InterruptedException {
ProcessBuilder pb = new ProcessBuilder(command);
if (workingFolder != null) {
pb.directory(workingFolder);
}
if (env != null) {
pb.environment().clear();
pb.environment().putAll(env);
}
pb.redirectErrorStream(true);
int code;
try {
Process process = pb.start();
String payload;
try {
code = process.waitFor();
} catch (InterruptedException ex) {
process.destroy();
throw ex;
}
payload = Miscellaneous.toString(process.getInputStream(), "UTF-8");
if (code == 0) {
return payload;
} else {
StringBuilder sb = new StringBuilder("Process returned code: " + code + ".");
if (payload != null) {
sb.append("\n").append(payload);
}
throw new ProcessException(code, sb.toString());
}
} catch (IOException ex) {
throw new RuntimeException(ex);
}
} | java | public static String executeProcess(Map<String, String> env, File workingFolder, String... command) throws ProcessException, InterruptedException {
ProcessBuilder pb = new ProcessBuilder(command);
if (workingFolder != null) {
pb.directory(workingFolder);
}
if (env != null) {
pb.environment().clear();
pb.environment().putAll(env);
}
pb.redirectErrorStream(true);
int code;
try {
Process process = pb.start();
String payload;
try {
code = process.waitFor();
} catch (InterruptedException ex) {
process.destroy();
throw ex;
}
payload = Miscellaneous.toString(process.getInputStream(), "UTF-8");
if (code == 0) {
return payload;
} else {
StringBuilder sb = new StringBuilder("Process returned code: " + code + ".");
if (payload != null) {
sb.append("\n").append(payload);
}
throw new ProcessException(code, sb.toString());
}
} catch (IOException ex) {
throw new RuntimeException(ex);
}
} | [
"public",
"static",
"String",
"executeProcess",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"env",
",",
"File",
"workingFolder",
",",
"String",
"...",
"command",
")",
"throws",
"ProcessException",
",",
"InterruptedException",
"{",
"ProcessBuilder",
"pb",
"=",... | Executes a native process with small stdout and stderr payloads
@param env
@param workingFolder
@param command
@return Merged stderr and stdout
@throws ProcessException if process ret code is not 0
@throws InterruptedException | [
"Executes",
"a",
"native",
"process",
"with",
"small",
"stdout",
"and",
"stderr",
"payloads"
] | 70685df2b2456d0bf1e6a4754d72c87bba4949df | https://github.com/brutusin/commons/blob/70685df2b2456d0bf1e6a4754d72c87bba4949df/src/main/java/org/brutusin/commons/utils/ProcessUtils.java#L49-L83 | train |
jcuda/jcusolver | JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java | JCusolverRf.cusolverRfGetMatrixFormat | public static int cusolverRfGetMatrixFormat(
cusolverRfHandle handle,
int[] format,
int[] diag)
{
return checkResult(cusolverRfGetMatrixFormatNative(handle, format, diag));
} | java | public static int cusolverRfGetMatrixFormat(
cusolverRfHandle handle,
int[] format,
int[] diag)
{
return checkResult(cusolverRfGetMatrixFormatNative(handle, format, diag));
} | [
"public",
"static",
"int",
"cusolverRfGetMatrixFormat",
"(",
"cusolverRfHandle",
"handle",
",",
"int",
"[",
"]",
"format",
",",
"int",
"[",
"]",
"diag",
")",
"{",
"return",
"checkResult",
"(",
"cusolverRfGetMatrixFormatNative",
"(",
"handle",
",",
"format",
",",... | CUSOLVERRF set and get input format | [
"CUSOLVERRF",
"set",
"and",
"get",
"input",
"format"
] | 2600c7eca36a92a60ebcc78cae6e028e0c1d00b9 | https://github.com/jcuda/jcusolver/blob/2600c7eca36a92a60ebcc78cae6e028e0c1d00b9/JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java#L84-L90 | train |
jcuda/jcusolver | JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java | JCusolverRf.cusolverRfSetNumericProperties | public static int cusolverRfSetNumericProperties(
cusolverRfHandle handle,
double zero,
double boost)
{
return checkResult(cusolverRfSetNumericPropertiesNative(handle, zero, boost));
} | java | public static int cusolverRfSetNumericProperties(
cusolverRfHandle handle,
double zero,
double boost)
{
return checkResult(cusolverRfSetNumericPropertiesNative(handle, zero, boost));
} | [
"public",
"static",
"int",
"cusolverRfSetNumericProperties",
"(",
"cusolverRfHandle",
"handle",
",",
"double",
"zero",
",",
"double",
"boost",
")",
"{",
"return",
"checkResult",
"(",
"cusolverRfSetNumericPropertiesNative",
"(",
"handle",
",",
"zero",
",",
"boost",
"... | CUSOLVERRF set and get numeric properties | [
"CUSOLVERRF",
"set",
"and",
"get",
"numeric",
"properties"
] | 2600c7eca36a92a60ebcc78cae6e028e0c1d00b9 | https://github.com/jcuda/jcusolver/blob/2600c7eca36a92a60ebcc78cae6e028e0c1d00b9/JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java#L111-L117 | train |
jcuda/jcusolver | JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java | JCusolverRf.cusolverRfSetAlgs | public static int cusolverRfSetAlgs(
cusolverRfHandle handle,
int factAlg,
int solveAlg)
{
return checkResult(cusolverRfSetAlgsNative(handle, factAlg, solveAlg));
} | java | public static int cusolverRfSetAlgs(
cusolverRfHandle handle,
int factAlg,
int solveAlg)
{
return checkResult(cusolverRfSetAlgsNative(handle, factAlg, solveAlg));
} | [
"public",
"static",
"int",
"cusolverRfSetAlgs",
"(",
"cusolverRfHandle",
"handle",
",",
"int",
"factAlg",
",",
"int",
"solveAlg",
")",
"{",
"return",
"checkResult",
"(",
"cusolverRfSetAlgsNative",
"(",
"handle",
",",
"factAlg",
",",
"solveAlg",
")",
")",
";",
... | CUSOLVERRF choose the triangular solve algorithm | [
"CUSOLVERRF",
"choose",
"the",
"triangular",
"solve",
"algorithm"
] | 2600c7eca36a92a60ebcc78cae6e028e0c1d00b9 | https://github.com/jcuda/jcusolver/blob/2600c7eca36a92a60ebcc78cae6e028e0c1d00b9/JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java#L149-L155 | train |
jcuda/jcusolver | JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java | JCusolverRf.cusolverRfSetupHost | public static int cusolverRfSetupHost(
int n,
int nnzA,
Pointer h_csrRowPtrA,
Pointer h_csrColIndA,
Pointer h_csrValA,
int nnzL,
Pointer h_csrRowPtrL,
Pointer h_csrColIndL,
Pointer h_csrValL,
int nnzU,
Pointer h_csrRowPtrU,
Pointer h_csrColIndU,
Pointer h_csrValU,
Pointer h_P,
Pointer h_Q,
/** Output */
cusolverRfHandle handle)
{
return checkResult(cusolverRfSetupHostNative(n, nnzA, h_csrRowPtrA, h_csrColIndA, h_csrValA, nnzL, h_csrRowPtrL, h_csrColIndL, h_csrValL, nnzU, h_csrRowPtrU, h_csrColIndU, h_csrValU, h_P, h_Q, handle));
} | java | public static int cusolverRfSetupHost(
int n,
int nnzA,
Pointer h_csrRowPtrA,
Pointer h_csrColIndA,
Pointer h_csrValA,
int nnzL,
Pointer h_csrRowPtrL,
Pointer h_csrColIndL,
Pointer h_csrValL,
int nnzU,
Pointer h_csrRowPtrU,
Pointer h_csrColIndU,
Pointer h_csrValU,
Pointer h_P,
Pointer h_Q,
/** Output */
cusolverRfHandle handle)
{
return checkResult(cusolverRfSetupHostNative(n, nnzA, h_csrRowPtrA, h_csrColIndA, h_csrValA, nnzL, h_csrRowPtrL, h_csrColIndL, h_csrValL, nnzU, h_csrRowPtrU, h_csrColIndU, h_csrValU, h_P, h_Q, handle));
} | [
"public",
"static",
"int",
"cusolverRfSetupHost",
"(",
"int",
"n",
",",
"int",
"nnzA",
",",
"Pointer",
"h_csrRowPtrA",
",",
"Pointer",
"h_csrColIndA",
",",
"Pointer",
"h_csrValA",
",",
"int",
"nnzL",
",",
"Pointer",
"h_csrRowPtrL",
",",
"Pointer",
"h_csrColIndL"... | CUSOLVERRF setup of internal structures from host or device memory | [
"CUSOLVERRF",
"setup",
"of",
"internal",
"structures",
"from",
"host",
"or",
"device",
"memory"
] | 2600c7eca36a92a60ebcc78cae6e028e0c1d00b9 | https://github.com/jcuda/jcusolver/blob/2600c7eca36a92a60ebcc78cae6e028e0c1d00b9/JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java#L200-L220 | train |
jcuda/jcusolver | JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java | JCusolverRf.cusolverRfBatchSetupHost | public static int cusolverRfBatchSetupHost(
int batchSize,
int n,
int nnzA,
Pointer h_csrRowPtrA,
Pointer h_csrColIndA,
Pointer h_csrValA_array,
int nnzL,
Pointer h_csrRowPtrL,
Pointer h_csrColIndL,
Pointer h_csrValL,
int nnzU,
Pointer h_csrRowPtrU,
Pointer h_csrColIndU,
Pointer h_csrValU,
Pointer h_P,
Pointer h_Q,
/** Output (in the device memory) */
cusolverRfHandle handle)
{
return checkResult(cusolverRfBatchSetupHostNative(batchSize, n, nnzA, h_csrRowPtrA, h_csrColIndA, h_csrValA_array, nnzL, h_csrRowPtrL, h_csrColIndL, h_csrValL, nnzU, h_csrRowPtrU, h_csrColIndU, h_csrValU, h_P, h_Q, handle));
} | java | public static int cusolverRfBatchSetupHost(
int batchSize,
int n,
int nnzA,
Pointer h_csrRowPtrA,
Pointer h_csrColIndA,
Pointer h_csrValA_array,
int nnzL,
Pointer h_csrRowPtrL,
Pointer h_csrColIndL,
Pointer h_csrValL,
int nnzU,
Pointer h_csrRowPtrU,
Pointer h_csrColIndU,
Pointer h_csrValU,
Pointer h_P,
Pointer h_Q,
/** Output (in the device memory) */
cusolverRfHandle handle)
{
return checkResult(cusolverRfBatchSetupHostNative(batchSize, n, nnzA, h_csrRowPtrA, h_csrColIndA, h_csrValA_array, nnzL, h_csrRowPtrL, h_csrColIndL, h_csrValL, nnzU, h_csrRowPtrU, h_csrColIndU, h_csrValU, h_P, h_Q, handle));
} | [
"public",
"static",
"int",
"cusolverRfBatchSetupHost",
"(",
"int",
"batchSize",
",",
"int",
"n",
",",
"int",
"nnzA",
",",
"Pointer",
"h_csrRowPtrA",
",",
"Pointer",
"h_csrColIndA",
",",
"Pointer",
"h_csrValA_array",
",",
"int",
"nnzL",
",",
"Pointer",
"h_csrRowP... | CUSOLVERRF-batch setup of internal structures from host | [
"CUSOLVERRF",
"-",
"batch",
"setup",
"of",
"internal",
"structures",
"from",
"host"
] | 2600c7eca36a92a60ebcc78cae6e028e0c1d00b9 | https://github.com/jcuda/jcusolver/blob/2600c7eca36a92a60ebcc78cae6e028e0c1d00b9/JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java#L435-L456 | train |
codegist/crest | core/src/main/java/org/codegist/crest/config/RegexPathTemplate.java | RegexPathTemplate.create | public static RegexPathTemplate create(String urlTemplate) {
StringBuffer baseUrl = new StringBuffer();
Map<String, PathTemplate> templates = new HashMap<String, PathTemplate>();
CurlyBraceTokenizer t = new CurlyBraceTokenizer(urlTemplate);
while (t.hasNext()) {
String tok = t.next();
if (CurlyBraceTokenizer.insideBraces(tok)) {
tok = CurlyBraceTokenizer.stripBraces(tok);
int index = tok.indexOf(':'); // first index of : as it can't appears in the name
String name;
Pattern validationPattern;
if(index > -1) {
name = tok.substring(0, index);
validationPattern = Pattern.compile("^" + tok.substring(index + 1) + "$");
}else{
name = tok;
validationPattern = DEFAULT_VALIDATION_PATTERN;
}
Validate.isTrue(TEMPLATE_NAME_PATTERN.matcher(name).matches(), "Template name '%s' doesn't match the expected format: %s", name, TEMPLATE_NAME_PATTERN);
Validate.isFalse(templates.containsKey(name), "Template name '%s' is already defined!", name);
templates.put(name, new PathTemplate(name, validationPattern));
baseUrl.append("{").append(name).append("}");
} else {
baseUrl.append(tok);
}
}
String url = baseUrl.toString();
isTrue(!Urls.hasQueryString(url), "Given url contains a query string: %s", url);
return new RegexPathTemplate(url, templates);
} | java | public static RegexPathTemplate create(String urlTemplate) {
StringBuffer baseUrl = new StringBuffer();
Map<String, PathTemplate> templates = new HashMap<String, PathTemplate>();
CurlyBraceTokenizer t = new CurlyBraceTokenizer(urlTemplate);
while (t.hasNext()) {
String tok = t.next();
if (CurlyBraceTokenizer.insideBraces(tok)) {
tok = CurlyBraceTokenizer.stripBraces(tok);
int index = tok.indexOf(':'); // first index of : as it can't appears in the name
String name;
Pattern validationPattern;
if(index > -1) {
name = tok.substring(0, index);
validationPattern = Pattern.compile("^" + tok.substring(index + 1) + "$");
}else{
name = tok;
validationPattern = DEFAULT_VALIDATION_PATTERN;
}
Validate.isTrue(TEMPLATE_NAME_PATTERN.matcher(name).matches(), "Template name '%s' doesn't match the expected format: %s", name, TEMPLATE_NAME_PATTERN);
Validate.isFalse(templates.containsKey(name), "Template name '%s' is already defined!", name);
templates.put(name, new PathTemplate(name, validationPattern));
baseUrl.append("{").append(name).append("}");
} else {
baseUrl.append(tok);
}
}
String url = baseUrl.toString();
isTrue(!Urls.hasQueryString(url), "Given url contains a query string: %s", url);
return new RegexPathTemplate(url, templates);
} | [
"public",
"static",
"RegexPathTemplate",
"create",
"(",
"String",
"urlTemplate",
")",
"{",
"StringBuffer",
"baseUrl",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"Map",
"<",
"String",
",",
"PathTemplate",
">",
"templates",
"=",
"new",
"HashMap",
"<",
"String",
... | Creates a regex path template for the given URI template
@param urlTemplate uri that can hold placeholders
@return a new regex path template instance | [
"Creates",
"a",
"regex",
"path",
"template",
"for",
"the",
"given",
"URI",
"template"
] | e99ba7728b27d2ddb2c247261350f1b6fa7a6698 | https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/config/RegexPathTemplate.java#L113-L143 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/ValidatorImpl.java | Section.addValidator | public void addValidator(Schema schema, ModeUsage modeUsage) {
// adds the schema to this section schemas
schemas.addElement(schema);
// creates the validator
Validator validator = createValidator(schema);
// adds the validator to this section validators
validators.addElement(validator);
// add the validator handler to the list of active handlers
activeHandlers.addElement(validator.getContentHandler());
// add the mode usage to the active handlers attribute mode usage list
activeHandlersAttributeModeUsage.addElement(modeUsage);
// compute the attribute processing
attributeProcessing = Math.max(attributeProcessing,
modeUsage.getAttributeProcessing());
// add a child mode with this mode usage and the validator content handler
childPrograms.addElement(new Program(modeUsage, validator.getContentHandler()));
if (modeUsage.isContextDependent())
contextDependent = true;
} | java | public void addValidator(Schema schema, ModeUsage modeUsage) {
// adds the schema to this section schemas
schemas.addElement(schema);
// creates the validator
Validator validator = createValidator(schema);
// adds the validator to this section validators
validators.addElement(validator);
// add the validator handler to the list of active handlers
activeHandlers.addElement(validator.getContentHandler());
// add the mode usage to the active handlers attribute mode usage list
activeHandlersAttributeModeUsage.addElement(modeUsage);
// compute the attribute processing
attributeProcessing = Math.max(attributeProcessing,
modeUsage.getAttributeProcessing());
// add a child mode with this mode usage and the validator content handler
childPrograms.addElement(new Program(modeUsage, validator.getContentHandler()));
if (modeUsage.isContextDependent())
contextDependent = true;
} | [
"public",
"void",
"addValidator",
"(",
"Schema",
"schema",
",",
"ModeUsage",
"modeUsage",
")",
"{",
"// adds the schema to this section schemas",
"schemas",
".",
"addElement",
"(",
"schema",
")",
";",
"// creates the validator",
"Validator",
"validator",
"=",
"createVal... | Adds a validator.
@param schema The schema to validate against.
@param modeUsage The mode usage for this validate action. | [
"Adds",
"a",
"validator",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/ValidatorImpl.java#L246-L264 | train |
brutusin/commons | src/main/java/org/brutusin/commons/utils/Miscellaneous.java | Miscellaneous.writeStringToFile | public static void writeStringToFile(File file, String data, String charset) throws IOException {
FileOutputStream fos = openOutputStream(file, false);
fos.write(data.getBytes(charset));
fos.close();
} | java | public static void writeStringToFile(File file, String data, String charset) throws IOException {
FileOutputStream fos = openOutputStream(file, false);
fos.write(data.getBytes(charset));
fos.close();
} | [
"public",
"static",
"void",
"writeStringToFile",
"(",
"File",
"file",
",",
"String",
"data",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"FileOutputStream",
"fos",
"=",
"openOutputStream",
"(",
"file",
",",
"false",
")",
";",
"fos",
".",
"wr... | Writes a String to a file creating the file if it does not exist.
@param file the file to write
@param data the content to write to the file
@param charset the encoding to use, {@code null} means platform default
@throws IOException in case of an I/O error | [
"Writes",
"a",
"String",
"to",
"a",
"file",
"creating",
"the",
"file",
"if",
"it",
"does",
"not",
"exist",
"."
] | 70685df2b2456d0bf1e6a4754d72c87bba4949df | https://github.com/brutusin/commons/blob/70685df2b2456d0bf1e6a4754d72c87bba4949df/src/main/java/org/brutusin/commons/utils/Miscellaneous.java#L305-L309 | train |
brutusin/commons | src/main/java/org/brutusin/commons/utils/Miscellaneous.java | Miscellaneous.pipeAsynchronously | public static Thread pipeAsynchronously(final InputStream is, final ErrorHandler errorHandler, final boolean closeResources, final OutputStream... os) {
Thread t = new Thread() {
@Override
public void run() {
try {
pipeSynchronously(is, closeResources, os);
} catch (Throwable th) {
if (errorHandler != null) {
errorHandler.onThrowable(th);
}
}
}
};
t.setDaemon(true);
t.start();
return t;
} | java | public static Thread pipeAsynchronously(final InputStream is, final ErrorHandler errorHandler, final boolean closeResources, final OutputStream... os) {
Thread t = new Thread() {
@Override
public void run() {
try {
pipeSynchronously(is, closeResources, os);
} catch (Throwable th) {
if (errorHandler != null) {
errorHandler.onThrowable(th);
}
}
}
};
t.setDaemon(true);
t.start();
return t;
} | [
"public",
"static",
"Thread",
"pipeAsynchronously",
"(",
"final",
"InputStream",
"is",
",",
"final",
"ErrorHandler",
"errorHandler",
",",
"final",
"boolean",
"closeResources",
",",
"final",
"OutputStream",
"...",
"os",
")",
"{",
"Thread",
"t",
"=",
"new",
"Threa... | Asynchronous writing from is to os
@param is
@param errorHandler
@param closeResources
@param os
@return | [
"Asynchronous",
"writing",
"from",
"is",
"to",
"os"
] | 70685df2b2456d0bf1e6a4754d72c87bba4949df | https://github.com/brutusin/commons/blob/70685df2b2456d0bf1e6a4754d72c87bba4949df/src/main/java/org/brutusin/commons/utils/Miscellaneous.java#L451-L467 | train |
brutusin/commons | src/main/java/org/brutusin/commons/utils/Miscellaneous.java | Miscellaneous.createFile | public static File createFile(String filePath) throws IOException {
boolean isDirectory = filePath.endsWith("/") || filePath.endsWith("\\");
String formattedFilePath = formatFilePath(filePath);
File f = new File(formattedFilePath);
if (f.exists()) {
return f;
}
if (isDirectory) {
f.mkdirs();
} else {
f.getParentFile().mkdirs();
f.createNewFile();
}
if (f.exists()) {
f.setExecutable(true, false);
f.setReadable(true, false);
f.setWritable(true, false);
return f;
}
throw new IOException("Error creating file: " + f.getAbsolutePath());
} | java | public static File createFile(String filePath) throws IOException {
boolean isDirectory = filePath.endsWith("/") || filePath.endsWith("\\");
String formattedFilePath = formatFilePath(filePath);
File f = new File(formattedFilePath);
if (f.exists()) {
return f;
}
if (isDirectory) {
f.mkdirs();
} else {
f.getParentFile().mkdirs();
f.createNewFile();
}
if (f.exists()) {
f.setExecutable(true, false);
f.setReadable(true, false);
f.setWritable(true, false);
return f;
}
throw new IOException("Error creating file: " + f.getAbsolutePath());
} | [
"public",
"static",
"File",
"createFile",
"(",
"String",
"filePath",
")",
"throws",
"IOException",
"{",
"boolean",
"isDirectory",
"=",
"filePath",
".",
"endsWith",
"(",
"\"/\"",
")",
"||",
"filePath",
".",
"endsWith",
"(",
"\"\\\\\"",
")",
";",
"String",
"fo... | Creates a file in the specified path. Creates also any necessary folder
needed to achieve the file level of nesting.
@param filePath the path of file to create.
@return the new created file. <code>null</code> if the file can no be
created.
@throws IOException if an IO error occurs. | [
"Creates",
"a",
"file",
"in",
"the",
"specified",
"path",
".",
"Creates",
"also",
"any",
"necessary",
"folder",
"needed",
"to",
"achieve",
"the",
"file",
"level",
"of",
"nesting",
"."
] | 70685df2b2456d0bf1e6a4754d72c87bba4949df | https://github.com/brutusin/commons/blob/70685df2b2456d0bf1e6a4754d72c87bba4949df/src/main/java/org/brutusin/commons/utils/Miscellaneous.java#L615-L640 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/NamespaceSpecification.java | NamespaceSpecification.compete | public boolean compete(NamespaceSpecification other) {
// if no wildcard for other then we check coverage
if ("".equals(other.wildcard)) {
return covers(other.ns);
}
// split the namespaces at wildcards
String[] otherParts = split(other.ns, other.wildcard);
// if the given namepsace specification does not use its wildcard
// then we just look if the current namespace specification covers it
if (otherParts.length == 1) {
return covers(other.ns);
}
// if no wildcard for the current namespace specification
if ("".equals(wildcard)) {
return other.covers(ns);
}
// also for the current namespace specification
String[] parts = split(ns, wildcard);
// now check if the current namespace specification is just an URI
if (parts.length == 1) {
return other.covers(ns);
}
// now each namespace specification contains wildcards
// suppose we have
// ns = a1*a2*...*an
// and
// other.ns = b1*b2*...*bm
// then we only need to check matchPrefix(a1, b1) and matchPrefix(an, bn) where
// matchPrefix(a, b) means a starts with b or b starts with a.
return matchPrefix(parts[0], otherParts[0])
&& matchPrefix(parts[parts.length - 1], otherParts[otherParts.length - 1]);
} | java | public boolean compete(NamespaceSpecification other) {
// if no wildcard for other then we check coverage
if ("".equals(other.wildcard)) {
return covers(other.ns);
}
// split the namespaces at wildcards
String[] otherParts = split(other.ns, other.wildcard);
// if the given namepsace specification does not use its wildcard
// then we just look if the current namespace specification covers it
if (otherParts.length == 1) {
return covers(other.ns);
}
// if no wildcard for the current namespace specification
if ("".equals(wildcard)) {
return other.covers(ns);
}
// also for the current namespace specification
String[] parts = split(ns, wildcard);
// now check if the current namespace specification is just an URI
if (parts.length == 1) {
return other.covers(ns);
}
// now each namespace specification contains wildcards
// suppose we have
// ns = a1*a2*...*an
// and
// other.ns = b1*b2*...*bm
// then we only need to check matchPrefix(a1, b1) and matchPrefix(an, bn) where
// matchPrefix(a, b) means a starts with b or b starts with a.
return matchPrefix(parts[0], otherParts[0])
&& matchPrefix(parts[parts.length - 1], otherParts[otherParts.length - 1]);
} | [
"public",
"boolean",
"compete",
"(",
"NamespaceSpecification",
"other",
")",
"{",
"// if no wildcard for other then we check coverage",
"if",
"(",
"\"\"",
".",
"equals",
"(",
"other",
".",
"wildcard",
")",
")",
"{",
"return",
"covers",
"(",
"other",
".",
"ns",
"... | Check if this namespace specification competes with
another namespace specification.
@param other The namespace specification we need to check if
it competes with this namespace specification.
@return true if the namespace specifications compete. | [
"Check",
"if",
"this",
"namespace",
"specification",
"competes",
"with",
"another",
"namespace",
"specification",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/NamespaceSpecification.java#L62-L94 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/NamespaceSpecification.java | NamespaceSpecification.matchPrefix | static private boolean matchPrefix(String s1, String s2) {
return s1.startsWith(s2) || s2.startsWith(s1);
} | java | static private boolean matchPrefix(String s1, String s2) {
return s1.startsWith(s2) || s2.startsWith(s1);
} | [
"static",
"private",
"boolean",
"matchPrefix",
"(",
"String",
"s1",
",",
"String",
"s2",
")",
"{",
"return",
"s1",
".",
"startsWith",
"(",
"s2",
")",
"||",
"s2",
".",
"startsWith",
"(",
"s1",
")",
";",
"}"
] | Checks with either of the strings starts with the other.
@param s1 a String
@param s2 a String
@return true if s1 starts with s2 or s2 starts with s1, false otherwise | [
"Checks",
"with",
"either",
"of",
"the",
"strings",
"starts",
"with",
"the",
"other",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/NamespaceSpecification.java#L102-L104 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/NamespaceSpecification.java | NamespaceSpecification.covers | public boolean covers(String uri) {
// any namspace covers only the any namespace uri
// no wildcard ("") requires equality between namespaces.
if (ANY_NAMESPACE.equals(ns) || "".equals(wildcard)) {
return ns.equals(uri);
}
String[] parts = split(ns, wildcard);
// no wildcard
if (parts.length == 1) {
return ns.equals(uri);
}
// at least one wildcard, we need to check that the start and end are the same
// then we get to match a string against a pattern like *p1*...*pn*
if (!uri.startsWith(parts[0])) {
return false;
}
if (!uri.endsWith(parts[parts.length - 1])) {
return false;
}
// Check that all remaining parts match the remaining URI.
int start = parts[0].length();
int end = uri.length() - parts[parts.length - 1].length();
for (int i = 1; i < parts.length - 1; i++) {
if (start > end) {
return false;
}
int match = uri.indexOf(parts[i], start);
if (match == -1 || match + parts[i].length() > end) {
return false;
}
start = match + parts[i].length();
}
return true;
} | java | public boolean covers(String uri) {
// any namspace covers only the any namespace uri
// no wildcard ("") requires equality between namespaces.
if (ANY_NAMESPACE.equals(ns) || "".equals(wildcard)) {
return ns.equals(uri);
}
String[] parts = split(ns, wildcard);
// no wildcard
if (parts.length == 1) {
return ns.equals(uri);
}
// at least one wildcard, we need to check that the start and end are the same
// then we get to match a string against a pattern like *p1*...*pn*
if (!uri.startsWith(parts[0])) {
return false;
}
if (!uri.endsWith(parts[parts.length - 1])) {
return false;
}
// Check that all remaining parts match the remaining URI.
int start = parts[0].length();
int end = uri.length() - parts[parts.length - 1].length();
for (int i = 1; i < parts.length - 1; i++) {
if (start > end) {
return false;
}
int match = uri.indexOf(parts[i], start);
if (match == -1 || match + parts[i].length() > end) {
return false;
}
start = match + parts[i].length();
}
return true;
} | [
"public",
"boolean",
"covers",
"(",
"String",
"uri",
")",
"{",
"// any namspace covers only the any namespace uri",
"// no wildcard (\"\") requires equality between namespaces.",
"if",
"(",
"ANY_NAMESPACE",
".",
"equals",
"(",
"ns",
")",
"||",
"\"\"",
".",
"equals",
"(",
... | Checks if a namespace specification covers a specified URI.
any namespace pattern covers only the any namespace uri.
@param uri The uri to be checked.
@return true if the namespace pattern covers the specified uri. | [
"Checks",
"if",
"a",
"namespace",
"specification",
"covers",
"a",
"specified",
"URI",
".",
"any",
"namespace",
"pattern",
"covers",
"only",
"the",
"any",
"namespace",
"uri",
"."
] | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/NamespaceSpecification.java#L126-L159 | train |
RestComm/mss-arquillian | mss-arquillian-container-extension/src/main/java/org/jboss/arquillian/container/mss/extension/ContainerManagerTool.java | ContainerManagerTool.reloadContext | @Override
public void reloadContext() throws DeploymentException
{
Archive<?> archive = mssContainer.getArchive();
deployableContainer.undeploy(archive);
deployableContainer.deploy(archive);
} | java | @Override
public void reloadContext() throws DeploymentException
{
Archive<?> archive = mssContainer.getArchive();
deployableContainer.undeploy(archive);
deployableContainer.deploy(archive);
} | [
"@",
"Override",
"public",
"void",
"reloadContext",
"(",
")",
"throws",
"DeploymentException",
"{",
"Archive",
"<",
"?",
">",
"archive",
"=",
"mssContainer",
".",
"getArchive",
"(",
")",
";",
"deployableContainer",
".",
"undeploy",
"(",
"archive",
")",
";",
... | Context related methods | [
"Context",
"related",
"methods"
] | d217b4e53701282c6e7176365a03be6f898342be | https://github.com/RestComm/mss-arquillian/blob/d217b4e53701282c6e7176365a03be6f898342be/mss-arquillian-container-extension/src/main/java/org/jboss/arquillian/container/mss/extension/ContainerManagerTool.java#L130-L136 | train |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/ModeUsage.java | ModeUsage.resolve | private Mode resolve(Mode mode) {
if (mode == Mode.CURRENT) {
return currentMode;
}
// For an action that does not specify the useMode attribute
// we create an anonymous next mode that becomes defined if we
// have a nested mode element inside the action.
// If we do not have a nested mode then the anonymous mode
// is not defined and basically that means we should use the
// current mode to perform that action.
if (mode.isAnonymous() && !mode.isDefined()) {
return currentMode;
}
return mode;
} | java | private Mode resolve(Mode mode) {
if (mode == Mode.CURRENT) {
return currentMode;
}
// For an action that does not specify the useMode attribute
// we create an anonymous next mode that becomes defined if we
// have a nested mode element inside the action.
// If we do not have a nested mode then the anonymous mode
// is not defined and basically that means we should use the
// current mode to perform that action.
if (mode.isAnonymous() && !mode.isDefined()) {
return currentMode;
}
return mode;
} | [
"private",
"Mode",
"resolve",
"(",
"Mode",
"mode",
")",
"{",
"if",
"(",
"mode",
"==",
"Mode",
".",
"CURRENT",
")",
"{",
"return",
"currentMode",
";",
"}",
"// For an action that does not specify the useMode attribute",
"// we create an anonymous next mode that becomes def... | Resolves the Mode.CURRENT to the currentMode for this mode usage.
If Mode.CURRENT is not passed as argument then the same mode is returned
with the exception of an anonymous mode that is not defined, when we
get also the current mode.
@param mode The mode to be resolved.
@return Either the current mode mode usage or the same mode passed as argument. | [
"Resolves",
"the",
"Mode",
".",
"CURRENT",
"to",
"the",
"currentMode",
"for",
"this",
"mode",
"usage",
".",
"If",
"Mode",
".",
"CURRENT",
"is",
"not",
"passed",
"as",
"argument",
"then",
"the",
"same",
"mode",
"is",
"returned",
"with",
"the",
"exception",
... | 9e529a4dc8bfdbbe4c794f3132ef400a006560a1 | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/ModeUsage.java#L87-L101 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.