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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
isisaddons-legacy/isis-module-security | dom/src/main/java/org/isisaddons/module/security/app/user/UserPermissionViewModel.java | UserPermissionViewModel.newViewModel | public static UserPermissionViewModel newViewModel(
final ApplicationFeatureId featureId, final ApplicationUser user, final ApplicationPermissionValueSet.Evaluation viewingEvaluation, final ApplicationPermissionValueSet.Evaluation changingEvaluation, final DomainObjectContainer container) {
return c... | java | public static UserPermissionViewModel newViewModel(
final ApplicationFeatureId featureId, final ApplicationUser user, final ApplicationPermissionValueSet.Evaluation viewingEvaluation, final ApplicationPermissionValueSet.Evaluation changingEvaluation, final DomainObjectContainer container) {
return c... | [
"public",
"static",
"UserPermissionViewModel",
"newViewModel",
"(",
"final",
"ApplicationFeatureId",
"featureId",
",",
"final",
"ApplicationUser",
"user",
",",
"final",
"ApplicationPermissionValueSet",
".",
"Evaluation",
"viewingEvaluation",
",",
"final",
"ApplicationPermissi... | region > constructors, factory methods | [
"region",
">",
"constructors",
"factory",
"methods"
] | a9deb1b003ba01e44c859085bd078be8df0c1863 | https://github.com/isisaddons-legacy/isis-module-security/blob/a9deb1b003ba01e44c859085bd078be8df0c1863/dom/src/main/java/org/isisaddons/module/security/app/user/UserPermissionViewModel.java#L85-L88 | train |
mgormley/agiga | src/main/java/edu/jhu/agiga/AgigaDocumentReader.java | AgigaDocumentReader.parseCorefs | private List<AgigaCoref> parseCorefs(VTDNav vn) throws PilotException, NavException {
require (vn.matchElement(AgigaConstants.DOC));
List<AgigaCoref> agigaCorefs = new ArrayList<AgigaCoref>();
if (!vn.toElement(VTDNav.FIRST_CHILD, AgigaConstants.COREFERENCES)) {
// If there ... | java | private List<AgigaCoref> parseCorefs(VTDNav vn) throws PilotException, NavException {
require (vn.matchElement(AgigaConstants.DOC));
List<AgigaCoref> agigaCorefs = new ArrayList<AgigaCoref>();
if (!vn.toElement(VTDNav.FIRST_CHILD, AgigaConstants.COREFERENCES)) {
// If there ... | [
"private",
"List",
"<",
"AgigaCoref",
">",
"parseCorefs",
"(",
"VTDNav",
"vn",
")",
"throws",
"PilotException",
",",
"NavException",
"{",
"require",
"(",
"vn",
".",
"matchElement",
"(",
"AgigaConstants",
".",
"DOC",
")",
")",
";",
"List",
"<",
"AgigaCoref",
... | Assumes the position of vn is at a "DOC" tag | [
"Assumes",
"the",
"position",
"of",
"vn",
"is",
"at",
"a",
"DOC",
"tag"
] | d61db78e3fa9d2470122d869a9ab798cb07eea3b | https://github.com/mgormley/agiga/blob/d61db78e3fa9d2470122d869a9ab798cb07eea3b/src/main/java/edu/jhu/agiga/AgigaDocumentReader.java#L174-L192 | train |
mgormley/agiga | src/main/java/edu/jhu/agiga/AgigaDocumentReader.java | AgigaDocumentReader.parseHeadline | private String parseHeadline(VTDNav vn) throws NavException {
require (vn.matchElement(AgigaConstants.DOC));
if (!vn.toElement(VTDNav.FIRST_CHILD, AgigaConstants.HEADLINE) || vn.getText() == -1) {
// If there is no headline annotation return the empty list
log.finer("No h... | java | private String parseHeadline(VTDNav vn) throws NavException {
require (vn.matchElement(AgigaConstants.DOC));
if (!vn.toElement(VTDNav.FIRST_CHILD, AgigaConstants.HEADLINE) || vn.getText() == -1) {
// If there is no headline annotation return the empty list
log.finer("No h... | [
"private",
"String",
"parseHeadline",
"(",
"VTDNav",
"vn",
")",
"throws",
"NavException",
"{",
"require",
"(",
"vn",
".",
"matchElement",
"(",
"AgigaConstants",
".",
"DOC",
")",
")",
";",
"if",
"(",
"!",
"vn",
".",
"toElement",
"(",
"VTDNav",
".",
"FIRST... | Parses out the HEADLINE element, which is a parse of the dateline if it exists.
Assumes the position of vn is at a "DOC" tag | [
"Parses",
"out",
"the",
"HEADLINE",
"element",
"which",
"is",
"a",
"parse",
"of",
"the",
"dateline",
"if",
"it",
"exists",
"."
] | d61db78e3fa9d2470122d869a9ab798cb07eea3b | https://github.com/mgormley/agiga/blob/d61db78e3fa9d2470122d869a9ab798cb07eea3b/src/main/java/edu/jhu/agiga/AgigaDocumentReader.java#L232-L240 | train |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/Logger.java | Logger.getEffectiveLevel | public Level getEffectiveLevel() {
Level effectiveLevel = level;
if (effectiveLevel == null && !name.equals("")) {
if (commonLoggerRepository == null) {
throw new IllegalStateException("CommonLoggerRepository has not been set");
} else {
effective... | java | public Level getEffectiveLevel() {
Level effectiveLevel = level;
if (effectiveLevel == null && !name.equals("")) {
if (commonLoggerRepository == null) {
throw new IllegalStateException("CommonLoggerRepository has not been set");
} else {
effective... | [
"public",
"Level",
"getEffectiveLevel",
"(",
")",
"{",
"Level",
"effectiveLevel",
"=",
"level",
";",
"if",
"(",
"effectiveLevel",
"==",
"null",
"&&",
"!",
"name",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"if",
"(",
"commonLoggerRepository",
"==",
"null",... | Get the effective log level. If we have a hierarchy of loggers, this is
searched to get the effective level.
@return the effective logger level. | [
"Get",
"the",
"effective",
"log",
"level",
".",
"If",
"we",
"have",
"a",
"hierarchy",
"of",
"loggers",
"this",
"is",
"searched",
"to",
"get",
"the",
"effective",
"level",
"."
] | 229632528e63a424460a219decdaffcf75a9f4a4 | https://github.com/lisicnu/Log4Android/blob/229632528e63a424460a219decdaffcf75a9f4a4/src/main/java/com/github/lisicnu/log4android/Logger.java#L111-L123 | train |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/Logger.java | Logger.setClientID | public void setClientID(String clientID) {
if (clientID == null || clientID.isEmpty()) {
this.clientID = DEFAULT_CLIENT_ID;
return;
}
this.clientID = clientID;
} | java | public void setClientID(String clientID) {
if (clientID == null || clientID.isEmpty()) {
this.clientID = DEFAULT_CLIENT_ID;
return;
}
this.clientID = clientID;
} | [
"public",
"void",
"setClientID",
"(",
"String",
"clientID",
")",
"{",
"if",
"(",
"clientID",
"==",
"null",
"||",
"clientID",
".",
"isEmpty",
"(",
")",
")",
"{",
"this",
".",
"clientID",
"=",
"DEFAULT_CLIENT_ID",
";",
"return",
";",
"}",
"this",
".",
"c... | Set the client ID.
@param clientID the clientID to set | [
"Set",
"the",
"client",
"ID",
"."
] | 229632528e63a424460a219decdaffcf75a9f4a4 | https://github.com/lisicnu/Log4Android/blob/229632528e63a424460a219decdaffcf75a9f4a4/src/main/java/com/github/lisicnu/log4android/Logger.java#L139-L145 | train |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/Logger.java | Logger.addAppender | synchronized public void addAppender(Appender appender) throws IllegalArgumentException {
if (appender == null) {
throw new IllegalArgumentException("Appender not allowed to be null");
}
for (Appender p : appenderList) {
if (p.getClass() == appender.getClass())
... | java | synchronized public void addAppender(Appender appender) throws IllegalArgumentException {
if (appender == null) {
throw new IllegalArgumentException("Appender not allowed to be null");
}
for (Appender p : appenderList) {
if (p.getClass() == appender.getClass())
... | [
"synchronized",
"public",
"void",
"addAppender",
"(",
"Appender",
"appender",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"appender",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Appender not allowed to be null\"",
")",
";... | Add the specified appender to the output appenders.
@param appender the <code>Appender</code> to add.
@throws IllegalArgumentException if the <code>appender</code> is <code>null</code>. | [
"Add",
"the",
"specified",
"appender",
"to",
"the",
"output",
"appenders",
"."
] | 229632528e63a424460a219decdaffcf75a9f4a4 | https://github.com/lisicnu/Log4Android/blob/229632528e63a424460a219decdaffcf75a9f4a4/src/main/java/com/github/lisicnu/log4android/Logger.java#L162-L172 | train |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/Logger.java | Logger.removeAppender | public void removeAppender(Appender appender) throws IllegalArgumentException {
if (appender == null) {
throw new IllegalArgumentException("The appender must not be null.");
}
if (appender.isLogOpen()) {
try {
appender.close();
} catch (IOExce... | java | public void removeAppender(Appender appender) throws IllegalArgumentException {
if (appender == null) {
throw new IllegalArgumentException("The appender must not be null.");
}
if (appender.isLogOpen()) {
try {
appender.close();
} catch (IOExce... | [
"public",
"void",
"removeAppender",
"(",
"Appender",
"appender",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"appender",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The appender must not be null.\"",
")",
";",
"}",
"if"... | Remove the specified appender from the appender list.
@param appender the <code>Appender</code> to remove. | [
"Remove",
"the",
"specified",
"appender",
"from",
"the",
"appender",
"list",
"."
] | 229632528e63a424460a219decdaffcf75a9f4a4 | https://github.com/lisicnu/Log4Android/blob/229632528e63a424460a219decdaffcf75a9f4a4/src/main/java/com/github/lisicnu/log4android/Logger.java#L179-L192 | train |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/Logger.java | Logger.removeAllAppenders | public void removeAllAppenders() {
ListIterator<Appender> ite = appenderList.listIterator();
while (ite.hasNext()) {
Appender appender = ite.next();
if (appender != null && appender.isLogOpen()) {
try {
appender.close();
} catch... | java | public void removeAllAppenders() {
ListIterator<Appender> ite = appenderList.listIterator();
while (ite.hasNext()) {
Appender appender = ite.next();
if (appender != null && appender.isLogOpen()) {
try {
appender.close();
} catch... | [
"public",
"void",
"removeAllAppenders",
"(",
")",
"{",
"ListIterator",
"<",
"Appender",
">",
"ite",
"=",
"appenderList",
".",
"listIterator",
"(",
")",
";",
"while",
"(",
"ite",
".",
"hasNext",
"(",
")",
")",
"{",
"Appender",
"appender",
"=",
"ite",
".",... | Remove all the appenders. | [
"Remove",
"all",
"the",
"appenders",
"."
] | 229632528e63a424460a219decdaffcf75a9f4a4 | https://github.com/lisicnu/Log4Android/blob/229632528e63a424460a219decdaffcf75a9f4a4/src/main/java/com/github/lisicnu/log4android/Logger.java#L197-L210 | train |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/Logger.java | Logger.getAppender | public Appender getAppender(int index) {
if (index < 0 || index >= appenderList.size())
return null;
return appenderList.get(index);
} | java | public Appender getAppender(int index) {
if (index < 0 || index >= appenderList.size())
return null;
return appenderList.get(index);
} | [
"public",
"Appender",
"getAppender",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"appenderList",
".",
"size",
"(",
")",
")",
"return",
"null",
";",
"return",
"appenderList",
".",
"get",
"(",
"index",
")",
";",
"}... | Get the specified appender, starting at index = 0.
@param index the index of the appender.
@return the appender. | [
"Get",
"the",
"specified",
"appender",
"starting",
"at",
"index",
"=",
"0",
"."
] | 229632528e63a424460a219decdaffcf75a9f4a4 | https://github.com/lisicnu/Log4Android/blob/229632528e63a424460a219decdaffcf75a9f4a4/src/main/java/com/github/lisicnu/log4android/Logger.java#L227-L231 | train |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/Logger.java | Logger.log | public void log(Level level, Object message) throws IllegalArgumentException {
log(level, message, null);
} | java | public void log(Level level, Object message) throws IllegalArgumentException {
log(level, message, null);
} | [
"public",
"void",
"log",
"(",
"Level",
"level",
",",
"Object",
"message",
")",
"throws",
"IllegalArgumentException",
"{",
"log",
"(",
"level",
",",
"message",
",",
"null",
")",
";",
"}"
] | Log the message at the specified level.
@param level the <code>Level</code> to log at.
@param message the message to log.
@throws IllegalArgumentException if the <code>level</code> is <code>null</code>. | [
"Log",
"the",
"message",
"at",
"the",
"specified",
"level",
"."
] | 229632528e63a424460a219decdaffcf75a9f4a4 | https://github.com/lisicnu/Log4Android/blob/229632528e63a424460a219decdaffcf75a9f4a4/src/main/java/com/github/lisicnu/log4android/Logger.java#L240-L242 | train |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/Logger.java | Logger.log | public void log(Level level, Object message, Throwable t) throws IllegalArgumentException {
if (level == null) {
throw new IllegalArgumentException("The level must not be null.");
}
if (getEffectiveLevel().toInt() <= level.toInt() && level.toInt() > Level.OFF_INT) {
if ... | java | public void log(Level level, Object message, Throwable t) throws IllegalArgumentException {
if (level == null) {
throw new IllegalArgumentException("The level must not be null.");
}
if (getEffectiveLevel().toInt() <= level.toInt() && level.toInt() > Level.OFF_INT) {
if ... | [
"public",
"void",
"log",
"(",
"Level",
"level",
",",
"Object",
"message",
",",
"Throwable",
"t",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"level",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The level must not be... | Log the message and the Throwable object at the specified level.
@param level the log level
@param message the message to log.
@param t the <code>Throwable</code> object.
@throws IllegalArgumentException if the <code>level</code> is <code>null</code>. | [
"Log",
"the",
"message",
"and",
"the",
"Throwable",
"object",
"at",
"the",
"specified",
"level",
"."
] | 229632528e63a424460a219decdaffcf75a9f4a4 | https://github.com/lisicnu/Log4Android/blob/229632528e63a424460a219decdaffcf75a9f4a4/src/main/java/com/github/lisicnu/log4android/Logger.java#L252-L278 | train |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/Logger.java | Logger.resetLogger | public synchronized void resetLogger() {
Logger.appenderList.clear();
Logger.stopWatch.stop();
Logger.stopWatch.reset();
Logger.firstLogEvent = true;
} | java | public synchronized void resetLogger() {
Logger.appenderList.clear();
Logger.stopWatch.stop();
Logger.stopWatch.reset();
Logger.firstLogEvent = true;
} | [
"public",
"synchronized",
"void",
"resetLogger",
"(",
")",
"{",
"Logger",
".",
"appenderList",
".",
"clear",
"(",
")",
";",
"Logger",
".",
"stopWatch",
".",
"stop",
"(",
")",
";",
"Logger",
".",
"stopWatch",
".",
"reset",
"(",
")",
";",
"Logger",
".",
... | Reset the Logger, i.e. remove all appenders and set the log level to the
default level. | [
"Reset",
"the",
"Logger",
"i",
".",
"e",
".",
"remove",
"all",
"appenders",
"and",
"set",
"the",
"log",
"level",
"to",
"the",
"default",
"level",
"."
] | 229632528e63a424460a219decdaffcf75a9f4a4 | https://github.com/lisicnu/Log4Android/blob/229632528e63a424460a219decdaffcf75a9f4a4/src/main/java/com/github/lisicnu/log4android/Logger.java#L464-L469 | train |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/Logger.java | Logger.open | void open() throws IOException {
ListIterator<Appender> ite = appenderList.listIterator();
while (ite.hasNext()) {
Appender p = ite.next();
if (p != null) p.open();
}
} | java | void open() throws IOException {
ListIterator<Appender> ite = appenderList.listIterator();
while (ite.hasNext()) {
Appender p = ite.next();
if (p != null) p.open();
}
} | [
"void",
"open",
"(",
")",
"throws",
"IOException",
"{",
"ListIterator",
"<",
"Appender",
">",
"ite",
"=",
"appenderList",
".",
"listIterator",
"(",
")",
";",
"while",
"(",
"ite",
".",
"hasNext",
"(",
")",
")",
"{",
"Appender",
"p",
"=",
"ite",
".",
"... | Open the log. The logging is now turned on. | [
"Open",
"the",
"log",
".",
"The",
"logging",
"is",
"now",
"turned",
"on",
"."
] | 229632528e63a424460a219decdaffcf75a9f4a4 | https://github.com/lisicnu/Log4Android/blob/229632528e63a424460a219decdaffcf75a9f4a4/src/main/java/com/github/lisicnu/log4android/Logger.java#L474-L480 | train |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/Logger.java | Logger.close | public void close() throws IOException {
ListIterator<Appender> ite = appenderList.listIterator();
while (ite.hasNext()) {
Appender p = ite.next();
if (p != null)
p.close();
}
stopWatch.stop();
Logger.firstLogEvent = true;
} | java | public void close() throws IOException {
ListIterator<Appender> ite = appenderList.listIterator();
while (ite.hasNext()) {
Appender p = ite.next();
if (p != null)
p.close();
}
stopWatch.stop();
Logger.firstLogEvent = true;
} | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"ListIterator",
"<",
"Appender",
">",
"ite",
"=",
"appenderList",
".",
"listIterator",
"(",
")",
";",
"while",
"(",
"ite",
".",
"hasNext",
"(",
")",
")",
"{",
"Appender",
"p",
"=",
"ite... | Close the log. From this point on, no logging is done.
@throws java.io.IOException if the <code>Logger</code> failed to close. | [
"Close",
"the",
"log",
".",
"From",
"this",
"point",
"on",
"no",
"logging",
"is",
"done",
"."
] | 229632528e63a424460a219decdaffcf75a9f4a4 | https://github.com/lisicnu/Log4Android/blob/229632528e63a424460a219decdaffcf75a9f4a4/src/main/java/com/github/lisicnu/log4android/Logger.java#L487-L496 | train |
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java | SSLEngineImpl.init | private void init(SSLContextImpl ctx) {
if (debug != null && Debug.isOn("ssl")) {
System.out.println("Using SSLEngineImpl.");
}
sslContext = ctx;
sess = SSLSessionImpl.nullSession;
handshakeSession = null;
/*
* State is cs_START until we initialize ... | java | private void init(SSLContextImpl ctx) {
if (debug != null && Debug.isOn("ssl")) {
System.out.println("Using SSLEngineImpl.");
}
sslContext = ctx;
sess = SSLSessionImpl.nullSession;
handshakeSession = null;
/*
* State is cs_START until we initialize ... | [
"private",
"void",
"init",
"(",
"SSLContextImpl",
"ctx",
")",
"{",
"if",
"(",
"debug",
"!=",
"null",
"&&",
"Debug",
".",
"isOn",
"(",
"\"ssl\"",
")",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Using SSLEngineImpl.\"",
")",
";",
"}",
"sslCo... | Initializes the Engine | [
"Initializes",
"the",
"Engine"
] | a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java#L354-L417 | train |
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java | SSLEngineImpl.unwrap | public SSLEngineResult unwrap(ByteBuffer netData, ByteBuffer [] appData,
int offset, int length) throws SSLException {
EngineArgs ea = new EngineArgs(netData, appData, offset, length);
try {
synchronized (unwrapLock) {
return readNetRecord(ea);
}
... | java | public SSLEngineResult unwrap(ByteBuffer netData, ByteBuffer [] appData,
int offset, int length) throws SSLException {
EngineArgs ea = new EngineArgs(netData, appData, offset, length);
try {
synchronized (unwrapLock) {
return readNetRecord(ea);
}
... | [
"public",
"SSLEngineResult",
"unwrap",
"(",
"ByteBuffer",
"netData",
",",
"ByteBuffer",
"[",
"]",
"appData",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"SSLException",
"{",
"EngineArgs",
"ea",
"=",
"new",
"EngineArgs",
"(",
"netData",
",",
"a... | Unwraps a buffer. Does a variety of checks before grabbing
the unwrapLock, which blocks multiple unwraps from occuring. | [
"Unwraps",
"a",
"buffer",
".",
"Does",
"a",
"variety",
"of",
"checks",
"before",
"grabbing",
"the",
"unwrapLock",
"which",
"blocks",
"multiple",
"unwraps",
"from",
"occuring",
"."
] | a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java#L757-L782 | train |
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java | SSLEngineImpl.wrap | public SSLEngineResult wrap(ByteBuffer [] appData,
int offset, int length, ByteBuffer netData) throws SSLException {
EngineArgs ea = new EngineArgs(appData, offset, length, netData);
/*
* We can be smarter about using smaller buffer sizes later.
* For now, force it to be ... | java | public SSLEngineResult wrap(ByteBuffer [] appData,
int offset, int length, ByteBuffer netData) throws SSLException {
EngineArgs ea = new EngineArgs(appData, offset, length, netData);
/*
* We can be smarter about using smaller buffer sizes later.
* For now, force it to be ... | [
"public",
"SSLEngineResult",
"wrap",
"(",
"ByteBuffer",
"[",
"]",
"appData",
",",
"int",
"offset",
",",
"int",
"length",
",",
"ByteBuffer",
"netData",
")",
"throws",
"SSLException",
"{",
"EngineArgs",
"ea",
"=",
"new",
"EngineArgs",
"(",
"appData",
",",
"off... | Wraps a buffer. Does a variety of checks before grabbing
the wrapLock, which blocks multiple wraps from occuring. | [
"Wraps",
"a",
"buffer",
".",
"Does",
"a",
"variety",
"of",
"checks",
"before",
"grabbing",
"the",
"wrapLock",
"which",
"blocks",
"multiple",
"wraps",
"from",
"occuring",
"."
] | a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java#L1160-L1191 | train |
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java | SSLEngineImpl.checkSequenceNumber | private boolean checkSequenceNumber(MAC mac, byte type)
throws IOException {
/*
* Don't bother to check the sequence number for error or
* closed connections, or NULL MAC
*/
if (connectionState >= cs_ERROR || mac == MAC.NULL) {
return false;
}
... | java | private boolean checkSequenceNumber(MAC mac, byte type)
throws IOException {
/*
* Don't bother to check the sequence number for error or
* closed connections, or NULL MAC
*/
if (connectionState >= cs_ERROR || mac == MAC.NULL) {
return false;
}
... | [
"private",
"boolean",
"checkSequenceNumber",
"(",
"MAC",
"mac",
",",
"byte",
"type",
")",
"throws",
"IOException",
"{",
"/*\n * Don't bother to check the sequence number for error or\n * closed connections, or NULL MAC\n */",
"if",
"(",
"connectionState",
">... | Check the sequence number state
RFC 4346 states that, "Sequence numbers are of type uint64 and
may not exceed 2^64-1. Sequence numbers do not wrap. If a TLS
implementation would need to wrap a sequence number, it must
renegotiate instead."
Return true if the handshake status may be changed. | [
"Check",
"the",
"sequence",
"number",
"state"
] | a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java#L1380-L1429 | train |
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java | SSLEngineImpl.setEnableSessionCreation | synchronized public void setEnableSessionCreation(boolean flag) {
enableSessionCreation = flag;
if ((handshaker != null) && !handshaker.activated()) {
handshaker.setEnableSessionCreation(enableSessionCreation);
}
} | java | synchronized public void setEnableSessionCreation(boolean flag) {
enableSessionCreation = flag;
if ((handshaker != null) && !handshaker.activated()) {
handshaker.setEnableSessionCreation(enableSessionCreation);
}
} | [
"synchronized",
"public",
"void",
"setEnableSessionCreation",
"(",
"boolean",
"flag",
")",
"{",
"enableSessionCreation",
"=",
"flag",
";",
"if",
"(",
"(",
"handshaker",
"!=",
"null",
")",
"&&",
"!",
"handshaker",
".",
"activated",
"(",
")",
")",
"{",
"handsh... | Controls whether new connections may cause creation of new SSL
sessions.
As long as handshaking has not started, we can change
whether we enable session creations. Otherwise,
we will need to wait for the next handshake. | [
"Controls",
"whether",
"new",
"connections",
"may",
"cause",
"creation",
"of",
"new",
"SSL",
"sessions",
"."
] | a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java#L1851-L1857 | train |
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java | SSLEngineImpl.setUseClientMode | synchronized public void setUseClientMode(boolean flag) {
switch (connectionState) {
case cs_START:
/*
* If we need to change the engine mode and the enabled
* protocols haven't specifically been set by the user,
* change them to the corresponding defa... | java | synchronized public void setUseClientMode(boolean flag) {
switch (connectionState) {
case cs_START:
/*
* If we need to change the engine mode and the enabled
* protocols haven't specifically been set by the user,
* change them to the corresponding defa... | [
"synchronized",
"public",
"void",
"setUseClientMode",
"(",
"boolean",
"flag",
")",
"{",
"switch",
"(",
"connectionState",
")",
"{",
"case",
"cs_START",
":",
"/*\n * If we need to change the engine mode and the enabled\n * protocols haven't specifically been ... | Sets the flag controlling whether the engine is in SSL
client or server mode. Must be called before any SSL
traffic has started. | [
"Sets",
"the",
"flag",
"controlling",
"whether",
"the",
"engine",
"is",
"in",
"SSL",
"client",
"or",
"server",
"mode",
".",
"Must",
"be",
"called",
"before",
"any",
"SSL",
"traffic",
"has",
"started",
"."
] | a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java#L1920-L1980 | train |
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java | SSLEngineImpl.getSSLParameters | synchronized public SSLParameters getSSLParameters() {
SSLParameters params = super.getSSLParameters();
// the super implementation does not handle the following parameters
params.setEndpointIdentificationAlgorithm(identificationProtocol);
params.setAlgorithmConstraints(algorithmConstra... | java | synchronized public SSLParameters getSSLParameters() {
SSLParameters params = super.getSSLParameters();
// the super implementation does not handle the following parameters
params.setEndpointIdentificationAlgorithm(identificationProtocol);
params.setAlgorithmConstraints(algorithmConstra... | [
"synchronized",
"public",
"SSLParameters",
"getSSLParameters",
"(",
")",
"{",
"SSLParameters",
"params",
"=",
"super",
".",
"getSSLParameters",
"(",
")",
";",
"// the super implementation does not handle the following parameters",
"params",
".",
"setEndpointIdentificationAlgori... | Returns the SSLParameters in effect for this SSLEngine. | [
"Returns",
"the",
"SSLParameters",
"in",
"effect",
"for",
"this",
"SSLEngine",
"."
] | a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java#L2064-L2072 | train |
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java | SSLEngineImpl.setSSLParameters | synchronized public void setSSLParameters(SSLParameters params) {
super.setSSLParameters(params);
// the super implementation does not handle the following parameters
identificationProtocol = params.getEndpointIdentificationAlgorithm();
algorithmConstraints = params.getAlgorithmConstrai... | java | synchronized public void setSSLParameters(SSLParameters params) {
super.setSSLParameters(params);
// the super implementation does not handle the following parameters
identificationProtocol = params.getEndpointIdentificationAlgorithm();
algorithmConstraints = params.getAlgorithmConstrai... | [
"synchronized",
"public",
"void",
"setSSLParameters",
"(",
"SSLParameters",
"params",
")",
"{",
"super",
".",
"setSSLParameters",
"(",
"params",
")",
";",
"// the super implementation does not handle the following parameters",
"identificationProtocol",
"=",
"params",
".",
"... | Applies SSLParameters to this engine. | [
"Applies",
"SSLParameters",
"to",
"this",
"engine",
"."
] | a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/SSLEngineImpl.java#L2077-L2087 | train |
morimekta/providence | providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/utils/JMessage.java | JMessage.exceptionMessageField | public Optional<JField> exceptionMessageField() {
String fieldName = getExceptionMessageFieldName();
return numericalOrderFields().stream()
.filter(f -> f.name().equals(fieldName) && f.type() == PType.STRING)
.findFirst();
} | java | public Optional<JField> exceptionMessageField() {
String fieldName = getExceptionMessageFieldName();
return numericalOrderFields().stream()
.filter(f -> f.name().equals(fieldName) && f.type() == PType.STRING)
.findFirst();
} | [
"public",
"Optional",
"<",
"JField",
">",
"exceptionMessageField",
"(",
")",
"{",
"String",
"fieldName",
"=",
"getExceptionMessageFieldName",
"(",
")",
";",
"return",
"numericalOrderFields",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"f",
"->",
"... | If the message has a 'string' field named 'message', which can be used as the 'message' for exceptions.
@return Optional message field. | [
"If",
"the",
"message",
"has",
"a",
"string",
"field",
"named",
"message",
"which",
"can",
"be",
"used",
"as",
"the",
"message",
"for",
"exceptions",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/utils/JMessage.java#L177-L182 | train |
morimekta/providence | providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/utils/JMessage.java | JMessage.getAnnotationValue | private String getAnnotationValue(String annotation) {
if (descriptor instanceof CAnnotatedDescriptor) {
if (((CAnnotatedDescriptor) descriptor).hasAnnotation(annotation)) {
return ((CAnnotatedDescriptor) descriptor).getAnnotationValue(annotation);
}
}
ret... | java | private String getAnnotationValue(String annotation) {
if (descriptor instanceof CAnnotatedDescriptor) {
if (((CAnnotatedDescriptor) descriptor).hasAnnotation(annotation)) {
return ((CAnnotatedDescriptor) descriptor).getAnnotationValue(annotation);
}
}
ret... | [
"private",
"String",
"getAnnotationValue",
"(",
"String",
"annotation",
")",
"{",
"if",
"(",
"descriptor",
"instanceof",
"CAnnotatedDescriptor",
")",
"{",
"if",
"(",
"(",
"(",
"CAnnotatedDescriptor",
")",
"descriptor",
")",
".",
"hasAnnotation",
"(",
"annotation",... | Get the annotation value.
@param annotation The annotation to get.
@return The value of the annotation, or null if not present. | [
"Get",
"the",
"annotation",
"value",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/utils/JMessage.java#L229-L236 | train |
schaloner/deadbolt-2-core | app/be/objectify/deadbolt/core/DeadboltAnalyzer.java | DeadboltAnalyzer.getRoleNames | public List<String> getRoleNames(final Optional<Subject> subjectOption)
{
final List<String> roleNames = new ArrayList<String>();
subjectOption.ifPresent(subject -> {
final List<? extends Role> roles = subject.getRoles();
if (roles != null)
{
... | java | public List<String> getRoleNames(final Optional<Subject> subjectOption)
{
final List<String> roleNames = new ArrayList<String>();
subjectOption.ifPresent(subject -> {
final List<? extends Role> roles = subject.getRoles();
if (roles != null)
{
... | [
"public",
"List",
"<",
"String",
">",
"getRoleNames",
"(",
"final",
"Optional",
"<",
"Subject",
">",
"subjectOption",
")",
"{",
"final",
"List",
"<",
"String",
">",
"roleNames",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"subjectOption",
... | Gets the role name of each role held.
@param subjectOption an option for the subject
@return a non-null list containing all role names | [
"Gets",
"the",
"role",
"name",
"of",
"each",
"role",
"held",
"."
] | dfc5cbaf866b4a46e1ba6b88d13ba236be20f658 | https://github.com/schaloner/deadbolt-2-core/blob/dfc5cbaf866b4a46e1ba6b88d13ba236be20f658/app/be/objectify/deadbolt/core/DeadboltAnalyzer.java#L57-L75 | train |
dpreussler/android-autolayout | src/main/java/de/jodamob/android/autolayout/AbsListViewFragment.java | AbsListViewFragment.onDestroyView | @Override
public void onDestroyView() {
mHandler.removeCallbacks(mRequestFocus);
mList = null;
mListShown = false;
mEmptyView = mProgressContainer = mListContainer = null;
mStandardEmptyView = null;
super.onDestroyView();
} | java | @Override
public void onDestroyView() {
mHandler.removeCallbacks(mRequestFocus);
mList = null;
mListShown = false;
mEmptyView = mProgressContainer = mListContainer = null;
mStandardEmptyView = null;
super.onDestroyView();
} | [
"@",
"Override",
"public",
"void",
"onDestroyView",
"(",
")",
"{",
"mHandler",
".",
"removeCallbacks",
"(",
"mRequestFocus",
")",
";",
"mList",
"=",
"null",
";",
"mListShown",
"=",
"false",
";",
"mEmptyView",
"=",
"mProgressContainer",
"=",
"mListContainer",
"... | Detach from list view. | [
"Detach",
"from",
"list",
"view",
"."
] | fd823f2206f24b00130533a42945f44f570ea422 | https://github.com/dpreussler/android-autolayout/blob/fd823f2206f24b00130533a42945f44f570ea422/src/main/java/de/jodamob/android/autolayout/AbsListViewFragment.java#L95-L103 | train |
dpreussler/android-autolayout | src/main/java/de/jodamob/android/autolayout/AbsListViewFragment.java | AbsListViewFragment.setListAdapter | public void setListAdapter(ListAdapter adapter) {
boolean hadAdapter = mAdapter != null;
mAdapter = adapter;
if (mList != null) {
mList.setAdapter(adapter);
if (!mListShown && !hadAdapter) {
// The list was hidden, and previously didn't have an
... | java | public void setListAdapter(ListAdapter adapter) {
boolean hadAdapter = mAdapter != null;
mAdapter = adapter;
if (mList != null) {
mList.setAdapter(adapter);
if (!mListShown && !hadAdapter) {
// The list was hidden, and previously didn't have an
... | [
"public",
"void",
"setListAdapter",
"(",
"ListAdapter",
"adapter",
")",
"{",
"boolean",
"hadAdapter",
"=",
"mAdapter",
"!=",
"null",
";",
"mAdapter",
"=",
"adapter",
";",
"if",
"(",
"mList",
"!=",
"null",
")",
"{",
"mList",
".",
"setAdapter",
"(",
"adapter... | Provide the cursor for the list view. | [
"Provide",
"the",
"cursor",
"for",
"the",
"list",
"view",
"."
] | fd823f2206f24b00130533a42945f44f570ea422 | https://github.com/dpreussler/android-autolayout/blob/fd823f2206f24b00130533a42945f44f570ea422/src/main/java/de/jodamob/android/autolayout/AbsListViewFragment.java#L122-L133 | train |
dpreussler/android-autolayout | src/main/java/de/jodamob/android/autolayout/AbsListViewFragment.java | AbsListViewFragment.setEmptyText | public void setEmptyText(CharSequence text) {
ensureList();
if (mStandardEmptyView == null) {
throw new IllegalStateException("Can't be used with a custom content view");
}
mStandardEmptyView.setText(text);
if (mEmptyText == null) {
mList.setEmptyView(mSta... | java | public void setEmptyText(CharSequence text) {
ensureList();
if (mStandardEmptyView == null) {
throw new IllegalStateException("Can't be used with a custom content view");
}
mStandardEmptyView.setText(text);
if (mEmptyText == null) {
mList.setEmptyView(mSta... | [
"public",
"void",
"setEmptyText",
"(",
"CharSequence",
"text",
")",
"{",
"ensureList",
"(",
")",
";",
"if",
"(",
"mStandardEmptyView",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Can't be used with a custom content view\"",
")",
";",
"... | The default content for a ListFragment has a TextView that can
be shown when the list is empty. If you would like to have it
shown, call this method to supply the text it should use. | [
"The",
"default",
"content",
"for",
"a",
"ListFragment",
"has",
"a",
"TextView",
"that",
"can",
"be",
"shown",
"when",
"the",
"list",
"is",
"empty",
".",
"If",
"you",
"would",
"like",
"to",
"have",
"it",
"shown",
"call",
"this",
"method",
"to",
"supply",... | fd823f2206f24b00130533a42945f44f570ea422 | https://github.com/dpreussler/android-autolayout/blob/fd823f2206f24b00130533a42945f44f570ea422/src/main/java/de/jodamob/android/autolayout/AbsListViewFragment.java#L175-L185 | train |
morimekta/providence | providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/program/extras/HazelcastPortableProgramFormatter.java | HazelcastPortableProgramFormatter.appendCreateMethod | private void appendCreateMethod(List<CStructDescriptor> messages) {
writer.appendln("@Override")
.formatln("public %s create(int classId) {", Portable.class.getName())
.begin()
.appendln("switch(classId) {")
.begin();
for (CStructDescriptor message... | java | private void appendCreateMethod(List<CStructDescriptor> messages) {
writer.appendln("@Override")
.formatln("public %s create(int classId) {", Portable.class.getName())
.begin()
.appendln("switch(classId) {")
.begin();
for (CStructDescriptor message... | [
"private",
"void",
"appendCreateMethod",
"(",
"List",
"<",
"CStructDescriptor",
">",
"messages",
")",
"{",
"writer",
".",
"appendln",
"(",
"\"@Override\"",
")",
".",
"formatln",
"(",
"\"public %s create(int classId) {\"",
",",
"Portable",
".",
"class",
".",
"getNa... | Method to write the create method from implemented PortableFactory
@param messages List with CStructDescriptor.
<pre>
{@code
@Override
public com.hazelcast.nio.serialization.Portable create(int classId) {
switch(classId) {
...
default: {
return null;
}
}
}
}
</pre> | [
"Method",
"to",
"write",
"the",
"create",
"method",
"from",
"implemented",
"PortableFactory"
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/program/extras/HazelcastPortableProgramFormatter.java#L163-L188 | train |
morimekta/providence | providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/program/extras/HazelcastPortableProgramFormatter.java | HazelcastPortableProgramFormatter.appendPopulateMethod | private void appendPopulateMethod(List<CStructDescriptor> messages) {
writer.formatln("public static final %s populateConfig(%s %s, int %s) {",
Config.class.getName(),
Config.class.getName(),
CONFIG,
PORTABLE_VERSION... | java | private void appendPopulateMethod(List<CStructDescriptor> messages) {
writer.formatln("public static final %s populateConfig(%s %s, int %s) {",
Config.class.getName(),
Config.class.getName(),
CONFIG,
PORTABLE_VERSION... | [
"private",
"void",
"appendPopulateMethod",
"(",
"List",
"<",
"CStructDescriptor",
">",
"messages",
")",
"{",
"writer",
".",
"formatln",
"(",
"\"public static final %s populateConfig(%s %s, int %s) {\"",
",",
"Config",
".",
"class",
".",
"getName",
"(",
")",
",",
"Co... | Method to append populate methods for the Hazelcast Config.
@param messages List with CStructDescriptor to iterate through.
<pre>
{@code
public static final com.hazelcast.config.Config populateConfig(com.hazelcast.config.Config config) {
PortableFactoryImpl instance = new PortableFactoryImpl();
config.getSerialization... | [
"Method",
"to",
"append",
"populate",
"methods",
"for",
"the",
"Hazelcast",
"Config",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/program/extras/HazelcastPortableProgramFormatter.java#L205-L232 | train |
morimekta/providence | providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/program/extras/HazelcastPortableProgramFormatter.java | HazelcastPortableProgramFormatter.appendCollectionTypeField | private void appendCollectionTypeField(JField field, PDescriptor descriptor) {
switch (descriptor.getType()) {
case BYTE:
case BINARY:
writer.formatln(".addByteArrayField(\"%s\")", field.name());
break;
case BOOL:
writer.formatl... | java | private void appendCollectionTypeField(JField field, PDescriptor descriptor) {
switch (descriptor.getType()) {
case BYTE:
case BINARY:
writer.formatln(".addByteArrayField(\"%s\")", field.name());
break;
case BOOL:
writer.formatl... | [
"private",
"void",
"appendCollectionTypeField",
"(",
"JField",
"field",
",",
"PDescriptor",
"descriptor",
")",
"{",
"switch",
"(",
"descriptor",
".",
"getType",
"(",
")",
")",
"{",
"case",
"BYTE",
":",
"case",
"BINARY",
":",
"writer",
".",
"formatln",
"(",
... | Append a specific list type field to the definition.
@param field JField to append.
<pre>
{@code
.addShortArrayField("shortValues")
}
</pre> | [
"Append",
"a",
"specific",
"list",
"type",
"field",
"to",
"the",
"definition",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/program/extras/HazelcastPortableProgramFormatter.java#L333-L370 | train |
isisaddons-legacy/isis-module-security | dom/src/main/java/org/isisaddons/module/security/facets/ApplicationTenancyEvaluatorUsingPaths.java | ApplicationTenancyEvaluatorUsingPaths.objectVisibleToUser | protected boolean objectVisibleToUser(String objectTenancyPath, String userTenancyPath) {
// if in "same hierarchy"
return objectTenancyPath.startsWith(userTenancyPath) ||
userTenancyPath.startsWith(objectTenancyPath);
} | java | protected boolean objectVisibleToUser(String objectTenancyPath, String userTenancyPath) {
// if in "same hierarchy"
return objectTenancyPath.startsWith(userTenancyPath) ||
userTenancyPath.startsWith(objectTenancyPath);
} | [
"protected",
"boolean",
"objectVisibleToUser",
"(",
"String",
"objectTenancyPath",
",",
"String",
"userTenancyPath",
")",
"{",
"// if in \"same hierarchy\"",
"return",
"objectTenancyPath",
".",
"startsWith",
"(",
"userTenancyPath",
")",
"||",
"userTenancyPath",
".",
"star... | Protected visibility so can be overridden if required, eg using wildcard matches. | [
"Protected",
"visibility",
"so",
"can",
"be",
"overridden",
"if",
"required",
"eg",
"using",
"wildcard",
"matches",
"."
] | a9deb1b003ba01e44c859085bd078be8df0c1863 | https://github.com/isisaddons-legacy/isis-module-security/blob/a9deb1b003ba01e44c859085bd078be8df0c1863/dom/src/main/java/org/isisaddons/module/security/facets/ApplicationTenancyEvaluatorUsingPaths.java#L95-L99 | train |
morimekta/providence | providence-core-server/src/main/java/net/morimekta/providence/server/ProvidenceHttpServlet.java | ProvidenceHttpServlet.getResponseException | @Nonnull
protected Throwable getResponseException(Throwable e) {
// Unwrap execution exceptions.
if (ExecutionException.class.isAssignableFrom(e.getClass())) {
return getResponseException(e.getCause());
}
return e;
} | java | @Nonnull
protected Throwable getResponseException(Throwable e) {
// Unwrap execution exceptions.
if (ExecutionException.class.isAssignableFrom(e.getClass())) {
return getResponseException(e.getCause());
}
return e;
} | [
"@",
"Nonnull",
"protected",
"Throwable",
"getResponseException",
"(",
"Throwable",
"e",
")",
"{",
"// Unwrap execution exceptions.",
"if",
"(",
"ExecutionException",
".",
"class",
".",
"isAssignableFrom",
"(",
"e",
".",
"getClass",
"(",
")",
")",
")",
"{",
"ret... | Get the exception to ge handled on failed requests.
@param e The exception seen.
@return The exception to use as response base. | [
"Get",
"the",
"exception",
"to",
"ge",
"handled",
"on",
"failed",
"requests",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core-server/src/main/java/net/morimekta/providence/server/ProvidenceHttpServlet.java#L228-L235 | train |
tropo/tropo-webapi-java | src/main/java/com/voxeo/tropo/Key.java | Key.JOIN_PROMPT | public static Key JOIN_PROMPT(String value, Voice voice) {
Map<String, String> map = new HashMap<String, String>();
map.put("value", value);
if (voice != null) {
map.put("voice", voice.toString());
}
return createKey("joinPrompt", map);
} | java | public static Key JOIN_PROMPT(String value, Voice voice) {
Map<String, String> map = new HashMap<String, String>();
map.put("value", value);
if (voice != null) {
map.put("voice", voice.toString());
}
return createKey("joinPrompt", map);
} | [
"public",
"static",
"Key",
"JOIN_PROMPT",
"(",
"String",
"value",
",",
"Voice",
"voice",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"map",
".",
"put",
"(",
"\"... | Defines a prompt that plays to all participants of a conference when
someone joins the conference.It's possible to define either TTS or an audio
URL using additional attributes value and voice
@param value
value is used to play simple TTS and/or an audio URL, and supports
SSML
@param voice
voice is used to define whic... | [
"Defines",
"a",
"prompt",
"that",
"plays",
"to",
"all",
"participants",
"of",
"a",
"conference",
"when",
"someone",
"joins",
"the",
"conference",
".",
"It",
"s",
"possible",
"to",
"define",
"either",
"TTS",
"or",
"an",
"audio",
"URL",
"using",
"additional",
... | 96af1fa292c1d4b6321d85a559d9718d33eec7e0 | https://github.com/tropo/tropo-webapi-java/blob/96af1fa292c1d4b6321d85a559d9718d33eec7e0/src/main/java/com/voxeo/tropo/Key.java#L421-L430 | train |
isisaddons-legacy/isis-module-security | dom/src/main/java/org/isisaddons/module/security/dom/tenancy/ApplicationTenancyRepository.java | ApplicationTenancyRepository.findByNameOrPathMatchingCached | @Programmatic
public List<ApplicationTenancy> findByNameOrPathMatchingCached(final String search) {
return queryResultsCache.execute(new Callable<List<ApplicationTenancy>>() {
@Override public List<ApplicationTenancy> call() throws Exception {
return findByNameOrPathMatching(sear... | java | @Programmatic
public List<ApplicationTenancy> findByNameOrPathMatchingCached(final String search) {
return queryResultsCache.execute(new Callable<List<ApplicationTenancy>>() {
@Override public List<ApplicationTenancy> call() throws Exception {
return findByNameOrPathMatching(sear... | [
"@",
"Programmatic",
"public",
"List",
"<",
"ApplicationTenancy",
">",
"findByNameOrPathMatchingCached",
"(",
"final",
"String",
"search",
")",
"{",
"return",
"queryResultsCache",
".",
"execute",
"(",
"new",
"Callable",
"<",
"List",
"<",
"ApplicationTenancy",
">",
... | region > findByNameOrPathMatching | [
"region",
">",
"findByNameOrPathMatching"
] | a9deb1b003ba01e44c859085bd078be8df0c1863 | https://github.com/isisaddons-legacy/isis-module-security/blob/a9deb1b003ba01e44c859085bd078be8df0c1863/dom/src/main/java/org/isisaddons/module/security/dom/tenancy/ApplicationTenancyRepository.java#L43-L50 | train |
isisaddons-legacy/isis-module-security | dom/src/main/java/org/isisaddons/module/security/dom/tenancy/ApplicationTenancyRepository.java | ApplicationTenancyRepository.findByPathCached | @Programmatic
public ApplicationTenancy findByPathCached(final String path) {
return queryResultsCache.execute(new Callable<ApplicationTenancy>() {
@Override
public ApplicationTenancy call() throws Exception {
return findByPath(path);
}
}, Applicat... | java | @Programmatic
public ApplicationTenancy findByPathCached(final String path) {
return queryResultsCache.execute(new Callable<ApplicationTenancy>() {
@Override
public ApplicationTenancy call() throws Exception {
return findByPath(path);
}
}, Applicat... | [
"@",
"Programmatic",
"public",
"ApplicationTenancy",
"findByPathCached",
"(",
"final",
"String",
"path",
")",
"{",
"return",
"queryResultsCache",
".",
"execute",
"(",
"new",
"Callable",
"<",
"ApplicationTenancy",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"A... | region > findByPath | [
"region",
">",
"findByPath"
] | a9deb1b003ba01e44c859085bd078be8df0c1863 | https://github.com/isisaddons-legacy/isis-module-security/blob/a9deb1b003ba01e44c859085bd078be8df0c1863/dom/src/main/java/org/isisaddons/module/security/dom/tenancy/ApplicationTenancyRepository.java#L81-L89 | train |
isisaddons-legacy/isis-module-security | dom/src/main/java/org/isisaddons/module/security/dom/tenancy/ApplicationTenancyRepository.java | ApplicationTenancyRepository.newTenancy | @Programmatic
public ApplicationTenancy newTenancy(
final String name,
final String path,
final ApplicationTenancy parent) {
ApplicationTenancy tenancy = findByPath(path);
if (tenancy == null) {
tenancy = getApplicationTenancyFactory().newApplicationTe... | java | @Programmatic
public ApplicationTenancy newTenancy(
final String name,
final String path,
final ApplicationTenancy parent) {
ApplicationTenancy tenancy = findByPath(path);
if (tenancy == null) {
tenancy = getApplicationTenancyFactory().newApplicationTe... | [
"@",
"Programmatic",
"public",
"ApplicationTenancy",
"newTenancy",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"path",
",",
"final",
"ApplicationTenancy",
"parent",
")",
"{",
"ApplicationTenancy",
"tenancy",
"=",
"findByPath",
"(",
"path",
")",
";",
... | region > newTenancy | [
"region",
">",
"newTenancy"
] | a9deb1b003ba01e44c859085bd078be8df0c1863 | https://github.com/isisaddons-legacy/isis-module-security/blob/a9deb1b003ba01e44c859085bd078be8df0c1863/dom/src/main/java/org/isisaddons/module/security/dom/tenancy/ApplicationTenancyRepository.java#L113-L127 | train |
isisaddons-legacy/isis-module-security | dom/src/main/java/org/isisaddons/module/security/dom/tenancy/ApplicationTenancyRepository.java | ApplicationTenancyRepository.allTenancies | @Programmatic
public List<ApplicationTenancy> allTenancies() {
return queryResultsCache.execute(new Callable<List<ApplicationTenancy>>() {
@Override
public List<ApplicationTenancy> call() throws Exception {
return allTenanciesNoCache();
}
}, Applic... | java | @Programmatic
public List<ApplicationTenancy> allTenancies() {
return queryResultsCache.execute(new Callable<List<ApplicationTenancy>>() {
@Override
public List<ApplicationTenancy> call() throws Exception {
return allTenanciesNoCache();
}
}, Applic... | [
"@",
"Programmatic",
"public",
"List",
"<",
"ApplicationTenancy",
">",
"allTenancies",
"(",
")",
"{",
"return",
"queryResultsCache",
".",
"execute",
"(",
"new",
"Callable",
"<",
"List",
"<",
"ApplicationTenancy",
">",
">",
"(",
")",
"{",
"@",
"Override",
"pu... | region > allTenancies | [
"region",
">",
"allTenancies"
] | a9deb1b003ba01e44c859085bd078be8df0c1863 | https://github.com/isisaddons-legacy/isis-module-security/blob/a9deb1b003ba01e44c859085bd078be8df0c1863/dom/src/main/java/org/isisaddons/module/security/dom/tenancy/ApplicationTenancyRepository.java#L132-L140 | train |
pawelprazak/java-extended | hamcrest/src/main/java/com/bluecatcode/hamcrest/Matchers.java | Matchers.isThrowable | public static <T extends Throwable> Matcher<T> isThrowable(Class<?> type) {
return IsThrowable.isThrowable(type);
} | java | public static <T extends Throwable> Matcher<T> isThrowable(Class<?> type) {
return IsThrowable.isThrowable(type);
} | [
"public",
"static",
"<",
"T",
"extends",
"Throwable",
">",
"Matcher",
"<",
"T",
">",
"isThrowable",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"IsThrowable",
".",
"isThrowable",
"(",
"type",
")",
";",
"}"
] | Throwable matcher with only a type argument
@param type the throwable type to match
@param <T> type of the matched throwable
@return the matcher | [
"Throwable",
"matcher",
"with",
"only",
"a",
"type",
"argument"
] | ce1a556a95cbbf7c950a03662938bc02622de69b | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/hamcrest/src/main/java/com/bluecatcode/hamcrest/Matchers.java#L156-L158 | train |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/contract/Checks.java | Checks.check | @Beta
public static <E extends Throwable> void check(boolean condition, E throwable) throws E {
checkArgument(throwable != null, "Expected non-null reference");
if (!condition) {
throw throwable;
}
} | java | @Beta
public static <E extends Throwable> void check(boolean condition, E throwable) throws E {
checkArgument(throwable != null, "Expected non-null reference");
if (!condition) {
throw throwable;
}
} | [
"@",
"Beta",
"public",
"static",
"<",
"E",
"extends",
"Throwable",
">",
"void",
"check",
"(",
"boolean",
"condition",
",",
"E",
"throwable",
")",
"throws",
"E",
"{",
"checkArgument",
"(",
"throwable",
"!=",
"null",
",",
"\"Expected non-null reference\"",
")",
... | Performs check of the condition.
@param condition condition to check
@param <E> the exception type
@throws IllegalArgumentException if the {@code throwable} is null
@throws IllegalArgumentException if the {@code throwableType} cannot be instantiated
@throws E if the {@code reference} doesn... | [
"Performs",
"check",
"of",
"the",
"condition",
"."
] | ce1a556a95cbbf7c950a03662938bc02622de69b | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/contract/Checks.java#L52-L58 | train |
morimekta/providence | providence-reflect/src/main/java/net/morimekta/providence/reflect/util/RecursiveTypeRegistry.java | RecursiveTypeRegistry.getRegistryForProgramName | public RecursiveTypeRegistry getRegistryForProgramName(String programName) {
if (localProgramContext.equals(programName)) return this;
for (RecursiveTypeRegistry registry : includes.values()) {
if (registry.getLocalProgramContext().equals(programName)) {
return registry;
... | java | public RecursiveTypeRegistry getRegistryForProgramName(String programName) {
if (localProgramContext.equals(programName)) return this;
for (RecursiveTypeRegistry registry : includes.values()) {
if (registry.getLocalProgramContext().equals(programName)) {
return registry;
... | [
"public",
"RecursiveTypeRegistry",
"getRegistryForProgramName",
"(",
"String",
"programName",
")",
"{",
"if",
"(",
"localProgramContext",
".",
"equals",
"(",
"programName",
")",
")",
"return",
"this",
";",
"for",
"(",
"RecursiveTypeRegistry",
"registry",
":",
"inclu... | Get the registry to be used for the specific program. Search through
all the included registries to find the best one.
@param programName The program to find registry for.
@return The Recursive type registry or null of not found. | [
"Get",
"the",
"registry",
"to",
"be",
"used",
"for",
"the",
"specific",
"program",
".",
"Search",
"through",
"all",
"the",
"included",
"registries",
"to",
"find",
"the",
"best",
"one",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-reflect/src/main/java/net/morimekta/providence/reflect/util/RecursiveTypeRegistry.java#L45-L59 | train |
morimekta/providence | providence-reflect/src/main/java/net/morimekta/providence/reflect/util/RecursiveTypeRegistry.java | RecursiveTypeRegistry.registerInclude | public void registerInclude(String programName, RecursiveTypeRegistry registry) {
if (registry == this) {
throw new IllegalArgumentException("Registering include back to itself: " + programName);
}
if (includes.containsKey(programName)) {
return;
}
include... | java | public void registerInclude(String programName, RecursiveTypeRegistry registry) {
if (registry == this) {
throw new IllegalArgumentException("Registering include back to itself: " + programName);
}
if (includes.containsKey(programName)) {
return;
}
include... | [
"public",
"void",
"registerInclude",
"(",
"String",
"programName",
",",
"RecursiveTypeRegistry",
"registry",
")",
"{",
"if",
"(",
"registry",
"==",
"this",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Registering include back to itself: \"",
"+",
"pro... | Register a recursive included registry.
@param programName The program to be included.
@param registry The registry for the given program. | [
"Register",
"a",
"recursive",
"included",
"registry",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-reflect/src/main/java/net/morimekta/providence/reflect/util/RecursiveTypeRegistry.java#L67-L75 | train |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/concurrent/Sleep.java | Sleep.sleepFor | @WillCloseWhenClosed
public static void sleepFor(long timeout, TimeUnit unit) {
try {
unit.sleep(timeout);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
} | java | @WillCloseWhenClosed
public static void sleepFor(long timeout, TimeUnit unit) {
try {
unit.sleep(timeout);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
} | [
"@",
"WillCloseWhenClosed",
"public",
"static",
"void",
"sleepFor",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"try",
"{",
"unit",
".",
"sleep",
"(",
"timeout",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"Thread",
... | Interruptible sleep of the current thread
<b>Will interrupt the thread if InterruptedException occurs</b>
@param timeout with unit, the maximum length of time that callers are willing to wait
@param unit with timeout, the maximum length of time that callers are willing to wait
@see TimeUnit#sleep(long) | [
"Interruptible",
"sleep",
"of",
"the",
"current",
"thread"
] | ce1a556a95cbbf7c950a03662938bc02622de69b | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/concurrent/Sleep.java#L30-L37 | train |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/concurrent/Sleep.java | Sleep.uninterruptibleSleepFor | @WillNotClose
public static Optional<InterruptedException> uninterruptibleSleepFor(long timeout, TimeUnit unit) {
try {
unit.sleep(timeout);
return Optional.absent();
} catch (InterruptedException e) {
return Optional.of(e);
}
} | java | @WillNotClose
public static Optional<InterruptedException> uninterruptibleSleepFor(long timeout, TimeUnit unit) {
try {
unit.sleep(timeout);
return Optional.absent();
} catch (InterruptedException e) {
return Optional.of(e);
}
} | [
"@",
"WillNotClose",
"public",
"static",
"Optional",
"<",
"InterruptedException",
">",
"uninterruptibleSleepFor",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"try",
"{",
"unit",
".",
"sleep",
"(",
"timeout",
")",
";",
"return",
"Optional",
".",
... | Uninterruptible sleep of the current thread
<b>WARNING: you must propagate the exception or interrupt the current thread</b>
@param timeout with unit, the maximum length of time that callers are willing to wait
@param unit with timeout, the maximum length of time that callers are willing to wait
@return true if was i... | [
"Uninterruptible",
"sleep",
"of",
"the",
"current",
"thread"
] | ce1a556a95cbbf7c950a03662938bc02622de69b | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/concurrent/Sleep.java#L50-L58 | train |
jboss/jboss-saaj-api_spec | src/main/java/javax/xml/soap/AttachmentPart.java | AttachmentPart.getContentId | public String getContentId() {
String[] values = getMimeHeader("Content-ID");
if (values != null && values.length > 0)
return values[0];
return null;
} | java | public String getContentId() {
String[] values = getMimeHeader("Content-ID");
if (values != null && values.length > 0)
return values[0];
return null;
} | [
"public",
"String",
"getContentId",
"(",
")",
"{",
"String",
"[",
"]",
"values",
"=",
"getMimeHeader",
"(",
"\"Content-ID\"",
")",
";",
"if",
"(",
"values",
"!=",
"null",
"&&",
"values",
".",
"length",
">",
"0",
")",
"return",
"values",
"[",
"0",
"]",
... | Gets the value of the MIME header whose name is "Content-ID".
@return a <code>String</code> giving the value of the
"Content-ID" header or <code>null</code> if there
is none
@see #setContentId | [
"Gets",
"the",
"value",
"of",
"the",
"MIME",
"header",
"whose",
"name",
"is",
"Content",
"-",
"ID",
"."
] | 2dda4e662e4f99b289f3a8d944a68cf537c78dd4 | https://github.com/jboss/jboss-saaj-api_spec/blob/2dda4e662e4f99b289f3a8d944a68cf537c78dd4/src/main/java/javax/xml/soap/AttachmentPart.java#L357-L362 | train |
jboss/jboss-saaj-api_spec | src/main/java/javax/xml/soap/AttachmentPart.java | AttachmentPart.getContentType | public String getContentType() {
String[] values = getMimeHeader("Content-Type");
if (values != null && values.length > 0)
return values[0];
return null;
} | java | public String getContentType() {
String[] values = getMimeHeader("Content-Type");
if (values != null && values.length > 0)
return values[0];
return null;
} | [
"public",
"String",
"getContentType",
"(",
")",
"{",
"String",
"[",
"]",
"values",
"=",
"getMimeHeader",
"(",
"\"Content-Type\"",
")",
";",
"if",
"(",
"values",
"!=",
"null",
"&&",
"values",
".",
"length",
">",
"0",
")",
"return",
"values",
"[",
"0",
"... | Gets the value of the MIME header whose name is "Content-Type".
@return a <code>String</code> giving the value of the
"Content-Type" header or <code>null</code> if there
is none | [
"Gets",
"the",
"value",
"of",
"the",
"MIME",
"header",
"whose",
"name",
"is",
"Content",
"-",
"Type",
"."
] | 2dda4e662e4f99b289f3a8d944a68cf537c78dd4 | https://github.com/jboss/jboss-saaj-api_spec/blob/2dda4e662e4f99b289f3a8d944a68cf537c78dd4/src/main/java/javax/xml/soap/AttachmentPart.java#L385-L390 | train |
morimekta/providence | providence-core/src/main/java/net/morimekta/providence/util/BaseTypeRegistry.java | BaseTypeRegistry.finalTypename | protected String finalTypename(String typeName, String programContext) {
String qualifiedName = qualifiedTypenameInternal(typeName, programContext);
if (typedefs.containsKey(qualifiedName)) {
String resolved = typedefs.get(qualifiedName);
return finalTypename(resolved, programCo... | java | protected String finalTypename(String typeName, String programContext) {
String qualifiedName = qualifiedTypenameInternal(typeName, programContext);
if (typedefs.containsKey(qualifiedName)) {
String resolved = typedefs.get(qualifiedName);
return finalTypename(resolved, programCo... | [
"protected",
"String",
"finalTypename",
"(",
"String",
"typeName",
",",
"String",
"programContext",
")",
"{",
"String",
"qualifiedName",
"=",
"qualifiedTypenameInternal",
"(",
"typeName",
",",
"programContext",
")",
";",
"if",
"(",
"typedefs",
".",
"containsKey",
... | Get the final typename of the given identifier within the context.
@param typeName The identifier name.
@param programContext The program context.
@return The final typename. | [
"Get",
"the",
"final",
"typename",
"of",
"the",
"given",
"identifier",
"within",
"the",
"context",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/util/BaseTypeRegistry.java#L166-L175 | train |
morimekta/providence | providence-core/src/main/java/net/morimekta/providence/util/BaseTypeRegistry.java | BaseTypeRegistry.qualifiedNameFromIdAndContext | protected static String qualifiedNameFromIdAndContext(String name, String context) {
if (!name.contains(".")) {
return context + "." + name;
}
return name;
} | java | protected static String qualifiedNameFromIdAndContext(String name, String context) {
if (!name.contains(".")) {
return context + "." + name;
}
return name;
} | [
"protected",
"static",
"String",
"qualifiedNameFromIdAndContext",
"(",
"String",
"name",
",",
"String",
"context",
")",
"{",
"if",
"(",
"!",
"name",
".",
"contains",
"(",
"\".\"",
")",
")",
"{",
"return",
"context",
"+",
"\".\"",
"+",
"name",
";",
"}",
"... | Make a qualified type name from a name identifier string and the program context.
@param name The type name.
@param context The program context.
@return The qualified name containing program name and type name. | [
"Make",
"a",
"qualified",
"type",
"name",
"from",
"a",
"name",
"identifier",
"string",
"and",
"the",
"program",
"context",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/util/BaseTypeRegistry.java#L183-L188 | train |
morimekta/providence | providence-core/src/main/java/net/morimekta/providence/util/BaseTypeRegistry.java | BaseTypeRegistry.registerListType | private void registerListType(PContainer containerType) {
PDescriptor itemType = containerType.itemDescriptor();
if (itemType.getType() == PType.MAP ||
itemType.getType() == PType.LIST ||
itemType.getType() == PType.SET) {
registerListType((PContainer) itemType);
... | java | private void registerListType(PContainer containerType) {
PDescriptor itemType = containerType.itemDescriptor();
if (itemType.getType() == PType.MAP ||
itemType.getType() == PType.LIST ||
itemType.getType() == PType.SET) {
registerListType((PContainer) itemType);
... | [
"private",
"void",
"registerListType",
"(",
"PContainer",
"containerType",
")",
"{",
"PDescriptor",
"itemType",
"=",
"containerType",
".",
"itemDescriptor",
"(",
")",
";",
"if",
"(",
"itemType",
".",
"getType",
"(",
")",
"==",
"PType",
".",
"MAP",
"||",
"ite... | Register a list type part of recursive registering.
@param containerType The container to register containing types of. | [
"Register",
"a",
"list",
"type",
"part",
"of",
"recursive",
"registering",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/util/BaseTypeRegistry.java#L195-L213 | train |
morimekta/providence | providence-reflect/src/main/java/net/morimekta/providence/reflect/contained/CStruct.java | CStruct.asString | protected static <Message extends PMessage<Message, CField>>
String asString(Message message) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PRETTY_SERIALIZER.serialize(baos, message);
return new String(baos.toByteArray(), UTF_8);
} | java | protected static <Message extends PMessage<Message, CField>>
String asString(Message message) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PRETTY_SERIALIZER.serialize(baos, message);
return new String(baos.toByteArray(), UTF_8);
} | [
"protected",
"static",
"<",
"Message",
"extends",
"PMessage",
"<",
"Message",
",",
"CField",
">",
">",
"String",
"asString",
"(",
"Message",
"message",
")",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"PRETTY_SERIALI... | Prints a jsonCompact string representation of the message.
@param message The message to stringify.
@param <Message> The contained message type.
@return The resulting string. | [
"Prints",
"a",
"jsonCompact",
"string",
"representation",
"of",
"the",
"message",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-reflect/src/main/java/net/morimekta/providence/reflect/contained/CStruct.java#L162-L167 | train |
morimekta/providence | providence-reflect/src/main/java/net/morimekta/providence/reflect/contained/CStruct.java | CStruct.compare | @SuppressWarnings("unchecked")
private static <T extends Comparable<T>> int compare(T o1, T o2) {
if (o1 instanceof PMessage && o2 instanceof PMessage) {
return compareMessages((PMessage) o1, (PMessage) o2);
}
return o1.compareTo(o2);
} | java | @SuppressWarnings("unchecked")
private static <T extends Comparable<T>> int compare(T o1, T o2) {
if (o1 instanceof PMessage && o2 instanceof PMessage) {
return compareMessages((PMessage) o1, (PMessage) o2);
}
return o1.compareTo(o2);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"T",
">",
">",
"int",
"compare",
"(",
"T",
"o1",
",",
"T",
"o2",
")",
"{",
"if",
"(",
"o1",
"instanceof",
"PMessage",
"&&",
"o2",
"instance... | Compare two values to each other.
@param o1 The first value.
@param o2 The second value.
@param <T> The object type.
@return The compare value (-1, 0 or 1). | [
"Compare",
"two",
"values",
"to",
"each",
"other",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-reflect/src/main/java/net/morimekta/providence/reflect/contained/CStruct.java#L177-L183 | train |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/base/ExceptionSupplier.java | ExceptionSupplier.throwA | public static <T, E extends RuntimeException> ExceptionSupplier<T, E> throwA(E exception) {
return new ExceptionSupplier<>(exception);
} | java | public static <T, E extends RuntimeException> ExceptionSupplier<T, E> throwA(E exception) {
return new ExceptionSupplier<>(exception);
} | [
"public",
"static",
"<",
"T",
",",
"E",
"extends",
"RuntimeException",
">",
"ExceptionSupplier",
"<",
"T",
",",
"E",
">",
"throwA",
"(",
"E",
"exception",
")",
"{",
"return",
"new",
"ExceptionSupplier",
"<>",
"(",
"exception",
")",
";",
"}"
] | Factory method for usage during variable or field initialisation.
@param exception exception to throw
@param <T> Supplied object type
@param <E> RuntimeException subtype
@return the exception supplier
@throws E the provided exception | [
"Factory",
"method",
"for",
"usage",
"during",
"variable",
"or",
"field",
"initialisation",
"."
] | ce1a556a95cbbf7c950a03662938bc02622de69b | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/base/ExceptionSupplier.java#L43-L45 | train |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/base/ExceptionSupplier.java | ExceptionSupplier.throwA | public static <T, E extends RuntimeException> ExceptionSupplier<T, E> throwA(
@SuppressWarnings("UnusedParameters") Class<T> type, E exception) {
return new ExceptionSupplier<>(exception);
} | java | public static <T, E extends RuntimeException> ExceptionSupplier<T, E> throwA(
@SuppressWarnings("UnusedParameters") Class<T> type, E exception) {
return new ExceptionSupplier<>(exception);
} | [
"public",
"static",
"<",
"T",
",",
"E",
"extends",
"RuntimeException",
">",
"ExceptionSupplier",
"<",
"T",
",",
"E",
">",
"throwA",
"(",
"@",
"SuppressWarnings",
"(",
"\"UnusedParameters\"",
")",
"Class",
"<",
"T",
">",
"type",
",",
"E",
"exception",
")",
... | Factory method for usage inside a method call
@param type class type used only for type inference
@param exception exception to throw
@param <T> Supplied object type
@param <E> RuntimeException subtype
@return the exception supplier
@throws E the provided exception | [
"Factory",
"method",
"for",
"usage",
"inside",
"a",
"method",
"call"
] | ce1a556a95cbbf7c950a03662938bc02622de69b | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/base/ExceptionSupplier.java#L57-L60 | train |
morimekta/providence | providence-reflect/src/main/java/net/morimekta/providence/reflect/parser/internal/ConstParser.java | ConstParser.parseMessage | private <Message extends PMessage<Message, Field>, Field extends PField>
Message parseMessage(ThriftTokenizer tokenizer,
PMessageDescriptor<Message, Field> type) throws IOException {
PMessageBuilder<Message, Field> builder = type.builder();
if (tokenizer.peek("checking for ... | java | private <Message extends PMessage<Message, Field>, Field extends PField>
Message parseMessage(ThriftTokenizer tokenizer,
PMessageDescriptor<Message, Field> type) throws IOException {
PMessageBuilder<Message, Field> builder = type.builder();
if (tokenizer.peek("checking for ... | [
"private",
"<",
"Message",
"extends",
"PMessage",
"<",
"Message",
",",
"Field",
">",
",",
"Field",
"extends",
"PField",
">",
"Message",
"parseMessage",
"(",
"ThriftTokenizer",
"tokenizer",
",",
"PMessageDescriptor",
"<",
"Message",
",",
"Field",
">",
"type",
"... | Parse JSON object as a message.
@param tokenizer The JSON tokenizer.
@param type The message type.
@param <Message> Message generic type.
@param <Field> Message field type.
@return The parsed message. | [
"Parse",
"JSON",
"object",
"as",
"a",
"message",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-reflect/src/main/java/net/morimekta/providence/reflect/parser/internal/ConstParser.java#L139-L193 | train |
isisaddons-legacy/isis-module-security | fixture/src/main/java/org/isisaddons/module/security/fixture/scripts/SecurityModuleAppFixturesService.java | SecurityModuleAppFixturesService.runFixtureScript | @Override
public List<FixtureResult> runFixtureScript(
final FixtureScript fixtureScript,
@Parameter(optionality = Optionality.OPTIONAL)
@ParameterLayout(
named = "Parameters",
describedAs = "Script-specific parameters (if any). The format depends... | java | @Override
public List<FixtureResult> runFixtureScript(
final FixtureScript fixtureScript,
@Parameter(optionality = Optionality.OPTIONAL)
@ParameterLayout(
named = "Parameters",
describedAs = "Script-specific parameters (if any). The format depends... | [
"@",
"Override",
"public",
"List",
"<",
"FixtureResult",
">",
"runFixtureScript",
"(",
"final",
"FixtureScript",
"fixtureScript",
",",
"@",
"Parameter",
"(",
"optionality",
"=",
"Optionality",
".",
"OPTIONAL",
")",
"@",
"ParameterLayout",
"(",
"named",
"=",
"\"P... | region > runFixtureScript | [
"region",
">",
"runFixtureScript"
] | a9deb1b003ba01e44c859085bd078be8df0c1863 | https://github.com/isisaddons-legacy/isis-module-security/blob/a9deb1b003ba01e44c859085bd078be8df0c1863/fixture/src/main/java/org/isisaddons/module/security/fixture/scripts/SecurityModuleAppFixturesService.java#L59-L70 | train |
isisaddons-legacy/isis-module-security | fixture/src/main/java/org/isisaddons/module/security/fixture/scripts/SecurityModuleAppFixturesService.java | SecurityModuleAppFixturesService.installFixturesAndReturnFirstRole | @Action(
semantics = SemanticsOf.NON_IDEMPOTENT,
restrictTo = RestrictTo.PROTOTYPING
)
@MemberOrder(sequence="20")
public Object installFixturesAndReturnFirstRole() {
final List<FixtureResult> fixtureResultList = findFixtureScriptFor(SecurityModuleAppSetUp.class).run(null);
... | java | @Action(
semantics = SemanticsOf.NON_IDEMPOTENT,
restrictTo = RestrictTo.PROTOTYPING
)
@MemberOrder(sequence="20")
public Object installFixturesAndReturnFirstRole() {
final List<FixtureResult> fixtureResultList = findFixtureScriptFor(SecurityModuleAppSetUp.class).run(null);
... | [
"@",
"Action",
"(",
"semantics",
"=",
"SemanticsOf",
".",
"NON_IDEMPOTENT",
",",
"restrictTo",
"=",
"RestrictTo",
".",
"PROTOTYPING",
")",
"@",
"MemberOrder",
"(",
"sequence",
"=",
"\"20\"",
")",
"public",
"Object",
"installFixturesAndReturnFirstRole",
"(",
")",
... | region > installFixturesAndReturnFirstRole | [
"region",
">",
"installFixturesAndReturnFirstRole"
] | a9deb1b003ba01e44c859085bd078be8df0c1863 | https://github.com/isisaddons-legacy/isis-module-security/blob/a9deb1b003ba01e44c859085bd078be8df0c1863/fixture/src/main/java/org/isisaddons/module/security/fixture/scripts/SecurityModuleAppFixturesService.java#L88-L103 | train |
morimekta/providence | providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/utils/JService.java | JService.methods | public JServiceMethod[] methods() {
List<CServiceMethod> methods = new ArrayList<>(service.getMethodsIncludingExtended());
CServiceMethod[] ma = methods.toArray(new CServiceMethod[methods.size()]);
JServiceMethod[] ret = new JServiceMethod[ma.length];
for (int i = 0; i < methods.size();... | java | public JServiceMethod[] methods() {
List<CServiceMethod> methods = new ArrayList<>(service.getMethodsIncludingExtended());
CServiceMethod[] ma = methods.toArray(new CServiceMethod[methods.size()]);
JServiceMethod[] ret = new JServiceMethod[ma.length];
for (int i = 0; i < methods.size();... | [
"public",
"JServiceMethod",
"[",
"]",
"methods",
"(",
")",
"{",
"List",
"<",
"CServiceMethod",
">",
"methods",
"=",
"new",
"ArrayList",
"<>",
"(",
"service",
".",
"getMethodsIncludingExtended",
"(",
")",
")",
";",
"CServiceMethod",
"[",
"]",
"ma",
"=",
"me... | All methods that apply for the service.
@return The method array. | [
"All",
"methods",
"that",
"apply",
"for",
"the",
"service",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/utils/JService.java#L54-L63 | train |
morimekta/providence | providence-core/src/main/java/net/morimekta/providence/util/ProvidenceHelper.java | ProvidenceHelper.parseDebugString | @Nonnull
public static <Message extends PMessage<Message, Field>, Field extends PField>
Message parseDebugString(String string, PMessageDescriptor<Message, Field> descriptor) {
try {
ByteArrayInputStream bais = new ByteArrayInputStream(string.getBytes(UTF_8));
return DEBUG_STRING... | java | @Nonnull
public static <Message extends PMessage<Message, Field>, Field extends PField>
Message parseDebugString(String string, PMessageDescriptor<Message, Field> descriptor) {
try {
ByteArrayInputStream bais = new ByteArrayInputStream(string.getBytes(UTF_8));
return DEBUG_STRING... | [
"@",
"Nonnull",
"public",
"static",
"<",
"Message",
"extends",
"PMessage",
"<",
"Message",
",",
"Field",
">",
",",
"Field",
"extends",
"PField",
">",
"Message",
"parseDebugString",
"(",
"String",
"string",
",",
"PMessageDescriptor",
"<",
"Message",
",",
"Field... | Parses a pretty formatted string, and makes exceptions unchecked.
@param string The message string to parse.
@param descriptor The message descriptor.
@param <Message> The message type.
@param <Field> The message field type.
@return The parsed message. | [
"Parses",
"a",
"pretty",
"formatted",
"string",
"and",
"makes",
"exceptions",
"unchecked",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/util/ProvidenceHelper.java#L134-L143 | train |
morimekta/providence | providence-core/src/main/java/net/morimekta/providence/util/ProvidenceHelper.java | ProvidenceHelper.optionalInMessage | @SuppressWarnings("unchecked")
@Nonnull
public static <T> Optional<T> optionalInMessage(PMessage message, PField... fields) {
if (fields == null || fields.length == 0) {
throw new IllegalArgumentException("No fields arguments.");
}
PField field = fields[0];
if (!messa... | java | @SuppressWarnings("unchecked")
@Nonnull
public static <T> Optional<T> optionalInMessage(PMessage message, PField... fields) {
if (fields == null || fields.length == 0) {
throw new IllegalArgumentException("No fields arguments.");
}
PField field = fields[0];
if (!messa... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Nonnull",
"public",
"static",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"optionalInMessage",
"(",
"PMessage",
"message",
",",
"PField",
"...",
"fields",
")",
"{",
"if",
"(",
"fields",
"==",
"null",
... | Get a field value from a message with optional chaining. If the field is
not set, or any message in the chain leading up to the last message is
missing, it will return an empty optional. Otherwise the leaf field value.
Note that this will only check for MESSAGE type if the message is present
and needs to be looked up ... | [
"Get",
"a",
"field",
"value",
"from",
"a",
"message",
"with",
"optional",
"chaining",
".",
"If",
"the",
"field",
"is",
"not",
"set",
"or",
"any",
"message",
"in",
"the",
"chain",
"leading",
"up",
"to",
"the",
"last",
"message",
"is",
"missing",
"it",
"... | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/util/ProvidenceHelper.java#L158-L177 | train |
morimekta/providence | providence-core/src/main/java-gen/net/morimekta/providence/PApplicationException.java | PApplicationException.optionalMessage | @javax.annotation.Nonnull
public java.util.Optional<String> optionalMessage() {
return java.util.Optional.ofNullable(mMessage);
} | java | @javax.annotation.Nonnull
public java.util.Optional<String> optionalMessage() {
return java.util.Optional.ofNullable(mMessage);
} | [
"@",
"javax",
".",
"annotation",
".",
"Nonnull",
"public",
"java",
".",
"util",
".",
"Optional",
"<",
"String",
">",
"optionalMessage",
"(",
")",
"{",
"return",
"java",
".",
"util",
".",
"Optional",
".",
"ofNullable",
"(",
"mMessage",
")",
";",
"}"
] | Exception message.
@return Optional of the <code>message</code> field value. | [
"Exception",
"message",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java-gen/net/morimekta/providence/PApplicationException.java#L61-L64 | train |
morimekta/providence | providence-core/src/main/java-gen/net/morimekta/providence/PApplicationException.java | PApplicationException.optionalId | @javax.annotation.Nonnull
public java.util.Optional<net.morimekta.providence.PApplicationExceptionType> optionalId() {
return java.util.Optional.ofNullable(mId);
} | java | @javax.annotation.Nonnull
public java.util.Optional<net.morimekta.providence.PApplicationExceptionType> optionalId() {
return java.util.Optional.ofNullable(mId);
} | [
"@",
"javax",
".",
"annotation",
".",
"Nonnull",
"public",
"java",
".",
"util",
".",
"Optional",
"<",
"net",
".",
"morimekta",
".",
"providence",
".",
"PApplicationExceptionType",
">",
"optionalId",
"(",
")",
"{",
"return",
"java",
".",
"util",
".",
"Optio... | The application exception type.
@return Optional of the <code>id</code> field value. | [
"The",
"application",
"exception",
"type",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java-gen/net/morimekta/providence/PApplicationException.java#L84-L87 | train |
morimekta/providence | providence-reflect/src/main/java/net/morimekta/providence/reflect/contained/CService.java | CService.getMethodsIncludingExtended | public Collection<CServiceMethod> getMethodsIncludingExtended() {
CService extended = getExtendsService();
if (extended == null) {
return getMethods();
}
List<CServiceMethod> out = new ArrayList<>();
out.addAll(extended.getMethodsIncludingExtended());
out.addA... | java | public Collection<CServiceMethod> getMethodsIncludingExtended() {
CService extended = getExtendsService();
if (extended == null) {
return getMethods();
}
List<CServiceMethod> out = new ArrayList<>();
out.addAll(extended.getMethodsIncludingExtended());
out.addA... | [
"public",
"Collection",
"<",
"CServiceMethod",
">",
"getMethodsIncludingExtended",
"(",
")",
"{",
"CService",
"extended",
"=",
"getExtendsService",
"(",
")",
";",
"if",
"(",
"extended",
"==",
"null",
")",
"{",
"return",
"getMethods",
"(",
")",
";",
"}",
"Lis... | Get all methods including methods declared in extended services.
@return The list of service methods. | [
"Get",
"all",
"methods",
"including",
"methods",
"declared",
"in",
"extended",
"services",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-reflect/src/main/java/net/morimekta/providence/reflect/contained/CService.java#L86-L95 | train |
pawelprazak/java-extended | junit/src/main/java/com/bluecatcode/junit/rules/Rules.java | Rules.ignoreIfNotUnix | public static TestRule ignoreIfNotUnix() {
return (base, description) -> new Statement() {
@Override
public void evaluate() throws Throwable {
assumeIsUnix();
base.evaluate();
}
};
} | java | public static TestRule ignoreIfNotUnix() {
return (base, description) -> new Statement() {
@Override
public void evaluate() throws Throwable {
assumeIsUnix();
base.evaluate();
}
};
} | [
"public",
"static",
"TestRule",
"ignoreIfNotUnix",
"(",
")",
"{",
"return",
"(",
"base",
",",
"description",
")",
"->",
"new",
"Statement",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"evaluate",
"(",
")",
"throws",
"Throwable",
"{",
"assumeIsUnix",
... | Require Unix like operating system. | [
"Require",
"Unix",
"like",
"operating",
"system",
"."
] | ce1a556a95cbbf7c950a03662938bc02622de69b | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/junit/src/main/java/com/bluecatcode/junit/rules/Rules.java#L21-L29 | train |
morimekta/providence | providence-core/src/main/java/net/morimekta/providence/serializer/JsonSerializer.java | JsonSerializer.appendPrimitive | private void appendPrimitive(JsonWriter writer, Object primitive) throws SerializerException {
if (primitive instanceof PEnumValue) {
if (IdType.ID.equals(enumValueType)) {
writer.value(((PEnumValue<?>) primitive).asInteger());
} else {
writer.valueUnescap... | java | private void appendPrimitive(JsonWriter writer, Object primitive) throws SerializerException {
if (primitive instanceof PEnumValue) {
if (IdType.ID.equals(enumValueType)) {
writer.value(((PEnumValue<?>) primitive).asInteger());
} else {
writer.valueUnescap... | [
"private",
"void",
"appendPrimitive",
"(",
"JsonWriter",
"writer",
",",
"Object",
"primitive",
")",
"throws",
"SerializerException",
"{",
"if",
"(",
"primitive",
"instanceof",
"PEnumValue",
")",
"{",
"if",
"(",
"IdType",
".",
"ID",
".",
"equals",
"(",
"enumVal... | Append a primitive value to json struct.
@param writer The JSON writer.
@param primitive The primitive instance. | [
"Append",
"a",
"primitive",
"value",
"to",
"json",
"struct",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/serializer/JsonSerializer.java#L812-L839 | train |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/appender/FileAppender.java | FileAppender.getTimeFileName | String getTimeFileName() {
SimpleDateFormat dateFormat = new SimpleDateFormat(wraper.formatter);
return dateFormat.format(Calendar.getInstance().getTime());
} | java | String getTimeFileName() {
SimpleDateFormat dateFormat = new SimpleDateFormat(wraper.formatter);
return dateFormat.format(Calendar.getInstance().getTime());
} | [
"String",
"getTimeFileName",
"(",
")",
"{",
"SimpleDateFormat",
"dateFormat",
"=",
"new",
"SimpleDateFormat",
"(",
"wraper",
".",
"formatter",
")",
";",
"return",
"dateFormat",
".",
"format",
"(",
"Calendar",
".",
"getInstance",
"(",
")",
".",
"getTime",
"(",
... | get in parameters date formatted result without file extension.
@return | [
"get",
"in",
"parameters",
"date",
"formatted",
"result",
"without",
"file",
"extension",
"."
] | 229632528e63a424460a219decdaffcf75a9f4a4 | https://github.com/lisicnu/Log4Android/blob/229632528e63a424460a219decdaffcf75a9f4a4/src/main/java/com/github/lisicnu/log4android/appender/FileAppender.java#L393-L396 | train |
morimekta/providence | providence-core/src/main/java/net/morimekta/providence/streams/MessageStreams.java | MessageStreams.stream | @Nonnull
public static <Message extends PMessage<Message, Field>, Field extends PField>
Stream<Message> stream(InputStream in,
Serializer serializer,
PMessageDescriptor<Message, Field> descriptor) {
return StreamSupport.stream(new MessageSpliterator<... | java | @Nonnull
public static <Message extends PMessage<Message, Field>, Field extends PField>
Stream<Message> stream(InputStream in,
Serializer serializer,
PMessageDescriptor<Message, Field> descriptor) {
return StreamSupport.stream(new MessageSpliterator<... | [
"@",
"Nonnull",
"public",
"static",
"<",
"Message",
"extends",
"PMessage",
"<",
"Message",
",",
"Field",
">",
",",
"Field",
"extends",
"PField",
">",
"Stream",
"<",
"Message",
">",
"stream",
"(",
"InputStream",
"in",
",",
"Serializer",
"serializer",
",",
"... | Read a input stream containing entries of a given type.
@param in The input stream to read.
@param serializer The serializer to use.
@param descriptor The descriptor of the entry type of the file.
@param <Message> The message type.
@param <Field> The message field type.
@return The stream that reads the fi... | [
"Read",
"a",
"input",
"stream",
"containing",
"entries",
"of",
"a",
"given",
"type",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/streams/MessageStreams.java#L129-L135 | train |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/concurrent/Futures.java | Futures.futureWith | public static <T, R> Function<T, ListenableFuture<R>> futureWith(final ListeningExecutorService executor,
final Function<T, R> task,
final FutureCallback<R> callback) {
check... | java | public static <T, R> Function<T, ListenableFuture<R>> futureWith(final ListeningExecutorService executor,
final Function<T, R> task,
final FutureCallback<R> callback) {
check... | [
"public",
"static",
"<",
"T",
",",
"R",
">",
"Function",
"<",
"T",
",",
"ListenableFuture",
"<",
"R",
">",
">",
"futureWith",
"(",
"final",
"ListeningExecutorService",
"executor",
",",
"final",
"Function",
"<",
"T",
",",
"R",
">",
"task",
",",
"final",
... | Function submits the task with given executor and callback
@param executor the executor service to use
@param task the task to submit
@param callback the callback to call on completion
@param <T> the function input type
@param <R> the function future return type
@return future result of the <tt>task</tt>
@throws Illega... | [
"Function",
"submits",
"the",
"task",
"with",
"given",
"executor",
"and",
"callback"
] | ce1a556a95cbbf7c950a03662938bc02622de69b | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/concurrent/Futures.java#L28-L40 | train |
morimekta/providence | providence-core/src/main/java/net/morimekta/providence/util/LogFormatter.java | LogFormatter.formatTo | public <Message extends PMessage<Message, Field>, Field extends PField>
void formatTo(OutputStream out, Message message) {
IndentedPrintWriter builder = new IndentedPrintWriter(out, indent, newline);
if (message == null) {
builder.append(null);
} else {
builder.append... | java | public <Message extends PMessage<Message, Field>, Field extends PField>
void formatTo(OutputStream out, Message message) {
IndentedPrintWriter builder = new IndentedPrintWriter(out, indent, newline);
if (message == null) {
builder.append(null);
} else {
builder.append... | [
"public",
"<",
"Message",
"extends",
"PMessage",
"<",
"Message",
",",
"Field",
">",
",",
"Field",
"extends",
"PField",
">",
"void",
"formatTo",
"(",
"OutputStream",
"out",
",",
"Message",
"message",
")",
"{",
"IndentedPrintWriter",
"builder",
"=",
"new",
"In... | Format message and write to the output stream.
@param out The output stream to write to.
@param message The message to be written.
@param <Message> The message type.
@param <Field> The field type. | [
"Format",
"message",
"and",
"write",
"to",
"the",
"output",
"stream",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/util/LogFormatter.java#L116-L127 | train |
morimekta/providence | providence-core/src/main/java/net/morimekta/providence/util/LogFormatter.java | LogFormatter.format | public <Message extends PMessage<Message, Field>, Field extends PField>
String format(Message message) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
formatTo(out, message);
return new String(out.toByteArray(), StandardCharsets.UTF_8);
} | java | public <Message extends PMessage<Message, Field>, Field extends PField>
String format(Message message) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
formatTo(out, message);
return new String(out.toByteArray(), StandardCharsets.UTF_8);
} | [
"public",
"<",
"Message",
"extends",
"PMessage",
"<",
"Message",
",",
"Field",
">",
",",
"Field",
"extends",
"PField",
">",
"String",
"format",
"(",
"Message",
"message",
")",
"{",
"ByteArrayOutputStream",
"out",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
... | Format message to a string.
@param message The message to be written.
@param <Message> The message type.
@param <Field> The field type.
@return The formatted message. | [
"Format",
"message",
"to",
"a",
"string",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/util/LogFormatter.java#L137-L142 | train |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/security/KeyProvider.java | KeyProvider.getKey | public Key getKey(String alias, String password) {
try {
return keyStore.getKey(alias, password.toCharArray());
} catch (GeneralSecurityException e) {
throw new IllegalStateException(e);
}
} | java | public Key getKey(String alias, String password) {
try {
return keyStore.getKey(alias, password.toCharArray());
} catch (GeneralSecurityException e) {
throw new IllegalStateException(e);
}
} | [
"public",
"Key",
"getKey",
"(",
"String",
"alias",
",",
"String",
"password",
")",
"{",
"try",
"{",
"return",
"keyStore",
".",
"getKey",
"(",
"alias",
",",
"password",
".",
"toCharArray",
"(",
")",
")",
";",
"}",
"catch",
"(",
"GeneralSecurityException",
... | Gets a key from the key store
@param alias key alias
@param password key password
@return the key | [
"Gets",
"a",
"key",
"from",
"the",
"key",
"store"
] | ce1a556a95cbbf7c950a03662938bc02622de69b | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/security/KeyProvider.java#L41-L47 | train |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/security/KeyProvider.java | KeyProvider.getPrivateKey | public PrivateKey getPrivateKey(String alias, String password) {
Key key = getKey(alias, password);
if (key instanceof PrivateKey) {
return (PrivateKey) key;
} else {
throw new IllegalStateException(format("Key with alias '%s' was not a private key, but was: %s",
... | java | public PrivateKey getPrivateKey(String alias, String password) {
Key key = getKey(alias, password);
if (key instanceof PrivateKey) {
return (PrivateKey) key;
} else {
throw new IllegalStateException(format("Key with alias '%s' was not a private key, but was: %s",
... | [
"public",
"PrivateKey",
"getPrivateKey",
"(",
"String",
"alias",
",",
"String",
"password",
")",
"{",
"Key",
"key",
"=",
"getKey",
"(",
"alias",
",",
"password",
")",
";",
"if",
"(",
"key",
"instanceof",
"PrivateKey",
")",
"{",
"return",
"(",
"PrivateKey",... | Gets a asymmetric encryption private key from the key store
@param alias key alias
@param password key password
@return the private key | [
"Gets",
"a",
"asymmetric",
"encryption",
"private",
"key",
"from",
"the",
"key",
"store"
] | ce1a556a95cbbf7c950a03662938bc02622de69b | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/security/KeyProvider.java#L55-L63 | train |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/security/KeyProvider.java | KeyProvider.getSecretKey | public SecretKey getSecretKey(String alias, String password) {
Key key = getKey(alias, password);
if (key instanceof PrivateKey) {
return (SecretKey) key;
} else {
throw new IllegalStateException(format("Key with alias '%s' was not a secret key, but was: %s",
... | java | public SecretKey getSecretKey(String alias, String password) {
Key key = getKey(alias, password);
if (key instanceof PrivateKey) {
return (SecretKey) key;
} else {
throw new IllegalStateException(format("Key with alias '%s' was not a secret key, but was: %s",
... | [
"public",
"SecretKey",
"getSecretKey",
"(",
"String",
"alias",
",",
"String",
"password",
")",
"{",
"Key",
"key",
"=",
"getKey",
"(",
"alias",
",",
"password",
")",
";",
"if",
"(",
"key",
"instanceof",
"PrivateKey",
")",
"{",
"return",
"(",
"SecretKey",
... | Gets a symmetric encryption secret key from the key store
@param alias key alias
@param password key password
@return the secret key | [
"Gets",
"a",
"symmetric",
"encryption",
"secret",
"key",
"from",
"the",
"key",
"store"
] | ce1a556a95cbbf7c950a03662938bc02622de69b | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/security/KeyProvider.java#L71-L79 | train |
morimekta/providence | it-serialization/src/main/java/net/morimekta/providence/it/serialization/FormatStatistics.java | FormatStatistics.colorHeader | public static String colorHeader() {
return Color.BOLD +
HEADER_L1 + "\n" +
new Color(Color.YELLOW, Color.UNDERLINE) +
HEADER_L2 + " " +
Color.CLEAR;
} | java | public static String colorHeader() {
return Color.BOLD +
HEADER_L1 + "\n" +
new Color(Color.YELLOW, Color.UNDERLINE) +
HEADER_L2 + " " +
Color.CLEAR;
} | [
"public",
"static",
"String",
"colorHeader",
"(",
")",
"{",
"return",
"Color",
".",
"BOLD",
"+",
"HEADER_L1",
"+",
"\"\\n\"",
"+",
"new",
"Color",
"(",
"Color",
".",
"YELLOW",
",",
"Color",
".",
"UNDERLINE",
")",
"+",
"HEADER_L2",
"+",
"\" \"",
"+",
... | Header string that matches the asString output.
@return The asString header. | [
"Header",
"string",
"that",
"matches",
"the",
"asString",
"output",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/it-serialization/src/main/java/net/morimekta/providence/it/serialization/FormatStatistics.java#L94-L100 | train |
morimekta/providence | providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/messages/extras/HazelcastPortableMessageFormatter.java | HazelcastPortableMessageFormatter.appendFactoryId | private void appendFactoryId(JMessage<?> message) {
writer.appendln("@Override")
.appendln("public int getFactoryId() {")
.begin()
//TODO: The factory should be file unqiue. ID is struct unique so for id we want to define several constants.
// so for conte... | java | private void appendFactoryId(JMessage<?> message) {
writer.appendln("@Override")
.appendln("public int getFactoryId() {")
.begin()
//TODO: The factory should be file unqiue. ID is struct unique so for id we want to define several constants.
// so for conte... | [
"private",
"void",
"appendFactoryId",
"(",
"JMessage",
"<",
"?",
">",
"message",
")",
"{",
"writer",
".",
"appendln",
"(",
"\"@Override\"",
")",
".",
"appendln",
"(",
"\"public int getFactoryId() {\"",
")",
".",
"begin",
"(",
")",
"//TODO: The factory should be fi... | Method to append get factory id from hazelcast_portable.
@param message JMessage with the information.
<pre>
{@code
public int getFactoryId() {
return ContentCmsPortableFactory.FACTORY_ID;
}
}
</pre> | [
"Method",
"to",
"append",
"get",
"factory",
"id",
"from",
"hazelcast_portable",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/messages/extras/HazelcastPortableMessageFormatter.java#L109-L122 | train |
morimekta/providence | providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/messages/extras/HazelcastPortableMessageFormatter.java | HazelcastPortableMessageFormatter.appendClassId | private void appendClassId(JMessage<?> message) {
writer.appendln("@Override")
.appendln("public int getClassId() {")
.begin()
//TODO: Need to add method to create a constant for the description or struct here.
.formatln("return %s.%s;",
... | java | private void appendClassId(JMessage<?> message) {
writer.appendln("@Override")
.appendln("public int getClassId() {")
.begin()
//TODO: Need to add method to create a constant for the description or struct here.
.formatln("return %s.%s;",
... | [
"private",
"void",
"appendClassId",
"(",
"JMessage",
"<",
"?",
">",
"message",
")",
"{",
"writer",
".",
"appendln",
"(",
"\"@Override\"",
")",
".",
"appendln",
"(",
"\"public int getClassId() {\"",
")",
".",
"begin",
"(",
")",
"//TODO: Need to add method to create... | Method to append get class id from hazelcast_portable.
@param message JMessage with the information.
<pre>
{@code
public int getClassId() {
return ContentCmsPortableFactory.CREATE_CONTENT_ID;
}
}
</pre> | [
"Method",
"to",
"append",
"get",
"class",
"id",
"from",
"hazelcast_portable",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/messages/extras/HazelcastPortableMessageFormatter.java#L136-L147 | train |
morimekta/providence | providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/messages/extras/HazelcastPortableMessageFormatter.java | HazelcastPortableMessageFormatter.appendPortableWriter | private void appendPortableWriter(JMessage<?> message) {
writer.appendln("@Override")
.formatln("public void writePortable(%s %s) throws %s {",
PortableWriter.class.getName(),
PORTABLE_WRITER,
IOException.class.getName())
... | java | private void appendPortableWriter(JMessage<?> message) {
writer.appendln("@Override")
.formatln("public void writePortable(%s %s) throws %s {",
PortableWriter.class.getName(),
PORTABLE_WRITER,
IOException.class.getName())
... | [
"private",
"void",
"appendPortableWriter",
"(",
"JMessage",
"<",
"?",
">",
"message",
")",
"{",
"writer",
".",
"appendln",
"(",
"\"@Override\"",
")",
".",
"formatln",
"(",
"\"public void writePortable(%s %s) throws %s {\"",
",",
"PortableWriter",
".",
"class",
".",
... | Method to append writePortable from hazelcast_portable.
@param message JMessage with the information.
<pre>
{@code
public void writePortable(com.hazelcast.nio.serialization.PortableWriter portableWriter) throws java.io.IOException {
...
portableWriter.writeByteArray("__hzOptionalsForClassOptionalFields", optionals.toB... | [
"Method",
"to",
"append",
"writePortable",
"from",
"hazelcast_portable",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/messages/extras/HazelcastPortableMessageFormatter.java#L162-L192 | train |
morimekta/providence | providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/messages/extras/HazelcastPortableMessageFormatter.java | HazelcastPortableMessageFormatter.appendPortableReader | private void appendPortableReader(JMessage<?> message) {
writer.appendln("@Override")
.formatln("public void readPortable(%s %s) throws %s {",
PortableReader.class.getName(),
PORTABLE_READER,
IOException.class.getName())
... | java | private void appendPortableReader(JMessage<?> message) {
writer.appendln("@Override")
.formatln("public void readPortable(%s %s) throws %s {",
PortableReader.class.getName(),
PORTABLE_READER,
IOException.class.getName())
... | [
"private",
"void",
"appendPortableReader",
"(",
"JMessage",
"<",
"?",
">",
"message",
")",
"{",
"writer",
".",
"appendln",
"(",
"\"@Override\"",
")",
".",
"formatln",
"(",
"\"public void readPortable(%s %s) throws %s {\"",
",",
"PortableReader",
".",
"class",
".",
... | Method to append readPortable from hazelcast_portable.
@param message JMessage with the information.
<pre>
{@code
public void readPortable(com.hazelcast.nio.serialization.PortableReader portableReader) throws java.io.IOException {
java.util.BitSet __temp_optionals = java.util.BitSet.valueOf(portableReader.readByteArra... | [
"Method",
"to",
"append",
"readPortable",
"from",
"hazelcast_portable",
"."
] | 7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-generator-java/src/main/java/net/morimekta/providence/generator/format/java/messages/extras/HazelcastPortableMessageFormatter.java#L207-L236 | train |
isisaddons-legacy/isis-module-security | dom/src/main/java/org/isisaddons/module/security/dom/role/ApplicationRoleRepository.java | ApplicationRoleRepository.newRole | @Programmatic
public ApplicationRole newRole(
final String name,
final String description) {
ApplicationRole role = findByName(name);
if (role == null){
role = getApplicationRoleFactory().newApplicationRole();
role.setName(name);
role.setDe... | java | @Programmatic
public ApplicationRole newRole(
final String name,
final String description) {
ApplicationRole role = findByName(name);
if (role == null){
role = getApplicationRoleFactory().newApplicationRole();
role.setName(name);
role.setDe... | [
"@",
"Programmatic",
"public",
"ApplicationRole",
"newRole",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"description",
")",
"{",
"ApplicationRole",
"role",
"=",
"findByName",
"(",
"name",
")",
";",
"if",
"(",
"role",
"==",
"null",
")",
"{",
"r... | region > newRole | [
"region",
">",
"newRole"
] | a9deb1b003ba01e44c859085bd078be8df0c1863 | https://github.com/isisaddons-legacy/isis-module-security/blob/a9deb1b003ba01e44c859085bd078be8df0c1863/dom/src/main/java/org/isisaddons/module/security/dom/role/ApplicationRoleRepository.java#L74-L86 | train |
ltearno/hexa.tools | hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCProxy.java | RPCProxy.hangOut | private void hangOut( final RequestCallInfo req, GenericJSO hangOut )
{
final int hangOutId = hangOut.getIntByIdx( 0 );
JsArrayString tmp = hangOut.getGenericJSOByIdx( 1 ).cast();
String name = tmp.get( 0 );
String type = tmp.get( 1 );
String title = tmp.get( 2 );
String description = tmp.get( 3 );
Java... | java | private void hangOut( final RequestCallInfo req, GenericJSO hangOut )
{
final int hangOutId = hangOut.getIntByIdx( 0 );
JsArrayString tmp = hangOut.getGenericJSOByIdx( 1 ).cast();
String name = tmp.get( 0 );
String type = tmp.get( 1 );
String title = tmp.get( 2 );
String description = tmp.get( 3 );
Java... | [
"private",
"void",
"hangOut",
"(",
"final",
"RequestCallInfo",
"req",
",",
"GenericJSO",
"hangOut",
")",
"{",
"final",
"int",
"hangOutId",
"=",
"hangOut",
".",
"getIntByIdx",
"(",
"0",
")",
";",
"JsArrayString",
"tmp",
"=",
"hangOut",
".",
"getGenericJSOByIdx"... | over the network | [
"over",
"the",
"network"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCProxy.java#L217-L241 | train |
ltearno/hexa.tools | hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCProxy.java | RPCProxy.getBatchRequestSender | private RPCBatchRequestSender getBatchRequestSender()
{
RPCBatchRequestSender sender = null;
// test the last sender we have in the list
if( !batchRequestSenders.isEmpty() )
{
sender = batchRequestSenders.get( batchRequestSenders.size() - 1 );
if( sender.canAddRequest() )
return sender;
}
// ot... | java | private RPCBatchRequestSender getBatchRequestSender()
{
RPCBatchRequestSender sender = null;
// test the last sender we have in the list
if( !batchRequestSenders.isEmpty() )
{
sender = batchRequestSenders.get( batchRequestSenders.size() - 1 );
if( sender.canAddRequest() )
return sender;
}
// ot... | [
"private",
"RPCBatchRequestSender",
"getBatchRequestSender",
"(",
")",
"{",
"RPCBatchRequestSender",
"sender",
"=",
"null",
";",
"// test the last sender we have in the list",
"if",
"(",
"!",
"batchRequestSenders",
".",
"isEmpty",
"(",
")",
")",
"{",
"sender",
"=",
"b... | retrieve a batch request sender that is OK for adding requests | [
"retrieve",
"a",
"batch",
"request",
"sender",
"that",
"is",
"OK",
"for",
"adding",
"requests"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCProxy.java#L244-L262 | train |
Blazebit/blaze-utils | blaze-ee-utils/src/main/java/com/blazebit/validation/constraint/validator/CheckEitherValidator.java | CheckEitherValidator.addViolations | private Set<ConstraintViolation<Object>> addViolations(
Set<ConstraintViolation<Object>> source,
Set<ConstraintViolation<Object>> target) {
if (supportsConstraintComposition) {
target.addAll(source);
return target;
}
for (final Iterator<Constraint... | java | private Set<ConstraintViolation<Object>> addViolations(
Set<ConstraintViolation<Object>> source,
Set<ConstraintViolation<Object>> target) {
if (supportsConstraintComposition) {
target.addAll(source);
return target;
}
for (final Iterator<Constraint... | [
"private",
"Set",
"<",
"ConstraintViolation",
"<",
"Object",
">",
">",
"addViolations",
"(",
"Set",
"<",
"ConstraintViolation",
"<",
"Object",
">",
">",
"source",
",",
"Set",
"<",
"ConstraintViolation",
"<",
"Object",
">",
">",
"target",
")",
"{",
"if",
"(... | Add the given source violations to the target set and return the target
set. This method will skip violations that have a property path depth
greater than 1.
@param source
@param target
@return | [
"Add",
"the",
"given",
"source",
"violations",
"to",
"the",
"target",
"set",
"and",
"return",
"the",
"target",
"set",
".",
"This",
"method",
"will",
"skip",
"violations",
"that",
"have",
"a",
"property",
"path",
"depth",
"greater",
"than",
"1",
"."
] | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-ee-utils/src/main/java/com/blazebit/validation/constraint/validator/CheckEitherValidator.java#L86-L111 | train |
Blazebit/blaze-utils | blaze-ee-utils/src/main/java/com/blazebit/validation/constraint/validator/CheckEitherValidator.java | CheckEitherValidator.passViolations | private void passViolations(ConstraintValidatorContext context,
Set<ConstraintViolation<Object>> source) {
for (final ConstraintViolation<Object> violation : source) {
final Iterator<Node> nodeIter = violation.getPropertyPath()
.iterator();
... | java | private void passViolations(ConstraintValidatorContext context,
Set<ConstraintViolation<Object>> source) {
for (final ConstraintViolation<Object> violation : source) {
final Iterator<Node> nodeIter = violation.getPropertyPath()
.iterator();
... | [
"private",
"void",
"passViolations",
"(",
"ConstraintValidatorContext",
"context",
",",
"Set",
"<",
"ConstraintViolation",
"<",
"Object",
">",
">",
"source",
")",
"{",
"for",
"(",
"final",
"ConstraintViolation",
"<",
"Object",
">",
"violation",
":",
"source",
")... | Pass the given violations to the given context. This method will skip
violations that have a property path depth greater than 1.
@param context
@param source | [
"Pass",
"the",
"given",
"violations",
"to",
"the",
"given",
"context",
".",
"This",
"method",
"will",
"skip",
"violations",
"that",
"have",
"a",
"property",
"path",
"depth",
"greater",
"than",
"1",
"."
] | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-ee-utils/src/main/java/com/blazebit/validation/constraint/validator/CheckEitherValidator.java#L120-L144 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/datatable/ObjectCollectionManager.java | ObjectCollectionManager.editCell | private void editCell( Cell cell )
{
if( cell == null || cell == editedCell )
return;
T record = getRecordForRow( cell.getParentRow() );
if( record == null )
return;
registerCurrentEdition( cell, record );
} | java | private void editCell( Cell cell )
{
if( cell == null || cell == editedCell )
return;
T record = getRecordForRow( cell.getParentRow() );
if( record == null )
return;
registerCurrentEdition( cell, record );
} | [
"private",
"void",
"editCell",
"(",
"Cell",
"cell",
")",
"{",
"if",
"(",
"cell",
"==",
"null",
"||",
"cell",
"==",
"editedCell",
")",
"return",
";",
"T",
"record",
"=",
"getRecordForRow",
"(",
"cell",
".",
"getParentRow",
"(",
")",
")",
";",
"if",
"(... | Begin cell edition
@param cell | [
"Begin",
"cell",
"edition"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/datatable/ObjectCollectionManager.java#L262-L272 | train |
hawkular/hawkular-commons | hawkular-command-gateway/hawkular-command-gateway-api/src/main/java/org/hawkular/cmdgw/api/ApiDeserializer.java | ApiDeserializer.toHawkularFormat | public static String toHawkularFormat(BasicMessage msg) {
return String.format("%s=%s", msg.getClass().getSimpleName(), msg.toJSON());
} | java | public static String toHawkularFormat(BasicMessage msg) {
return String.format("%s=%s", msg.getClass().getSimpleName(), msg.toJSON());
} | [
"public",
"static",
"String",
"toHawkularFormat",
"(",
"BasicMessage",
"msg",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"%s=%s\"",
",",
"msg",
".",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
",",
"msg",
".",
"toJSON",
"(",
")",
")",
... | Returns a string that encodes the given object as a JSON message but then
prefixes that JSON with additional information that a Hawkular client will
need to be able to deserialize the JSON.
This string can be used to deserialize the object via {@link #deserialize(String)}.
@param msg the message object that will be s... | [
"Returns",
"a",
"string",
"that",
"encodes",
"the",
"given",
"object",
"as",
"a",
"JSON",
"message",
"but",
"then",
"prefixes",
"that",
"JSON",
"with",
"additional",
"information",
"that",
"a",
"Hawkular",
"client",
"will",
"need",
"to",
"be",
"able",
"to",
... | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-api/src/main/java/org/hawkular/cmdgw/api/ApiDeserializer.java#L45-L47 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/AbstractMessage.java | AbstractMessage.fromJSON | public static <T extends BasicMessage> T fromJSON(String json, Class<T> clazz) {
try {
Method buildObjectMapperForDeserializationMethod = findBuildObjectMapperForDeserializationMethod(clazz);
final ObjectMapper mapper = (ObjectMapper) buildObjectMapperForDeserializationMethod.invoke(nul... | java | public static <T extends BasicMessage> T fromJSON(String json, Class<T> clazz) {
try {
Method buildObjectMapperForDeserializationMethod = findBuildObjectMapperForDeserializationMethod(clazz);
final ObjectMapper mapper = (ObjectMapper) buildObjectMapperForDeserializationMethod.invoke(nul... | [
"public",
"static",
"<",
"T",
"extends",
"BasicMessage",
">",
"T",
"fromJSON",
"(",
"String",
"json",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"try",
"{",
"Method",
"buildObjectMapperForDeserializationMethod",
"=",
"findBuildObjectMapperForDeserializationMeth... | Convenience static method that converts a JSON string to a particular message object.
@param json the JSON string
@param clazz the class whose instance is represented by the JSON string
@return the message object that was represented by the JSON string | [
"Convenience",
"static",
"method",
"that",
"converts",
"a",
"JSON",
"string",
"to",
"a",
"particular",
"message",
"object",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/AbstractMessage.java#L66-L79 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/AbstractMessage.java | AbstractMessage.fromJSON | public static <T extends BasicMessage> BasicMessageWithExtraData<T> fromJSON(InputStream in, Class<T> clazz) {
final T obj;
final byte[] remainder;
try (JsonParser parser = new JsonFactory().configure(Feature.AUTO_CLOSE_SOURCE, false).createParser(in)) {
Method buildObjectMapperForDe... | java | public static <T extends BasicMessage> BasicMessageWithExtraData<T> fromJSON(InputStream in, Class<T> clazz) {
final T obj;
final byte[] remainder;
try (JsonParser parser = new JsonFactory().configure(Feature.AUTO_CLOSE_SOURCE, false).createParser(in)) {
Method buildObjectMapperForDe... | [
"public",
"static",
"<",
"T",
"extends",
"BasicMessage",
">",
"BasicMessageWithExtraData",
"<",
"T",
">",
"fromJSON",
"(",
"InputStream",
"in",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"final",
"T",
"obj",
";",
"final",
"byte",
"[",
"]",
"remainde... | Convenience static method that reads a JSON string from the given stream and converts the JSON
string to a particular message object. The input stream will remain open so the caller can
stream any extra data that might appear after it.
Because of the way the JSON parser works, some extra data might have been read from... | [
"Convenience",
"static",
"method",
"that",
"reads",
"a",
"JSON",
"string",
"from",
"the",
"given",
"stream",
"and",
"converts",
"the",
"JSON",
"string",
"to",
"a",
"particular",
"message",
"object",
".",
"The",
"input",
"stream",
"will",
"remain",
"open",
"s... | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/AbstractMessage.java#L99-L118 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/AbstractMessage.java | AbstractMessage.buildObjectMapperForDeserialization | protected static ObjectMapper buildObjectMapperForDeserialization() {
final ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return mapper;
} | java | protected static ObjectMapper buildObjectMapperForDeserialization() {
final ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return mapper;
} | [
"protected",
"static",
"ObjectMapper",
"buildObjectMapperForDeserialization",
"(",
")",
"{",
"final",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"mapper",
".",
"configure",
"(",
"DeserializationFeature",
".",
"FAIL_ON_UNKNOWN_PROPERTIES",
",",
... | This is static, so really there is no true overriding it in subclasses.
However, fromJSON will do the proper reflection in order to invoke
the proper method for the class that is being deserialized. So subclasses
that want to provide their own ObjectMapper will define their own
method that matches the signature of this... | [
"This",
"is",
"static",
"so",
"really",
"there",
"is",
"no",
"true",
"overriding",
"it",
"in",
"subclasses",
".",
"However",
"fromJSON",
"will",
"do",
"the",
"proper",
"reflection",
"in",
"order",
"to",
"invoke",
"the",
"proper",
"method",
"for",
"the",
"c... | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/AbstractMessage.java#L140-L144 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/AbstractMessage.java | AbstractMessage.toJSON | @Override
public String toJSON() {
final ObjectMapper mapper = buildObjectMapperForSerialization();
try {
return mapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
throw new IllegalStateException("Object cannot be parsed as JSON.", e);
}
... | java | @Override
public String toJSON() {
final ObjectMapper mapper = buildObjectMapperForSerialization();
try {
return mapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
throw new IllegalStateException("Object cannot be parsed as JSON.", e);
}
... | [
"@",
"Override",
"public",
"String",
"toJSON",
"(",
")",
"{",
"final",
"ObjectMapper",
"mapper",
"=",
"buildObjectMapperForSerialization",
"(",
")",
";",
"try",
"{",
"return",
"mapper",
".",
"writeValueAsString",
"(",
"this",
")",
";",
"}",
"catch",
"(",
"Js... | Converts this message to its JSON string representation.
@return JSON encoded data that represents this message. | [
"Converts",
"this",
"message",
"to",
"its",
"JSON",
"string",
"representation",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/AbstractMessage.java#L151-L159 | train |
ltearno/hexa.tools | hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/CachedServerComm.java | CachedServerComm.onResponse | @Override
public void onResponse( Object cookie, ResponseJSO response, int msgLevel, String msg )
{
PendingRequestInfo info = (PendingRequestInfo) cookie;
// Store answer in cache
if( info.fStoreResultInCache )
cache.put( info.requestKey, response );
// give the result to all the subscribees
for( Reque... | java | @Override
public void onResponse( Object cookie, ResponseJSO response, int msgLevel, String msg )
{
PendingRequestInfo info = (PendingRequestInfo) cookie;
// Store answer in cache
if( info.fStoreResultInCache )
cache.put( info.requestKey, response );
// give the result to all the subscribees
for( Reque... | [
"@",
"Override",
"public",
"void",
"onResponse",
"(",
"Object",
"cookie",
",",
"ResponseJSO",
"response",
",",
"int",
"msgLevel",
",",
"String",
"msg",
")",
"{",
"PendingRequestInfo",
"info",
"=",
"(",
"PendingRequestInfo",
")",
"cookie",
";",
"// Store answer i... | receives the answer from the ServerComm object | [
"receives",
"the",
"answer",
"from",
"the",
"ServerComm",
"object"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/CachedServerComm.java#L110-L128 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/server/database/DatabaseSchema.java | DatabaseSchema.dumpDatabaseSchemaToFile | public static boolean dumpDatabaseSchemaToFile( DatabaseContext ctx, File file )
{
log.info( "Dumping database schema to file " + file.getAbsolutePath() );
DatabaseDescriptionInspector inspector = new DatabaseDescriptionInspector();
DatabaseDescription dbDesc = inspector.getDatabaseDescription( ctx.db, ctx.dbh ... | java | public static boolean dumpDatabaseSchemaToFile( DatabaseContext ctx, File file )
{
log.info( "Dumping database schema to file " + file.getAbsolutePath() );
DatabaseDescriptionInspector inspector = new DatabaseDescriptionInspector();
DatabaseDescription dbDesc = inspector.getDatabaseDescription( ctx.db, ctx.dbh ... | [
"public",
"static",
"boolean",
"dumpDatabaseSchemaToFile",
"(",
"DatabaseContext",
"ctx",
",",
"File",
"file",
")",
"{",
"log",
".",
"info",
"(",
"\"Dumping database schema to file \"",
"+",
"file",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"DatabaseDescriptionIns... | Writes the current database schema to a file, in JSON format.
This file can be used to update another database.
@param ctx Database context
@param file File to be written
@return <code>true</code> if successful | [
"Writes",
"the",
"current",
"database",
"schema",
"to",
"a",
"file",
"in",
"JSON",
"format",
".",
"This",
"file",
"can",
"be",
"used",
"to",
"update",
"another",
"database",
"."
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/server/database/DatabaseSchema.java#L106-L130 | train |
ltearno/hexa.tools | hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/PropertyChangesStatistics.java | PropertyChangesStatistics.getStatistics | String getStatistics()
{
String msg = "PropertyChanges stats :\r\n"
+ "# registered handlers : " + nbRegisteredHandlers + "\r\n"
+ "# notifications : " + nbNotifications + "\r\n"
+ "# dispatches : " + nbDispatches + "\r\n";
StringBuilder details = new StringBuilder();
for( Entry<Str... | java | String getStatistics()
{
String msg = "PropertyChanges stats :\r\n"
+ "# registered handlers : " + nbRegisteredHandlers + "\r\n"
+ "# notifications : " + nbNotifications + "\r\n"
+ "# dispatches : " + nbDispatches + "\r\n";
StringBuilder details = new StringBuilder();
for( Entry<Str... | [
"String",
"getStatistics",
"(",
")",
"{",
"String",
"msg",
"=",
"\"PropertyChanges stats :\\r\\n\"",
"+",
"\"# registered handlers : \"",
"+",
"nbRegisteredHandlers",
"+",
"\"\\r\\n\"",
"+",
"\"# notifications : \"",
"+",
"nbNotifications",
"+",
"\"\\r\\n\"",
"+",
"... | Show an alert containing useful information for debugging. It also
shows how many registrations happened since last call ; that's useful
to detect registration leaks. | [
"Show",
"an",
"alert",
"containing",
"useful",
"information",
"for",
"debugging",
".",
"It",
"also",
"shows",
"how",
"many",
"registrations",
"happened",
"since",
"last",
"call",
";",
"that",
"s",
"useful",
"to",
"detect",
"registration",
"leaks",
"."
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/PropertyChangesStatistics.java#L21-L43 | train |
ltearno/hexa.tools | hexa.spring/src/main/java/fr/lteconsulting/hexa/server/spring/HexaSpring.java | HexaSpring.manageTransaction | public <T> T manageTransaction( DatabaseContext ctx, TransactionManagedAction<T> action )
{
ctx.db.startTransaction();
try
{
T result = action.execute( ctx );
ctx.db.commit();
return result;
}
catch( Exception exception )
{
ctx.db.rollback();
throw new ManagedTransactionException( "Except... | java | public <T> T manageTransaction( DatabaseContext ctx, TransactionManagedAction<T> action )
{
ctx.db.startTransaction();
try
{
T result = action.execute( ctx );
ctx.db.commit();
return result;
}
catch( Exception exception )
{
ctx.db.rollback();
throw new ManagedTransactionException( "Except... | [
"public",
"<",
"T",
">",
"T",
"manageTransaction",
"(",
"DatabaseContext",
"ctx",
",",
"TransactionManagedAction",
"<",
"T",
">",
"action",
")",
"{",
"ctx",
".",
"db",
".",
"startTransaction",
"(",
")",
";",
"try",
"{",
"T",
"result",
"=",
"action",
".",... | it everything goes fine, commit | [
"it",
"everything",
"goes",
"fine",
"commit"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.spring/src/main/java/fr/lteconsulting/hexa/server/spring/HexaSpring.java#L157-L174 | train |
ltearno/hexa.tools | hexa.spring/src/main/java/fr/lteconsulting/hexa/server/spring/HexaSpring.java | HexaSpring.dbFactory | public synchronized DatabaseContextFactory dbFactory( String databaseUri )
{
DatabaseContextFactory factory = new DatabaseContextFactory();
if( ! factory.init( databaseUri ) )
{
log.error( "Cannot initialize database connection pool, it won't be available to the program !" );
return null;
}
return f... | java | public synchronized DatabaseContextFactory dbFactory( String databaseUri )
{
DatabaseContextFactory factory = new DatabaseContextFactory();
if( ! factory.init( databaseUri ) )
{
log.error( "Cannot initialize database connection pool, it won't be available to the program !" );
return null;
}
return f... | [
"public",
"synchronized",
"DatabaseContextFactory",
"dbFactory",
"(",
"String",
"databaseUri",
")",
"{",
"DatabaseContextFactory",
"factory",
"=",
"new",
"DatabaseContextFactory",
"(",
")",
";",
"if",
"(",
"!",
"factory",
".",
"init",
"(",
"databaseUri",
")",
")",... | handles the database connection creation | [
"handles",
"the",
"database",
"connection",
"creation"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.spring/src/main/java/fr/lteconsulting/hexa/server/spring/HexaSpring.java#L196-L206 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/exception/ExceptionUtils.java | ExceptionUtils.getCause | public static Throwable getCause(Throwable e, Class<? extends Throwable>... causes) {
if ((e == null) || (causes == null) || (causes.length < 1)) {
return null;
} else if (isInstance(e, causes)) {
if (((e.getCause() == null) || (e.getCause()
.equals(e) ||... | java | public static Throwable getCause(Throwable e, Class<? extends Throwable>... causes) {
if ((e == null) || (causes == null) || (causes.length < 1)) {
return null;
} else if (isInstance(e, causes)) {
if (((e.getCause() == null) || (e.getCause()
.equals(e) ||... | [
"public",
"static",
"Throwable",
"getCause",
"(",
"Throwable",
"e",
",",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"...",
"causes",
")",
"{",
"if",
"(",
"(",
"e",
"==",
"null",
")",
"||",
"(",
"causes",
"==",
"null",
")",
"||",
"(",
"causes",
... | Gets the cause which are one of the given expected causes. This method is
useful when you have to find a cause within unexpected or unpredictable
exception wrappings.
@param e the exception instance to search the cause on
@param causes the causes which are searched.
@return the found cause, where the first occurr... | [
"Gets",
"the",
"cause",
"which",
"are",
"one",
"of",
"the",
"given",
"expected",
"causes",
".",
"This",
"method",
"is",
"useful",
"when",
"you",
"have",
"to",
"find",
"a",
"cause",
"within",
"unexpected",
"or",
"unpredictable",
"exception",
"wrappings",
"."
... | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/exception/ExceptionUtils.java#L124-L141 | train |
byoutline/AndroidStubServer | src/main/java/com/byoutline/androidstubserver/AndroidStubServer.java | AndroidStubServer.start | public static HttpMockServer start(ConfigReader configReader, NetworkType networkType) {
return HttpMockServer.startMockApiServer(configReader, networkType);
} | java | public static HttpMockServer start(ConfigReader configReader, NetworkType networkType) {
return HttpMockServer.startMockApiServer(configReader, networkType);
} | [
"public",
"static",
"HttpMockServer",
"start",
"(",
"ConfigReader",
"configReader",
",",
"NetworkType",
"networkType",
")",
"{",
"return",
"HttpMockServer",
".",
"startMockApiServer",
"(",
"configReader",
",",
"networkType",
")",
";",
"}"
] | Starts local HTTP server.
@param configReader reader that provides access to responses configuration, responses and static files
@param networkType network type to be simulated by adding extra delays. | [
"Starts",
"local",
"HTTP",
"server",
"."
] | 292cbc52bd06dbcd7ad18087885e605eadf064bd | https://github.com/byoutline/AndroidStubServer/blob/292cbc52bd06dbcd7ad18087885e605eadf064bd/src/main/java/com/byoutline/androidstubserver/AndroidStubServer.java#L37-L39 | train |
Blazebit/blaze-utils | blaze-ee-utils/src/main/java/com/blazebit/cdi/CdiUtils.java | CdiUtils.getBean | @SuppressWarnings("unchecked")
public static <T> T getBean(String name) {
BeanManager bm = getBeanManager();
Bean<?> bean = bm.getBeans(name).iterator().next();
CreationalContext<?> ctx = bm.createCreationalContext(bean);
return (T) bm.getReference(bean, bean.getBeanClass(), ctx);
... | java | @SuppressWarnings("unchecked")
public static <T> T getBean(String name) {
BeanManager bm = getBeanManager();
Bean<?> bean = bm.getBeans(name).iterator().next();
CreationalContext<?> ctx = bm.createCreationalContext(bean);
return (T) bm.getReference(bean, bean.getBeanClass(), ctx);
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getBean",
"(",
"String",
"name",
")",
"{",
"BeanManager",
"bm",
"=",
"getBeanManager",
"(",
")",
";",
"Bean",
"<",
"?",
">",
"bean",
"=",
"bm",
".",
"getBeans"... | Retrieves the instance for a named bean by the given name
@param name The name of the bean to look for
@return The found bean object if found, otherwise null | [
"Retrieves",
"the",
"instance",
"for",
"a",
"named",
"bean",
"by",
"the",
"given",
"name"
] | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-ee-utils/src/main/java/com/blazebit/cdi/CdiUtils.java#L51-L57 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/common/HexaDate.java | HexaDate.toInt | public int toInt()
{
int day = ((year + 1900) * 12 + month) * 31 + (date - 1);
if( day < TIME_BEGIN )
day = TIME_BEGIN;
else if( day > TIME_END )
day = TIME_END;
return day;
} | java | public int toInt()
{
int day = ((year + 1900) * 12 + month) * 31 + (date - 1);
if( day < TIME_BEGIN )
day = TIME_BEGIN;
else if( day > TIME_END )
day = TIME_END;
return day;
} | [
"public",
"int",
"toInt",
"(",
")",
"{",
"int",
"day",
"=",
"(",
"(",
"year",
"+",
"1900",
")",
"*",
"12",
"+",
"month",
")",
"*",
"31",
"+",
"(",
"date",
"-",
"1",
")",
";",
"if",
"(",
"day",
"<",
"TIME_BEGIN",
")",
"day",
"=",
"TIME_BEGIN",... | encodes the date into an int | [
"encodes",
"the",
"date",
"into",
"an",
"int"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/common/HexaDate.java#L272-L282 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/chart/raphael/ShapeCollection.java | ShapeCollection.indexOf | public int indexOf( Widget w )
{
for( int i = 0; i < size; ++i )
{
if( array[i] == w )
{
return i;
}
}
return -1;
} | java | public int indexOf( Widget w )
{
for( int i = 0; i < size; ++i )
{
if( array[i] == w )
{
return i;
}
}
return -1;
} | [
"public",
"int",
"indexOf",
"(",
"Widget",
"w",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"++",
"i",
")",
"{",
"if",
"(",
"array",
"[",
"i",
"]",
"==",
"w",
")",
"{",
"return",
"i",
";",
"}",
"}",
"return",
"... | Gets the index of the specified index.
@param w
the widget to be found
@return the index of the specified widget, or <code>-1</code> if it is
not found | [
"Gets",
"the",
"index",
"of",
"the",
"specified",
"index",
"."
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/chart/raphael/ShapeCollection.java#L123-L134 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/chart/raphael/ShapeCollection.java | ShapeCollection.insert | public void insert( Shape w, int beforeIndex )
{
if( (beforeIndex < 0) || (beforeIndex > size) )
{
throw new IndexOutOfBoundsException();
}
// Realloc array if necessary (doubling).
if( size == array.length )
{
Shape[] newArray = new Shape[array.length * 2];
for( int i = 0; i < array.length; ++i ... | java | public void insert( Shape w, int beforeIndex )
{
if( (beforeIndex < 0) || (beforeIndex > size) )
{
throw new IndexOutOfBoundsException();
}
// Realloc array if necessary (doubling).
if( size == array.length )
{
Shape[] newArray = new Shape[array.length * 2];
for( int i = 0; i < array.length; ++i ... | [
"public",
"void",
"insert",
"(",
"Shape",
"w",
",",
"int",
"beforeIndex",
")",
"{",
"if",
"(",
"(",
"beforeIndex",
"<",
"0",
")",
"||",
"(",
"beforeIndex",
">",
"size",
")",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"... | Inserts a widget before the specified index.
@param w
the widget to be inserted
@param beforeIndex
the index before which the widget will be inserted
@throws IndexOutOfBoundsException
if <code>beforeIndex</code> is out of range | [
"Inserts",
"a",
"widget",
"before",
"the",
"specified",
"index",
"."
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/chart/raphael/ShapeCollection.java#L146-L173 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/chart/raphael/ShapeCollection.java | ShapeCollection.remove | public void remove( int index )
{
if( (index < 0) || (index >= size) )
{
throw new IndexOutOfBoundsException();
}
--size;
for( int i = index; i < size; ++i )
{
array[i] = array[i + 1];
}
array[size] = null;
} | java | public void remove( int index )
{
if( (index < 0) || (index >= size) )
{
throw new IndexOutOfBoundsException();
}
--size;
for( int i = index; i < size; ++i )
{
array[i] = array[i + 1];
}
array[size] = null;
} | [
"public",
"void",
"remove",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"(",
"index",
"<",
"0",
")",
"||",
"(",
"index",
">=",
"size",
")",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"}",
"--",
"size",
";",
"for",
"(",
"i... | Removes the widget at the specified index.
@param index
the index of the widget to be removed
@throws IndexOutOfBoundsException
if <code>index</code> is out of range | [
"Removes",
"the",
"widget",
"at",
"the",
"specified",
"index",
"."
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/chart/raphael/ShapeCollection.java#L194-L208 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.