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
graphhopper/graphhopper
core/src/main/java/com/graphhopper/routing/util/spatialrules/countries/GermanySpatialRule.java
GermanySpatialRule.getMaxSpeed
@Override public double getMaxSpeed(String highwayTag, double _default) { """ Germany contains roads with no speed limit. For these roads, this method will return Integer.MAX_VALUE. Your implementation should be able to handle these cases. """ // As defined in: https://wiki.openstreetmap.org/wiki/...
java
@Override public double getMaxSpeed(String highwayTag, double _default) { // As defined in: https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Maxspeed#Motorcar switch (highwayTag) { case "motorway": return Integer.MAX_VALUE; case "trunk": ...
[ "@", "Override", "public", "double", "getMaxSpeed", "(", "String", "highwayTag", ",", "double", "_default", ")", "{", "// As defined in: https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Maxspeed#Motorcar", "switch", "(", "highwayTag", ")", "{", "case", "\"motorway\"",...
Germany contains roads with no speed limit. For these roads, this method will return Integer.MAX_VALUE. Your implementation should be able to handle these cases.
[ "Germany", "contains", "roads", "with", "no", "speed", "limit", ".", "For", "these", "roads", "this", "method", "will", "return", "Integer", ".", "MAX_VALUE", ".", "Your", "implementation", "should", "be", "able", "to", "handle", "these", "cases", "." ]
train
https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/spatialrules/countries/GermanySpatialRule.java#L34-L49
groovy/groovy-core
src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java
StringGroovyMethods.splitEachLine
public static <T> T splitEachLine(CharSequence self, Pattern pattern, @ClosureParams(value=FromString.class,options="List<String>") Closure<T> closure) throws IOException { """ Iterates through the given CharSequence line by line, splitting each line using the given separator Pattern. The list of tokens for each...
java
public static <T> T splitEachLine(CharSequence self, Pattern pattern, @ClosureParams(value=FromString.class,options="List<String>") Closure<T> closure) throws IOException { final List<String> list = readLines(self); T result = null; for (String line : list) { List vals = Arrays.asLis...
[ "public", "static", "<", "T", ">", "T", "splitEachLine", "(", "CharSequence", "self", ",", "Pattern", "pattern", ",", "@", "ClosureParams", "(", "value", "=", "FromString", ".", "class", ",", "options", "=", "\"List<String>\"", ")", "Closure", "<", "T", ">...
Iterates through the given CharSequence line by line, splitting each line using the given separator Pattern. The list of tokens for each line is then passed to the given closure. @param self a CharSequence @param pattern the regular expression Pattern for the delimiter @param closure a closure @return the last val...
[ "Iterates", "through", "the", "given", "CharSequence", "line", "by", "line", "splitting", "each", "line", "using", "the", "given", "separator", "Pattern", ".", "The", "list", "of", "tokens", "for", "each", "line", "is", "then", "passed", "to", "the", "given"...
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L2901-L2909
lotaris/rox-client-java
rox-client-java/src/main/java/com/lotaris/rox/core/filters/FilterTargetData.java
FilterTargetData.mergeTickets
private static String mergeTickets(RoxableTest mAnnotation, RoxableTestClass cAnnotation) { """ Create a string containing all the tickets from method and class annotations @param mAnnotation Method annotation @param cAnnotation Class annotation @return The string of tickets """ List<String> tickets = n...
java
private static String mergeTickets(RoxableTest mAnnotation, RoxableTestClass cAnnotation) { List<String> tickets = new ArrayList<>(); if (mAnnotation != null) { tickets.addAll(Arrays.asList(mAnnotation.tickets())); } if (cAnnotation != null) { tickets.addAll(Arrays.asList(cAnnotation.tickets())); ...
[ "private", "static", "String", "mergeTickets", "(", "RoxableTest", "mAnnotation", ",", "RoxableTestClass", "cAnnotation", ")", "{", "List", "<", "String", ">", "tickets", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "mAnnotation", "!=", "null", "...
Create a string containing all the tickets from method and class annotations @param mAnnotation Method annotation @param cAnnotation Class annotation @return The string of tickets
[ "Create", "a", "string", "containing", "all", "the", "tickets", "from", "method", "and", "class", "annotations" ]
train
https://github.com/lotaris/rox-client-java/blob/1b33f7560347c382c59a40c4037d175ab8127fde/rox-client-java/src/main/java/com/lotaris/rox/core/filters/FilterTargetData.java#L158-L170
Azure/azure-sdk-for-java
labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java
GlobalUsersInner.getEnvironment
public GetEnvironmentResponseInner getEnvironment(String userName, String environmentId) { """ Gets the virtual machine details. @param userName The name of the user. @param environmentId The resourceId of the environment @throws IllegalArgumentException thrown if parameters fail the validation @throws Cloud...
java
public GetEnvironmentResponseInner getEnvironment(String userName, String environmentId) { return getEnvironmentWithServiceResponseAsync(userName, environmentId).toBlocking().single().body(); }
[ "public", "GetEnvironmentResponseInner", "getEnvironment", "(", "String", "userName", ",", "String", "environmentId", ")", "{", "return", "getEnvironmentWithServiceResponseAsync", "(", "userName", ",", "environmentId", ")", ".", "toBlocking", "(", ")", ".", "single", ...
Gets the virtual machine details. @param userName The name of the user. @param environmentId The resourceId of the environment @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked ...
[ "Gets", "the", "virtual", "machine", "details", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java#L128-L130
spring-projects/spring-security-oauth
spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java
OAuthProviderProcessingFilter.requiresAuthentication
protected boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) { """ Whether this filter is configured to process the specified request. @param request The request. @param response The response @param filterChain The filter chain @return Whe...
java
protected boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) { //copied from org.springframework.security.ui.AbstractProcessingFilter.requiresAuthentication String uri = request.getRequestURI(); int pathParamIndex = uri.indexOf(';'); if (pa...
[ "protected", "boolean", "requiresAuthentication", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "FilterChain", "filterChain", ")", "{", "//copied from org.springframework.security.ui.AbstractProcessingFilter.requiresAuthentication", "String", "uri...
Whether this filter is configured to process the specified request. @param request The request. @param response The response @param filterChain The filter chain @return Whether this filter is configured to process the specified request.
[ "Whether", "this", "filter", "is", "configured", "to", "process", "the", "specified", "request", "." ]
train
https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java#L389-L408
CenturyLinkCloud/mdw
mdw-common/src/com/centurylink/mdw/util/JMSServices.java
JMSServices.getQueue
public Queue getQueue(Session session, String commonName) throws ServiceLocatorException { """ Uses the container-specific qualifier to look up a JMS queue. @param commonName the vendor-neutral logical queue name @return javax.jms.Queue """ Queue queue = (Queue) queueCache.get(commonName); ...
java
public Queue getQueue(Session session, String commonName) throws ServiceLocatorException { Queue queue = (Queue) queueCache.get(commonName); if (queue == null) { try { String name = namingProvider.qualifyJmsQueueName(commonName); queue = jmsProvider.getQueue(s...
[ "public", "Queue", "getQueue", "(", "Session", "session", ",", "String", "commonName", ")", "throws", "ServiceLocatorException", "{", "Queue", "queue", "=", "(", "Queue", ")", "queueCache", ".", "get", "(", "commonName", ")", ";", "if", "(", "queue", "==", ...
Uses the container-specific qualifier to look up a JMS queue. @param commonName the vendor-neutral logical queue name @return javax.jms.Queue
[ "Uses", "the", "container", "-", "specific", "qualifier", "to", "look", "up", "a", "JMS", "queue", "." ]
train
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/util/JMSServices.java#L221-L235
fommil/matrix-toolkits-java
src/main/java/no/uib/cipr/matrix/io/MatrixVectorWriter.java
MatrixVectorWriter.printPattern
public void printPattern(int[] row, int[] column, int offset) { """ Prints the coordinates to the underlying stream. One index pair on each line. The offset is added to each index, typically, this can transform from a 0-based indicing to a 1-based. """ int size = row.length; if (size != colum...
java
public void printPattern(int[] row, int[] column, int offset) { int size = row.length; if (size != column.length) throw new IllegalArgumentException( "All arrays must be of the same size"); for (int i = 0; i < size; ++i) format(Locale.ENGLISH, "%10d %1...
[ "public", "void", "printPattern", "(", "int", "[", "]", "row", ",", "int", "[", "]", "column", ",", "int", "offset", ")", "{", "int", "size", "=", "row", ".", "length", ";", "if", "(", "size", "!=", "column", ".", "length", ")", "throw", "new", "...
Prints the coordinates to the underlying stream. One index pair on each line. The offset is added to each index, typically, this can transform from a 0-based indicing to a 1-based.
[ "Prints", "the", "coordinates", "to", "the", "underlying", "stream", ".", "One", "index", "pair", "on", "each", "line", ".", "The", "offset", "is", "added", "to", "each", "index", "typically", "this", "can", "transform", "from", "a", "0", "-", "based", "...
train
https://github.com/fommil/matrix-toolkits-java/blob/6157618bc86bcda3749af2a60bf869d8f3292960/src/main/java/no/uib/cipr/matrix/io/MatrixVectorWriter.java#L385-L393
xdcrafts/flower
flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java
MapDotApi.dotGetNullable
public static Object dotGetNullable(final Map map, final String pathString) { """ Get object value by path. @param map subject @param pathString nodes to walk in map @return value """ return dotGetNullable(map, Object.class, pathString); }
java
public static Object dotGetNullable(final Map map, final String pathString) { return dotGetNullable(map, Object.class, pathString); }
[ "public", "static", "Object", "dotGetNullable", "(", "final", "Map", "map", ",", "final", "String", "pathString", ")", "{", "return", "dotGetNullable", "(", "map", ",", "Object", ".", "class", ",", "pathString", ")", ";", "}" ]
Get object value by path. @param map subject @param pathString nodes to walk in map @return value
[ "Get", "object", "value", "by", "path", "." ]
train
https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java#L116-L118
apache/groovy
src/main/java/org/codehaus/groovy/runtime/metaclass/ReflectorLoader.java
ReflectorLoader.loadClass
protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { """ Loads a class per name. Unlike a normal loadClass this version behaves different during a class definition. In that case it checks if the class we want to load is Reflector and returns class if the check is ...
java
protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { if (inDefine) { if (name.equals(REFLECTOR)) return Reflector.class; } return super.loadClass(name, resolve); }
[ "protected", "synchronized", "Class", "loadClass", "(", "String", "name", ",", "boolean", "resolve", ")", "throws", "ClassNotFoundException", "{", "if", "(", "inDefine", ")", "{", "if", "(", "name", ".", "equals", "(", "REFLECTOR", ")", ")", "return", "Refle...
Loads a class per name. Unlike a normal loadClass this version behaves different during a class definition. In that case it checks if the class we want to load is Reflector and returns class if the check is successful. If it is not during a class definition it just calls the super class version of loadClass. @param na...
[ "Loads", "a", "class", "per", "name", ".", "Unlike", "a", "normal", "loadClass", "this", "version", "behaves", "different", "during", "a", "class", "definition", ".", "In", "that", "case", "it", "checks", "if", "the", "class", "we", "want", "to", "load", ...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/metaclass/ReflectorLoader.java#L69-L74
recruit-mp/android-RMP-Appirater
library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java
RmpAppirater.setDoNotShowAgain
public static void setDoNotShowAgain(Context context, boolean doNotShowAgain) { """ Modify internal value. <p/> If you use this method, you might need to have a good understanding of this class code. @param context Context @param doNotShowAgain Clicked "No, Thanks" if true. """ SharedPrefe...
java
public static void setDoNotShowAgain(Context context, boolean doNotShowAgain) { SharedPreferences prefs = getSharedPreferences(context); SharedPreferences.Editor prefsEditor = prefs.edit(); prefsEditor.putBoolean(PREF_KEY_DO_NOT_SHOW_AGAIN, doNotShowAgain); prefsEditor.commit(); }
[ "public", "static", "void", "setDoNotShowAgain", "(", "Context", "context", ",", "boolean", "doNotShowAgain", ")", "{", "SharedPreferences", "prefs", "=", "getSharedPreferences", "(", "context", ")", ";", "SharedPreferences", ".", "Editor", "prefsEditor", "=", "pref...
Modify internal value. <p/> If you use this method, you might need to have a good understanding of this class code. @param context Context @param doNotShowAgain Clicked "No, Thanks" if true.
[ "Modify", "internal", "value", ".", "<p", "/", ">", "If", "you", "use", "this", "method", "you", "might", "need", "to", "have", "a", "good", "understanding", "of", "this", "class", "code", "." ]
train
https://github.com/recruit-mp/android-RMP-Appirater/blob/14fcdf110dfb97120303f39aab1de9393e84b90a/library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java#L396-L403
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/cookies/CookieCacheData.java
CookieCacheData.getAllCookieValues
public int getAllCookieValues(String name, List<String> list) { """ Find all instances of the input cookie name in the cache and append their values into the input list. @param name @param list @return int - number of items added """ int added = 0; if (0 < this.parsedList.size() && null !...
java
public int getAllCookieValues(String name, List<String> list) { int added = 0; if (0 < this.parsedList.size() && null != name) { for (HttpCookie cookie : this.parsedList) { if (name.equals(cookie.getName())) { list.add(cookie.getValue()); }...
[ "public", "int", "getAllCookieValues", "(", "String", "name", ",", "List", "<", "String", ">", "list", ")", "{", "int", "added", "=", "0", ";", "if", "(", "0", "<", "this", ".", "parsedList", ".", "size", "(", ")", "&&", "null", "!=", "name", ")", ...
Find all instances of the input cookie name in the cache and append their values into the input list. @param name @param list @return int - number of items added
[ "Find", "all", "instances", "of", "the", "input", "cookie", "name", "in", "the", "cache", "and", "append", "their", "values", "into", "the", "input", "list", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/cookies/CookieCacheData.java#L164-L174
hibernate/hibernate-ogm
core/src/main/java/org/hibernate/ogm/id/impl/OgmTableGenerator.java
OgmTableGenerator.determineSegmentColumnName
protected String determineSegmentColumnName(Properties params, Dialect dialect) { """ Determine the name of the column used to indicate the segment for each row. This column acts as the primary key. <p> Called during {@link #configure configuration}. @param params The params supplied in the generator config...
java
protected String determineSegmentColumnName(Properties params, Dialect dialect) { ObjectNameNormalizer normalizer = (ObjectNameNormalizer) params.get( PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER ); String name = ConfigurationHelper.getString( SEGMENT_COLUMN_PARAM, params, DEF_SEGMENT_COLUMN ); return norm...
[ "protected", "String", "determineSegmentColumnName", "(", "Properties", "params", ",", "Dialect", "dialect", ")", "{", "ObjectNameNormalizer", "normalizer", "=", "(", "ObjectNameNormalizer", ")", "params", ".", "get", "(", "PersistentIdentifierGenerator", ".", "IDENTIFI...
Determine the name of the column used to indicate the segment for each row. This column acts as the primary key. <p> Called during {@link #configure configuration}. @param params The params supplied in the generator config (plus some standard useful extras). @param dialect The dialect in effect @return The name of t...
[ "Determine", "the", "name", "of", "the", "column", "used", "to", "indicate", "the", "segment", "for", "each", "row", ".", "This", "column", "acts", "as", "the", "primary", "key", ".", "<p", ">", "Called", "during", "{", "@link", "#configure", "configuratio...
train
https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/id/impl/OgmTableGenerator.java#L219-L223
zaproxy/zaproxy
src/org/zaproxy/zap/extension/brk/BreakpointMessageHandler.java
BreakpointMessageHandler.handleMessageReceivedFromClient
public boolean handleMessageReceivedFromClient(Message aMessage, boolean onlyIfInScope) { """ Do not call if in {@link Mode#safe}. @param aMessage @param onlyIfInScope @return False if message should be dropped. """ if ( ! isBreakpoint(aMessage, true, onlyIfInScope)) { return true; ...
java
public boolean handleMessageReceivedFromClient(Message aMessage, boolean onlyIfInScope) { if ( ! isBreakpoint(aMessage, true, onlyIfInScope)) { return true; } // Do this outside of the semaphore loop so that the 'continue' button can apply to all queued break points ...
[ "public", "boolean", "handleMessageReceivedFromClient", "(", "Message", "aMessage", ",", "boolean", "onlyIfInScope", ")", "{", "if", "(", "!", "isBreakpoint", "(", "aMessage", ",", "true", ",", "onlyIfInScope", ")", ")", "{", "return", "true", ";", "}", "// Do...
Do not call if in {@link Mode#safe}. @param aMessage @param onlyIfInScope @return False if message should be dropped.
[ "Do", "not", "call", "if", "in", "{", "@link", "Mode#safe", "}", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/brk/BreakpointMessageHandler.java#L71-L88
threerings/nenya
core/src/main/java/com/threerings/openal/Stream.java
Stream.fadeOut
public void fadeOut (float interval, boolean dispose) { """ Fades this stream out over the specified interval. @param dispose if true, dispose of the stream when done fading out """ _fadeMode = dispose ? FadeMode.OUT_DISPOSE : FadeMode.OUT; _fadeInterval = interval; _fadeElapsed = 0f...
java
public void fadeOut (float interval, boolean dispose) { _fadeMode = dispose ? FadeMode.OUT_DISPOSE : FadeMode.OUT; _fadeInterval = interval; _fadeElapsed = 0f; }
[ "public", "void", "fadeOut", "(", "float", "interval", ",", "boolean", "dispose", ")", "{", "_fadeMode", "=", "dispose", "?", "FadeMode", ".", "OUT_DISPOSE", ":", "FadeMode", ".", "OUT", ";", "_fadeInterval", "=", "interval", ";", "_fadeElapsed", "=", "0f", ...
Fades this stream out over the specified interval. @param dispose if true, dispose of the stream when done fading out
[ "Fades", "this", "stream", "out", "over", "the", "specified", "interval", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Stream.java#L146-L151
alkacon/opencms-core
src/org/opencms/main/CmsShellCommands.java
CmsShellCommands.uploadFile
public CmsResource uploadFile(String localfile, String folder, String filename, String type) throws Exception, CmsIllegalArgumentException { """ Loads a file from the "real" file system to the VFS.<p> @param localfile the file upload @param folder the folder in the VFS to place the file into @param filena...
java
public CmsResource uploadFile(String localfile, String folder, String filename, String type) throws Exception, CmsIllegalArgumentException { I_CmsResourceType t = OpenCms.getResourceManager().getResourceType(type); return m_cms.createResource(folder + filename, t, CmsFileUtil.readFile(new File(loca...
[ "public", "CmsResource", "uploadFile", "(", "String", "localfile", ",", "String", "folder", ",", "String", "filename", ",", "String", "type", ")", "throws", "Exception", ",", "CmsIllegalArgumentException", "{", "I_CmsResourceType", "t", "=", "OpenCms", ".", "getRe...
Loads a file from the "real" file system to the VFS.<p> @param localfile the file upload @param folder the folder in the VFS to place the file into @param filename the name of the uploaded file in the VFS @param type the type of the new file in the VFS @return the createed file @throws Exception if something goes wron...
[ "Loads", "a", "file", "from", "the", "real", "file", "system", "to", "the", "VFS", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L1769-L1774
dnsjava/dnsjava
org/xbill/DNS/Record.java
Record.newRecord
public static Record newRecord(Name name, int type, int dclass, long ttl, byte [] data) { """ Creates a new record, with the given parameters. @param name The owner name of the record. @param type The record's type. @param dclass The record's class. @param ttl The record's time to live. @param data The comple...
java
public static Record newRecord(Name name, int type, int dclass, long ttl, byte [] data) { return newRecord(name, type, dclass, ttl, data.length, data); }
[ "public", "static", "Record", "newRecord", "(", "Name", "name", ",", "int", "type", ",", "int", "dclass", ",", "long", "ttl", ",", "byte", "[", "]", "data", ")", "{", "return", "newRecord", "(", "name", ",", "type", ",", "dclass", ",", "ttl", ",", ...
Creates a new record, with the given parameters. @param name The owner name of the record. @param type The record's type. @param dclass The record's class. @param ttl The record's time to live. @param data The complete rdata of the record, in uncompressed DNS wire format.
[ "Creates", "a", "new", "record", "with", "the", "given", "parameters", "." ]
train
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Record.java#L137-L140
Ordinastie/MalisisCore
src/main/java/net/malisis/core/inventory/message/InventoryActionMessage.java
InventoryActionMessage.process
@Override public void process(Packet message, MessageContext ctx) { """ Handles the {@link Packet} received from the client.<br> Passes the action to the {@link MalisisInventoryContainer}, and send the changes back to the client. @param message the message @param ctx the ctx """ Container c = ctx.getSe...
java
@Override public void process(Packet message, MessageContext ctx) { Container c = ctx.getServerHandler().player.openContainer; if (message.windowId != c.windowId || !(c instanceof MalisisInventoryContainer)) return; MalisisInventoryContainer container = (MalisisInventoryContainer) c; container.handleActio...
[ "@", "Override", "public", "void", "process", "(", "Packet", "message", ",", "MessageContext", "ctx", ")", "{", "Container", "c", "=", "ctx", ".", "getServerHandler", "(", ")", ".", "player", ".", "openContainer", ";", "if", "(", "message", ".", "windowId"...
Handles the {@link Packet} received from the client.<br> Passes the action to the {@link MalisisInventoryContainer}, and send the changes back to the client. @param message the message @param ctx the ctx
[ "Handles", "the", "{", "@link", "Packet", "}", "received", "from", "the", "client", ".", "<br", ">", "Passes", "the", "action", "to", "the", "{", "@link", "MalisisInventoryContainer", "}", "and", "send", "the", "changes", "back", "to", "the", "client", "."...
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/inventory/message/InventoryActionMessage.java#L61-L71
VoltDB/voltdb
src/frontend/org/voltdb/ClientInterface.java
ClientInterface.failOverConnection
private void failOverConnection(Integer partitionId, Long initiatorHSId, Connection c) { """ /* When partition mastership for a partition changes, check all outstanding requests for that partition and if they aren't for the current partition master, drop them and send an error response. """ ClientIn...
java
private void failOverConnection(Integer partitionId, Long initiatorHSId, Connection c) { ClientInterfaceHandleManager cihm = m_cihm.get(c.connectionId()); if (cihm == null) { return; } List<Iv2InFlight> transactions = cihm.removeHandlesForPartitionAndInitiato...
[ "private", "void", "failOverConnection", "(", "Integer", "partitionId", ",", "Long", "initiatorHSId", ",", "Connection", "c", ")", "{", "ClientInterfaceHandleManager", "cihm", "=", "m_cihm", ".", "get", "(", "c", ".", "connectionId", "(", ")", ")", ";", "if", ...
/* When partition mastership for a partition changes, check all outstanding requests for that partition and if they aren't for the current partition master, drop them and send an error response.
[ "/", "*", "When", "partition", "mastership", "for", "a", "partition", "changes", "check", "all", "outstanding", "requests", "for", "that", "partition", "and", "if", "they", "aren", "t", "for", "the", "current", "partition", "master", "drop", "them", "and", "...
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ClientInterface.java#L1341-L1373
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java
DiagnosticsInner.executeSiteDetectorSlot
public DiagnosticDetectorResponseInner executeSiteDetectorSlot(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, String slot) { """ Execute Detector. Execute Detector. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Si...
java
public DiagnosticDetectorResponseInner executeSiteDetectorSlot(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, String slot) { return executeSiteDetectorSlotWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory, slot).toBlocking().single...
[ "public", "DiagnosticDetectorResponseInner", "executeSiteDetectorSlot", "(", "String", "resourceGroupName", ",", "String", "siteName", ",", "String", "detectorName", ",", "String", "diagnosticCategory", ",", "String", "slot", ")", "{", "return", "executeSiteDetectorSlotWith...
Execute Detector. Execute Detector. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Site Name @param detectorName Detector Resource Name @param diagnosticCategory Category Name @param slot Slot Name @throws IllegalArgumentException thrown if parameters fail the valida...
[ "Execute", "Detector", ".", "Execute", "Detector", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L2372-L2374
adobe/htl-tck
src/main/java/io/sightly/tck/html/HTMLExtractor.java
HTMLExtractor.contains
public static boolean contains(String url, String markup, String selector, String value) { """ Checks if any of the elements from the {@code markup} identified by the {@code selector} contain the text from {@code value}. The {@code url} is used only for caching purposes, to avoid parsing multiple times the markup...
java
public static boolean contains(String url, String markup, String selector, String value) { ensureMarkup(url, markup); Document document = documents.get(url); Elements elements = document.select(selector); return elements.outerHtml().contains(value); }
[ "public", "static", "boolean", "contains", "(", "String", "url", ",", "String", "markup", ",", "String", "selector", ",", "String", "value", ")", "{", "ensureMarkup", "(", "url", ",", "markup", ")", ";", "Document", "document", "=", "documents", ".", "get"...
Checks if any of the elements from the {@code markup} identified by the {@code selector} contain the text from {@code value}. The {@code url} is used only for caching purposes, to avoid parsing multiple times the markup returned for the same resource. @param url the url that identifies the markup @param markup ...
[ "Checks", "if", "any", "of", "the", "elements", "from", "the", "{", "@code", "markup", "}", "identified", "by", "the", "{", "@code", "selector", "}", "contain", "the", "text", "from", "{", "@code", "value", "}", ".", "The", "{", "@code", "url", "}", ...
train
https://github.com/adobe/htl-tck/blob/2043a9616083c06cefbd685798c9a2b2ac2ea98e/src/main/java/io/sightly/tck/html/HTMLExtractor.java#L57-L62
Azure/azure-sdk-for-java
network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworksInner.java
VirtualNetworksInner.listUsageWithServiceResponseAsync
public Observable<ServiceResponse<Page<VirtualNetworkUsageInner>>> listUsageWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { """ Lists usage stats. @param resourceGroupName The name of the resource group. @param virtualNetworkName The name of the virtual network. @th...
java
public Observable<ServiceResponse<Page<VirtualNetworkUsageInner>>> listUsageWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { return listUsageSinglePageAsync(resourceGroupName, virtualNetworkName) .concatMap(new Func1<ServiceResponse<Page<VirtualNetworkUsage...
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "VirtualNetworkUsageInner", ">", ">", ">", "listUsageWithServiceResponseAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "virtualNetworkName", ")", "{", "return", "listUsageSin...
Lists usage stats. @param resourceGroupName The name of the resource group. @param virtualNetworkName The name of the virtual network. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;VirtualNetworkUsageInner&gt; object
[ "Lists", "usage", "stats", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworksInner.java#L1378-L1390
jaredrummler/AndroidShell
library/src/main/java/com/jaredrummler/android/shell/Shell.java
Shell.runWithEnv
@WorkerThread public static Process runWithEnv(@NonNull String command, @Nullable String[] environment) throws IOException { """ <p>This code is adapted from java.lang.ProcessBuilder.start().</p> <p>The problem is that Android doesn't allow us to modify the map returned by ProcessBuilder.environment(), even ...
java
@WorkerThread public static Process runWithEnv(@NonNull String command, @Nullable String[] environment) throws IOException { if (environment != null) { Map<String, String> newEnvironment = new HashMap<>(); newEnvironment.putAll(System.getenv()); int split; for (String entry : environment) ...
[ "@", "WorkerThread", "public", "static", "Process", "runWithEnv", "(", "@", "NonNull", "String", "command", ",", "@", "Nullable", "String", "[", "]", "environment", ")", "throws", "IOException", "{", "if", "(", "environment", "!=", "null", ")", "{", "Map", ...
<p>This code is adapted from java.lang.ProcessBuilder.start().</p> <p>The problem is that Android doesn't allow us to modify the map returned by ProcessBuilder.environment(), even though the JavaDoc indicates that it should. This is because it simply returns the SystemEnvironment object that System.getenv() gives us. ...
[ "<p", ">", "This", "code", "is", "adapted", "from", "java", ".", "lang", ".", "ProcessBuilder", ".", "start", "()", ".", "<", "/", "p", ">" ]
train
https://github.com/jaredrummler/AndroidShell/blob/0826b6f93c208b7bc95344dd20e2989d367a1e43/library/src/main/java/com/jaredrummler/android/shell/Shell.java#L166-L185
spring-projects/spring-loaded
springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java
TypeRegistry.iiIntercept
public static Object iiIntercept(Object instance, Object[] params, Object instance2, String nameAndDescriptor) { """ See notes.md#001 @param instance the object instance on which the INVOKEINTERFACE is being called @param params the parameters to the INVOKEINTERFACE call @param instance2 the object instance o...
java
public static Object iiIntercept(Object instance, Object[] params, Object instance2, String nameAndDescriptor) { Class<?> clazz = instance.getClass(); try { if (clazz.getName().contains("$$Lambda")) { // There may be multiple methods here, we want the public one (I think!) Method[] ms = instance.getClass...
[ "public", "static", "Object", "iiIntercept", "(", "Object", "instance", ",", "Object", "[", "]", "params", ",", "Object", "instance2", ",", "String", "nameAndDescriptor", ")", "{", "Class", "<", "?", ">", "clazz", "=", "instance", ".", "getClass", "(", ")"...
See notes.md#001 @param instance the object instance on which the INVOKEINTERFACE is being called @param params the parameters to the INVOKEINTERFACE call @param instance2 the object instance on which the INVOKEINTERFACE is being called @param nameAndDescriptor the name and descriptor of what is being called (e.g. foo...
[ "See", "notes", ".", "md#001" ]
train
https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java#L1512-L1543
bujiio/buji-pac4j
src/main/java/io/buji/pac4j/util/ShiroHelper.java
ShiroHelper.populateSubject
public static void populateSubject(final LinkedHashMap<String, CommonProfile> profiles) { """ Populate the authenticated user profiles in the Shiro subject. @param profiles the linked hashmap of profiles """ if (profiles != null && profiles.size() > 0) { final List<CommonProfile> listPro...
java
public static void populateSubject(final LinkedHashMap<String, CommonProfile> profiles) { if (profiles != null && profiles.size() > 0) { final List<CommonProfile> listProfiles = ProfileHelper.flatIntoAProfileList(profiles); try { if (IS_FULLY_AUTHENTICATED_AUTHORIZER.isAu...
[ "public", "static", "void", "populateSubject", "(", "final", "LinkedHashMap", "<", "String", ",", "CommonProfile", ">", "profiles", ")", "{", "if", "(", "profiles", "!=", "null", "&&", "profiles", ".", "size", "(", ")", ">", "0", ")", "{", "final", "List...
Populate the authenticated user profiles in the Shiro subject. @param profiles the linked hashmap of profiles
[ "Populate", "the", "authenticated", "user", "profiles", "in", "the", "Shiro", "subject", "." ]
train
https://github.com/bujiio/buji-pac4j/blob/5ce149161f359074df09bc47b9f2aed8e17141a2/src/main/java/io/buji/pac4j/util/ShiroHelper.java#L51-L64
pip-services3-java/pip-services3-commons-java
src/org/pipservices3/commons/data/AnyValueMap.java
AnyValueMap.fromMaps
public static AnyValueMap fromMaps(Map<?, ?>... maps) { """ Creates a new AnyValueMap by merging two or more maps. Maps defined later in the list override values from previously defined maps. @param maps an array of maps to be merged @return a newly created AnyValueMap. """ AnyValueMap result = new AnyV...
java
public static AnyValueMap fromMaps(Map<?, ?>... maps) { AnyValueMap result = new AnyValueMap(); if (maps == null || maps.length == 0) return result; for (Map<?, ?> map : maps) { for (Map.Entry<?, ?> entry : map.entrySet()) { String key = StringConverter.toString(entry.getKey()); Object value = entr...
[ "public", "static", "AnyValueMap", "fromMaps", "(", "Map", "<", "?", ",", "?", ">", "...", "maps", ")", "{", "AnyValueMap", "result", "=", "new", "AnyValueMap", "(", ")", ";", "if", "(", "maps", "==", "null", "||", "maps", ".", "length", "==", "0", ...
Creates a new AnyValueMap by merging two or more maps. Maps defined later in the list override values from previously defined maps. @param maps an array of maps to be merged @return a newly created AnyValueMap.
[ "Creates", "a", "new", "AnyValueMap", "by", "merging", "two", "or", "more", "maps", ".", "Maps", "defined", "later", "in", "the", "list", "override", "values", "from", "previously", "defined", "maps", "." ]
train
https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/data/AnyValueMap.java#L705-L719
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java
CPOptionPersistenceImpl.fetchByC_ERC
@Override public CPOption fetchByC_ERC(long companyId, String externalReferenceCode) { """ Returns the cp option where companyId = &#63; and externalReferenceCode = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache. @param companyId the company ID @param externalReferenceCode ...
java
@Override public CPOption fetchByC_ERC(long companyId, String externalReferenceCode) { return fetchByC_ERC(companyId, externalReferenceCode, true); }
[ "@", "Override", "public", "CPOption", "fetchByC_ERC", "(", "long", "companyId", ",", "String", "externalReferenceCode", ")", "{", "return", "fetchByC_ERC", "(", "companyId", ",", "externalReferenceCode", ",", "true", ")", ";", "}" ]
Returns the cp option where companyId = &#63; and externalReferenceCode = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache. @param companyId the company ID @param externalReferenceCode the external reference code @return the matching cp option, or <code>null</code> if a matching cp op...
[ "Returns", "the", "cp", "option", "where", "companyId", "=", "&#63", ";", "and", "externalReferenceCode", "=", "&#63", ";", "or", "returns", "<code", ">", "null<", "/", "code", ">", "if", "it", "could", "not", "be", "found", ".", "Uses", "the", "finder",...
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java#L2274-L2277
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XStringForFSB.java
XStringForFSB.startsWith
public boolean startsWith(XMLString prefix, int toffset) { """ Tests if this string starts with the specified prefix beginning a specified index. @param prefix the prefix. @param toffset where to begin looking in the string. @return <code>true</code> if the character sequence represented by the ar...
java
public boolean startsWith(XMLString prefix, int toffset) { FastStringBuffer fsb = fsb(); int to = m_start + toffset; int tlim = m_start + m_length; int po = 0; int pc = prefix.length(); // Note: toffset might be near -1>>>1. if ((toffset < 0) || (toffset > m_length - pc)) { ret...
[ "public", "boolean", "startsWith", "(", "XMLString", "prefix", ",", "int", "toffset", ")", "{", "FastStringBuffer", "fsb", "=", "fsb", "(", ")", ";", "int", "to", "=", "m_start", "+", "toffset", ";", "int", "tlim", "=", "m_start", "+", "m_length", ";", ...
Tests if this string starts with the specified prefix beginning a specified index. @param prefix the prefix. @param toffset where to begin looking in the string. @return <code>true</code> if the character sequence represented by the argument is a prefix of the substring of this object starting at index <code...
[ "Tests", "if", "this", "string", "starts", "with", "the", "specified", "prefix", "beginning", "a", "specified", "index", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XStringForFSB.java#L608-L635
beders/Resty
src/main/java/us/monoid/web/XMLResource.java
XMLResource.get
public <T> T get(String xPath, Class<T> returnType) throws Exception { """ Access the XML evaluating an XPath on it, returning the resulting Object of the desired type Supported types are NodeList, String, Boolean, Double, Node. @throws Exception """ XPathQuery xp = new XPathQuery(xPath); return xp.eval(...
java
public <T> T get(String xPath, Class<T> returnType) throws Exception { XPathQuery xp = new XPathQuery(xPath); return xp.eval(this, returnType); }
[ "public", "<", "T", ">", "T", "get", "(", "String", "xPath", ",", "Class", "<", "T", ">", "returnType", ")", "throws", "Exception", "{", "XPathQuery", "xp", "=", "new", "XPathQuery", "(", "xPath", ")", ";", "return", "xp", ".", "eval", "(", "this", ...
Access the XML evaluating an XPath on it, returning the resulting Object of the desired type Supported types are NodeList, String, Boolean, Double, Node. @throws Exception
[ "Access", "the", "XML", "evaluating", "an", "XPath", "on", "it", "returning", "the", "resulting", "Object", "of", "the", "desired", "type", "Supported", "types", "are", "NodeList", "String", "Boolean", "Double", "Node", "." ]
train
https://github.com/beders/Resty/blob/4493603e9689c942cc3e53b9c5018010e414a364/src/main/java/us/monoid/web/XMLResource.java#L143-L146
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/handlers/LogRepositoryComponent.java
LogRepositoryComponent.setProcessInfo
public static void setProcessInfo(String pid, String label, String superPid) { """ identify whether this is a logical subProcess of another process or not @param pid processId of current process @param label label for current process (used in generating file names) @param superPid processId of logical parent pr...
java
public static void setProcessInfo(String pid, String label, String superPid) { svPid = pid ; svLabel = label ; svSuperPid = superPid ; }
[ "public", "static", "void", "setProcessInfo", "(", "String", "pid", ",", "String", "label", ",", "String", "superPid", ")", "{", "svPid", "=", "pid", ";", "svLabel", "=", "label", ";", "svSuperPid", "=", "superPid", ";", "}" ]
identify whether this is a logical subProcess of another process or not @param pid processId of current process @param label label for current process (used in generating file names) @param superPid processId of logical parent process
[ "identify", "whether", "this", "is", "a", "logical", "subProcess", "of", "another", "process", "or", "not" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/handlers/LogRepositoryComponent.java#L616-L620
baasbox/Android-SDK
library/src/main/java/com/baasbox/android/BaasACL.java
BaasACL.hasRoleGrant
public boolean hasRoleGrant(Grant grant,String role) { """ Checks if the role has the specified {@code grant} @param grant a {@link com.baasbox.android.Grant} @param role a role @return """ if (grant == null) throw new IllegalArgumentException("grant cannot be null"); if (role == null) throw...
java
public boolean hasRoleGrant(Grant grant,String role){ if (grant == null) throw new IllegalArgumentException("grant cannot be null"); if (role == null) throw new IllegalArgumentException("role cannot be null"); Set<String> roles = rolesGrants.get(grant); return roles!=null&&roles.contains...
[ "public", "boolean", "hasRoleGrant", "(", "Grant", "grant", ",", "String", "role", ")", "{", "if", "(", "grant", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"grant cannot be null\"", ")", ";", "if", "(", "role", "==", "null", ")", ...
Checks if the role has the specified {@code grant} @param grant a {@link com.baasbox.android.Grant} @param role a role @return
[ "Checks", "if", "the", "role", "has", "the", "specified", "{" ]
train
https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasACL.java#L125-L130
dita-ot/dita-ot
src/main/java/org/dita/dost/util/Job.java
Job.setProperty
public Object setProperty(final String key, final String value) { """ Set property value. @param key property key @param value property value @return the previous value of the specified key in this property list, or {@code null} if it did not have one """ return prop.put(key, value); }
java
public Object setProperty(final String key, final String value) { return prop.put(key, value); }
[ "public", "Object", "setProperty", "(", "final", "String", "key", ",", "final", "String", "value", ")", "{", "return", "prop", ".", "put", "(", "key", ",", "value", ")", ";", "}" ]
Set property value. @param key property key @param value property value @return the previous value of the specified key in this property list, or {@code null} if it did not have one
[ "Set", "property", "value", "." ]
train
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/Job.java#L443-L445
Azure/azure-sdk-for-java
appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java
AppServicePlansInner.listVnetsAsync
public Observable<List<VnetInfoInner>> listVnetsAsync(String resourceGroupName, String name) { """ Get all Virtual Networks associated with an App Service plan. Get all Virtual Networks associated with an App Service plan. @param resourceGroupName Name of the resource group to which the resource belongs. @par...
java
public Observable<List<VnetInfoInner>> listVnetsAsync(String resourceGroupName, String name) { return listVnetsWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<List<VnetInfoInner>>, List<VnetInfoInner>>() { @Override public List<VnetInfoInner> call(ServiceR...
[ "public", "Observable", "<", "List", "<", "VnetInfoInner", ">", ">", "listVnetsAsync", "(", "String", "resourceGroupName", ",", "String", "name", ")", "{", "return", "listVnetsWithServiceResponseAsync", "(", "resourceGroupName", ",", "name", ")", ".", "map", "(", ...
Get all Virtual Networks associated with an App Service plan. Get all Virtual Networks associated with an App Service plan. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the App Service plan. @throws IllegalArgumentException thrown if parameters fail the validat...
[ "Get", "all", "Virtual", "Networks", "associated", "with", "an", "App", "Service", "plan", ".", "Get", "all", "Virtual", "Networks", "associated", "with", "an", "App", "Service", "plan", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L3011-L3018
lucmoreau/ProvToolbox
prov-interop/src/main/java/org/openprovenance/prov/interop/InteropFramework.java
InteropFramework.readDocumentFromFile
public Document readDocumentFromFile(String filename) { """ Reads a document from a file, using the file extension to decide which parser to read the file with. @param filename the file to read a document from @return a Document """ ProvFormat format = getTypeForFile(filename); if (f...
java
public Document readDocumentFromFile(String filename) { ProvFormat format = getTypeForFile(filename); if (format == null) { throw new InteropException("Unknown output file format: " + filename); } return readDocumentFromFile(filena...
[ "public", "Document", "readDocumentFromFile", "(", "String", "filename", ")", "{", "ProvFormat", "format", "=", "getTypeForFile", "(", "filename", ")", ";", "if", "(", "format", "==", "null", ")", "{", "throw", "new", "InteropException", "(", "\"Unknown output f...
Reads a document from a file, using the file extension to decide which parser to read the file with. @param filename the file to read a document from @return a Document
[ "Reads", "a", "document", "from", "a", "file", "using", "the", "file", "extension", "to", "decide", "which", "parser", "to", "read", "the", "file", "with", "." ]
train
https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-interop/src/main/java/org/openprovenance/prov/interop/InteropFramework.java#L685-L693
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalCell.java
CrystalCell.transfToOriginCell
public void transfToOriginCell(Tuple3d[] points, Tuple3d reference) { """ Converts a set of points so that the reference point falls in the unit cell. This is useful to transform a whole chain at once, allowing some of the atoms to be outside the unit cell, but forcing the centroid to be within it. @param p...
java
public void transfToOriginCell(Tuple3d[] points, Tuple3d reference) { reference = new Point3d(reference);//clone transfToCrystal(reference); int x = (int)Math.floor(reference.x); int y = (int)Math.floor(reference.y); int z = (int)Math.floor(reference.z); for( Tuple3d point: points ) { transfToCrystal(p...
[ "public", "void", "transfToOriginCell", "(", "Tuple3d", "[", "]", "points", ",", "Tuple3d", "reference", ")", "{", "reference", "=", "new", "Point3d", "(", "reference", ")", ";", "//clone", "transfToCrystal", "(", "reference", ")", ";", "int", "x", "=", "(...
Converts a set of points so that the reference point falls in the unit cell. This is useful to transform a whole chain at once, allowing some of the atoms to be outside the unit cell, but forcing the centroid to be within it. @param points A set of points to transform (in orthonormal coordinates) @param reference The...
[ "Converts", "a", "set", "of", "points", "so", "that", "the", "reference", "point", "falls", "in", "the", "unit", "cell", "." ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalCell.java#L191-L206
GeoLatte/geolatte-common
src/main/java/org/geolatte/common/dataformats/json/jackson/DefaultFeature.java
DefaultFeature.setGeometry
public void setGeometry(String name, Geometry value) { """ Sets the geometry property of the feature. This method also allows wiping the current geometry by setting the name of the property to null. The value will in that case be ignored. @param name the name of the geometry property, or null if the geometry pro...
java
public void setGeometry(String name, Geometry value) { if (name == null) { geomPropertyName = null; geomValue = null; } else { geomPropertyName= name; geomValue = value; } }
[ "public", "void", "setGeometry", "(", "String", "name", ",", "Geometry", "value", ")", "{", "if", "(", "name", "==", "null", ")", "{", "geomPropertyName", "=", "null", ";", "geomValue", "=", "null", ";", "}", "else", "{", "geomPropertyName", "=", "name",...
Sets the geometry property of the feature. This method also allows wiping the current geometry by setting the name of the property to null. The value will in that case be ignored. @param name the name of the geometry property, or null if the geometry property is to be wiped @param value the value of the geometry proper...
[ "Sets", "the", "geometry", "property", "of", "the", "feature", ".", "This", "method", "also", "allows", "wiping", "the", "current", "geometry", "by", "setting", "the", "name", "of", "the", "property", "to", "null", ".", "The", "value", "will", "in", "that"...
train
https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/DefaultFeature.java#L79-L91
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Keyspace.java
Keyspace.clearSnapshot
public static void clearSnapshot(String snapshotName, String keyspace) { """ Clear all the snapshots for a given keyspace. @param snapshotName the user supplied snapshot name. It empty or null, all the snapshots will be cleaned """ List<File> snapshotDirs = Directories.getKSChildDirectories(keyspac...
java
public static void clearSnapshot(String snapshotName, String keyspace) { List<File> snapshotDirs = Directories.getKSChildDirectories(keyspace); Directories.clearSnapshot(snapshotName, snapshotDirs); }
[ "public", "static", "void", "clearSnapshot", "(", "String", "snapshotName", ",", "String", "keyspace", ")", "{", "List", "<", "File", ">", "snapshotDirs", "=", "Directories", ".", "getKSChildDirectories", "(", "keyspace", ")", ";", "Directories", ".", "clearSnap...
Clear all the snapshots for a given keyspace. @param snapshotName the user supplied snapshot name. It empty or null, all the snapshots will be cleaned
[ "Clear", "all", "the", "snapshots", "for", "a", "given", "keyspace", "." ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Keyspace.java#L250-L254
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java
JsonStringToJsonIntermediateConverter.parseJsonArrayType
private JsonElement parseJsonArrayType(JsonSchema schema, JsonElement value) throws DataConversionException { """ Parses JsonArray type values @param schema @param value @return @throws DataConversionException """ Type arrayType = schema.getTypeOfArrayItems(); JsonArray tempArray = new JsonAr...
java
private JsonElement parseJsonArrayType(JsonSchema schema, JsonElement value) throws DataConversionException { Type arrayType = schema.getTypeOfArrayItems(); JsonArray tempArray = new JsonArray(); if (Type.isPrimitive(arrayType)) { return value; } JsonSchema nestedSchema = schema.getItems...
[ "private", "JsonElement", "parseJsonArrayType", "(", "JsonSchema", "schema", ",", "JsonElement", "value", ")", "throws", "DataConversionException", "{", "Type", "arrayType", "=", "schema", ".", "getTypeOfArrayItems", "(", ")", ";", "JsonArray", "tempArray", "=", "ne...
Parses JsonArray type values @param schema @param value @return @throws DataConversionException
[ "Parses", "JsonArray", "type", "values" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/converter/json/JsonStringToJsonIntermediateConverter.java#L183-L195
SvenEwald/xmlbeam
src/main/java/org/xmlbeam/util/intern/DOMHelper.java
DOMHelper.fillNSMapWithPrefixesDeclaredInElement
private static void fillNSMapWithPrefixesDeclaredInElement(final Map<String, String> nsMap, final Element element) throws DOMException { """ Search for prefix definitions in element and all children. There still is an issue for documents that use the same prefix on differen namespaces in disjunct subtrees. This m...
java
private static void fillNSMapWithPrefixesDeclaredInElement(final Map<String, String> nsMap, final Element element) throws DOMException { NamedNodeMap attributes = element.getAttributes(); for (int i = 0; i < attributes.getLength(); i++) { Node attribute = attributes.item(i); if (...
[ "private", "static", "void", "fillNSMapWithPrefixesDeclaredInElement", "(", "final", "Map", "<", "String", ",", "String", ">", "nsMap", ",", "final", "Element", "element", ")", "throws", "DOMException", "{", "NamedNodeMap", "attributes", "=", "element", ".", "getA...
Search for prefix definitions in element and all children. There still is an issue for documents that use the same prefix on differen namespaces in disjunct subtrees. This might be possible but we won't support this. Same is with declaring multiple default namespaces. XMLBeams behaviour will be undefined in that case. ...
[ "Search", "for", "prefix", "definitions", "in", "element", "and", "all", "children", ".", "There", "still", "is", "an", "issue", "for", "documents", "that", "use", "the", "same", "prefix", "on", "differen", "namespaces", "in", "disjunct", "subtrees", ".", "T...
train
https://github.com/SvenEwald/xmlbeam/blob/acaac1b8fa28d246f17187f5e3c6696458a0b447/src/main/java/org/xmlbeam/util/intern/DOMHelper.java#L125-L145
azkaban/azkaban
az-core/src/main/java/azkaban/utils/PropsUtils.java
PropsUtils.loadProps
public static Props loadProps(final Props parent, final File... propFiles) { """ Load Props @param parent parent prop @param propFiles prop files @return constructed new Prop """ try { Props props = new Props(parent); for (final File f : propFiles) { if (f.isFile()) { pro...
java
public static Props loadProps(final Props parent, final File... propFiles) { try { Props props = new Props(parent); for (final File f : propFiles) { if (f.isFile()) { props = new Props(props, f); } } return props; } catch (final IOException e) { throw new...
[ "public", "static", "Props", "loadProps", "(", "final", "Props", "parent", ",", "final", "File", "...", "propFiles", ")", "{", "try", "{", "Props", "props", "=", "new", "Props", "(", "parent", ")", ";", "for", "(", "final", "File", "f", ":", "propFiles...
Load Props @param parent parent prop @param propFiles prop files @return constructed new Prop
[ "Load", "Props" ]
train
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L99-L112
line/armeria
core/src/main/java/com/linecorp/armeria/client/Clients.java
Clients.newClient
public static <T> T newClient(String uri, Class<T> clientType, ClientOptions options) { """ Creates a new client that connects to the specified {@code uri} using the default {@link ClientFactory}. @param uri the URI of the server endpoint @param clientType the type of the new client @param options the {@link...
java
public static <T> T newClient(String uri, Class<T> clientType, ClientOptions options) { return newClient(ClientFactory.DEFAULT, uri, clientType, options); }
[ "public", "static", "<", "T", ">", "T", "newClient", "(", "String", "uri", ",", "Class", "<", "T", ">", "clientType", ",", "ClientOptions", "options", ")", "{", "return", "newClient", "(", "ClientFactory", ".", "DEFAULT", ",", "uri", ",", "clientType", "...
Creates a new client that connects to the specified {@code uri} using the default {@link ClientFactory}. @param uri the URI of the server endpoint @param clientType the type of the new client @param options the {@link ClientOptions} @throws IllegalArgumentException if the scheme of the specified {@code uri} or the sp...
[ "Creates", "a", "new", "client", "that", "connects", "to", "the", "specified", "{", "@code", "uri", "}", "using", "the", "default", "{", "@link", "ClientFactory", "}", "." ]
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/Clients.java#L67-L69
EsfingeFramework/ClassMock
ClassMock/src/main/java/net/sf/esfinge/classmock/ClassMockUtils.java
ClassMockUtils.get
public static Object get(final Object bean, final String property) { """ Access the value in the property of the bean. @param bean to inspect @param property the name of the property to be access @return the value """ try { if (property.indexOf(".") >= 0) { final Ob...
java
public static Object get(final Object bean, final String property) { try { if (property.indexOf(".") >= 0) { final Object subBean = ClassMockUtils.get(bean, property.substring(0, property.indexOf("."))); if (subBean == null) { return null; ...
[ "public", "static", "Object", "get", "(", "final", "Object", "bean", ",", "final", "String", "property", ")", "{", "try", "{", "if", "(", "property", ".", "indexOf", "(", "\".\"", ")", ">=", "0", ")", "{", "final", "Object", "subBean", "=", "ClassMockU...
Access the value in the property of the bean. @param bean to inspect @param property the name of the property to be access @return the value
[ "Access", "the", "value", "in", "the", "property", "of", "the", "bean", "." ]
train
https://github.com/EsfingeFramework/ClassMock/blob/a354c9dc68e8813fc4e995eef13e34796af58892/ClassMock/src/main/java/net/sf/esfinge/classmock/ClassMockUtils.java#L24-L55
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java
DiskClient.resizeDisk
@BetaApi public final Operation resizeDisk(String disk, DisksResizeRequest disksResizeRequestResource) { """ Resizes the specified persistent disk. You can only increase the size of the disk. <p>Sample code: <pre><code> try (DiskClient diskClient = DiskClient.create()) { ProjectZoneDiskName disk = Projec...
java
@BetaApi public final Operation resizeDisk(String disk, DisksResizeRequest disksResizeRequestResource) { ResizeDiskHttpRequest request = ResizeDiskHttpRequest.newBuilder() .setDisk(disk) .setDisksResizeRequestResource(disksResizeRequestResource) .build(); return re...
[ "@", "BetaApi", "public", "final", "Operation", "resizeDisk", "(", "String", "disk", ",", "DisksResizeRequest", "disksResizeRequestResource", ")", "{", "ResizeDiskHttpRequest", "request", "=", "ResizeDiskHttpRequest", ".", "newBuilder", "(", ")", ".", "setDisk", "(", ...
Resizes the specified persistent disk. You can only increase the size of the disk. <p>Sample code: <pre><code> try (DiskClient diskClient = DiskClient.create()) { ProjectZoneDiskName disk = ProjectZoneDiskName.of("[PROJECT]", "[ZONE]", "[DISK]"); DisksResizeRequest disksResizeRequestResource = DisksResizeRequest.newB...
[ "Resizes", "the", "specified", "persistent", "disk", ".", "You", "can", "only", "increase", "the", "size", "of", "the", "disk", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/DiskClient.java#L1020-L1029
jenkinsci/multi-branch-project-plugin
src/main/java/com/github/mjdetullio/jenkins/plugins/multibranch/TemplateDrivenMultiBranchProject.java
TemplateDrivenMultiBranchProject.initViews
@Override protected void initViews(List<View> views) throws IOException { """ Overrides view initialization to use BranchListView instead of AllView. <br> {@inheritDoc} """ BranchListView v = new BranchListView("All", this); v.setIncludeRegex(".*"); views.add(v); v.save();...
java
@Override protected void initViews(List<View> views) throws IOException { BranchListView v = new BranchListView("All", this); v.setIncludeRegex(".*"); views.add(v); v.save(); }
[ "@", "Override", "protected", "void", "initViews", "(", "List", "<", "View", ">", "views", ")", "throws", "IOException", "{", "BranchListView", "v", "=", "new", "BranchListView", "(", "\"All\"", ",", "this", ")", ";", "v", ".", "setIncludeRegex", "(", "\"....
Overrides view initialization to use BranchListView instead of AllView. <br> {@inheritDoc}
[ "Overrides", "view", "initialization", "to", "use", "BranchListView", "instead", "of", "AllView", ".", "<br", ">", "{" ]
train
https://github.com/jenkinsci/multi-branch-project-plugin/blob/a98828f6b5ea4e0f69a83f3d274fe05063caad52/src/main/java/com/github/mjdetullio/jenkins/plugins/multibranch/TemplateDrivenMultiBranchProject.java#L163-L169
Azure/azure-sdk-for-java
mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ConfigurationsInner.java
ConfigurationsInner.listByServerAsync
public Observable<List<ConfigurationInner>> listByServerAsync(String resourceGroupName, String serverName) { """ List all the configurations in a given server. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the...
java
public Observable<List<ConfigurationInner>> listByServerAsync(String resourceGroupName, String serverName) { return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<ConfigurationInner>>, List<ConfigurationInner>>() { @Override public ...
[ "public", "Observable", "<", "List", "<", "ConfigurationInner", ">", ">", "listByServerAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ")", "{", "return", "listByServerWithServiceResponseAsync", "(", "resourceGroupName", ",", "serverName", ")", ...
List all the configurations in a given server. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @throws IllegalArgumentException thrown if parameters fail the valida...
[ "List", "all", "the", "configurations", "in", "a", "given", "server", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ConfigurationsInner.java#L390-L397
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/KafkaClient.java
KafkaClient.sendMessageRaw
public Future<RecordMetadata> sendMessageRaw(ProducerType type, KafkaMessage message) { """ Sends a message asynchronously, specifying {@link ProducerType}. <p> This methods returns the underlying Kafka producer's output directly to caller, not converting {@link RecordMetadata} to {@link KafkaMessage}. </p> ...
java
public Future<RecordMetadata> sendMessageRaw(ProducerType type, KafkaMessage message) { return sendMessageRaw(DEFAULT_PRODUCER_TYPE, message, null); }
[ "public", "Future", "<", "RecordMetadata", ">", "sendMessageRaw", "(", "ProducerType", "type", ",", "KafkaMessage", "message", ")", "{", "return", "sendMessageRaw", "(", "DEFAULT_PRODUCER_TYPE", ",", "message", ",", "null", ")", ";", "}" ]
Sends a message asynchronously, specifying {@link ProducerType}. <p> This methods returns the underlying Kafka producer's output directly to caller, not converting {@link RecordMetadata} to {@link KafkaMessage}. </p> @param type @param message @return @since 1.3.1
[ "Sends", "a", "message", "asynchronously", "specifying", "{", "@link", "ProducerType", "}", "." ]
train
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/KafkaClient.java#L796-L798
UrielCh/ovh-java-sdk
ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java
ApiOvhPackxdsl.packName_exchangeAccount_services_domain_GET
public OvhExchangeAccountService packName_exchangeAccount_services_domain_GET(String packName, String domain) throws IOException { """ Get this object properties REST: GET /pack/xdsl/{packName}/exchangeAccount/services/{domain} @param packName [required] The internal name of your pack @param domain [required]...
java
public OvhExchangeAccountService packName_exchangeAccount_services_domain_GET(String packName, String domain) throws IOException { String qPath = "/pack/xdsl/{packName}/exchangeAccount/services/{domain}"; StringBuilder sb = path(qPath, packName, domain); String resp = exec(qPath, "GET", sb.toString(), null); re...
[ "public", "OvhExchangeAccountService", "packName_exchangeAccount_services_domain_GET", "(", "String", "packName", ",", "String", "domain", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/pack/xdsl/{packName}/exchangeAccount/services/{domain}\"", ";", "StringBuilder...
Get this object properties REST: GET /pack/xdsl/{packName}/exchangeAccount/services/{domain} @param packName [required] The internal name of your pack @param domain [required]
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L675-L680
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/task/TaskUtils.java
TaskUtils.getTaskFactory
public static Optional<TaskFactory> getTaskFactory(State state) { """ Parse the {@link TaskFactory} in the state if one is defined. """ try { if (state.contains(TASK_FACTORY_CLASS)) { return Optional.of((TaskFactory) Class.forName(state.getProp(TASK_FACTORY_CLASS)).newInstance()); } els...
java
public static Optional<TaskFactory> getTaskFactory(State state) { try { if (state.contains(TASK_FACTORY_CLASS)) { return Optional.of((TaskFactory) Class.forName(state.getProp(TASK_FACTORY_CLASS)).newInstance()); } else { return Optional.absent(); } } catch (ReflectiveOperationE...
[ "public", "static", "Optional", "<", "TaskFactory", ">", "getTaskFactory", "(", "State", "state", ")", "{", "try", "{", "if", "(", "state", ".", "contains", "(", "TASK_FACTORY_CLASS", ")", ")", "{", "return", "Optional", ".", "of", "(", "(", "TaskFactory",...
Parse the {@link TaskFactory} in the state if one is defined.
[ "Parse", "the", "{" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/task/TaskUtils.java#L35-L45
HiddenStage/divide
Shared/src/main/java/io/divide/shared/transitory/TransientObject.java
TransientObject.get
public <O> O get(Class<O> clazz, String key) { """ Retrieve a specific element from this object. @param clazz type of object to be retrieved. If type given does not match a classcast exception will be thrown. @param key key of object to be retrieved. @return element of type specified corrosponding to the given ...
java
public <O> O get(Class<O> clazz, String key){ // canWrite(); TODO disabled for now Object o = null; try{ o = user_data.get(key); return clazz.cast( o ); } catch (Exception e){ e.printStackTrace(); System.out.println("Get(" + clazz.getSimpleN...
[ "public", "<", "O", ">", "O", "get", "(", "Class", "<", "O", ">", "clazz", ",", "String", "key", ")", "{", "// canWrite(); TODO disabled for now", "Object", "o", "=", "null", ";", "try", "{", "o", "=", "user_data", ".", "get", "(", "key", ")", ...
Retrieve a specific element from this object. @param clazz type of object to be retrieved. If type given does not match a classcast exception will be thrown. @param key key of object to be retrieved. @return element of type specified corrosponding to the given key.
[ "Retrieve", "a", "specific", "element", "from", "this", "object", "." ]
train
https://github.com/HiddenStage/divide/blob/14e36598c50d92b4393e6649915e32b86141c598/Shared/src/main/java/io/divide/shared/transitory/TransientObject.java#L228-L240
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java
SARLRuntime.isUnpackedSRE
public static boolean isUnpackedSRE(File directory) { """ Replies if the given directory contains a SRE. @param directory the directory. @return <code>true</code> if the given directory contains a SRE. Otherwise <code>false</code>. @see #isPackedSRE(File) """ File manifestFile = new File(directory, "MET...
java
public static boolean isUnpackedSRE(File directory) { File manifestFile = new File(directory, "META-INF"); //$NON-NLS-1$ manifestFile = new File(manifestFile, "MANIFEST.MF"); //$NON-NLS-1$ if (manifestFile.canRead()) { try (InputStream manifestStream = new FileInputStream(manifestFile)) { final Manifest ma...
[ "public", "static", "boolean", "isUnpackedSRE", "(", "File", "directory", ")", "{", "File", "manifestFile", "=", "new", "File", "(", "directory", ",", "\"META-INF\"", ")", ";", "//$NON-NLS-1$", "manifestFile", "=", "new", "File", "(", "manifestFile", ",", "\"M...
Replies if the given directory contains a SRE. @param directory the directory. @return <code>true</code> if the given directory contains a SRE. Otherwise <code>false</code>. @see #isPackedSRE(File)
[ "Replies", "if", "the", "given", "directory", "contains", "a", "SRE", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L870-L891
alibaba/otter
shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/zookeeper/TransformZooKeeperArbitrateEvent.java
TransformZooKeeperArbitrateEvent.await
public EtlEventData await(Long pipelineId) throws InterruptedException { """ <pre> 算法: 1. 检查当前的Permit,阻塞等待其授权(解决Channel的pause状态处理) 2. 开始阻塞获取符合条件的processId 3. 检查当前的即时Permit状态 (在阻塞获取processId过程会出现一些error信号,process节点会被删除) 4. 获取Select传递的EventData数据,添加next node信息后直接返回 </pre> @return """ Assert.notN...
java
public EtlEventData await(Long pipelineId) throws InterruptedException { Assert.notNull(pipelineId); PermitMonitor permitMonitor = ArbitrateFactory.getInstance(pipelineId, PermitMonitor.class); permitMonitor.waitForPermit();// 阻塞等待授权 TransformStageListener transformStageListener = Arbit...
[ "public", "EtlEventData", "await", "(", "Long", "pipelineId", ")", "throws", "InterruptedException", "{", "Assert", ".", "notNull", "(", "pipelineId", ")", ";", "PermitMonitor", "permitMonitor", "=", "ArbitrateFactory", ".", "getInstance", "(", "pipelineId", ",", ...
<pre> 算法: 1. 检查当前的Permit,阻塞等待其授权(解决Channel的pause状态处理) 2. 开始阻塞获取符合条件的processId 3. 检查当前的即时Permit状态 (在阻塞获取processId过程会出现一些error信号,process节点会被删除) 4. 获取Select传递的EventData数据,添加next node信息后直接返回 </pre> @return
[ "<pre", ">", "算法", ":", "1", ".", "检查当前的Permit,阻塞等待其授权", "(", "解决Channel的pause状态处理", ")", "2", ".", "开始阻塞获取符合条件的processId", "3", ".", "检查当前的即时Permit状态", "(", "在阻塞获取processId过程会出现一些error信号", "process节点会被删除", ")", "4", ".", "获取Select传递的EventData数据,添加next", "node信息后直接返回", ...
train
https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/arbitrate/src/main/java/com/alibaba/otter/shared/arbitrate/impl/setl/zookeeper/TransformZooKeeperArbitrateEvent.java#L62-L96
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/content/DocumentTypeUrl.java
DocumentTypeUrl.getDocumentTypeUrl
public static MozuUrl getDocumentTypeUrl(String documentTypeName, String responseFields) { """ Get Resource Url for GetDocumentType @param documentTypeName The name of the document type to retrieve. @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned...
java
public static MozuUrl getDocumentTypeUrl(String documentTypeName, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/content/documenttypes/{documentTypeName}?responseFields={responseFields}"); formatter.formatUrl("documentTypeName", documentTypeName); formatter.formatUrl("responseFields...
[ "public", "static", "MozuUrl", "getDocumentTypeUrl", "(", "String", "documentTypeName", ",", "String", "responseFields", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/content/documenttypes/{documentTypeName}?responseFields={responseFields}\"", ...
Get Resource Url for GetDocumentType @param documentTypeName The name of the document type to retrieve. @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data ...
[ "Get", "Resource", "Url", "for", "GetDocumentType" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/content/DocumentTypeUrl.java#L38-L44
rwl/CSparseJ
src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_pvec.java
DZcs_pvec.cs_pvec
public static boolean cs_pvec(int [] p, DZcsa b, DZcsa x, int n) { """ Permutes a vector, x=P*b, for dense vectors x and b. @param p permutation vector, p=null denotes identity @param b input vector @param x output vector, x=P*b @param n length of p, b and x @return true if successful, false otherwise ...
java
public static boolean cs_pvec(int [] p, DZcsa b, DZcsa x, int n) { int k ; if (x == null || b == null) return (false) ; /* check inputs */ for (k = 0 ; k < n ; k++) x.set(k, b.get(p != null ? p [k] : k)) ; return (true) ; }
[ "public", "static", "boolean", "cs_pvec", "(", "int", "[", "]", "p", ",", "DZcsa", "b", ",", "DZcsa", "x", ",", "int", "n", ")", "{", "int", "k", ";", "if", "(", "x", "==", "null", "||", "b", "==", "null", ")", "return", "(", "false", ")", ";...
Permutes a vector, x=P*b, for dense vectors x and b. @param p permutation vector, p=null denotes identity @param b input vector @param x output vector, x=P*b @param n length of p, b and x @return true if successful, false otherwise
[ "Permutes", "a", "vector", "x", "=", "P", "*", "b", "for", "dense", "vectors", "x", "and", "b", "." ]
train
https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_pvec.java#L51-L57
m-m-m/util
event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java
AbstractEventBus.handleErrors
protected void handleErrors(Collection<Throwable> errors, Object event) { """ This method is called if errors occurred while dispatching events. @param errors is the {@link Collection} with the errors. Will NOT be {@link Collection#isEmpty() empty}. @param event is the event that has been send and caused the e...
java
protected void handleErrors(Collection<Throwable> errors, Object event) { if (this.globalExceptionHandler == null) { for (Throwable error : errors) { LOG.error("Failed to dispatch event {}", event, error); } } else { this.globalExceptionHandler.handleErrors(event, errors.toArray(new T...
[ "protected", "void", "handleErrors", "(", "Collection", "<", "Throwable", ">", "errors", ",", "Object", "event", ")", "{", "if", "(", "this", ".", "globalExceptionHandler", "==", "null", ")", "{", "for", "(", "Throwable", "error", ":", "errors", ")", "{", ...
This method is called if errors occurred while dispatching events. @param errors is the {@link Collection} with the errors. Will NOT be {@link Collection#isEmpty() empty}. @param event is the event that has been send and caused the errors.
[ "This", "method", "is", "called", "if", "errors", "occurred", "while", "dispatching", "events", "." ]
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java#L161-L170
Azure/azure-sdk-for-java
sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java
DatabasesInner.beginPauseAsync
public Observable<DatabaseInner> beginPauseAsync(String resourceGroupName, String serverName, String databaseName) { """ Pauses a database. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param ser...
java
public Observable<DatabaseInner> beginPauseAsync(String resourceGroupName, String serverName, String databaseName) { return beginPauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DatabaseInner>, DatabaseInner>() { @Override public Da...
[ "public", "Observable", "<", "DatabaseInner", ">", "beginPauseAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "databaseName", ")", "{", "return", "beginPauseWithServiceResponseAsync", "(", "resourceGroupName", ",", "serverName", "...
Pauses a database. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param databaseName The name of the database to be paused. @throws IllegalArgumentException throw...
[ "Pauses", "a", "database", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java#L1201-L1208
zk1931/jzab
src/main/java/com/github/zk1931/jzab/SimpleLog.java
SimpleLog.firstDivergingPoint
@Override public DivergingTuple firstDivergingPoint(Zxid zxid) throws IOException { """ See {@link Log#firstDivergingPoint}. @param zxid the id of the transaction. @return a tuple holds first diverging zxid and an iterator points to subsequent transactions. @throws IOException in case of IO failures ""...
java
@Override public DivergingTuple firstDivergingPoint(Zxid zxid) throws IOException { SimpleLogIterator iter = (SimpleLogIterator)getIterator(Zxid.ZXID_NOT_EXIST); Zxid prevZxid = Zxid.ZXID_NOT_EXIST; while (iter.hasNext()) { Zxid curZxid = iter.next().getZxid(); if (curZxid.compareTo(zxid...
[ "@", "Override", "public", "DivergingTuple", "firstDivergingPoint", "(", "Zxid", "zxid", ")", "throws", "IOException", "{", "SimpleLogIterator", "iter", "=", "(", "SimpleLogIterator", ")", "getIterator", "(", "Zxid", ".", "ZXID_NOT_EXIST", ")", ";", "Zxid", "prevZ...
See {@link Log#firstDivergingPoint}. @param zxid the id of the transaction. @return a tuple holds first diverging zxid and an iterator points to subsequent transactions. @throws IOException in case of IO failures
[ "See", "{", "@link", "Log#firstDivergingPoint", "}", "." ]
train
https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/SimpleLog.java#L246-L263
opsmatters/opsmatters-core
src/main/java/com/opsmatters/core/util/FormatUtilities.java
FormatUtilities.getFormattedDateTime
static public String getFormattedDateTime(long dt, TimeZone tz, String country) { """ Returns the given date formatted as "dd-MM-yyyy HH:mm:ss" in the given timezone and country. @param dt The date to be formatted @param tz The timezone associated with the date @param country The country associated with the dat...
java
static public String getFormattedDateTime(long dt, TimeZone tz, String country) { return getFormattedDateTime(dt, DATETIME_FORMAT, tz, country, 0L); }
[ "static", "public", "String", "getFormattedDateTime", "(", "long", "dt", ",", "TimeZone", "tz", ",", "String", "country", ")", "{", "return", "getFormattedDateTime", "(", "dt", ",", "DATETIME_FORMAT", ",", "tz", ",", "country", ",", "0L", ")", ";", "}" ]
Returns the given date formatted as "dd-MM-yyyy HH:mm:ss" in the given timezone and country. @param dt The date to be formatted @param tz The timezone associated with the date @param country The country associated with the date @return The given date formatted as "dd-MM-yyyy HH:mm:ss" in the given timezone and country
[ "Returns", "the", "given", "date", "formatted", "as", "dd", "-", "MM", "-", "yyyy", "HH", ":", "mm", ":", "ss", "in", "the", "given", "timezone", "and", "country", "." ]
train
https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/FormatUtilities.java#L180-L183
mgormley/prim
src/main/java/edu/jhu/prim/map/IntObjectHashMap.java
IntObjectHashMap.containsKey
private boolean containsKey(final int key, final int index) { """ Check if the tables contain an element associated with specified key at specified index. @param key key to check @param index index to check @return true if an element is associated with key at index """ return (key != 0 || states[in...
java
private boolean containsKey(final int key, final int index) { return (key != 0 || states[index] == FULL) && keys[index] == key; }
[ "private", "boolean", "containsKey", "(", "final", "int", "key", ",", "final", "int", "index", ")", "{", "return", "(", "key", "!=", "0", "||", "states", "[", "index", "]", "==", "FULL", ")", "&&", "keys", "[", "index", "]", "==", "key", ";", "}" ]
Check if the tables contain an element associated with specified key at specified index. @param key key to check @param index index to check @return true if an element is associated with key at index
[ "Check", "if", "the", "tables", "contain", "an", "element", "associated", "with", "specified", "key", "at", "specified", "index", "." ]
train
https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/map/IntObjectHashMap.java#L402-L404
liyiorg/weixin-popular
src/main/java/weixin/popular/api/MediaAPI.java
MediaAPI.mediaUploadvideo
public static Media mediaUploadvideo(String access_token,Uploadvideo uploadvideo) { """ 高级群发 构成 MassMPvideoMessage 对象的前置请求接口 @param access_token access_token @param uploadvideo uploadvideo @return Media """ String messageJson = JsonUtil.toJSONString(uploadvideo); HttpUriRequest httpUriRequest = RequestB...
java
public static Media mediaUploadvideo(String access_token,Uploadvideo uploadvideo){ String messageJson = JsonUtil.toJSONString(uploadvideo); HttpUriRequest httpUriRequest = RequestBuilder.post() .setHeader(jsonHeader) //2.8.20 修改URI 原URI MEDIA_URI+"/cgi-bin/media/uploadvideo" .setUri(B...
[ "public", "static", "Media", "mediaUploadvideo", "(", "String", "access_token", ",", "Uploadvideo", "uploadvideo", ")", "{", "String", "messageJson", "=", "JsonUtil", ".", "toJSONString", "(", "uploadvideo", ")", ";", "HttpUriRequest", "httpUriRequest", "=", "Reques...
高级群发 构成 MassMPvideoMessage 对象的前置请求接口 @param access_token access_token @param uploadvideo uploadvideo @return Media
[ "高级群发", "构成", "MassMPvideoMessage", "对象的前置请求接口" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/MediaAPI.java#L300-L310
cdk/cdk
base/silent/src/main/java/org/openscience/cdk/silent/Reaction.java
Reaction.setProductCoefficient
@Override public boolean setProductCoefficient(IAtomContainer product, Double coefficient) { """ Sets the coefficient of a a product to a given value. @param product Product for which the coefficient is set @param coefficient The new coefficient for the given product @return true if Molecule has ...
java
@Override public boolean setProductCoefficient(IAtomContainer product, Double coefficient) { boolean result = products.setMultiplier(product, coefficient); return result; }
[ "@", "Override", "public", "boolean", "setProductCoefficient", "(", "IAtomContainer", "product", ",", "Double", "coefficient", ")", "{", "boolean", "result", "=", "products", ".", "setMultiplier", "(", "product", ",", "coefficient", ")", ";", "return", "result", ...
Sets the coefficient of a a product to a given value. @param product Product for which the coefficient is set @param coefficient The new coefficient for the given product @return true if Molecule has been found and stoichiometry has been set. @see #getProductCoefficient
[ "Sets", "the", "coefficient", "of", "a", "a", "product", "to", "a", "given", "value", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/Reaction.java#L323-L327
apiman/apiman
gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/AbstractMappedPolicy.java
AbstractMappedPolicy.doProcessFailure
protected void doProcessFailure(PolicyFailure failure, IPolicyContext context, C config, IPolicyFailureChain chain) { """ Override if you wish to modify a failure. @see IPolicy#processFailure(PolicyFailure, IPolicyContext, Object) """ chain.doFailure(failure); }
java
protected void doProcessFailure(PolicyFailure failure, IPolicyContext context, C config, IPolicyFailureChain chain) { chain.doFailure(failure); }
[ "protected", "void", "doProcessFailure", "(", "PolicyFailure", "failure", ",", "IPolicyContext", "context", ",", "C", "config", ",", "IPolicyFailureChain", "chain", ")", "{", "chain", ".", "doFailure", "(", "failure", ")", ";", "}" ]
Override if you wish to modify a failure. @see IPolicy#processFailure(PolicyFailure, IPolicyContext, Object)
[ "Override", "if", "you", "wish", "to", "modify", "a", "failure", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/policies/src/main/java/io/apiman/gateway/engine/policies/AbstractMappedPolicy.java#L116-L118
carewebframework/carewebframework-core
org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/BaseMojo.java
BaseMojo.newStagingFile
public File newStagingFile(String entryName, long modTime) { """ Creates a new file in the staging directory. Ensures that all folders in the path are also created. @param entryName Entry name to create. @param modTime Modification timestamp for the new entry. If 0, defaults to the current time. @return the ...
java
public File newStagingFile(String entryName, long modTime) { File file = new File(stagingDirectory, entryName); if (modTime != 0) { file.setLastModified(modTime); } file.getParentFile().mkdirs(); return file; }
[ "public", "File", "newStagingFile", "(", "String", "entryName", ",", "long", "modTime", ")", "{", "File", "file", "=", "new", "File", "(", "stagingDirectory", ",", "entryName", ")", ";", "if", "(", "modTime", "!=", "0", ")", "{", "file", ".", "setLastMod...
Creates a new file in the staging directory. Ensures that all folders in the path are also created. @param entryName Entry name to create. @param modTime Modification timestamp for the new entry. If 0, defaults to the current time. @return the new file
[ "Creates", "a", "new", "file", "in", "the", "staging", "directory", ".", "Ensures", "that", "all", "folders", "in", "the", "path", "are", "also", "created", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/BaseMojo.java#L217-L226
pedrovgs/Nox
nox/src/main/java/com/github/pedrovgs/nox/NoxItemCatalog.java
NoxItemCatalog.getImageLoaderListener
private ImageLoader.Listener getImageLoaderListener(final int position) { """ Returns the ImageLoader.Listener associated to a NoxItem given a position. If the ImageLoader.Listener wasn't previously created, creates a new instance. """ if (listeners[position] == null) { listeners[position] = new Nox...
java
private ImageLoader.Listener getImageLoaderListener(final int position) { if (listeners[position] == null) { listeners[position] = new NoxItemCatalogImageLoaderListener(position, this); } return listeners[position]; }
[ "private", "ImageLoader", ".", "Listener", "getImageLoaderListener", "(", "final", "int", "position", ")", "{", "if", "(", "listeners", "[", "position", "]", "==", "null", ")", "{", "listeners", "[", "position", "]", "=", "new", "NoxItemCatalogImageLoaderListene...
Returns the ImageLoader.Listener associated to a NoxItem given a position. If the ImageLoader.Listener wasn't previously created, creates a new instance.
[ "Returns", "the", "ImageLoader", ".", "Listener", "associated", "to", "a", "NoxItem", "given", "a", "position", ".", "If", "the", "ImageLoader", ".", "Listener", "wasn", "t", "previously", "created", "creates", "a", "new", "instance", "." ]
train
https://github.com/pedrovgs/Nox/blob/b4dfe37895e1b7bf2084d60139931dd4fb12f3f4/nox/src/main/java/com/github/pedrovgs/nox/NoxItemCatalog.java#L250-L255
jsurfer/JsonSurfer
jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java
JsonSurfer.collectAll
@Deprecated public Collection<Object> collectAll(Reader reader, String... paths) { """ Collect all matched value into a collection @param reader Json reader @param paths JsonPath @return values @deprecated use {@link #collectAll(InputStream, String...)} instead """ return collectAll(reader, ...
java
@Deprecated public Collection<Object> collectAll(Reader reader, String... paths) { return collectAll(reader, compile(paths)); }
[ "@", "Deprecated", "public", "Collection", "<", "Object", ">", "collectAll", "(", "Reader", "reader", ",", "String", "...", "paths", ")", "{", "return", "collectAll", "(", "reader", ",", "compile", "(", "paths", ")", ")", ";", "}" ]
Collect all matched value into a collection @param reader Json reader @param paths JsonPath @return values @deprecated use {@link #collectAll(InputStream, String...)} instead
[ "Collect", "all", "matched", "value", "into", "a", "collection" ]
train
https://github.com/jsurfer/JsonSurfer/blob/52bd75a453338b86e115092803da140bf99cee62/jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java#L301-L304
raydac/java-binary-block-parser
jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java
JBBPUtils.arrayStartsWith
public static boolean arrayStartsWith(final byte[] array, final byte[] str) { """ Check that a byte array starts with some byte values. @param array array to be checked, must not be null @param str a byte string which will be checked as the start sequence of the array, must not be null @return true if the ...
java
public static boolean arrayStartsWith(final byte[] array, final byte[] str) { boolean result = false; if (array.length >= str.length) { result = true; int index = str.length; while (--index >= 0) { if (array[index] != str[index]) { result = false; break; } ...
[ "public", "static", "boolean", "arrayStartsWith", "(", "final", "byte", "[", "]", "array", ",", "final", "byte", "[", "]", "str", ")", "{", "boolean", "result", "=", "false", ";", "if", "(", "array", ".", "length", ">=", "str", ".", "length", ")", "{...
Check that a byte array starts with some byte values. @param array array to be checked, must not be null @param str a byte string which will be checked as the start sequence of the array, must not be null @return true if the string is the start sequence of the array, false otherwise @throws NullPointerException if a...
[ "Check", "that", "a", "byte", "array", "starts", "with", "some", "byte", "values", "." ]
train
https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java#L915-L928
RestDocArchive/restdoc-api
src/main/java/org/restdoc/api/util/RestDocObject.java
RestDocObject.setAdditionalField
@JsonAnySetter public void setAdditionalField(final String key, final Object value) { """ Add additional field @param key the field name @param value the field value """ this.additionalFields.put(key, value); }
java
@JsonAnySetter public void setAdditionalField(final String key, final Object value) { this.additionalFields.put(key, value); }
[ "@", "JsonAnySetter", "public", "void", "setAdditionalField", "(", "final", "String", "key", ",", "final", "Object", "value", ")", "{", "this", ".", "additionalFields", ".", "put", "(", "key", ",", "value", ")", ";", "}" ]
Add additional field @param key the field name @param value the field value
[ "Add", "additional", "field" ]
train
https://github.com/RestDocArchive/restdoc-api/blob/4bda600d0303229518abf13dbb6ca6a84b4de415/src/main/java/org/restdoc/api/util/RestDocObject.java#L47-L50
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.dropWhile
public static <T> T[] dropWhile(T[] self, @ClosureParams(FirstParam.Component.class) Closure<?> condition) { """ Create a suffix of the given array by dropping as many elements as possible from the front of the original array such that calling the given closure condition evaluates to true when passed each of the...
java
public static <T> T[] dropWhile(T[] self, @ClosureParams(FirstParam.Component.class) Closure<?> condition) { int num = 0; BooleanClosureWrapper bcw = new BooleanClosureWrapper(condition); while (num < self.length) { if (bcw.call(self[num])) { num += 1; } e...
[ "public", "static", "<", "T", ">", "T", "[", "]", "dropWhile", "(", "T", "[", "]", "self", ",", "@", "ClosureParams", "(", "FirstParam", ".", "Component", ".", "class", ")", "Closure", "<", "?", ">", "condition", ")", "{", "int", "num", "=", "0", ...
Create a suffix of the given array by dropping as many elements as possible from the front of the original array such that calling the given closure condition evaluates to true when passed each of the dropped elements. <pre class="groovyTestCase"> def nums = [ 1, 3, 2 ] as Integer[] assert nums.dropWhile{ it {@code <=}...
[ "Create", "a", "suffix", "of", "the", "given", "array", "by", "dropping", "as", "many", "elements", "as", "possible", "from", "the", "front", "of", "the", "original", "array", "such", "that", "calling", "the", "given", "closure", "condition", "evaluates", "t...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L11206-L11217
google/flogger
api/src/main/java/com/google/common/flogger/parser/ParseException.java
ParseException.withBounds
public static ParseException withBounds( String errorMessage, String logMessage, int start, int end) { """ Creates a new parse exception for situations in which both the start and end positions of the error are known. @param errorMessage the user error message. @param logMessage the original log message...
java
public static ParseException withBounds( String errorMessage, String logMessage, int start, int end) { return new ParseException(msg(errorMessage, logMessage, start, end), logMessage); }
[ "public", "static", "ParseException", "withBounds", "(", "String", "errorMessage", ",", "String", "logMessage", ",", "int", "start", ",", "int", "end", ")", "{", "return", "new", "ParseException", "(", "msg", "(", "errorMessage", ",", "logMessage", ",", "start...
Creates a new parse exception for situations in which both the start and end positions of the error are known. @param errorMessage the user error message. @param logMessage the original log message. @param start the index of the first character in the invalid section of the log message. @param end the index after the ...
[ "Creates", "a", "new", "parse", "exception", "for", "situations", "in", "which", "both", "the", "start", "and", "end", "positions", "of", "the", "error", "are", "known", "." ]
train
https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/parser/ParseException.java#L43-L46
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java
NodeTypes.isUnorderedCollection
public boolean isUnorderedCollection( Name nodeTypeName, Collection<Name> mixinTypes ) { """ Determine if the named node type or any of the mixin types subtypes the 'mode:unorderedCollection' type. @param nodeTypeName the node type name; may be null @param mixinTypes the mixin type names; may be null or empty ...
java
public boolean isUnorderedCollection( Name nodeTypeName, Collection<Name> mixinTypes ) { if (nodeTypeName != null && nodeTypeNamesThatAreUnorderableCollections.contains(nodeTypeName)) { return true; } if (mixinTypes != null && !mixinTypes.isEmpty()) { for (Name mixin : mi...
[ "public", "boolean", "isUnorderedCollection", "(", "Name", "nodeTypeName", ",", "Collection", "<", "Name", ">", "mixinTypes", ")", "{", "if", "(", "nodeTypeName", "!=", "null", "&&", "nodeTypeNamesThatAreUnorderableCollections", ".", "contains", "(", "nodeTypeName", ...
Determine if the named node type or any of the mixin types subtypes the 'mode:unorderedCollection' type. @param nodeTypeName the node type name; may be null @param mixinTypes the mixin type names; may be null or empty @return true if any of the named node type is an unordered collection, or false otherwise
[ "Determine", "if", "the", "named", "node", "type", "or", "any", "of", "the", "mixin", "types", "subtypes", "the", "mode", ":", "unorderedCollection", "type", "." ]
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L626-L638
zaproxy/zaproxy
src/org/zaproxy/zap/extension/forceduser/ExtensionForcedUser.java
ExtensionForcedUser.setForcedUser
public void setForcedUser(int contextId, User user) { """ Sets the forced user for a context. @param contextId the context id @param user the user """ if (user != null) this.contextForcedUsersMap.put(contextId, user); else this.contextForcedUsersMap.remove(contextId); this.updateForcedUserModeT...
java
public void setForcedUser(int contextId, User user) { if (user != null) this.contextForcedUsersMap.put(contextId, user); else this.contextForcedUsersMap.remove(contextId); this.updateForcedUserModeToggleButtonState(); }
[ "public", "void", "setForcedUser", "(", "int", "contextId", ",", "User", "user", ")", "{", "if", "(", "user", "!=", "null", ")", "this", ".", "contextForcedUsersMap", ".", "put", "(", "contextId", ",", "user", ")", ";", "else", "this", ".", "contextForce...
Sets the forced user for a context. @param contextId the context id @param user the user
[ "Sets", "the", "forced", "user", "for", "a", "context", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/forceduser/ExtensionForcedUser.java#L234-L240
liferay/com-liferay-commerce
commerce-shipping-engine-fixed-service/src/main/java/com/liferay/commerce/shipping/engine/fixed/service/persistence/impl/CommerceShippingFixedOptionRelPersistenceImpl.java
CommerceShippingFixedOptionRelPersistenceImpl.findAll
@Override public List<CommerceShippingFixedOptionRel> findAll(int start, int end) { """ Returns a range of all the commerce shipping fixed option rels. <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, the...
java
@Override public List<CommerceShippingFixedOptionRel> findAll(int start, int end) { return findAll(start, end, null); }
[ "@", "Override", "public", "List", "<", "CommerceShippingFixedOptionRel", ">", "findAll", "(", "int", "start", ",", "int", "end", ")", "{", "return", "findAll", "(", "start", ",", "end", ",", "null", ")", ";", "}" ]
Returns a range of all the commerce shipping fixed option rels. <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. Sett...
[ "Returns", "a", "range", "of", "all", "the", "commerce", "shipping", "fixed", "option", "rels", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-shipping-engine-fixed-service/src/main/java/com/liferay/commerce/shipping/engine/fixed/service/persistence/impl/CommerceShippingFixedOptionRelPersistenceImpl.java#L1752-L1755
vipshop/vjtools
vjkit/src/main/java/com/vip/vjtools/vjkit/io/FileUtil.java
FileUtil.copyFile
public static void copyFile(@NotNull Path from, @NotNull Path to) throws IOException { """ 文件复制. @see {@link Files#copy} @param from 如果为null,或文件不存在或者是目录,,抛出异常 @param to 如果to为null,或文件存在但是一个目录,抛出异常 """ Validate.isTrue(Files.exists(from), "%s is not exist or not a file", from); Validate.notNull(to); Val...
java
public static void copyFile(@NotNull Path from, @NotNull Path to) throws IOException { Validate.isTrue(Files.exists(from), "%s is not exist or not a file", from); Validate.notNull(to); Validate.isTrue(!FileUtil.isDirExists(to), "%s is exist but it is a dir", to); Files.copy(from, to); }
[ "public", "static", "void", "copyFile", "(", "@", "NotNull", "Path", "from", ",", "@", "NotNull", "Path", "to", ")", "throws", "IOException", "{", "Validate", ".", "isTrue", "(", "Files", ".", "exists", "(", "from", ")", ",", "\"%s is not exist or not a file...
文件复制. @see {@link Files#copy} @param from 如果为null,或文件不存在或者是目录,,抛出异常 @param to 如果to为null,或文件存在但是一个目录,抛出异常
[ "文件复制", ".", "@see", "{", "@link", "Files#copy", "}" ]
train
https://github.com/vipshop/vjtools/blob/60c743da35913d72f37f2d79afa90ad2bf73cb89/vjkit/src/main/java/com/vip/vjtools/vjkit/io/FileUtil.java#L251-L256
lessthanoptimal/BoofCV
main/boofcv-types/src/main/java/boofcv/struct/convolve/Kernel1D_S32.java
Kernel1D_S32.wrap
public static Kernel1D_S32 wrap(int data[], int width, int offset ) { """ Creates a kernel whose elements are the specified data array and has the specified width. @param data The array who will be the kernel's data. Reference is saved. @param width The kernel's width. @param offset Location of the origin ...
java
public static Kernel1D_S32 wrap(int data[], int width, int offset ) { Kernel1D_S32 ret = new Kernel1D_S32(); ret.data = data; ret.width = width; ret.offset = offset; return ret; }
[ "public", "static", "Kernel1D_S32", "wrap", "(", "int", "data", "[", "]", ",", "int", "width", ",", "int", "offset", ")", "{", "Kernel1D_S32", "ret", "=", "new", "Kernel1D_S32", "(", ")", ";", "ret", ".", "data", "=", "data", ";", "ret", ".", "width"...
Creates a kernel whose elements are the specified data array and has the specified width. @param data The array who will be the kernel's data. Reference is saved. @param width The kernel's width. @param offset Location of the origin in the array @return A new kernel.
[ "Creates", "a", "kernel", "whose", "elements", "are", "the", "specified", "data", "array", "and", "has", "the", "specified", "width", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/convolve/Kernel1D_S32.java#L103-L110
google/auto
common/src/main/java/com/google/auto/common/GeneratedAnnotationSpecs.java
GeneratedAnnotationSpecs.generatedAnnotationSpec
public static Optional<AnnotationSpec> generatedAnnotationSpec( Elements elements, SourceVersion sourceVersion, Class<?> processorClass) { """ Returns {@code @Generated("processorClass"} for the target {@code SourceVersion}. <p>Returns {@code javax.annotation.processing.Generated} for JDK 9 and newer, {@c...
java
public static Optional<AnnotationSpec> generatedAnnotationSpec( Elements elements, SourceVersion sourceVersion, Class<?> processorClass) { return generatedAnnotationSpecBuilder(elements, sourceVersion, processorClass) .map(AnnotationSpec.Builder::build); }
[ "public", "static", "Optional", "<", "AnnotationSpec", ">", "generatedAnnotationSpec", "(", "Elements", "elements", ",", "SourceVersion", "sourceVersion", ",", "Class", "<", "?", ">", "processorClass", ")", "{", "return", "generatedAnnotationSpecBuilder", "(", "elemen...
Returns {@code @Generated("processorClass"} for the target {@code SourceVersion}. <p>Returns {@code javax.annotation.processing.Generated} for JDK 9 and newer, {@code javax.annotation.Generated} for earlier releases, and Optional#empty()} if the annotation is not available.
[ "Returns", "{", "@code", "@Generated", "(", "processorClass", "}", "for", "the", "target", "{", "@code", "SourceVersion", "}", "." ]
train
https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/common/src/main/java/com/google/auto/common/GeneratedAnnotationSpecs.java#L73-L77
pryzach/midao
midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java
MappingUtils.objectImplements
public static boolean objectImplements(Object object, String interfaceClass) { """ Checks if Instance implements specified Interface {@link Class#isAssignableFrom(Class)} is not used as Interface might not be available and String representation can only be used @param object Instance which would be ch...
java
public static boolean objectImplements(Object object, String interfaceClass) { AssertUtils.assertNotNull(object); boolean result = false; Class[] interfaces = object.getClass().getInterfaces(); for (int i = 0; i < interfaces.length; i++) { if (interfaces[i].getName()...
[ "public", "static", "boolean", "objectImplements", "(", "Object", "object", ",", "String", "interfaceClass", ")", "{", "AssertUtils", ".", "assertNotNull", "(", "object", ")", ";", "boolean", "result", "=", "false", ";", "Class", "[", "]", "interfaces", "=", ...
Checks if Instance implements specified Interface {@link Class#isAssignableFrom(Class)} is not used as Interface might not be available and String representation can only be used @param object Instance which would be checked @param interfaceClass Interface with which it would be checked @return true if Instanc...
[ "Checks", "if", "Instance", "implements", "specified", "Interface", "{", "@link", "Class#isAssignableFrom", "(", "Class", ")", "}", "is", "not", "used", "as", "Interface", "might", "not", "be", "available", "and", "String", "representation", "can", "only", "be",...
train
https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java#L332-L346
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java
LottieAnimationView.setAnimation
public void setAnimation(JsonReader reader, @Nullable String cacheKey) { """ Sets the animation from a JSONReader. This will load and deserialize the file asynchronously. <p> This is particularly useful for animations loaded from the network. You can fetch the bodymovin json from the network and pass it direct...
java
public void setAnimation(JsonReader reader, @Nullable String cacheKey) { setCompositionTask(LottieCompositionFactory.fromJsonReader(reader, cacheKey)); }
[ "public", "void", "setAnimation", "(", "JsonReader", "reader", ",", "@", "Nullable", "String", "cacheKey", ")", "{", "setCompositionTask", "(", "LottieCompositionFactory", ".", "fromJsonReader", "(", "reader", ",", "cacheKey", ")", ")", ";", "}" ]
Sets the animation from a JSONReader. This will load and deserialize the file asynchronously. <p> This is particularly useful for animations loaded from the network. You can fetch the bodymovin json from the network and pass it directly here.
[ "Sets", "the", "animation", "from", "a", "JSONReader", ".", "This", "will", "load", "and", "deserialize", "the", "file", "asynchronously", ".", "<p", ">", "This", "is", "particularly", "useful", "for", "animations", "loaded", "from", "the", "network", ".", "...
train
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java#L333-L335
sarl/sarl
main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/Capacities.java
Capacities.createSkillDelegator
@Pure public static <C extends Capacity> C createSkillDelegator(Skill originalSkill, Class<C> capacity, AgentTrait capacityCaller) throws Exception { """ Create a delegator for the given skill. <p>The delegator is wrapping the original skill in order to set the value of the caller that will be replied by {...
java
@Pure public static <C extends Capacity> C createSkillDelegator(Skill originalSkill, Class<C> capacity, AgentTrait capacityCaller) throws Exception { final String name = capacity.getName() + CAPACITY_WRAPPER_NAME; final Class<?> type = Class.forName(name, true, capacity.getClassLoader()); final Constructor<?>...
[ "@", "Pure", "public", "static", "<", "C", "extends", "Capacity", ">", "C", "createSkillDelegator", "(", "Skill", "originalSkill", ",", "Class", "<", "C", ">", "capacity", ",", "AgentTrait", "capacityCaller", ")", "throws", "Exception", "{", "final", "String",...
Create a delegator for the given skill. <p>The delegator is wrapping the original skill in order to set the value of the caller that will be replied by {@link #getCaller()}. The associated caller is given as argument. <p>The delegator is an instance of an specific inner type, sub-type of {@link Capacity.ContextAwareC...
[ "Create", "a", "delegator", "for", "the", "given", "skill", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/core/Capacities.java#L87-L94
jmeetsma/Iglu-Util
src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java
StringSupport.replaceAll
public static String replaceAll(String haystack, String[] needle, String newNeedle[]) { """ Replaces a series of possible occurrences by a series of substitutes. @param haystack @param needle @param newNeedle @return """ if (needle.length != newNeedle.length) { throw new IllegalArgumentException("le...
java
public static String replaceAll(String haystack, String[] needle, String newNeedle[]) { if (needle.length != newNeedle.length) { throw new IllegalArgumentException("length of original and replace values do not match (" + needle.length + " != " + newNeedle.length + " )"); } StringBuffer buf = new StringBuffer(h...
[ "public", "static", "String", "replaceAll", "(", "String", "haystack", ",", "String", "[", "]", "needle", ",", "String", "newNeedle", "[", "]", ")", "{", "if", "(", "needle", ".", "length", "!=", "newNeedle", ".", "length", ")", "{", "throw", "new", "I...
Replaces a series of possible occurrences by a series of substitutes. @param haystack @param needle @param newNeedle @return
[ "Replaces", "a", "series", "of", "possible", "occurrences", "by", "a", "series", "of", "substitutes", "." ]
train
https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java#L120-L131
alkacon/opencms-core
src-modules/org/opencms/workplace/list/A_CmsListExplorerDialog.java
A_CmsListExplorerDialog.setColumnVisibility
protected void setColumnVisibility(int colFlag, int prefs) { """ Sets the given column visibility flag from the given preferences.<p> @param colFlag the flag that identifies the column to set the flag for @param prefs the user preferences """ Integer key = new Integer(colFlag); Boolean val...
java
protected void setColumnVisibility(int colFlag, int prefs) { Integer key = new Integer(colFlag); Boolean value = Boolean.valueOf((prefs & colFlag) > 0); m_colVisibilities.put(key, value); }
[ "protected", "void", "setColumnVisibility", "(", "int", "colFlag", ",", "int", "prefs", ")", "{", "Integer", "key", "=", "new", "Integer", "(", "colFlag", ")", ";", "Boolean", "value", "=", "Boolean", ".", "valueOf", "(", "(", "prefs", "&", "colFlag", ")...
Sets the given column visibility flag from the given preferences.<p> @param colFlag the flag that identifies the column to set the flag for @param prefs the user preferences
[ "Sets", "the", "given", "column", "visibility", "flag", "from", "the", "given", "preferences", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/list/A_CmsListExplorerDialog.java#L711-L716
mapcode-foundation/mapcode-java
src/main/java/com/mapcode/Point.java
Point.fromMicroDeg
@Nonnull public static Point fromMicroDeg(final int latMicroDeg, final int lonMicroDeg) { """ Public construction, from integer microdegrees (no loss of precision). @param latMicroDeg Latitude, in microdegrees. @param lonMicroDeg Longitude, in microdegrees. @return A defined point. """ final P...
java
@Nonnull public static Point fromMicroDeg(final int latMicroDeg, final int lonMicroDeg) { final Point p = new Point(); p.latMicroDeg = latMicroDeg; p.latFractionOnlyDeg = 0; p.lonMicroDeg = lonMicroDeg; p.lonFractionOnlyDeg = 0; p.defined = true; return p.wrap...
[ "@", "Nonnull", "public", "static", "Point", "fromMicroDeg", "(", "final", "int", "latMicroDeg", ",", "final", "int", "lonMicroDeg", ")", "{", "final", "Point", "p", "=", "new", "Point", "(", ")", ";", "p", ".", "latMicroDeg", "=", "latMicroDeg", ";", "p...
Public construction, from integer microdegrees (no loss of precision). @param latMicroDeg Latitude, in microdegrees. @param lonMicroDeg Longitude, in microdegrees. @return A defined point.
[ "Public", "construction", "from", "integer", "microdegrees", "(", "no", "loss", "of", "precision", ")", "." ]
train
https://github.com/mapcode-foundation/mapcode-java/blob/f12d4d9fbd460472ac0fff1f702f2ac716bc0ab8/src/main/java/com/mapcode/Point.java#L81-L90
datumbox/datumbox-framework
datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/DiscreteDistributions.java
DiscreteDistributions.poisson
public static double poisson(int k, double lamda) { """ Returns the probability of k occurrences when rate is lamda @param k @param lamda @return """ if(k<0 || lamda<0) { throw new IllegalArgumentException("All the parameters must be positive."); } /* /...
java
public static double poisson(int k, double lamda) { if(k<0 || lamda<0) { throw new IllegalArgumentException("All the parameters must be positive."); } /* //Slow $probability=pow($lamda,$k)*exp(-$lamda)/StatsUtilities::factorial($k); */ //fast...
[ "public", "static", "double", "poisson", "(", "int", "k", ",", "double", "lamda", ")", "{", "if", "(", "k", "<", "0", "||", "lamda", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"All the parameters must be positive.\"", ")", ";", ...
Returns the probability of k occurrences when rate is lamda @param k @param lamda @return
[ "Returns", "the", "probability", "of", "k", "occurrences", "when", "rate", "is", "lamda" ]
train
https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/DiscreteDistributions.java#L381-L399
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/BaseFont.java
BaseFont.getDocumentFonts
public static ArrayList getDocumentFonts(PdfReader reader, int page) { """ Gets a list of the document fonts in a particular page. Each element of the <CODE>ArrayList</CODE> contains a <CODE>Object[]{String,PRIndirectReference}</CODE> with the font name and the indirect reference to it. @param reader the docume...
java
public static ArrayList getDocumentFonts(PdfReader reader, int page) { IntHashtable hits = new IntHashtable(); ArrayList fonts = new ArrayList(); recourseFonts(reader.getPageN(page), hits, fonts, 1); return fonts; }
[ "public", "static", "ArrayList", "getDocumentFonts", "(", "PdfReader", "reader", ",", "int", "page", ")", "{", "IntHashtable", "hits", "=", "new", "IntHashtable", "(", ")", ";", "ArrayList", "fonts", "=", "new", "ArrayList", "(", ")", ";", "recourseFonts", "...
Gets a list of the document fonts in a particular page. Each element of the <CODE>ArrayList</CODE> contains a <CODE>Object[]{String,PRIndirectReference}</CODE> with the font name and the indirect reference to it. @param reader the document where the fonts are to be listed from @param page the page to list the fonts fro...
[ "Gets", "a", "list", "of", "the", "document", "fonts", "in", "a", "particular", "page", ".", "Each", "element", "of", "the", "<CODE", ">", "ArrayList<", "/", "CODE", ">", "contains", "a", "<CODE", ">", "Object", "[]", "{", "String", "PRIndirectReference", ...
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/BaseFont.java#L1488-L1493
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/gen/CodeBuilderUtil.java
CodeBuilderUtil.definePrepareBridges
public static void definePrepareBridges(ClassFile cf, Class leaf) { """ Add prepare bridge methods for all classes/interfaces between the leaf (genericised class) and the root (genericised baseclass). @param cf file to which to add the prepare bridge @param leaf leaf class @since 1.2 """ for (Cl...
java
public static void definePrepareBridges(ClassFile cf, Class leaf) { for (Class c : gatherAllBridgeTypes(new HashSet<Class>(), leaf)) { if (c != Object.class) { definePrepareBridge(cf, leaf, c); } } }
[ "public", "static", "void", "definePrepareBridges", "(", "ClassFile", "cf", ",", "Class", "leaf", ")", "{", "for", "(", "Class", "c", ":", "gatherAllBridgeTypes", "(", "new", "HashSet", "<", "Class", ">", "(", ")", ",", "leaf", ")", ")", "{", "if", "("...
Add prepare bridge methods for all classes/interfaces between the leaf (genericised class) and the root (genericised baseclass). @param cf file to which to add the prepare bridge @param leaf leaf class @since 1.2
[ "Add", "prepare", "bridge", "methods", "for", "all", "classes", "/", "interfaces", "between", "the", "leaf", "(", "genericised", "class", ")", "and", "the", "root", "(", "genericised", "baseclass", ")", "." ]
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/gen/CodeBuilderUtil.java#L262-L268
dita-ot/dita-ot
src/main/java/org/dita/dost/project/XmlReader.java
XmlReader.readDocument
private Document readDocument(InputStream in, URI file) throws TransformerConfigurationException, SAXException, IOException { """ Read and validate project file. @param in input project file @param file @return project file document """ final Document document = documentBuilder.newDocument(); ...
java
private Document readDocument(InputStream in, URI file) throws TransformerConfigurationException, SAXException, IOException { final Document document = documentBuilder.newDocument(); if (file != null) { document.setDocumentURI(file.toString()); } final TransformerHandler dom...
[ "private", "Document", "readDocument", "(", "InputStream", "in", ",", "URI", "file", ")", "throws", "TransformerConfigurationException", ",", "SAXException", ",", "IOException", "{", "final", "Document", "document", "=", "documentBuilder", ".", "newDocument", "(", "...
Read and validate project file. @param in input project file @param file @return project file document
[ "Read", "and", "validate", "project", "file", "." ]
train
https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/project/XmlReader.java#L136-L151
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/storage/lowlevel/akubra/HashPathIdMapper.java
HashPathIdMapper.getPath
private void getPath(String uri, StringBuilder builder) { """ gets the path based on the hash of the uri, or "" if the pattern is empty """ if (pattern.length() == 0) { return; } String hash = getHash(uri); int hashPos = 0; for (int i = 0; i < pattern.length(...
java
private void getPath(String uri, StringBuilder builder) { if (pattern.length() == 0) { return; } String hash = getHash(uri); int hashPos = 0; for (int i = 0; i < pattern.length(); i++) { char c = pattern.charAt(i); if (c == '#') { ...
[ "private", "void", "getPath", "(", "String", "uri", ",", "StringBuilder", "builder", ")", "{", "if", "(", "pattern", ".", "length", "(", ")", "==", "0", ")", "{", "return", ";", "}", "String", "hash", "=", "getHash", "(", "uri", ")", ";", "int", "h...
gets the path based on the hash of the uri, or "" if the pattern is empty
[ "gets", "the", "path", "based", "on", "the", "hash", "of", "the", "uri", "or", "if", "the", "pattern", "is", "empty" ]
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/lowlevel/akubra/HashPathIdMapper.java#L130-L145
ReactiveX/RxJavaAsyncUtil
src/main/java/rx/util/async/Async.java
Async.startFuture
public static <T> Observable<T> startFuture(Func0<? extends Future<? extends T>> functionAsync) { """ Invokes the asynchronous function immediately, surfacing the result through an Observable. <p> <em>Important note</em> subscribing to the resulting Observable blocks until the future completes. <p> <img width=...
java
public static <T> Observable<T> startFuture(Func0<? extends Future<? extends T>> functionAsync) { return OperatorStartFuture.startFuture(functionAsync); }
[ "public", "static", "<", "T", ">", "Observable", "<", "T", ">", "startFuture", "(", "Func0", "<", "?", "extends", "Future", "<", "?", "extends", "T", ">", ">", "functionAsync", ")", "{", "return", "OperatorStartFuture", ".", "startFuture", "(", "functionAs...
Invokes the asynchronous function immediately, surfacing the result through an Observable. <p> <em>Important note</em> subscribing to the resulting Observable blocks until the future completes. <p> <img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/startFuture.png" alt=""> @param <T...
[ "Invokes", "the", "asynchronous", "function", "immediately", "surfacing", "the", "result", "through", "an", "Observable", ".", "<p", ">", "<em", ">", "Important", "note<", "/", "em", ">", "subscribing", "to", "the", "resulting", "Observable", "blocks", "until", ...
train
https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L1765-L1767
lightblue-platform/lightblue-client
core/src/main/java/com/redhat/lightblue/client/request/DataBulkRequest.java
DataBulkRequest.insertAfter
public DataBulkRequest insertAfter(CRUDRequest request, CRUDRequest after) { """ Inserts a request after another specified request. This guarantees that the first request parameter will be executed, sequentially, after the second request parameter. It does not guarantee consecutive execution. @param request ...
java
public DataBulkRequest insertAfter(CRUDRequest request, CRUDRequest after) { this.requests.add(requests.indexOf(after) + 1, request); return this; }
[ "public", "DataBulkRequest", "insertAfter", "(", "CRUDRequest", "request", ",", "CRUDRequest", "after", ")", "{", "this", ".", "requests", ".", "add", "(", "requests", ".", "indexOf", "(", "after", ")", "+", "1", ",", "request", ")", ";", "return", "this",...
Inserts a request after another specified request. This guarantees that the first request parameter will be executed, sequentially, after the second request parameter. It does not guarantee consecutive execution. @param request @param after @return
[ "Inserts", "a", "request", "after", "another", "specified", "request", ".", "This", "guarantees", "that", "the", "first", "request", "parameter", "will", "be", "executed", "sequentially", "after", "the", "second", "request", "parameter", ".", "It", "does", "not"...
train
https://github.com/lightblue-platform/lightblue-client/blob/03790aff34e90d3889f60fd6c603c21a21dc1a40/core/src/main/java/com/redhat/lightblue/client/request/DataBulkRequest.java#L99-L102
finmath/finmath-lib
src/main/java/net/finmath/marketdata/calibration/CalibratedCurves.java
CalibratedCurves.getCloneShiftedForRegExp
public CalibratedCurves getCloneShiftedForRegExp(String symbolRegExp, double shift) throws SolverException, CloneNotSupportedException { """ Returns the set curves calibrated to "shifted" market data, that is, the market date of <code>this</code> object, modified by the shifts provided to this methods. This m...
java
public CalibratedCurves getCloneShiftedForRegExp(String symbolRegExp, double shift) throws SolverException, CloneNotSupportedException { return getCloneShifted(Pattern.compile(symbolRegExp), shift); }
[ "public", "CalibratedCurves", "getCloneShiftedForRegExp", "(", "String", "symbolRegExp", ",", "double", "shift", ")", "throws", "SolverException", ",", "CloneNotSupportedException", "{", "return", "getCloneShifted", "(", "Pattern", ".", "compile", "(", "symbolRegExp", "...
Returns the set curves calibrated to "shifted" market data, that is, the market date of <code>this</code> object, modified by the shifts provided to this methods. This method will shift all symbols matching a given regular expression. @see java.util.regex.Pattern @param symbolRegExp A string representing a regular e...
[ "Returns", "the", "set", "curves", "calibrated", "to", "shifted", "market", "data", "that", "is", "the", "market", "date", "of", "<code", ">", "this<", "/", "code", ">", "object", "modified", "by", "the", "shifts", "provided", "to", "this", "methods", "." ...
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/calibration/CalibratedCurves.java#L655-L657
jinahya/hex-codec
src/main/java/com/github/jinahya/codec/HexEncoder.java
HexEncoder.encodeMultiple
public static byte[] encodeMultiple(final byte[] input) { """ Encodes given sequence of octets into a sequence of nibbles. @param input the octets to encode @return the encoded nibbles. """ if (input == null) { throw new NullPointerException("input"); } final byte[] ...
java
public static byte[] encodeMultiple(final byte[] input) { if (input == null) { throw new NullPointerException("input"); } final byte[] output = new byte[input.length << 1]; // * 2 encodeMultiple(input, 0, output, 0, input.length); return output; }
[ "public", "static", "byte", "[", "]", "encodeMultiple", "(", "final", "byte", "[", "]", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"input\"", ")", ";", "}", "final", "byte", "[", "]", ...
Encodes given sequence of octets into a sequence of nibbles. @param input the octets to encode @return the encoded nibbles.
[ "Encodes", "given", "sequence", "of", "octets", "into", "a", "sequence", "of", "nibbles", "." ]
train
https://github.com/jinahya/hex-codec/blob/159aa54010821655496177e76a3ef35a49fbd433/src/main/java/com/github/jinahya/codec/HexEncoder.java#L146-L157
alkacon/opencms-core
src/org/opencms/db/CmsSecurityManager.java
CmsSecurityManager.readResource
protected CmsResource readResource(CmsDbContext dbc, CmsUUID structureID, CmsResourceFilter filter) throws CmsException { """ Reads a resource from the OpenCms VFS, using the specified resource filter.<p> @param dbc the current database context @param structureID the ID of the structure to read @param fil...
java
protected CmsResource readResource(CmsDbContext dbc, CmsUUID structureID, CmsResourceFilter filter) throws CmsException { // read the resource from the VFS CmsResource resource = m_driverManager.readResource(dbc, structureID, filter); // check if the user has read access to the resource ...
[ "protected", "CmsResource", "readResource", "(", "CmsDbContext", "dbc", ",", "CmsUUID", "structureID", ",", "CmsResourceFilter", "filter", ")", "throws", "CmsException", "{", "// read the resource from the VFS", "CmsResource", "resource", "=", "m_driverManager", ".", "rea...
Reads a resource from the OpenCms VFS, using the specified resource filter.<p> @param dbc the current database context @param structureID the ID of the structure to read @param filter the resource filter to use while reading @return the resource that was read @throws CmsException if something goes wrong @see CmsObj...
[ "Reads", "a", "resource", "from", "the", "OpenCms", "VFS", "using", "the", "specified", "resource", "filter", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L7449-L7460
Microsoft/malmo
Minecraft/src/main/java/com/microsoft/Malmo/Utils/PositionHelper.java
PositionHelper.calcDistanceFromPlayerToPosition
public static float calcDistanceFromPlayerToPosition(EntityPlayerSP player, Pos targetPos) { """ Calculate the Euclidean distance between the player and the target position. @param player the player whose distance from target we want to know @param targetPos the target position, specified as a Schema pos object ...
java
public static float calcDistanceFromPlayerToPosition(EntityPlayerSP player, Pos targetPos) { double x = player.posX - targetPos.getX().doubleValue(); double y = player.posY - targetPos.getY().doubleValue(); double z = player.posZ - targetPos.getZ().doubleValue(); return (float)Math.sqrt(x*x + y*y +...
[ "public", "static", "float", "calcDistanceFromPlayerToPosition", "(", "EntityPlayerSP", "player", ",", "Pos", "targetPos", ")", "{", "double", "x", "=", "player", ".", "posX", "-", "targetPos", ".", "getX", "(", ")", ".", "doubleValue", "(", ")", ";", "doubl...
Calculate the Euclidean distance between the player and the target position. @param player the player whose distance from target we want to know @param targetPos the target position, specified as a Schema pos object @return a float containing the Euclidean distance 'twixt player and target
[ "Calculate", "the", "Euclidean", "distance", "between", "the", "player", "and", "the", "target", "position", "." ]
train
https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Minecraft/src/main/java/com/microsoft/Malmo/Utils/PositionHelper.java#L39-L45
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsconsoleloginprompt.java
nsconsoleloginprompt.get
public static nsconsoleloginprompt get(nitro_service service, options option) throws Exception { """ Use this API to fetch all the nsconsoleloginprompt resources that are configured on netscaler. """ nsconsoleloginprompt obj = new nsconsoleloginprompt(); nsconsoleloginprompt[] response = (nsconsoleloginpr...
java
public static nsconsoleloginprompt get(nitro_service service, options option) throws Exception{ nsconsoleloginprompt obj = new nsconsoleloginprompt(); nsconsoleloginprompt[] response = (nsconsoleloginprompt[])obj.get_resources(service,option); return response[0]; }
[ "public", "static", "nsconsoleloginprompt", "get", "(", "nitro_service", "service", ",", "options", "option", ")", "throws", "Exception", "{", "nsconsoleloginprompt", "obj", "=", "new", "nsconsoleloginprompt", "(", ")", ";", "nsconsoleloginprompt", "[", "]", "respon...
Use this API to fetch all the nsconsoleloginprompt resources that are configured on netscaler.
[ "Use", "this", "API", "to", "fetch", "all", "the", "nsconsoleloginprompt", "resources", "that", "are", "configured", "on", "netscaler", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsconsoleloginprompt.java#L118-L122
eclipse/xtext-lib
org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/BigDecimalExtensions.java
BigDecimalExtensions.operator_divide
@Pure @Inline(value="$1.divide($2, $3.DECIMAL128)", imported=MathContext.class) public static BigDecimal operator_divide(BigDecimal a, BigDecimal b) { """ The binary <code>divide</code> operator. @param a a BigDecimal. May not be <code>null</code>. @param b a BigDecimal. May not be <code>null</code>. @ret...
java
@Pure @Inline(value="$1.divide($2, $3.DECIMAL128)", imported=MathContext.class) public static BigDecimal operator_divide(BigDecimal a, BigDecimal b) { return a.divide(b, MathContext.DECIMAL128); }
[ "@", "Pure", "@", "Inline", "(", "value", "=", "\"$1.divide($2, $3.DECIMAL128)\"", ",", "imported", "=", "MathContext", ".", "class", ")", "public", "static", "BigDecimal", "operator_divide", "(", "BigDecimal", "a", ",", "BigDecimal", "b", ")", "{", "return", ...
The binary <code>divide</code> operator. @param a a BigDecimal. May not be <code>null</code>. @param b a BigDecimal. May not be <code>null</code>. @return <code>a.divide(b, MathContext.DECIMAL128)</code> @throws NullPointerException if {@code a} or {@code b} is <code>null</code>.
[ "The", "binary", "<code", ">", "divide<", "/", "code", ">", "operator", "." ]
train
https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/BigDecimalExtensions.java#L117-L121
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/trees/EnglishGrammaticalStructure.java
EnglishGrammaticalStructure.collapse2WP
private static void collapse2WP(Collection<TypedDependency> list) { """ Collapse multiword preposition of the following format: prep|advmod|dep|amod(gov, mwp[0]) <br/> dep(mpw[0],mwp[1]) <br/> pobj|pcomp(mwp[1], compl) or pobj|pcomp(mwp[0], compl) <br/> -> prep_mwp[0]_mwp[1](gov, compl) <br/> prep|advmod|de...
java
private static void collapse2WP(Collection<TypedDependency> list) { Collection<TypedDependency> newTypedDeps = new ArrayList<TypedDependency>(); for (String[] mwp : MULTIWORD_PREPS) { // first look for patterns such as: // X(gov, mwp[0]) // Y(mpw[0],mwp[1]) // Z(mwp[1], compl) or...
[ "private", "static", "void", "collapse2WP", "(", "Collection", "<", "TypedDependency", ">", "list", ")", "{", "Collection", "<", "TypedDependency", ">", "newTypedDeps", "=", "new", "ArrayList", "<", "TypedDependency", ">", "(", ")", ";", "for", "(", "String", ...
Collapse multiword preposition of the following format: prep|advmod|dep|amod(gov, mwp[0]) <br/> dep(mpw[0],mwp[1]) <br/> pobj|pcomp(mwp[1], compl) or pobj|pcomp(mwp[0], compl) <br/> -> prep_mwp[0]_mwp[1](gov, compl) <br/> prep|advmod|dep|amod(gov, mwp[1]) <br/> dep(mpw[1],mwp[0]) <br/> pobj|pcomp(mwp[1], compl) or pob...
[ "Collapse", "multiword", "preposition", "of", "the", "following", "format", ":", "prep|advmod|dep|amod", "(", "gov", "mwp", "[", "0", "]", ")", "<br", "/", ">", "dep", "(", "mpw", "[", "0", "]", "mwp", "[", "1", "]", ")", "<br", "/", ">", "pobj|pcomp...
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/EnglishGrammaticalStructure.java#L1141-L1159
Azure/azure-sdk-for-java
containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersInner.java
ContainersInner.executeCommand
public ContainerExecResponseInner executeCommand(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { """ Executes a command in a specific container instance. Executes a command for a specific container instance in a specified resource group and c...
java
public ContainerExecResponseInner executeCommand(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { return executeCommandWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).toBlocking().single()...
[ "public", "ContainerExecResponseInner", "executeCommand", "(", "String", "resourceGroupName", ",", "String", "containerGroupName", ",", "String", "containerName", ",", "ContainerExecRequest", "containerExecRequest", ")", "{", "return", "executeCommandWithServiceResponseAsync", ...
Executes a command in a specific container instance. Executes a command for a specific container instance in a specified resource group and container group. @param resourceGroupName The name of the resource group. @param containerGroupName The name of the container group. @param containerName The name of the container...
[ "Executes", "a", "command", "in", "a", "specific", "container", "instance", ".", "Executes", "a", "command", "for", "a", "specific", "container", "instance", "in", "a", "specified", "resource", "group", "and", "container", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersInner.java#L273-L275
calrissian/mango
mango-core/src/main/java/org/calrissian/mango/collect/CloseableIterables.java
CloseableIterables.transform
public static <F, T> CloseableIterable<T> transform(final CloseableIterable<F> iterable, final Function<? super F, ? extends T> function) { """ Returns an iterable that applies {@code function} to each element of {@code fromIterable}. """ return wrap(Iterables.transform(iterable, function::apply), ite...
java
public static <F, T> CloseableIterable<T> transform(final CloseableIterable<F> iterable, final Function<? super F, ? extends T> function) { return wrap(Iterables.transform(iterable, function::apply), iterable); }
[ "public", "static", "<", "F", ",", "T", ">", "CloseableIterable", "<", "T", ">", "transform", "(", "final", "CloseableIterable", "<", "F", ">", "iterable", ",", "final", "Function", "<", "?", "super", "F", ",", "?", "extends", "T", ">", "function", ")"...
Returns an iterable that applies {@code function} to each element of {@code fromIterable}.
[ "Returns", "an", "iterable", "that", "applies", "{" ]
train
https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/collect/CloseableIterables.java#L226-L228
awslabs/jsii
packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiClient.java
JsiiClient.setPropertyValue
public void setPropertyValue(final JsiiObjectRef objRef, final String property, final JsonNode value) { """ Sets a value for a property in a remote object. @param objRef The remote object reference. @param property The name of the property. @param value The new property value. """ ObjectNode req = m...
java
public void setPropertyValue(final JsiiObjectRef objRef, final String property, final JsonNode value) { ObjectNode req = makeRequest("set", objRef); req.put("property", property); req.set("value", value); this.runtime.requestResponse(req); }
[ "public", "void", "setPropertyValue", "(", "final", "JsiiObjectRef", "objRef", ",", "final", "String", "property", ",", "final", "JsonNode", "value", ")", "{", "ObjectNode", "req", "=", "makeRequest", "(", "\"set\"", ",", "objRef", ")", ";", "req", ".", "put...
Sets a value for a property in a remote object. @param objRef The remote object reference. @param property The name of the property. @param value The new property value.
[ "Sets", "a", "value", "for", "a", "property", "in", "a", "remote", "object", "." ]
train
https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiClient.java#L122-L128
seancfoley/IPAddress
IPAddress/src/inet.ipaddr/inet/ipaddr/mac/MACAddressSection.java
MACAddressSection.isEUI64
public boolean isEUI64(boolean asMAC, boolean partial) { """ Whether this section is consistent with an EUI64 section, which means it came from an extended 8 byte address, and the corresponding segments in the middle match 0xff and 0xff/fe for MAC/not-MAC @param partial whether missing segments are considered...
java
public boolean isEUI64(boolean asMAC, boolean partial) { if(isExtended()) { int segmentCount = getSegmentCount(); int endIndex = addressSegmentIndex + segmentCount; if(addressSegmentIndex <= 3) { if(endIndex > 4) { int index3 = 3 - addressSegmentIndex; MACAddressSegment seg3 = getSegment...
[ "public", "boolean", "isEUI64", "(", "boolean", "asMAC", ",", "boolean", "partial", ")", "{", "if", "(", "isExtended", "(", ")", ")", "{", "int", "segmentCount", "=", "getSegmentCount", "(", ")", ";", "int", "endIndex", "=", "addressSegmentIndex", "+", "se...
Whether this section is consistent with an EUI64 section, which means it came from an extended 8 byte address, and the corresponding segments in the middle match 0xff and 0xff/fe for MAC/not-MAC @param partial whether missing segments are considered a match (this only has an effect if this section came from an extende...
[ "Whether", "this", "section", "is", "consistent", "with", "an", "EUI64", "section", "which", "means", "it", "came", "from", "an", "extended", "8", "byte", "address", "and", "the", "corresponding", "segments", "in", "the", "middle", "match", "0xff", "and", "0...
train
https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/mac/MACAddressSection.java#L663-L684
baratine/baratine
kraken/src/main/java/com/caucho/v5/kraken/query/SelectQueryLocal.java
SelectQueryLocal.onGet
private Cursor onGet(EnvKelp envKelp, RowCursor rowCursor, Boolean isFound) { """ /* private class GetResult extends Result.Wrapper<Boolean,Cursor> { private EnvKelp _envKelp; private RowCursor _rowCursor; GetResult(Result<Cursor> result, EnvKelp envKelp, RowCursor rowCursor) { super(result); _envKel...
java
private Cursor onGet(EnvKelp envKelp, RowCursor rowCursor, Boolean isFound) { if (Boolean.TRUE.equals(isFound)) { envKelp.test(rowCursor); CursorKraken cursor = new CursorKraken(table(), envKelp, rowCursor, _results); return cursor; } else { return null; } }
[ "private", "Cursor", "onGet", "(", "EnvKelp", "envKelp", ",", "RowCursor", "rowCursor", ",", "Boolean", "isFound", ")", "{", "if", "(", "Boolean", ".", "TRUE", ".", "equals", "(", "isFound", ")", ")", "{", "envKelp", ".", "test", "(", "rowCursor", ")", ...
/* private class GetResult extends Result.Wrapper<Boolean,Cursor> { private EnvKelp _envKelp; private RowCursor _rowCursor; GetResult(Result<Cursor> result, EnvKelp envKelp, RowCursor rowCursor) { super(result); _envKelp = envKelp; _rowCursor = rowCursor; } @Override public void complete(Boolean isFound) { if (Boole...
[ "/", "*", "private", "class", "GetResult", "extends", "Result", ".", "Wrapper<Boolean", "Cursor", ">", "{", "private", "EnvKelp", "_envKelp", ";", "private", "RowCursor", "_rowCursor", ";" ]
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/SelectQueryLocal.java#L381-L393
Whiley/WhileyCompiler
src/main/java/wyil/interpreter/Interpreter.java
Interpreter.executeWhile
private Status executeWhile(Stmt.While stmt, CallStack frame, EnclosingScope scope) { """ Execute a While statement at a given point in the function or method body. This will loop over the body zero or more times. @param stmt --- Loop statement to executed @param frame --- The current stack frame @return ...
java
private Status executeWhile(Stmt.While stmt, CallStack frame, EnclosingScope scope) { Status r; do { RValue.Bool operand = executeExpression(BOOL_T, stmt.getCondition(), frame); if (operand == RValue.False) { return Status.NEXT; } // Keep executing the loop body until we exit it somehow. r = exec...
[ "private", "Status", "executeWhile", "(", "Stmt", ".", "While", "stmt", ",", "CallStack", "frame", ",", "EnclosingScope", "scope", ")", "{", "Status", "r", ";", "do", "{", "RValue", ".", "Bool", "operand", "=", "executeExpression", "(", "BOOL_T", ",", "stm...
Execute a While statement at a given point in the function or method body. This will loop over the body zero or more times. @param stmt --- Loop statement to executed @param frame --- The current stack frame @return
[ "Execute", "a", "While", "statement", "at", "a", "given", "point", "in", "the", "function", "or", "method", "body", ".", "This", "will", "loop", "over", "the", "body", "zero", "or", "more", "times", "." ]
train
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/interpreter/Interpreter.java#L416-L433
pryzach/midao
midao-jdbc-core/src/main/java/org/midao/jdbc/core/MjdbcConfig.java
MjdbcConfig.getDefaultOverrider
public static Overrider getDefaultOverrider() { """ Creates new {@link Overrider} implementation instance based on default statement handler implementation class set via {@link #setDefaultOverrider(Class)} @return new {@link Overrider} instance """ Overrider result = null; Class<Overrid...
java
public static Overrider getDefaultOverrider() { Overrider result = null; Class<Overrider> clazz = instance().defaultOverrider; try { result = clazz.newInstance(); } catch (InstantiationException e) { throw new MjdbcRuntimeException(ERROR_OR_INIT_FAILED, ...
[ "public", "static", "Overrider", "getDefaultOverrider", "(", ")", "{", "Overrider", "result", "=", "null", ";", "Class", "<", "Overrider", ">", "clazz", "=", "instance", "(", ")", ".", "defaultOverrider", ";", "try", "{", "result", "=", "clazz", ".", "newI...
Creates new {@link Overrider} implementation instance based on default statement handler implementation class set via {@link #setDefaultOverrider(Class)} @return new {@link Overrider} instance
[ "Creates", "new", "{", "@link", "Overrider", "}", "implementation", "instance", "based", "on", "default", "statement", "handler", "implementation", "class", "set", "via", "{", "@link", "#setDefaultOverrider", "(", "Class", ")", "}" ]
train
https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/MjdbcConfig.java#L453-L467