repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
belaban/JGroups
src/org/jgroups/util/Bits.java
Bits.writeString
public static void writeString(String s, DataOutput out) throws IOException { """ Writes a string to buf. The length of the string is written first, followed by the chars (as single-byte values). Multi-byte values are truncated: only the lower byte of each multi-byte char is written, similar to {@link DataOutput#writeChars(String)}. @param s the string @param out the output stream """ if(s != null) { out.write(1); out.writeUTF(s); } else out.write(0); }
java
public static void writeString(String s, DataOutput out) throws IOException { if(s != null) { out.write(1); out.writeUTF(s); } else out.write(0); }
[ "public", "static", "void", "writeString", "(", "String", "s", ",", "DataOutput", "out", ")", "throws", "IOException", "{", "if", "(", "s", "!=", "null", ")", "{", "out", ".", "write", "(", "1", ")", ";", "out", ".", "writeUTF", "(", "s", ")", ";",...
Writes a string to buf. The length of the string is written first, followed by the chars (as single-byte values). Multi-byte values are truncated: only the lower byte of each multi-byte char is written, similar to {@link DataOutput#writeChars(String)}. @param s the string @param out the output stream
[ "Writes", "a", "string", "to", "buf", ".", "The", "length", "of", "the", "string", "is", "written", "first", "followed", "by", "the", "chars", "(", "as", "single", "-", "byte", "values", ")", ".", "Multi", "-", "byte", "values", "are", "truncated", ":"...
train
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/Bits.java#L616-L623
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Metric.java
Metric.addDatapoints
public void addDatapoints(Map<Long, Double> datapoints) { """ Adds the current set of data points to the current set. @param datapoints The set of data points to add. If null or empty, only the deletion of the current set of data points is performed. """ if (datapoints != null) { _datapoints.putAll(datapoints); } }
java
public void addDatapoints(Map<Long, Double> datapoints) { if (datapoints != null) { _datapoints.putAll(datapoints); } }
[ "public", "void", "addDatapoints", "(", "Map", "<", "Long", ",", "Double", ">", "datapoints", ")", "{", "if", "(", "datapoints", "!=", "null", ")", "{", "_datapoints", ".", "putAll", "(", "datapoints", ")", ";", "}", "}" ]
Adds the current set of data points to the current set. @param datapoints The set of data points to add. If null or empty, only the deletion of the current set of data points is performed.
[ "Adds", "the", "current", "set", "of", "data", "points", "to", "the", "current", "set", "." ]
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Metric.java#L173-L177
googleads/googleads-java-lib
modules/ads_lib/src/main/java/com/google/api/ads/common/lib/auth/AuthorizationHeaderProvider.java
AuthorizationHeaderProvider.getAuthorizationHeader
public String getAuthorizationHeader(AdsSession adsSession, @Nullable String endpointUrl) throws AuthenticationException { """ Gets a header value that can be set to the {@code Authorization} HTTP header. The endpoint URL can be {@code null} if it's not needed for the authentication mechanism (i.e. OAuth2). @param adsSession the session to pull authentication information from @param endpointUrl the endpoint URL used for authentication mechanisms like OAuth. @return the authorization header @throws AuthenticationException if the authorization header could not be created @throws IllegalArgumentException if no valid authentication information exists within the session. """ if (adsSession instanceof OAuth2Compatible && ((OAuth2Compatible) adsSession).getOAuth2Credential() != null) { return getOAuth2Header((OAuth2Compatible) adsSession); } else { throw new IllegalArgumentException( "Session does not have any valid authentication mechanisms"); } }
java
public String getAuthorizationHeader(AdsSession adsSession, @Nullable String endpointUrl) throws AuthenticationException { if (adsSession instanceof OAuth2Compatible && ((OAuth2Compatible) adsSession).getOAuth2Credential() != null) { return getOAuth2Header((OAuth2Compatible) adsSession); } else { throw new IllegalArgumentException( "Session does not have any valid authentication mechanisms"); } }
[ "public", "String", "getAuthorizationHeader", "(", "AdsSession", "adsSession", ",", "@", "Nullable", "String", "endpointUrl", ")", "throws", "AuthenticationException", "{", "if", "(", "adsSession", "instanceof", "OAuth2Compatible", "&&", "(", "(", "OAuth2Compatible", ...
Gets a header value that can be set to the {@code Authorization} HTTP header. The endpoint URL can be {@code null} if it's not needed for the authentication mechanism (i.e. OAuth2). @param adsSession the session to pull authentication information from @param endpointUrl the endpoint URL used for authentication mechanisms like OAuth. @return the authorization header @throws AuthenticationException if the authorization header could not be created @throws IllegalArgumentException if no valid authentication information exists within the session.
[ "Gets", "a", "header", "value", "that", "can", "be", "set", "to", "the", "{", "@code", "Authorization", "}", "HTTP", "header", ".", "The", "endpoint", "URL", "can", "be", "{", "@code", "null", "}", "if", "it", "s", "not", "needed", "for", "the", "aut...
train
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/common/lib/auth/AuthorizationHeaderProvider.java#L70-L79
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/MapTileCircuitModel.java
MapTileCircuitModel.getTransitiveGroup
private String getTransitiveGroup(Circuit initialCircuit, Tile tile) { """ Get the transitive group by replacing the transition group name with the plain one. @param initialCircuit The initial circuit. @param tile The tile reference. @return The plain group name. """ final Set<Circuit> circuitSet = circuits.keySet(); final Collection<String> groups = new HashSet<>(circuitSet.size()); final String groupIn = mapGroup.getGroup(tile); for (final Circuit circuit : circuitSet) { final String groupOut = circuit.getOut(); for (final Tile neighbor : map.getNeighbors(tile)) { final String groupNeighbor = mapGroup.getGroup(neighbor); if (groupNeighbor.equals(groupOut) && !groupNeighbor.equals(groupIn)) { return groupOut; } } groups.add(groupOut); } return getShortestTransitiveGroup(groups, initialCircuit); }
java
private String getTransitiveGroup(Circuit initialCircuit, Tile tile) { final Set<Circuit> circuitSet = circuits.keySet(); final Collection<String> groups = new HashSet<>(circuitSet.size()); final String groupIn = mapGroup.getGroup(tile); for (final Circuit circuit : circuitSet) { final String groupOut = circuit.getOut(); for (final Tile neighbor : map.getNeighbors(tile)) { final String groupNeighbor = mapGroup.getGroup(neighbor); if (groupNeighbor.equals(groupOut) && !groupNeighbor.equals(groupIn)) { return groupOut; } } groups.add(groupOut); } return getShortestTransitiveGroup(groups, initialCircuit); }
[ "private", "String", "getTransitiveGroup", "(", "Circuit", "initialCircuit", ",", "Tile", "tile", ")", "{", "final", "Set", "<", "Circuit", ">", "circuitSet", "=", "circuits", ".", "keySet", "(", ")", ";", "final", "Collection", "<", "String", ">", "groups",...
Get the transitive group by replacing the transition group name with the plain one. @param initialCircuit The initial circuit. @param tile The tile reference. @return The plain group name.
[ "Get", "the", "transitive", "group", "by", "replacing", "the", "transition", "group", "name", "with", "the", "plain", "one", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/circuit/MapTileCircuitModel.java#L203-L222
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java
ItemsUnion.update
public void update(final Memory srcMem, final ArrayOfItemsSerDe<T> serDe) { """ Iterative union operation, which means this method can be repeatedly called. Merges the given Memory image of a ItemsSketch into this union object. The given Memory object is not modified and a link to it is not retained. It is required that the ratio of the two K values be a power of 2. This is easily satisfied if each of the K values is already a power of 2. If the given sketch is null or empty it is ignored. <p>It is required that the results of the union operation, which can be obtained at any time, is obtained from {@link #getResult() }.</p> @param srcMem Memory image of sketch to be merged @param serDe an instance of ArrayOfItemsSerDe """ final ItemsSketch<T> that = ItemsSketch.getInstance(srcMem, comparator_, serDe); gadget_ = updateLogic(maxK_, comparator_, gadget_, that); }
java
public void update(final Memory srcMem, final ArrayOfItemsSerDe<T> serDe) { final ItemsSketch<T> that = ItemsSketch.getInstance(srcMem, comparator_, serDe); gadget_ = updateLogic(maxK_, comparator_, gadget_, that); }
[ "public", "void", "update", "(", "final", "Memory", "srcMem", ",", "final", "ArrayOfItemsSerDe", "<", "T", ">", "serDe", ")", "{", "final", "ItemsSketch", "<", "T", ">", "that", "=", "ItemsSketch", ".", "getInstance", "(", "srcMem", ",", "comparator_", ","...
Iterative union operation, which means this method can be repeatedly called. Merges the given Memory image of a ItemsSketch into this union object. The given Memory object is not modified and a link to it is not retained. It is required that the ratio of the two K values be a power of 2. This is easily satisfied if each of the K values is already a power of 2. If the given sketch is null or empty it is ignored. <p>It is required that the results of the union operation, which can be obtained at any time, is obtained from {@link #getResult() }.</p> @param srcMem Memory image of sketch to be merged @param serDe an instance of ArrayOfItemsSerDe
[ "Iterative", "union", "operation", "which", "means", "this", "method", "can", "be", "repeatedly", "called", ".", "Merges", "the", "given", "Memory", "image", "of", "a", "ItemsSketch", "into", "this", "union", "object", ".", "The", "given", "Memory", "object", ...
train
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java#L115-L118
alkacon/opencms-core
src-modules/org/opencms/workplace/tools/modules/CmsCloneModuleThread.java
CmsCloneModuleThread.replacesMessages
private void replacesMessages(Map<String, String> descKeys, List<CmsResource> resources) throws CmsException, UnsupportedEncodingException { """ Replaces the messages for the given resources.<p> @param descKeys the replacement mapping @param resources the resources to consult @throws CmsException if something goes wrong @throws UnsupportedEncodingException if the file content could not be read with the determined encoding """ for (CmsResource resource : resources) { CmsFile file = getCms().readFile(resource); String encoding = CmsLocaleManager.getResourceEncoding(getCms(), file); String content = new String(file.getContents(), encoding); for (Map.Entry<String, String> entry : descKeys.entrySet()) { content = content.replaceAll(entry.getKey(), entry.getValue()); } file.setContents(content.getBytes(encoding)); getCms().writeFile(file); } }
java
private void replacesMessages(Map<String, String> descKeys, List<CmsResource> resources) throws CmsException, UnsupportedEncodingException { for (CmsResource resource : resources) { CmsFile file = getCms().readFile(resource); String encoding = CmsLocaleManager.getResourceEncoding(getCms(), file); String content = new String(file.getContents(), encoding); for (Map.Entry<String, String> entry : descKeys.entrySet()) { content = content.replaceAll(entry.getKey(), entry.getValue()); } file.setContents(content.getBytes(encoding)); getCms().writeFile(file); } }
[ "private", "void", "replacesMessages", "(", "Map", "<", "String", ",", "String", ">", "descKeys", ",", "List", "<", "CmsResource", ">", "resources", ")", "throws", "CmsException", ",", "UnsupportedEncodingException", "{", "for", "(", "CmsResource", "resource", "...
Replaces the messages for the given resources.<p> @param descKeys the replacement mapping @param resources the resources to consult @throws CmsException if something goes wrong @throws UnsupportedEncodingException if the file content could not be read with the determined encoding
[ "Replaces", "the", "messages", "for", "the", "given", "resources", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/modules/CmsCloneModuleThread.java#L1026-L1039
Red5/red5-websocket
src/main/java/org/red5/net/websocket/WebSocketConnection.java
WebSocketConnection.sendPong
public void sendPong(byte[] buf) { """ Sends a pong back to the client; normally in response to a ping. @param buf """ if (log.isTraceEnabled()) { log.trace("send pong: {}", buf); } // send pong send(Packet.build(buf, MessageType.PONG)); }
java
public void sendPong(byte[] buf) { if (log.isTraceEnabled()) { log.trace("send pong: {}", buf); } // send pong send(Packet.build(buf, MessageType.PONG)); }
[ "public", "void", "sendPong", "(", "byte", "[", "]", "buf", ")", "{", "if", "(", "log", ".", "isTraceEnabled", "(", ")", ")", "{", "log", ".", "trace", "(", "\"send pong: {}\"", ",", "buf", ")", ";", "}", "// send pong", "send", "(", "Packet", ".", ...
Sends a pong back to the client; normally in response to a ping. @param buf
[ "Sends", "a", "pong", "back", "to", "the", "client", ";", "normally", "in", "response", "to", "a", "ping", "." ]
train
https://github.com/Red5/red5-websocket/blob/24b53f2f3875624fb01f0a2604f4117583aeab40/src/main/java/org/red5/net/websocket/WebSocketConnection.java#L284-L290
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/process/CoreLabelTokenFactory.java
CoreLabelTokenFactory.makeToken
public CoreLabel makeToken(String tokenText, String originalText, int begin, int length) { """ Constructs a CoreLabel as a String with a corresponding BEGIN and END position, when the original OriginalTextAnnotation is different from TextAnnotation (Does not take substring). """ CoreLabel cl = addIndices ? new CoreLabel(5) : new CoreLabel(); cl.setValue(tokenText); cl.setWord(tokenText); cl.setOriginalText(originalText); if(addIndices) { cl.set(CharacterOffsetBeginAnnotation.class, begin); cl.set(CharacterOffsetEndAnnotation.class, begin+length); } return cl; }
java
public CoreLabel makeToken(String tokenText, String originalText, int begin, int length) { CoreLabel cl = addIndices ? new CoreLabel(5) : new CoreLabel(); cl.setValue(tokenText); cl.setWord(tokenText); cl.setOriginalText(originalText); if(addIndices) { cl.set(CharacterOffsetBeginAnnotation.class, begin); cl.set(CharacterOffsetEndAnnotation.class, begin+length); } return cl; }
[ "public", "CoreLabel", "makeToken", "(", "String", "tokenText", ",", "String", "originalText", ",", "int", "begin", ",", "int", "length", ")", "{", "CoreLabel", "cl", "=", "addIndices", "?", "new", "CoreLabel", "(", "5", ")", ":", "new", "CoreLabel", "(", ...
Constructs a CoreLabel as a String with a corresponding BEGIN and END position, when the original OriginalTextAnnotation is different from TextAnnotation (Does not take substring).
[ "Constructs", "a", "CoreLabel", "as", "a", "String", "with", "a", "corresponding", "BEGIN", "and", "END", "position", "when", "the", "original", "OriginalTextAnnotation", "is", "different", "from", "TextAnnotation", "(", "Does", "not", "take", "substring", ")", ...
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/process/CoreLabelTokenFactory.java#L59-L69
aspectran/aspectran
core/src/main/java/com/aspectran/core/util/apon/AponSyntaxException.java
AponSyntaxException.makeMessage
private static String makeMessage(int lineNumber, String line, String tline, String msg) { """ Create a detail message. @param lineNumber the line number @param line the character line @param tline the trimmed character line @param msg the message @return the detail message """ int columnNumber = (tline != null ? line.indexOf(tline) : 0); StringBuilder sb = new StringBuilder(); if (msg != null) { sb.append(msg); } sb.append(" [lineNumber: ").append(lineNumber); if (columnNumber != -1) { String lspace = line.substring(0, columnNumber); int tabCnt = StringUtils.search(lspace, "\t"); if (tline != null && tline.length() > 33) { tline = tline.substring(0, 30) + "..."; } sb.append(", columnNumber: ").append(columnNumber + 1); if (tabCnt != 0) { sb.append(" ("); sb.append("Tabs ").append(tabCnt); sb.append(", Spaces ").append(columnNumber - tabCnt); sb.append(")"); } sb.append("] ").append(tline); } return sb.toString(); }
java
private static String makeMessage(int lineNumber, String line, String tline, String msg) { int columnNumber = (tline != null ? line.indexOf(tline) : 0); StringBuilder sb = new StringBuilder(); if (msg != null) { sb.append(msg); } sb.append(" [lineNumber: ").append(lineNumber); if (columnNumber != -1) { String lspace = line.substring(0, columnNumber); int tabCnt = StringUtils.search(lspace, "\t"); if (tline != null && tline.length() > 33) { tline = tline.substring(0, 30) + "..."; } sb.append(", columnNumber: ").append(columnNumber + 1); if (tabCnt != 0) { sb.append(" ("); sb.append("Tabs ").append(tabCnt); sb.append(", Spaces ").append(columnNumber - tabCnt); sb.append(")"); } sb.append("] ").append(tline); } return sb.toString(); }
[ "private", "static", "String", "makeMessage", "(", "int", "lineNumber", ",", "String", "line", ",", "String", "tline", ",", "String", "msg", ")", "{", "int", "columnNumber", "=", "(", "tline", "!=", "null", "?", "line", ".", "indexOf", "(", "tline", ")",...
Create a detail message. @param lineNumber the line number @param line the character line @param tline the trimmed character line @param msg the message @return the detail message
[ "Create", "a", "detail", "message", "." ]
train
https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/apon/AponSyntaxException.java#L72-L95
groupon/odo
proxyui/src/main/java/com/groupon/odo/controllers/ServerMappingController.java
ServerMappingController.updateDestRedirectHost
@RequestMapping(value = "api/edit/server/ { """ Updates the dest host header in the server redirects @param model @param id @param hostHeader @return @throws Exception """id}/host", method = RequestMethod.POST) public @ResponseBody ServerRedirect updateDestRedirectHost(Model model, @PathVariable int id, String hostHeader) throws Exception { ServerRedirectService.getInstance().setHostHeader(hostHeader, id); return ServerRedirectService.getInstance().getRedirect(id); }
java
@RequestMapping(value = "api/edit/server/{id}/host", method = RequestMethod.POST) public @ResponseBody ServerRedirect updateDestRedirectHost(Model model, @PathVariable int id, String hostHeader) throws Exception { ServerRedirectService.getInstance().setHostHeader(hostHeader, id); return ServerRedirectService.getInstance().getRedirect(id); }
[ "@", "RequestMapping", "(", "value", "=", "\"api/edit/server/{id}/host\"", ",", "method", "=", "RequestMethod", ".", "POST", ")", "public", "@", "ResponseBody", "ServerRedirect", "updateDestRedirectHost", "(", "Model", "model", ",", "@", "PathVariable", "int", "id",...
Updates the dest host header in the server redirects @param model @param id @param hostHeader @return @throws Exception
[ "Updates", "the", "dest", "host", "header", "in", "the", "server", "redirects" ]
train
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ServerMappingController.java#L321-L327
nguillaumin/slick2d-maven
slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontFileReader.java
FontFileReader.readTTFString
public final String readTTFString() throws IOException { """ Read a NUL terminated ISO-8859-1 string. @return A String @throws IOException If EOF is reached """ int i = current; while (file[i++] != 0) { if (i > fsize) { throw new java.io.EOFException("Reached EOF, file size=" + fsize); } } byte[] tmp = new byte[i - current]; System.arraycopy(file, current, tmp, 0, i - current); return new String(tmp, "ISO-8859-1"); }
java
public final String readTTFString() throws IOException { int i = current; while (file[i++] != 0) { if (i > fsize) { throw new java.io.EOFException("Reached EOF, file size=" + fsize); } } byte[] tmp = new byte[i - current]; System.arraycopy(file, current, tmp, 0, i - current); return new String(tmp, "ISO-8859-1"); }
[ "public", "final", "String", "readTTFString", "(", ")", "throws", "IOException", "{", "int", "i", "=", "current", ";", "while", "(", "file", "[", "i", "++", "]", "!=", "0", ")", "{", "if", "(", "i", ">", "fsize", ")", "{", "throw", "new", "java", ...
Read a NUL terminated ISO-8859-1 string. @return A String @throws IOException If EOF is reached
[ "Read", "a", "NUL", "terminated", "ISO", "-", "8859", "-", "1", "string", "." ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontFileReader.java#L302-L314
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java
CacheManager.downloadAreaAsync
public CacheManagerTask downloadAreaAsync(Context ctx, List<Long> pTiles, final int zoomMin, final int zoomMax) { """ Download in background all tiles of the specified area in osmdroid cache. @param ctx @param pTiles @param zoomMin @param zoomMax """ final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), pTiles, zoomMin, zoomMax); task.addCallback(getDownloadingDialog(ctx, task)); return execute(task); }
java
public CacheManagerTask downloadAreaAsync(Context ctx, List<Long> pTiles, final int zoomMin, final int zoomMax) { final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), pTiles, zoomMin, zoomMax); task.addCallback(getDownloadingDialog(ctx, task)); return execute(task); }
[ "public", "CacheManagerTask", "downloadAreaAsync", "(", "Context", "ctx", ",", "List", "<", "Long", ">", "pTiles", ",", "final", "int", "zoomMin", ",", "final", "int", "zoomMax", ")", "{", "final", "CacheManagerTask", "task", "=", "new", "CacheManagerTask", "(...
Download in background all tiles of the specified area in osmdroid cache. @param ctx @param pTiles @param zoomMin @param zoomMax
[ "Download", "in", "background", "all", "tiles", "of", "the", "specified", "area", "in", "osmdroid", "cache", "." ]
train
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L495-L499
Whiley/WhileyCompiler
src/main/java/wyil/check/FlowTypeCheck.java
FlowTypeCheck.checkLogicalConjunction
private Environment checkLogicalConjunction(Expr.LogicalAnd expr, boolean sign, Environment environment) { """ In this case, we are threading each environment as is through to the next statement. For example, consider this example: <pre> function f(int|null x) -> (bool r): return (x is int) && (x >= 0) </pre> The environment going into <code>x is int</code> will be <code>{x->(int|null)}</code>. The environment coming out of this statement will be <code>{x-&gt;int}</code> and this is just threaded directly into the next statement <code>x &gt; 0</code> @param operands @param sign @param environment @return """ Tuple<Expr> operands = expr.getOperands(); if (sign) { for (int i = 0; i != operands.size(); ++i) { environment = checkCondition(operands.get(i), sign, environment); } return environment; } else { Environment[] refinements = new Environment[operands.size()]; for (int i = 0; i != operands.size(); ++i) { refinements[i] = checkCondition(operands.get(i), sign, environment); // The clever bit. Recalculate assuming opposite sign. environment = checkCondition(operands.get(i), !sign, environment); } // Done. return FlowTypeUtils.union(refinements); } }
java
private Environment checkLogicalConjunction(Expr.LogicalAnd expr, boolean sign, Environment environment) { Tuple<Expr> operands = expr.getOperands(); if (sign) { for (int i = 0; i != operands.size(); ++i) { environment = checkCondition(operands.get(i), sign, environment); } return environment; } else { Environment[] refinements = new Environment[operands.size()]; for (int i = 0; i != operands.size(); ++i) { refinements[i] = checkCondition(operands.get(i), sign, environment); // The clever bit. Recalculate assuming opposite sign. environment = checkCondition(operands.get(i), !sign, environment); } // Done. return FlowTypeUtils.union(refinements); } }
[ "private", "Environment", "checkLogicalConjunction", "(", "Expr", ".", "LogicalAnd", "expr", ",", "boolean", "sign", ",", "Environment", "environment", ")", "{", "Tuple", "<", "Expr", ">", "operands", "=", "expr", ".", "getOperands", "(", ")", ";", "if", "("...
In this case, we are threading each environment as is through to the next statement. For example, consider this example: <pre> function f(int|null x) -> (bool r): return (x is int) && (x >= 0) </pre> The environment going into <code>x is int</code> will be <code>{x->(int|null)}</code>. The environment coming out of this statement will be <code>{x-&gt;int}</code> and this is just threaded directly into the next statement <code>x &gt; 0</code> @param operands @param sign @param environment @return
[ "In", "this", "case", "we", "are", "threading", "each", "environment", "as", "is", "through", "to", "the", "next", "statement", ".", "For", "example", "consider", "this", "example", ":" ]
train
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L997-L1014
jenkinsci/jenkins
core/src/main/java/hudson/scm/RepositoryBrowser.java
RepositoryBrowser.normalizeToEndWithSlash
protected static URL normalizeToEndWithSlash(URL url) { """ Normalize the URL so that it ends with '/'. <p> An attention is paid to preserve the query parameters in URL if any. """ if(url.getPath().endsWith("/")) return url; // normalize String q = url.getQuery(); q = q!=null?('?'+q):""; try { return new URL(url,url.getPath()+'/'+q); } catch (MalformedURLException e) { // impossible throw new Error(e); } }
java
protected static URL normalizeToEndWithSlash(URL url) { if(url.getPath().endsWith("/")) return url; // normalize String q = url.getQuery(); q = q!=null?('?'+q):""; try { return new URL(url,url.getPath()+'/'+q); } catch (MalformedURLException e) { // impossible throw new Error(e); } }
[ "protected", "static", "URL", "normalizeToEndWithSlash", "(", "URL", "url", ")", "{", "if", "(", "url", ".", "getPath", "(", ")", ".", "endsWith", "(", "\"/\"", ")", ")", "return", "url", ";", "// normalize", "String", "q", "=", "url", ".", "getQuery", ...
Normalize the URL so that it ends with '/'. <p> An attention is paid to preserve the query parameters in URL if any.
[ "Normalize", "the", "URL", "so", "that", "it", "ends", "with", "/", ".", "<p", ">", "An", "attention", "is", "paid", "to", "preserve", "the", "query", "parameters", "in", "URL", "if", "any", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/RepositoryBrowser.java#L84-L97
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/TaskOperations.java
TaskOperations.deleteTask
public void deleteTask(String jobId, String taskId) throws BatchErrorException, IOException { """ Deletes the specified task. @param jobId The ID of the job containing the task. @param taskId The ID of the task. @throws BatchErrorException Exception thrown when an error response is received from the Batch service. @throws IOException Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service. """ deleteTask(jobId, taskId, null); }
java
public void deleteTask(String jobId, String taskId) throws BatchErrorException, IOException { deleteTask(jobId, taskId, null); }
[ "public", "void", "deleteTask", "(", "String", "jobId", ",", "String", "taskId", ")", "throws", "BatchErrorException", ",", "IOException", "{", "deleteTask", "(", "jobId", ",", "taskId", ",", "null", ")", ";", "}" ]
Deletes the specified task. @param jobId The ID of the job containing the task. @param taskId The ID of the task. @throws BatchErrorException Exception thrown when an error response is received from the Batch service. @throws IOException Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
[ "Deletes", "the", "specified", "task", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/TaskOperations.java#L551-L553
bartprokop/rxtx
src/main/java/gnu/io/RXTXPort.java
RXTXPort.staticSetDTR
public static boolean staticSetDTR(String port, boolean flag) throws UnsupportedCommOperationException { """ Extension to CommAPI This is an extension to CommAPI. It may not be supported on all operating systems. Open the port and set DTR. remove lockfile and do not close This is so some software can appear to set the DTR before 'opening' the port a second time later on. @param port port name @param flag flag value @return true on success @throws UnsupportedCommOperationException on error """ logger.fine("RXTXPort:staticSetDTR( " + port + " " + flag); return (nativeStaticSetDTR(port, flag)); }
java
public static boolean staticSetDTR(String port, boolean flag) throws UnsupportedCommOperationException { logger.fine("RXTXPort:staticSetDTR( " + port + " " + flag); return (nativeStaticSetDTR(port, flag)); }
[ "public", "static", "boolean", "staticSetDTR", "(", "String", "port", ",", "boolean", "flag", ")", "throws", "UnsupportedCommOperationException", "{", "logger", ".", "fine", "(", "\"RXTXPort:staticSetDTR( \"", "+", "port", "+", "\" \"", "+", "flag", ")", ";", "r...
Extension to CommAPI This is an extension to CommAPI. It may not be supported on all operating systems. Open the port and set DTR. remove lockfile and do not close This is so some software can appear to set the DTR before 'opening' the port a second time later on. @param port port name @param flag flag value @return true on success @throws UnsupportedCommOperationException on error
[ "Extension", "to", "CommAPI", "This", "is", "an", "extension", "to", "CommAPI", ".", "It", "may", "not", "be", "supported", "on", "all", "operating", "systems", "." ]
train
https://github.com/bartprokop/rxtx/blob/7b2c7857c262743e9dd15e9779c880b93c650890/src/main/java/gnu/io/RXTXPort.java#L1763-L1769
leancloud/java-sdk-all
core/src/main/java/cn/leancloud/codec/Base64.java
Base64.encodeToString
public static String encodeToString(byte[] input, int flags) { """ Base64-encode the given data and return a newly allocated String with the result. @param input the data to encode @param flags controls certain features of the encoded output. Passing {@code DEFAULT} results in output that adheres to RFC 2045. """ try { return new String(encode(input, flags), "US-ASCII"); } catch (UnsupportedEncodingException e) { // US-ASCII is guaranteed to be available. throw new AssertionError(e); } }
java
public static String encodeToString(byte[] input, int flags) { try { return new String(encode(input, flags), "US-ASCII"); } catch (UnsupportedEncodingException e) { // US-ASCII is guaranteed to be available. throw new AssertionError(e); } }
[ "public", "static", "String", "encodeToString", "(", "byte", "[", "]", "input", ",", "int", "flags", ")", "{", "try", "{", "return", "new", "String", "(", "encode", "(", "input", ",", "flags", ")", ",", "\"US-ASCII\"", ")", ";", "}", "catch", "(", "U...
Base64-encode the given data and return a newly allocated String with the result. @param input the data to encode @param flags controls certain features of the encoded output. Passing {@code DEFAULT} results in output that adheres to RFC 2045.
[ "Base64", "-", "encode", "the", "given", "data", "and", "return", "a", "newly", "allocated", "String", "with", "the", "result", "." ]
train
https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/core/src/main/java/cn/leancloud/codec/Base64.java#L433-L440
oboehm/jfachwert
src/main/java/de/jfachwert/bank/Geldbetrag.java
Geldbetrag.parse
public static Geldbetrag parse(CharSequence text, MonetaryAmountFormat formatter) { """ Erzeugt einen Geldbetrag anhand des uebergebenen Textes und mittels des uebergebenen Formatters. @param text z.B. "12,25 EUR" @param formatter Formatter @return Geldbetrag """ return from(formatter.parse(text)); }
java
public static Geldbetrag parse(CharSequence text, MonetaryAmountFormat formatter) { return from(formatter.parse(text)); }
[ "public", "static", "Geldbetrag", "parse", "(", "CharSequence", "text", ",", "MonetaryAmountFormat", "formatter", ")", "{", "return", "from", "(", "formatter", ".", "parse", "(", "text", ")", ")", ";", "}" ]
Erzeugt einen Geldbetrag anhand des uebergebenen Textes und mittels des uebergebenen Formatters. @param text z.B. "12,25 EUR" @param formatter Formatter @return Geldbetrag
[ "Erzeugt", "einen", "Geldbetrag", "anhand", "des", "uebergebenen", "Textes", "und", "mittels", "des", "uebergebenen", "Formatters", "." ]
train
https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/bank/Geldbetrag.java#L488-L490
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/Index.java
Index.batchRules
public JSONObject batchRules(List<JSONObject> rules) throws AlgoliaException { """ Add or Replace a list of synonyms @param rules the list of rules to add/replace """ return batchRules(rules, false, false); }
java
public JSONObject batchRules(List<JSONObject> rules) throws AlgoliaException { return batchRules(rules, false, false); }
[ "public", "JSONObject", "batchRules", "(", "List", "<", "JSONObject", ">", "rules", ")", "throws", "AlgoliaException", "{", "return", "batchRules", "(", "rules", ",", "false", ",", "false", ")", ";", "}" ]
Add or Replace a list of synonyms @param rules the list of rules to add/replace
[ "Add", "or", "Replace", "a", "list", "of", "synonyms" ]
train
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1760-L1762
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbookDraftsInner.java
RunbookDraftsInner.replaceContentAsync
public Observable<String> replaceContentAsync(String resourceGroupName, String automationAccountName, String runbookName, String runbookContent) { """ Replaces the runbook draft content. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param runbookName The runbook name. @param runbookContent The runbook draft content. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable for the request """ return replaceContentWithServiceResponseAsync(resourceGroupName, automationAccountName, runbookName, runbookContent).map(new Func1<ServiceResponseWithHeaders<String, RunbookDraftReplaceContentHeaders>, String>() { @Override public String call(ServiceResponseWithHeaders<String, RunbookDraftReplaceContentHeaders> response) { return response.body(); } }); }
java
public Observable<String> replaceContentAsync(String resourceGroupName, String automationAccountName, String runbookName, String runbookContent) { return replaceContentWithServiceResponseAsync(resourceGroupName, automationAccountName, runbookName, runbookContent).map(new Func1<ServiceResponseWithHeaders<String, RunbookDraftReplaceContentHeaders>, String>() { @Override public String call(ServiceResponseWithHeaders<String, RunbookDraftReplaceContentHeaders> response) { return response.body(); } }); }
[ "public", "Observable", "<", "String", ">", "replaceContentAsync", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ",", "String", "runbookName", ",", "String", "runbookContent", ")", "{", "return", "replaceContentWithServiceResponseAsync", "(",...
Replaces the runbook draft content. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param runbookName The runbook name. @param runbookContent The runbook draft content. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable for the request
[ "Replaces", "the", "runbook", "draft", "content", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbookDraftsInner.java#L223-L230
facebookarchive/hadoop-20
src/core/org/apache/hadoop/metrics/spi/MetricsRecordImpl.java
MetricsRecordImpl.setTag
public void setTag(String tagName, short tagValue) { """ Sets the named tag to the specified value. @param tagName name of the tag @param tagValue new value of the tag @throws MetricsException if the tagName conflicts with the configuration """ tagTable.put(tagName, Short.valueOf(tagValue)); }
java
public void setTag(String tagName, short tagValue) { tagTable.put(tagName, Short.valueOf(tagValue)); }
[ "public", "void", "setTag", "(", "String", "tagName", ",", "short", "tagValue", ")", "{", "tagTable", ".", "put", "(", "tagName", ",", "Short", ".", "valueOf", "(", "tagValue", ")", ")", ";", "}" ]
Sets the named tag to the specified value. @param tagName name of the tag @param tagValue new value of the tag @throws MetricsException if the tagName conflicts with the configuration
[ "Sets", "the", "named", "tag", "to", "the", "specified", "value", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/spi/MetricsRecordImpl.java#L101-L103
BioPAX/Paxtools
paxtools-core/src/main/java/org/biopax/paxtools/io/BioPAXIOHandlerAdapter.java
BioPAXIOHandlerAdapter.createAndAdd
protected void createAndAdd(Model model, String id, String localName) { """ This method is called by the reader for each OWL instance in the OWL model. It creates a POJO instance, with the given id and inserts it into the model. The inserted object is "clean" in the sense that its properties are not set yet. Implementers of this abstract class can override this method to inject code during object creation. @param model to be inserted @param id of the new object. The model should not contain another object with the same ID. @param localName of the class to be instantiated. """ BioPAXElement bpe = this.getFactory().create(localName, id); if (log.isTraceEnabled()) { log.trace("id:" + id + " " + localName + " : " + bpe); } /* null might occur here, * so the following is to prevent the NullPointerException * and to continue the model assembling. */ if (bpe != null) { model.add(bpe); } else { log.warn("null object created during reading. It might not be an official BioPAX class.ID: " + id + " Class " + "name " + localName); } }
java
protected void createAndAdd(Model model, String id, String localName) { BioPAXElement bpe = this.getFactory().create(localName, id); if (log.isTraceEnabled()) { log.trace("id:" + id + " " + localName + " : " + bpe); } /* null might occur here, * so the following is to prevent the NullPointerException * and to continue the model assembling. */ if (bpe != null) { model.add(bpe); } else { log.warn("null object created during reading. It might not be an official BioPAX class.ID: " + id + " Class " + "name " + localName); } }
[ "protected", "void", "createAndAdd", "(", "Model", "model", ",", "String", "id", ",", "String", "localName", ")", "{", "BioPAXElement", "bpe", "=", "this", ".", "getFactory", "(", ")", ".", "create", "(", "localName", ",", "id", ")", ";", "if", "(", "l...
This method is called by the reader for each OWL instance in the OWL model. It creates a POJO instance, with the given id and inserts it into the model. The inserted object is "clean" in the sense that its properties are not set yet. Implementers of this abstract class can override this method to inject code during object creation. @param model to be inserted @param id of the new object. The model should not contain another object with the same ID. @param localName of the class to be instantiated.
[ "This", "method", "is", "called", "by", "the", "reader", "for", "each", "OWL", "instance", "in", "the", "OWL", "model", ".", "It", "creates", "a", "POJO", "instance", "with", "the", "given", "id", "and", "inserts", "it", "into", "the", "model", ".", "T...
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/io/BioPAXIOHandlerAdapter.java#L244-L265
LAW-Unimi/BUbiNG
src/it/unimi/di/law/bubing/util/Util.java
Util.writeByteArray
public final static void writeByteArray(final byte[] a, final ObjectOutputStream s) throws IOException { """ Writes a byte array prefixed by its length encoded using vByte. @param a the array to be written. @param s the stream where the array should be written. """ writeVByte(a.length, s); s.write(a); }
java
public final static void writeByteArray(final byte[] a, final ObjectOutputStream s) throws IOException { writeVByte(a.length, s); s.write(a); }
[ "public", "final", "static", "void", "writeByteArray", "(", "final", "byte", "[", "]", "a", ",", "final", "ObjectOutputStream", "s", ")", "throws", "IOException", "{", "writeVByte", "(", "a", ".", "length", ",", "s", ")", ";", "s", ".", "write", "(", "...
Writes a byte array prefixed by its length encoded using vByte. @param a the array to be written. @param s the stream where the array should be written.
[ "Writes", "a", "byte", "array", "prefixed", "by", "its", "length", "encoded", "using", "vByte", "." ]
train
https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/util/Util.java#L167-L170
interedition/collatex
collatex-core/src/main/java/eu/interedition/collatex/suffixarray/Tools.java
Tools.allPositive
static boolean allPositive(int[] input, int start, int length) { """ Check if all symbols in the given range are greater than 0, return <code>true</code> if so, <code>false</code> otherwise. """ for (int i = length - 1, index = start; i >= 0; i--, index++) { if (input[index] <= 0) { return false; } } return true; }
java
static boolean allPositive(int[] input, int start, int length) { for (int i = length - 1, index = start; i >= 0; i--, index++) { if (input[index] <= 0) { return false; } } return true; }
[ "static", "boolean", "allPositive", "(", "int", "[", "]", "input", ",", "int", "start", ",", "int", "length", ")", "{", "for", "(", "int", "i", "=", "length", "-", "1", ",", "index", "=", "start", ";", "i", ">=", "0", ";", "i", "--", ",", "inde...
Check if all symbols in the given range are greater than 0, return <code>true</code> if so, <code>false</code> otherwise.
[ "Check", "if", "all", "symbols", "in", "the", "given", "range", "are", "greater", "than", "0", "return", "<code", ">", "true<", "/", "code", ">", "if", "so", "<code", ">", "false<", "/", "code", ">", "otherwise", "." ]
train
https://github.com/interedition/collatex/blob/76dd1fcc36047bc66a87d31142e72e98b5347821/collatex-core/src/main/java/eu/interedition/collatex/suffixarray/Tools.java#L18-L26
erlang/otp
lib/jinterface/java_src/com/ericsson/otp/erlang/OtpNode.java
OtpNode.closeMbox
public void closeMbox(final OtpMbox mbox, final OtpErlangObject reason) { """ Close the specified mailbox with the given reason. @param mbox the mailbox to close. @param reason an Erlang term describing the reason for the termination. <p> After this operation, the mailbox will no longer be able to receive messages. Any delivered but as yet unretrieved messages can still be retrieved however. </p> <p> If there are links from the mailbox to other {@link OtpErlangPid pids}, they will be broken when this method is called and exit signals with the given reason will be sent. </p> """ if (mbox != null) { mboxes.remove(mbox); mbox.name = null; mbox.breakLinks(reason); } }
java
public void closeMbox(final OtpMbox mbox, final OtpErlangObject reason) { if (mbox != null) { mboxes.remove(mbox); mbox.name = null; mbox.breakLinks(reason); } }
[ "public", "void", "closeMbox", "(", "final", "OtpMbox", "mbox", ",", "final", "OtpErlangObject", "reason", ")", "{", "if", "(", "mbox", "!=", "null", ")", "{", "mboxes", ".", "remove", "(", "mbox", ")", ";", "mbox", ".", "name", "=", "null", ";", "mb...
Close the specified mailbox with the given reason. @param mbox the mailbox to close. @param reason an Erlang term describing the reason for the termination. <p> After this operation, the mailbox will no longer be able to receive messages. Any delivered but as yet unretrieved messages can still be retrieved however. </p> <p> If there are links from the mailbox to other {@link OtpErlangPid pids}, they will be broken when this method is called and exit signals with the given reason will be sent. </p>
[ "Close", "the", "specified", "mailbox", "with", "the", "given", "reason", "." ]
train
https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpNode.java#L320-L326
BioPAX/Paxtools
paxtools-core/src/main/java/org/biopax/paxtools/io/SimpleIOHandler.java
SimpleIOHandler.bindValue
private void bindValue(Triple triple, Model model) { """ Binds property. This method also throws exceptions related to binding. @param triple A java object that represents an RDF Triple - domain-property-range. @param model that is being populated. """ if (log.isDebugEnabled()) log.debug(String.valueOf(triple)); BioPAXElement domain = model.getByID(triple.domain); PropertyEditor editor = this.getEditorMap().getEditorForProperty(triple.property, domain.getModelInterface()); bindValue(triple.range, editor, domain, model); }
java
private void bindValue(Triple triple, Model model) { if (log.isDebugEnabled()) log.debug(String.valueOf(triple)); BioPAXElement domain = model.getByID(triple.domain); PropertyEditor editor = this.getEditorMap().getEditorForProperty(triple.property, domain.getModelInterface()); bindValue(triple.range, editor, domain, model); }
[ "private", "void", "bindValue", "(", "Triple", "triple", ",", "Model", "model", ")", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "log", ".", "debug", "(", "String", ".", "valueOf", "(", "triple", ")", ")", ";", "BioPAXElement", "domain...
Binds property. This method also throws exceptions related to binding. @param triple A java object that represents an RDF Triple - domain-property-range. @param model that is being populated.
[ "Binds", "property", "." ]
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/io/SimpleIOHandler.java#L338-L348
threerings/nenya
core/src/main/java/com/threerings/media/AbstractMediaManager.java
AbstractMediaManager.paint
public void paint (Graphics2D gfx, int layer, Shape clip) { """ Renders all registered media in the given layer that intersect the supplied clipping rectangle to the given graphics context. @param layer the layer to render; one of {@link #FRONT}, {@link #BACK}, or {@link #ALL}. The front layer contains all animations with a positive render order; the back layer contains all animations with a negative render order; all, both. """ for (int ii = 0, nn = _media.size(); ii < nn; ii++) { AbstractMedia media = _media.get(ii); int order = media.getRenderOrder(); try { if (((layer == ALL) || (layer == FRONT && order >= 0) || (layer == BACK && order < 0)) && clip.intersects(media.getBounds())) { media.paint(gfx); } } catch (Exception e) { log.warning("Failed to render media", "media", media, e); } } }
java
public void paint (Graphics2D gfx, int layer, Shape clip) { for (int ii = 0, nn = _media.size(); ii < nn; ii++) { AbstractMedia media = _media.get(ii); int order = media.getRenderOrder(); try { if (((layer == ALL) || (layer == FRONT && order >= 0) || (layer == BACK && order < 0)) && clip.intersects(media.getBounds())) { media.paint(gfx); } } catch (Exception e) { log.warning("Failed to render media", "media", media, e); } } }
[ "public", "void", "paint", "(", "Graphics2D", "gfx", ",", "int", "layer", ",", "Shape", "clip", ")", "{", "for", "(", "int", "ii", "=", "0", ",", "nn", "=", "_media", ".", "size", "(", ")", ";", "ii", "<", "nn", ";", "ii", "++", ")", "{", "Ab...
Renders all registered media in the given layer that intersect the supplied clipping rectangle to the given graphics context. @param layer the layer to render; one of {@link #FRONT}, {@link #BACK}, or {@link #ALL}. The front layer contains all animations with a positive render order; the back layer contains all animations with a negative render order; all, both.
[ "Renders", "all", "registered", "media", "in", "the", "given", "layer", "that", "intersect", "the", "supplied", "clipping", "rectangle", "to", "the", "given", "graphics", "context", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/AbstractMediaManager.java#L103-L118
JRebirth/JRebirth
org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/AbstractService.java
AbstractService.updateTitle
public void updateTitle(final Wave wave, final String title) { """ Update the current message of the service task related to the given wave. @param wave the wave that trigger the service task call @param title the title of the service task processed """ // Update the task title into JAT JRebirth.runIntoJAT("Service Task Title => " + title, () -> wave.get(JRebirthWaves.SERVICE_TASK).updateTitle(title)); }
java
public void updateTitle(final Wave wave, final String title) { // Update the task title into JAT JRebirth.runIntoJAT("Service Task Title => " + title, () -> wave.get(JRebirthWaves.SERVICE_TASK).updateTitle(title)); }
[ "public", "void", "updateTitle", "(", "final", "Wave", "wave", ",", "final", "String", "title", ")", "{", "// Update the task title into JAT", "JRebirth", ".", "runIntoJAT", "(", "\"Service Task Title => \"", "+", "title", ",", "(", ")", "->", "wave", ".", "get"...
Update the current message of the service task related to the given wave. @param wave the wave that trigger the service task call @param title the title of the service task processed
[ "Update", "the", "current", "message", "of", "the", "service", "task", "related", "to", "the", "given", "wave", "." ]
train
https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/AbstractService.java#L359-L364
AdamBien/enhydrator
enhydrator/src/main/java/com/airhacks/enhydrator/in/Row.java
Row.addColumn
public Row addColumn(int index, String name, Object value) { """ Adds or overrides a column with a default destination @param index the origin index @param name a unique name of the column. @param value @return reference for method chaining """ Objects.requireNonNull(name, "Name of the column cannot be null"); Objects.requireNonNull(value, "Value of " + name + " cannot be null"); final Column column = new Column(index, name, value); return this.addColumn(column); }
java
public Row addColumn(int index, String name, Object value) { Objects.requireNonNull(name, "Name of the column cannot be null"); Objects.requireNonNull(value, "Value of " + name + " cannot be null"); final Column column = new Column(index, name, value); return this.addColumn(column); }
[ "public", "Row", "addColumn", "(", "int", "index", ",", "String", "name", ",", "Object", "value", ")", "{", "Objects", ".", "requireNonNull", "(", "name", ",", "\"Name of the column cannot be null\"", ")", ";", "Objects", ".", "requireNonNull", "(", "value", "...
Adds or overrides a column with a default destination @param index the origin index @param name a unique name of the column. @param value @return reference for method chaining
[ "Adds", "or", "overrides", "a", "column", "with", "a", "default", "destination" ]
train
https://github.com/AdamBien/enhydrator/blob/7a2a2f0a05e533b53f27fab73ce8d58aae852379/enhydrator/src/main/java/com/airhacks/enhydrator/in/Row.java#L115-L120
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/cdn/CdnClient.java
CdnClient.setDomainLimitRate
public SetDomainLimitRateResponse setDomainLimitRate(SetDomainLimitRateRequest request) { """ Set the rate limit of specified domain acceleration. @param request The request containing all of the options related to the update request. @return Result of the setDomainLimitRate operation returned by the service. """ checkNotNull(request, "The parameter request should NOT be null."); InternalRequest internalRequest = createRequest(request, HttpMethodName.PUT, DOMAIN, request.getDomain(), "config"); internalRequest.addParameter("limitRate",""); this.attachRequestToBody(request, internalRequest); return invokeHttpClient(internalRequest, SetDomainLimitRateResponse.class); }
java
public SetDomainLimitRateResponse setDomainLimitRate(SetDomainLimitRateRequest request) { checkNotNull(request, "The parameter request should NOT be null."); InternalRequest internalRequest = createRequest(request, HttpMethodName.PUT, DOMAIN, request.getDomain(), "config"); internalRequest.addParameter("limitRate",""); this.attachRequestToBody(request, internalRequest); return invokeHttpClient(internalRequest, SetDomainLimitRateResponse.class); }
[ "public", "SetDomainLimitRateResponse", "setDomainLimitRate", "(", "SetDomainLimitRateRequest", "request", ")", "{", "checkNotNull", "(", "request", ",", "\"The parameter request should NOT be null.\"", ")", ";", "InternalRequest", "internalRequest", "=", "createRequest", "(", ...
Set the rate limit of specified domain acceleration. @param request The request containing all of the options related to the update request. @return Result of the setDomainLimitRate operation returned by the service.
[ "Set", "the", "rate", "limit", "of", "specified", "domain", "acceleration", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/cdn/CdnClient.java#L439-L445
rundeck/rundeck
core/src/main/java/com/dtolabs/rundeck/core/common/ProjectNodeSupport.java
ProjectNodeSupport.listPluginConfigurations
public List<ExtPluginConfiguration> listPluginConfigurations(final String keyprefix, final String serviceName) { """ Return a list of resource model configuration @param serviceName @param keyprefix prefix for properties @return List of Maps, each map containing "type": String, "props":Properties """ return listPluginConfigurations(keyprefix, serviceName, true); }
java
public List<ExtPluginConfiguration> listPluginConfigurations(final String keyprefix, final String serviceName) { return listPluginConfigurations(keyprefix, serviceName, true); }
[ "public", "List", "<", "ExtPluginConfiguration", ">", "listPluginConfigurations", "(", "final", "String", "keyprefix", ",", "final", "String", "serviceName", ")", "{", "return", "listPluginConfigurations", "(", "keyprefix", ",", "serviceName", ",", "true", ")", ";",...
Return a list of resource model configuration @param serviceName @param keyprefix prefix for properties @return List of Maps, each map containing "type": String, "props":Properties
[ "Return", "a", "list", "of", "resource", "model", "configuration" ]
train
https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/common/ProjectNodeSupport.java#L683-L686
dadoonet/fscrawler
framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/framework/FsCrawlerUtil.java
FsCrawlerUtil.readJsonVersionedFile
private static String readJsonVersionedFile(Path dir, String version, String type) throws IOException { """ Reads a mapping from dir/version/type.json file @param dir Directory containing mapping files per major version @param version Elasticsearch major version number (only major digit is kept so for 2.3.4 it will be 2) @param type The expected type (will be expanded to type.json) @return the mapping @throws IOException If the mapping can not be read """ Path file = dir.resolve(version).resolve(type + ".json"); return new String(Files.readAllBytes(file), StandardCharsets.UTF_8); }
java
private static String readJsonVersionedFile(Path dir, String version, String type) throws IOException { Path file = dir.resolve(version).resolve(type + ".json"); return new String(Files.readAllBytes(file), StandardCharsets.UTF_8); }
[ "private", "static", "String", "readJsonVersionedFile", "(", "Path", "dir", ",", "String", "version", ",", "String", "type", ")", "throws", "IOException", "{", "Path", "file", "=", "dir", ".", "resolve", "(", "version", ")", ".", "resolve", "(", "type", "+...
Reads a mapping from dir/version/type.json file @param dir Directory containing mapping files per major version @param version Elasticsearch major version number (only major digit is kept so for 2.3.4 it will be 2) @param type The expected type (will be expanded to type.json) @return the mapping @throws IOException If the mapping can not be read
[ "Reads", "a", "mapping", "from", "dir", "/", "version", "/", "type", ".", "json", "file" ]
train
https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/framework/src/main/java/fr/pilato/elasticsearch/crawler/fs/framework/FsCrawlerUtil.java#L100-L103
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java
FlowController.resolveAction
public String resolveAction( String actionName, Object form, HttpServletRequest request, HttpServletResponse response ) throws Exception { """ Call an action and return the result URI. @param actionName the name of the action to run. @param form the form bean instance to pass to the action, or <code>null</code> if none should be passed. @return the result webapp-relative URI, as a String. @throws ActionNotFoundException when the given action does not exist in this FlowController. @throws Exception if the action method throws an Exception. """ ActionMapping mapping = ( ActionMapping ) getModuleConfig().findActionConfig( '/' + actionName ); if ( mapping == null ) { InternalUtils.throwPageFlowException( new ActionNotFoundException( actionName, this, form ), request ); } ActionForward fwd = getActionMethodForward( actionName, form, request, response, mapping ); if ( fwd instanceof Forward ) { ( ( Forward ) fwd ).initialize( mapping, this, request ); } String path = fwd.getPath(); if ( fwd.getContextRelative() || FileUtils.isAbsoluteURI( path ) ) { return path; } else { return getModulePath() + path; } }
java
public String resolveAction( String actionName, Object form, HttpServletRequest request, HttpServletResponse response ) throws Exception { ActionMapping mapping = ( ActionMapping ) getModuleConfig().findActionConfig( '/' + actionName ); if ( mapping == null ) { InternalUtils.throwPageFlowException( new ActionNotFoundException( actionName, this, form ), request ); } ActionForward fwd = getActionMethodForward( actionName, form, request, response, mapping ); if ( fwd instanceof Forward ) { ( ( Forward ) fwd ).initialize( mapping, this, request ); } String path = fwd.getPath(); if ( fwd.getContextRelative() || FileUtils.isAbsoluteURI( path ) ) { return path; } else { return getModulePath() + path; } }
[ "public", "String", "resolveAction", "(", "String", "actionName", ",", "Object", "form", ",", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "Exception", "{", "ActionMapping", "mapping", "=", "(", "ActionMapping", ")", "getMo...
Call an action and return the result URI. @param actionName the name of the action to run. @param form the form bean instance to pass to the action, or <code>null</code> if none should be passed. @return the result webapp-relative URI, as a String. @throws ActionNotFoundException when the given action does not exist in this FlowController. @throws Exception if the action method throws an Exception.
[ "Call", "an", "action", "and", "return", "the", "result", "URI", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowController.java#L1095-L1122
mojohaus/webstart
webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/sign/SignConfig.java
SignConfig.createVerifyRequest
public JarSignerRequest createVerifyRequest( File jarFile, boolean certs ) { """ Creates a jarsigner request to do a verify operation. @param jarFile the location of the jar to sign @param certs flag to show certificates details @return the jarsigner request """ JarSignerVerifyRequest request = new JarSignerVerifyRequest(); request.setCerts( certs ); request.setWorkingDirectory( workDirectory ); request.setMaxMemory( getMaxMemory() ); request.setVerbose( isVerbose() ); request.setArchive( jarFile ); return request; }
java
public JarSignerRequest createVerifyRequest( File jarFile, boolean certs ) { JarSignerVerifyRequest request = new JarSignerVerifyRequest(); request.setCerts( certs ); request.setWorkingDirectory( workDirectory ); request.setMaxMemory( getMaxMemory() ); request.setVerbose( isVerbose() ); request.setArchive( jarFile ); return request; }
[ "public", "JarSignerRequest", "createVerifyRequest", "(", "File", "jarFile", ",", "boolean", "certs", ")", "{", "JarSignerVerifyRequest", "request", "=", "new", "JarSignerVerifyRequest", "(", ")", ";", "request", ".", "setCerts", "(", "certs", ")", ";", "request",...
Creates a jarsigner request to do a verify operation. @param jarFile the location of the jar to sign @param certs flag to show certificates details @return the jarsigner request
[ "Creates", "a", "jarsigner", "request", "to", "do", "a", "verify", "operation", "." ]
train
https://github.com/mojohaus/webstart/blob/38fdd1d21f063f21716cfcd61ebeabd963487576/webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/sign/SignConfig.java#L354-L363
OpenLiberty/open-liberty
dev/com.ibm.ws.classloading/src/com/ibm/ws/library/internal/LibraryPackageExporter.java
LibraryPackageExporter.getLibraryExporterRegion
private Region getLibraryExporterRegion(final RegionDigraph digraph, final PackageVisibility visibility) throws BundleException { """ /* Gets or creates the region to install the exporting bundle to. The implementation only uses one of two regions. 1) for all bundles that expose packages to the liberty kernel region 2) for all bundles that expose packages to the osgi applications region for API access """ final String libertyExporterRegionName = getExportFromRegion(visibility); final Region existingLibraryExporter = digraph.getRegion(libertyExporterRegionName); if (existingLibraryExporter == null) { ApiRegion.update(digraph, new Callable<RegionDigraph>() { @Override public RegionDigraph call() throws Exception { RegionDigraph copy = digraph.copy(); Region libraryExporter = copy.getRegion(libertyExporterRegionName); if (libraryExporter != null) { // another thread won creating the region return null; } libraryExporter = copy.createRegion(libertyExporterRegionName); // notice that we assume the exportTo region already exists. // if it does not then we will get an NPE below. Region exportTo = copy.getRegion(getExportToRegion(visibility)); RegionFilterBuilder builder = copy.createRegionFilterBuilder(); // allow all packages into the product hub so that all packages provided by // the library are visible for all liberty feature bundles to use. builder.allowAll(RegionFilter.VISIBLE_PACKAGE_NAMESPACE); exportTo.connectRegion(libraryExporter, builder.build()); return copy; } }); return digraph.getRegion(libertyExporterRegionName); } return existingLibraryExporter; }
java
private Region getLibraryExporterRegion(final RegionDigraph digraph, final PackageVisibility visibility) throws BundleException { final String libertyExporterRegionName = getExportFromRegion(visibility); final Region existingLibraryExporter = digraph.getRegion(libertyExporterRegionName); if (existingLibraryExporter == null) { ApiRegion.update(digraph, new Callable<RegionDigraph>() { @Override public RegionDigraph call() throws Exception { RegionDigraph copy = digraph.copy(); Region libraryExporter = copy.getRegion(libertyExporterRegionName); if (libraryExporter != null) { // another thread won creating the region return null; } libraryExporter = copy.createRegion(libertyExporterRegionName); // notice that we assume the exportTo region already exists. // if it does not then we will get an NPE below. Region exportTo = copy.getRegion(getExportToRegion(visibility)); RegionFilterBuilder builder = copy.createRegionFilterBuilder(); // allow all packages into the product hub so that all packages provided by // the library are visible for all liberty feature bundles to use. builder.allowAll(RegionFilter.VISIBLE_PACKAGE_NAMESPACE); exportTo.connectRegion(libraryExporter, builder.build()); return copy; } }); return digraph.getRegion(libertyExporterRegionName); } return existingLibraryExporter; }
[ "private", "Region", "getLibraryExporterRegion", "(", "final", "RegionDigraph", "digraph", ",", "final", "PackageVisibility", "visibility", ")", "throws", "BundleException", "{", "final", "String", "libertyExporterRegionName", "=", "getExportFromRegion", "(", "visibility", ...
/* Gets or creates the region to install the exporting bundle to. The implementation only uses one of two regions. 1) for all bundles that expose packages to the liberty kernel region 2) for all bundles that expose packages to the osgi applications region for API access
[ "/", "*", "Gets", "or", "creates", "the", "region", "to", "install", "the", "exporting", "bundle", "to", ".", "The", "implementation", "only", "uses", "one", "of", "two", "regions", ".", "1", ")", "for", "all", "bundles", "that", "expose", "packages", "t...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/library/internal/LibraryPackageExporter.java#L192-L220
Jasig/uPortal
uPortal-rendering/src/main/java/org/apereo/portal/url/xml/XsltPortalUrlProvider.java
XsltPortalUrlProvider.addParameter
public static void addParameter(IUrlBuilder urlBuilder, String name, String value) { """ Needed due to compile-time type checking limitations of the XSLTC compiler """ urlBuilder.addParameter(name, value); }
java
public static void addParameter(IUrlBuilder urlBuilder, String name, String value) { urlBuilder.addParameter(name, value); }
[ "public", "static", "void", "addParameter", "(", "IUrlBuilder", "urlBuilder", ",", "String", "name", ",", "String", "value", ")", "{", "urlBuilder", ".", "addParameter", "(", "name", ",", "value", ")", ";", "}" ]
Needed due to compile-time type checking limitations of the XSLTC compiler
[ "Needed", "due", "to", "compile", "-", "time", "type", "checking", "limitations", "of", "the", "XSLTC", "compiler" ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-rendering/src/main/java/org/apereo/portal/url/xml/XsltPortalUrlProvider.java#L50-L52
tvesalainen/util
util/src/main/java/org/vesalainen/util/CmdArgs.java
CmdArgs.addOption
public final <T> void addOption(String name, String description, String exclusiveGroup, T defValue) { """ Add an option @param <T> @param name Option name Option name without @param description Option description @param exclusiveGroup A group of options. Only options of a single group are accepted. @param defValue Option default value """ Option opt = new Option(name, description, exclusiveGroup, defValue); Option old = map.put(name, opt); if (old != null) { throw new IllegalArgumentException(name+" was already added"); } if (exclusiveGroup != null) { groups.add(exclusiveGroup, opt); } }
java
public final <T> void addOption(String name, String description, String exclusiveGroup, T defValue) { Option opt = new Option(name, description, exclusiveGroup, defValue); Option old = map.put(name, opt); if (old != null) { throw new IllegalArgumentException(name+" was already added"); } if (exclusiveGroup != null) { groups.add(exclusiveGroup, opt); } }
[ "public", "final", "<", "T", ">", "void", "addOption", "(", "String", "name", ",", "String", "description", ",", "String", "exclusiveGroup", ",", "T", "defValue", ")", "{", "Option", "opt", "=", "new", "Option", "(", "name", ",", "description", ",", "exc...
Add an option @param <T> @param name Option name Option name without @param description Option description @param exclusiveGroup A group of options. Only options of a single group are accepted. @param defValue Option default value
[ "Add", "an", "option" ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/CmdArgs.java#L384-L396
stripe/stripe-java
src/main/java/com/stripe/net/Webhook.java
Webhook.constructEvent
public static Event constructEvent(String payload, String sigHeader, String secret) throws SignatureVerificationException { """ Returns an Event instance using the provided JSON payload. Throws a JsonSyntaxException if the payload is not valid JSON, and a SignatureVerificationException if the signature verification fails for any reason. @param payload the payload sent by Stripe. @param sigHeader the contents of the signature header sent by Stripe. @param secret secret used to generate the signature. @return the Event instance @throws SignatureVerificationException if the verification fails. """ return constructEvent(payload, sigHeader, secret, DEFAULT_TOLERANCE); }
java
public static Event constructEvent(String payload, String sigHeader, String secret) throws SignatureVerificationException { return constructEvent(payload, sigHeader, secret, DEFAULT_TOLERANCE); }
[ "public", "static", "Event", "constructEvent", "(", "String", "payload", ",", "String", "sigHeader", ",", "String", "secret", ")", "throws", "SignatureVerificationException", "{", "return", "constructEvent", "(", "payload", ",", "sigHeader", ",", "secret", ",", "D...
Returns an Event instance using the provided JSON payload. Throws a JsonSyntaxException if the payload is not valid JSON, and a SignatureVerificationException if the signature verification fails for any reason. @param payload the payload sent by Stripe. @param sigHeader the contents of the signature header sent by Stripe. @param secret secret used to generate the signature. @return the Event instance @throws SignatureVerificationException if the verification fails.
[ "Returns", "an", "Event", "instance", "using", "the", "provided", "JSON", "payload", ".", "Throws", "a", "JsonSyntaxException", "if", "the", "payload", "is", "not", "valid", "JSON", "and", "a", "SignatureVerificationException", "if", "the", "signature", "verificat...
train
https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/Webhook.java#L30-L33
wildfly/wildfly-core
network/src/main/java/org/jboss/as/network/SocketBinding.java
SocketBinding.getMulticastSocketAddress
public InetSocketAddress getMulticastSocketAddress() { """ Get the multicast socket address. @return the multicast address """ if (multicastAddress == null) { throw MESSAGES.noMulticastBinding(name); } return new InetSocketAddress(multicastAddress, multicastPort); }
java
public InetSocketAddress getMulticastSocketAddress() { if (multicastAddress == null) { throw MESSAGES.noMulticastBinding(name); } return new InetSocketAddress(multicastAddress, multicastPort); }
[ "public", "InetSocketAddress", "getMulticastSocketAddress", "(", ")", "{", "if", "(", "multicastAddress", "==", "null", ")", "{", "throw", "MESSAGES", ".", "noMulticastBinding", "(", "name", ")", ";", "}", "return", "new", "InetSocketAddress", "(", "multicastAddre...
Get the multicast socket address. @return the multicast address
[ "Get", "the", "multicast", "socket", "address", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/network/src/main/java/org/jboss/as/network/SocketBinding.java#L139-L144
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_easyHunting_serviceName_hunting_PUT
public void billingAccount_easyHunting_serviceName_hunting_PUT(String billingAccount, String serviceName, OvhOvhPabxHunting body) throws IOException { """ Alter this object properties REST: PUT /telephony/{billingAccount}/easyHunting/{serviceName}/hunting @param body [required] New object properties @param billingAccount [required] The name of your billingAccount @param serviceName [required] """ String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/hunting"; StringBuilder sb = path(qPath, billingAccount, serviceName); exec(qPath, "PUT", sb.toString(), body); }
java
public void billingAccount_easyHunting_serviceName_hunting_PUT(String billingAccount, String serviceName, OvhOvhPabxHunting body) throws IOException { String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/hunting"; StringBuilder sb = path(qPath, billingAccount, serviceName); exec(qPath, "PUT", sb.toString(), body); }
[ "public", "void", "billingAccount_easyHunting_serviceName_hunting_PUT", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "OvhOvhPabxHunting", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/telephony/{billingAccount}/easyHunting/{servic...
Alter this object properties REST: PUT /telephony/{billingAccount}/easyHunting/{serviceName}/hunting @param body [required] New object properties @param billingAccount [required] The name of your billingAccount @param serviceName [required]
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L2787-L2791
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.filemonitor/src/com/ibm/ws/kernel/filemonitor/internal/MonitorHolder.java
MonitorHolder.processFileRefresh
void processFileRefresh(boolean doFilterPaths, String listenerFilter) { """ Processes file refresh operations for specific listeners. @param doFilterPaths The filter indicator. If true, input paths are filtered against pending file events. If false, all pending file events are processed. @param listenerFilter The filter string that allows only those listeners with a matching id to be called to process the event. """ externalScan(null, null, null, doFilterPaths, listenerFilter); }
java
void processFileRefresh(boolean doFilterPaths, String listenerFilter) { externalScan(null, null, null, doFilterPaths, listenerFilter); }
[ "void", "processFileRefresh", "(", "boolean", "doFilterPaths", ",", "String", "listenerFilter", ")", "{", "externalScan", "(", "null", ",", "null", ",", "null", ",", "doFilterPaths", ",", "listenerFilter", ")", ";", "}" ]
Processes file refresh operations for specific listeners. @param doFilterPaths The filter indicator. If true, input paths are filtered against pending file events. If false, all pending file events are processed. @param listenerFilter The filter string that allows only those listeners with a matching id to be called to process the event.
[ "Processes", "file", "refresh", "operations", "for", "specific", "listeners", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.filemonitor/src/com/ibm/ws/kernel/filemonitor/internal/MonitorHolder.java#L1142-L1144
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java
ElementsExceptionsFactory.newAuthorizationException
public static AuthorizationException newAuthorizationException(String message, Object... args) { """ Constructs and initializes a new {@link AuthorizationException} with the given {@link String message} formatted with the given {@link Object[] arguments}. @param message {@link String} describing the {@link AuthorizationException exception}. @param args {@link Object[] arguments} used to replace format placeholders in the {@link String message}. @return a new {@link AuthorizationException} with the given {@link String message}. @see #newAuthorizationException(Throwable, String, Object...) @see org.cp.elements.security.AuthorizationException """ return newAuthorizationException(null, message, args); }
java
public static AuthorizationException newAuthorizationException(String message, Object... args) { return newAuthorizationException(null, message, args); }
[ "public", "static", "AuthorizationException", "newAuthorizationException", "(", "String", "message", ",", "Object", "...", "args", ")", "{", "return", "newAuthorizationException", "(", "null", ",", "message", ",", "args", ")", ";", "}" ]
Constructs and initializes a new {@link AuthorizationException} with the given {@link String message} formatted with the given {@link Object[] arguments}. @param message {@link String} describing the {@link AuthorizationException exception}. @param args {@link Object[] arguments} used to replace format placeholders in the {@link String message}. @return a new {@link AuthorizationException} with the given {@link String message}. @see #newAuthorizationException(Throwable, String, Object...) @see org.cp.elements.security.AuthorizationException
[ "Constructs", "and", "initializes", "a", "new", "{", "@link", "AuthorizationException", "}", "with", "the", "given", "{", "@link", "String", "message", "}", "formatted", "with", "the", "given", "{", "@link", "Object", "[]", "arguments", "}", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L613-L615
ngageoint/geopackage-core-java
src/main/java/mil/nga/geopackage/extension/RTreeIndexCoreExtension.java
RTreeIndexCoreExtension.getRTreeTableName
private String getRTreeTableName(String tableName, String geometryColumnName) { """ Get the RTree Table name for the feature table and geometry column @param tableName feature table name @param geometryColumnName geometry column name @return RTree table name """ String sqlName = GeoPackageProperties.getProperty(SQL_PROPERTY, TABLE_PROPERTY); String rTreeTableName = substituteSqlArguments(sqlName, tableName, geometryColumnName, null, null); return rTreeTableName; }
java
private String getRTreeTableName(String tableName, String geometryColumnName) { String sqlName = GeoPackageProperties.getProperty(SQL_PROPERTY, TABLE_PROPERTY); String rTreeTableName = substituteSqlArguments(sqlName, tableName, geometryColumnName, null, null); return rTreeTableName; }
[ "private", "String", "getRTreeTableName", "(", "String", "tableName", ",", "String", "geometryColumnName", ")", "{", "String", "sqlName", "=", "GeoPackageProperties", ".", "getProperty", "(", "SQL_PROPERTY", ",", "TABLE_PROPERTY", ")", ";", "String", "rTreeTableName",...
Get the RTree Table name for the feature table and geometry column @param tableName feature table name @param geometryColumnName geometry column name @return RTree table name
[ "Get", "the", "RTree", "Table", "name", "for", "the", "feature", "table", "and", "geometry", "column" ]
train
https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/RTreeIndexCoreExtension.java#L1115-L1121
xm-online/xm-commons
xm-commons-tenant/src/main/java/com/icthh/xm/commons/tenant/internal/TenantContextDataHolder.java
TenantContextDataHolder.setData
void setData(Map<String, Object> data) { """ Sets tenant context data. Must be called after {@link #setTenant}. @param data data to set into context """ Objects.requireNonNull(data, "data can't be null"); // @adovbnya DO NOT CHANGE !!!! // allow tenant change only from initial (empty) value or only from super tenant if (this.dataMap.isEmpty()) { this.dataMap = ValueHolder.valueOf(data); } else if (!Objects.equals(this.dataMap.get(), data)) { if (!this.tenant.isPresent()) { throw new IllegalStateException("Tenant doesn't set in context yet"); } if (this.tenant.get().isSuper()) { this.dataMap = ValueHolder.valueOf(data); } else { StackTraceElement[] traces = Thread.currentThread().getStackTrace(); if (!isAllowedToChangeTenant(traces)) { throw new IllegalStateException("Trying to set the data from " + this.dataMap.get() + " to " + data); } } } }
java
void setData(Map<String, Object> data) { Objects.requireNonNull(data, "data can't be null"); // @adovbnya DO NOT CHANGE !!!! // allow tenant change only from initial (empty) value or only from super tenant if (this.dataMap.isEmpty()) { this.dataMap = ValueHolder.valueOf(data); } else if (!Objects.equals(this.dataMap.get(), data)) { if (!this.tenant.isPresent()) { throw new IllegalStateException("Tenant doesn't set in context yet"); } if (this.tenant.get().isSuper()) { this.dataMap = ValueHolder.valueOf(data); } else { StackTraceElement[] traces = Thread.currentThread().getStackTrace(); if (!isAllowedToChangeTenant(traces)) { throw new IllegalStateException("Trying to set the data from " + this.dataMap.get() + " to " + data); } } } }
[ "void", "setData", "(", "Map", "<", "String", ",", "Object", ">", "data", ")", "{", "Objects", ".", "requireNonNull", "(", "data", ",", "\"data can't be null\"", ")", ";", "// @adovbnya DO NOT CHANGE !!!!", "// allow tenant change only from initial (empty) value or only f...
Sets tenant context data. Must be called after {@link #setTenant}. @param data data to set into context
[ "Sets", "tenant", "context", "data", ".", "Must", "be", "called", "after", "{", "@link", "#setTenant", "}", "." ]
train
https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-tenant/src/main/java/com/icthh/xm/commons/tenant/internal/TenantContextDataHolder.java#L101-L124
unbescape/unbescape
src/main/java/org/unbescape/html/HtmlEscape.java
HtmlEscape.escapeHtml4Xml
public static void escapeHtml4Xml(final char[] text, final int offset, final int len, final Writer writer) throws IOException { """ <p> Perform an HTML 4 level 1 (XML-style) <strong>escape</strong> operation on a <tt>char[]</tt> input. </p> <p> <em>Level 1</em> means this method will only escape the five markup-significant characters: <tt>&lt;</tt>, <tt>&gt;</tt>, <tt>&amp;</tt>, <tt>&quot;</tt> and <tt>&#39;</tt>. It is called <em>XML-style</em> in order to link it with JSP's <tt>escapeXml</tt> attribute in JSTL's <tt>&lt;c:out ... /&gt;</tt> tags. </p> <p> Note this method may <strong>not</strong> produce the same results as {@link #escapeHtml5Xml(char[], int, int, java.io.Writer)} because it will escape the apostrophe as <tt>&amp;#39;</tt>, whereas in HTML5 there is a specific NCR for such character (<tt>&amp;apos;</tt>). </p> <p> This method calls {@link #escapeHtml(char[], int, int, java.io.Writer, HtmlEscapeType, HtmlEscapeLevel)} with the following preconfigured values: </p> <ul> <li><tt>type</tt>: {@link org.unbescape.html.HtmlEscapeType#HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL}</li> <li><tt>level</tt>: {@link org.unbescape.html.HtmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}</li> </ul> <p> This method is <strong>thread-safe</strong>. </p> @param text the <tt>char[]</tt> to be escaped. @param offset the position in <tt>text</tt> at which the escape operation should start. @param len the number of characters in <tt>text</tt> that should be escaped. @param writer the <tt>java.io.Writer</tt> to which the escaped result will be written. Nothing will be written at all to this writer if input is <tt>null</tt>. @throws IOException if an input/output exception occurs """ escapeHtml(text, offset, len, writer, HtmlEscapeType.HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL, HtmlEscapeLevel.LEVEL_1_ONLY_MARKUP_SIGNIFICANT); }
java
public static void escapeHtml4Xml(final char[] text, final int offset, final int len, final Writer writer) throws IOException { escapeHtml(text, offset, len, writer, HtmlEscapeType.HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL, HtmlEscapeLevel.LEVEL_1_ONLY_MARKUP_SIGNIFICANT); }
[ "public", "static", "void", "escapeHtml4Xml", "(", "final", "char", "[", "]", "text", ",", "final", "int", "offset", ",", "final", "int", "len", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "escapeHtml", "(", "text", ",", "offset", ...
<p> Perform an HTML 4 level 1 (XML-style) <strong>escape</strong> operation on a <tt>char[]</tt> input. </p> <p> <em>Level 1</em> means this method will only escape the five markup-significant characters: <tt>&lt;</tt>, <tt>&gt;</tt>, <tt>&amp;</tt>, <tt>&quot;</tt> and <tt>&#39;</tt>. It is called <em>XML-style</em> in order to link it with JSP's <tt>escapeXml</tt> attribute in JSTL's <tt>&lt;c:out ... /&gt;</tt> tags. </p> <p> Note this method may <strong>not</strong> produce the same results as {@link #escapeHtml5Xml(char[], int, int, java.io.Writer)} because it will escape the apostrophe as <tt>&amp;#39;</tt>, whereas in HTML5 there is a specific NCR for such character (<tt>&amp;apos;</tt>). </p> <p> This method calls {@link #escapeHtml(char[], int, int, java.io.Writer, HtmlEscapeType, HtmlEscapeLevel)} with the following preconfigured values: </p> <ul> <li><tt>type</tt>: {@link org.unbescape.html.HtmlEscapeType#HTML4_NAMED_REFERENCES_DEFAULT_TO_DECIMAL}</li> <li><tt>level</tt>: {@link org.unbescape.html.HtmlEscapeLevel#LEVEL_1_ONLY_MARKUP_SIGNIFICANT}</li> </ul> <p> This method is <strong>thread-safe</strong>. </p> @param text the <tt>char[]</tt> to be escaped. @param offset the position in <tt>text</tt> at which the escape operation should start. @param len the number of characters in <tt>text</tt> that should be escaped. @param writer the <tt>java.io.Writer</tt> to which the escaped result will be written. Nothing will be written at all to this writer if input is <tt>null</tt>. @throws IOException if an input/output exception occurs
[ "<p", ">", "Perform", "an", "HTML", "4", "level", "1", "(", "XML", "-", "style", ")", "<strong", ">", "escape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "char", "[]", "<", "/", "tt", ">", "input", ".", "<", "/", "p", ">", "<p", ...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/html/HtmlEscape.java#L1000-L1004
elastic/elasticsearch-hadoop
hive/src/main/java/org/elasticsearch/hadoop/hive/HiveUtils.java
HiveUtils.discoverJsonFieldName
static String discoverJsonFieldName(Settings settings, FieldAlias alias) { """ Selects an appropriate field from the given Hive table schema to insert JSON data into if the feature is enabled @param settings Settings to read schema information from @return A FieldAlias object that projects the json source field into the select destination field """ Set<String> virtualColumnsToBeRemoved = new HashSet<String>(HiveConstants.VIRTUAL_COLUMNS.length); Collections.addAll(virtualColumnsToBeRemoved, HiveConstants.VIRTUAL_COLUMNS); List<String> columnNames = StringUtils.tokenize(settings.getProperty(HiveConstants.COLUMNS), ","); Iterator<String> nameIter = columnNames.iterator(); List<String> columnTypes = StringUtils.tokenize(settings.getProperty(HiveConstants.COLUMNS_TYPES), ":"); Iterator<String> typeIter = columnTypes.iterator(); String candidateField = null; while(nameIter.hasNext() && candidateField == null) { String columnName = nameIter.next(); String type = typeIter.next(); if ("string".equalsIgnoreCase(type) && !virtualColumnsToBeRemoved.contains(columnName)) { candidateField = columnName; } } Assert.hasText(candidateField, "Could not identify a field to insert JSON data into " + "from the given fields : {" + columnNames + "} of types {" + columnTypes + "}"); // If the candidate field is aliased to something else, find the alias name and use that for the field name: candidateField = alias.toES(candidateField); return candidateField; }
java
static String discoverJsonFieldName(Settings settings, FieldAlias alias) { Set<String> virtualColumnsToBeRemoved = new HashSet<String>(HiveConstants.VIRTUAL_COLUMNS.length); Collections.addAll(virtualColumnsToBeRemoved, HiveConstants.VIRTUAL_COLUMNS); List<String> columnNames = StringUtils.tokenize(settings.getProperty(HiveConstants.COLUMNS), ","); Iterator<String> nameIter = columnNames.iterator(); List<String> columnTypes = StringUtils.tokenize(settings.getProperty(HiveConstants.COLUMNS_TYPES), ":"); Iterator<String> typeIter = columnTypes.iterator(); String candidateField = null; while(nameIter.hasNext() && candidateField == null) { String columnName = nameIter.next(); String type = typeIter.next(); if ("string".equalsIgnoreCase(type) && !virtualColumnsToBeRemoved.contains(columnName)) { candidateField = columnName; } } Assert.hasText(candidateField, "Could not identify a field to insert JSON data into " + "from the given fields : {" + columnNames + "} of types {" + columnTypes + "}"); // If the candidate field is aliased to something else, find the alias name and use that for the field name: candidateField = alias.toES(candidateField); return candidateField; }
[ "static", "String", "discoverJsonFieldName", "(", "Settings", "settings", ",", "FieldAlias", "alias", ")", "{", "Set", "<", "String", ">", "virtualColumnsToBeRemoved", "=", "new", "HashSet", "<", "String", ">", "(", "HiveConstants", ".", "VIRTUAL_COLUMNS", ".", ...
Selects an appropriate field from the given Hive table schema to insert JSON data into if the feature is enabled @param settings Settings to read schema information from @return A FieldAlias object that projects the json source field into the select destination field
[ "Selects", "an", "appropriate", "field", "from", "the", "given", "Hive", "table", "schema", "to", "insert", "JSON", "data", "into", "if", "the", "feature", "is", "enabled" ]
train
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/hive/src/main/java/org/elasticsearch/hadoop/hive/HiveUtils.java#L138-L166
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/split/TransformSplit.java
TransformSplit.ofSearchReplace
public static TransformSplit ofSearchReplace(@NonNull BaseInputSplit sourceSplit, @NonNull final String search, @NonNull final String replace) throws URISyntaxException { """ Static factory method, replace the string version of the URI with a simple search-replace pair @param sourceSplit the split with URIs to transform @param search the string to search @param replace the string to replace with @throws URISyntaxException thrown if the transformed URI is malformed """ return new TransformSplit(sourceSplit, new URITransform() { @Override public URI apply(URI uri) throws URISyntaxException { return new URI(uri.toString().replace(search, replace)); } }); }
java
public static TransformSplit ofSearchReplace(@NonNull BaseInputSplit sourceSplit, @NonNull final String search, @NonNull final String replace) throws URISyntaxException { return new TransformSplit(sourceSplit, new URITransform() { @Override public URI apply(URI uri) throws URISyntaxException { return new URI(uri.toString().replace(search, replace)); } }); }
[ "public", "static", "TransformSplit", "ofSearchReplace", "(", "@", "NonNull", "BaseInputSplit", "sourceSplit", ",", "@", "NonNull", "final", "String", "search", ",", "@", "NonNull", "final", "String", "replace", ")", "throws", "URISyntaxException", "{", "return", ...
Static factory method, replace the string version of the URI with a simple search-replace pair @param sourceSplit the split with URIs to transform @param search the string to search @param replace the string to replace with @throws URISyntaxException thrown if the transformed URI is malformed
[ "Static", "factory", "method", "replace", "the", "string", "version", "of", "the", "URI", "with", "a", "simple", "search", "-", "replace", "pair" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/split/TransformSplit.java#L60-L68
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/webcontext/ControlBeanContextSupport.java
ControlBeanContextSupport.fireMembershipEvent
private void fireMembershipEvent(BeanContextMembershipEvent bcme, boolean childrenAdded) { """ Fire a BeanContextMembershipEvent. @param bcme Event to fire. @param childrenAdded True if add event, false if remove event. """ for (BeanContextMembershipListener bcml : _bcMembershipListeners) { if (childrenAdded) { bcml.childrenAdded(bcme); } else { bcml.childrenRemoved(bcme); } } }
java
private void fireMembershipEvent(BeanContextMembershipEvent bcme, boolean childrenAdded) { for (BeanContextMembershipListener bcml : _bcMembershipListeners) { if (childrenAdded) { bcml.childrenAdded(bcme); } else { bcml.childrenRemoved(bcme); } } }
[ "private", "void", "fireMembershipEvent", "(", "BeanContextMembershipEvent", "bcme", ",", "boolean", "childrenAdded", ")", "{", "for", "(", "BeanContextMembershipListener", "bcml", ":", "_bcMembershipListeners", ")", "{", "if", "(", "childrenAdded", ")", "{", "bcml", ...
Fire a BeanContextMembershipEvent. @param bcme Event to fire. @param childrenAdded True if add event, false if remove event.
[ "Fire", "a", "BeanContextMembershipEvent", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/webcontext/ControlBeanContextSupport.java#L529-L539
ModeShape/modeshape
web/modeshape-web-jcr-webdav/src/main/java/org/modeshape/web/jcr/webdav/ResolvedRequest.java
ResolvedRequest.withPath
public ResolvedRequest withPath( String path ) { """ Create a new request that is similar to this request except with the supplied path. This can only be done if the repository name and workspace name are non-null @param path the new path @return the new request; never null """ assert repositoryName != null; assert workspaceName != null; return new ResolvedRequest(request, repositoryName, workspaceName, path); }
java
public ResolvedRequest withPath( String path ) { assert repositoryName != null; assert workspaceName != null; return new ResolvedRequest(request, repositoryName, workspaceName, path); }
[ "public", "ResolvedRequest", "withPath", "(", "String", "path", ")", "{", "assert", "repositoryName", "!=", "null", ";", "assert", "workspaceName", "!=", "null", ";", "return", "new", "ResolvedRequest", "(", "request", ",", "repositoryName", ",", "workspaceName", ...
Create a new request that is similar to this request except with the supplied path. This can only be done if the repository name and workspace name are non-null @param path the new path @return the new request; never null
[ "Create", "a", "new", "request", "that", "is", "similar", "to", "this", "request", "except", "with", "the", "supplied", "path", ".", "This", "can", "only", "be", "done", "if", "the", "repository", "name", "and", "workspace", "name", "are", "non", "-", "n...
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-jcr-webdav/src/main/java/org/modeshape/web/jcr/webdav/ResolvedRequest.java#L84-L88
landawn/AbacusUtil
src/com/landawn/abacus/util/RegExUtil.java
RegExUtil.removeAll
public static String removeAll(final String text, final Pattern regex) { """ <p>Removes each substring of the text String that matches the given regular expression pattern.</p> This method is a {@code null} safe equivalent to: <ul> <li>{@code pattern.matcher(text).replaceAll(N.EMPTY_STRING)}</li> </ul> <p>A {@code null} reference passed to this method is a no-op.</p> <pre> StringUtils.removeAll(null, *) = null StringUtils.removeAll("any", (Pattern) null) = "any" StringUtils.removeAll("any", Pattern.compile("")) = "any" StringUtils.removeAll("any", Pattern.compile(".*")) = "" StringUtils.removeAll("any", Pattern.compile(".+")) = "" StringUtils.removeAll("abc", Pattern.compile(".?")) = "" StringUtils.removeAll("A&lt;__&gt;\n&lt;__&gt;B", Pattern.compile("&lt;.*&gt;")) = "A\nB" StringUtils.removeAll("A&lt;__&gt;\n&lt;__&gt;B", Pattern.compile("(?s)&lt;.*&gt;")) = "AB" StringUtils.removeAll("A&lt;__&gt;\n&lt;__&gt;B", Pattern.compile("&lt;.*&gt;", Pattern.DOTALL)) = "AB" StringUtils.removeAll("ABCabc123abc", Pattern.compile("[a-z]")) = "ABC123" </pre> @param text text to remove from, may be null @param regex the regular expression to which this string is to be matched @return the text with any removes processed, {@code null} if null String input @see #replaceAll(String, Pattern, String) @see java.util.regex.Matcher#replaceAll(String) @see java.util.regex.Pattern """ return replaceAll(text, regex, N.EMPTY_STRING); }
java
public static String removeAll(final String text, final Pattern regex) { return replaceAll(text, regex, N.EMPTY_STRING); }
[ "public", "static", "String", "removeAll", "(", "final", "String", "text", ",", "final", "Pattern", "regex", ")", "{", "return", "replaceAll", "(", "text", ",", "regex", ",", "N", ".", "EMPTY_STRING", ")", ";", "}" ]
<p>Removes each substring of the text String that matches the given regular expression pattern.</p> This method is a {@code null} safe equivalent to: <ul> <li>{@code pattern.matcher(text).replaceAll(N.EMPTY_STRING)}</li> </ul> <p>A {@code null} reference passed to this method is a no-op.</p> <pre> StringUtils.removeAll(null, *) = null StringUtils.removeAll("any", (Pattern) null) = "any" StringUtils.removeAll("any", Pattern.compile("")) = "any" StringUtils.removeAll("any", Pattern.compile(".*")) = "" StringUtils.removeAll("any", Pattern.compile(".+")) = "" StringUtils.removeAll("abc", Pattern.compile(".?")) = "" StringUtils.removeAll("A&lt;__&gt;\n&lt;__&gt;B", Pattern.compile("&lt;.*&gt;")) = "A\nB" StringUtils.removeAll("A&lt;__&gt;\n&lt;__&gt;B", Pattern.compile("(?s)&lt;.*&gt;")) = "AB" StringUtils.removeAll("A&lt;__&gt;\n&lt;__&gt;B", Pattern.compile("&lt;.*&gt;", Pattern.DOTALL)) = "AB" StringUtils.removeAll("ABCabc123abc", Pattern.compile("[a-z]")) = "ABC123" </pre> @param text text to remove from, may be null @param regex the regular expression to which this string is to be matched @return the text with any removes processed, {@code null} if null String input @see #replaceAll(String, Pattern, String) @see java.util.regex.Matcher#replaceAll(String) @see java.util.regex.Pattern
[ "<p", ">", "Removes", "each", "substring", "of", "the", "text", "String", "that", "matches", "the", "given", "regular", "expression", "pattern", ".", "<", "/", "p", ">" ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/RegExUtil.java#L68-L70
apache/groovy
src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java
EncodingGroovyMethods.encodeBase64
public static Writable encodeBase64(Byte[] data, final boolean chunked) { """ Produce a Writable object which writes the Base64 encoding of the byte array. Calling toString() on the result returns the encoding as a String. For more information on Base64 encoding and chunking see <code>RFC 4648</code>. @param data Byte array to be encoded @param chunked whether or not the Base64 encoded data should be MIME chunked @return object which will write the Base64 encoding of the byte array @since 1.5.1 """ return encodeBase64(DefaultTypeTransformation.convertToByteArray(data), chunked); }
java
public static Writable encodeBase64(Byte[] data, final boolean chunked) { return encodeBase64(DefaultTypeTransformation.convertToByteArray(data), chunked); }
[ "public", "static", "Writable", "encodeBase64", "(", "Byte", "[", "]", "data", ",", "final", "boolean", "chunked", ")", "{", "return", "encodeBase64", "(", "DefaultTypeTransformation", ".", "convertToByteArray", "(", "data", ")", ",", "chunked", ")", ";", "}" ...
Produce a Writable object which writes the Base64 encoding of the byte array. Calling toString() on the result returns the encoding as a String. For more information on Base64 encoding and chunking see <code>RFC 4648</code>. @param data Byte array to be encoded @param chunked whether or not the Base64 encoded data should be MIME chunked @return object which will write the Base64 encoding of the byte array @since 1.5.1
[ "Produce", "a", "Writable", "object", "which", "writes", "the", "Base64", "encoding", "of", "the", "byte", "array", ".", "Calling", "toString", "()", "on", "the", "result", "returns", "the", "encoding", "as", "a", "String", ".", "For", "more", "information",...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java#L60-L62
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/QueryBuilder.java
QueryBuilder.selectDistinct
@NonNull public static Select selectDistinct(@NonNull SelectResult... results) { """ Create a SELECT DISTINCT statement instance that you can use further (e.g. calling the from() function) to construct the complete query statement. @param results The array of the SelectResult object for specifying the returned values. @return A Select distinct object. """ if (results == null) { throw new IllegalArgumentException("results cannot be null."); } return new Select(true, results); }
java
@NonNull public static Select selectDistinct(@NonNull SelectResult... results) { if (results == null) { throw new IllegalArgumentException("results cannot be null."); } return new Select(true, results); }
[ "@", "NonNull", "public", "static", "Select", "selectDistinct", "(", "@", "NonNull", "SelectResult", "...", "results", ")", "{", "if", "(", "results", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"results cannot be null.\"", ")", ";...
Create a SELECT DISTINCT statement instance that you can use further (e.g. calling the from() function) to construct the complete query statement. @param results The array of the SelectResult object for specifying the returned values. @return A Select distinct object.
[ "Create", "a", "SELECT", "DISTINCT", "statement", "instance", "that", "you", "can", "use", "further", "(", "e", ".", "g", ".", "calling", "the", "from", "()", "function", ")", "to", "construct", "the", "complete", "query", "statement", "." ]
train
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/QueryBuilder.java#L48-L52
strator-dev/greenpepper
greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Specification.java
Specification.removeReference
public void removeReference(Reference reference) throws GreenPepperServerException { """ <p>removeReference.</p> @param reference a {@link com.greenpepper.server.domain.Reference} object. @throws com.greenpepper.server.GreenPepperServerException if any. """ if(!references.contains(reference)) { throw new GreenPepperServerException( GreenPepperServerErrorKey.REFERENCE_NOT_FOUND, "Reference not found"); } references.remove(reference); reference.setSpecification(null); }
java
public void removeReference(Reference reference) throws GreenPepperServerException { if(!references.contains(reference)) { throw new GreenPepperServerException( GreenPepperServerErrorKey.REFERENCE_NOT_FOUND, "Reference not found"); } references.remove(reference); reference.setSpecification(null); }
[ "public", "void", "removeReference", "(", "Reference", "reference", ")", "throws", "GreenPepperServerException", "{", "if", "(", "!", "references", ".", "contains", "(", "reference", ")", ")", "{", "throw", "new", "GreenPepperServerException", "(", "GreenPepperServe...
<p>removeReference.</p> @param reference a {@link com.greenpepper.server.domain.Reference} object. @throws com.greenpepper.server.GreenPepperServerException if any.
[ "<p", ">", "removeReference", ".", "<", "/", "p", ">" ]
train
https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Specification.java#L167-L176
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java
JobsImpl.getTaskCounts
public TaskCounts getTaskCounts(String jobId, JobGetTaskCountsOptions jobGetTaskCountsOptions) { """ Gets the task counts for the specified job. Task counts provide a count of the tasks by active, running or completed task state, and a count of tasks which succeeded or failed. Tasks in the preparing state are counted as running. @param jobId The ID of the job. @param jobGetTaskCountsOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @throws BatchErrorException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the TaskCounts object if successful. """ return getTaskCountsWithServiceResponseAsync(jobId, jobGetTaskCountsOptions).toBlocking().single().body(); }
java
public TaskCounts getTaskCounts(String jobId, JobGetTaskCountsOptions jobGetTaskCountsOptions) { return getTaskCountsWithServiceResponseAsync(jobId, jobGetTaskCountsOptions).toBlocking().single().body(); }
[ "public", "TaskCounts", "getTaskCounts", "(", "String", "jobId", ",", "JobGetTaskCountsOptions", "jobGetTaskCountsOptions", ")", "{", "return", "getTaskCountsWithServiceResponseAsync", "(", "jobId", ",", "jobGetTaskCountsOptions", ")", ".", "toBlocking", "(", ")", ".", ...
Gets the task counts for the specified job. Task counts provide a count of the tasks by active, running or completed task state, and a count of tasks which succeeded or failed. Tasks in the preparing state are counted as running. @param jobId The ID of the job. @param jobGetTaskCountsOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @throws BatchErrorException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the TaskCounts object if successful.
[ "Gets", "the", "task", "counts", "for", "the", "specified", "job", ".", "Task", "counts", "provide", "a", "count", "of", "the", "tasks", "by", "active", "running", "or", "completed", "task", "state", "and", "a", "count", "of", "tasks", "which", "succeeded"...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L3207-L3209
elki-project/elki
elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/VectorUtil.java
VectorUtil.minDot
public static double minDot(SpatialComparable v1, SpatialComparable v2) { """ Compute the minimum angle between two rectangles, assuming unit length vectors @param v1 first rectangle @param v2 second rectangle @return Angle """ if(v1 instanceof NumberVector && v2 instanceof NumberVector) { return dot((NumberVector) v1, (NumberVector) v2); } final int dim1 = v1.getDimensionality(), dim2 = v2.getDimensionality(); final int mindim = (dim1 <= dim2) ? dim1 : dim2; // Essentially, we want to compute this: // absmax(v1.transposeTimes(v2)); double s1 = 0, s2 = 0; for(int k = 0; k < mindim; k++) { final double min1 = v1.getMin(k), max1 = v1.getMax(k); final double min2 = v2.getMin(k), max2 = v2.getMax(k); final double p1 = min1 * min2, p2 = min1 * max2; final double p3 = max1 * min2, p4 = max1 * max2; s1 += Math.max(Math.max(p1, p2), Math.max(p3, p4)); s2 += Math.min(Math.min(p1, p2), Math.min(p3, p4)); } return Math.max(Math.abs(s1), Math.abs(s2)); }
java
public static double minDot(SpatialComparable v1, SpatialComparable v2) { if(v1 instanceof NumberVector && v2 instanceof NumberVector) { return dot((NumberVector) v1, (NumberVector) v2); } final int dim1 = v1.getDimensionality(), dim2 = v2.getDimensionality(); final int mindim = (dim1 <= dim2) ? dim1 : dim2; // Essentially, we want to compute this: // absmax(v1.transposeTimes(v2)); double s1 = 0, s2 = 0; for(int k = 0; k < mindim; k++) { final double min1 = v1.getMin(k), max1 = v1.getMax(k); final double min2 = v2.getMin(k), max2 = v2.getMax(k); final double p1 = min1 * min2, p2 = min1 * max2; final double p3 = max1 * min2, p4 = max1 * max2; s1 += Math.max(Math.max(p1, p2), Math.max(p3, p4)); s2 += Math.min(Math.min(p1, p2), Math.min(p3, p4)); } return Math.max(Math.abs(s1), Math.abs(s2)); }
[ "public", "static", "double", "minDot", "(", "SpatialComparable", "v1", ",", "SpatialComparable", "v2", ")", "{", "if", "(", "v1", "instanceof", "NumberVector", "&&", "v2", "instanceof", "NumberVector", ")", "{", "return", "dot", "(", "(", "NumberVector", ")",...
Compute the minimum angle between two rectangles, assuming unit length vectors @param v1 first rectangle @param v2 second rectangle @return Angle
[ "Compute", "the", "minimum", "angle", "between", "two", "rectangles", "assuming", "unit", "length", "vectors" ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/VectorUtil.java#L432-L450
lessthanoptimal/ejml
main/ejml-simple/src/org/ejml/equation/Equation.java
Equation.parseBracketCreateMatrix
protected void parseBracketCreateMatrix(TokenList tokens, Sequence sequence) { """ Searches for brackets which are only used to construct new matrices by concatenating 1 or more matrices together """ List<TokenList.Token> left = new ArrayList<TokenList.Token>(); TokenList.Token t = tokens.getFirst(); while( t != null ) { TokenList.Token next = t.next; if( t.getSymbol() == Symbol.BRACKET_LEFT ) { left.add(t); } else if( t.getSymbol() == Symbol.BRACKET_RIGHT ) { if( left.isEmpty() ) throw new RuntimeException("No matching left bracket for right"); TokenList.Token start = left.remove(left.size() - 1); // Compute everything inside the [ ], this will leave a // series of variables and semi-colons hopefully TokenList bracketLet = tokens.extractSubList(start.next,t.previous); parseBlockNoParentheses(bracketLet, sequence, true); MatrixConstructor constructor = constructMatrix(bracketLet); // define the matrix op and inject into token list Operation.Info info = Operation.matrixConstructor(constructor); sequence.addOperation(info.op); tokens.insert(start.previous, new TokenList.Token(info.output)); // remove the brackets tokens.remove(start); tokens.remove(t); } t = next; } if( !left.isEmpty() ) throw new RuntimeException("Dangling ["); }
java
protected void parseBracketCreateMatrix(TokenList tokens, Sequence sequence) { List<TokenList.Token> left = new ArrayList<TokenList.Token>(); TokenList.Token t = tokens.getFirst(); while( t != null ) { TokenList.Token next = t.next; if( t.getSymbol() == Symbol.BRACKET_LEFT ) { left.add(t); } else if( t.getSymbol() == Symbol.BRACKET_RIGHT ) { if( left.isEmpty() ) throw new RuntimeException("No matching left bracket for right"); TokenList.Token start = left.remove(left.size() - 1); // Compute everything inside the [ ], this will leave a // series of variables and semi-colons hopefully TokenList bracketLet = tokens.extractSubList(start.next,t.previous); parseBlockNoParentheses(bracketLet, sequence, true); MatrixConstructor constructor = constructMatrix(bracketLet); // define the matrix op and inject into token list Operation.Info info = Operation.matrixConstructor(constructor); sequence.addOperation(info.op); tokens.insert(start.previous, new TokenList.Token(info.output)); // remove the brackets tokens.remove(start); tokens.remove(t); } t = next; } if( !left.isEmpty() ) throw new RuntimeException("Dangling ["); }
[ "protected", "void", "parseBracketCreateMatrix", "(", "TokenList", "tokens", ",", "Sequence", "sequence", ")", "{", "List", "<", "TokenList", ".", "Token", ">", "left", "=", "new", "ArrayList", "<", "TokenList", ".", "Token", ">", "(", ")", ";", "TokenList",...
Searches for brackets which are only used to construct new matrices by concatenating 1 or more matrices together
[ "Searches", "for", "brackets", "which", "are", "only", "used", "to", "construct", "new", "matrices", "by", "concatenating", "1", "or", "more", "matrices", "together" ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/Equation.java#L1115-L1152
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java
PoolOperations.evaluateAutoScale
public AutoScaleRun evaluateAutoScale(String poolId, String autoScaleFormula) throws BatchErrorException, IOException { """ Gets the result of evaluating an automatic scaling formula on the specified pool. This is primarily for validating an autoscale formula, as it simply returns the result without applying the formula to the pool. @param poolId The ID of the pool. @param autoScaleFormula The formula to be evaluated on the pool. @return The result of evaluating the formula on the specified pool. @throws BatchErrorException Exception thrown when an error response is received from the Batch service. @throws IOException Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service. """ return evaluateAutoScale(poolId, autoScaleFormula, null); }
java
public AutoScaleRun evaluateAutoScale(String poolId, String autoScaleFormula) throws BatchErrorException, IOException { return evaluateAutoScale(poolId, autoScaleFormula, null); }
[ "public", "AutoScaleRun", "evaluateAutoScale", "(", "String", "poolId", ",", "String", "autoScaleFormula", ")", "throws", "BatchErrorException", ",", "IOException", "{", "return", "evaluateAutoScale", "(", "poolId", ",", "autoScaleFormula", ",", "null", ")", ";", "}...
Gets the result of evaluating an automatic scaling formula on the specified pool. This is primarily for validating an autoscale formula, as it simply returns the result without applying the formula to the pool. @param poolId The ID of the pool. @param autoScaleFormula The formula to be evaluated on the pool. @return The result of evaluating the formula on the specified pool. @throws BatchErrorException Exception thrown when an error response is received from the Batch service. @throws IOException Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
[ "Gets", "the", "result", "of", "evaluating", "an", "automatic", "scaling", "formula", "on", "the", "specified", "pool", ".", "This", "is", "primarily", "for", "validating", "an", "autoscale", "formula", "as", "it", "simply", "returns", "the", "result", "withou...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java#L808-L811
haraldk/TwelveMonkeys
servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java
ServletUtil.getDoubleParameter
public static double getDoubleParameter(final ServletRequest pReq, final String pName, final double pDefault) { """ Gets the value of the given parameter from the request converted to a {@code double}.&nbsp;If the parameter is not set or not parseable, the default value is returned. @param pReq the servlet request @param pName the parameter name @param pDefault the default value @return the value of the parameter converted to n {@code double}, or the default value, if the parameter is not set. """ String str = pReq.getParameter(pName); try { return str != null ? Double.parseDouble(str) : pDefault; } catch (NumberFormatException nfe) { return pDefault; } }
java
public static double getDoubleParameter(final ServletRequest pReq, final String pName, final double pDefault) { String str = pReq.getParameter(pName); try { return str != null ? Double.parseDouble(str) : pDefault; } catch (NumberFormatException nfe) { return pDefault; } }
[ "public", "static", "double", "getDoubleParameter", "(", "final", "ServletRequest", "pReq", ",", "final", "String", "pName", ",", "final", "double", "pDefault", ")", "{", "String", "str", "=", "pReq", ".", "getParameter", "(", "pName", ")", ";", "try", "{", ...
Gets the value of the given parameter from the request converted to a {@code double}.&nbsp;If the parameter is not set or not parseable, the default value is returned. @param pReq the servlet request @param pName the parameter name @param pDefault the default value @return the value of the parameter converted to n {@code double}, or the default value, if the parameter is not set.
[ "Gets", "the", "value", "of", "the", "given", "parameter", "from", "the", "request", "converted", "to", "a", "{", "@code", "double", "}", ".", "&nbsp", ";", "If", "the", "parameter", "is", "not", "set", "or", "not", "parseable", "the", "default", "value"...
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java#L272-L281
otto-de/edison-hal
src/main/java/de/otto/edison/hal/traverson/Traverson.java
Traverson.getResourceAs
public <T extends HalRepresentation> Optional<T> getResourceAs(final Class<T> type) throws IOException { """ Return the selected resource and return it in the specified type. <p> If there are multiple matching representations, the first node is returned. </p> @param type the subtype of the HalRepresentation used to parse the resource. @param <T> the subtype of HalRepresentation of the returned resource. @return HalRepresentation @throws IOException if a low-level I/O problem (unexpected end-of-input, network error) occurs. @throws JsonParseException if the json document can not be parsed by Jackson's ObjectMapper @throws JsonMappingException if the input JSON structure can not be mapped to the specified HalRepresentation type @since 1.0.0 """ return getResourceAs(type, null); }
java
public <T extends HalRepresentation> Optional<T> getResourceAs(final Class<T> type) throws IOException { return getResourceAs(type, null); }
[ "public", "<", "T", "extends", "HalRepresentation", ">", "Optional", "<", "T", ">", "getResourceAs", "(", "final", "Class", "<", "T", ">", "type", ")", "throws", "IOException", "{", "return", "getResourceAs", "(", "type", ",", "null", ")", ";", "}" ]
Return the selected resource and return it in the specified type. <p> If there are multiple matching representations, the first node is returned. </p> @param type the subtype of the HalRepresentation used to parse the resource. @param <T> the subtype of HalRepresentation of the returned resource. @return HalRepresentation @throws IOException if a low-level I/O problem (unexpected end-of-input, network error) occurs. @throws JsonParseException if the json document can not be parsed by Jackson's ObjectMapper @throws JsonMappingException if the input JSON structure can not be mapped to the specified HalRepresentation type @since 1.0.0
[ "Return", "the", "selected", "resource", "and", "return", "it", "in", "the", "specified", "type", ".", "<p", ">", "If", "there", "are", "multiple", "matching", "representations", "the", "first", "node", "is", "returned", ".", "<", "/", "p", ">" ]
train
https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/traverson/Traverson.java#L1118-L1120
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.setSecretAsync
public Observable<SecretBundle> setSecretAsync(String vaultBaseUrl, String secretName, String value, Map<String, String> tags, String contentType, SecretAttributes secretAttributes) { """ Sets a secret in a specified key vault. The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param secretName The name of the secret. @param value The value of the secret. @param tags Application specific metadata in the form of key-value pairs. @param contentType Type of the secret value such as a password. @param secretAttributes The secret management attributes. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the SecretBundle object """ return setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value, tags, contentType, secretAttributes).map(new Func1<ServiceResponse<SecretBundle>, SecretBundle>() { @Override public SecretBundle call(ServiceResponse<SecretBundle> response) { return response.body(); } }); }
java
public Observable<SecretBundle> setSecretAsync(String vaultBaseUrl, String secretName, String value, Map<String, String> tags, String contentType, SecretAttributes secretAttributes) { return setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value, tags, contentType, secretAttributes).map(new Func1<ServiceResponse<SecretBundle>, SecretBundle>() { @Override public SecretBundle call(ServiceResponse<SecretBundle> response) { return response.body(); } }); }
[ "public", "Observable", "<", "SecretBundle", ">", "setSecretAsync", "(", "String", "vaultBaseUrl", ",", "String", "secretName", ",", "String", "value", ",", "Map", "<", "String", ",", "String", ">", "tags", ",", "String", "contentType", ",", "SecretAttributes", ...
Sets a secret in a specified key vault. The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param secretName The name of the secret. @param value The value of the secret. @param tags Application specific metadata in the form of key-value pairs. @param contentType Type of the secret value such as a password. @param secretAttributes The secret management attributes. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the SecretBundle object
[ "Sets", "a", "secret", "in", "a", "specified", "key", "vault", ".", "The", "SET", "operation", "adds", "a", "secret", "to", "the", "Azure", "Key", "Vault", ".", "If", "the", "named", "secret", "already", "exists", "Azure", "Key", "Vault", "creates", "a",...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L3456-L3463
MenoData/Time4J
base/src/main/java/net/time4j/range/DateInterval.java
DateInterval.until
public static DateInterval until(PlainDate end) { """ /*[deutsch] <p>Erzeugt ein unbegrenztes Intervall bis zum angegebenen Endedatum. </p> @param end date of upper boundary (inclusive) @return new date interval @since 2.0 """ Boundary<PlainDate> past = Boundary.infinitePast(); return new DateInterval(past, Boundary.of(CLOSED, end)); }
java
public static DateInterval until(PlainDate end) { Boundary<PlainDate> past = Boundary.infinitePast(); return new DateInterval(past, Boundary.of(CLOSED, end)); }
[ "public", "static", "DateInterval", "until", "(", "PlainDate", "end", ")", "{", "Boundary", "<", "PlainDate", ">", "past", "=", "Boundary", ".", "infinitePast", "(", ")", ";", "return", "new", "DateInterval", "(", "past", ",", "Boundary", ".", "of", "(", ...
/*[deutsch] <p>Erzeugt ein unbegrenztes Intervall bis zum angegebenen Endedatum. </p> @param end date of upper boundary (inclusive) @return new date interval @since 2.0
[ "/", "*", "[", "deutsch", "]", "<p", ">", "Erzeugt", "ein", "unbegrenztes", "Intervall", "bis", "zum", "angegebenen", "Endedatum", ".", "<", "/", "p", ">" ]
train
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/DateInterval.java#L284-L289
protostuff/protostuff
protostuff-msgpack/src/main/java/io/protostuff/MsgpackXIOUtil.java
MsgpackXIOUtil.writeListTo
public static <T> void writeListTo(LinkedBuffer buffer, List<T> messages, Schema<T> schema, boolean numeric) { """ Serializes the {@code messages} into the {@link LinkedBuffer} using the given schema. """ if (buffer.start != buffer.offset) { throw new IllegalArgumentException("Buffer previously used and had not been reset."); } if (messages.isEmpty()) { return; } MsgpackXOutput output = new MsgpackXOutput(buffer, numeric, schema); try { for (T m : messages) { LinkedBuffer objectStarter = output.writeStartObject(); schema.writeTo(output, m); if (output.isLastRepeated()) { output.writeEndArray(); } output.writeEndObject(objectStarter); } } catch (IOException e) { throw new RuntimeException("Serializing to a byte array threw an IOException " + "(should never happen).", e); } }
java
public static <T> void writeListTo(LinkedBuffer buffer, List<T> messages, Schema<T> schema, boolean numeric) { if (buffer.start != buffer.offset) { throw new IllegalArgumentException("Buffer previously used and had not been reset."); } if (messages.isEmpty()) { return; } MsgpackXOutput output = new MsgpackXOutput(buffer, numeric, schema); try { for (T m : messages) { LinkedBuffer objectStarter = output.writeStartObject(); schema.writeTo(output, m); if (output.isLastRepeated()) { output.writeEndArray(); } output.writeEndObject(objectStarter); } } catch (IOException e) { throw new RuntimeException("Serializing to a byte array threw an IOException " + "(should never happen).", e); } }
[ "public", "static", "<", "T", ">", "void", "writeListTo", "(", "LinkedBuffer", "buffer", ",", "List", "<", "T", ">", "messages", ",", "Schema", "<", "T", ">", "schema", ",", "boolean", "numeric", ")", "{", "if", "(", "buffer", ".", "start", "!=", "bu...
Serializes the {@code messages} into the {@link LinkedBuffer} using the given schema.
[ "Serializes", "the", "{" ]
train
https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-msgpack/src/main/java/io/protostuff/MsgpackXIOUtil.java#L137-L176
banq/jdonframework
JdonAccessory/jdon-remote/src/main/java/com/jdon/bussinessproxy/remote/HessianToJdonServlet.java
HessianToJdonServlet.service
@Override public void service(final ServletRequest req, final ServletResponse resp) throws ServletException, IOException { """ Servlet to handle incoming Hessian requests and invoke HessianToJdonRequestProcessor. @param req ServletRequest @param resp ServletResponse @throws javax.servlet.ServletException If errors occur @throws java.io.IOException If IO errors occur """ HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) resp; final String beanName = request.getPathInfo().substring(1); // remove "/" htorp.process(beanName, request, response); }
java
@Override public void service(final ServletRequest req, final ServletResponse resp) throws ServletException, IOException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) resp; final String beanName = request.getPathInfo().substring(1); // remove "/" htorp.process(beanName, request, response); }
[ "@", "Override", "public", "void", "service", "(", "final", "ServletRequest", "req", ",", "final", "ServletResponse", "resp", ")", "throws", "ServletException", ",", "IOException", "{", "HttpServletRequest", "request", "=", "(", "HttpServletRequest", ")", "req", "...
Servlet to handle incoming Hessian requests and invoke HessianToJdonRequestProcessor. @param req ServletRequest @param resp ServletResponse @throws javax.servlet.ServletException If errors occur @throws java.io.IOException If IO errors occur
[ "Servlet", "to", "handle", "incoming", "Hessian", "requests", "and", "invoke", "HessianToJdonRequestProcessor", "." ]
train
https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-remote/src/main/java/com/jdon/bussinessproxy/remote/HessianToJdonServlet.java#L56-L63
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorageDirectoryRetentionManager.java
NNStorageDirectoryRetentionManager.deleteOldBackups
static void deleteOldBackups(File root, String[] backups, int daysToKeep, int copiesToKeep) { """ Delete backups according to the retention policy. @param root root directory @param backups backups SORTED on the timestamp from oldest to newest @param daysToKeep @param copiesToKeep """ Date now = new Date(System.currentTimeMillis()); // leave the copiesToKeep-1 at least (+1 will be the current backup) int maxIndex = Math.max(0, backups.length - copiesToKeep + 1); for (int i = 0; i < maxIndex; i++) { String backup = backups[i]; Date backupDate = null; try { backupDate = dateForm.get().parse(backup.substring(backup .indexOf(File.pathSeparator) + 1)); } catch (ParseException pex) { // This should not happen because of the // way we construct the list } long backupAge = now.getTime() - backupDate.getTime(); // if daysToKeep is set delete everything older providing that // we retain at least copiesToKeep copies boolean deleteOldBackup = (daysToKeep > 0 && backupAge > daysToKeep * 24 * 60 * 60 * 1000); // if daysToKeep is set to zero retain most recent copies boolean deleteExtraBackup = (daysToKeep == 0); if (deleteOldBackup || deleteExtraBackup) { // This backup is older than daysToKeep, delete it try { FLOG.info("Deleting backup " + new File(root, backup)); FileUtil.fullyDelete(new File(root, backup)); FLOG.info("Deleted backup " + new File(root, backup)); } catch (IOException iex) { FLOG.error("Error deleting backup " + new File(root, backup), iex); } } else { // done with deleting old backups break; } } }
java
static void deleteOldBackups(File root, String[] backups, int daysToKeep, int copiesToKeep) { Date now = new Date(System.currentTimeMillis()); // leave the copiesToKeep-1 at least (+1 will be the current backup) int maxIndex = Math.max(0, backups.length - copiesToKeep + 1); for (int i = 0; i < maxIndex; i++) { String backup = backups[i]; Date backupDate = null; try { backupDate = dateForm.get().parse(backup.substring(backup .indexOf(File.pathSeparator) + 1)); } catch (ParseException pex) { // This should not happen because of the // way we construct the list } long backupAge = now.getTime() - backupDate.getTime(); // if daysToKeep is set delete everything older providing that // we retain at least copiesToKeep copies boolean deleteOldBackup = (daysToKeep > 0 && backupAge > daysToKeep * 24 * 60 * 60 * 1000); // if daysToKeep is set to zero retain most recent copies boolean deleteExtraBackup = (daysToKeep == 0); if (deleteOldBackup || deleteExtraBackup) { // This backup is older than daysToKeep, delete it try { FLOG.info("Deleting backup " + new File(root, backup)); FileUtil.fullyDelete(new File(root, backup)); FLOG.info("Deleted backup " + new File(root, backup)); } catch (IOException iex) { FLOG.error("Error deleting backup " + new File(root, backup), iex); } } else { // done with deleting old backups break; } } }
[ "static", "void", "deleteOldBackups", "(", "File", "root", ",", "String", "[", "]", "backups", ",", "int", "daysToKeep", ",", "int", "copiesToKeep", ")", "{", "Date", "now", "=", "new", "Date", "(", "System", ".", "currentTimeMillis", "(", ")", ")", ";",...
Delete backups according to the retention policy. @param root root directory @param backups backups SORTED on the timestamp from oldest to newest @param daysToKeep @param copiesToKeep
[ "Delete", "backups", "according", "to", "the", "retention", "policy", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorageDirectoryRetentionManager.java#L156-L197
xcesco/kripton
kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java
StringUtils.formatParam
public static String formatParam(Object value, String delimiter) { """ format as sql parameter. If value is not null, method will return 'value'. If value is not null, delimiter will be used to delimit return value. Otherwise, defaultValue will be returned, without delimiter. @param value the value @param delimiter the delimiter @return the string """ if (value != null) { if (byte[].class.getSimpleName().equals(value.getClass().getSimpleName())) { return checkSize((byte[]) value, VIEW_SIZE); } String str = value.toString(); if (str.length() > VIEW_SIZE) { return delimiter + str.substring(0, VIEW_SIZE - 3) + "..." + delimiter; } else return delimiter + str + delimiter; } else return "<undefined>"; }
java
public static String formatParam(Object value, String delimiter) { if (value != null) { if (byte[].class.getSimpleName().equals(value.getClass().getSimpleName())) { return checkSize((byte[]) value, VIEW_SIZE); } String str = value.toString(); if (str.length() > VIEW_SIZE) { return delimiter + str.substring(0, VIEW_SIZE - 3) + "..." + delimiter; } else return delimiter + str + delimiter; } else return "<undefined>"; }
[ "public", "static", "String", "formatParam", "(", "Object", "value", ",", "String", "delimiter", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "if", "(", "byte", "[", "]", ".", "class", ".", "getSimpleName", "(", ")", ".", "equals", "(", "val...
format as sql parameter. If value is not null, method will return 'value'. If value is not null, delimiter will be used to delimit return value. Otherwise, defaultValue will be returned, without delimiter. @param value the value @param delimiter the delimiter @return the string
[ "format", "as", "sql", "parameter", ".", "If", "value", "is", "not", "null", "method", "will", "return", "value", ".", "If", "value", "is", "not", "null", "delimiter", "will", "be", "used", "to", "delimit", "return", "value", ".", "Otherwise", "defaultValu...
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/StringUtils.java#L140-L154
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.updatePrebuiltEntityRoleWithServiceResponseAsync
public Observable<ServiceResponse<OperationStatus>> updatePrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdatePrebuiltEntityRoleOptionalParameter updatePrebuiltEntityRoleOptionalParameter) { """ Update an entity role for a given entity. @param appId The application ID. @param versionId The version ID. @param entityId The entity ID. @param roleId The entity role ID. @param updatePrebuiltEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the OperationStatus object """ if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } final String name = updatePrebuiltEntityRoleOptionalParameter != null ? updatePrebuiltEntityRoleOptionalParameter.name() : null; return updatePrebuiltEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId, name); }
java
public Observable<ServiceResponse<OperationStatus>> updatePrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdatePrebuiltEntityRoleOptionalParameter updatePrebuiltEntityRoleOptionalParameter) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } if (roleId == null) { throw new IllegalArgumentException("Parameter roleId is required and cannot be null."); } final String name = updatePrebuiltEntityRoleOptionalParameter != null ? updatePrebuiltEntityRoleOptionalParameter.name() : null; return updatePrebuiltEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId, name); }
[ "public", "Observable", "<", "ServiceResponse", "<", "OperationStatus", ">", ">", "updatePrebuiltEntityRoleWithServiceResponseAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "entityId", ",", "UUID", "roleId", ",", "UpdatePrebuiltEntityRoleOptionalPa...
Update an entity role for a given entity. @param appId The application ID. @param versionId The version ID. @param entityId The entity ID. @param roleId The entity role ID. @param updatePrebuiltEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the OperationStatus object
[ "Update", "an", "entity", "role", "for", "a", "given", "entity", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L11296-L11315
motown-io/motown
operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/persistence/repositories/ReservationRepository.java
ReservationRepository.findByChargingStationIdEvseIdUserId
public Reservation findByChargingStationIdEvseIdUserId(ChargingStationId chargingStationId, EvseId evseid, UserIdentity UserId) throws NoResultException { """ find reservations by chargingstationid, evseid and userId @param chargingStationId @param evseid @param UserId @return @throws NoResultException """ EntityManager entityManager = getEntityManager(); try { return entityManager.createQuery("SELECT t FROM io.motown.operatorapi.viewmodel.persistence.entities.Reservation AS t WHERE t.chargingStationId = :chargingStationId AND evseId = :evseId AND userId = :userId", Reservation.class) .setParameter("chargingStationId", chargingStationId.getId()) .setParameter("evseId", evseid) .setParameter("userId", UserId.getId()) .getSingleResult(); } finally { entityManager.close(); } }
java
public Reservation findByChargingStationIdEvseIdUserId(ChargingStationId chargingStationId, EvseId evseid, UserIdentity UserId) throws NoResultException { EntityManager entityManager = getEntityManager(); try { return entityManager.createQuery("SELECT t FROM io.motown.operatorapi.viewmodel.persistence.entities.Reservation AS t WHERE t.chargingStationId = :chargingStationId AND evseId = :evseId AND userId = :userId", Reservation.class) .setParameter("chargingStationId", chargingStationId.getId()) .setParameter("evseId", evseid) .setParameter("userId", UserId.getId()) .getSingleResult(); } finally { entityManager.close(); } }
[ "public", "Reservation", "findByChargingStationIdEvseIdUserId", "(", "ChargingStationId", "chargingStationId", ",", "EvseId", "evseid", ",", "UserIdentity", "UserId", ")", "throws", "NoResultException", "{", "EntityManager", "entityManager", "=", "getEntityManager", "(", ")...
find reservations by chargingstationid, evseid and userId @param chargingStationId @param evseid @param UserId @return @throws NoResultException
[ "find", "reservations", "by", "chargingstationid", "evseid", "and", "userId" ]
train
https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/persistence/repositories/ReservationRepository.java#L86-L97
apache/groovy
src/main/java/org/codehaus/groovy/runtime/metaclass/ReflectorLoader.java
ReflectorLoader.defineClass
public synchronized Class defineClass(String name, byte[] bytecode, ProtectionDomain domain) { """ helper method to define Reflector classes. @param name of the Reflector @param bytecode the bytecode @param domain the protection domain @return the generated class """ inDefine = true; Class c = defineClass(name, bytecode, 0, bytecode.length, domain); loadedClasses.put(name,c); resolveClass(c); inDefine = false; return c; }
java
public synchronized Class defineClass(String name, byte[] bytecode, ProtectionDomain domain) { inDefine = true; Class c = defineClass(name, bytecode, 0, bytecode.length, domain); loadedClasses.put(name,c); resolveClass(c); inDefine = false; return c; }
[ "public", "synchronized", "Class", "defineClass", "(", "String", "name", ",", "byte", "[", "]", "bytecode", ",", "ProtectionDomain", "domain", ")", "{", "inDefine", "=", "true", ";", "Class", "c", "=", "defineClass", "(", "name", ",", "bytecode", ",", "0",...
helper method to define Reflector classes. @param name of the Reflector @param bytecode the bytecode @param domain the protection domain @return the generated class
[ "helper", "method", "to", "define", "Reflector", "classes", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/metaclass/ReflectorLoader.java#L83-L90
sagiegurari/fax4j
src/main/java/org/fax4j/util/DefaultProcessExecutor.java
DefaultProcessExecutor.addAllBuffer
protected StringBuilder addAllBuffer(List<String> commandList,StringBuilder buffer) { """ Updates the command list and the buffer. @param commandList The command list to update @param buffer The input buffer @return The updated buffer """ commandList.add(buffer.toString()); buffer.delete(0,buffer.length()); return buffer; }
java
protected StringBuilder addAllBuffer(List<String> commandList,StringBuilder buffer) { commandList.add(buffer.toString()); buffer.delete(0,buffer.length()); return buffer; }
[ "protected", "StringBuilder", "addAllBuffer", "(", "List", "<", "String", ">", "commandList", ",", "StringBuilder", "buffer", ")", "{", "commandList", ".", "add", "(", "buffer", ".", "toString", "(", ")", ")", ";", "buffer", ".", "delete", "(", "0", ",", ...
Updates the command list and the buffer. @param commandList The command list to update @param buffer The input buffer @return The updated buffer
[ "Updates", "the", "command", "list", "and", "the", "buffer", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/DefaultProcessExecutor.java#L174-L180
VoltDB/voltdb
src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java
JDBC4DatabaseMetaData.getFunctions
@Override public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException { """ Retrieves a description of the system and user functions available in the given catalog. """ checkClosed(); throw SQLError.noSupport(); }
java
@Override public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException { checkClosed(); throw SQLError.noSupport(); }
[ "@", "Override", "public", "ResultSet", "getFunctions", "(", "String", "catalog", ",", "String", "schemaPattern", ",", "String", "functionNamePattern", ")", "throws", "SQLException", "{", "checkClosed", "(", ")", ";", "throw", "SQLError", ".", "noSupport", "(", ...
Retrieves a description of the system and user functions available in the given catalog.
[ "Retrieves", "a", "description", "of", "the", "system", "and", "user", "functions", "available", "in", "the", "given", "catalog", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4DatabaseMetaData.java#L370-L375
samskivert/samskivert
src/main/java/com/samskivert/servlet/util/ParameterUtil.java
ParameterUtil.requireFloatParameter
public static float requireFloatParameter ( HttpServletRequest req, String name, String invalidDataMessage) throws DataValidationException { """ Fetches the supplied parameter from the request and converts it to a float. If the parameter does not exist or is not a well-formed float, a data validation exception is thrown with the supplied message. """ return parseFloatParameter(getParameter(req, name, false), invalidDataMessage); }
java
public static float requireFloatParameter ( HttpServletRequest req, String name, String invalidDataMessage) throws DataValidationException { return parseFloatParameter(getParameter(req, name, false), invalidDataMessage); }
[ "public", "static", "float", "requireFloatParameter", "(", "HttpServletRequest", "req", ",", "String", "name", ",", "String", "invalidDataMessage", ")", "throws", "DataValidationException", "{", "return", "parseFloatParameter", "(", "getParameter", "(", "req", ",", "n...
Fetches the supplied parameter from the request and converts it to a float. If the parameter does not exist or is not a well-formed float, a data validation exception is thrown with the supplied message.
[ "Fetches", "the", "supplied", "parameter", "from", "the", "request", "and", "converts", "it", "to", "a", "float", ".", "If", "the", "parameter", "does", "not", "exist", "or", "is", "not", "a", "well", "-", "formed", "float", "a", "data", "validation", "e...
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/util/ParameterUtil.java#L74-L79
lessthanoptimal/BoofCV
integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java
ConvertBitmap.bitmapToGray
public static <T extends ImageGray<T>> T bitmapToGray( Bitmap input , T output , Class<T> imageType , byte[] storage) { """ Converts Bitmap image into a single band image of arbitrary type. @see #declareStorage(android.graphics.Bitmap, byte[]) @param input Input Bitmap image. @param output Output single band image. If null a new one will be declared. @param imageType Type of single band image. @param storage Byte array used for internal storage. If null it will be declared internally. @return The converted gray scale image. """ if( imageType == GrayF32.class ) return (T)bitmapToGray(input,(GrayF32)output,storage); else if( imageType == GrayU8.class ) return (T)bitmapToGray(input,(GrayU8)output,storage); else throw new IllegalArgumentException("Unsupported BoofCV Image Type"); }
java
public static <T extends ImageGray<T>> T bitmapToGray( Bitmap input , T output , Class<T> imageType , byte[] storage) { if( imageType == GrayF32.class ) return (T)bitmapToGray(input,(GrayF32)output,storage); else if( imageType == GrayU8.class ) return (T)bitmapToGray(input,(GrayU8)output,storage); else throw new IllegalArgumentException("Unsupported BoofCV Image Type"); }
[ "public", "static", "<", "T", "extends", "ImageGray", "<", "T", ">", ">", "T", "bitmapToGray", "(", "Bitmap", "input", ",", "T", "output", ",", "Class", "<", "T", ">", "imageType", ",", "byte", "[", "]", "storage", ")", "{", "if", "(", "imageType", ...
Converts Bitmap image into a single band image of arbitrary type. @see #declareStorage(android.graphics.Bitmap, byte[]) @param input Input Bitmap image. @param output Output single band image. If null a new one will be declared. @param imageType Type of single band image. @param storage Byte array used for internal storage. If null it will be declared internally. @return The converted gray scale image.
[ "Converts", "Bitmap", "image", "into", "a", "single", "band", "image", "of", "arbitrary", "type", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L98-L107
aspectran/aspectran
core/src/main/java/com/aspectran/core/util/MethodUtils.java
MethodUtils.invokeStaticMethod
public static Object invokeStaticMethod(Class<?> objectClass, String methodName, Object[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { """ <p>Invoke a named static method whose parameter type matches the object type.</p> <p>The behaviour of this method is less deterministic than {@link #invokeExactMethod(Object object,String methodName,Object[] args)}. It loops through all methods with names that match and then executes the first it finds with compatible parameters.</p> <p>This method supports calls to methods taking primitive parameters via passing in wrapping classes. So, for example, a {@code Boolean} class would match a {@code boolean} primitive.</p> <p> This is a convenient wrapper for {@link #invokeStaticMethod(Class objectClass,String methodName,Object[] args,Class[] paramTypes)}. </p> @param objectClass invoke static method on this class @param methodName get method with this name @param args use these arguments - treat null as empty array @return the value returned by the invoked method @throws NoSuchMethodException if there is no such accessible method @throws InvocationTargetException wraps an exception thrown by the method invoked @throws IllegalAccessException if the requested method is not accessible via reflection """ if (args == null) { args = EMPTY_OBJECT_ARRAY; } int arguments = args.length; Class<?>[] paramTypes = new Class<?>[arguments]; for (int i = 0; i < arguments; i++) { paramTypes[i] = args[i].getClass(); } return invokeStaticMethod(objectClass, methodName, args, paramTypes); }
java
public static Object invokeStaticMethod(Class<?> objectClass, String methodName, Object[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { if (args == null) { args = EMPTY_OBJECT_ARRAY; } int arguments = args.length; Class<?>[] paramTypes = new Class<?>[arguments]; for (int i = 0; i < arguments; i++) { paramTypes[i] = args[i].getClass(); } return invokeStaticMethod(objectClass, methodName, args, paramTypes); }
[ "public", "static", "Object", "invokeStaticMethod", "(", "Class", "<", "?", ">", "objectClass", ",", "String", "methodName", ",", "Object", "[", "]", "args", ")", "throws", "NoSuchMethodException", ",", "IllegalAccessException", ",", "InvocationTargetException", "{"...
<p>Invoke a named static method whose parameter type matches the object type.</p> <p>The behaviour of this method is less deterministic than {@link #invokeExactMethod(Object object,String methodName,Object[] args)}. It loops through all methods with names that match and then executes the first it finds with compatible parameters.</p> <p>This method supports calls to methods taking primitive parameters via passing in wrapping classes. So, for example, a {@code Boolean} class would match a {@code boolean} primitive.</p> <p> This is a convenient wrapper for {@link #invokeStaticMethod(Class objectClass,String methodName,Object[] args,Class[] paramTypes)}. </p> @param objectClass invoke static method on this class @param methodName get method with this name @param args use these arguments - treat null as empty array @return the value returned by the invoked method @throws NoSuchMethodException if there is no such accessible method @throws InvocationTargetException wraps an exception thrown by the method invoked @throws IllegalAccessException if the requested method is not accessible via reflection
[ "<p", ">", "Invoke", "a", "named", "static", "method", "whose", "parameter", "type", "matches", "the", "object", "type", ".", "<", "/", "p", ">" ]
train
https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/MethodUtils.java#L459-L470
Jasig/uPortal
uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DistributedLayoutManager.java
DistributedLayoutManager.getPublishedChannelParametersMap
private Map getPublishedChannelParametersMap(String channelPublishId) throws PortalException { """ Return a map parameter names to channel parameter objects representing the parameters specified at publish time for the channel with the passed-in publish id. @param channelPublishId @return @throws PortalException """ try { IPortletDefinitionRegistry registry = PortletDefinitionRegistryLocator.getPortletDefinitionRegistry(); IPortletDefinition def = registry.getPortletDefinition(channelPublishId); return def.getParametersAsUnmodifiableMap(); } catch (Exception e) { throw new PortalException("Unable to acquire channel definition.", e); } }
java
private Map getPublishedChannelParametersMap(String channelPublishId) throws PortalException { try { IPortletDefinitionRegistry registry = PortletDefinitionRegistryLocator.getPortletDefinitionRegistry(); IPortletDefinition def = registry.getPortletDefinition(channelPublishId); return def.getParametersAsUnmodifiableMap(); } catch (Exception e) { throw new PortalException("Unable to acquire channel definition.", e); } }
[ "private", "Map", "getPublishedChannelParametersMap", "(", "String", "channelPublishId", ")", "throws", "PortalException", "{", "try", "{", "IPortletDefinitionRegistry", "registry", "=", "PortletDefinitionRegistryLocator", ".", "getPortletDefinitionRegistry", "(", ")", ";", ...
Return a map parameter names to channel parameter objects representing the parameters specified at publish time for the channel with the passed-in publish id. @param channelPublishId @return @throws PortalException
[ "Return", "a", "map", "parameter", "names", "to", "channel", "parameter", "objects", "representing", "the", "parameters", "specified", "at", "publish", "time", "for", "the", "channel", "with", "the", "passed", "-", "in", "publish", "id", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DistributedLayoutManager.java#L894-L903
apache/reef
lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/cli/LogFileEntry.java
LogFileEntry.writeFiles
private void writeFiles(final DataInputStream valueStream, final Writer outputWriter) throws IOException { """ Writes the logs of the next container to the given writer. Assumes that the valueStream is suitably positioned. @param valueStream @param outputWriter @throws IOException """ while (valueStream.available() > 0) { final String strFileName = valueStream.readUTF(); final int entryLength = Integer.parseInt(valueStream.readUTF()); outputWriter.write("=====================================================\n"); outputWriter.write("File Name: " + strFileName + "\n"); outputWriter.write("File Length: " + entryLength + "\n"); outputWriter.write("-----------------------------------------------------\n"); this.write(valueStream, outputWriter, entryLength); outputWriter.write("\n"); } }
java
private void writeFiles(final DataInputStream valueStream, final Writer outputWriter) throws IOException { while (valueStream.available() > 0) { final String strFileName = valueStream.readUTF(); final int entryLength = Integer.parseInt(valueStream.readUTF()); outputWriter.write("=====================================================\n"); outputWriter.write("File Name: " + strFileName + "\n"); outputWriter.write("File Length: " + entryLength + "\n"); outputWriter.write("-----------------------------------------------------\n"); this.write(valueStream, outputWriter, entryLength); outputWriter.write("\n"); } }
[ "private", "void", "writeFiles", "(", "final", "DataInputStream", "valueStream", ",", "final", "Writer", "outputWriter", ")", "throws", "IOException", "{", "while", "(", "valueStream", ".", "available", "(", ")", ">", "0", ")", "{", "final", "String", "strFile...
Writes the logs of the next container to the given writer. Assumes that the valueStream is suitably positioned. @param valueStream @param outputWriter @throws IOException
[ "Writes", "the", "logs", "of", "the", "next", "container", "to", "the", "given", "writer", ".", "Assumes", "that", "the", "valueStream", "is", "suitably", "positioned", "." ]
train
https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/cli/LogFileEntry.java#L80-L91
soi-toolkit/soi-toolkit-mule
commons/components/module-logger/src/main/java/org/soitoolkit/commons/module/logger/SoitoolkitLoggerModule.java
SoitoolkitLoggerModule.logDebug
@Processor public Object logDebug( String message, @Optional String integrationScenario, @Optional String contractId, @Optional String correlationId, @Optional Map<String, String> extra) { """ Log processor for level DEBUG {@sample.xml ../../../doc/SoitoolkitLogger-connector.xml.sample soitoolkitlogger:log} @param message Log-message to be processed @param integrationScenario Optional name of the integration scenario or business process @param contractId Optional name of the contract in use @param correlationId Optional correlation identity of the message @param extra Optional extra info @return The incoming payload """ return doLog(LogLevelType.DEBUG, message, integrationScenario, contractId, correlationId, extra); }
java
@Processor public Object logDebug( String message, @Optional String integrationScenario, @Optional String contractId, @Optional String correlationId, @Optional Map<String, String> extra) { return doLog(LogLevelType.DEBUG, message, integrationScenario, contractId, correlationId, extra); }
[ "@", "Processor", "public", "Object", "logDebug", "(", "String", "message", ",", "@", "Optional", "String", "integrationScenario", ",", "@", "Optional", "String", "contractId", ",", "@", "Optional", "String", "correlationId", ",", "@", "Optional", "Map", "<", ...
Log processor for level DEBUG {@sample.xml ../../../doc/SoitoolkitLogger-connector.xml.sample soitoolkitlogger:log} @param message Log-message to be processed @param integrationScenario Optional name of the integration scenario or business process @param contractId Optional name of the contract in use @param correlationId Optional correlation identity of the message @param extra Optional extra info @return The incoming payload
[ "Log", "processor", "for", "level", "DEBUG" ]
train
https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/module-logger/src/main/java/org/soitoolkit/commons/module/logger/SoitoolkitLoggerModule.java#L121-L130
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.project_serviceName_ipLoadbalancing_POST
public OvhIPLoadbalancing project_serviceName_ipLoadbalancing_POST(String serviceName, String ipLoadbalancingServiceName, String redirection) throws IOException { """ Import an existing IP LB into OpenStack REST: POST /cloud/project/{serviceName}/ipLoadbalancing @param ipLoadbalancingServiceName [required] Service name of the IP LB to import @param redirection [required] Where you want to redirect the user after sucessfull authentication. Useful variables admitted: %project <=> project ID, %id <=> ID of load balancing ip, %iplb <=> IPLB service name @param serviceName [required] The project id API beta """ String qPath = "/cloud/project/{serviceName}/ipLoadbalancing"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "ipLoadbalancingServiceName", ipLoadbalancingServiceName); addBody(o, "redirection", redirection); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhIPLoadbalancing.class); }
java
public OvhIPLoadbalancing project_serviceName_ipLoadbalancing_POST(String serviceName, String ipLoadbalancingServiceName, String redirection) throws IOException { String qPath = "/cloud/project/{serviceName}/ipLoadbalancing"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "ipLoadbalancingServiceName", ipLoadbalancingServiceName); addBody(o, "redirection", redirection); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhIPLoadbalancing.class); }
[ "public", "OvhIPLoadbalancing", "project_serviceName_ipLoadbalancing_POST", "(", "String", "serviceName", ",", "String", "ipLoadbalancingServiceName", ",", "String", "redirection", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cloud/project/{serviceName}/ipLoad...
Import an existing IP LB into OpenStack REST: POST /cloud/project/{serviceName}/ipLoadbalancing @param ipLoadbalancingServiceName [required] Service name of the IP LB to import @param redirection [required] Where you want to redirect the user after sucessfull authentication. Useful variables admitted: %project <=> project ID, %id <=> ID of load balancing ip, %iplb <=> IPLB service name @param serviceName [required] The project id API beta
[ "Import", "an", "existing", "IP", "LB", "into", "OpenStack" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1673-L1681
igniterealtime/Smack
smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java
OmemoMessageBuilder.finish
public OmemoElement finish() { """ Assemble an OmemoMessageElement from the current state of the builder. @return OmemoMessageElement """ OmemoHeaderElement_VAxolotl header = new OmemoHeaderElement_VAxolotl( userDevice.getDeviceId(), keys, initializationVector ); return new OmemoElement_VAxolotl(header, ciphertextMessage); }
java
public OmemoElement finish() { OmemoHeaderElement_VAxolotl header = new OmemoHeaderElement_VAxolotl( userDevice.getDeviceId(), keys, initializationVector ); return new OmemoElement_VAxolotl(header, ciphertextMessage); }
[ "public", "OmemoElement", "finish", "(", ")", "{", "OmemoHeaderElement_VAxolotl", "header", "=", "new", "OmemoHeaderElement_VAxolotl", "(", "userDevice", ".", "getDeviceId", "(", ")", ",", "keys", ",", "initializationVector", ")", ";", "return", "new", "OmemoElement...
Assemble an OmemoMessageElement from the current state of the builder. @return OmemoMessageElement
[ "Assemble", "an", "OmemoMessageElement", "from", "the", "current", "state", "of", "the", "builder", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java#L250-L257
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java
BitcoinSerializer.deserializePayload
@Override public Message deserializePayload(BitcoinPacketHeader header, ByteBuffer in) throws ProtocolException, BufferUnderflowException { """ Deserialize payload only. You must provide a header, typically obtained by calling {@link BitcoinSerializer#deserializeHeader}. """ byte[] payloadBytes = new byte[header.size]; in.get(payloadBytes, 0, header.size); // Verify the checksum. byte[] hash; hash = Sha256Hash.hashTwice(payloadBytes); if (header.checksum[0] != hash[0] || header.checksum[1] != hash[1] || header.checksum[2] != hash[2] || header.checksum[3] != hash[3]) { throw new ProtocolException("Checksum failed to verify, actual " + HEX.encode(hash) + " vs " + HEX.encode(header.checksum)); } if (log.isDebugEnabled()) { log.debug("Received {} byte '{}' message: {}", header.size, header.command, HEX.encode(payloadBytes)); } try { return makeMessage(header.command, header.size, payloadBytes, hash, header.checksum); } catch (Exception e) { throw new ProtocolException("Error deserializing message " + HEX.encode(payloadBytes) + "\n", e); } }
java
@Override public Message deserializePayload(BitcoinPacketHeader header, ByteBuffer in) throws ProtocolException, BufferUnderflowException { byte[] payloadBytes = new byte[header.size]; in.get(payloadBytes, 0, header.size); // Verify the checksum. byte[] hash; hash = Sha256Hash.hashTwice(payloadBytes); if (header.checksum[0] != hash[0] || header.checksum[1] != hash[1] || header.checksum[2] != hash[2] || header.checksum[3] != hash[3]) { throw new ProtocolException("Checksum failed to verify, actual " + HEX.encode(hash) + " vs " + HEX.encode(header.checksum)); } if (log.isDebugEnabled()) { log.debug("Received {} byte '{}' message: {}", header.size, header.command, HEX.encode(payloadBytes)); } try { return makeMessage(header.command, header.size, payloadBytes, hash, header.checksum); } catch (Exception e) { throw new ProtocolException("Error deserializing message " + HEX.encode(payloadBytes) + "\n", e); } }
[ "@", "Override", "public", "Message", "deserializePayload", "(", "BitcoinPacketHeader", "header", ",", "ByteBuffer", "in", ")", "throws", "ProtocolException", ",", "BufferUnderflowException", "{", "byte", "[", "]", "payloadBytes", "=", "new", "byte", "[", "header", ...
Deserialize payload only. You must provide a header, typically obtained by calling {@link BitcoinSerializer#deserializeHeader}.
[ "Deserialize", "payload", "only", ".", "You", "must", "provide", "a", "header", "typically", "obtained", "by", "calling", "{" ]
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/BitcoinSerializer.java#L164-L189
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/AcroFields.java
AcroFields.setField
public boolean setField(String name, String value) throws IOException, DocumentException { """ Sets the field value. @param name the fully qualified field name or the partial name in the case of XFA forms @param value the field value @throws IOException on error @throws DocumentException on error @return <CODE>true</CODE> if the field was found and changed, <CODE>false</CODE> otherwise """ return setField(name, value, null); }
java
public boolean setField(String name, String value) throws IOException, DocumentException { return setField(name, value, null); }
[ "public", "boolean", "setField", "(", "String", "name", ",", "String", "value", ")", "throws", "IOException", ",", "DocumentException", "{", "return", "setField", "(", "name", ",", "value", ",", "null", ")", ";", "}" ]
Sets the field value. @param name the fully qualified field name or the partial name in the case of XFA forms @param value the field value @throws IOException on error @throws DocumentException on error @return <CODE>true</CODE> if the field was found and changed, <CODE>false</CODE> otherwise
[ "Sets", "the", "field", "value", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/AcroFields.java#L1278-L1280
scaleset/scaleset-geo
src/main/java/com/scaleset/geo/math/GoogleMapsTileMath.java
GoogleMapsTileMath.metersToTilePixelsTransform
public AffineTransform metersToTilePixelsTransform(int tx, int ty, int zoomLevel) { """ Create a transform that converts meters to tile-relative pixels @param tx The x coordinate of the tile @param ty The y coordinate of the tile @param zoomLevel the zoom level @return AffineTransform with meters to pixels transformation """ AffineTransform result = new AffineTransform(); double scale = 1.0 / resolution(zoomLevel); int nTiles = 2 << (zoomLevel - 1); int px = tx * -256; int py = (nTiles - ty) * -256; // flip y for upper-left origin result.scale(1, -1); result.translate(px, py); result.scale(scale, scale); result.translate(originShift, originShift); return result; }
java
public AffineTransform metersToTilePixelsTransform(int tx, int ty, int zoomLevel) { AffineTransform result = new AffineTransform(); double scale = 1.0 / resolution(zoomLevel); int nTiles = 2 << (zoomLevel - 1); int px = tx * -256; int py = (nTiles - ty) * -256; // flip y for upper-left origin result.scale(1, -1); result.translate(px, py); result.scale(scale, scale); result.translate(originShift, originShift); return result; }
[ "public", "AffineTransform", "metersToTilePixelsTransform", "(", "int", "tx", ",", "int", "ty", ",", "int", "zoomLevel", ")", "{", "AffineTransform", "result", "=", "new", "AffineTransform", "(", ")", ";", "double", "scale", "=", "1.0", "/", "resolution", "(",...
Create a transform that converts meters to tile-relative pixels @param tx The x coordinate of the tile @param ty The y coordinate of the tile @param zoomLevel the zoom level @return AffineTransform with meters to pixels transformation
[ "Create", "a", "transform", "that", "converts", "meters", "to", "tile", "-", "relative", "pixels" ]
train
https://github.com/scaleset/scaleset-geo/blob/5cff2349668037dc287928a6c1a1f67c76d96b02/src/main/java/com/scaleset/geo/math/GoogleMapsTileMath.java#L216-L228
vlingo/vlingo-actors
src/main/java/io/vlingo/actors/Stage.java
Stage.actorFor
public Protocols actorFor(final Class<?>[] protocols, final Definition definition) { """ Answers a {@code Protocols} that provides one or more supported {@code protocols} for the newly created {@code Actor} according to {@code definition}. @param protocols the {@code Class<?>}[] array of protocols that the {@code Actor} supports @param definition the {@code Definition} providing parameters to the {@code Actor} @return Protocols """ final ActorProtocolActor<Object>[] all = actorProtocolFor( protocols, definition, definition.parentOr(world.defaultParent()), definition.supervisor(), definition.loggerOr(world.defaultLogger())); return new Protocols(ActorProtocolActor.toActors(all)); }
java
public Protocols actorFor(final Class<?>[] protocols, final Definition definition) { final ActorProtocolActor<Object>[] all = actorProtocolFor( protocols, definition, definition.parentOr(world.defaultParent()), definition.supervisor(), definition.loggerOr(world.defaultLogger())); return new Protocols(ActorProtocolActor.toActors(all)); }
[ "public", "Protocols", "actorFor", "(", "final", "Class", "<", "?", ">", "[", "]", "protocols", ",", "final", "Definition", "definition", ")", "{", "final", "ActorProtocolActor", "<", "Object", ">", "[", "]", "all", "=", "actorProtocolFor", "(", "protocols",...
Answers a {@code Protocols} that provides one or more supported {@code protocols} for the newly created {@code Actor} according to {@code definition}. @param protocols the {@code Class<?>}[] array of protocols that the {@code Actor} supports @param definition the {@code Definition} providing parameters to the {@code Actor} @return Protocols
[ "Answers", "a", "{" ]
train
https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/Stage.java#L145-L155
matthewhorridge/owlapi-gwt
owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLIrreflexiveObjectPropertyAxiomImpl_CustomFieldSerializer.java
OWLIrreflexiveObjectPropertyAxiomImpl_CustomFieldSerializer.serializeInstance
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLIrreflexiveObjectPropertyAxiomImpl instance) throws SerializationException { """ Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the object's content to @param instance the object instance to serialize @throws com.google.gwt.user.client.rpc.SerializationException if the serialization operation is not successful """ serialize(streamWriter, instance); }
java
@Override public void serializeInstance(SerializationStreamWriter streamWriter, OWLIrreflexiveObjectPropertyAxiomImpl instance) throws SerializationException { serialize(streamWriter, instance); }
[ "@", "Override", "public", "void", "serializeInstance", "(", "SerializationStreamWriter", "streamWriter", ",", "OWLIrreflexiveObjectPropertyAxiomImpl", "instance", ")", "throws", "SerializationException", "{", "serialize", "(", "streamWriter", ",", "instance", ")", ";", "...
Serializes the content of the object into the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter}. @param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the object's content to @param instance the object instance to serialize @throws com.google.gwt.user.client.rpc.SerializationException if the serialization operation is not successful
[ "Serializes", "the", "content", "of", "the", "object", "into", "the", "{", "@link", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "rpc", ".", "SerializationStreamWriter", "}", "." ]
train
https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLIrreflexiveObjectPropertyAxiomImpl_CustomFieldSerializer.java#L74-L77
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfUtils.java
MmtfUtils.setSecStructType
public static void setSecStructType(Group group, int dsspIndex) { """ Get the secondary structure as defined by DSSP. @param group the input group to be calculated @param the integer index of the group type. """ SecStrucType secStrucType = getSecStructTypeFromDsspIndex(dsspIndex); SecStrucState secStrucState = new SecStrucState(group, "MMTF_ASSIGNED", secStrucType); if(secStrucType!=null){ group.setProperty("secstruc", secStrucState); } else{ } }
java
public static void setSecStructType(Group group, int dsspIndex) { SecStrucType secStrucType = getSecStructTypeFromDsspIndex(dsspIndex); SecStrucState secStrucState = new SecStrucState(group, "MMTF_ASSIGNED", secStrucType); if(secStrucType!=null){ group.setProperty("secstruc", secStrucState); } else{ } }
[ "public", "static", "void", "setSecStructType", "(", "Group", "group", ",", "int", "dsspIndex", ")", "{", "SecStrucType", "secStrucType", "=", "getSecStructTypeFromDsspIndex", "(", "dsspIndex", ")", ";", "SecStrucState", "secStrucState", "=", "new", "SecStrucState", ...
Get the secondary structure as defined by DSSP. @param group the input group to be calculated @param the integer index of the group type.
[ "Get", "the", "secondary", "structure", "as", "defined", "by", "DSSP", "." ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfUtils.java#L376-L384
Ordinastie/MalisisCore
src/main/java/net/malisis/core/client/gui/component/interaction/UITextField.java
UITextField.setFilter
public void setFilter(Function<String, String> filterFunction) { """ Sets the function that applies to all incoming text. Immediately applies filter to current text. @param filterFunction the function """ this.filterFunction = filterFunction; this.text = new StringBuilder(this.filterFunction.apply(this.text.toString())); }
java
public void setFilter(Function<String, String> filterFunction) { this.filterFunction = filterFunction; this.text = new StringBuilder(this.filterFunction.apply(this.text.toString())); }
[ "public", "void", "setFilter", "(", "Function", "<", "String", ",", "String", ">", "filterFunction", ")", "{", "this", ".", "filterFunction", "=", "filterFunction", ";", "this", ".", "text", "=", "new", "StringBuilder", "(", "this", ".", "filterFunction", "....
Sets the function that applies to all incoming text. Immediately applies filter to current text. @param filterFunction the function
[ "Sets", "the", "function", "that", "applies", "to", "all", "incoming", "text", ".", "Immediately", "applies", "filter", "to", "current", "text", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/component/interaction/UITextField.java#L379-L383
sarl/sarl
sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java
JanusConfig.getSystemPropertyAsEnum
public static <S extends Enum<S>> S getSystemPropertyAsEnum(Class<S> type, String name) { """ Replies the value of the enumeration system property. @param <S> - type of the enumeration to read. @param type - type of the enumeration. @param name - name of the property. @return the value, or <code>null</code> if no property found. """ return getSystemPropertyAsEnum(type, name, null); }
java
public static <S extends Enum<S>> S getSystemPropertyAsEnum(Class<S> type, String name) { return getSystemPropertyAsEnum(type, name, null); }
[ "public", "static", "<", "S", "extends", "Enum", "<", "S", ">", ">", "S", "getSystemPropertyAsEnum", "(", "Class", "<", "S", ">", "type", ",", "String", "name", ")", "{", "return", "getSystemPropertyAsEnum", "(", "type", ",", "name", ",", "null", ")", ...
Replies the value of the enumeration system property. @param <S> - type of the enumeration to read. @param type - type of the enumeration. @param name - name of the property. @return the value, or <code>null</code> if no property found.
[ "Replies", "the", "value", "of", "the", "enumeration", "system", "property", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java#L440-L442
jbundle/jbundle
base/screen/model/src/main/java/org/jbundle/base/screen/model/TopScreen.java
TopScreen.getDefaultJava
public char getDefaultJava(String strBrowser, String strOS) { """ Get best way to launch java @param strBrowser @param strOS @return """ char chJavaLaunch = 'A'; // Applet = default if ("safari".equalsIgnoreCase(strBrowser)) chJavaLaunch = 'W'; // Web start // if ("linux".equalsIgnoreCase(strOS)) // chJavaLaunch = 'W'; // Web start return chJavaLaunch; }
java
public char getDefaultJava(String strBrowser, String strOS) { char chJavaLaunch = 'A'; // Applet = default if ("safari".equalsIgnoreCase(strBrowser)) chJavaLaunch = 'W'; // Web start // if ("linux".equalsIgnoreCase(strOS)) // chJavaLaunch = 'W'; // Web start return chJavaLaunch; }
[ "public", "char", "getDefaultJava", "(", "String", "strBrowser", ",", "String", "strOS", ")", "{", "char", "chJavaLaunch", "=", "'", "'", ";", "// Applet = default", "if", "(", "\"safari\"", ".", "equalsIgnoreCase", "(", "strBrowser", ")", ")", "chJavaLaunch", ...
Get best way to launch java @param strBrowser @param strOS @return
[ "Get", "best", "way", "to", "launch", "java" ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/TopScreen.java#L356-L364
apereo/cas
support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java
LdapUtils.getBoolean
public static Boolean getBoolean(final LdapEntry ctx, final String attribute) { """ Reads a Boolean value from the LdapEntry. @param ctx the ldap entry @param attribute the attribute name @return {@code true} if the attribute's value matches (case-insensitive) {@code "true"}, otherwise false """ return getBoolean(ctx, attribute, Boolean.FALSE); }
java
public static Boolean getBoolean(final LdapEntry ctx, final String attribute) { return getBoolean(ctx, attribute, Boolean.FALSE); }
[ "public", "static", "Boolean", "getBoolean", "(", "final", "LdapEntry", "ctx", ",", "final", "String", "attribute", ")", "{", "return", "getBoolean", "(", "ctx", ",", "attribute", ",", "Boolean", ".", "FALSE", ")", ";", "}" ]
Reads a Boolean value from the LdapEntry. @param ctx the ldap entry @param attribute the attribute name @return {@code true} if the attribute's value matches (case-insensitive) {@code "true"}, otherwise false
[ "Reads", "a", "Boolean", "value", "from", "the", "LdapEntry", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java#L136-L138
JodaOrg/joda-beans
src/main/java/org/joda/beans/ser/GuavaSerIteratorFactory.java
GuavaSerIteratorFactory.sortedMultiset
@SuppressWarnings( { """ Gets an iterable wrapper for {@code SortedMultiset}. @param valueType the value type, not null @param valueTypeTypes the generic parameters of the value type @return the iterable, not null """ "rawtypes", "unchecked" }) public static final SerIterable sortedMultiset(final Class<?> valueType, final List<Class<?>> valueTypeTypes) { Ordering natural = Ordering.natural(); final SortedMultiset<Object> coll = TreeMultiset.create(natural); return multiset(valueType, valueTypeTypes, coll); }
java
@SuppressWarnings({ "rawtypes", "unchecked" }) public static final SerIterable sortedMultiset(final Class<?> valueType, final List<Class<?>> valueTypeTypes) { Ordering natural = Ordering.natural(); final SortedMultiset<Object> coll = TreeMultiset.create(natural); return multiset(valueType, valueTypeTypes, coll); }
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "public", "static", "final", "SerIterable", "sortedMultiset", "(", "final", "Class", "<", "?", ">", "valueType", ",", "final", "List", "<", "Class", "<", "?", ">", ">", "val...
Gets an iterable wrapper for {@code SortedMultiset}. @param valueType the value type, not null @param valueTypeTypes the generic parameters of the value type @return the iterable, not null
[ "Gets", "an", "iterable", "wrapper", "for", "{", "@code", "SortedMultiset", "}", "." ]
train
https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/GuavaSerIteratorFactory.java#L280-L285
Azure/azure-sdk-for-java
kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java
EventHubConnectionsInner.createOrUpdate
public EventHubConnectionInner createOrUpdate(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionInner parameters) { """ Creates or updates a Event Hub connection. @param resourceGroupName The name of the resource group containing the Kusto cluster. @param clusterName The name of the Kusto cluster. @param databaseName The name of the database in the Kusto cluster. @param eventHubConnectionName The name of the event hub connection. @param parameters The Event Hub connection parameters supplied to the CreateOrUpdate operation. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the EventHubConnectionInner object if successful. """ return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters).toBlocking().last().body(); }
java
public EventHubConnectionInner createOrUpdate(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubConnectionName, parameters).toBlocking().last().body(); }
[ "public", "EventHubConnectionInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "clusterName", ",", "String", "databaseName", ",", "String", "eventHubConnectionName", ",", "EventHubConnectionInner", "parameters", ")", "{", "return", "createOrUpdate...
Creates or updates a Event Hub connection. @param resourceGroupName The name of the resource group containing the Kusto cluster. @param clusterName The name of the Kusto cluster. @param databaseName The name of the database in the Kusto cluster. @param eventHubConnectionName The name of the event hub connection. @param parameters The Event Hub connection parameters supplied to the CreateOrUpdate operation. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the EventHubConnectionInner object if successful.
[ "Creates", "or", "updates", "a", "Event", "Hub", "connection", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java#L413-L415
lviggiano/owner
owner-java8-extras/src/main/java/org/aeonbits/owner/converters/DurationConverter.java
DurationConverter.parseDuration
private static Duration parseDuration(String input) { """ Parses a duration string. If no units are specified in the string, it is assumed to be in milliseconds. This implementation was blatantly stolen/adapted from the typesafe-config project: https://github.com/typesafehub/config/blob/v1.3.0/config/src/main/java/com/typesafe/config/impl/SimpleConfig.java#L551-L624 @param input the string to parse @return duration @throws IllegalArgumentException if input is invalid """ String[] parts = ConverterUtil.splitNumericAndChar(input); String numberString = parts[0]; String originalUnitString = parts[1]; String unitString = originalUnitString; if (numberString.length() == 0) { throw new IllegalArgumentException(String.format("No number in duration value '%s'", input)); } if (unitString.length() > 2 && !unitString.endsWith("s")) { unitString = unitString + "s"; } ChronoUnit units; // note that this is deliberately case-sensitive switch (unitString) { case "ns": case "nanos": case "nanoseconds": units = ChronoUnit.NANOS; break; case "us": case "µs": case "micros": case "microseconds": units = ChronoUnit.MICROS; break; case "": case "ms": case "millis": case "milliseconds": units = ChronoUnit.MILLIS; break; case "s": case "seconds": units = ChronoUnit.SECONDS; break; case "m": case "minutes": units = ChronoUnit.MINUTES; break; case "h": case "hours": units = ChronoUnit.HOURS; break; case "d": case "days": units = ChronoUnit.DAYS; break; default: throw new IllegalArgumentException( String.format("Could not parse time unit '%s' (try ns, us, ms, s, m, h, d)", originalUnitString)); } return Duration.of(Long.parseLong(numberString), units); }
java
private static Duration parseDuration(String input) { String[] parts = ConverterUtil.splitNumericAndChar(input); String numberString = parts[0]; String originalUnitString = parts[1]; String unitString = originalUnitString; if (numberString.length() == 0) { throw new IllegalArgumentException(String.format("No number in duration value '%s'", input)); } if (unitString.length() > 2 && !unitString.endsWith("s")) { unitString = unitString + "s"; } ChronoUnit units; // note that this is deliberately case-sensitive switch (unitString) { case "ns": case "nanos": case "nanoseconds": units = ChronoUnit.NANOS; break; case "us": case "µs": case "micros": case "microseconds": units = ChronoUnit.MICROS; break; case "": case "ms": case "millis": case "milliseconds": units = ChronoUnit.MILLIS; break; case "s": case "seconds": units = ChronoUnit.SECONDS; break; case "m": case "minutes": units = ChronoUnit.MINUTES; break; case "h": case "hours": units = ChronoUnit.HOURS; break; case "d": case "days": units = ChronoUnit.DAYS; break; default: throw new IllegalArgumentException( String.format("Could not parse time unit '%s' (try ns, us, ms, s, m, h, d)", originalUnitString)); } return Duration.of(Long.parseLong(numberString), units); }
[ "private", "static", "Duration", "parseDuration", "(", "String", "input", ")", "{", "String", "[", "]", "parts", "=", "ConverterUtil", ".", "splitNumericAndChar", "(", "input", ")", ";", "String", "numberString", "=", "parts", "[", "0", "]", ";", "String", ...
Parses a duration string. If no units are specified in the string, it is assumed to be in milliseconds. This implementation was blatantly stolen/adapted from the typesafe-config project: https://github.com/typesafehub/config/blob/v1.3.0/config/src/main/java/com/typesafe/config/impl/SimpleConfig.java#L551-L624 @param input the string to parse @return duration @throws IllegalArgumentException if input is invalid
[ "Parses", "a", "duration", "string", ".", "If", "no", "units", "are", "specified", "in", "the", "string", "it", "is", "assumed", "to", "be", "in", "milliseconds", "." ]
train
https://github.com/lviggiano/owner/blob/1223ecfbe3c275b3b7c5ec13e9238c9bb888754f/owner-java8-extras/src/main/java/org/aeonbits/owner/converters/DurationConverter.java#L74-L130
Jasig/uPortal
uPortal-portlets/src/main/java/org/apereo/portal/portlets/account/PreferenceInputFactory.java
PreferenceInputFactory.createSingleTextPreference
public static Preference createSingleTextPreference(String name, String label) { """ Define a single-valued text input preferences. This method is a convenient wrapper for the most common expected use case and assumes null values for the default value and a predictable label. @param name @param label @return """ return createSingleTextPreference( name, "attribute.displayName." + name, TextDisplay.TEXT, null); }
java
public static Preference createSingleTextPreference(String name, String label) { return createSingleTextPreference( name, "attribute.displayName." + name, TextDisplay.TEXT, null); }
[ "public", "static", "Preference", "createSingleTextPreference", "(", "String", "name", ",", "String", "label", ")", "{", "return", "createSingleTextPreference", "(", "name", ",", "\"attribute.displayName.\"", "+", "name", ",", "TextDisplay", ".", "TEXT", ",", "null"...
Define a single-valued text input preferences. This method is a convenient wrapper for the most common expected use case and assumes null values for the default value and a predictable label. @param name @param label @return
[ "Define", "a", "single", "-", "valued", "text", "input", "preferences", ".", "This", "method", "is", "a", "convenient", "wrapper", "for", "the", "most", "common", "expected", "use", "case", "and", "assumes", "null", "values", "for", "the", "default", "value"...
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/account/PreferenceInputFactory.java#L45-L48
ngageoint/geopackage-core-java
src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java
CoverageDataCore.getSourceMinAndMax
private CoverageDataSourcePixel getSourceMinAndMax(float source, int sourceFloor, float valueLocation) { """ Get the min, max, and offset of the source pixel @param source source pixel @param sourceFloor source floor value @param valueLocation value location @return source pixel information """ int min = sourceFloor; int max = sourceFloor; float offset; if (source < valueLocation) { min--; offset = 1.0f - (valueLocation - source); } else { max++; offset = source - valueLocation; } return new CoverageDataSourcePixel(source, min, max, offset); }
java
private CoverageDataSourcePixel getSourceMinAndMax(float source, int sourceFloor, float valueLocation) { int min = sourceFloor; int max = sourceFloor; float offset; if (source < valueLocation) { min--; offset = 1.0f - (valueLocation - source); } else { max++; offset = source - valueLocation; } return new CoverageDataSourcePixel(source, min, max, offset); }
[ "private", "CoverageDataSourcePixel", "getSourceMinAndMax", "(", "float", "source", ",", "int", "sourceFloor", ",", "float", "valueLocation", ")", "{", "int", "min", "=", "sourceFloor", ";", "int", "max", "=", "sourceFloor", ";", "float", "offset", ";", "if", ...
Get the min, max, and offset of the source pixel @param source source pixel @param sourceFloor source floor value @param valueLocation value location @return source pixel information
[ "Get", "the", "min", "max", "and", "offset", "of", "the", "source", "pixel" ]
train
https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java#L1038-L1053
greenmail-mail-test/greenmail
greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java
ImapRequestLineReader.commandContinuationRequest
public void commandContinuationRequest() throws ProtocolException { """ Sends a server command continuation request '+' back to the client, requesting more data to be sent. """ try { output.write('+'); output.write(' '); output.write('O'); output.write('K'); output.write('\r'); output.write('\n'); output.flush(); } catch (IOException e) { throw new ProtocolException("Unexpected exception in sending command continuation request.", e); } }
java
public void commandContinuationRequest() throws ProtocolException { try { output.write('+'); output.write(' '); output.write('O'); output.write('K'); output.write('\r'); output.write('\n'); output.flush(); } catch (IOException e) { throw new ProtocolException("Unexpected exception in sending command continuation request.", e); } }
[ "public", "void", "commandContinuationRequest", "(", ")", "throws", "ProtocolException", "{", "try", "{", "output", ".", "write", "(", "'", "'", ")", ";", "output", ".", "write", "(", "'", "'", ")", ";", "output", ".", "write", "(", "'", "'", ")", ";...
Sends a server command continuation request '+' back to the client, requesting more data to be sent.
[ "Sends", "a", "server", "command", "continuation", "request", "+", "back", "to", "the", "client", "requesting", "more", "data", "to", "be", "sent", "." ]
train
https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestLineReader.java#L172-L185
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java
CommerceShippingMethodPersistenceImpl.findAll
@Override public List<CommerceShippingMethod> findAll(int start, int end) { """ Returns a range of all the commerce shipping methods. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CommerceShippingMethodModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. </p> @param start the lower bound of the range of commerce shipping methods @param end the upper bound of the range of commerce shipping methods (not inclusive) @return the range of commerce shipping methods """ return findAll(start, end, null); }
java
@Override public List<CommerceShippingMethod> findAll(int start, int end) { return findAll(start, end, null); }
[ "@", "Override", "public", "List", "<", "CommerceShippingMethod", ">", "findAll", "(", "int", "start", ",", "int", "end", ")", "{", "return", "findAll", "(", "start", ",", "end", ",", "null", ")", ";", "}" ]
Returns a range of all the commerce shipping methods. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CommerceShippingMethodModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. </p> @param start the lower bound of the range of commerce shipping methods @param end the upper bound of the range of commerce shipping methods (not inclusive) @return the range of commerce shipping methods
[ "Returns", "a", "range", "of", "all", "the", "commerce", "shipping", "methods", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java#L2023-L2026
eddi888/camel-tinkerforge
src/main/java/org/atomspace/camel/component/tinkerforge/TinkerforgeEndpoint.java
TinkerforgeEndpoint.getValue
public <T> T getValue(Class<T> type, String parameter, Message message, T uriParameterValue) { """ Get Header-Parameter or alternative Configured URI Parameter Value """ if(message==null && uriParameterValue!=null){ return uriParameterValue; } T value = message.getHeader(parameter, type); if(value==null){ value = uriParameterValue; } return value; }
java
public <T> T getValue(Class<T> type, String parameter, Message message, T uriParameterValue){ if(message==null && uriParameterValue!=null){ return uriParameterValue; } T value = message.getHeader(parameter, type); if(value==null){ value = uriParameterValue; } return value; }
[ "public", "<", "T", ">", "T", "getValue", "(", "Class", "<", "T", ">", "type", ",", "String", "parameter", ",", "Message", "message", ",", "T", "uriParameterValue", ")", "{", "if", "(", "message", "==", "null", "&&", "uriParameterValue", "!=", "null", ...
Get Header-Parameter or alternative Configured URI Parameter Value
[ "Get", "Header", "-", "Parameter", "or", "alternative", "Configured", "URI", "Parameter", "Value" ]
train
https://github.com/eddi888/camel-tinkerforge/blob/b003f272fc77c6a8aa3d18025702b6182161b90a/src/main/java/org/atomspace/camel/component/tinkerforge/TinkerforgeEndpoint.java#L79-L88
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/URI.java
URI.setHost
public void setHost(String p_host) throws MalformedURIException { """ Set the host for this URI. If null is passed in, the userinfo field is also set to null and the port is set to -1. @param p_host the host for this URI @throws MalformedURIException if p_host is not a valid IP address or DNS hostname. """ if (p_host == null || p_host.trim().length() == 0) { m_host = p_host; m_userinfo = null; m_port = -1; } else if (!isWellFormedAddress(p_host)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!"); } m_host = p_host; }
java
public void setHost(String p_host) throws MalformedURIException { if (p_host == null || p_host.trim().length() == 0) { m_host = p_host; m_userinfo = null; m_port = -1; } else if (!isWellFormedAddress(p_host)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!"); } m_host = p_host; }
[ "public", "void", "setHost", "(", "String", "p_host", ")", "throws", "MalformedURIException", "{", "if", "(", "p_host", "==", "null", "||", "p_host", ".", "trim", "(", ")", ".", "length", "(", ")", "==", "0", ")", "{", "m_host", "=", "p_host", ";", "...
Set the host for this URI. If null is passed in, the userinfo field is also set to null and the port is set to -1. @param p_host the host for this URI @throws MalformedURIException if p_host is not a valid IP address or DNS hostname.
[ "Set", "the", "host", "for", "this", "URI", ".", "If", "null", "is", "passed", "in", "the", "userinfo", "field", "is", "also", "set", "to", "null", "and", "the", "port", "is", "set", "to", "-", "1", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/utils/URI.java#L1098-L1113
Harium/keel
src/main/java/com/harium/keel/catalano/math/ComplexNumber.java
ComplexNumber.Divide
public static ComplexNumber Divide(ComplexNumber z1, double scalar) { """ Divides scalar value to a complex number. @param z1 Complex Number. @param scalar Scalar value. @return Returns new ComplexNumber instance containing the divide of specified complex number with the scalar value. """ return new ComplexNumber(z1.real / scalar, z1.imaginary / scalar); }
java
public static ComplexNumber Divide(ComplexNumber z1, double scalar) { return new ComplexNumber(z1.real / scalar, z1.imaginary / scalar); }
[ "public", "static", "ComplexNumber", "Divide", "(", "ComplexNumber", "z1", ",", "double", "scalar", ")", "{", "return", "new", "ComplexNumber", "(", "z1", ".", "real", "/", "scalar", ",", "z1", ".", "imaginary", "/", "scalar", ")", ";", "}" ]
Divides scalar value to a complex number. @param z1 Complex Number. @param scalar Scalar value. @return Returns new ComplexNumber instance containing the divide of specified complex number with the scalar value.
[ "Divides", "scalar", "value", "to", "a", "complex", "number", "." ]
train
https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L384-L386
FINRAOS/JTAF-ExtWebDriver
src/main/java/org/finra/jtaf/ewd/properties/GUIProperties.java
GUIProperties.getPropertyValueAsList
public List<String> getPropertyValueAsList(String key, String... params) { """ Retrieves the property associated with the given key as a {@code List} of {@code String}s. @param key the key to be retrieved @param params instances of the {@code String} literal <code>"{n}"</code> in the retrieved value will be replaced by {@code params[n]} @return the parameterized property list associated with the given key @throws MissingGUIPropertyException """ try { String properties[] = RESOURCE_BUNDLE.getStringArray(key); if ((params != null) && (params.length > 0)) { List<String> returnProperties = new ArrayList<String>(); for (String property : properties) { returnProperties.add(MessageFormat.format(property, (Object[]) params).trim()); } return returnProperties; } else { return Arrays.asList(properties); } } catch (MissingResourceException e) { throw new MissingGUIPropertyException(key, actualBundleName); } catch (IllegalArgumentException ie) { throw ie; } }
java
public List<String> getPropertyValueAsList(String key, String... params) { try { String properties[] = RESOURCE_BUNDLE.getStringArray(key); if ((params != null) && (params.length > 0)) { List<String> returnProperties = new ArrayList<String>(); for (String property : properties) { returnProperties.add(MessageFormat.format(property, (Object[]) params).trim()); } return returnProperties; } else { return Arrays.asList(properties); } } catch (MissingResourceException e) { throw new MissingGUIPropertyException(key, actualBundleName); } catch (IllegalArgumentException ie) { throw ie; } }
[ "public", "List", "<", "String", ">", "getPropertyValueAsList", "(", "String", "key", ",", "String", "...", "params", ")", "{", "try", "{", "String", "properties", "[", "]", "=", "RESOURCE_BUNDLE", ".", "getStringArray", "(", "key", ")", ";", "if", "(", ...
Retrieves the property associated with the given key as a {@code List} of {@code String}s. @param key the key to be retrieved @param params instances of the {@code String} literal <code>"{n}"</code> in the retrieved value will be replaced by {@code params[n]} @return the parameterized property list associated with the given key @throws MissingGUIPropertyException
[ "Retrieves", "the", "property", "associated", "with", "the", "given", "key", "as", "a", "{", "@code", "List", "}", "of", "{", "@code", "String", "}", "s", "." ]
train
https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/properties/GUIProperties.java#L120-L137
instacount/appengine-counter
src/main/java/io/instacount/appengine/counter/service/ShardedCounterServiceImpl.java
ShardedCounterServiceImpl.determineRandomShardNumber
@Override public int determineRandomShardNumber(final Optional<Integer> optShardNumber, final int numShards) { """ Helper method to determine the random shard number for the mutation operation. If {@code optShardNumber} is present, then this value will be used so long as it is greater-than or equal to zero. Otherwise, a PRNG will be used to select the next shard number based upon the current number of shards that are allowed for the current counter as specified by {@code numShards}. @param optShardNumber An {@link Optional} instance of {@link Integer} that specifies the shard number to use, if present. @param numShards The number of shards that the mutating counter has available to it for increment/decrement operations. @return """ Preconditions.checkArgument(numShards > 0); Preconditions.checkNotNull(optShardNumber); if (optShardNumber.isPresent()) { final int shardNumber = optShardNumber.get(); if (shardNumber >= 0 && shardNumber < numShards) { return optShardNumber.get(); } } // Otherwise... return generator.nextInt(numShards); }
java
@Override public int determineRandomShardNumber(final Optional<Integer> optShardNumber, final int numShards) { Preconditions.checkArgument(numShards > 0); Preconditions.checkNotNull(optShardNumber); if (optShardNumber.isPresent()) { final int shardNumber = optShardNumber.get(); if (shardNumber >= 0 && shardNumber < numShards) { return optShardNumber.get(); } } // Otherwise... return generator.nextInt(numShards); }
[ "@", "Override", "public", "int", "determineRandomShardNumber", "(", "final", "Optional", "<", "Integer", ">", "optShardNumber", ",", "final", "int", "numShards", ")", "{", "Preconditions", ".", "checkArgument", "(", "numShards", ">", "0", ")", ";", "Preconditio...
Helper method to determine the random shard number for the mutation operation. If {@code optShardNumber} is present, then this value will be used so long as it is greater-than or equal to zero. Otherwise, a PRNG will be used to select the next shard number based upon the current number of shards that are allowed for the current counter as specified by {@code numShards}. @param optShardNumber An {@link Optional} instance of {@link Integer} that specifies the shard number to use, if present. @param numShards The number of shards that the mutating counter has available to it for increment/decrement operations. @return
[ "Helper", "method", "to", "determine", "the", "random", "shard", "number", "for", "the", "mutation", "operation", ".", "If", "{", "@code", "optShardNumber", "}", "is", "present", "then", "this", "value", "will", "be", "used", "so", "long", "as", "it", "is"...
train
https://github.com/instacount/appengine-counter/blob/60aa86ab28f173ec1642539926b69924b8bda238/src/main/java/io/instacount/appengine/counter/service/ShardedCounterServiceImpl.java#L484-L502