id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
41,600 | aoindustries/aocode-public | src/main/java/com/aoindustries/util/SortedArrayList.java | SortedArrayList.binarySearchHashCode | protected int binarySearchHashCode(int elemHash) {
int left = 0;
int right = size()-1;
while(left <= right) {
int mid = (left + right)>>1;
int midHash = get(mid).hashCode();
if(elemHash==midHash) return mid;
if(elemHash<midHash) right = mid-1;
else left = mid+1;
}
return -(left+1);
} | java | protected int binarySearchHashCode(int elemHash) {
int left = 0;
int right = size()-1;
while(left <= right) {
int mid = (left + right)>>1;
int midHash = get(mid).hashCode();
if(elemHash==midHash) return mid;
if(elemHash<midHash) right = mid-1;
else left = mid+1;
}
return -(left+1);
} | [
"protected",
"int",
"binarySearchHashCode",
"(",
"int",
"elemHash",
")",
"{",
"int",
"left",
"=",
"0",
";",
"int",
"right",
"=",
"size",
"(",
")",
"-",
"1",
";",
"while",
"(",
"left",
"<=",
"right",
")",
"{",
"int",
"mid",
"=",
"(",
"left",
"+",
... | Performs a binary search on hashCode values only.
It will return any matching element, not necessarily
the first or the last. | [
"Performs",
"a",
"binary",
"search",
"on",
"hashCode",
"values",
"only",
".",
"It",
"will",
"return",
"any",
"matching",
"element",
"not",
"necessarily",
"the",
"first",
"or",
"the",
"last",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/SortedArrayList.java#L62-L73 |
41,601 | aoindustries/aocode-public | src/main/java/com/aoindustries/util/SortedArrayList.java | SortedArrayList.indexOf | public int indexOf(int hashCode) {
int pos=binarySearchHashCode(hashCode);
if(pos<0) return -1;
// Try backwards until different hashCode
while(pos>0 && get(pos-1).hashCode()==hashCode) pos--;
return pos;
} | java | public int indexOf(int hashCode) {
int pos=binarySearchHashCode(hashCode);
if(pos<0) return -1;
// Try backwards until different hashCode
while(pos>0 && get(pos-1).hashCode()==hashCode) pos--;
return pos;
} | [
"public",
"int",
"indexOf",
"(",
"int",
"hashCode",
")",
"{",
"int",
"pos",
"=",
"binarySearchHashCode",
"(",
"hashCode",
")",
";",
"if",
"(",
"pos",
"<",
"0",
")",
"return",
"-",
"1",
";",
"// Try backwards until different hashCode",
"while",
"(",
"pos",
... | Finds the first index where the object has the provided hashCode | [
"Finds",
"the",
"first",
"index",
"where",
"the",
"object",
"has",
"the",
"provided",
"hashCode"
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/SortedArrayList.java#L124-L131 |
41,602 | aoindustries/aocode-public | src/main/java/com/aoindustries/util/SortedArrayList.java | SortedArrayList.add | @Override
public boolean add(E o) {
// Shortcut for empty
int size=size();
if(size==0) {
super.add(o);
} else {
int Ohash=o.hashCode();
// Shortcut for adding to end (makes imports of already-sorted data operate at constant-time instead of logarithmic complexity)
if(Ohash>=get(size-1).hashCode()) ... | java | @Override
public boolean add(E o) {
// Shortcut for empty
int size=size();
if(size==0) {
super.add(o);
} else {
int Ohash=o.hashCode();
// Shortcut for adding to end (makes imports of already-sorted data operate at constant-time instead of logarithmic complexity)
if(Ohash>=get(size-1).hashCode()) ... | [
"@",
"Override",
"public",
"boolean",
"add",
"(",
"E",
"o",
")",
"{",
"// Shortcut for empty",
"int",
"size",
"=",
"size",
"(",
")",
";",
"if",
"(",
"size",
"==",
"0",
")",
"{",
"super",
".",
"add",
"(",
"o",
")",
";",
"}",
"else",
"{",
"int",
... | Adds the specified element in sorted position within this list. When
two elements have the same hashCode, the new item is added at the end
of the list of matching hashCodes.
@param o element to be appended to this list.
@return <tt>true</tt> (as per the general contract of Collection.add). | [
"Adds",
"the",
"specified",
"element",
"in",
"sorted",
"position",
"within",
"this",
"list",
".",
"When",
"two",
"elements",
"have",
"the",
"same",
"hashCode",
"the",
"new",
"item",
"is",
"added",
"at",
"the",
"end",
"of",
"the",
"list",
"of",
"matching",
... | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/SortedArrayList.java#L194-L220 |
41,603 | aoindustries/aocode-public | src/main/java/com/aoindustries/net/UnmodifiableHttpParameters.java | UnmodifiableHttpParameters.wrap | public static HttpParameters wrap(HttpParameters wrapped) {
// null remains null
if(wrapped == null) return null;
// Empty are unmodifiable
if(wrapped == EmptyParameters.getInstance()) return wrapped;
// ServletRequest parameters are unmodifiable already
if(wrapped instanceof ServletRequestParameters) retur... | java | public static HttpParameters wrap(HttpParameters wrapped) {
// null remains null
if(wrapped == null) return null;
// Empty are unmodifiable
if(wrapped == EmptyParameters.getInstance()) return wrapped;
// ServletRequest parameters are unmodifiable already
if(wrapped instanceof ServletRequestParameters) retur... | [
"public",
"static",
"HttpParameters",
"wrap",
"(",
"HttpParameters",
"wrapped",
")",
"{",
"// null remains null",
"if",
"(",
"wrapped",
"==",
"null",
")",
"return",
"null",
";",
"// Empty are unmodifiable",
"if",
"(",
"wrapped",
"==",
"EmptyParameters",
".",
"getI... | Wraps the given parameters to ensure they are unmodifiable.
@return {@code null} when wrapped is {@code null}, otherwise unmodifiable parameters | [
"Wraps",
"the",
"given",
"parameters",
"to",
"ensure",
"they",
"are",
"unmodifiable",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/net/UnmodifiableHttpParameters.java#L44-L55 |
41,604 | aoindustries/semanticcms-news-servlet | src/main/java/com/semanticcms/news/servlet/RssUtils.java | RssUtils.isRssEnabled | public static boolean isRssEnabled(ServletContext servletContext) {
// Note: no locking performed since it's ok for two threads to do the work concurrently at first
Boolean isRssEnabled = (Boolean)servletContext.getAttribute(ISS_RSS_ENABLED_CACHE_KEY);
if(isRssEnabled == null) {
try {
Class.forName(RSS_SER... | java | public static boolean isRssEnabled(ServletContext servletContext) {
// Note: no locking performed since it's ok for two threads to do the work concurrently at first
Boolean isRssEnabled = (Boolean)servletContext.getAttribute(ISS_RSS_ENABLED_CACHE_KEY);
if(isRssEnabled == null) {
try {
Class.forName(RSS_SER... | [
"public",
"static",
"boolean",
"isRssEnabled",
"(",
"ServletContext",
"servletContext",
")",
"{",
"// Note: no locking performed since it's ok for two threads to do the work concurrently at first",
"Boolean",
"isRssEnabled",
"=",
"(",
"Boolean",
")",
"servletContext",
".",
"getAt... | Checks if the RSS module is installed. This is done by checking for the existence of the
servlet class. This is cached in application scope to avoid throwing and catching ClassNotFoundException
repeatedly. | [
"Checks",
"if",
"the",
"RSS",
"module",
"is",
"installed",
".",
"This",
"is",
"done",
"by",
"checking",
"for",
"the",
"existence",
"of",
"the",
"servlet",
"class",
".",
"This",
"is",
"cached",
"in",
"application",
"scope",
"to",
"avoid",
"throwing",
"and",... | 3899c14fedffb4decc7be3e1560930e82cb5c933 | https://github.com/aoindustries/semanticcms-news-servlet/blob/3899c14fedffb4decc7be3e1560930e82cb5c933/src/main/java/com/semanticcms/news/servlet/RssUtils.java#L51-L64 |
41,605 | aoindustries/semanticcms-news-servlet | src/main/java/com/semanticcms/news/servlet/RssUtils.java | RssUtils.isProtectedExtension | public static boolean isProtectedExtension(String path) {
for(String extension : PROTECTED_EXTENSIONS) {
if(path.endsWith(extension)) return true;
}
return false;
} | java | public static boolean isProtectedExtension(String path) {
for(String extension : PROTECTED_EXTENSIONS) {
if(path.endsWith(extension)) return true;
}
return false;
} | [
"public",
"static",
"boolean",
"isProtectedExtension",
"(",
"String",
"path",
")",
"{",
"for",
"(",
"String",
"extension",
":",
"PROTECTED_EXTENSIONS",
")",
"{",
"if",
"(",
"path",
".",
"endsWith",
"(",
"extension",
")",
")",
"return",
"true",
";",
"}",
"r... | Checks that the given resource should not be included under any circumstances. | [
"Checks",
"that",
"the",
"given",
"resource",
"should",
"not",
"be",
"included",
"under",
"any",
"circumstances",
"."
] | 3899c14fedffb4decc7be3e1560930e82cb5c933 | https://github.com/aoindustries/semanticcms-news-servlet/blob/3899c14fedffb4decc7be3e1560930e82cb5c933/src/main/java/com/semanticcms/news/servlet/RssUtils.java#L91-L96 |
41,606 | aoindustries/semanticcms-news-servlet | src/main/java/com/semanticcms/news/servlet/RssUtils.java | RssUtils.getRssServletPath | public static String getRssServletPath(PageRef pageRef) {
String servletPath = pageRef.getBookRef().getPrefix() + pageRef.getPath();
for(String extension : RESOURCE_EXTENSIONS) {
if(servletPath.endsWith(extension)) {
servletPath = servletPath.substring(0, servletPath.length() - extension.length());
break... | java | public static String getRssServletPath(PageRef pageRef) {
String servletPath = pageRef.getBookRef().getPrefix() + pageRef.getPath();
for(String extension : RESOURCE_EXTENSIONS) {
if(servletPath.endsWith(extension)) {
servletPath = servletPath.substring(0, servletPath.length() - extension.length());
break... | [
"public",
"static",
"String",
"getRssServletPath",
"(",
"PageRef",
"pageRef",
")",
"{",
"String",
"servletPath",
"=",
"pageRef",
".",
"getBookRef",
"(",
")",
".",
"getPrefix",
"(",
")",
"+",
"pageRef",
".",
"getPath",
"(",
")",
";",
"for",
"(",
"String",
... | Gets the servletPath to the RSS feed for the give page ref. | [
"Gets",
"the",
"servletPath",
"to",
"the",
"RSS",
"feed",
"for",
"the",
"give",
"page",
"ref",
"."
] | 3899c14fedffb4decc7be3e1560930e82cb5c933 | https://github.com/aoindustries/semanticcms-news-servlet/blob/3899c14fedffb4decc7be3e1560930e82cb5c933/src/main/java/com/semanticcms/news/servlet/RssUtils.java#L101-L110 |
41,607 | aoindustries/semanticcms-core-model | src/main/java/com/semanticcms/core/model/BookRef.java | BookRef.compareTo | public int compareTo(BookRef o) {
int diff = domain.compareTo(o.domain);
if(diff != 0) return diff;
return path.compareTo(o.path);
} | java | public int compareTo(BookRef o) {
int diff = domain.compareTo(o.domain);
if(diff != 0) return diff;
return path.compareTo(o.path);
} | [
"public",
"int",
"compareTo",
"(",
"BookRef",
"o",
")",
"{",
"int",
"diff",
"=",
"domain",
".",
"compareTo",
"(",
"o",
".",
"domain",
")",
";",
"if",
"(",
"diff",
"!=",
"0",
")",
"return",
"diff",
";",
"return",
"path",
".",
"compareTo",
"(",
"o",
... | Ordered by domain, path. | [
"Ordered",
"by",
"domain",
"path",
"."
] | 14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624 | https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/BookRef.java#L96-L100 |
41,608 | nlalevee/jsourcemap | jsourcemap/src/java/org/hibnet/jsourcemap/IndexedSourceMapConsumer.java | IndexedSourceMapConsumer.sources | @Override
public List<String> sources() {
List<String> sources = new ArrayList<>();
for (int i = 0; i < this._sections.size(); i++) {
for (int j = 0; j < this._sections.get(i).consumer.sources().size(); j++) {
sources.add(this._sections.get(i).consumer.sources().get(j));
... | java | @Override
public List<String> sources() {
List<String> sources = new ArrayList<>();
for (int i = 0; i < this._sections.size(); i++) {
for (int j = 0; j < this._sections.get(i).consumer.sources().size(); j++) {
sources.add(this._sections.get(i).consumer.sources().get(j));
... | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"sources",
"(",
")",
"{",
"List",
"<",
"String",
">",
"sources",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"_sections",
".",
... | The list of original sources. | [
"The",
"list",
"of",
"original",
"sources",
"."
] | 361a99c73d51c11afa5579dd83d477c4d0345599 | https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/IndexedSourceMapConsumer.java#L130-L139 |
41,609 | aoindustries/aocode-public | src/main/java/com/aoindustries/io/SyncFile.java | SyncFile.syncFile | public static long syncFile(InputStream in, RandomAccessFile out) throws IOException {
byte[] inBuff = new byte[BLOCK_SIZE];
byte[] outBuff = new byte[BLOCK_SIZE];
long pos = 0;
long bytesWritten = 0;
int numBytes;
while((numBytes=in.read(inBuff, 0, BLOCK_SIZE))!=-1) {
if(DEBUG) System.err.println(pos+":... | java | public static long syncFile(InputStream in, RandomAccessFile out) throws IOException {
byte[] inBuff = new byte[BLOCK_SIZE];
byte[] outBuff = new byte[BLOCK_SIZE];
long pos = 0;
long bytesWritten = 0;
int numBytes;
while((numBytes=in.read(inBuff, 0, BLOCK_SIZE))!=-1) {
if(DEBUG) System.err.println(pos+":... | [
"public",
"static",
"long",
"syncFile",
"(",
"InputStream",
"in",
",",
"RandomAccessFile",
"out",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"inBuff",
"=",
"new",
"byte",
"[",
"BLOCK_SIZE",
"]",
";",
"byte",
"[",
"]",
"outBuff",
"=",
"new",
"by... | Synchronized the input to the provided output, only writing data that
doesn't already match the input.
Returns the number of bytes written. | [
"Synchronized",
"the",
"input",
"to",
"the",
"provided",
"output",
"only",
"writing",
"data",
"that",
"doesn",
"t",
"already",
"match",
"the",
"input",
".",
"Returns",
"the",
"number",
"of",
"bytes",
"written",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/SyncFile.java#L88-L130 |
41,610 | aoindustries/semanticcms-core-taglib | src/main/java/com/semanticcms/core/taglib/ElementTag.java | ElementTag.evaluateAttributes | protected void evaluateAttributes(E element, ELContext elContext) throws JspTagException, IOException {
String idStr = nullIfEmpty(resolveValue(id, String.class, elContext));
if(idStr != null) element.setId(idStr);
} | java | protected void evaluateAttributes(E element, ELContext elContext) throws JspTagException, IOException {
String idStr = nullIfEmpty(resolveValue(id, String.class, elContext));
if(idStr != null) element.setId(idStr);
} | [
"protected",
"void",
"evaluateAttributes",
"(",
"E",
"element",
",",
"ELContext",
"elContext",
")",
"throws",
"JspTagException",
",",
"IOException",
"{",
"String",
"idStr",
"=",
"nullIfEmpty",
"(",
"resolveValue",
"(",
"id",
",",
"String",
".",
"class",
",",
"... | Resolves all attributes, setting into the created element as appropriate,
This is only called for captureLevel >= META.
Attributes are resolved before the element is added to any parent node.
Typically, deferred expressions will be evaluated here.
Overriding methods must call this implementation. | [
"Resolves",
"all",
"attributes",
"setting",
"into",
"the",
"created",
"element",
"as",
"appropriate",
"This",
"is",
"only",
"called",
"for",
"captureLevel",
">",
"=",
"META",
".",
"Attributes",
"are",
"resolved",
"before",
"the",
"element",
"is",
"added",
"to"... | 2e6c5dd3b1299c6cc6a87a335302460c5c69c539 | https://github.com/aoindustries/semanticcms-core-taglib/blob/2e6c5dd3b1299c6cc6a87a335302460c5c69c539/src/main/java/com/semanticcms/core/taglib/ElementTag.java#L179-L182 |
41,611 | aoindustries/semanticcms-core-taglib | src/main/java/com/semanticcms/core/taglib/ElementTag.java | ElementTag.doBody | protected void doBody(E element, CaptureLevel captureLevel) throws JspException, IOException {
JspFragment body = getJspBody();
if(body != null) {
if(captureLevel == CaptureLevel.BODY) {
final PageContext pageContext = (PageContext)getJspContext();
// Invoke tag body, capturing output
BufferWriter ca... | java | protected void doBody(E element, CaptureLevel captureLevel) throws JspException, IOException {
JspFragment body = getJspBody();
if(body != null) {
if(captureLevel == CaptureLevel.BODY) {
final PageContext pageContext = (PageContext)getJspContext();
// Invoke tag body, capturing output
BufferWriter ca... | [
"protected",
"void",
"doBody",
"(",
"E",
"element",
",",
"CaptureLevel",
"captureLevel",
")",
"throws",
"JspException",
",",
"IOException",
"{",
"JspFragment",
"body",
"=",
"getJspBody",
"(",
")",
";",
"if",
"(",
"body",
"!=",
"null",
")",
"{",
"if",
"(",
... | This is only called for captureLevel >= META. | [
"This",
"is",
"only",
"called",
"for",
"captureLevel",
">",
"=",
"META",
"."
] | 2e6c5dd3b1299c6cc6a87a335302460c5c69c539 | https://github.com/aoindustries/semanticcms-core-taglib/blob/2e6c5dd3b1299c6cc6a87a335302460c5c69c539/src/main/java/com/semanticcms/core/taglib/ElementTag.java#L187-L207 |
41,612 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/PropertiesUtils.java | PropertiesUtils.loadFromResource | public static Properties loadFromResource(ServletContext servletContext, String resource) throws IOException {
Properties props = new Properties();
InputStream in = servletContext.getResourceAsStream(resource);
if(in==null) throw new LocalizedIOException(accessor, "PropertiesUtils.readProperties.resourceNotFound"... | java | public static Properties loadFromResource(ServletContext servletContext, String resource) throws IOException {
Properties props = new Properties();
InputStream in = servletContext.getResourceAsStream(resource);
if(in==null) throw new LocalizedIOException(accessor, "PropertiesUtils.readProperties.resourceNotFound"... | [
"public",
"static",
"Properties",
"loadFromResource",
"(",
"ServletContext",
"servletContext",
",",
"String",
"resource",
")",
"throws",
"IOException",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"InputStream",
"in",
"=",
"servletContext",
... | Loads properties from a web resource. | [
"Loads",
"properties",
"from",
"a",
"web",
"resource",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/PropertiesUtils.java#L47-L57 |
41,613 | probedock/probedock-java | src/main/java/io/probedock/client/common/utils/PackageMatcher.java | PackageMatcher.match | public static Map.Entry<String, String> match(Map<String, String> categoriesByPackage, String pkg) {
if (categoriesByPackage != null && pkg != null) {
for (Map.Entry<String, String> e : categoriesByPackage.entrySet()) {
if (Minimatch.minimatch(pkg.replaceAll("\\.", "/"), e.getKey().r... | java | public static Map.Entry<String, String> match(Map<String, String> categoriesByPackage, String pkg) {
if (categoriesByPackage != null && pkg != null) {
for (Map.Entry<String, String> e : categoriesByPackage.entrySet()) {
if (Minimatch.minimatch(pkg.replaceAll("\\.", "/"), e.getKey().r... | [
"public",
"static",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"match",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"categoriesByPackage",
",",
"String",
"pkg",
")",
"{",
"if",
"(",
"categoriesByPackage",
"!=",
"null",
"&&",
"pkg",
"!=",
... | Check if there is a pattern in the map that match the given package
@param categoriesByPackage The map of package patterns
@param pkg The package to check against
@return The entry with the corresponding match or null if no match | [
"Check",
"if",
"there",
"is",
"a",
"pattern",
"in",
"the",
"map",
"that",
"match",
"the",
"given",
"package"
] | 92ee6634ba4fe3fdffeb4e202f5372ef947a67c3 | https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/common/utils/PackageMatcher.java#L20-L30 |
41,614 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/LastModifiedServlet.java | LastModifiedServlet.getCachedLastModified | private static long getCachedLastModified(ServletContext servletContext, HeaderAndPath hap) {
// Get the cache
@SuppressWarnings("unchecked")
Map<HeaderAndPath,GetLastModifiedCacheValue> cache = (Map<HeaderAndPath,GetLastModifiedCacheValue>)servletContext.getAttribute(GET_LAST_MODIFIED_CACHE_ATTRIBUTE_NAME);
if... | java | private static long getCachedLastModified(ServletContext servletContext, HeaderAndPath hap) {
// Get the cache
@SuppressWarnings("unchecked")
Map<HeaderAndPath,GetLastModifiedCacheValue> cache = (Map<HeaderAndPath,GetLastModifiedCacheValue>)servletContext.getAttribute(GET_LAST_MODIFIED_CACHE_ATTRIBUTE_NAME);
if... | [
"private",
"static",
"long",
"getCachedLastModified",
"(",
"ServletContext",
"servletContext",
",",
"HeaderAndPath",
"hap",
")",
"{",
"// Get the cache",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Map",
"<",
"HeaderAndPath",
",",
"GetLastModifiedCacheValue",
"... | Gets a modified time from either a file or URL.
Caches results for up to a second. | [
"Gets",
"a",
"modified",
"time",
"from",
"either",
"a",
"file",
"or",
"URL",
".",
"Caches",
"results",
"for",
"up",
"to",
"a",
"second",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/LastModifiedServlet.java#L331-L385 |
41,615 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/LastModifiedServlet.java | LastModifiedServlet.getLastModified | public static long getLastModified(ServletContext servletContext, HttpServletRequest request, String path) {
return getLastModified(
servletContext,
request,
path,
FileUtils.getExtension(path)
);
} | java | public static long getLastModified(ServletContext servletContext, HttpServletRequest request, String path) {
return getLastModified(
servletContext,
request,
path,
FileUtils.getExtension(path)
);
} | [
"public",
"static",
"long",
"getLastModified",
"(",
"ServletContext",
"servletContext",
",",
"HttpServletRequest",
"request",
",",
"String",
"path",
")",
"{",
"return",
"getLastModified",
"(",
"servletContext",
",",
"request",
",",
"path",
",",
"FileUtils",
".",
"... | Automatically determines extension from path.
@see #getLastModified(javax.servlet.ServletContext, java.lang.String, java.lang.String) | [
"Automatically",
"determines",
"extension",
"from",
"path",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/LastModifiedServlet.java#L421-L428 |
41,616 | aoindustries/semanticcms-core-sitemap | src/main/java/com/semanticcms/core/sitemap/SiteMapIndexServlet.java | SiteMapIndexServlet.getLastModified | @Override
protected long getLastModified(HttpServletRequest req) {
try {
ReadableInstant mostRecent = null;
for(
Tuple2<Book,ReadableInstant> sitemapBook
: getSitemapBooks(
getServletContext(),
req,
(HttpServletResponse)req.getAttribute(RESPONSE_IN_REQUEST_ATTRIBUTE)
)
) {
Rea... | java | @Override
protected long getLastModified(HttpServletRequest req) {
try {
ReadableInstant mostRecent = null;
for(
Tuple2<Book,ReadableInstant> sitemapBook
: getSitemapBooks(
getServletContext(),
req,
(HttpServletResponse)req.getAttribute(RESPONSE_IN_REQUEST_ATTRIBUTE)
)
) {
Rea... | [
"@",
"Override",
"protected",
"long",
"getLastModified",
"(",
"HttpServletRequest",
"req",
")",
"{",
"try",
"{",
"ReadableInstant",
"mostRecent",
"=",
"null",
";",
"for",
"(",
"Tuple2",
"<",
"Book",
",",
"ReadableInstant",
">",
"sitemapBook",
":",
"getSitemapBoo... | Last modified is known only when the last modified is known for all books,
and it is the most recent of all the per-book last modified. | [
"Last",
"modified",
"is",
"known",
"only",
"when",
"the",
"last",
"modified",
"is",
"known",
"for",
"all",
"books",
"and",
"it",
"is",
"the",
"most",
"recent",
"of",
"all",
"the",
"per",
"-",
"book",
"last",
"modified",
"."
] | 564f77bc8b14572942903126dfd99e400bc11f85 | https://github.com/aoindustries/semanticcms-core-sitemap/blob/564f77bc8b14572942903126dfd99e400bc11f85/src/main/java/com/semanticcms/core/sitemap/SiteMapIndexServlet.java#L318-L348 |
41,617 | aoindustries/semanticcms-core-sitemap | src/main/java/com/semanticcms/core/sitemap/SiteMapIndexServlet.java | SiteMapIndexServlet.hasSiteMapUrl | private static boolean hasSiteMapUrl(
final ServletContext servletContext,
final HttpServletRequest req,
final HttpServletResponse resp,
final SortedSet<View> views,
final Book book,
PageRef pageRef
) throws ServletException, IOException {
Boolean result = CapturePage.traversePagesAnyOrder(
servletCon... | java | private static boolean hasSiteMapUrl(
final ServletContext servletContext,
final HttpServletRequest req,
final HttpServletResponse resp,
final SortedSet<View> views,
final Book book,
PageRef pageRef
) throws ServletException, IOException {
Boolean result = CapturePage.traversePagesAnyOrder(
servletCon... | [
"private",
"static",
"boolean",
"hasSiteMapUrl",
"(",
"final",
"ServletContext",
"servletContext",
",",
"final",
"HttpServletRequest",
"req",
",",
"final",
"HttpServletResponse",
"resp",
",",
"final",
"SortedSet",
"<",
"View",
">",
"views",
",",
"final",
"Book",
"... | Checks if the sitemap has at least one page.
This version implemented as a traversal. | [
"Checks",
"if",
"the",
"sitemap",
"has",
"at",
"least",
"one",
"page",
".",
"This",
"version",
"implemented",
"as",
"a",
"traversal",
"."
] | 564f77bc8b14572942903126dfd99e400bc11f85 | https://github.com/aoindustries/semanticcms-core-sitemap/blob/564f77bc8b14572942903126dfd99e400bc11f85/src/main/java/com/semanticcms/core/sitemap/SiteMapIndexServlet.java#L378-L422 |
41,618 | bremersee/sms | src/main/java/org/bremersee/sms/GoyyaSmsService.java | GoyyaSmsService.getMessageType | protected String getMessageType(final String message) {
if (StringUtils.isBlank(defaultMessageType) || MESSAGE_TYPE_TEXT_VALUE
.equalsIgnoreCase(defaultMessageType)
|| MESSAGE_TYPE_LONG_TEXT_VALUE.equalsIgnoreCase(defaultMessageType)) {
return message.length() > getMaxLengthOfOneSms() ? MESSAG... | java | protected String getMessageType(final String message) {
if (StringUtils.isBlank(defaultMessageType) || MESSAGE_TYPE_TEXT_VALUE
.equalsIgnoreCase(defaultMessageType)
|| MESSAGE_TYPE_LONG_TEXT_VALUE.equalsIgnoreCase(defaultMessageType)) {
return message.length() > getMaxLengthOfOneSms() ? MESSAG... | [
"protected",
"String",
"getMessageType",
"(",
"final",
"String",
"message",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"defaultMessageType",
")",
"||",
"MESSAGE_TYPE_TEXT_VALUE",
".",
"equalsIgnoreCase",
"(",
"defaultMessageType",
")",
"||",
"MESSAGE_T... | Returns the message type.
@param message the message
@return the message type | [
"Returns",
"the",
"message",
"type",
"."
] | 4e5e87ea98616dd316573b544f54cac56750d2f9 | https://github.com/bremersee/sms/blob/4e5e87ea98616dd316573b544f54cac56750d2f9/src/main/java/org/bremersee/sms/GoyyaSmsService.java#L376-L384 |
41,619 | bremersee/sms | src/main/java/org/bremersee/sms/GoyyaSmsService.java | GoyyaSmsService.createSendTime | protected String createSendTime(final Date sendTime) {
if (sendTime == null || new Date(System.currentTimeMillis() + 1000L * 60L).after(sendTime)) {
return null;
}
String customSendTimePattern =
StringUtils.isBlank(this.sendTimePattern) ? DEFAULT_SEND_TIME_PATTERN
: this.sendTimePa... | java | protected String createSendTime(final Date sendTime) {
if (sendTime == null || new Date(System.currentTimeMillis() + 1000L * 60L).after(sendTime)) {
return null;
}
String customSendTimePattern =
StringUtils.isBlank(this.sendTimePattern) ? DEFAULT_SEND_TIME_PATTERN
: this.sendTimePa... | [
"protected",
"String",
"createSendTime",
"(",
"final",
"Date",
"sendTime",
")",
"{",
"if",
"(",
"sendTime",
"==",
"null",
"||",
"new",
"Date",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"1000L",
"*",
"60L",
")",
".",
"after",
"(",
"sendTime"... | Creates the send time URL parameter value.
@param sendTime the send time as {@link Date}
@return the send time URL parameter value | [
"Creates",
"the",
"send",
"time",
"URL",
"parameter",
"value",
"."
] | 4e5e87ea98616dd316573b544f54cac56750d2f9 | https://github.com/bremersee/sms/blob/4e5e87ea98616dd316573b544f54cac56750d2f9/src/main/java/org/bremersee/sms/GoyyaSmsService.java#L392-L402 |
41,620 | bremersee/sms | src/main/java/org/bremersee/sms/GoyyaSmsService.java | GoyyaSmsService.createTrustAllManagers | protected TrustManager[] createTrustAllManagers() {
return new TrustManager[]{
new X509TrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkClientTrusted(X509Certificate[] certs, ... | java | protected TrustManager[] createTrustAllManagers() {
return new TrustManager[]{
new X509TrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkClientTrusted(X509Certificate[] certs, ... | [
"protected",
"TrustManager",
"[",
"]",
"createTrustAllManagers",
"(",
")",
"{",
"return",
"new",
"TrustManager",
"[",
"]",
"{",
"new",
"X509TrustManager",
"(",
")",
"{",
"@",
"Override",
"public",
"X509Certificate",
"[",
"]",
"getAcceptedIssuers",
"(",
")",
"{... | Creates an array of trust managers which trusts all X509 certificates.
@return the trust manager [ ] | [
"Creates",
"an",
"array",
"of",
"trust",
"managers",
"which",
"trusts",
"all",
"X509",
"certificates",
"."
] | 4e5e87ea98616dd316573b544f54cac56750d2f9 | https://github.com/bremersee/sms/blob/4e5e87ea98616dd316573b544f54cac56750d2f9/src/main/java/org/bremersee/sms/GoyyaSmsService.java#L464-L482 |
41,621 | bremersee/sms | src/main/java/org/bremersee/sms/GoyyaSmsService.java | GoyyaSmsService.encode | private String encode(final String value, final Charset charset) {
if (StringUtils.isBlank(value)) {
return "";
}
try {
return URLEncoder.encode(value, charset.name());
} catch (UnsupportedEncodingException e) {
return value;
}
} | java | private String encode(final String value, final Charset charset) {
if (StringUtils.isBlank(value)) {
return "";
}
try {
return URLEncoder.encode(value, charset.name());
} catch (UnsupportedEncodingException e) {
return value;
}
} | [
"private",
"String",
"encode",
"(",
"final",
"String",
"value",
",",
"final",
"Charset",
"charset",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"value",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"try",
"{",
"return",
"URLEncoder",
".",
"e... | Encode query parameter.
@param value the parameter value
@param charset the charset
@return the encoded parameter value | [
"Encode",
"query",
"parameter",
"."
] | 4e5e87ea98616dd316573b544f54cac56750d2f9 | https://github.com/bremersee/sms/blob/4e5e87ea98616dd316573b544f54cac56750d2f9/src/main/java/org/bremersee/sms/GoyyaSmsService.java#L491-L501 |
41,622 | nlalevee/jsourcemap | jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapGenerator.java | SourceMapGenerator.fromSourceMap | public static SourceMapGenerator fromSourceMap(SourceMapConsumer aSourceMapConsumer) {
String sourceRoot = aSourceMapConsumer.sourceRoot;
SourceMapGenerator generator = new SourceMapGenerator(aSourceMapConsumer.file, sourceRoot);
aSourceMapConsumer.eachMapping().forEach(mapping -> {
... | java | public static SourceMapGenerator fromSourceMap(SourceMapConsumer aSourceMapConsumer) {
String sourceRoot = aSourceMapConsumer.sourceRoot;
SourceMapGenerator generator = new SourceMapGenerator(aSourceMapConsumer.file, sourceRoot);
aSourceMapConsumer.eachMapping().forEach(mapping -> {
... | [
"public",
"static",
"SourceMapGenerator",
"fromSourceMap",
"(",
"SourceMapConsumer",
"aSourceMapConsumer",
")",
"{",
"String",
"sourceRoot",
"=",
"aSourceMapConsumer",
".",
"sourceRoot",
";",
"SourceMapGenerator",
"generator",
"=",
"new",
"SourceMapGenerator",
"(",
"aSour... | Creates a new SourceMapGenerator based on a SourceMapConsumer
@param aSourceMapConsumer
The SourceMap. | [
"Creates",
"a",
"new",
"SourceMapGenerator",
"based",
"on",
"a",
"SourceMapConsumer"
] | 361a99c73d51c11afa5579dd83d477c4d0345599 | https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapGenerator.java#L57-L81 |
41,623 | nlalevee/jsourcemap | jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapGenerator.java | SourceMapGenerator.setSourceContent | public void setSourceContent(String aSourceFile, String aSourceContent) {
String source = aSourceFile;
if (this._sourceRoot != null) {
source = Util.relative(this._sourceRoot, source);
}
if (aSourceContent != null) {
// Add the source content to the _sourcesConte... | java | public void setSourceContent(String aSourceFile, String aSourceContent) {
String source = aSourceFile;
if (this._sourceRoot != null) {
source = Util.relative(this._sourceRoot, source);
}
if (aSourceContent != null) {
// Add the source content to the _sourcesConte... | [
"public",
"void",
"setSourceContent",
"(",
"String",
"aSourceFile",
",",
"String",
"aSourceContent",
")",
"{",
"String",
"source",
"=",
"aSourceFile",
";",
"if",
"(",
"this",
".",
"_sourceRoot",
"!=",
"null",
")",
"{",
"source",
"=",
"Util",
".",
"relative",... | Set the source content for a source file. | [
"Set",
"the",
"source",
"content",
"for",
"a",
"source",
"file",
"."
] | 361a99c73d51c11afa5579dd83d477c4d0345599 | https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapGenerator.java#L111-L132 |
41,624 | nlalevee/jsourcemap | jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapGenerator.java | SourceMapGenerator.serializeMappings | private String serializeMappings() {
int previousGeneratedColumn = 0;
int previousGeneratedLine = 1;
int previousOriginalColumn = 0;
int previousOriginalLine = 0;
int previousName = 0;
int previousSource = 0;
String result = "";
Mapping mapping;
in... | java | private String serializeMappings() {
int previousGeneratedColumn = 0;
int previousGeneratedLine = 1;
int previousOriginalColumn = 0;
int previousOriginalLine = 0;
int previousName = 0;
int previousSource = 0;
String result = "";
Mapping mapping;
in... | [
"private",
"String",
"serializeMappings",
"(",
")",
"{",
"int",
"previousGeneratedColumn",
"=",
"0",
";",
"int",
"previousGeneratedLine",
"=",
"1",
";",
"int",
"previousOriginalColumn",
"=",
"0",
";",
"int",
"previousOriginalLine",
"=",
"0",
";",
"int",
"previou... | Serialize the accumulated mappings in to the stream of base 64 VLQs specified by the source map format. | [
"Serialize",
"the",
"accumulated",
"mappings",
"in",
"to",
"the",
"stream",
"of",
"base",
"64",
"VLQs",
"specified",
"by",
"the",
"source",
"map",
"format",
"."
] | 361a99c73d51c11afa5579dd83d477c4d0345599 | https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapGenerator.java#L221-L275 |
41,625 | nlalevee/jsourcemap | jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapGenerator.java | SourceMapGenerator.toJSON | public SourceMap toJSON() {
SourceMap map = new SourceMap();
map.version = this._version;
map.sources = this._sources.toArray();
map.names = this._names.toArray();
map.mappings = serializeMappings();
map.file = this._file;
map.sourceRoot = this._sourceRoot;
... | java | public SourceMap toJSON() {
SourceMap map = new SourceMap();
map.version = this._version;
map.sources = this._sources.toArray();
map.names = this._names.toArray();
map.mappings = serializeMappings();
map.file = this._file;
map.sourceRoot = this._sourceRoot;
... | [
"public",
"SourceMap",
"toJSON",
"(",
")",
"{",
"SourceMap",
"map",
"=",
"new",
"SourceMap",
"(",
")",
";",
"map",
".",
"version",
"=",
"this",
".",
"_version",
";",
"map",
".",
"sources",
"=",
"this",
".",
"_sources",
".",
"toArray",
"(",
")",
";",
... | Externalize the source map. | [
"Externalize",
"the",
"source",
"map",
"."
] | 361a99c73d51c11afa5579dd83d477c4d0345599 | https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/SourceMapGenerator.java#L292-L304 |
41,626 | aoindustries/aocode-public | src/main/java/com/aoindustries/cache/BackgroundCache.java | BackgroundCache.get | public Result<V,E> get(
K key,
Refresher<? super K,? extends V,? extends E> refresher
) {
Result<V,E> result = get(key);
if(result == null) result = put(key, refresher);
return result;
} | java | public Result<V,E> get(
K key,
Refresher<? super K,? extends V,? extends E> refresher
) {
Result<V,E> result = get(key);
if(result == null) result = put(key, refresher);
return result;
} | [
"public",
"Result",
"<",
"V",
",",
"E",
">",
"get",
"(",
"K",
"key",
",",
"Refresher",
"<",
"?",
"super",
"K",
",",
"?",
"extends",
"V",
",",
"?",
"extends",
"E",
">",
"refresher",
")",
"{",
"Result",
"<",
"V",
",",
"E",
">",
"result",
"=",
"... | Gets the value if currently in the cache. If not,
Runs the refresher immediately to obtain the result, then
places an entry into the cache.
@return The result obtained from either the cache or this refresher
@see #get(java.lang.Object)
@see #put(java.lang.Object, com.aoindustries.cache.BackgroundCache.Refresher) | [
"Gets",
"the",
"value",
"if",
"currently",
"in",
"the",
"cache",
".",
"If",
"not",
"Runs",
"the",
"refresher",
"immediately",
"to",
"obtain",
"the",
"result",
"then",
"places",
"an",
"entry",
"into",
"the",
"cache",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/cache/BackgroundCache.java#L288-L295 |
41,627 | aoindustries/aocode-public | src/main/java/com/aoindustries/cache/BackgroundCache.java | BackgroundCache.get | public Result<V,E> get(K key) {
CacheEntry entry = map.get(key);
if(entry == null) {
return null;
} else {
return entry.getResult();
}
} | java | public Result<V,E> get(K key) {
CacheEntry entry = map.get(key);
if(entry == null) {
return null;
} else {
return entry.getResult();
}
} | [
"public",
"Result",
"<",
"V",
",",
"E",
">",
"get",
"(",
"K",
"key",
")",
"{",
"CacheEntry",
"entry",
"=",
"map",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"entry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
... | Gets a cached result for the given key, null if not cached.
Extends the expiration of the cache entry. | [
"Gets",
"a",
"cached",
"result",
"for",
"the",
"given",
"key",
"null",
"if",
"not",
"cached",
".",
"Extends",
"the",
"expiration",
"of",
"the",
"cache",
"entry",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/cache/BackgroundCache.java#L301-L308 |
41,628 | aoindustries/aocode-public | src/main/java/com/aoindustries/cache/BackgroundCache.java | BackgroundCache.put | public Result<V,E> put(
K key,
Refresher<? super K,? extends V,? extends E> refresher
) {
Result<V,E> result = runRefresher(refresher, key);
put(key, refresher, result);
return result;
} | java | public Result<V,E> put(
K key,
Refresher<? super K,? extends V,? extends E> refresher
) {
Result<V,E> result = runRefresher(refresher, key);
put(key, refresher, result);
return result;
} | [
"public",
"Result",
"<",
"V",
",",
"E",
">",
"put",
"(",
"K",
"key",
",",
"Refresher",
"<",
"?",
"super",
"K",
",",
"?",
"extends",
"V",
",",
"?",
"extends",
"E",
">",
"refresher",
")",
"{",
"Result",
"<",
"V",
",",
"E",
">",
"result",
"=",
"... | Runs the refresher immediately to obtain the result, then
places an entry into the cache, replacing any existing entry under this key.
@return The result obtained from this refresher | [
"Runs",
"the",
"refresher",
"immediately",
"to",
"obtain",
"the",
"result",
"then",
"places",
"an",
"entry",
"into",
"the",
"cache",
"replacing",
"any",
"existing",
"entry",
"under",
"this",
"key",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/cache/BackgroundCache.java#L333-L340 |
41,629 | aoindustries/aocode-public | src/main/java/com/aoindustries/cache/BackgroundCache.java | BackgroundCache.put | public void put(
K key,
Refresher<? super K,? extends V,? extends E> refresher,
V value
) {
put(key, refresher, new Result<V,E>(value));
} | java | public void put(
K key,
Refresher<? super K,? extends V,? extends E> refresher,
V value
) {
put(key, refresher, new Result<V,E>(value));
} | [
"public",
"void",
"put",
"(",
"K",
"key",
",",
"Refresher",
"<",
"?",
"super",
"K",
",",
"?",
"extends",
"V",
",",
"?",
"extends",
"E",
">",
"refresher",
",",
"V",
"value",
")",
"{",
"put",
"(",
"key",
",",
"refresher",
",",
"new",
"Result",
"<",... | Places a result into the cache, replacing any existing entry under this key. | [
"Places",
"a",
"result",
"into",
"the",
"cache",
"replacing",
"any",
"existing",
"entry",
"under",
"this",
"key",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/cache/BackgroundCache.java#L345-L351 |
41,630 | aoindustries/semanticcms-core-taglib | src/main/java/com/semanticcms/core/taglib/NavigationTreeTag.java | NavigationTreeTag.doTag | @Override
public void doTag() throws JspTagException, IOException {
try {
final PageContext pageContext = (PageContext)getJspContext();
NavigationTreeRenderer.writeNavigationTree(
pageContext.getServletContext(),
pageContext.getELContext(),
(HttpServletRequest)pageContext.getRequest(),
(HttpSer... | java | @Override
public void doTag() throws JspTagException, IOException {
try {
final PageContext pageContext = (PageContext)getJspContext();
NavigationTreeRenderer.writeNavigationTree(
pageContext.getServletContext(),
pageContext.getELContext(),
(HttpServletRequest)pageContext.getRequest(),
(HttpSer... | [
"@",
"Override",
"public",
"void",
"doTag",
"(",
")",
"throws",
"JspTagException",
",",
"IOException",
"{",
"try",
"{",
"final",
"PageContext",
"pageContext",
"=",
"(",
"PageContext",
")",
"getJspContext",
"(",
")",
";",
"NavigationTreeRenderer",
".",
"writeNavi... | Creates the nested <ul> and <li> tags used by TreeView.
The first level is expanded.
<a href="http://developer.yahoo.com/yui/treeview/#start">http://developer.yahoo.com/yui/treeview/#start</a> | [
"Creates",
"the",
"nested",
"<",
";",
"ul>",
";",
"and",
"<",
";",
"li>",
";",
"tags",
"used",
"by",
"TreeView",
".",
"The",
"first",
"level",
"is",
"expanded",
"."
] | 2e6c5dd3b1299c6cc6a87a335302460c5c69c539 | https://github.com/aoindustries/semanticcms-core-taglib/blob/2e6c5dd3b1299c6cc6a87a335302460c5c69c539/src/main/java/com/semanticcms/core/taglib/NavigationTreeTag.java#L103-L129 |
41,631 | nlalevee/jsourcemap | jsourcemap/src/java/org/hibnet/jsourcemap/BasicSourceMapConsumer.java | BasicSourceMapConsumer.fromSourceMap | public static BasicSourceMapConsumer fromSourceMap(SourceMapGenerator aSourceMap) {
BasicSourceMapConsumer smc = new BasicSourceMapConsumer();
ArraySet<String> names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
ArraySet<String> sources = smc._sources = ArraySet.fromArra... | java | public static BasicSourceMapConsumer fromSourceMap(SourceMapGenerator aSourceMap) {
BasicSourceMapConsumer smc = new BasicSourceMapConsumer();
ArraySet<String> names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
ArraySet<String> sources = smc._sources = ArraySet.fromArra... | [
"public",
"static",
"BasicSourceMapConsumer",
"fromSourceMap",
"(",
"SourceMapGenerator",
"aSourceMap",
")",
"{",
"BasicSourceMapConsumer",
"smc",
"=",
"new",
"BasicSourceMapConsumer",
"(",
")",
";",
"ArraySet",
"<",
"String",
">",
"names",
"=",
"smc",
".",
"_names"... | Create a BasicSourceMapConsumer from a SourceMapGenerator.
@param SourceMapGenerator
aSourceMap The source map that will be consumed.
@returns BasicSourceMapConsumer | [
"Create",
"a",
"BasicSourceMapConsumer",
"from",
"a",
"SourceMapGenerator",
"."
] | 361a99c73d51c11afa5579dd83d477c4d0345599 | https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/BasicSourceMapConsumer.java#L115-L155 |
41,632 | nlalevee/jsourcemap | jsourcemap/src/java/org/hibnet/jsourcemap/BasicSourceMapConsumer.java | BasicSourceMapConsumer.computeColumnSpans | void computeColumnSpans() {
for (int index = 0; index < _generatedMappings().size(); ++index) {
ParsedMapping mapping = _generatedMappings().get(index);
// Mappings do not contain a field for the last generated columnt. We
// can come up with an optimistic estimate, however,... | java | void computeColumnSpans() {
for (int index = 0; index < _generatedMappings().size(); ++index) {
ParsedMapping mapping = _generatedMappings().get(index);
// Mappings do not contain a field for the last generated columnt. We
// can come up with an optimistic estimate, however,... | [
"void",
"computeColumnSpans",
"(",
")",
"{",
"for",
"(",
"int",
"index",
"=",
"0",
";",
"index",
"<",
"_generatedMappings",
"(",
")",
".",
"size",
"(",
")",
";",
"++",
"index",
")",
"{",
"ParsedMapping",
"mapping",
"=",
"_generatedMappings",
"(",
")",
... | Compute the last column for each generated mapping. The last column is inclusive. | [
"Compute",
"the",
"last",
"column",
"for",
"each",
"generated",
"mapping",
".",
"The",
"last",
"column",
"is",
"inclusive",
"."
] | 361a99c73d51c11afa5579dd83d477c4d0345599 | https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/BasicSourceMapConsumer.java#L280-L300 |
41,633 | nlalevee/jsourcemap | jsourcemap/src/java/org/hibnet/jsourcemap/BasicSourceMapConsumer.java | BasicSourceMapConsumer.hasContentsOfAllSources | @Override
public boolean hasContentsOfAllSources() {
if (sourcesContent == null) {
return false;
}
return this.sourcesContent.size() >= this._sources.size() && !this.sourcesContent.stream().anyMatch(sc -> sc == null);
} | java | @Override
public boolean hasContentsOfAllSources() {
if (sourcesContent == null) {
return false;
}
return this.sourcesContent.size() >= this._sources.size() && !this.sourcesContent.stream().anyMatch(sc -> sc == null);
} | [
"@",
"Override",
"public",
"boolean",
"hasContentsOfAllSources",
"(",
")",
"{",
"if",
"(",
"sourcesContent",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"this",
".",
"sourcesContent",
".",
"size",
"(",
")",
">=",
"this",
".",
"_sources",... | Return true if we have the source content for every source in the source map, false otherwise. | [
"Return",
"true",
"if",
"we",
"have",
"the",
"source",
"content",
"for",
"every",
"source",
"in",
"the",
"source",
"map",
"false",
"otherwise",
"."
] | 361a99c73d51c11afa5579dd83d477c4d0345599 | https://github.com/nlalevee/jsourcemap/blob/361a99c73d51c11afa5579dd83d477c4d0345599/jsourcemap/src/java/org/hibnet/jsourcemap/BasicSourceMapConsumer.java#L358-L364 |
41,634 | probedock/probedock-java | src/main/java/io/probedock/client/common/model/v1/ModelFactory.java | ModelFactory.createFingerprint | public static String createFingerprint(Class cl, Method m) {
return FingerprintGenerator.fingerprint(cl, m);
} | java | public static String createFingerprint(Class cl, Method m) {
return FingerprintGenerator.fingerprint(cl, m);
} | [
"public",
"static",
"String",
"createFingerprint",
"(",
"Class",
"cl",
",",
"Method",
"m",
")",
"{",
"return",
"FingerprintGenerator",
".",
"fingerprint",
"(",
"cl",
",",
"m",
")",
";",
"}"
] | Create fingerprint for java test method
@param cl The test class
@param m The test method
@return The fingerprint generated | [
"Create",
"fingerprint",
"for",
"java",
"test",
"method"
] | 92ee6634ba4fe3fdffeb4e202f5372ef947a67c3 | https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/common/model/v1/ModelFactory.java#L32-L34 |
41,635 | probedock/probedock-java | src/main/java/io/probedock/client/common/model/v1/ModelFactory.java | ModelFactory.enrichContext | public static void enrichContext(Context context) {
context.setPostProperty(Context.MEMORY_TOTAL, Runtime.getRuntime().totalMemory());
context.setPostProperty(Context.MEMORY_FREE, Runtime.getRuntime().freeMemory());
context.setPostProperty(Context.MEMORY_USED, Runtime.getRuntime().totalMemory() - Runtime.getRunti... | java | public static void enrichContext(Context context) {
context.setPostProperty(Context.MEMORY_TOTAL, Runtime.getRuntime().totalMemory());
context.setPostProperty(Context.MEMORY_FREE, Runtime.getRuntime().freeMemory());
context.setPostProperty(Context.MEMORY_USED, Runtime.getRuntime().totalMemory() - Runtime.getRunti... | [
"public",
"static",
"void",
"enrichContext",
"(",
"Context",
"context",
")",
"{",
"context",
".",
"setPostProperty",
"(",
"Context",
".",
"MEMORY_TOTAL",
",",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"totalMemory",
"(",
")",
")",
";",
"context",
".",
"... | Enrich a context | [
"Enrich",
"a",
"context"
] | 92ee6634ba4fe3fdffeb4e202f5372ef947a67c3 | https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/common/model/v1/ModelFactory.java#L100-L104 |
41,636 | aoindustries/aocode-public | src/main/java/com/aoindustries/version/PropertiesVersions.java | PropertiesVersions.getVersion | public Version getVersion(String product) throws IllegalArgumentException {
String three = properties.getProperty(product);
if(three==null) throw new IllegalArgumentException(accessor.getMessage("PropertiesVersions.getVersion.productNotFound", product));
return Version.valueOf(three+"."+getBuild());
} | java | public Version getVersion(String product) throws IllegalArgumentException {
String three = properties.getProperty(product);
if(three==null) throw new IllegalArgumentException(accessor.getMessage("PropertiesVersions.getVersion.productNotFound", product));
return Version.valueOf(three+"."+getBuild());
} | [
"public",
"Version",
"getVersion",
"(",
"String",
"product",
")",
"throws",
"IllegalArgumentException",
"{",
"String",
"three",
"=",
"properties",
".",
"getProperty",
"(",
"product",
")",
";",
"if",
"(",
"three",
"==",
"null",
")",
"throw",
"new",
"IllegalArgu... | Gets the version number for the provided product. | [
"Gets",
"the",
"version",
"number",
"for",
"the",
"provided",
"product",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/version/PropertiesVersions.java#L73-L77 |
41,637 | aoindustries/aocode-public | src/main/java/com/aoindustries/version/PropertiesVersions.java | PropertiesVersions.getBuild | public int getBuild() throws IllegalArgumentException {
String build = properties.getProperty("build.number");
if(build==null) throw new IllegalArgumentException(accessor.getMessage("PropertiesVersions.getVersion.buildNotFound"));
return Integer.parseInt(build);
} | java | public int getBuild() throws IllegalArgumentException {
String build = properties.getProperty("build.number");
if(build==null) throw new IllegalArgumentException(accessor.getMessage("PropertiesVersions.getVersion.buildNotFound"));
return Integer.parseInt(build);
} | [
"public",
"int",
"getBuild",
"(",
")",
"throws",
"IllegalArgumentException",
"{",
"String",
"build",
"=",
"properties",
".",
"getProperty",
"(",
"\"build.number\"",
")",
";",
"if",
"(",
"build",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",... | Gets the build number that is applied to all products. | [
"Gets",
"the",
"build",
"number",
"that",
"is",
"applied",
"to",
"all",
"products",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/version/PropertiesVersions.java#L82-L86 |
41,638 | aoindustries/aocode-public | src/main/java/com/aoindustries/io/FilesystemIterator.java | FilesystemIterator.getNextFiles | public int getNextFiles(final File[] files, final int batchSize) throws IOException {
int c=0;
while(c<batchSize) {
File file=getNextFile();
if(file==null) break;
files[c++]=file;
}
return c;
} | java | public int getNextFiles(final File[] files, final int batchSize) throws IOException {
int c=0;
while(c<batchSize) {
File file=getNextFile();
if(file==null) break;
files[c++]=file;
}
return c;
} | [
"public",
"int",
"getNextFiles",
"(",
"final",
"File",
"[",
"]",
"files",
",",
"final",
"int",
"batchSize",
")",
"throws",
"IOException",
"{",
"int",
"c",
"=",
"0",
";",
"while",
"(",
"c",
"<",
"batchSize",
")",
"{",
"File",
"file",
"=",
"getNextFile",... | Gets the next files, up to batchSize.
@return the number of files in the array, zero (0) indicates iteration has completed
@throws java.io.IOException | [
"Gets",
"the",
"next",
"files",
"up",
"to",
"batchSize",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/FilesystemIterator.java#L260-L268 |
41,639 | aoindustries/aocode-public | src/main/java/com/aoindustries/io/FilesystemIterator.java | FilesystemIterator.isFilesystemRoot | protected boolean isFilesystemRoot(String filename) throws IOException {
String[] roots=getFilesystemRoots();
for(int c=0, len=roots.length;c<len;c++) {
if(roots[c].equals(filename)) return true;
}
return false;
} | java | protected boolean isFilesystemRoot(String filename) throws IOException {
String[] roots=getFilesystemRoots();
for(int c=0, len=roots.length;c<len;c++) {
if(roots[c].equals(filename)) return true;
}
return false;
} | [
"protected",
"boolean",
"isFilesystemRoot",
"(",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"String",
"[",
"]",
"roots",
"=",
"getFilesystemRoots",
"(",
")",
";",
"for",
"(",
"int",
"c",
"=",
"0",
",",
"len",
"=",
"roots",
".",
"length",
";... | Determines if a path is a possible file system root | [
"Determines",
"if",
"a",
"path",
"is",
"a",
"possible",
"file",
"system",
"root"
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/FilesystemIterator.java#L293-L299 |
41,640 | aoindustries/aocode-public | src/main/java/com/aoindustries/io/FilesystemIterator.java | FilesystemIterator.getBestRule | private FilesystemIteratorRule getBestRule(final String filename) {
String longestPrefix = null;
FilesystemIteratorRule rule = null;
// First search the path and all of its parents for the first regular rule
String path = filename;
while(true) {
// Check the current path for an exact match
//System.out.... | java | private FilesystemIteratorRule getBestRule(final String filename) {
String longestPrefix = null;
FilesystemIteratorRule rule = null;
// First search the path and all of its parents for the first regular rule
String path = filename;
while(true) {
// Check the current path for an exact match
//System.out.... | [
"private",
"FilesystemIteratorRule",
"getBestRule",
"(",
"final",
"String",
"filename",
")",
"{",
"String",
"longestPrefix",
"=",
"null",
";",
"FilesystemIteratorRule",
"rule",
"=",
"null",
";",
"// First search the path and all of its parents for the first regular rule",
"St... | Gets the rule that best suits the provided filename. The rule is the longer
rule between the regular rules and the prefix rules.
The regular rules are scanned first by looking through the filename and then
all parents up to the root for the first match. These use Map lookups in the
set of rules so this should still ... | [
"Gets",
"the",
"rule",
"that",
"best",
"suits",
"the",
"provided",
"filename",
".",
"The",
"rule",
"is",
"the",
"longer",
"rule",
"between",
"the",
"regular",
"rules",
"and",
"the",
"prefix",
"rules",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/FilesystemIterator.java#L326-L372 |
41,641 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/ServletContextCache.java | ServletContextCache.getCache | public static ServletContextCache getCache(ServletContext servletContext) {
ServletContextCache cache = (ServletContextCache)servletContext.getAttribute(ATTRIBUTE_KEY);
if(cache == null) {
// It is possible this is called during context initialization before the listener
cache = new ServletContextCache(servle... | java | public static ServletContextCache getCache(ServletContext servletContext) {
ServletContextCache cache = (ServletContextCache)servletContext.getAttribute(ATTRIBUTE_KEY);
if(cache == null) {
// It is possible this is called during context initialization before the listener
cache = new ServletContextCache(servle... | [
"public",
"static",
"ServletContextCache",
"getCache",
"(",
"ServletContext",
"servletContext",
")",
"{",
"ServletContextCache",
"cache",
"=",
"(",
"ServletContextCache",
")",
"servletContext",
".",
"getAttribute",
"(",
"ATTRIBUTE_KEY",
")",
";",
"if",
"(",
"cache",
... | Gets or creates the cache for the provided servlet context. | [
"Gets",
"or",
"creates",
"the",
"cache",
"for",
"the",
"provided",
"servlet",
"context",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/ServletContextCache.java#L52-L63 |
41,642 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/ServletContextCache.java | ServletContextCache.getResource | public URL getResource(String path) throws MalformedURLException {
Result<URL,MalformedURLException> result = getResourceCache.get(path, getResourceRefresher);
MalformedURLException exception = result.getException();
if(exception != null) throw exception;
return result.getValue();
} | java | public URL getResource(String path) throws MalformedURLException {
Result<URL,MalformedURLException> result = getResourceCache.get(path, getResourceRefresher);
MalformedURLException exception = result.getException();
if(exception != null) throw exception;
return result.getValue();
} | [
"public",
"URL",
"getResource",
"(",
"String",
"path",
")",
"throws",
"MalformedURLException",
"{",
"Result",
"<",
"URL",
",",
"MalformedURLException",
">",
"result",
"=",
"getResourceCache",
".",
"get",
"(",
"path",
",",
"getResourceRefresher",
")",
";",
"Malfo... | Gets the possibly cached URL. This URL is not copied and caller should not fiddle with
its state. Thank you Java for this not being immutable.
@see ServletContext#getResource(java.lang.String) | [
"Gets",
"the",
"possibly",
"cached",
"URL",
".",
"This",
"URL",
"is",
"not",
"copied",
"and",
"caller",
"should",
"not",
"fiddle",
"with",
"its",
"state",
".",
"Thank",
"you",
"Java",
"for",
"this",
"not",
"being",
"immutable",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/ServletContextCache.java#L98-L103 |
41,643 | aoindustries/aocode-public | src/main/java/com/aoindustries/util/SortedIntArrayList.java | SortedIntArrayList.binarySearch | protected int binarySearch(int value) {
int left = 0;
int right = size-1;
while(left <= right) {
int mid = (left + right)>>1;
int midValue = elementData[mid];
if(value==midValue) return mid;
if(value<midValue) right = mid-1;
else left = mid+1;
}
return -(left+1);
} | java | protected int binarySearch(int value) {
int left = 0;
int right = size-1;
while(left <= right) {
int mid = (left + right)>>1;
int midValue = elementData[mid];
if(value==midValue) return mid;
if(value<midValue) right = mid-1;
else left = mid+1;
}
return -(left+1);
} | [
"protected",
"int",
"binarySearch",
"(",
"int",
"value",
")",
"{",
"int",
"left",
"=",
"0",
";",
"int",
"right",
"=",
"size",
"-",
"1",
";",
"while",
"(",
"left",
"<=",
"right",
")",
"{",
"int",
"mid",
"=",
"(",
"left",
"+",
"right",
")",
">>",
... | Performs a binary search for the provide value.
It will return any matching element, not necessarily
the first or the last. | [
"Performs",
"a",
"binary",
"search",
"for",
"the",
"provide",
"value",
".",
"It",
"will",
"return",
"any",
"matching",
"element",
"not",
"necessarily",
"the",
"first",
"or",
"the",
"last",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/SortedIntArrayList.java#L62-L73 |
41,644 | aoindustries/aocode-public | src/main/java/com/aoindustries/util/SortedIntArrayList.java | SortedIntArrayList.indexOf | @Override
public int indexOf(int elem) {
// Find the location to insert the object at
int pos=binarySearch(elem);
// Not found
if(pos<0) return -1;
// Found one, iterate backwards to the first one
while(pos>0 && elementData[pos-1]==elem) pos--;
return pos;
} | java | @Override
public int indexOf(int elem) {
// Find the location to insert the object at
int pos=binarySearch(elem);
// Not found
if(pos<0) return -1;
// Found one, iterate backwards to the first one
while(pos>0 && elementData[pos-1]==elem) pos--;
return pos;
} | [
"@",
"Override",
"public",
"int",
"indexOf",
"(",
"int",
"elem",
")",
"{",
"// Find the location to insert the object at",
"int",
"pos",
"=",
"binarySearch",
"(",
"elem",
")",
";",
"// Not found",
"if",
"(",
"pos",
"<",
"0",
")",
"return",
"-",
"1",
";",
"... | Searches for the first occurrence of the given value.
@param elem the value
@return the index of the first occurrence of the argument in this
list; returns <tt>-1</tt> if the object is not found. | [
"Searches",
"for",
"the",
"first",
"occurrence",
"of",
"the",
"given",
"value",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/SortedIntArrayList.java#L82-L93 |
41,645 | aoindustries/aocode-public | src/main/java/com/aoindustries/util/SortedIntArrayList.java | SortedIntArrayList.add | @Override
public boolean add(int o) {
// Shortcut for empty
int mySize=size();
if(mySize==0) {
super.add(o);
} else {
// Shortcut for adding to end (makes imports of already-sorted data operate at constant-time instead of logarithmic complexity)
if(o>=elementData[mySize-1]) {
super.add(o);
} el... | java | @Override
public boolean add(int o) {
// Shortcut for empty
int mySize=size();
if(mySize==0) {
super.add(o);
} else {
// Shortcut for adding to end (makes imports of already-sorted data operate at constant-time instead of logarithmic complexity)
if(o>=elementData[mySize-1]) {
super.add(o);
} el... | [
"@",
"Override",
"public",
"boolean",
"add",
"(",
"int",
"o",
")",
"{",
"// Shortcut for empty",
"int",
"mySize",
"=",
"size",
"(",
")",
";",
"if",
"(",
"mySize",
"==",
"0",
")",
"{",
"super",
".",
"add",
"(",
"o",
")",
";",
"}",
"else",
"{",
"//... | Adds the specified element in sorted position within this list.
@param o element to be appended to this list.
@return <tt>true</tt> (as per the general contract of Collection.add). | [
"Adds",
"the",
"specified",
"element",
"in",
"sorted",
"position",
"within",
"this",
"list",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/SortedIntArrayList.java#L130-L153 |
41,646 | aoindustries/aocode-public | src/main/java/com/aoindustries/util/SortedIntArrayList.java | SortedIntArrayList.addAll | @Override
public boolean addAll(Collection<? extends Integer> c) {
Iterator<? extends Integer> iter=c.iterator();
boolean didOne=false;
while(iter.hasNext()) {
add(iter.next().intValue());
didOne=true;
}
return didOne;
} | java | @Override
public boolean addAll(Collection<? extends Integer> c) {
Iterator<? extends Integer> iter=c.iterator();
boolean didOne=false;
while(iter.hasNext()) {
add(iter.next().intValue());
didOne=true;
}
return didOne;
} | [
"@",
"Override",
"public",
"boolean",
"addAll",
"(",
"Collection",
"<",
"?",
"extends",
"Integer",
">",
"c",
")",
"{",
"Iterator",
"<",
"?",
"extends",
"Integer",
">",
"iter",
"=",
"c",
".",
"iterator",
"(",
")",
";",
"boolean",
"didOne",
"=",
"false",... | Adds all of the elements in the specified Collection and sorts during
the add. This may operate slowly as it is the same as individual
calls to the add method. | [
"Adds",
"all",
"of",
"the",
"elements",
"in",
"the",
"specified",
"Collection",
"and",
"sorts",
"during",
"the",
"add",
".",
"This",
"may",
"operate",
"slowly",
"as",
"it",
"is",
"the",
"same",
"as",
"individual",
"calls",
"to",
"the",
"add",
"method",
"... | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/SortedIntArrayList.java#L188-L197 |
41,647 | bremersee/sms | src/main/java/org/bremersee/sms/model/SmsSendResponseDto.java | SmsSendResponseDto.isSuccessfullySent | @XmlElement(name = "successfullySent", required = true)
@JsonProperty(value = "successfullySent", required = true)
public boolean isSuccessfullySent() {
return successfullySent;
} | java | @XmlElement(name = "successfullySent", required = true)
@JsonProperty(value = "successfullySent", required = true)
public boolean isSuccessfullySent() {
return successfullySent;
} | [
"@",
"XmlElement",
"(",
"name",
"=",
"\"successfullySent\"",
",",
"required",
"=",
"true",
")",
"@",
"JsonProperty",
"(",
"value",
"=",
"\"successfullySent\"",
",",
"required",
"=",
"true",
")",
"public",
"boolean",
"isSuccessfullySent",
"(",
")",
"{",
"return... | Is successfully sent boolean.
@return the boolean | [
"Is",
"successfully",
"sent",
"boolean",
"."
] | 4e5e87ea98616dd316573b544f54cac56750d2f9 | https://github.com/bremersee/sms/blob/4e5e87ea98616dd316573b544f54cac56750d2f9/src/main/java/org/bremersee/sms/model/SmsSendResponseDto.java#L136-L140 |
41,648 | aoindustries/aocode-public | src/main/java/com/aoindustries/util/persistent/LargeMappedPersistentBuffer.java | LargeMappedPersistentBuffer.get | @Override
// @NotThreadSafe
public byte get(long position) throws IOException {
return mappedBuffers.get(getBufferNum(position)).get(getIndex(position));
} | java | @Override
// @NotThreadSafe
public byte get(long position) throws IOException {
return mappedBuffers.get(getBufferNum(position)).get(getIndex(position));
} | [
"@",
"Override",
"// @NotThreadSafe",
"public",
"byte",
"get",
"(",
"long",
"position",
")",
"throws",
"IOException",
"{",
"return",
"mappedBuffers",
".",
"get",
"(",
"getBufferNum",
"(",
"position",
")",
")",
".",
"get",
"(",
"getIndex",
"(",
"position",
")... | Gets a single byte from the buffer. | [
"Gets",
"a",
"single",
"byte",
"from",
"the",
"buffer",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/persistent/LargeMappedPersistentBuffer.java#L251-L255 |
41,649 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/Includer.java | Includer.dispatchInclude | public static void dispatchInclude(RequestDispatcher dispatcher, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SkipPageException {
final boolean isOutmostInclude = request.getAttribute(IS_INCLUDED_REQUEST_ATTRIBUTE_NAME) == null;
if(logger.isLoggable(Level.FINE)) lo... | java | public static void dispatchInclude(RequestDispatcher dispatcher, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SkipPageException {
final boolean isOutmostInclude = request.getAttribute(IS_INCLUDED_REQUEST_ATTRIBUTE_NAME) == null;
if(logger.isLoggable(Level.FINE)) lo... | [
"public",
"static",
"void",
"dispatchInclude",
"(",
"RequestDispatcher",
"dispatcher",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
",",
"SkipPageException",
"{",
"final",
"boolean",
... | Performs the actual include, supporting propagation of SkipPageException and sendError. | [
"Performs",
"the",
"actual",
"include",
"supporting",
"propagation",
"of",
"SkipPageException",
"and",
"sendError",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/Includer.java#L82-L121 |
41,650 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/Includer.java | Includer.setLocation | public static void setLocation(HttpServletRequest request, HttpServletResponse response, String location) {
if(request.getAttribute(IS_INCLUDED_REQUEST_ATTRIBUTE_NAME) == null) {
// Not included, setHeader directly
response.setHeader("Location", location);
} else {
// Is included, set attribute so top leve... | java | public static void setLocation(HttpServletRequest request, HttpServletResponse response, String location) {
if(request.getAttribute(IS_INCLUDED_REQUEST_ATTRIBUTE_NAME) == null) {
// Not included, setHeader directly
response.setHeader("Location", location);
} else {
// Is included, set attribute so top leve... | [
"public",
"static",
"void",
"setLocation",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"String",
"location",
")",
"{",
"if",
"(",
"request",
".",
"getAttribute",
"(",
"IS_INCLUDED_REQUEST_ATTRIBUTE_NAME",
")",
"==",
"null",
")"... | Sets a Location header. When not in an included page, calls setHeader directly.
When inside of an include will set request attribute so outermost include can call setHeader. | [
"Sets",
"a",
"Location",
"header",
".",
"When",
"not",
"in",
"an",
"included",
"page",
"calls",
"setHeader",
"directly",
".",
"When",
"inside",
"of",
"an",
"include",
"will",
"set",
"request",
"attribute",
"so",
"outermost",
"include",
"can",
"call",
"setHea... | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/Includer.java#L127-L135 |
41,651 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/Includer.java | Includer.sendError | public static void sendError(HttpServletRequest request, HttpServletResponse response, int status, String message) throws IOException {
if(request.getAttribute(IS_INCLUDED_REQUEST_ATTRIBUTE_NAME) == null) {
// Not included, sendError directly
if(message == null) {
response.sendError(status);
} else {
... | java | public static void sendError(HttpServletRequest request, HttpServletResponse response, int status, String message) throws IOException {
if(request.getAttribute(IS_INCLUDED_REQUEST_ATTRIBUTE_NAME) == null) {
// Not included, sendError directly
if(message == null) {
response.sendError(status);
} else {
... | [
"public",
"static",
"void",
"sendError",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"int",
"status",
",",
"String",
"message",
")",
"throws",
"IOException",
"{",
"if",
"(",
"request",
".",
"getAttribute",
"(",
"IS_INCLUDED_R... | Sends an error. When not in an included page, calls sendError directly.
When inside of an include will set request attribute so outermost include can call sendError. | [
"Sends",
"an",
"error",
".",
"When",
"not",
"in",
"an",
"included",
"page",
"calls",
"sendError",
"directly",
".",
"When",
"inside",
"of",
"an",
"include",
"will",
"set",
"request",
"attribute",
"so",
"outermost",
"include",
"can",
"call",
"sendError",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/Includer.java#L141-L154 |
41,652 | probedock/probedock-junit | src/main/java/io/probedock/client/junit/AbstractProbeListener.java | AbstractProbeListener.createAndlogStackTrace | protected String createAndlogStackTrace(Failure failure) {
StringBuilder sb = new StringBuilder();
if (failure.getMessage() != null && !failure.getMessage().isEmpty()) {
sb.append("Failure message: ").append(failure.getMessage());
}
if (failure.getException() != null) {
... | java | protected String createAndlogStackTrace(Failure failure) {
StringBuilder sb = new StringBuilder();
if (failure.getMessage() != null && !failure.getMessage().isEmpty()) {
sb.append("Failure message: ").append(failure.getMessage());
}
if (failure.getException() != null) {
... | [
"protected",
"String",
"createAndlogStackTrace",
"(",
"Failure",
"failure",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"failure",
".",
"getMessage",
"(",
")",
"!=",
"null",
"&&",
"!",
"failure",
".",
"getMessage",... | Build a stack trace string
@param failure The failure to get the exceptions and so on
@return The stack trace stringified | [
"Build",
"a",
"stack",
"trace",
"string"
] | a2163dfcb10e94f30d5cd20bca6c62e6e3cd1d46 | https://github.com/probedock/probedock-junit/blob/a2163dfcb10e94f30d5cd20bca6c62e6e3cd1d46/src/main/java/io/probedock/client/junit/AbstractProbeListener.java#L176-L210 |
41,653 | probedock/probedock-junit | src/main/java/io/probedock/client/junit/AbstractProbeListener.java | AbstractProbeListener.getFingerprint | protected final String getFingerprint(Description description) {
return TestResultDataUtils.getFingerprint(description.getTestClass(), description.getMethodName());
} | java | protected final String getFingerprint(Description description) {
return TestResultDataUtils.getFingerprint(description.getTestClass(), description.getMethodName());
} | [
"protected",
"final",
"String",
"getFingerprint",
"(",
"Description",
"description",
")",
"{",
"return",
"TestResultDataUtils",
".",
"getFingerprint",
"(",
"description",
".",
"getTestClass",
"(",
")",
",",
"description",
".",
"getMethodName",
"(",
")",
")",
";",
... | Retrieve the fingerprint of a test based on its description
@param description The description
@return The fingerprint | [
"Retrieve",
"the",
"fingerprint",
"of",
"a",
"test",
"based",
"on",
"its",
"description"
] | a2163dfcb10e94f30d5cd20bca6c62e6e3cd1d46 | https://github.com/probedock/probedock-junit/blob/a2163dfcb10e94f30d5cd20bca6c62e6e3cd1d46/src/main/java/io/probedock/client/junit/AbstractProbeListener.java#L218-L220 |
41,654 | probedock/probedock-junit | src/main/java/io/probedock/client/junit/AbstractProbeListener.java | AbstractProbeListener.getPackage | protected final String getPackage(Class cls) {
return cls.getPackage() != null ? cls.getPackage().getName() : "defaultPackage";
} | java | protected final String getPackage(Class cls) {
return cls.getPackage() != null ? cls.getPackage().getName() : "defaultPackage";
} | [
"protected",
"final",
"String",
"getPackage",
"(",
"Class",
"cls",
")",
"{",
"return",
"cls",
".",
"getPackage",
"(",
")",
"!=",
"null",
"?",
"cls",
".",
"getPackage",
"(",
")",
".",
"getName",
"(",
")",
":",
"\"defaultPackage\"",
";",
"}"
] | Retrieve the package name if available, if not, default package name is used.
@param cls The class to extract the package name
@return The package name if found, "defaultPackage" if not found | [
"Retrieve",
"the",
"package",
"name",
"if",
"available",
"if",
"not",
"default",
"package",
"name",
"is",
"used",
"."
] | a2163dfcb10e94f30d5cd20bca6c62e6e3cd1d46 | https://github.com/probedock/probedock-junit/blob/a2163dfcb10e94f30d5cd20bca6c62e6e3cd1d46/src/main/java/io/probedock/client/junit/AbstractProbeListener.java#L237-L239 |
41,655 | probedock/probedock-java | src/main/java/io/probedock/client/common/utils/Inflector.java | Inflector.getHumanName | public static String getHumanName(String methodName) {
char[] name = methodName.toCharArray();
StringBuilder humanName = new StringBuilder();
boolean digit = false;
boolean upper = true;
int upCount = 0;
for (int i = 0; i < name.length; i++) {
if (i == 0) {... | java | public static String getHumanName(String methodName) {
char[] name = methodName.toCharArray();
StringBuilder humanName = new StringBuilder();
boolean digit = false;
boolean upper = true;
int upCount = 0;
for (int i = 0; i < name.length; i++) {
if (i == 0) {... | [
"public",
"static",
"String",
"getHumanName",
"(",
"String",
"methodName",
")",
"{",
"char",
"[",
"]",
"name",
"=",
"methodName",
".",
"toCharArray",
"(",
")",
";",
"StringBuilder",
"humanName",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"boolean",
"digit",... | Create a human name from a method name
@param methodName The method name to get a human name
@return The human name created | [
"Create",
"a",
"human",
"name",
"from",
"a",
"method",
"name"
] | 92ee6634ba4fe3fdffeb4e202f5372ef947a67c3 | https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/common/utils/Inflector.java#L60-L100 |
41,656 | aoindustries/aocode-public | src/main/java/com/aoindustries/util/sort/IntegerRadixSort.java | IntegerRadixSort.waitForAll | private static void waitForAll(Iterable<? extends Future<?>> futures) throws InterruptedException, ExecutionException {
for(Future<?> future : futures) {
future.get();
}
} | java | private static void waitForAll(Iterable<? extends Future<?>> futures) throws InterruptedException, ExecutionException {
for(Future<?> future : futures) {
future.get();
}
} | [
"private",
"static",
"void",
"waitForAll",
"(",
"Iterable",
"<",
"?",
"extends",
"Future",
"<",
"?",
">",
">",
"futures",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
"{",
"for",
"(",
"Future",
"<",
"?",
">",
"future",
":",
"futures",
... | Waits for all futures to complete, discarding any results.
Note: This method is cloned from ConcurrentUtils.java to avoid package dependency. | [
"Waits",
"for",
"all",
"futures",
"to",
"complete",
"discarding",
"any",
"results",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/sort/IntegerRadixSort.java#L142-L146 |
41,657 | aoindustries/ao-messaging-api | src/main/java/com/aoindustries/messaging/StringMessage.java | StringMessage.decode | public static StringMessage decode(ByteArray encodedMessage) {
if(encodedMessage.size == 0) return EMPTY_STRING_MESSAGE;
return new StringMessage(new String(encodedMessage.array, 0, encodedMessage.size, CHARSET));
} | java | public static StringMessage decode(ByteArray encodedMessage) {
if(encodedMessage.size == 0) return EMPTY_STRING_MESSAGE;
return new StringMessage(new String(encodedMessage.array, 0, encodedMessage.size, CHARSET));
} | [
"public",
"static",
"StringMessage",
"decode",
"(",
"ByteArray",
"encodedMessage",
")",
"{",
"if",
"(",
"encodedMessage",
".",
"size",
"==",
"0",
")",
"return",
"EMPTY_STRING_MESSAGE",
";",
"return",
"new",
"StringMessage",
"(",
"new",
"String",
"(",
"encodedMes... | UTF-8 decodes the message. | [
"UTF",
"-",
"8",
"decodes",
"the",
"message",
"."
] | dbe4d3baefcc846f99b7eeab42646057e99729f0 | https://github.com/aoindustries/ao-messaging-api/blob/dbe4d3baefcc846f99b7eeab42646057e99729f0/src/main/java/com/aoindustries/messaging/StringMessage.java#L40-L44 |
41,658 | aoindustries/ao-messaging-api | src/main/java/com/aoindustries/messaging/StringMessage.java | StringMessage.encodeAsByteArray | @Override
public ByteArray encodeAsByteArray() {
if(message.isEmpty()) return ByteArray.EMPTY_BYTE_ARRAY;
return new ByteArray(message.getBytes(CHARSET));
} | java | @Override
public ByteArray encodeAsByteArray() {
if(message.isEmpty()) return ByteArray.EMPTY_BYTE_ARRAY;
return new ByteArray(message.getBytes(CHARSET));
} | [
"@",
"Override",
"public",
"ByteArray",
"encodeAsByteArray",
"(",
")",
"{",
"if",
"(",
"message",
".",
"isEmpty",
"(",
")",
")",
"return",
"ByteArray",
".",
"EMPTY_BYTE_ARRAY",
";",
"return",
"new",
"ByteArray",
"(",
"message",
".",
"getBytes",
"(",
"CHARSET... | UTF-8 encodes the message. | [
"UTF",
"-",
"8",
"encodes",
"the",
"message",
"."
] | dbe4d3baefcc846f99b7eeab42646057e99729f0 | https://github.com/aoindustries/ao-messaging-api/blob/dbe4d3baefcc846f99b7eeab42646057e99729f0/src/main/java/com/aoindustries/messaging/StringMessage.java#L87-L92 |
41,659 | aoindustries/aocode-public | src/main/java/com/aoindustries/io/CompressedDataInputStream.java | CompressedDataInputStream.readCompressedInt | public static int readCompressedInt(InputStream in) throws IOException {
int b1=in.read();
if(b1==-1) throw new EOFException();
if((b1&0x80)!=0) {
// 31 bit
int b2=in.read();
if(b2==-1) throw new EOFException();
int b3=in.read();
if(b3==-1) throw new EOFException();
int b4=in.read();
if(b4==-... | java | public static int readCompressedInt(InputStream in) throws IOException {
int b1=in.read();
if(b1==-1) throw new EOFException();
if((b1&0x80)!=0) {
// 31 bit
int b2=in.read();
if(b2==-1) throw new EOFException();
int b3=in.read();
if(b3==-1) throw new EOFException();
int b4=in.read();
if(b4==-... | [
"public",
"static",
"int",
"readCompressedInt",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"int",
"b1",
"=",
"in",
".",
"read",
"(",
")",
";",
"if",
"(",
"b1",
"==",
"-",
"1",
")",
"throw",
"new",
"EOFException",
"(",
")",
";",
"if"... | Reads a compressed integer from the stream.
The 31 bit pattern is as follows:
<pre>
5 bit - 000SXXXX
13 bit - 001SXXXX XXXXXXXX
22 bit - 01SXXXXX XXXXXXXX XXXXXXXX
31 bit - 1SXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
</pre>
@exception EOFException if the end of file is reached | [
"Reads",
"a",
"compressed",
"integer",
"from",
"the",
"stream",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/CompressedDataInputStream.java#L54-L100 |
41,660 | aoindustries/aocode-public | src/main/java/com/aoindustries/io/CompressedDataInputStream.java | CompressedDataInputStream.readLongUTF | public String readLongUTF() throws IOException {
int length = readCompressedInt();
StringBuilder SB = new StringBuilder(length);
for(int position = 0; position<length; position+=20480) {
int expectedLen = length - position;
if(expectedLen>20480) expectedLen = 20480;
String block = readUTF();
if(block.... | java | public String readLongUTF() throws IOException {
int length = readCompressedInt();
StringBuilder SB = new StringBuilder(length);
for(int position = 0; position<length; position+=20480) {
int expectedLen = length - position;
if(expectedLen>20480) expectedLen = 20480;
String block = readUTF();
if(block.... | [
"public",
"String",
"readLongUTF",
"(",
")",
"throws",
"IOException",
"{",
"int",
"length",
"=",
"readCompressedInt",
"(",
")",
";",
"StringBuilder",
"SB",
"=",
"new",
"StringBuilder",
"(",
"length",
")",
";",
"for",
"(",
"int",
"position",
"=",
"0",
";",
... | Reads a string of any length. | [
"Reads",
"a",
"string",
"of",
"any",
"length",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/CompressedDataInputStream.java#L173-L185 |
41,661 | aoindustries/aocode-public | src/main/java/com/aoindustries/swing/SynchronizingMutableTreeNode.java | SynchronizingMutableTreeNode.synchronize | public void synchronize(DefaultTreeModel treeModel, Tree<E> tree) throws IOException, SQLException {
assert SwingUtilities.isEventDispatchThread() : ApplicationResources.accessor.getMessage("assert.notRunningInSwingEventThread");
synchronize(treeModel, tree.getRootNodes());
} | java | public void synchronize(DefaultTreeModel treeModel, Tree<E> tree) throws IOException, SQLException {
assert SwingUtilities.isEventDispatchThread() : ApplicationResources.accessor.getMessage("assert.notRunningInSwingEventThread");
synchronize(treeModel, tree.getRootNodes());
} | [
"public",
"void",
"synchronize",
"(",
"DefaultTreeModel",
"treeModel",
",",
"Tree",
"<",
"E",
">",
"tree",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"assert",
"SwingUtilities",
".",
"isEventDispatchThread",
"(",
")",
":",
"ApplicationResources",
".",... | Synchronizes the children of this node with the roots of the provided
tree while adding and removing only a minimum number of nodes.
Comparisons are performed using equals on the value objects. This must
be called from the Swing event dispatch thread. | [
"Synchronizes",
"the",
"children",
"of",
"this",
"node",
"with",
"the",
"roots",
"of",
"the",
"provided",
"tree",
"while",
"adding",
"and",
"removing",
"only",
"a",
"minimum",
"number",
"of",
"nodes",
".",
"Comparisons",
"are",
"performed",
"using",
"equals",
... | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/swing/SynchronizingMutableTreeNode.java#L69-L72 |
41,662 | aoindustries/aocode-public | src/main/java/com/aoindustries/swing/SynchronizingMutableTreeNode.java | SynchronizingMutableTreeNode.synchronize | @SuppressWarnings("unchecked")
public void synchronize(DefaultTreeModel treeModel, List<Node<E>> children) throws IOException, SQLException {
assert SwingUtilities.isEventDispatchThread() : ApplicationResources.accessor.getMessage("assert.notRunningInSwingEventThread");
if(children==null) {
// No children allow... | java | @SuppressWarnings("unchecked")
public void synchronize(DefaultTreeModel treeModel, List<Node<E>> children) throws IOException, SQLException {
assert SwingUtilities.isEventDispatchThread() : ApplicationResources.accessor.getMessage("assert.notRunningInSwingEventThread");
if(children==null) {
// No children allow... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"synchronize",
"(",
"DefaultTreeModel",
"treeModel",
",",
"List",
"<",
"Node",
"<",
"E",
">",
">",
"children",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"assert",
"SwingUtilities... | Synchronizes the children of this node with the provided children
while adding and removing only a minimum number of nodes.
Comparisons are performed using equals on the value objects. This must
be called from the Swing event dispatch thread.
@param children If children is null, then doesn't allow children. | [
"Synchronizes",
"the",
"children",
"of",
"this",
"node",
"with",
"the",
"provided",
"children",
"while",
"adding",
"and",
"removing",
"only",
"a",
"minimum",
"number",
"of",
"nodes",
".",
"Comparisons",
"are",
"performed",
"using",
"equals",
"on",
"the",
"valu... | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/swing/SynchronizingMutableTreeNode.java#L82-L141 |
41,663 | aoindustries/semanticcms-core-model | src/main/java/com/semanticcms/core/model/Page.java | Page.checkDates | private void checkDates() {
DateTime created = this.dateCreated;
DateTime published = this.datePublished;
DateTime modified = this.dateModified;
DateTime reviewed = this.dateReviewed;
if(
created != null
&& published != null
&& published.compareTo(created) < 0
) throw new IllegalArgumentException("... | java | private void checkDates() {
DateTime created = this.dateCreated;
DateTime published = this.datePublished;
DateTime modified = this.dateModified;
DateTime reviewed = this.dateReviewed;
if(
created != null
&& published != null
&& published.compareTo(created) < 0
) throw new IllegalArgumentException("... | [
"private",
"void",
"checkDates",
"(",
")",
"{",
"DateTime",
"created",
"=",
"this",
".",
"dateCreated",
";",
"DateTime",
"published",
"=",
"this",
".",
"datePublished",
";",
"DateTime",
"modified",
"=",
"this",
".",
"dateModified",
";",
"DateTime",
"reviewed",... | Checks the dates for consistency. | [
"Checks",
"the",
"dates",
"for",
"consistency",
"."
] | 14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624 | https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/Page.java#L233-L253 |
41,664 | aoindustries/semanticcms-core-model | src/main/java/com/semanticcms/core/model/Page.java | Page.getElementsById | public Map<String,Element> getElementsById() {
synchronized(lock) {
if(elementsById == null) return Collections.emptyMap();
if(frozen) return elementsById;
return AoCollections.unmodifiableCopyMap(elementsById);
}
} | java | public Map<String,Element> getElementsById() {
synchronized(lock) {
if(elementsById == null) return Collections.emptyMap();
if(frozen) return elementsById;
return AoCollections.unmodifiableCopyMap(elementsById);
}
} | [
"public",
"Map",
"<",
"String",
",",
"Element",
">",
"getElementsById",
"(",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"elementsById",
"==",
"null",
")",
"return",
"Collections",
".",
"emptyMap",
"(",
")",
";",
"if",
"(",
"frozen",
")... | Gets the elements indexed by id, in no particular order.
Note, while the page is being created, elements with automatic IDs will not be in
this map. However, once frozen, every element will have an ID.
@see #freeze() | [
"Gets",
"the",
"elements",
"indexed",
"by",
"id",
"in",
"no",
"particular",
"order",
".",
"Note",
"while",
"the",
"page",
"is",
"being",
"created",
"elements",
"with",
"automatic",
"IDs",
"will",
"not",
"be",
"in",
"this",
"map",
".",
"However",
"once",
... | 14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624 | https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/Page.java#L428-L434 |
41,665 | aoindustries/semanticcms-core-model | src/main/java/com/semanticcms/core/model/Page.java | Page.getGeneratedIds | public Set<String> getGeneratedIds() {
synchronized(lock) {
if(generatedIds == null) return Collections.emptySet();
if(frozen) return generatedIds;
return AoCollections.unmodifiableCopySet(generatedIds);
}
} | java | public Set<String> getGeneratedIds() {
synchronized(lock) {
if(generatedIds == null) return Collections.emptySet();
if(frozen) return generatedIds;
return AoCollections.unmodifiableCopySet(generatedIds);
}
} | [
"public",
"Set",
"<",
"String",
">",
"getGeneratedIds",
"(",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"generatedIds",
"==",
"null",
")",
"return",
"Collections",
".",
"emptySet",
"(",
")",
";",
"if",
"(",
"frozen",
")",
"return",
"ge... | Gets which element IDs were generated. | [
"Gets",
"which",
"element",
"IDs",
"were",
"generated",
"."
] | 14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624 | https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/Page.java#L439-L445 |
41,666 | aoindustries/semanticcms-core-model | src/main/java/com/semanticcms/core/model/Page.java | Page.addElement | public void addElement(Element element) {
synchronized(lock) {
checkNotFrozen();
element.setPage(this);
// elements
if(elements == null) elements = new ArrayList<>();
elements.add(element);
// elementsById
addToElementsById(element, false);
}
} | java | public void addElement(Element element) {
synchronized(lock) {
checkNotFrozen();
element.setPage(this);
// elements
if(elements == null) elements = new ArrayList<>();
elements.add(element);
// elementsById
addToElementsById(element, false);
}
} | [
"public",
"void",
"addElement",
"(",
"Element",
"element",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"checkNotFrozen",
"(",
")",
";",
"element",
".",
"setPage",
"(",
"this",
")",
";",
"// elements",
"if",
"(",
"elements",
"==",
"null",
")",
"eleme... | Adds an element to this page. | [
"Adds",
"an",
"element",
"to",
"this",
"page",
"."
] | 14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624 | https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/Page.java#L450-L460 |
41,667 | NessComputing/components-ness-jms | src/main/java/com/nesscomputing/jms/JmsUtils.java | JmsUtils.closeQuietly | public static void closeQuietly(final MessageConsumer consumer)
{
if (consumer != null) {
try {
consumer.close();
}
catch (JMSException je) {
if (je.getCause() instanceof InterruptedException) {
LOG.trace("ActiveMQ caugh... | java | public static void closeQuietly(final MessageConsumer consumer)
{
if (consumer != null) {
try {
consumer.close();
}
catch (JMSException je) {
if (je.getCause() instanceof InterruptedException) {
LOG.trace("ActiveMQ caugh... | [
"public",
"static",
"void",
"closeQuietly",
"(",
"final",
"MessageConsumer",
"consumer",
")",
"{",
"if",
"(",
"consumer",
"!=",
"null",
")",
"{",
"try",
"{",
"consumer",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"JMSException",
"je",
")",
"{",
"i... | Close a message consumer.
@param consumer | [
"Close",
"a",
"message",
"consumer",
"."
] | 29e0d320ada3a1a375483437a9f3ff629822b714 | https://github.com/NessComputing/components-ness-jms/blob/29e0d320ada3a1a375483437a9f3ff629822b714/src/main/java/com/nesscomputing/jms/JmsUtils.java#L44-L62 |
41,668 | NessComputing/components-ness-jms | src/main/java/com/nesscomputing/jms/JmsUtils.java | JmsUtils.closeQuietly | public static void closeQuietly(final MessageProducer producer)
{
if (producer != null) {
try {
producer.close();
}
catch (JMSException je) {
if (je.getCause() instanceof InterruptedException) {
LOG.trace("ActiveMQ caugh... | java | public static void closeQuietly(final MessageProducer producer)
{
if (producer != null) {
try {
producer.close();
}
catch (JMSException je) {
if (je.getCause() instanceof InterruptedException) {
LOG.trace("ActiveMQ caugh... | [
"public",
"static",
"void",
"closeQuietly",
"(",
"final",
"MessageProducer",
"producer",
")",
"{",
"if",
"(",
"producer",
"!=",
"null",
")",
"{",
"try",
"{",
"producer",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"JMSException",
"je",
")",
"{",
"i... | Close a message producer.
@param producer | [
"Close",
"a",
"message",
"producer",
"."
] | 29e0d320ada3a1a375483437a9f3ff629822b714 | https://github.com/NessComputing/components-ness-jms/blob/29e0d320ada3a1a375483437a9f3ff629822b714/src/main/java/com/nesscomputing/jms/JmsUtils.java#L69-L87 |
41,669 | aoindustries/ao-messaging-api | src/main/java/com/aoindustries/messaging/ByteArrayMessage.java | ByteArrayMessage.decode | public static ByteArrayMessage decode(String encodedMessage) {
if(encodedMessage.isEmpty()) return EMPTY_BYTE_ARRAY_MESSAGE;
return new ByteArrayMessage(Base64Coder.decode(encodedMessage));
} | java | public static ByteArrayMessage decode(String encodedMessage) {
if(encodedMessage.isEmpty()) return EMPTY_BYTE_ARRAY_MESSAGE;
return new ByteArrayMessage(Base64Coder.decode(encodedMessage));
} | [
"public",
"static",
"ByteArrayMessage",
"decode",
"(",
"String",
"encodedMessage",
")",
"{",
"if",
"(",
"encodedMessage",
".",
"isEmpty",
"(",
")",
")",
"return",
"EMPTY_BYTE_ARRAY_MESSAGE",
";",
"return",
"new",
"ByteArrayMessage",
"(",
"Base64Coder",
".",
"decod... | base-64 decodes the message. | [
"base",
"-",
"64",
"decodes",
"the",
"message",
"."
] | dbe4d3baefcc846f99b7eeab42646057e99729f0 | https://github.com/aoindustries/ao-messaging-api/blob/dbe4d3baefcc846f99b7eeab42646057e99729f0/src/main/java/com/aoindustries/messaging/ByteArrayMessage.java#L37-L41 |
41,670 | aoindustries/aocode-public | src/main/java/com/aoindustries/ws/WsEncoder.java | WsEncoder.encode | public static String encode(String value) {
if(value==null) return null;
StringBuilder encoded=null;
int len=value.length();
for(int c=0;c<len;c++) {
char ch=value.charAt(c);
if(
(ch<' ' && ch!='\n' && ch!='\r')
|| ch=='\\'
) {
if(encoded==null) {
encoded=new StringBuilder();
if(... | java | public static String encode(String value) {
if(value==null) return null;
StringBuilder encoded=null;
int len=value.length();
for(int c=0;c<len;c++) {
char ch=value.charAt(c);
if(
(ch<' ' && ch!='\n' && ch!='\r')
|| ch=='\\'
) {
if(encoded==null) {
encoded=new StringBuilder();
if(... | [
"public",
"static",
"String",
"encode",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"StringBuilder",
"encoded",
"=",
"null",
";",
"int",
"len",
"=",
"value",
".",
"length",
"(",
")",
";",
"for",
"("... | Encodes string for binary transparency over SOAP. | [
"Encodes",
"string",
"for",
"binary",
"transparency",
"over",
"SOAP",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/ws/WsEncoder.java#L64-L98 |
41,671 | buschmais/jqa-javaee6-plugin | src/main/java/com/buschmais/jqassistant/plugin/javaee6/impl/scanner/XmlDescriptorHelper.java | XmlDescriptorHelper.createDescription | public static DescriptionDescriptor createDescription(DescriptionType descriptionType, Store store) {
DescriptionDescriptor descriptionDescriptor = store.create(DescriptionDescriptor.class);
descriptionDescriptor.setLang(descriptionType.getLang());
descriptionDescriptor.setValue(descriptionType.... | java | public static DescriptionDescriptor createDescription(DescriptionType descriptionType, Store store) {
DescriptionDescriptor descriptionDescriptor = store.create(DescriptionDescriptor.class);
descriptionDescriptor.setLang(descriptionType.getLang());
descriptionDescriptor.setValue(descriptionType.... | [
"public",
"static",
"DescriptionDescriptor",
"createDescription",
"(",
"DescriptionType",
"descriptionType",
",",
"Store",
"store",
")",
"{",
"DescriptionDescriptor",
"descriptionDescriptor",
"=",
"store",
".",
"create",
"(",
"DescriptionDescriptor",
".",
"class",
")",
... | Create a description descriptor.
@param descriptionType
The XML description type.
@param store
The store.
@return The description descriptor. | [
"Create",
"a",
"description",
"descriptor",
"."
] | f5776604d9255206807e5aca90b8767bde494e14 | https://github.com/buschmais/jqa-javaee6-plugin/blob/f5776604d9255206807e5aca90b8767bde494e14/src/main/java/com/buschmais/jqassistant/plugin/javaee6/impl/scanner/XmlDescriptorHelper.java#L22-L27 |
41,672 | buschmais/jqa-javaee6-plugin | src/main/java/com/buschmais/jqassistant/plugin/javaee6/impl/scanner/XmlDescriptorHelper.java | XmlDescriptorHelper.createIcon | public static IconDescriptor createIcon(IconType iconType, Store store) {
IconDescriptor iconDescriptor = store.create(IconDescriptor.class);
iconDescriptor.setLang(iconType.getLang());
PathType largeIcon = iconType.getLargeIcon();
if (largeIcon != null) {
iconDescriptor.setL... | java | public static IconDescriptor createIcon(IconType iconType, Store store) {
IconDescriptor iconDescriptor = store.create(IconDescriptor.class);
iconDescriptor.setLang(iconType.getLang());
PathType largeIcon = iconType.getLargeIcon();
if (largeIcon != null) {
iconDescriptor.setL... | [
"public",
"static",
"IconDescriptor",
"createIcon",
"(",
"IconType",
"iconType",
",",
"Store",
"store",
")",
"{",
"IconDescriptor",
"iconDescriptor",
"=",
"store",
".",
"create",
"(",
"IconDescriptor",
".",
"class",
")",
";",
"iconDescriptor",
".",
"setLang",
"(... | Create an icon descriptor.
@param iconType
The XML icon type.
@param store
The store
@return The icon descriptor. | [
"Create",
"an",
"icon",
"descriptor",
"."
] | f5776604d9255206807e5aca90b8767bde494e14 | https://github.com/buschmais/jqa-javaee6-plugin/blob/f5776604d9255206807e5aca90b8767bde494e14/src/main/java/com/buschmais/jqassistant/plugin/javaee6/impl/scanner/XmlDescriptorHelper.java#L38-L50 |
41,673 | buschmais/jqa-javaee6-plugin | src/main/java/com/buschmais/jqassistant/plugin/javaee6/impl/scanner/XmlDescriptorHelper.java | XmlDescriptorHelper.createDisplayName | public static DisplayNameDescriptor createDisplayName(DisplayNameType displayNameType, Store store) {
DisplayNameDescriptor displayNameDescriptor = store.create(DisplayNameDescriptor.class);
displayNameDescriptor.setLang(displayNameType.getLang());
displayNameDescriptor.setValue(displayNameType.... | java | public static DisplayNameDescriptor createDisplayName(DisplayNameType displayNameType, Store store) {
DisplayNameDescriptor displayNameDescriptor = store.create(DisplayNameDescriptor.class);
displayNameDescriptor.setLang(displayNameType.getLang());
displayNameDescriptor.setValue(displayNameType.... | [
"public",
"static",
"DisplayNameDescriptor",
"createDisplayName",
"(",
"DisplayNameType",
"displayNameType",
",",
"Store",
"store",
")",
"{",
"DisplayNameDescriptor",
"displayNameDescriptor",
"=",
"store",
".",
"create",
"(",
"DisplayNameDescriptor",
".",
"class",
")",
... | Create a display name descriptor.
@param displayNameType
The XML display name type.
@param store
The store.
@return The display name descriptor. | [
"Create",
"a",
"display",
"name",
"descriptor",
"."
] | f5776604d9255206807e5aca90b8767bde494e14 | https://github.com/buschmais/jqa-javaee6-plugin/blob/f5776604d9255206807e5aca90b8767bde494e14/src/main/java/com/buschmais/jqassistant/plugin/javaee6/impl/scanner/XmlDescriptorHelper.java#L61-L66 |
41,674 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/ServletUtil.java | ServletUtil.getRequestEncoding | public static String getRequestEncoding(ServletRequest request) {
String requestEncoding = request.getCharacterEncoding();
return requestEncoding != null ? requestEncoding : DEFAULT_REQUEST_ENCODING;
} | java | public static String getRequestEncoding(ServletRequest request) {
String requestEncoding = request.getCharacterEncoding();
return requestEncoding != null ? requestEncoding : DEFAULT_REQUEST_ENCODING;
} | [
"public",
"static",
"String",
"getRequestEncoding",
"(",
"ServletRequest",
"request",
")",
"{",
"String",
"requestEncoding",
"=",
"request",
".",
"getCharacterEncoding",
"(",
")",
";",
"return",
"requestEncoding",
"!=",
"null",
"?",
"requestEncoding",
":",
"DEFAULT_... | Gets the request encoding or ISO-8859-1 when not available. | [
"Gets",
"the",
"request",
"encoding",
"or",
"ISO",
"-",
"8859",
"-",
"1",
"when",
"not",
"available",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/ServletUtil.java#L80-L83 |
41,675 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/ServletUtil.java | ServletUtil.getAbsoluteURL | public static void getAbsoluteURL(HttpServletRequest request, String relPath, Appendable out) throws IOException {
out.append(request.isSecure() ? "https://" : "http://");
out.append(request.getServerName());
int port = request.getServerPort();
if(port!=(request.isSecure() ? 443 : 80)) out.append(':').append(In... | java | public static void getAbsoluteURL(HttpServletRequest request, String relPath, Appendable out) throws IOException {
out.append(request.isSecure() ? "https://" : "http://");
out.append(request.getServerName());
int port = request.getServerPort();
if(port!=(request.isSecure() ? 443 : 80)) out.append(':').append(In... | [
"public",
"static",
"void",
"getAbsoluteURL",
"(",
"HttpServletRequest",
"request",
",",
"String",
"relPath",
",",
"Appendable",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"append",
"(",
"request",
".",
"isSecure",
"(",
")",
"?",
"\"https://\"",
":"... | Gets an absolute URL for the given context-relative path. This includes
protocol, port, context path, and relative path.
No URL rewriting is performed. | [
"Gets",
"an",
"absolute",
"URL",
"for",
"the",
"given",
"context",
"-",
"relative",
"path",
".",
"This",
"includes",
"protocol",
"port",
"context",
"path",
"and",
"relative",
"path",
".",
"No",
"URL",
"rewriting",
"is",
"performed",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/ServletUtil.java#L265-L272 |
41,676 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/ServletUtil.java | ServletUtil.getRedirectLocation | public static String getRedirectLocation(
HttpServletRequest request,
HttpServletResponse response,
String servletPath,
String href
) throws MalformedURLException, UnsupportedEncodingException {
// Convert page-relative paths to context-relative path, resolving ./ and ../
href = getAbsolutePath(servletPath... | java | public static String getRedirectLocation(
HttpServletRequest request,
HttpServletResponse response,
String servletPath,
String href
) throws MalformedURLException, UnsupportedEncodingException {
// Convert page-relative paths to context-relative path, resolving ./ and ../
href = getAbsolutePath(servletPath... | [
"public",
"static",
"String",
"getRedirectLocation",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"String",
"servletPath",
",",
"String",
"href",
")",
"throws",
"MalformedURLException",
",",
"UnsupportedEncodingException",
"{",
"// Co... | Gets the absolute URL that should be used for a redirect.
@param href The absolute, context-relative, or page-relative path to redirect to.
The following actions are performed on the provided href:
<ol>
<li>Convert page-relative paths to context-relative path, resolving ./ and ../</li>
<li>Encode URL path elements (... | [
"Gets",
"the",
"absolute",
"URL",
"that",
"should",
"be",
"used",
"for",
"a",
"redirect",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/ServletUtil.java#L306-L325 |
41,677 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/ServletUtil.java | ServletUtil.sendRedirect | public static void sendRedirect(
HttpServletResponse response,
String location,
int status
) throws IllegalStateException, IOException {
// Response must not be committed
if(response.isCommitted()) throw new IllegalStateException("Unable to redirect: Response already committed");
response.setHeader("Locat... | java | public static void sendRedirect(
HttpServletResponse response,
String location,
int status
) throws IllegalStateException, IOException {
// Response must not be committed
if(response.isCommitted()) throw new IllegalStateException("Unable to redirect: Response already committed");
response.setHeader("Locat... | [
"public",
"static",
"void",
"sendRedirect",
"(",
"HttpServletResponse",
"response",
",",
"String",
"location",
",",
"int",
"status",
")",
"throws",
"IllegalStateException",
",",
"IOException",
"{",
"// Response must not be committed",
"if",
"(",
"response",
".",
"isCo... | Sends a redirect to the provided absolute URL location.
@see #getRedirectLocation(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.String) | [
"Sends",
"a",
"redirect",
"to",
"the",
"provided",
"absolute",
"URL",
"location",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/ServletUtil.java#L332-L342 |
41,678 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/ServletUtil.java | ServletUtil.sendRedirect | public static void sendRedirect(
HttpServletRequest request,
HttpServletResponse response,
String href,
int status
) throws IllegalStateException, IOException {
sendRedirect(
response,
getRedirectLocation(
request,
response,
request.getServletPath(),
href
),
status
);
} | java | public static void sendRedirect(
HttpServletRequest request,
HttpServletResponse response,
String href,
int status
) throws IllegalStateException, IOException {
sendRedirect(
response,
getRedirectLocation(
request,
response,
request.getServletPath(),
href
),
status
);
} | [
"public",
"static",
"void",
"sendRedirect",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"String",
"href",
",",
"int",
"status",
")",
"throws",
"IllegalStateException",
",",
"IOException",
"{",
"sendRedirect",
"(",
"response",
"... | Sends a redirect with relative paths determined from the request servlet path.
@see #getRedirectLocation(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.String) for transformations applied to the href | [
"Sends",
"a",
"redirect",
"with",
"relative",
"paths",
"determined",
"from",
"the",
"request",
"servlet",
"path",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/ServletUtil.java#L349-L365 |
41,679 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/ServletUtil.java | ServletUtil.getContextRequestUri | public static String getContextRequestUri(HttpServletRequest request) {
String requestUri = request.getRequestURI();
String contextPath = request.getContextPath();
int cpLen = contextPath.length();
if(cpLen > 0) {
assert requestUri.startsWith(contextPath);
return requestUri.substring(cpLen);
} else {
... | java | public static String getContextRequestUri(HttpServletRequest request) {
String requestUri = request.getRequestURI();
String contextPath = request.getContextPath();
int cpLen = contextPath.length();
if(cpLen > 0) {
assert requestUri.startsWith(contextPath);
return requestUri.substring(cpLen);
} else {
... | [
"public",
"static",
"String",
"getContextRequestUri",
"(",
"HttpServletRequest",
"request",
")",
"{",
"String",
"requestUri",
"=",
"request",
".",
"getRequestURI",
"(",
")",
";",
"String",
"contextPath",
"=",
"request",
".",
"getContextPath",
"(",
")",
";",
"int... | Gets the current request URI in context-relative form. The contextPath stripped. | [
"Gets",
"the",
"current",
"request",
"URI",
"in",
"context",
"-",
"relative",
"form",
".",
"The",
"contextPath",
"stripped",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/ServletUtil.java#L370-L380 |
41,680 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/ServletUtil.java | ServletUtil.doOptions | public static <S extends HttpServlet> void doOptions(
HttpServletResponse response,
Class<S> stopClass,
Class<? extends S> thisClass,
String doGet,
String doPost,
String doPut,
String doDelete,
Class<?>[] paramTypes
) {
boolean ALLOW_GET = false;
boolean ALLOW_HEAD = false;
boolean ALLOW_POST = f... | java | public static <S extends HttpServlet> void doOptions(
HttpServletResponse response,
Class<S> stopClass,
Class<? extends S> thisClass,
String doGet,
String doPost,
String doPut,
String doDelete,
Class<?>[] paramTypes
) {
boolean ALLOW_GET = false;
boolean ALLOW_HEAD = false;
boolean ALLOW_POST = f... | [
"public",
"static",
"<",
"S",
"extends",
"HttpServlet",
">",
"void",
"doOptions",
"(",
"HttpServletResponse",
"response",
",",
"Class",
"<",
"S",
">",
"stopClass",
",",
"Class",
"<",
"?",
"extends",
"S",
">",
"thisClass",
",",
"String",
"doGet",
",",
"Stri... | A reusable doOptions implementation for servlets. | [
"A",
"reusable",
"doOptions",
"implementation",
"for",
"servlets",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/ServletUtil.java#L416-L481 |
41,681 | NessComputing/components-ness-httpserver | src/main/java/com/nesscomputing/httpserver/HttpConnector.java | HttpConnector.getPort | public int getPort()
{
if (port != 0) {
return port;
}
else {
final Connector connector = connectorHolder.get();
if (connector != null) {
Preconditions.checkState(connector.getLocalPort() > 0, "no port was set and the connector is not yet s... | java | public int getPort()
{
if (port != 0) {
return port;
}
else {
final Connector connector = connectorHolder.get();
if (connector != null) {
Preconditions.checkState(connector.getLocalPort() > 0, "no port was set and the connector is not yet s... | [
"public",
"int",
"getPort",
"(",
")",
"{",
"if",
"(",
"port",
"!=",
"0",
")",
"{",
"return",
"port",
";",
"}",
"else",
"{",
"final",
"Connector",
"connector",
"=",
"connectorHolder",
".",
"get",
"(",
")",
";",
"if",
"(",
"connector",
"!=",
"null",
... | Returns the system port for this connector. | [
"Returns",
"the",
"system",
"port",
"for",
"this",
"connector",
"."
] | 6a26bb852e8408e3499ad5d139961cdc6a96e857 | https://github.com/NessComputing/components-ness-httpserver/blob/6a26bb852e8408e3499ad5d139961cdc6a96e857/src/main/java/com/nesscomputing/httpserver/HttpConnector.java#L74-L89 |
41,682 | aoindustries/semanticcms-openfile-servlet | src/main/java/com/semanticcms/openfile/servlet/OpenFile.java | OpenFile.isAllowed | public static boolean isAllowed(ServletContext servletContext, ServletRequest request) {
return
Boolean.parseBoolean(servletContext.getInitParameter(ENABLE_INIT_PARAM))
&& isAllowedAddr(request.getRemoteAddr())
;
} | java | public static boolean isAllowed(ServletContext servletContext, ServletRequest request) {
return
Boolean.parseBoolean(servletContext.getInitParameter(ENABLE_INIT_PARAM))
&& isAllowedAddr(request.getRemoteAddr())
;
} | [
"public",
"static",
"boolean",
"isAllowed",
"(",
"ServletContext",
"servletContext",
",",
"ServletRequest",
"request",
")",
"{",
"return",
"Boolean",
".",
"parseBoolean",
"(",
"servletContext",
".",
"getInitParameter",
"(",
"ENABLE_INIT_PARAM",
")",
")",
"&&",
"isAl... | Checks if the given request is allowed to open files on the server.
The servlet init param must have it enabled, as well as be from an allowed IP. | [
"Checks",
"if",
"the",
"given",
"request",
"is",
"allowed",
"to",
"open",
"files",
"on",
"the",
"server",
".",
"The",
"servlet",
"init",
"param",
"must",
"have",
"it",
"enabled",
"as",
"well",
"as",
"be",
"from",
"an",
"allowed",
"IP",
"."
] | d22b2580b57708311949ac1088e3275355774921 | https://github.com/aoindustries/semanticcms-openfile-servlet/blob/d22b2580b57708311949ac1088e3275355774921/src/main/java/com/semanticcms/openfile/servlet/OpenFile.java#L70-L75 |
41,683 | aoindustries/semanticcms-openfile-servlet | src/main/java/com/semanticcms/openfile/servlet/OpenFile.java | OpenFile.addFileOpener | public static void addFileOpener(ServletContext servletContext, FileOpener fileOpener, String ... extensions) {
synchronized(fileOpenersLock) {
@SuppressWarnings("unchecked")
Map<String,FileOpener> fileOpeners = (Map<String,FileOpener>)servletContext.getAttribute(FILE_OPENERS_REQUEST_ATTRIBUTE_NAME);
if(file... | java | public static void addFileOpener(ServletContext servletContext, FileOpener fileOpener, String ... extensions) {
synchronized(fileOpenersLock) {
@SuppressWarnings("unchecked")
Map<String,FileOpener> fileOpeners = (Map<String,FileOpener>)servletContext.getAttribute(FILE_OPENERS_REQUEST_ATTRIBUTE_NAME);
if(file... | [
"public",
"static",
"void",
"addFileOpener",
"(",
"ServletContext",
"servletContext",
",",
"FileOpener",
"fileOpener",
",",
"String",
"...",
"extensions",
")",
"{",
"synchronized",
"(",
"fileOpenersLock",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",... | Registers a file opener.
@param extensions The simple extensions, in lowercase, not including the dot, such as "dia" | [
"Registers",
"a",
"file",
"opener",
"."
] | d22b2580b57708311949ac1088e3275355774921 | https://github.com/aoindustries/semanticcms-openfile-servlet/blob/d22b2580b57708311949ac1088e3275355774921/src/main/java/com/semanticcms/openfile/servlet/OpenFile.java#L115-L128 |
41,684 | aoindustries/semanticcms-openfile-servlet | src/main/java/com/semanticcms/openfile/servlet/OpenFile.java | OpenFile.removeFileOpener | public static void removeFileOpener(ServletContext servletContext, String ... extensions) {
synchronized(fileOpenersLock) {
@SuppressWarnings("unchecked")
Map<String,FileOpener> fileOpeners = (Map<String,FileOpener>)servletContext.getAttribute(FILE_OPENERS_REQUEST_ATTRIBUTE_NAME);
if(fileOpeners != null) {
... | java | public static void removeFileOpener(ServletContext servletContext, String ... extensions) {
synchronized(fileOpenersLock) {
@SuppressWarnings("unchecked")
Map<String,FileOpener> fileOpeners = (Map<String,FileOpener>)servletContext.getAttribute(FILE_OPENERS_REQUEST_ATTRIBUTE_NAME);
if(fileOpeners != null) {
... | [
"public",
"static",
"void",
"removeFileOpener",
"(",
"ServletContext",
"servletContext",
",",
"String",
"...",
"extensions",
")",
"{",
"synchronized",
"(",
"fileOpenersLock",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Map",
"<",
"String",
",",
... | Removes file openers.
@param extensions The simple extensions, in lowercase, not including the dot, such as "dia" | [
"Removes",
"file",
"openers",
"."
] | d22b2580b57708311949ac1088e3275355774921 | https://github.com/aoindustries/semanticcms-openfile-servlet/blob/d22b2580b57708311949ac1088e3275355774921/src/main/java/com/semanticcms/openfile/servlet/OpenFile.java#L135-L148 |
41,685 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/Cookies.java | Cookies.addCookie | public static void addCookie(
HttpServletRequest request,
HttpServletResponse response,
String cookieName,
String value,
String comment,
int maxAge,
boolean secure,
boolean contextOnlyPath
) {
Cookie newCookie = new Cookie(cookieName, value);
if(comment!=null) newCookie.setComment(comment);
newCo... | java | public static void addCookie(
HttpServletRequest request,
HttpServletResponse response,
String cookieName,
String value,
String comment,
int maxAge,
boolean secure,
boolean contextOnlyPath
) {
Cookie newCookie = new Cookie(cookieName, value);
if(comment!=null) newCookie.setComment(comment);
newCo... | [
"public",
"static",
"void",
"addCookie",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"String",
"cookieName",
",",
"String",
"value",
",",
"String",
"comment",
",",
"int",
"maxAge",
",",
"boolean",
"secure",
",",
"boolean",
... | Adds a cookie. | [
"Adds",
"a",
"cookie",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/Cookies.java#L43-L66 |
41,686 | aoindustries/aocode-public | src/main/java/com/aoindustries/servlet/http/Cookies.java | Cookies.removeCookie | public static void removeCookie(
HttpServletRequest request,
HttpServletResponse response,
String cookieName,
boolean secure,
boolean contextOnlyPath
) {
addCookie(request, response, cookieName, "Removed", null, 0, secure, contextOnlyPath);
} | java | public static void removeCookie(
HttpServletRequest request,
HttpServletResponse response,
String cookieName,
boolean secure,
boolean contextOnlyPath
) {
addCookie(request, response, cookieName, "Removed", null, 0, secure, contextOnlyPath);
} | [
"public",
"static",
"void",
"removeCookie",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"String",
"cookieName",
",",
"boolean",
"secure",
",",
"boolean",
"contextOnlyPath",
")",
"{",
"addCookie",
"(",
"request",
",",
"response"... | Removes a cookie by adding it with maxAge of zero. | [
"Removes",
"a",
"cookie",
"by",
"adding",
"it",
"with",
"maxAge",
"of",
"zero",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/Cookies.java#L85-L93 |
41,687 | aoindustries/aocode-public | src/main/java/com/aoindustries/table/Column.java | Column.compareTo | @Override
public int compareTo(Column o) {
int diff = name.compareToIgnoreCase(o.name);
if(diff!=0) return diff;
return name.compareTo(o.name);
} | java | @Override
public int compareTo(Column o) {
int diff = name.compareToIgnoreCase(o.name);
if(diff!=0) return diff;
return name.compareTo(o.name);
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"Column",
"o",
")",
"{",
"int",
"diff",
"=",
"name",
".",
"compareToIgnoreCase",
"(",
"o",
".",
"name",
")",
";",
"if",
"(",
"diff",
"!=",
"0",
")",
"return",
"diff",
";",
"return",
"name",
".",
"... | Ordered by column name only. | [
"Ordered",
"by",
"column",
"name",
"only",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/table/Column.java#L61-L66 |
41,688 | aoindustries/aocode-public | src/main/java/com/aoindustries/md5/MD5InputStream.java | MD5InputStream.read | @Override
public int read() throws IOException {
int c = in.read();
if (c == -1) return -1;
md5.Update(c);
return c;
} | java | @Override
public int read() throws IOException {
int c = in.read();
if (c == -1) return -1;
md5.Update(c);
return c;
} | [
"@",
"Override",
"public",
"int",
"read",
"(",
")",
"throws",
"IOException",
"{",
"int",
"c",
"=",
"in",
".",
"read",
"(",
")",
";",
"if",
"(",
"c",
"==",
"-",
"1",
")",
"return",
"-",
"1",
";",
"md5",
".",
"Update",
"(",
"c",
")",
";",
"retu... | Read a byte of data.
@see java.io.FilterInputStream | [
"Read",
"a",
"byte",
"of",
"data",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/md5/MD5InputStream.java#L102-L110 |
41,689 | aoindustries/aocode-public | src/main/java/com/aoindustries/md5/MD5InputStream.java | MD5InputStream.read | @Override
public int read (byte bytes[], int offset, int length) throws IOException {
int r;
if ((r = in.read(bytes, offset, length)) == -1) return -1;
md5.Update(bytes, offset, r);
return r;
} | java | @Override
public int read (byte bytes[], int offset, int length) throws IOException {
int r;
if ((r = in.read(bytes, offset, length)) == -1) return -1;
md5.Update(bytes, offset, r);
return r;
} | [
"@",
"Override",
"public",
"int",
"read",
"(",
"byte",
"bytes",
"[",
"]",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"int",
"r",
";",
"if",
"(",
"(",
"r",
"=",
"in",
".",
"read",
"(",
"bytes",
",",
"offset",
",... | Reads into an array of bytes. | [
"Reads",
"into",
"an",
"array",
"of",
"bytes",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/md5/MD5InputStream.java#L115-L124 |
41,690 | aoindustries/aocode-public | src/main/java/com/aoindustries/util/i18n/EditableResourceBundleSet.java | EditableResourceBundleSet.addBundle | void addBundle(EditableResourceBundle bundle) {
Locale locale = bundle.getBundleLocale();
if(!locales.contains(locale)) throw new AssertionError("locale not in locales: "+locale);
bundles.put(locale, bundle);
} | java | void addBundle(EditableResourceBundle bundle) {
Locale locale = bundle.getBundleLocale();
if(!locales.contains(locale)) throw new AssertionError("locale not in locales: "+locale);
bundles.put(locale, bundle);
} | [
"void",
"addBundle",
"(",
"EditableResourceBundle",
"bundle",
")",
"{",
"Locale",
"locale",
"=",
"bundle",
".",
"getBundleLocale",
"(",
")",
";",
"if",
"(",
"!",
"locales",
".",
"contains",
"(",
"locale",
")",
")",
"throw",
"new",
"AssertionError",
"(",
"\... | The constructor of EditableResourceBundle adds itself here. | [
"The",
"constructor",
"of",
"EditableResourceBundle",
"adds",
"itself",
"here",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/i18n/EditableResourceBundleSet.java#L75-L79 |
41,691 | aoindustries/aocode-public | src/main/java/com/aoindustries/util/i18n/EditableResourceBundleSet.java | EditableResourceBundleSet.getResourceBundle | public EditableResourceBundle getResourceBundle(Locale locale) {
EditableResourceBundle localeBundle = bundles.get(locale);
if(localeBundle==null) {
ResourceBundle resourceBundle = ResourceBundle.getBundle(baseName, locale);
if(!resourceBundle.getLocale().equals(locale)) throw new AssertionError("ResourceBund... | java | public EditableResourceBundle getResourceBundle(Locale locale) {
EditableResourceBundle localeBundle = bundles.get(locale);
if(localeBundle==null) {
ResourceBundle resourceBundle = ResourceBundle.getBundle(baseName, locale);
if(!resourceBundle.getLocale().equals(locale)) throw new AssertionError("ResourceBund... | [
"public",
"EditableResourceBundle",
"getResourceBundle",
"(",
"Locale",
"locale",
")",
"{",
"EditableResourceBundle",
"localeBundle",
"=",
"bundles",
".",
"get",
"(",
"locale",
")",
";",
"if",
"(",
"localeBundle",
"==",
"null",
")",
"{",
"ResourceBundle",
"resourc... | Gets the editable bundle for the provided locale. | [
"Gets",
"the",
"editable",
"bundle",
"for",
"the",
"provided",
"locale",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/i18n/EditableResourceBundleSet.java#L95-L107 |
41,692 | probedock/probedock-java | src/main/java/io/probedock/client/utils/EnvironmentUtils.java | EnvironmentUtils.getEnvironmentBoolean | public static Boolean getEnvironmentBoolean(String name, Boolean defaultValue) {
if (envVars == null) {
throw new IllegalStateException("The environment vars must be provided before calling getEnvironmentBoolean.");
}
String value = getEnvironmentString(name, null);
if (val... | java | public static Boolean getEnvironmentBoolean(String name, Boolean defaultValue) {
if (envVars == null) {
throw new IllegalStateException("The environment vars must be provided before calling getEnvironmentBoolean.");
}
String value = getEnvironmentString(name, null);
if (val... | [
"public",
"static",
"Boolean",
"getEnvironmentBoolean",
"(",
"String",
"name",
",",
"Boolean",
"defaultValue",
")",
"{",
"if",
"(",
"envVars",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The environment vars must be provided before calling g... | Retrieve boolean value for the environment variable name
@param name The name of the variable without prefix
@param defaultValue The default value if not found
@return The value found, or the default if not found | [
"Retrieve",
"boolean",
"value",
"for",
"the",
"environment",
"variable",
"name"
] | 92ee6634ba4fe3fdffeb4e202f5372ef947a67c3 | https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/utils/EnvironmentUtils.java#L32-L45 |
41,693 | probedock/probedock-java | src/main/java/io/probedock/client/utils/EnvironmentUtils.java | EnvironmentUtils.getEnvironmentInteger | public static Integer getEnvironmentInteger(String name, Integer defaultValue) {
if (envVars == null) {
throw new IllegalStateException("The environment vars must be provided before calling getEnvironmentInteger.");
}
String value = getEnvironmentString(name, null);
if (val... | java | public static Integer getEnvironmentInteger(String name, Integer defaultValue) {
if (envVars == null) {
throw new IllegalStateException("The environment vars must be provided before calling getEnvironmentInteger.");
}
String value = getEnvironmentString(name, null);
if (val... | [
"public",
"static",
"Integer",
"getEnvironmentInteger",
"(",
"String",
"name",
",",
"Integer",
"defaultValue",
")",
"{",
"if",
"(",
"envVars",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The environment vars must be provided before calling g... | Retrieve integer value for the environment variable name
@param name The name of the variable without prefix
@param defaultValue The default value if not found
@return The value found, or the default if not found | [
"Retrieve",
"integer",
"value",
"for",
"the",
"environment",
"variable",
"name"
] | 92ee6634ba4fe3fdffeb4e202f5372ef947a67c3 | https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/utils/EnvironmentUtils.java#L54-L67 |
41,694 | probedock/probedock-java | src/main/java/io/probedock/client/utils/EnvironmentUtils.java | EnvironmentUtils.getEnvironmentString | public static String getEnvironmentString(String name, String defaultValue) {
if (envVars == null) {
throw new IllegalStateException("The environment vars must be provided before calling getEnvironmentString.");
}
return envVars.get(ENV_PREFIX + name) != null ? envVars.get(ENV_PREFI... | java | public static String getEnvironmentString(String name, String defaultValue) {
if (envVars == null) {
throw new IllegalStateException("The environment vars must be provided before calling getEnvironmentString.");
}
return envVars.get(ENV_PREFIX + name) != null ? envVars.get(ENV_PREFI... | [
"public",
"static",
"String",
"getEnvironmentString",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"envVars",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The environment vars must be provided before calling getE... | Retrieve string value for the environment variable name
@param name The name of the variable without prefix
@param defaultValue The default value if not found
@return The value found, or the default if not found | [
"Retrieve",
"string",
"value",
"for",
"the",
"environment",
"variable",
"name"
] | 92ee6634ba4fe3fdffeb4e202f5372ef947a67c3 | https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/utils/EnvironmentUtils.java#L76-L82 |
41,695 | aoindustries/ao-messaging-api | src/main/java/com/aoindustries/messaging/MultiMessage.java | MultiMessage.encodeAsString | @Override
public String encodeAsString() throws IOException {
final int size = messages.size();
if(size == 0) return "";
StringBuilder sb = new StringBuilder();
sb.append(size).append(DELIMITER);
int count = 0;
for(Message message : messages) {
count++;
String str = message.encodeAsString();
sb
... | java | @Override
public String encodeAsString() throws IOException {
final int size = messages.size();
if(size == 0) return "";
StringBuilder sb = new StringBuilder();
sb.append(size).append(DELIMITER);
int count = 0;
for(Message message : messages) {
count++;
String str = message.encodeAsString();
sb
... | [
"@",
"Override",
"public",
"String",
"encodeAsString",
"(",
")",
"throws",
"IOException",
"{",
"final",
"int",
"size",
"=",
"messages",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
"==",
"0",
")",
"return",
"\"\"",
";",
"StringBuilder",
"sb",
"=",
"n... | Encodes the messages into a single string. | [
"Encodes",
"the",
"messages",
"into",
"a",
"single",
"string",
"."
] | dbe4d3baefcc846f99b7eeab42646057e99729f0 | https://github.com/aoindustries/ao-messaging-api/blob/dbe4d3baefcc846f99b7eeab42646057e99729f0/src/main/java/com/aoindustries/messaging/MultiMessage.java#L191-L211 |
41,696 | aoindustries/ao-messaging-api | src/main/java/com/aoindustries/messaging/MultiMessage.java | MultiMessage.encodeAsByteArray | @Override
public ByteArray encodeAsByteArray() throws IOException {
final int size = messages.size();
if(size == 0) return ByteArray.EMPTY_BYTE_ARRAY;
AoByteArrayOutputStream bout = new AoByteArrayOutputStream();
try {
try (DataOutputStream out = new DataOutputStream(bout)) {
out.writeInt(size);
in... | java | @Override
public ByteArray encodeAsByteArray() throws IOException {
final int size = messages.size();
if(size == 0) return ByteArray.EMPTY_BYTE_ARRAY;
AoByteArrayOutputStream bout = new AoByteArrayOutputStream();
try {
try (DataOutputStream out = new DataOutputStream(bout)) {
out.writeInt(size);
in... | [
"@",
"Override",
"public",
"ByteArray",
"encodeAsByteArray",
"(",
")",
"throws",
"IOException",
"{",
"final",
"int",
"size",
"=",
"messages",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
"==",
"0",
")",
"return",
"ByteArray",
".",
"EMPTY_BYTE_ARRAY",
";"... | Encodes the messages into a single ByteArray.
There is likely a more efficient implementation that reads-through, but this
is a simple implementation. | [
"Encodes",
"the",
"messages",
"into",
"a",
"single",
"ByteArray",
".",
"There",
"is",
"likely",
"a",
"more",
"efficient",
"implementation",
"that",
"reads",
"-",
"through",
"but",
"this",
"is",
"a",
"simple",
"implementation",
"."
] | dbe4d3baefcc846f99b7eeab42646057e99729f0 | https://github.com/aoindustries/ao-messaging-api/blob/dbe4d3baefcc846f99b7eeab42646057e99729f0/src/main/java/com/aoindustries/messaging/MultiMessage.java#L218-L242 |
41,697 | aoindustries/aocode-public | src/main/java/com/aoindustries/io/FifoFile.java | FifoFile.setLength | protected void setLength(long length) throws IOException {
if(length<0) throw new IllegalArgumentException("Invalid length: "+length);
synchronized(this) {
file.seek(8);
file.writeLong(length);
if(length==0) setFirstIndex(0);
}
} | java | protected void setLength(long length) throws IOException {
if(length<0) throw new IllegalArgumentException("Invalid length: "+length);
synchronized(this) {
file.seek(8);
file.writeLong(length);
if(length==0) setFirstIndex(0);
}
} | [
"protected",
"void",
"setLength",
"(",
"long",
"length",
")",
"throws",
"IOException",
"{",
"if",
"(",
"length",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid length: \"",
"+",
"length",
")",
";",
"synchronized",
"(",
"this",
")",
... | Sets the number of bytes currently contained by the FIFO. | [
"Sets",
"the",
"number",
"of",
"bytes",
"currently",
"contained",
"by",
"the",
"FIFO",
"."
] | c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3 | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/FifoFile.java#L141-L148 |
41,698 | NessComputing/components-ness-httpserver | src/main/java/com/nesscomputing/httpserver/jetty/TransparentCompressionFilter.java | TransparentCompressionFilter.isExcludedPath | private boolean isExcludedPath(String requestURI)
{
if (requestURI == null)
return false;
if (_excludedPaths != null)
{
for (String excludedPath : _excludedPaths)
{
if (requestURI.startsWith(excludedPath))
{
... | java | private boolean isExcludedPath(String requestURI)
{
if (requestURI == null)
return false;
if (_excludedPaths != null)
{
for (String excludedPath : _excludedPaths)
{
if (requestURI.startsWith(excludedPath))
{
... | [
"private",
"boolean",
"isExcludedPath",
"(",
"String",
"requestURI",
")",
"{",
"if",
"(",
"requestURI",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"_excludedPaths",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"excludedPath",
":",
"_excludedPaths... | Checks to see if the path is excluded
@param requestURI
the request uri
@return boolean true if excluded | [
"Checks",
"to",
"see",
"if",
"the",
"path",
"is",
"excluded"
] | 6a26bb852e8408e3499ad5d139961cdc6a96e857 | https://github.com/NessComputing/components-ness-httpserver/blob/6a26bb852e8408e3499ad5d139961cdc6a96e857/src/main/java/com/nesscomputing/httpserver/jetty/TransparentCompressionFilter.java#L362-L387 |
41,699 | probedock/probedock-java | src/main/java/io/probedock/client/core/filters/FilterUtils.java | FilterUtils.isRunnable | @SuppressWarnings("unchecked")
public static boolean isRunnable(Class cl, Method method, List<FilterDefinition> filters) {
// Get the ROX annotations
ProbeTest mAnnotation = method.getAnnotation(ProbeTest.class);
ProbeTestClass cAnnotation = method.getDeclaringClass().getAnnotation(ProbeTest... | java | @SuppressWarnings("unchecked")
public static boolean isRunnable(Class cl, Method method, List<FilterDefinition> filters) {
// Get the ROX annotations
ProbeTest mAnnotation = method.getAnnotation(ProbeTest.class);
ProbeTestClass cAnnotation = method.getDeclaringClass().getAnnotation(ProbeTest... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"boolean",
"isRunnable",
"(",
"Class",
"cl",
",",
"Method",
"method",
",",
"List",
"<",
"FilterDefinition",
">",
"filters",
")",
"{",
"// Get the ROX annotations",
"ProbeTest",
"mAnnotation",
... | Define if a test is runnable or not based on a method and class
@param cl Class
@param method The method
@param filters The filters to apply
@return True if the test can be run | [
"Define",
"if",
"a",
"test",
"is",
"runnable",
"or",
"not",
"based",
"on",
"a",
"method",
"and",
"class"
] | 92ee6634ba4fe3fdffeb4e202f5372ef947a67c3 | https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/core/filters/FilterUtils.java#L44-L57 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.