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
apache/incubator-atlas
repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java
GraphBackedTypeStore.createVertices
private List<AtlasVertex> createVertices(List<TypeVertexInfo> infoList) throws AtlasException { """ Finds or creates type vertices with the information specified. @param infoList @return list with the vertices corresponding to the types in the list. @throws AtlasException """ List<AtlasVertex> re...
java
private List<AtlasVertex> createVertices(List<TypeVertexInfo> infoList) throws AtlasException { List<AtlasVertex> result = new ArrayList<>(infoList.size()); List<String> typeNames = Lists.transform(infoList, new Function<TypeVertexInfo,String>() { @Override public String apply(T...
[ "private", "List", "<", "AtlasVertex", ">", "createVertices", "(", "List", "<", "TypeVertexInfo", ">", "infoList", ")", "throws", "AtlasException", "{", "List", "<", "AtlasVertex", ">", "result", "=", "new", "ArrayList", "<>", "(", "infoList", ".", "size", "...
Finds or creates type vertices with the information specified. @param infoList @return list with the vertices corresponding to the types in the list. @throws AtlasException
[ "Finds", "or", "creates", "type", "vertices", "with", "the", "information", "specified", "." ]
train
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java#L361-L393
apache/groovy
subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java
SwingGroovyMethods.putAt
public static void putAt(DefaultListModel self, int index, Object e) { """ Allow DefaultListModel to work with subscript operators.<p> <b>WARNING:</b> this operation does not replace the element at the specified index, rather it inserts the element at that index, thus increasing the size of of the model by 1. ...
java
public static void putAt(DefaultListModel self, int index, Object e) { self.set(index, e); }
[ "public", "static", "void", "putAt", "(", "DefaultListModel", "self", ",", "int", "index", ",", "Object", "e", ")", "{", "self", ".", "set", "(", "index", ",", "e", ")", ";", "}" ]
Allow DefaultListModel to work with subscript operators.<p> <b>WARNING:</b> this operation does not replace the element at the specified index, rather it inserts the element at that index, thus increasing the size of of the model by 1. @param self a DefaultListModel @param index an index @param e the element to i...
[ "Allow", "DefaultListModel", "to", "work", "with", "subscript", "operators", ".", "<p", ">", "<b", ">", "WARNING", ":", "<", "/", "b", ">", "this", "operation", "does", "not", "replace", "the", "element", "at", "the", "specified", "index", "rather", "it", ...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java#L230-L232
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
FSDirectory.getFullPathName
private static String getFullPathName(INode[] inodes, int pos) { """ Return the name of the path represented by inodes at [0, pos] """ StringBuilder fullPathName = new StringBuilder(); for (int i=1; i<=pos; i++) { fullPathName.append(Path.SEPARATOR_CHAR).append(inodes[i].getLocalName()); } ...
java
private static String getFullPathName(INode[] inodes, int pos) { StringBuilder fullPathName = new StringBuilder(); for (int i=1; i<=pos; i++) { fullPathName.append(Path.SEPARATOR_CHAR).append(inodes[i].getLocalName()); } return fullPathName.toString(); }
[ "private", "static", "String", "getFullPathName", "(", "INode", "[", "]", "inodes", ",", "int", "pos", ")", "{", "StringBuilder", "fullPathName", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "pos", ";", ...
Return the name of the path represented by inodes at [0, pos]
[ "Return", "the", "name", "of", "the", "path", "represented", "by", "inodes", "at", "[", "0", "pos", "]" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2184-L2190
beangle/beangle3
commons/core/src/main/java/org/beangle/commons/lang/BitStrings.java
BitStrings.andWith
public static String andWith(final String str, final String boolString) { """ 将一个字符串,按照boolString的形式进行变化. 如果boolString[i]!=0则保留str[i],否则置0 @param str a {@link java.lang.String} object. @param boolString a {@link java.lang.String} object. @return a {@link java.lang.String} object. """ if (Strings.isEmp...
java
public static String andWith(final String str, final String boolString) { if (Strings.isEmpty(str)) { return null; } if (Strings.isEmpty(boolString)) { return str; } if (str.length() < boolString.length()) { return str; } final StringBuilder buffer = new StringBuilder(str); for (int i = 0; i < buffe...
[ "public", "static", "String", "andWith", "(", "final", "String", "str", ",", "final", "String", "boolString", ")", "{", "if", "(", "Strings", ".", "isEmpty", "(", "str", ")", ")", "{", "return", "null", ";", "}", "if", "(", "Strings", ".", "isEmpty", ...
将一个字符串,按照boolString的形式进行变化. 如果boolString[i]!=0则保留str[i],否则置0 @param str a {@link java.lang.String} object. @param boolString a {@link java.lang.String} object. @return a {@link java.lang.String} object.
[ "将一个字符串,按照boolString的形式进行变化", ".", "如果boolString", "[", "i", "]", "!", "=", "0则保留str", "[", "i", "]", "否则置0" ]
train
https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/lang/BitStrings.java#L80-L91
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/javac/file/JavacFileManager.java
JavacFileManager.openArchive
protected Archive openArchive(File zipFilename) throws IOException { """ /* This method looks for a ZipFormatException and takes appropriate evasive action. If there is a failure in the fast mode then we fail over to the platform zip, and allow it to deal with a potentially non compliant zip file. """ ...
java
protected Archive openArchive(File zipFilename) throws IOException { try { return openArchive(zipFilename, contextUseOptimizedZip); } catch (IOException ioe) { if (ioe instanceof ZipFileIndex.ZipFormatException) { return openArchive(zipFilename, false); ...
[ "protected", "Archive", "openArchive", "(", "File", "zipFilename", ")", "throws", "IOException", "{", "try", "{", "return", "openArchive", "(", "zipFilename", ",", "contextUseOptimizedZip", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "if", "("...
/* This method looks for a ZipFormatException and takes appropriate evasive action. If there is a failure in the fast mode then we fail over to the platform zip, and allow it to deal with a potentially non compliant zip file.
[ "/", "*", "This", "method", "looks", "for", "a", "ZipFormatException", "and", "takes", "appropriate", "evasive", "action", ".", "If", "there", "is", "a", "failure", "in", "the", "fast", "mode", "then", "we", "fail", "over", "to", "the", "platform", "zip", ...
train
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java#L460-L470
Azure/azure-sdk-for-java
postgresql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/postgresql/v2017_12_01/implementation/VirtualNetworkRulesInner.java
VirtualNetworkRulesInner.beginCreateOrUpdateAsync
public Observable<VirtualNetworkRuleInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner parameters) { """ Creates or updates an existing virtual network rule. @param resourceGroupName The name of the resource group that contains the...
java
public Observable<VirtualNetworkRuleInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String virtualNetworkRuleName, VirtualNetworkRuleInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, virtualNetworkRuleName, parameters).map(new Func...
[ "public", "Observable", "<", "VirtualNetworkRuleInner", ">", "beginCreateOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "virtualNetworkRuleName", ",", "VirtualNetworkRuleInner", "parameters", ")", "{", "return", "beginCreateO...
Creates or updates an existing virtual network rule. @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 virtualNetworkRuleName The name of the virtual network r...
[ "Creates", "or", "updates", "an", "existing", "virtual", "network", "rule", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/postgresql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/postgresql/v2017_12_01/implementation/VirtualNetworkRulesInner.java#L312-L319
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.findIndexValues
public static List<Number> findIndexValues(Object self, Closure condition) { """ Iterates over the elements of an aggregate of items and returns the index values of the items that match the condition specified in the closure. @param self the iteration object over which to iterate @param condition the mat...
java
public static List<Number> findIndexValues(Object self, Closure condition) { return findIndexValues(self, 0, condition); }
[ "public", "static", "List", "<", "Number", ">", "findIndexValues", "(", "Object", "self", ",", "Closure", "condition", ")", "{", "return", "findIndexValues", "(", "self", ",", "0", ",", "condition", ")", ";", "}" ]
Iterates over the elements of an aggregate of items and returns the index values of the items that match the condition specified in the closure. @param self the iteration object over which to iterate @param condition the matching condition @return a list of numbers corresponding to the index values of all matched...
[ "Iterates", "over", "the", "elements", "of", "an", "aggregate", "of", "items", "and", "returns", "the", "index", "values", "of", "the", "items", "that", "match", "the", "condition", "specified", "in", "the", "closure", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L16944-L16946
NessComputing/components-ness-config
src/main/java/com/nesscomputing/config/Config.java
Config.getConfig
public static Config getConfig(@Nonnull final URI configLocation, @Nullable final String configName) { """ Load Configuration, using the supplied URI as base. The loaded configuration can be overridden using system properties. """ final ConfigFactory configFactory = new ConfigFactory(configLocation, c...
java
public static Config getConfig(@Nonnull final URI configLocation, @Nullable final String configName) { final ConfigFactory configFactory = new ConfigFactory(configLocation, configName); return new Config(configFactory.load()); }
[ "public", "static", "Config", "getConfig", "(", "@", "Nonnull", "final", "URI", "configLocation", ",", "@", "Nullable", "final", "String", "configName", ")", "{", "final", "ConfigFactory", "configFactory", "=", "new", "ConfigFactory", "(", "configLocation", ",", ...
Load Configuration, using the supplied URI as base. The loaded configuration can be overridden using system properties.
[ "Load", "Configuration", "using", "the", "supplied", "URI", "as", "base", ".", "The", "loaded", "configuration", "can", "be", "overridden", "using", "system", "properties", "." ]
train
https://github.com/NessComputing/components-ness-config/blob/eb9b37327a9e612a097f1258eb09d288f475e2cb/src/main/java/com/nesscomputing/config/Config.java#L157-L161
thymeleaf/thymeleaf-spring
thymeleaf-spring4/src/main/java/org/thymeleaf/spring4/expression/SPELContextPropertyAccessor.java
SPELContextPropertyAccessor.checkExecInfo
@Deprecated static Object checkExecInfo(final String propertyName, final EvaluationContext context) { """ Translation from 'execInfo' context variable (${execInfo}) to 'execInfo' expression object (${#execInfo}), needed since 3.0.0. Note this is expressed as a separate method in order to mark this as depre...
java
@Deprecated static Object checkExecInfo(final String propertyName, final EvaluationContext context) { if ("execInfo".equals(propertyName)) { if (!(context instanceof IThymeleafEvaluationContext)) { throw new TemplateProcessingException( "Found Thymeleaf St...
[ "@", "Deprecated", "static", "Object", "checkExecInfo", "(", "final", "String", "propertyName", ",", "final", "EvaluationContext", "context", ")", "{", "if", "(", "\"execInfo\"", ".", "equals", "(", "propertyName", ")", ")", "{", "if", "(", "!", "(", "contex...
Translation from 'execInfo' context variable (${execInfo}) to 'execInfo' expression object (${#execInfo}), needed since 3.0.0. Note this is expressed as a separate method in order to mark this as deprecated and make it easily locatable. @param propertyName the name of the property being accessed (we are looking for '...
[ "Translation", "from", "execInfo", "context", "variable", "(", "$", "{", "execInfo", "}", ")", "to", "execInfo", "expression", "object", "(", "$", "{", "#execInfo", "}", ")", "needed", "since", "3", ".", "0", ".", "0", "." ]
train
https://github.com/thymeleaf/thymeleaf-spring/blob/9aa15a19017a0938e57646e3deefb8a90ab78dcb/thymeleaf-spring4/src/main/java/org/thymeleaf/spring4/expression/SPELContextPropertyAccessor.java#L144-L167
mapbox/mapbox-navigation-android
libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/ThemeSwitcher.java
ThemeSwitcher.setTheme
static void setTheme(Context context, AttributeSet attrs) { """ Called in onCreate() to check the UI Mode (day or night) and set the theme colors accordingly. @param context {@link NavigationView} where the theme will be set @param attrs holding custom styles if any are set """ boolean nightModeEnab...
java
static void setTheme(Context context, AttributeSet attrs) { boolean nightModeEnabled = isNightModeEnabled(context); if (shouldSetThemeFromPreferences(context)) { int prefLightTheme = retrieveThemeResIdFromPreferences(context, NavigationConstants.NAVIGATION_VIEW_LIGHT_THEME); int prefDarkTheme = ret...
[ "static", "void", "setTheme", "(", "Context", "context", ",", "AttributeSet", "attrs", ")", "{", "boolean", "nightModeEnabled", "=", "isNightModeEnabled", "(", "context", ")", ";", "if", "(", "shouldSetThemeFromPreferences", "(", "context", ")", ")", "{", "int",...
Called in onCreate() to check the UI Mode (day or night) and set the theme colors accordingly. @param context {@link NavigationView} where the theme will be set @param attrs holding custom styles if any are set
[ "Called", "in", "onCreate", "()", "to", "check", "the", "UI", "Mode", "(", "day", "or", "night", ")", "and", "set", "the", "theme", "colors", "accordingly", "." ]
train
https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/ThemeSwitcher.java#L86-L106
xwiki/xwiki-rendering
xwiki-rendering-transformations/xwiki-rendering-transformation-macro/src/main/java/org/xwiki/rendering/internal/macro/DefaultMacroContentParser.java
DefaultMacroContentParser.getSyntaxParser
private Parser getSyntaxParser(Syntax syntax) throws MacroExecutionException { """ Get the parser for the current syntax. @param syntax the current syntax of the title content @return the parser for the current syntax @throws org.xwiki.rendering.macro.MacroExecutionException Failed to find source parser. ...
java
private Parser getSyntaxParser(Syntax syntax) throws MacroExecutionException { try { return this.componentManager.getInstance(Parser.class, syntax.toIdString()); } catch (ComponentLookupException e) { throw new MacroExecutionException("Failed to find source parser for syntax ...
[ "private", "Parser", "getSyntaxParser", "(", "Syntax", "syntax", ")", "throws", "MacroExecutionException", "{", "try", "{", "return", "this", ".", "componentManager", ".", "getInstance", "(", "Parser", ".", "class", ",", "syntax", ".", "toIdString", "(", ")", ...
Get the parser for the current syntax. @param syntax the current syntax of the title content @return the parser for the current syntax @throws org.xwiki.rendering.macro.MacroExecutionException Failed to find source parser.
[ "Get", "the", "parser", "for", "the", "current", "syntax", "." ]
train
https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-transformations/xwiki-rendering-transformation-macro/src/main/java/org/xwiki/rendering/internal/macro/DefaultMacroContentParser.java#L183-L190
sebastiangraf/treetank
coremodules/core/src/main/java/org/treetank/access/conf/StorageConfiguration.java
StorageConfiguration.deserialize
public static StorageConfiguration deserialize(final File pFile) throws TTIOException { """ Generate a StorageConfiguration out of a file. @param pFile where the StorageConfiguration lies in as json @return a new {@link StorageConfiguration} class @throws TTIOException """ try { FileR...
java
public static StorageConfiguration deserialize(final File pFile) throws TTIOException { try { FileReader fileReader = new FileReader(new File(pFile, Paths.ConfigBinary.getFile().getName())); JsonReader jsonReader = new JsonReader(fileReader); jsonReader.beginObject(); ...
[ "public", "static", "StorageConfiguration", "deserialize", "(", "final", "File", "pFile", ")", "throws", "TTIOException", "{", "try", "{", "FileReader", "fileReader", "=", "new", "FileReader", "(", "new", "File", "(", "pFile", ",", "Paths", ".", "ConfigBinary", ...
Generate a StorageConfiguration out of a file. @param pFile where the StorageConfiguration lies in as json @return a new {@link StorageConfiguration} class @throws TTIOException
[ "Generate", "a", "StorageConfiguration", "out", "of", "a", "file", "." ]
train
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/coremodules/core/src/main/java/org/treetank/access/conf/StorageConfiguration.java#L172-L186
TrueNight/Utils
safe-typeface/src/main/java/xyz/truenight/safetypeface/SafeTypeface.java
SafeTypeface.createFromAsset
public static Typeface createFromAsset(AssetManager mgr, String path) { """ Create a new typeface from the specified font data. @param mgr The application's asset manager @param path The file name of the font data in the assets directory @return The new typeface. """ Typeface typeface = TYPEFACES...
java
public static Typeface createFromAsset(AssetManager mgr, String path) { Typeface typeface = TYPEFACES.get(path); if (typeface != null) { return typeface; } else { typeface = Typeface.createFromAsset(mgr, path); TYPEFACES.put(path, typeface); return...
[ "public", "static", "Typeface", "createFromAsset", "(", "AssetManager", "mgr", ",", "String", "path", ")", "{", "Typeface", "typeface", "=", "TYPEFACES", ".", "get", "(", "path", ")", ";", "if", "(", "typeface", "!=", "null", ")", "{", "return", "typeface"...
Create a new typeface from the specified font data. @param mgr The application's asset manager @param path The file name of the font data in the assets directory @return The new typeface.
[ "Create", "a", "new", "typeface", "from", "the", "specified", "font", "data", "." ]
train
https://github.com/TrueNight/Utils/blob/78a11faa16258b09f08826797370310ab650530c/safe-typeface/src/main/java/xyz/truenight/safetypeface/SafeTypeface.java#L40-L49
Javacord/Javacord
javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java
ChannelUpdateHandler.handleServerTextChannel
private void handleServerTextChannel(JsonNode jsonChannel) { """ Handles a server text channel update. @param jsonChannel The json channel data. """ long channelId = jsonChannel.get("id").asLong(); api.getTextChannelById(channelId).map(c -> ((ServerTextChannelImpl) c)).ifPresent(channel -> {...
java
private void handleServerTextChannel(JsonNode jsonChannel) { long channelId = jsonChannel.get("id").asLong(); api.getTextChannelById(channelId).map(c -> ((ServerTextChannelImpl) c)).ifPresent(channel -> { String oldTopic = channel.getTopic(); String newTopic = jsonChannel.has("to...
[ "private", "void", "handleServerTextChannel", "(", "JsonNode", "jsonChannel", ")", "{", "long", "channelId", "=", "jsonChannel", ".", "get", "(", "\"id\"", ")", ".", "asLong", "(", ")", ";", "api", ".", "getTextChannelById", "(", "channelId", ")", ".", "map"...
Handles a server text channel update. @param jsonChannel The json channel data.
[ "Handles", "a", "server", "text", "channel", "update", "." ]
train
https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/util/handler/channel/ChannelUpdateHandler.java#L272-L311
JOML-CI/JOML
src/org/joml/Matrix3x2d.java
Matrix3x2d.unprojectInv
public Vector2d unprojectInv(double winX, double winY, int[] viewport, Vector2d dest) { """ Unproject the given window coordinates <code>(winX, winY)</code> by <code>this</code> matrix using the specified viewport. <p> This method differs from {@link #unproject(double, double, int[], Vector2d) unproject()} in t...
java
public Vector2d unprojectInv(double winX, double winY, int[] viewport, Vector2d dest) { double ndcX = (winX-viewport[0])/viewport[2]*2.0-1.0; double ndcY = (winY-viewport[1])/viewport[3]*2.0-1.0; dest.x = m00 * ndcX + m10 * ndcY + m20; dest.y = m01 * ndcX + m11 * ndcY + m21; retu...
[ "public", "Vector2d", "unprojectInv", "(", "double", "winX", ",", "double", "winY", ",", "int", "[", "]", "viewport", ",", "Vector2d", "dest", ")", "{", "double", "ndcX", "=", "(", "winX", "-", "viewport", "[", "0", "]", ")", "/", "viewport", "[", "2...
Unproject the given window coordinates <code>(winX, winY)</code> by <code>this</code> matrix using the specified viewport. <p> This method differs from {@link #unproject(double, double, int[], Vector2d) unproject()} in that it assumes that <code>this</code> is already the inverse matrix of the original projection matri...
[ "Unproject", "the", "given", "window", "coordinates", "<code", ">", "(", "winX", "winY", ")", "<", "/", "code", ">", "by", "<code", ">", "this<", "/", "code", ">", "matrix", "using", "the", "specified", "viewport", ".", "<p", ">", "This", "method", "di...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2d.java#L2336-L2342
finmath/finmath-lib
src/main/java6/net/finmath/marketdata/products/SwapAnnuity.java
SwapAnnuity.getSwapAnnuity
public static double getSwapAnnuity(ScheduleInterface schedule, ForwardCurveInterface forwardCurve) { """ Function to calculate an (idealized) single curve swap annuity for a given schedule and forward curve. The discount curve used to calculate the annuity is calculated from the forward curve using classical si...
java
public static double getSwapAnnuity(ScheduleInterface schedule, ForwardCurveInterface forwardCurve) { DiscountCurveInterface discountCurve = new DiscountCurveFromForwardCurve(forwardCurve.getName()); double evaluationTime = 0.0; // Consider only payment time > 0 return getSwapAnnuity(evaluationTime, schedule, dis...
[ "public", "static", "double", "getSwapAnnuity", "(", "ScheduleInterface", "schedule", ",", "ForwardCurveInterface", "forwardCurve", ")", "{", "DiscountCurveInterface", "discountCurve", "=", "new", "DiscountCurveFromForwardCurve", "(", "forwardCurve", ".", "getName", "(", ...
Function to calculate an (idealized) single curve swap annuity for a given schedule and forward curve. The discount curve used to calculate the annuity is calculated from the forward curve using classical single curve interpretations of forwards and a default period length. The may be a crude approximation. Note: This...
[ "Function", "to", "calculate", "an", "(", "idealized", ")", "single", "curve", "swap", "annuity", "for", "a", "given", "schedule", "and", "forward", "curve", ".", "The", "discount", "curve", "used", "to", "calculate", "the", "annuity", "is", "calculated", "f...
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/marketdata/products/SwapAnnuity.java#L99-L103
google/error-prone
core/src/main/java/com/google/errorprone/refaster/BlockTemplate.java
BlockTemplate.printStatement
private static String printStatement(Context context, JCStatement statement) { """ Returns a {@code String} representation of a statement, including semicolon. """ StringWriter writer = new StringWriter(); try { pretty(context, writer).printStat(statement); } catch (IOException e) { thr...
java
private static String printStatement(Context context, JCStatement statement) { StringWriter writer = new StringWriter(); try { pretty(context, writer).printStat(statement); } catch (IOException e) { throw new AssertionError("StringWriter cannot throw IOExceptions"); } return writer.toStr...
[ "private", "static", "String", "printStatement", "(", "Context", "context", ",", "JCStatement", "statement", ")", "{", "StringWriter", "writer", "=", "new", "StringWriter", "(", ")", ";", "try", "{", "pretty", "(", "context", ",", "writer", ")", ".", "printS...
Returns a {@code String} representation of a statement, including semicolon.
[ "Returns", "a", "{" ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/refaster/BlockTemplate.java#L176-L184
artikcloud/artikcloud-java
src/main/java/cloud/artik/api/UsersApi.java
UsersApi.getUserDevicesAsync
public com.squareup.okhttp.Call getUserDevicesAsync(String userId, Integer offset, Integer count, Boolean includeProperties, String owner, Boolean includeShareInfo, String dtid, final ApiCallback<DevicesEnvelope> callback) throws ApiException { """ Get User Devices (asynchronously) Retrieve User&#39;s Devices @p...
java
public com.squareup.okhttp.Call getUserDevicesAsync(String userId, Integer offset, Integer count, Boolean includeProperties, String owner, Boolean includeShareInfo, String dtid, final ApiCallback<DevicesEnvelope> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ...
[ "public", "com", ".", "squareup", ".", "okhttp", ".", "Call", "getUserDevicesAsync", "(", "String", "userId", ",", "Integer", "offset", ",", "Integer", "count", ",", "Boolean", "includeProperties", ",", "String", "owner", ",", "Boolean", "includeShareInfo", ",",...
Get User Devices (asynchronously) Retrieve User&#39;s Devices @param userId User ID (required) @param offset Offset for pagination. (optional) @param count Desired count of items in the result set (optional) @param includeProperties Optional. Boolean (true/false) - If false, only return the user&#39;s device types. If ...
[ "Get", "User", "Devices", "(", "asynchronously", ")", "Retrieve", "User&#39", ";", "s", "Devices" ]
train
https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/UsersApi.java#L686-L711
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/lib/MultipleOutputFormat.java
MultipleOutputFormat.getRecordWriter
public RecordWriter<K, V> getRecordWriter(FileSystem fs, JobConf job, String name, Progressable arg3) throws IOException { """ Create a composite record writer that can write key/value data to different output files @param fs the file system to use @param job the job conf for the job @param name the...
java
public RecordWriter<K, V> getRecordWriter(FileSystem fs, JobConf job, String name, Progressable arg3) throws IOException { final FileSystem myFS = fs; final String myName = generateLeafFileName(name); final JobConf myJob = job; final Progressable myProgressable = arg3; return new RecordWrite...
[ "public", "RecordWriter", "<", "K", ",", "V", ">", "getRecordWriter", "(", "FileSystem", "fs", ",", "JobConf", "job", ",", "String", "name", ",", "Progressable", "arg3", ")", "throws", "IOException", "{", "final", "FileSystem", "myFS", "=", "fs", ";", "fin...
Create a composite record writer that can write key/value data to different output files @param fs the file system to use @param job the job conf for the job @param name the leaf file name for the output file (such as part-00000") @param arg3 a progressable for reporting progress. @return a composite record writer @th...
[ "Create", "a", "composite", "record", "writer", "that", "can", "write", "key", "/", "value", "data", "to", "different", "output", "files" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/MultipleOutputFormat.java#L69-L114
javagl/Common
src/main/java/de/javagl/common/xml/XmlUtils.java
XmlUtils.readEnum
static <E extends Enum<E>> E readEnum(Node node, Class<E> enumClass) { """ Parse an enum value from the first child of the given node. @param <E> The enum type @param node The node @param enumClass The enum class @return The enum value @throws XmlException If the given node was <code>null</code>, or no e...
java
static <E extends Enum<E>> E readEnum(Node node, Class<E> enumClass) { if (node == null) { throw new XmlException( "Tried to read "+enumClass.getSimpleName()+ " value from null node"); } String value = node.getFirstChild().getNodeVa...
[ "static", "<", "E", "extends", "Enum", "<", "E", ">", ">", "E", "readEnum", "(", "Node", "node", ",", "Class", "<", "E", ">", "enumClass", ")", "{", "if", "(", "node", "==", "null", ")", "{", "throw", "new", "XmlException", "(", "\"Tried to read \"",...
Parse an enum value from the first child of the given node. @param <E> The enum type @param node The node @param enumClass The enum class @return The enum value @throws XmlException If the given node was <code>null</code>, or no enum value could be parsed
[ "Parse", "an", "enum", "value", "from", "the", "first", "child", "of", "the", "given", "node", "." ]
train
https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/xml/XmlUtils.java#L581-L606
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/DataGridStateFactory.java
DataGridStateFactory.attachDataGridState
public final void attachDataGridState(String name, DataGridState state) { """ <p> Convenience method that allows a {@link DataGridState} object from a client to be attached to the factory. This allows subsequent calls to retrieve this same {@link DataGridState} instance. </p> @param name the name of the da...
java
public final void attachDataGridState(String name, DataGridState state) { DataGridStateCodec codec = lookupCodec(name, DEFAULT_DATA_GRID_CONFIG); codec.setDataGridState(state); }
[ "public", "final", "void", "attachDataGridState", "(", "String", "name", ",", "DataGridState", "state", ")", "{", "DataGridStateCodec", "codec", "=", "lookupCodec", "(", "name", ",", "DEFAULT_DATA_GRID_CONFIG", ")", ";", "codec", ".", "setDataGridState", "(", "sta...
<p> Convenience method that allows a {@link DataGridState} object from a client to be attached to the factory. This allows subsequent calls to retrieve this same {@link DataGridState} instance. </p> @param name the name of the data grid @param state the {@link DataGridState} object to attach
[ "<p", ">", "Convenience", "method", "that", "allows", "a", "{", "@link", "DataGridState", "}", "object", "from", "a", "client", "to", "be", "attached", "to", "the", "factory", ".", "This", "allows", "subsequent", "calls", "to", "retrieve", "this", "same", ...
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/DataGridStateFactory.java#L172-L175
jronrun/benayn
benayn-ustyle/src/main/java/com/benayn/ustyle/Dater.java
Dater.of
public static Dater of(Date date, String pattern) { """ Returns a new Dater instance with the given date and pattern @param date @return """ return of(date).with(pattern); }
java
public static Dater of(Date date, String pattern) { return of(date).with(pattern); }
[ "public", "static", "Dater", "of", "(", "Date", "date", ",", "String", "pattern", ")", "{", "return", "of", "(", "date", ")", ".", "with", "(", "pattern", ")", ";", "}" ]
Returns a new Dater instance with the given date and pattern @param date @return
[ "Returns", "a", "new", "Dater", "instance", "with", "the", "given", "date", "and", "pattern" ]
train
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/Dater.java#L244-L246
eyp/serfj
src/main/java/net/sf/serfj/ServletHelper.java
ServletHelper.signatureStrategy
private Object signatureStrategy(UrlInfo urlInfo, ResponseHelper responseHelper) throws ClassNotFoundException, IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException { """ Invokes URL's action using SIGNATURE strategy. It means that controller's method could hav...
java
private Object signatureStrategy(UrlInfo urlInfo, ResponseHelper responseHelper) throws ClassNotFoundException, IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException { Class<?> clazz = Class.forName(urlInfo.getController()); Object result = null; // action(Respo...
[ "private", "Object", "signatureStrategy", "(", "UrlInfo", "urlInfo", ",", "ResponseHelper", "responseHelper", ")", "throws", "ClassNotFoundException", ",", "IllegalAccessException", ",", "InvocationTargetException", ",", "InstantiationException", ",", "NoSuchMethodException", ...
Invokes URL's action using SIGNATURE strategy. It means that controller's method could have these signatures: - action(ResponseHelper, Map<String,Object>). - action(ResponseHelper). - action(Map<String,Object>). - action(). @param urlInfo Information of REST's URL. @param responseHelper ResponseHelper object to inje...
[ "Invokes", "URL", "s", "action", "using", "SIGNATURE", "strategy", ".", "It", "means", "that", "controller", "s", "method", "could", "have", "these", "signatures", ":" ]
train
https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/ServletHelper.java#L211-L245
OpenLiberty/open-liberty
dev/com.ibm.ws.session/src/com/ibm/ws/session/SessionManager.java
SessionManager.getSession
public Object getSession(String id, int version, boolean isSessionAccess, Object xdCorrelator) { """ This method is invoked by the HttpSessionManagerImpl to get at the session or related session information. If the getSession is a result of a request.getSession call from the application, then the isSessionAcces...
java
public Object getSession(String id, int version, boolean isSessionAccess, Object xdCorrelator) { return getSession(id, version, isSessionAccess, false, xdCorrelator); }
[ "public", "Object", "getSession", "(", "String", "id", ",", "int", "version", ",", "boolean", "isSessionAccess", ",", "Object", "xdCorrelator", ")", "{", "return", "getSession", "(", "id", ",", "version", ",", "isSessionAccess", ",", "false", ",", "xdCorrelato...
This method is invoked by the HttpSessionManagerImpl to get at the session or related session information. If the getSession is a result of a request.getSession call from the application, then the isSessionAccess boolean is set to true. Also if the version number is available, then it is provided. If not, then a value ...
[ "This", "method", "is", "invoked", "by", "the", "HttpSessionManagerImpl", "to", "get", "at", "the", "session", "or", "related", "session", "information", ".", "If", "the", "getSession", "is", "a", "result", "of", "a", "request", ".", "getSession", "call", "f...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session/src/com/ibm/ws/session/SessionManager.java#L433-L435
timols/java-gitlab-api
src/main/java/org/gitlab/api/GitlabAPI.java
GitlabAPI.createGroup
public GitlabGroup createGroup(String name, String path, String ldapCn, GitlabAccessLevel ldapAccess, GitlabUser sudoUser, Integer parentId) throws IOException { """ Creates a Group @param name The name of the group @param path The path for the group @param ldapCn LDAP Group Name to sync with,...
java
public GitlabGroup createGroup(String name, String path, String ldapCn, GitlabAccessLevel ldapAccess, GitlabUser sudoUser, Integer parentId) throws IOException { Query query = new Query() .append("name", name) .append("path", path) .appendIf("ldap_cn", ldapCn) ...
[ "public", "GitlabGroup", "createGroup", "(", "String", "name", ",", "String", "path", ",", "String", "ldapCn", ",", "GitlabAccessLevel", "ldapAccess", ",", "GitlabUser", "sudoUser", ",", "Integer", "parentId", ")", "throws", "IOException", "{", "Query", "query", ...
Creates a Group @param name The name of the group @param path The path for the group @param ldapCn LDAP Group Name to sync with, null otherwise @param ldapAccess Access level for LDAP group members, null otherwise @param sudoUser The user to create the group on behalf of @param parentId The id of a...
[ "Creates", "a", "Group" ]
train
https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L636-L649
joniles/mpxj
src/main/java/net/sf/mpxj/mpp/FieldMap.java
FieldMap.createEnterpriseCustomFieldMap
public void createEnterpriseCustomFieldMap(Props props, Class<?> c) { """ Create a field map for enterprise custom fields. @param props props data @param c target class """ byte[] fieldMapData = null; for (Integer key : ENTERPRISE_CUSTOM_KEYS) { fieldMapData = props.getByteArray(...
java
public void createEnterpriseCustomFieldMap(Props props, Class<?> c) { byte[] fieldMapData = null; for (Integer key : ENTERPRISE_CUSTOM_KEYS) { fieldMapData = props.getByteArray(key); if (fieldMapData != null) { break; } } if (fieldMapData...
[ "public", "void", "createEnterpriseCustomFieldMap", "(", "Props", "props", ",", "Class", "<", "?", ">", "c", ")", "{", "byte", "[", "]", "fieldMapData", "=", "null", ";", "for", "(", "Integer", "key", ":", "ENTERPRISE_CUSTOM_KEYS", ")", "{", "fieldMapData", ...
Create a field map for enterprise custom fields. @param props props data @param c target class
[ "Create", "a", "field", "map", "for", "enterprise", "custom", "fields", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/FieldMap.java#L316-L349
RestComm/sip-servlets
sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SessionManagerUtil.java
SessionManagerUtil.parseHaSipSessionKey
public static SipSessionKey parseHaSipSessionKey( String sipSessionKey, String sipAppSessionId, String sipApplicationName) throws ParseException { """ Parse a sip application key that was previously generated and put as an http request param through the encodeURL method of SipApplicationSession @param sipSes...
java
public static SipSessionKey parseHaSipSessionKey( String sipSessionKey, String sipAppSessionId, String sipApplicationName) throws ParseException { if(logger.isDebugEnabled()) { logger.debug("parseHaSipSessionKey - sipSessionKey=" + sipSessionKey + ", sipAppSessionId=" + sipAppSessionId + ", sipApplicationNam...
[ "public", "static", "SipSessionKey", "parseHaSipSessionKey", "(", "String", "sipSessionKey", ",", "String", "sipAppSessionId", ",", "String", "sipApplicationName", ")", "throws", "ParseException", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", ...
Parse a sip application key that was previously generated and put as an http request param through the encodeURL method of SipApplicationSession @param sipSessionKey the stringified version of the sip application key @return the corresponding sip application session key @throws ParseException if the stringfied key cann...
[ "Parse", "a", "sip", "application", "key", "that", "was", "previously", "generated", "and", "put", "as", "an", "http", "request", "param", "through", "the", "encodeURL", "method", "of", "SipApplicationSession" ]
train
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SessionManagerUtil.java#L208-L219
jMetal/jMetal
jmetal-core/src/main/java/org/uma/jmetal/util/SolutionListUtils.java
SolutionListUtils.selectNRandomDifferentSolutions
public static <S> List<S> selectNRandomDifferentSolutions( int numberOfSolutionsToBeReturned, List<S> solutionList) { """ This method receives a normalized list of non-dominated solutions and return the inverted one. This operation is needed for minimization problem @param solutionList The front to inver...
java
public static <S> List<S> selectNRandomDifferentSolutions( int numberOfSolutionsToBeReturned, List<S> solutionList) { JMetalRandom random = JMetalRandom.getInstance(); return selectNRandomDifferentSolutions(numberOfSolutionsToBeReturned, solutionList, (low, up) -> random.nextInt(low, up)); }
[ "public", "static", "<", "S", ">", "List", "<", "S", ">", "selectNRandomDifferentSolutions", "(", "int", "numberOfSolutionsToBeReturned", ",", "List", "<", "S", ">", "solutionList", ")", "{", "JMetalRandom", "random", "=", "JMetalRandom", ".", "getInstance", "("...
This method receives a normalized list of non-dominated solutions and return the inverted one. This operation is needed for minimization problem @param solutionList The front to invert @return The inverted front
[ "This", "method", "receives", "a", "normalized", "list", "of", "non", "-", "dominated", "solutions", "and", "return", "the", "inverted", "one", ".", "This", "operation", "is", "needed", "for", "minimization", "problem" ]
train
https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/SolutionListUtils.java#L198-L202
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java
TableFormBuilder.addBinding
public JComponent[] addBinding(Binding binding, JComponent wrappedControl, String attributes) { """ adds a field binding to the form @param binding the binding of the field @param wrappedControl the optional wrapped component. If null the component of the binding is used. This Parameter should be used if th...
java
public JComponent[] addBinding(Binding binding, JComponent wrappedControl, String attributes) { return addBinding(binding, wrappedControl, attributes, getLabelAttributes()); }
[ "public", "JComponent", "[", "]", "addBinding", "(", "Binding", "binding", ",", "JComponent", "wrappedControl", ",", "String", "attributes", ")", "{", "return", "addBinding", "(", "binding", ",", "wrappedControl", ",", "attributes", ",", "getLabelAttributes", "(",...
adds a field binding to the form @param binding the binding of the field @param wrappedControl the optional wrapped component. If null the component of the binding is used. This Parameter should be used if the component of the binding is being wrapped inside this component @param attributes optional layout attributes ...
[ "adds", "a", "field", "binding", "to", "the", "form" ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java#L411-L413
networknt/light-4j
consul/src/main/java/com/networknt/consul/ConsulUtils.java
ConsulUtils.isSame
public static boolean isSame(List<URL> urls1, List<URL> urls2) { """ Check if two lists have the same urls. If any list is empty, return false @param urls1 first url list @param urls2 second url list @return boolean true when they are the same """ if (urls1 == null || urls2 == null) { ...
java
public static boolean isSame(List<URL> urls1, List<URL> urls2) { if (urls1 == null || urls2 == null) { return false; } if (urls1.size() != urls2.size()) { return false; } return urls1.containsAll(urls2); }
[ "public", "static", "boolean", "isSame", "(", "List", "<", "URL", ">", "urls1", ",", "List", "<", "URL", ">", "urls2", ")", "{", "if", "(", "urls1", "==", "null", "||", "urls2", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "url...
Check if two lists have the same urls. If any list is empty, return false @param urls1 first url list @param urls2 second url list @return boolean true when they are the same
[ "Check", "if", "two", "lists", "have", "the", "same", "urls", ".", "If", "any", "list", "is", "empty", "return", "false" ]
train
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/consul/src/main/java/com/networknt/consul/ConsulUtils.java#L38-L46
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java
ToStream.startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { """ Begin the scope of a prefix-URI Namespace mapping just before another element is about to start. This call will close any open tags so that the prefix mapping will not apply to the current element, but the up...
java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { // the "true" causes the flush of any open tags startPrefixMapping(prefix, uri, true); }
[ "public", "void", "startPrefixMapping", "(", "String", "prefix", ",", "String", "uri", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "// the \"true\" causes the flush of any open tags", "startPrefixMapping", "(", "prefix", ",", "uri", ",", ...
Begin the scope of a prefix-URI Namespace mapping just before another element is about to start. This call will close any open tags so that the prefix mapping will not apply to the current element, but the up comming child. @see org.xml.sax.ContentHandler#startPrefixMapping @param prefix The Namespace prefix being de...
[ "Begin", "the", "scope", "of", "a", "prefix", "-", "URI", "Namespace", "mapping", "just", "before", "another", "element", "is", "about", "to", "start", ".", "This", "call", "will", "close", "any", "open", "tags", "so", "that", "the", "prefix", "mapping", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java#L2295-L2300
kiswanij/jk-util
src/main/java/com/jk/util/JKHttpUtil.java
JKHttpUtil.requestUrl
public static String requestUrl(final String url, final String method, final Properties header, final String body) { """ Send http request. @param url the url @param method the method @param header the header @param body the body @return the string """ try { final URL siteUrl = new URL(url); ...
java
public static String requestUrl(final String url, final String method, final Properties header, final String body) { try { final URL siteUrl = new URL(url); final HttpURLConnection connection = (HttpURLConnection) siteUrl.openConnection(); connection.setRequestMethod(method); final Enumeration<?> keys = h...
[ "public", "static", "String", "requestUrl", "(", "final", "String", "url", ",", "final", "String", "method", ",", "final", "Properties", "header", ",", "final", "String", "body", ")", "{", "try", "{", "final", "URL", "siteUrl", "=", "new", "URL", "(", "u...
Send http request. @param url the url @param method the method @param header the header @param body the body @return the string
[ "Send", "http", "request", "." ]
train
https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKHttpUtil.java#L98-L124
mgm-tp/jfunk
jfunk-common/src/main/java/com/mgmtp/jfunk/common/cli/CliUtils.java
CliUtils.executeCommandLine
public static CliOutput executeCommandLine(final Commandline cli, final String loggerName, final String logMessagePrefix, final InputStream inputStream, final int timeoutInSeconds) { """ Executes the specified command line and blocks until the process has finished or till the timeout is reached. The output of ...
java
public static CliOutput executeCommandLine(final Commandline cli, final String loggerName, final String logMessagePrefix, final InputStream inputStream, final int timeoutInSeconds) { try { String cliString = CommandLineUtils.toString(cli.getShellCommandline()); LOGGER.info("Executing command-line: {}", cliSt...
[ "public", "static", "CliOutput", "executeCommandLine", "(", "final", "Commandline", "cli", ",", "final", "String", "loggerName", ",", "final", "String", "logMessagePrefix", ",", "final", "InputStream", "inputStream", ",", "final", "int", "timeoutInSeconds", ")", "{"...
Executes the specified command line and blocks until the process has finished or till the timeout is reached. The output of the process is captured, returned, as well as logged with info (stdout) and error (stderr) level, respectively. @param cli the command line @param loggerName the name of the logger to use (passed...
[ "Executes", "the", "specified", "command", "line", "and", "blocks", "until", "the", "process", "has", "finished", "or", "till", "the", "timeout", "is", "reached", ".", "The", "output", "of", "the", "process", "is", "captured", "returned", "as", "well", "as",...
train
https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/cli/CliUtils.java#L153-L167
mojohaus/mrm
mrm-servlet/src/main/java/org/codehaus/mojo/mrm/impl/DiskFileSystem.java
DiskFileSystem.toFile
private File toFile( Entry entry ) { """ Convert an entry into the corresponding file path. @param entry the entry. @return the corresponding file. @since 1.0 """ Stack<String> stack = new Stack<String>(); Entry entryRoot = entry.getFileSystem().getRoot(); while ( entry != null && ...
java
private File toFile( Entry entry ) { Stack<String> stack = new Stack<String>(); Entry entryRoot = entry.getFileSystem().getRoot(); while ( entry != null && !entryRoot.equals( entry ) ) { String name = entry.getName(); if ( "..".equals( name ) ) { ...
[ "private", "File", "toFile", "(", "Entry", "entry", ")", "{", "Stack", "<", "String", ">", "stack", "=", "new", "Stack", "<", "String", ">", "(", ")", ";", "Entry", "entryRoot", "=", "entry", ".", "getFileSystem", "(", ")", ".", "getRoot", "(", ")", ...
Convert an entry into the corresponding file path. @param entry the entry. @return the corresponding file. @since 1.0
[ "Convert", "an", "entry", "into", "the", "corresponding", "file", "path", "." ]
train
https://github.com/mojohaus/mrm/blob/ecbe54a1866f210c10bf2e9274b63d4804d6a151/mrm-servlet/src/main/java/org/codehaus/mojo/mrm/impl/DiskFileSystem.java#L120-L146
alkacon/opencms-core
src-setup/org/opencms/setup/CmsSetupDb.java
CmsSetupDb.updateDatabase
public void updateDatabase(String updateScript, Map<String, String> replacers) { """ Calls an update script.<p> @param updateScript the update script code @param replacers the replacers to use in the script code """ StringReader reader = new StringReader(updateScript); executeSql(reader, r...
java
public void updateDatabase(String updateScript, Map<String, String> replacers) { StringReader reader = new StringReader(updateScript); executeSql(reader, replacers, true); }
[ "public", "void", "updateDatabase", "(", "String", "updateScript", ",", "Map", "<", "String", ",", "String", ">", "replacers", ")", "{", "StringReader", "reader", "=", "new", "StringReader", "(", "updateScript", ")", ";", "executeSql", "(", "reader", ",", "r...
Calls an update script.<p> @param updateScript the update script code @param replacers the replacers to use in the script code
[ "Calls", "an", "update", "script", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/CmsSetupDb.java#L540-L544
DDTH/ddth-commons
ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DPathUtils.java
DPathUtils.getValue
public static <T> T getValue(Object target, String dPath, Class<T> clazz) { """ Extract a value from the target object using DPath expression (generic version). @param target @param dPath @param clazz @return """ if (clazz == null) { throw new NullPointerException("Class parameter is...
java
public static <T> T getValue(Object target, String dPath, Class<T> clazz) { if (clazz == null) { throw new NullPointerException("Class parameter is null!"); } Object temp = getValue(target, dPath); return ValueUtils.convertValue(temp, clazz); }
[ "public", "static", "<", "T", ">", "T", "getValue", "(", "Object", "target", ",", "String", "dPath", ",", "Class", "<", "T", ">", "clazz", ")", "{", "if", "(", "clazz", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Class param...
Extract a value from the target object using DPath expression (generic version). @param target @param dPath @param clazz @return
[ "Extract", "a", "value", "from", "the", "target", "object", "using", "DPath", "expression", "(", "generic", "version", ")", "." ]
train
https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DPathUtils.java#L383-L389
pressgang-ccms/PressGangCCMSDatasourceProviders
rest-provider/src/main/java/org/jboss/pressgang/ccms/provider/RESTDataProvider.java
RESTDataProvider.getExpansion
protected ExpandDataTrunk getExpansion(final String expansionName, final Map<String, Collection<String>> subExpansionNames) { """ Create an expansion with sub expansions. @param expansionName The name of the root expansion. @param subExpansionNames The list of names to create the branches from. @return The ex...
java
protected ExpandDataTrunk getExpansion(final String expansionName, final Map<String, Collection<String>> subExpansionNames) { final ExpandDataTrunk expandData = new ExpandDataTrunk(new ExpandDataDetails(expansionName)); // Add the sub expansions expandData.setBranches(getExpansionBranches(subExp...
[ "protected", "ExpandDataTrunk", "getExpansion", "(", "final", "String", "expansionName", ",", "final", "Map", "<", "String", ",", "Collection", "<", "String", ">", ">", "subExpansionNames", ")", "{", "final", "ExpandDataTrunk", "expandData", "=", "new", "ExpandDat...
Create an expansion with sub expansions. @param expansionName The name of the root expansion. @param subExpansionNames The list of names to create the branches from. @return The expansion with the branches set.
[ "Create", "an", "expansion", "with", "sub", "expansions", "." ]
train
https://github.com/pressgang-ccms/PressGangCCMSDatasourceProviders/blob/e47588adad0dcd55608b197b37825a512bc8fd25/rest-provider/src/main/java/org/jboss/pressgang/ccms/provider/RESTDataProvider.java#L241-L246
briandilley/jsonrpc4j
src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java
JsonRpcClient.readResponse
@SuppressWarnings("unchecked") public <T> T readResponse(Class<T> clazz, InputStream input) throws Throwable { """ Reads a JSON-PRC response from the server. This blocks until a response is received. @param clazz the expected return type @param input the {@link InputStream} to read from @param <T> the ex...
java
@SuppressWarnings("unchecked") public <T> T readResponse(Class<T> clazz, InputStream input) throws Throwable { return (T) readResponse((Type) clazz, input); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "readResponse", "(", "Class", "<", "T", ">", "clazz", ",", "InputStream", "input", ")", "throws", "Throwable", "{", "return", "(", "T", ")", "readResponse", "(", "(", "Type...
Reads a JSON-PRC response from the server. This blocks until a response is received. @param clazz the expected return type @param input the {@link InputStream} to read from @param <T> the expected return type @return the object returned by the JSON-RPC response @throws Throwable on error
[ "Reads", "a", "JSON", "-", "PRC", "response", "from", "the", "server", ".", "This", "blocks", "until", "a", "response", "is", "received", "." ]
train
https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java#L516-L519
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/export/CmsEntityWrapper.java
CmsEntityWrapper.insertAttributeValueEntity
public void insertAttributeValueEntity(String attributeName, CmsEntityWrapper value, int index) { """ Wrapper method.<p> @param attributeName parameter for the wrapped method @param value parameter for the wrapped method @param index parameter for the wrapped method """ m_entity.insertAttribute...
java
public void insertAttributeValueEntity(String attributeName, CmsEntityWrapper value, int index) { m_entity.insertAttributeValue(attributeName, value.getEntity(), index); }
[ "public", "void", "insertAttributeValueEntity", "(", "String", "attributeName", ",", "CmsEntityWrapper", "value", ",", "int", "index", ")", "{", "m_entity", ".", "insertAttributeValue", "(", "attributeName", ",", "value", ".", "getEntity", "(", ")", ",", "index", ...
Wrapper method.<p> @param attributeName parameter for the wrapped method @param value parameter for the wrapped method @param index parameter for the wrapped method
[ "Wrapper", "method", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/export/CmsEntityWrapper.java#L154-L157
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/raw/RawCursor.java
RawCursor.compareKeysPartially
protected int compareKeysPartially(byte[] key1, byte[] key2) { """ Returns {@literal <0} if key1 is less, 0 if equal (at least partially), {@literal >0} if key1 is greater. """ int length = Math.min(key1.length, key2.length); for (int i=0; i<length; i++) { int a1 = key1[i]; ...
java
protected int compareKeysPartially(byte[] key1, byte[] key2) { int length = Math.min(key1.length, key2.length); for (int i=0; i<length; i++) { int a1 = key1[i]; int a2 = key2[i]; if (a1 != a2) { return (a1 & 0xff) - (a2 & 0xff); } ...
[ "protected", "int", "compareKeysPartially", "(", "byte", "[", "]", "key1", ",", "byte", "[", "]", "key2", ")", "{", "int", "length", "=", "Math", ".", "min", "(", "key1", ".", "length", ",", "key2", ".", "length", ")", ";", "for", "(", "int", "i", ...
Returns {@literal <0} if key1 is less, 0 if equal (at least partially), {@literal >0} if key1 is greater.
[ "Returns", "{" ]
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/RawCursor.java#L502-L512
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java
KeyVaultClientCustomImpl.listKeyVersions
public PagedList<KeyItem> listKeyVersions(final String vaultBaseUrl, final String keyName) { """ Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. @param vaultBaseUrl...
java
public PagedList<KeyItem> listKeyVersions(final String vaultBaseUrl, final String keyName) { return getKeyVersions(vaultBaseUrl, keyName); }
[ "public", "PagedList", "<", "KeyItem", ">", "listKeyVersions", "(", "final", "String", "vaultBaseUrl", ",", "final", "String", "keyName", ")", "{", "return", "getKeyVersions", "(", "vaultBaseUrl", ",", "keyName", ")", ";", "}" ]
Retrieves a list of individual key versions with the same key name. The full key identifier, attributes, and tags are provided in the response. Authorization: Requires the keys/list permission. @param vaultBaseUrl The vault name, e.g. https://myvault.vault.azure.net @param keyName The name of the key @return the Paged...
[ "Retrieves", "a", "list", "of", "individual", "key", "versions", "with", "the", "same", "key", "name", ".", "The", "full", "key", "identifier", "attributes", "and", "tags", "are", "provided", "in", "the", "response", ".", "Authorization", ":", "Requires", "t...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java#L687-L689
pietermartin/sqlg
sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/EdgeLabel.java
EdgeLabel.removeInVertexLabel
void removeInVertexLabel(VertexLabel lbl, boolean preserveData) { """ remove a vertex label from the in collection @param lbl the vertex label @param preserveData should we keep the sql data? """ this.uncommittedRemovedInVertexLabels.add(lbl); if (!preserveData) { delet...
java
void removeInVertexLabel(VertexLabel lbl, boolean preserveData) { this.uncommittedRemovedInVertexLabels.add(lbl); if (!preserveData) { deleteColumn(lbl.getFullName() + Topology.IN_VERTEX_COLUMN_END); } }
[ "void", "removeInVertexLabel", "(", "VertexLabel", "lbl", ",", "boolean", "preserveData", ")", "{", "this", ".", "uncommittedRemovedInVertexLabels", ".", "add", "(", "lbl", ")", ";", "if", "(", "!", "preserveData", ")", "{", "deleteColumn", "(", "lbl", ".", ...
remove a vertex label from the in collection @param lbl the vertex label @param preserveData should we keep the sql data?
[ "remove", "a", "vertex", "label", "from", "the", "in", "collection" ]
train
https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/structure/topology/EdgeLabel.java#L1245-L1250
ontop/ontop
core/model/src/main/java/it/unibz/inf/ontop/dbschema/QuotedID.java
QuotedID.createIdFromDatabaseRecord
public static QuotedID createIdFromDatabaseRecord(QuotedIDFactory idfac, String s) { """ creates attribute ID from the database record (as though it is a quoted name) @param s @return """ // ID is as though it is quoted -- DB stores names as is return new QuotedID(s, idfac.getIDQuotationString()); }
java
public static QuotedID createIdFromDatabaseRecord(QuotedIDFactory idfac, String s) { // ID is as though it is quoted -- DB stores names as is return new QuotedID(s, idfac.getIDQuotationString()); }
[ "public", "static", "QuotedID", "createIdFromDatabaseRecord", "(", "QuotedIDFactory", "idfac", ",", "String", "s", ")", "{", "// ID is as though it is quoted -- DB stores names as is ", "return", "new", "QuotedID", "(", "s", ",", "idfac", ".", "getIDQuotationString", "(",...
creates attribute ID from the database record (as though it is a quoted name) @param s @return
[ "creates", "attribute", "ID", "from", "the", "database", "record", "(", "as", "though", "it", "is", "a", "quoted", "name", ")" ]
train
https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/dbschema/QuotedID.java#L74-L77
openbase/jul
visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java
SVGIcon.startForegroundIconRotateAnimation
public void startForegroundIconRotateAnimation(final double fromAngle, final double toAngle, final int cycleCount, final double duration, final Interpolator interpolator, final boolean autoReverse) { """ Method starts the rotate animation of the foreground icon. @param fromAngle the rotation angle where the ...
java
public void startForegroundIconRotateAnimation(final double fromAngle, final double toAngle, final int cycleCount, final double duration, final Interpolator interpolator, final boolean autoReverse) { stopForegroundIconRotateAnimation(); foregroundRotateAnimation = Animations.createRotateTransition(foreg...
[ "public", "void", "startForegroundIconRotateAnimation", "(", "final", "double", "fromAngle", ",", "final", "double", "toAngle", ",", "final", "int", "cycleCount", ",", "final", "double", "duration", ",", "final", "Interpolator", "interpolator", ",", "final", "boolea...
Method starts the rotate animation of the foreground icon. @param fromAngle the rotation angle where the transition should start. @param toAngle the rotation angle where the transition should end. @param cycleCount the number of times the animation should be played (use Animation.INDEFINITE for endless). @pa...
[ "Method", "starts", "the", "rotate", "animation", "of", "the", "foreground", "icon", "." ]
train
https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java#L359-L364
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/utils/DateUtil.java
DateUtil.parseXmlDate
public static Calendar parseXmlDate(String xsDate) throws ParseException { """ Parses an XML xs:date into a calendar object. @param xsDate an xs:date string @return a calendar object @throws ParseException thrown if the date cannot be converted to a calendar """ try { DatatypeFactory df ...
java
public static Calendar parseXmlDate(String xsDate) throws ParseException { try { DatatypeFactory df = DatatypeFactory.newInstance(); XMLGregorianCalendar dateTime = df.newXMLGregorianCalendar(xsDate); return dateTime.toGregorianCalendar(); } catch (DatatypeConfigurati...
[ "public", "static", "Calendar", "parseXmlDate", "(", "String", "xsDate", ")", "throws", "ParseException", "{", "try", "{", "DatatypeFactory", "df", "=", "DatatypeFactory", ".", "newInstance", "(", ")", ";", "XMLGregorianCalendar", "dateTime", "=", "df", ".", "ne...
Parses an XML xs:date into a calendar object. @param xsDate an xs:date string @return a calendar object @throws ParseException thrown if the date cannot be converted to a calendar
[ "Parses", "an", "XML", "xs", ":", "date", "into", "a", "calendar", "object", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/utils/DateUtil.java#L47-L55
Azure/azure-sdk-for-java
mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsInner.java
StreamingLocatorsInner.listContentKeysAsync
public Observable<ListContentKeysResponseInner> listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName) { """ List Content Keys. List Content Keys used by this Streaming Locator. @param resourceGroupName The name of the resource group within the Azure subscription. @par...
java
public Observable<ListContentKeysResponseInner> listContentKeysAsync(String resourceGroupName, String accountName, String streamingLocatorName) { return listContentKeysWithServiceResponseAsync(resourceGroupName, accountName, streamingLocatorName).map(new Func1<ServiceResponse<ListContentKeysResponseInner>, List...
[ "public", "Observable", "<", "ListContentKeysResponseInner", ">", "listContentKeysAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "streamingLocatorName", ")", "{", "return", "listContentKeysWithServiceResponseAsync", "(", "resourceGrou...
List Content Keys. List Content Keys used by this Streaming Locator. @param resourceGroupName The name of the resource group within the Azure subscription. @param accountName The Media Services account name. @param streamingLocatorName The Streaming Locator name. @throws IllegalArgumentException thrown if parameters f...
[ "List", "Content", "Keys", ".", "List", "Content", "Keys", "used", "by", "this", "Streaming", "Locator", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingLocatorsInner.java#L703-L710
aws/aws-sdk-java
aws-java-sdk-cloudsearch/src/main/java/com/amazonaws/services/cloudsearchdomain/model/SearchResult.java
SearchResult.withStats
public SearchResult withStats(java.util.Map<String, FieldStats> stats) { """ <p> The requested field statistics information. </p> @param stats The requested field statistics information. @return Returns a reference to this object so that method calls can be chained together. """ setStats(stats);...
java
public SearchResult withStats(java.util.Map<String, FieldStats> stats) { setStats(stats); return this; }
[ "public", "SearchResult", "withStats", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "FieldStats", ">", "stats", ")", "{", "setStats", "(", "stats", ")", ";", "return", "this", ";", "}" ]
<p> The requested field statistics information. </p> @param stats The requested field statistics information. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "The", "requested", "field", "statistics", "information", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudsearch/src/main/java/com/amazonaws/services/cloudsearchdomain/model/SearchResult.java#L234-L237
actorapp/actor-platform
actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java
ImageLoading.loadReuseExact
public static ReuseResult loadReuseExact(byte[] data, Bitmap dest) throws ImageLoadException { """ Loading bitmap with using reuse bitmap with the same size of source image. If it is unable to load with reuse method tries to load without it. Reuse works only in 3.0+ @param data image file contents @param des...
java
public static ReuseResult loadReuseExact(byte[] data, Bitmap dest) throws ImageLoadException { return loadBitmapReuseExact(new MemorySource(data), dest); }
[ "public", "static", "ReuseResult", "loadReuseExact", "(", "byte", "[", "]", "data", ",", "Bitmap", "dest", ")", "throws", "ImageLoadException", "{", "return", "loadBitmapReuseExact", "(", "new", "MemorySource", "(", "data", ")", ",", "dest", ")", ";", "}" ]
Loading bitmap with using reuse bitmap with the same size of source image. If it is unable to load with reuse method tries to load without it. Reuse works only in 3.0+ @param data image file contents @param dest reuse bitmap @return result of loading @throws ImageLoadException if it is unable to load file
[ "Loading", "bitmap", "with", "using", "reuse", "bitmap", "with", "the", "same", "size", "of", "source", "image", ".", "If", "it", "is", "unable", "to", "load", "with", "reuse", "method", "tries", "to", "load", "without", "it", ".", "Reuse", "works", "onl...
train
https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L173-L175
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/util/MergedClass.java
MergedClass.buildClassFile
public static ClassFile buildClassFile(String className, Class<?>[] classes, String[] prefixes) { """ Just create the bytecode for the merged class, but don't load it. Since no ClassInjector is provided to resolve name conflict...
java
public static ClassFile buildClassFile(String className, Class<?>[] classes, String[] prefixes) { return buildClassFile(className, classes, prefixes, null, OBSERVER_DISABLED); }
[ "public", "static", "ClassFile", "buildClassFile", "(", "String", "className", ",", "Class", "<", "?", ">", "[", "]", "classes", ",", "String", "[", "]", "prefixes", ")", "{", "return", "buildClassFile", "(", "className", ",", "classes", ",", "prefixes", "...
Just create the bytecode for the merged class, but don't load it. Since no ClassInjector is provided to resolve name conflicts, the class name must be manually provided. @param className name to give to merged class @param classes Source classes used to derive merged class @param prefixes Optional prefixes to apply to...
[ "Just", "create", "the", "bytecode", "for", "the", "merged", "class", "but", "don", "t", "load", "it", ".", "Since", "no", "ClassInjector", "is", "provided", "to", "resolve", "name", "conflicts", "the", "class", "name", "must", "be", "manually", "provided", ...
train
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/util/MergedClass.java#L443-L447
gallandarakhneorg/afc
core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/BinaryTreeNode.java
BinaryTreeNode.setChildAt
public final boolean setChildAt(BinaryTreeZone zone, N newChild) { """ Set the child for the specified zone. @param zone is the zone to set @param newChild is the child to insert @return <code>true</code> if the child was added, otherwise <code>false</code> """ switch (zone) { case LEFT: return set...
java
public final boolean setChildAt(BinaryTreeZone zone, N newChild) { switch (zone) { case LEFT: return setLeftChild(newChild); case RIGHT: return setRightChild(newChild); default: throw new IndexOutOfBoundsException(); } }
[ "public", "final", "boolean", "setChildAt", "(", "BinaryTreeZone", "zone", ",", "N", "newChild", ")", "{", "switch", "(", "zone", ")", "{", "case", "LEFT", ":", "return", "setLeftChild", "(", "newChild", ")", ";", "case", "RIGHT", ":", "return", "setRightC...
Set the child for the specified zone. @param zone is the zone to set @param newChild is the child to insert @return <code>true</code> if the child was added, otherwise <code>false</code>
[ "Set", "the", "child", "for", "the", "specified", "zone", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathtree/src/main/java/org/arakhne/afc/math/tree/node/BinaryTreeNode.java#L318-L327
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java
Text.getRelativeParent
public static String getRelativeParent(String path, int level, boolean ignoreTrailingSlash) { """ Same as {@link #getRelativeParent(String, int)} but adding the possibility to pass paths that end with a trailing '/'. @see #getRelativeParent(String, int) @param path path @param level level @param ignoreTra...
java
public static String getRelativeParent(String path, int level, boolean ignoreTrailingSlash) { if (ignoreTrailingSlash && path.endsWith("/") && path.length() > 1) { path = path.substring(0, path.length() - 1); } return getRelativeParent(path, level); }
[ "public", "static", "String", "getRelativeParent", "(", "String", "path", ",", "int", "level", ",", "boolean", "ignoreTrailingSlash", ")", "{", "if", "(", "ignoreTrailingSlash", "&&", "path", ".", "endsWith", "(", "\"/\"", ")", "&&", "path", ".", "length", "...
Same as {@link #getRelativeParent(String, int)} but adding the possibility to pass paths that end with a trailing '/'. @see #getRelativeParent(String, int) @param path path @param level level @param ignoreTrailingSlash ignore trailing slash @return String relative parent
[ "Same", "as", "{", "@link", "#getRelativeParent", "(", "String", "int", ")", "}", "but", "adding", "the", "possibility", "to", "pass", "paths", "that", "end", "with", "a", "trailing", "/", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L788-L795
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/utilities/ImageIOGreyScale.java
ImageIOGreyScale.createImageInputStream
public static ImageInputStream createImageInputStream(Object input) throws IOException { """ Returns an <code>ImageInputStream</code> that will take its input from the given <code>Object</code>. The set of <code>ImageInputStreamSpi</code>s registered with the <code>IIORegistry</code> class is queried and the fir...
java
public static ImageInputStream createImageInputStream(Object input) throws IOException { if (input == null) { throw new IllegalArgumentException("input == null!"); } Iterator iter; // Ensure category is present try { iter = theRegistry.getServiceProviders(ImageInputStreamSpi.class, true); } ...
[ "public", "static", "ImageInputStream", "createImageInputStream", "(", "Object", "input", ")", "throws", "IOException", "{", "if", "(", "input", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"input == null!\"", ")", ";", "}", "Iterator...
Returns an <code>ImageInputStream</code> that will take its input from the given <code>Object</code>. The set of <code>ImageInputStreamSpi</code>s registered with the <code>IIORegistry</code> class is queried and the first one that is able to take input from the supplied object is used to create the returned <code>Imag...
[ "Returns", "an", "<code", ">", "ImageInputStream<", "/", "code", ">", "that", "will", "take", "its", "input", "from", "the", "given", "<code", ">", "Object<", "/", "code", ">", ".", "The", "set", "of", "<code", ">", "ImageInputStreamSpi<", "/", "code", "...
train
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/ImageIOGreyScale.java#L296-L323
cubedtear/aritzh
aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java
Configuration.getBoolean
public boolean getBoolean(String category, String key) { """ Same as {@link Configuration#getProperty(String, String)}, but a boolean is parsed. @param category The category of the property @param key The key (identifier) of the property @return {@code true} if the property can be parsed to boolean, or e...
java
public boolean getBoolean(String category, String key) { String value = this.getProperty(category, key); return Boolean.parseBoolean(value) || "on".equalsIgnoreCase(value); }
[ "public", "boolean", "getBoolean", "(", "String", "category", ",", "String", "key", ")", "{", "String", "value", "=", "this", ".", "getProperty", "(", "category", ",", "key", ")", ";", "return", "Boolean", ".", "parseBoolean", "(", "value", ")", "||", "\...
Same as {@link Configuration#getProperty(String, String)}, but a boolean is parsed. @param category The category of the property @param key The key (identifier) of the property @return {@code true} if the property can be parsed to boolean, or equals (ignoring case) {@code "on"}
[ "Same", "as", "{", "@link", "Configuration#getProperty", "(", "String", "String", ")", "}", "but", "a", "boolean", "is", "parsed", "." ]
train
https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java#L273-L276
voldemort/voldemort
src/java/voldemort/utils/ReflectUtils.java
ReflectUtils.callConstructor
public static <T> T callConstructor(Class<T> klass) { """ Call the no-arg constructor for the given class @param <T> The type of the thing to construct @param klass The class @return The constructed thing """ return callConstructor(klass, new Class<?>[0], new Object[0]); }
java
public static <T> T callConstructor(Class<T> klass) { return callConstructor(klass, new Class<?>[0], new Object[0]); }
[ "public", "static", "<", "T", ">", "T", "callConstructor", "(", "Class", "<", "T", ">", "klass", ")", "{", "return", "callConstructor", "(", "klass", ",", "new", "Class", "<", "?", ">", "[", "0", "]", ",", "new", "Object", "[", "0", "]", ")", ";"...
Call the no-arg constructor for the given class @param <T> The type of the thing to construct @param klass The class @return The constructed thing
[ "Call", "the", "no", "-", "arg", "constructor", "for", "the", "given", "class" ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ReflectUtils.java#L85-L87
gsi-upm/Shanks
shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/reasoning/bayes/smile/ShanksAgentBayesianReasoningCapability.java
ShanksAgentBayesianReasoningCapability.clearEvidence
public static void clearEvidence(Network bn, String nodeName) throws ShanksException { """ Clear a hard evidence fixed in a given node /** @param bn @param nodeName @throws ShanksException """ int node = bn.getNode(nodeName); if (bn.isEvidence(node)) { bn.clearEv...
java
public static void clearEvidence(Network bn, String nodeName) throws ShanksException { int node = bn.getNode(nodeName); if (bn.isEvidence(node)) { bn.clearEvidence(nodeName); bn.updateBeliefs(); } }
[ "public", "static", "void", "clearEvidence", "(", "Network", "bn", ",", "String", "nodeName", ")", "throws", "ShanksException", "{", "int", "node", "=", "bn", ".", "getNode", "(", "nodeName", ")", ";", "if", "(", "bn", ".", "isEvidence", "(", "node", ")"...
Clear a hard evidence fixed in a given node /** @param bn @param nodeName @throws ShanksException
[ "Clear", "a", "hard", "evidence", "fixed", "in", "a", "given", "node" ]
train
https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/reasoning/bayes/smile/ShanksAgentBayesianReasoningCapability.java#L315-L322
sockeqwe/sqlbrite-dao
objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableAnnotatedClass.java
ObjectMappableAnnotatedClass.isSetterForField
private boolean isSetterForField(ExecutableElement setter, VariableElement field) { """ Checks if the setter method is valid for the given field @param setter The setter method @param field The field @return true if setter works for given field, otherwise false """ return setter.getParameters() != nul...
java
private boolean isSetterForField(ExecutableElement setter, VariableElement field) { return setter.getParameters() != null && setter.getParameters().size() == 1 && setter.getParameters().get(0).asType().equals(field.asType()); // TODO inheritance? TypeUtils is applicable? }
[ "private", "boolean", "isSetterForField", "(", "ExecutableElement", "setter", ",", "VariableElement", "field", ")", "{", "return", "setter", ".", "getParameters", "(", ")", "!=", "null", "&&", "setter", ".", "getParameters", "(", ")", ".", "size", "(", ")", ...
Checks if the setter method is valid for the given field @param setter The setter method @param field The field @return true if setter works for given field, otherwise false
[ "Checks", "if", "the", "setter", "method", "is", "valid", "for", "the", "given", "field" ]
train
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableAnnotatedClass.java#L262-L267
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/runner/PatchModuleInvalidationUtils.java
PatchModuleInvalidationUtils.validateLocalFileRecord
private static boolean validateLocalFileRecord(FileChannel channel, long startLocRecord, long compressedSize) throws IOException { """ Checks that the data starting at startLocRecord looks like a local file record header. @param channel the channel @param startLocRecord offset into channel of the start ...
java
private static boolean validateLocalFileRecord(FileChannel channel, long startLocRecord, long compressedSize) throws IOException { ByteBuffer lfhBuffer = getByteBuffer(LOCLEN); read(lfhBuffer, channel, startLocRecord); if (lfhBuffer.limit() < LOCLEN || getUnsignedInt(lfhBuffer, 0) != LOCSIG) { ...
[ "private", "static", "boolean", "validateLocalFileRecord", "(", "FileChannel", "channel", ",", "long", "startLocRecord", ",", "long", "compressedSize", ")", "throws", "IOException", "{", "ByteBuffer", "lfhBuffer", "=", "getByteBuffer", "(", "LOCLEN", ")", ";", "read...
Checks that the data starting at startLocRecord looks like a local file record header. @param channel the channel @param startLocRecord offset into channel of the start of the local record @param compressedSize expected compressed size of the file, or -1 to indicate this isn't known
[ "Checks", "that", "the", "data", "starting", "at", "startLocRecord", "looks", "like", "a", "local", "file", "record", "header", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/PatchModuleInvalidationUtils.java#L469-L489
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java
AsynchronousRequest.getMaterialCategoryInfo
public void getMaterialCategoryInfo(int[] ids, Callback<List<MaterialCategory>> callback) throws GuildWars2Exception, NullPointerException { """ For more info on Material MaterialCategory API go <a href="https://wiki.guildwars2.com/wiki/API:2/materials">here</a><br/> Give user the access to {@link Callback#onResp...
java
public void getMaterialCategoryInfo(int[] ids, Callback<List<MaterialCategory>> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ids)); gw2API.getMaterialBankInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); }
[ "public", "void", "getMaterialCategoryInfo", "(", "int", "[", "]", "ids", ",", "Callback", "<", "List", "<", "MaterialCategory", ">", ">", "callback", ")", "throws", "GuildWars2Exception", ",", "NullPointerException", "{", "isParamValid", "(", "new", "ParamChecker...
For more info on Material MaterialCategory API go <a href="https://wiki.guildwars2.com/wiki/API:2/materials">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions @param ids list of category id @param callb...
[ "For", "more", "info", "on", "Material", "MaterialCategory", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "materials", ">", "here<", "/", "a", ">", "<br", "/", ">...
train
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1863-L1866
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ConnectionDescriptorImpl.java
ConnectionDescriptorImpl.setAll
public void setAll(String _rhn, String _rha, String _lhn, String _lha) { """ Set all of the stored information based on the input strings. @param _rhn @param _rha @param _lhn @param _lha """ this.remoteHostName = _rhn; this.remoteHostAddress = _rha; this.localHostName = _lhn; ...
java
public void setAll(String _rhn, String _rha, String _lhn, String _lha) { this.remoteHostName = _rhn; this.remoteHostAddress = _rha; this.localHostName = _lhn; this.localHostAddress = _lha; this.addrLocal = null; this.addrRemote = null; }
[ "public", "void", "setAll", "(", "String", "_rhn", ",", "String", "_rha", ",", "String", "_lhn", ",", "String", "_lha", ")", "{", "this", ".", "remoteHostName", "=", "_rhn", ";", "this", ".", "remoteHostAddress", "=", "_rha", ";", "this", ".", "localHost...
Set all of the stored information based on the input strings. @param _rhn @param _rha @param _lhn @param _lha
[ "Set", "all", "of", "the", "stored", "information", "based", "on", "the", "input", "strings", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ConnectionDescriptorImpl.java#L140-L147
Samsung/GearVRf
GVRf/Framework/backend_oculus/src/main/java/org/gearvrf/OvrViewManager.java
OvrViewManager.onSurfaceChanged
void onSurfaceChanged(int width, int height) { """ Called when the surface is created or recreated. Avoided because this can be called twice at the beginning. """ Log.v(TAG, "onSurfaceChanged"); final VrAppSettings.EyeBufferParams.DepthFormat depthFormat = mApplication.getAppSettings().getEye...
java
void onSurfaceChanged(int width, int height) { Log.v(TAG, "onSurfaceChanged"); final VrAppSettings.EyeBufferParams.DepthFormat depthFormat = mApplication.getAppSettings().getEyeBufferParams().getDepthFormat(); mApplication.getConfigurationManager().configureRendering(VrAppSettings.EyeBufferPara...
[ "void", "onSurfaceChanged", "(", "int", "width", ",", "int", "height", ")", "{", "Log", ".", "v", "(", "TAG", ",", "\"onSurfaceChanged\"", ")", ";", "final", "VrAppSettings", ".", "EyeBufferParams", ".", "DepthFormat", "depthFormat", "=", "mApplication", ".", ...
Called when the surface is created or recreated. Avoided because this can be called twice at the beginning.
[ "Called", "when", "the", "surface", "is", "created", "or", "recreated", ".", "Avoided", "because", "this", "can", "be", "called", "twice", "at", "the", "beginning", "." ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/backend_oculus/src/main/java/org/gearvrf/OvrViewManager.java#L145-L150
elki-project/elki
elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/OutputStreamLogger.java
OutputStreamLogger.tailingNonNewline
private int tailingNonNewline(char[] cbuf, int off, int len) { """ Count the tailing non-newline characters. @param cbuf Character buffer @param off Offset @param len Range @return number of tailing non-newline character """ for(int cnt = 0; cnt < len; cnt++) { final int pos = off + (len - 1) -...
java
private int tailingNonNewline(char[] cbuf, int off, int len) { for(int cnt = 0; cnt < len; cnt++) { final int pos = off + (len - 1) - cnt; if(cbuf[pos] == UNIX_NEWLINE) { return cnt; } if(cbuf[pos] == CARRIAGE_RETURN) { return cnt; } // TODO: need to compare to NE...
[ "private", "int", "tailingNonNewline", "(", "char", "[", "]", "cbuf", ",", "int", "off", ",", "int", "len", ")", "{", "for", "(", "int", "cnt", "=", "0", ";", "cnt", "<", "len", ";", "cnt", "++", ")", "{", "final", "int", "pos", "=", "off", "+"...
Count the tailing non-newline characters. @param cbuf Character buffer @param off Offset @param len Range @return number of tailing non-newline character
[ "Count", "the", "tailing", "non", "-", "newline", "characters", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/OutputStreamLogger.java#L126-L138
knowm/Sundial
src/main/java/org/knowm/sundial/SundialJobScheduler.java
SundialJobScheduler.getAllJobsAndTriggers
public static Map<String, List<Trigger>> getAllJobsAndTriggers() throws SundialSchedulerException { """ Generates a Map of all Job names with corresponding Triggers @return """ Map<String, List<Trigger>> allJobsMap = new TreeMap<String, List<Trigger>>(); try { Set<String> allJobKey...
java
public static Map<String, List<Trigger>> getAllJobsAndTriggers() throws SundialSchedulerException { Map<String, List<Trigger>> allJobsMap = new TreeMap<String, List<Trigger>>(); try { Set<String> allJobKeys = getScheduler().getJobKeys(); for (String jobKey : allJobKeys) { List<...
[ "public", "static", "Map", "<", "String", ",", "List", "<", "Trigger", ">", ">", "getAllJobsAndTriggers", "(", ")", "throws", "SundialSchedulerException", "{", "Map", "<", "String", ",", "List", "<", "Trigger", ">", ">", "allJobsMap", "=", "new", "TreeMap", ...
Generates a Map of all Job names with corresponding Triggers @return
[ "Generates", "a", "Map", "of", "all", "Job", "names", "with", "corresponding", "Triggers" ]
train
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L525-L540
Wadpam/guja
guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java
GeneratedDConnectionDaoImpl.queryByImageUrl
public Iterable<DConnection> queryByImageUrl(java.lang.String imageUrl) { """ query-by method for field imageUrl @param imageUrl the specified attribute @return an Iterable of DConnections for the specified imageUrl """ return queryByField(null, DConnectionMapper.Field.IMAGEURL.getFieldName(), imageUrl);...
java
public Iterable<DConnection> queryByImageUrl(java.lang.String imageUrl) { return queryByField(null, DConnectionMapper.Field.IMAGEURL.getFieldName(), imageUrl); }
[ "public", "Iterable", "<", "DConnection", ">", "queryByImageUrl", "(", "java", ".", "lang", ".", "String", "imageUrl", ")", "{", "return", "queryByField", "(", "null", ",", "DConnectionMapper", ".", "Field", ".", "IMAGEURL", ".", "getFieldName", "(", ")", ",...
query-by method for field imageUrl @param imageUrl the specified attribute @return an Iterable of DConnections for the specified imageUrl
[ "query", "-", "by", "method", "for", "field", "imageUrl" ]
train
https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java#L97-L99
op4j/op4j
src/main/java/org/op4j/functions/FnDate.java
FnDate.toStr
public static final Function<Date,String> toStr(final String pattern, final Locale locale) { """ <p> Converts the target Date into a String using the specified <tt>pattern</tt>. The pattern has to be written in the <tt>java.text.SimpleDateFormat</tt> format, and the specified locale will be used for text-based ...
java
public static final Function<Date,String> toStr(final String pattern, final Locale locale) { return new ToString(pattern, locale); }
[ "public", "static", "final", "Function", "<", "Date", ",", "String", ">", "toStr", "(", "final", "String", "pattern", ",", "final", "Locale", "locale", ")", "{", "return", "new", "ToString", "(", "pattern", ",", "locale", ")", ";", "}" ]
<p> Converts the target Date into a String using the specified <tt>pattern</tt>. The pattern has to be written in the <tt>java.text.SimpleDateFormat</tt> format, and the specified locale will be used for text-based pattern components (like month names or week days). </p> @param pattern the pattern to be used, as speci...
[ "<p", ">", "Converts", "the", "target", "Date", "into", "a", "String", "using", "the", "specified", "<tt", ">", "pattern<", "/", "tt", ">", ".", "The", "pattern", "has", "to", "be", "written", "in", "the", "<tt", ">", "java", ".", "text", ".", "Simpl...
train
https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnDate.java#L408-L410
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/ShipmentUrl.java
ShipmentUrl.getShipmentUrl
public static MozuUrl getShipmentUrl(String orderId, String responseFields, String shipmentId) { """ Get Resource Url for GetShipment @param orderId Unique identifier of the order. @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON obj...
java
public static MozuUrl getShipmentUrl(String orderId, String responseFields, String shipmentId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/shipments/{shipmentId}?responseFields={responseFields}"); formatter.formatUrl("orderId", orderId); formatter.formatUrl("responseFields", r...
[ "public", "static", "MozuUrl", "getShipmentUrl", "(", "String", "orderId", ",", "String", "responseFields", ",", "String", "shipmentId", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/orders/{orderId}/shipments/{shipmentId}?response...
Get Resource Url for GetShipment @param orderId Unique identifier of the order. @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 using this parameter may...
[ "Get", "Resource", "Url", "for", "GetShipment" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/ShipmentUrl.java#L23-L30
jamesagnew/hapi-fhir
hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Truncatewords.java
Truncatewords.apply
@Override public Object apply(Object value, Object... params) { """ /* truncatewords(input, words = 15, truncate_string = "...") Truncate a string down to x words """ if (value == null) { return ""; } String text = super.asString(value); String[] words = te...
java
@Override public Object apply(Object value, Object... params) { if (value == null) { return ""; } String text = super.asString(value); String[] words = text.split("\\s++"); int length = 15; String truncateString = "..."; if (params.length >= 1) ...
[ "@", "Override", "public", "Object", "apply", "(", "Object", "value", ",", "Object", "...", "params", ")", "{", "if", "(", "value", "==", "null", ")", "{", "return", "\"\"", ";", "}", "String", "text", "=", "super", ".", "asString", "(", "value", ")"...
/* truncatewords(input, words = 15, truncate_string = "...") Truncate a string down to x words
[ "/", "*", "truncatewords", "(", "input", "words", "=", "15", "truncate_string", "=", "...", ")" ]
train
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Truncatewords.java#L10-L35
susom/database
src/main/java/com/github/susom/database/DatabaseProviderVertx.java
DatabaseProviderVertx.transactAsync
public <T> void transactAsync(final DbCodeTyped<T> code, Handler<AsyncResult<T>> resultHandler) { """ Execute a transaction on a Vert.x worker thread, with default semantics (commit if the code completes successfully, or rollback if it throws an error). The provided result handler will be call after the commit o...
java
public <T> void transactAsync(final DbCodeTyped<T> code, Handler<AsyncResult<T>> resultHandler) { VertxUtil.executeBlocking(executor, future -> { try { T returnValue; boolean complete = false; try { returnValue = code.run(this); complete = true; } catch (Th...
[ "public", "<", "T", ">", "void", "transactAsync", "(", "final", "DbCodeTyped", "<", "T", ">", "code", ",", "Handler", "<", "AsyncResult", "<", "T", ">", ">", "resultHandler", ")", "{", "VertxUtil", ".", "executeBlocking", "(", "executor", ",", "future", ...
Execute a transaction on a Vert.x worker thread, with default semantics (commit if the code completes successfully, or rollback if it throws an error). The provided result handler will be call after the commit or rollback, and will run on the event loop thread (the same thread that is calling this method).
[ "Execute", "a", "transaction", "on", "a", "Vert", ".", "x", "worker", "thread", "with", "default", "semantics", "(", "commit", "if", "the", "code", "completes", "successfully", "or", "rollback", "if", "it", "throws", "an", "error", ")", ".", "The", "provid...
train
https://github.com/susom/database/blob/25add9e08ad863712f9b5e319b6cb826f6f97640/src/main/java/com/github/susom/database/DatabaseProviderVertx.java#L191-L217
iipc/openwayback
wayback-core/src/main/java/org/archive/wayback/util/DirMaker.java
DirMaker.ensureDir
public static File ensureDir(String path, String name) throws IOException { """ Ensure that the path pointed to by 'path' is a directory, if possible @param path @param name @return File that is a created directory @throws IOException """ if((path == null) || (path.length() == 0)) { throw new IOExcept...
java
public static File ensureDir(String path, String name) throws IOException { if((path == null) || (path.length() == 0)) { throw new IOException("No configuration for (" + name + ")"); } File dir = new File(path); if(dir.exists()) { if(!dir.isDirectory()) { throw new IOException("Dir(" + name + ") at ("...
[ "public", "static", "File", "ensureDir", "(", "String", "path", ",", "String", "name", ")", "throws", "IOException", "{", "if", "(", "(", "path", "==", "null", ")", "||", "(", "path", ".", "length", "(", ")", "==", "0", ")", ")", "{", "throw", "new...
Ensure that the path pointed to by 'path' is a directory, if possible @param path @param name @return File that is a created directory @throws IOException
[ "Ensure", "that", "the", "path", "pointed", "to", "by", "path", "is", "a", "directory", "if", "possible" ]
train
https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/util/DirMaker.java#L40-L57
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java
ExpressionBuilder.greaterThan
public ExpressionBuilder greaterThan(final SubordinateTrigger trigger, final Object compare) { """ Appends a greater than test to the condition. @param trigger the trigger field. @param compare the value to use in the compare. @return this ExpressionBuilder. """ BooleanExpression exp = new CompareExpres...
java
public ExpressionBuilder greaterThan(final SubordinateTrigger trigger, final Object compare) { BooleanExpression exp = new CompareExpression(CompareType.GREATER_THAN, trigger, compare); appendExpression(exp); return this; }
[ "public", "ExpressionBuilder", "greaterThan", "(", "final", "SubordinateTrigger", "trigger", ",", "final", "Object", "compare", ")", "{", "BooleanExpression", "exp", "=", "new", "CompareExpression", "(", "CompareType", ".", "GREATER_THAN", ",", "trigger", ",", "comp...
Appends a greater than test to the condition. @param trigger the trigger field. @param compare the value to use in the compare. @return this ExpressionBuilder.
[ "Appends", "a", "greater", "than", "test", "to", "the", "condition", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L120-L125
netty/netty-tcnative
openssl-dynamic/src/main/java/io/netty/internal/tcnative/SSL.java
SSL.setKeyMaterialServerSide
@Deprecated public static void setKeyMaterialServerSide(long ssl, long chain, long key) throws Exception { """ Sets the keymaterial to be used for the server side. The passed in chain and key needs to be generated via {@link #parseX509Chain(long)} and {@link #parsePrivateKey(long, String)}. It's important to ...
java
@Deprecated public static void setKeyMaterialServerSide(long ssl, long chain, long key) throws Exception { setKeyMaterial(ssl, chain, key); }
[ "@", "Deprecated", "public", "static", "void", "setKeyMaterialServerSide", "(", "long", "ssl", ",", "long", "chain", ",", "long", "key", ")", "throws", "Exception", "{", "setKeyMaterial", "(", "ssl", ",", "chain", ",", "key", ")", ";", "}" ]
Sets the keymaterial to be used for the server side. The passed in chain and key needs to be generated via {@link #parseX509Chain(long)} and {@link #parsePrivateKey(long, String)}. It's important to note that the caller of the method is responsible to free the passed in chain and key in any case as this method will inc...
[ "Sets", "the", "keymaterial", "to", "be", "used", "for", "the", "server", "side", ".", "The", "passed", "in", "chain", "and", "key", "needs", "to", "be", "generated", "via", "{", "@link", "#parseX509Chain", "(", "long", ")", "}", "and", "{", "@link", "...
train
https://github.com/netty/netty-tcnative/blob/4a5d7330c6c36cff2bebbb465571cab1cf7a4063/openssl-dynamic/src/main/java/io/netty/internal/tcnative/SSL.java#L729-L732
jhunters/jprotobuf
src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java
MiniTemplatorParser.skipBlanks
private static int skipBlanks(String s, int p) { """ Skips blanks (white space) in string s starting at position p. """ while (p < s.length() && Character.isWhitespace(s.charAt(p))) p++; return p; }
java
private static int skipBlanks(String s, int p) { while (p < s.length() && Character.isWhitespace(s.charAt(p))) p++; return p; }
[ "private", "static", "int", "skipBlanks", "(", "String", "s", ",", "int", "p", ")", "{", "while", "(", "p", "<", "s", ".", "length", "(", ")", "&&", "Character", ".", "isWhitespace", "(", "s", ".", "charAt", "(", "p", ")", ")", ")", "p", "++", ...
Skips blanks (white space) in string s starting at position p.
[ "Skips", "blanks", "(", "white", "space", ")", "in", "string", "s", "starting", "at", "position", "p", "." ]
train
https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/MiniTemplator.java#L1561-L1565
JDBDT/jdbdt
src/main/java/org/jdbdt/JDBDT.java
JDBDT.assertInserted
@SafeVarargs public static void assertInserted(String message, DataSet... dataSets) throws DBAssertionError { """ Assert that database changed only by insertion of given data sets (error message variant). @param message Assertion error message. @param dataSets Data sets. @throws DBAssertionError if the ass...
java
@SafeVarargs public static void assertInserted(String message, DataSet... dataSets) throws DBAssertionError { multipleInsertAssertions(CallInfo.create(message), dataSets); }
[ "@", "SafeVarargs", "public", "static", "void", "assertInserted", "(", "String", "message", ",", "DataSet", "...", "dataSets", ")", "throws", "DBAssertionError", "{", "multipleInsertAssertions", "(", "CallInfo", ".", "create", "(", "message", ")", ",", "dataSets",...
Assert that database changed only by insertion of given data sets (error message variant). @param message Assertion error message. @param dataSets Data sets. @throws DBAssertionError if the assertion fails. @see #assertInserted(String,DataSet) @since 1.2
[ "Assert", "that", "database", "changed", "only", "by", "insertion", "of", "given", "data", "sets", "(", "error", "message", "variant", ")", "." ]
train
https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/JDBDT.java#L546-L549
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/filter/StartSearchFilter.java
StartSearchFilter.fakeTheDate
public void fakeTheDate() { """ If the current key starts with a date, convert the search field to a date and compare. """ int ecErrorCode; BaseField fldToCompare = m_fldToCompare; // Cache this in case it is changed if (m_fldToCompare.isNull()) return; // Don't convert th...
java
public void fakeTheDate() { int ecErrorCode; BaseField fldToCompare = m_fldToCompare; // Cache this in case it is changed if (m_fldToCompare.isNull()) return; // Don't convert the date if this is NULL! if (m_fldFakeDate == null) m_fldFakeDate = new DateField...
[ "public", "void", "fakeTheDate", "(", ")", "{", "int", "ecErrorCode", ";", "BaseField", "fldToCompare", "=", "m_fldToCompare", ";", "// Cache this in case it is changed", "if", "(", "m_fldToCompare", ".", "isNull", "(", ")", ")", "return", ";", "// Don't convert the...
If the current key starts with a date, convert the search field to a date and compare.
[ "If", "the", "current", "key", "starts", "with", "a", "date", "convert", "the", "search", "field", "to", "a", "date", "and", "compare", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/filter/StartSearchFilter.java#L126-L145
threerings/narya
core/src/main/java/com/threerings/presents/client/InvocationDirector.java
InvocationDirector.sendRequest
public void sendRequest (int invOid, int invCode, int methodId, Object[] args) { """ Requests that the specified invocation request be packaged up and sent to the supplied invocation oid. """ sendRequest(invOid, invCode, methodId, args, Transport.DEFAULT); }
java
public void sendRequest (int invOid, int invCode, int methodId, Object[] args) { sendRequest(invOid, invCode, methodId, args, Transport.DEFAULT); }
[ "public", "void", "sendRequest", "(", "int", "invOid", ",", "int", "invCode", ",", "int", "methodId", ",", "Object", "[", "]", "args", ")", "{", "sendRequest", "(", "invOid", ",", "invCode", ",", "methodId", ",", "args", ",", "Transport", ".", "DEFAULT",...
Requests that the specified invocation request be packaged up and sent to the supplied invocation oid.
[ "Requests", "that", "the", "specified", "invocation", "request", "be", "packaged", "up", "and", "sent", "to", "the", "supplied", "invocation", "oid", "." ]
train
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/InvocationDirector.java#L207-L210
apache/flink
flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/KryoUtils.java
KryoUtils.applyRegistrations
public static void applyRegistrations(Kryo kryo, Collection<KryoRegistration> resolvedRegistrations) { """ Apply a list of {@link KryoRegistration} to a Kryo instance. The list of registrations is assumed to already be a final resolution of all possible registration overwrites. <p>The registrations are applied...
java
public static void applyRegistrations(Kryo kryo, Collection<KryoRegistration> resolvedRegistrations) { Serializer<?> serializer; for (KryoRegistration registration : resolvedRegistrations) { serializer = registration.getSerializer(kryo); if (serializer != null) { kryo.register(registration.getRegistered...
[ "public", "static", "void", "applyRegistrations", "(", "Kryo", "kryo", ",", "Collection", "<", "KryoRegistration", ">", "resolvedRegistrations", ")", "{", "Serializer", "<", "?", ">", "serializer", ";", "for", "(", "KryoRegistration", "registration", ":", "resolve...
Apply a list of {@link KryoRegistration} to a Kryo instance. The list of registrations is assumed to already be a final resolution of all possible registration overwrites. <p>The registrations are applied in the given order and always specify the registration id as the next available id in the Kryo instance (providing...
[ "Apply", "a", "list", "of", "{", "@link", "KryoRegistration", "}", "to", "a", "Kryo", "instance", ".", "The", "list", "of", "registrations", "is", "assumed", "to", "already", "be", "a", "final", "resolution", "of", "all", "possible", "registration", "overwri...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/KryoUtils.java#L103-L115
lucidworks/spark-solr
src/main/java/com/lucidworks/spark/query/SolrStreamIterator.java
SolrStreamIterator.getStreamContext
protected StreamContext getStreamContext() { """ We have to set the streaming context so that we can pass our own cloud client with authentication """ StreamContext context = new StreamContext(); solrClientCache = new SparkSolrClientCache(cloudSolrClient, httpSolrClient); context.setSolrClientCache...
java
protected StreamContext getStreamContext() { StreamContext context = new StreamContext(); solrClientCache = new SparkSolrClientCache(cloudSolrClient, httpSolrClient); context.setSolrClientCache(solrClientCache); context.numWorkers = numWorkers; context.workerID = workerId; return context; }
[ "protected", "StreamContext", "getStreamContext", "(", ")", "{", "StreamContext", "context", "=", "new", "StreamContext", "(", ")", ";", "solrClientCache", "=", "new", "SparkSolrClientCache", "(", "cloudSolrClient", ",", "httpSolrClient", ")", ";", "context", ".", ...
We have to set the streaming context so that we can pass our own cloud client with authentication
[ "We", "have", "to", "set", "the", "streaming", "context", "so", "that", "we", "can", "pass", "our", "own", "cloud", "client", "with", "authentication" ]
train
https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/query/SolrStreamIterator.java#L67-L74
buschmais/jqa-core-framework
rule/src/main/java/com/buschmais/jqassistant/core/rule/impl/reader/XmlRuleParserPlugin.java
XmlRuleParserPlugin.getSeverity
private Severity getSeverity(SeverityEnumType severityType, Severity defaultSeverity) throws RuleException { """ Get the severity. @param severityType The severity type. @param defaultSeverity The default severity. @return The severity. """ return severityType == null ? defaultSeverity : Severit...
java
private Severity getSeverity(SeverityEnumType severityType, Severity defaultSeverity) throws RuleException { return severityType == null ? defaultSeverity : Severity.fromValue(severityType.value()); }
[ "private", "Severity", "getSeverity", "(", "SeverityEnumType", "severityType", ",", "Severity", "defaultSeverity", ")", "throws", "RuleException", "{", "return", "severityType", "==", "null", "?", "defaultSeverity", ":", "Severity", ".", "fromValue", "(", "severityTyp...
Get the severity. @param severityType The severity type. @param defaultSeverity The default severity. @return The severity.
[ "Get", "the", "severity", "." ]
train
https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/rule/src/main/java/com/buschmais/jqassistant/core/rule/impl/reader/XmlRuleParserPlugin.java#L274-L276
biojava/biojava
biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastService.java
NCBIQBlastService.getAlignmentResults
@Override public InputStream getAlignmentResults(String id, RemotePairwiseAlignmentOutputProperties outputProperties) throws Exception { """ Extracts the actual Blast report for given request id according to options provided in {@code outputProperties} argument. <p/> If the results are not ready yet, sleeps un...
java
@Override public InputStream getAlignmentResults(String id, RemotePairwiseAlignmentOutputProperties outputProperties) throws Exception { Map<String, String> params = new HashMap<String, String>(); for (String key : outputProperties.getOutputOptions()) { params.put(key, outputProperties.getOutputOption(key)); ...
[ "@", "Override", "public", "InputStream", "getAlignmentResults", "(", "String", "id", ",", "RemotePairwiseAlignmentOutputProperties", "outputProperties", ")", "throws", "Exception", "{", "Map", "<", "String", ",", "String", ">", "params", "=", "new", "HashMap", "<",...
Extracts the actual Blast report for given request id according to options provided in {@code outputProperties} argument. <p/> If the results are not ready yet, sleeps until they are available. If sleeping is not desired, call this method after {@code isReady} returns true @param id : request id, which was returned by...
[ "Extracts", "the", "actual", "Blast", "report", "for", "given", "request", "id", "according", "to", "options", "provided", "in", "{", "@code", "outputProperties", "}", "argument", ".", "<p", "/", ">", "If", "the", "results", "are", "not", "ready", "yet", "...
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastService.java#L319-L348
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.addEmailAlias
public EmailAlias addEmailAlias(String email, boolean isConfirmed) { """ Adds a new email alias to this user's account and confirms it without user interaction. This functionality is only available for enterprise admins. @param email the email address to add as an alias. @param isConfirmed whether or not the em...
java
public EmailAlias addEmailAlias(String email, boolean isConfirmed) { URL url = EMAIL_ALIASES_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "POST"); JsonObject requestJSON = new JsonObject() .add("ema...
[ "public", "EmailAlias", "addEmailAlias", "(", "String", "email", ",", "boolean", "isConfirmed", ")", "{", "URL", "url", "=", "EMAIL_ALIASES_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "g...
Adds a new email alias to this user's account and confirms it without user interaction. This functionality is only available for enterprise admins. @param email the email address to add as an alias. @param isConfirmed whether or not the email alias should be automatically confirmed. @return the newly created email alia...
[ "Adds", "a", "new", "email", "alias", "to", "this", "user", "s", "account", "and", "confirms", "it", "without", "user", "interaction", ".", "This", "functionality", "is", "only", "available", "for", "enterprise", "admins", "." ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L357-L372
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java
WriteOnlyCollection.doesStaticFactoryReturnNeedToBeWatched
@Override protected boolean doesStaticFactoryReturnNeedToBeWatched(String clsName, String methodName, String signature) { """ implements the MissingMethodsDetector to determine whether this factory-like method returns a collection @param clsName the clsName the class name of the factory @param methodName ...
java
@Override protected boolean doesStaticFactoryReturnNeedToBeWatched(String clsName, String methodName, String signature) { return collectionFactoryMethods.contains(new FQMethod(clsName, methodName, signature)); }
[ "@", "Override", "protected", "boolean", "doesStaticFactoryReturnNeedToBeWatched", "(", "String", "clsName", ",", "String", "methodName", ",", "String", "signature", ")", "{", "return", "collectionFactoryMethods", ".", "contains", "(", "new", "FQMethod", "(", "clsName...
implements the MissingMethodsDetector to determine whether this factory-like method returns a collection @param clsName the clsName the class name of the factory @param methodName the method name of the factory @param signature the signature of the factory method @return whether this class is a collection
[ "implements", "the", "MissingMethodsDetector", "to", "determine", "whether", "this", "factory", "-", "like", "method", "returns", "a", "collection" ]
train
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java#L270-L273
alkacon/opencms-core
src/org/opencms/ui/dataview/CmsColumnValueConverter.java
CmsColumnValueConverter.getColumnValue
public static Object getColumnValue(Object value, CmsDataViewColumn.Type type) { """ Gets the actual column value for the given data value.<p> @param value the data value @param type the column type enum @return the actual column value to use """ if (type == Type.imageType) { Image ...
java
public static Object getColumnValue(Object value, CmsDataViewColumn.Type type) { if (type == Type.imageType) { Image image = new Image("", new ExternalResource((String)value)); image.addStyleName("o-table-image"); return image; } else { return value; ...
[ "public", "static", "Object", "getColumnValue", "(", "Object", "value", ",", "CmsDataViewColumn", ".", "Type", "type", ")", "{", "if", "(", "type", "==", "Type", ".", "imageType", ")", "{", "Image", "image", "=", "new", "Image", "(", "\"\"", ",", "new", ...
Gets the actual column value for the given data value.<p> @param value the data value @param type the column type enum @return the actual column value to use
[ "Gets", "the", "actual", "column", "value", "for", "the", "given", "data", "value", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dataview/CmsColumnValueConverter.java#L72-L81
jboss/jboss-jstl-api_spec
src/main/java/org/apache/taglibs/standard/tag/common/sql/DataSourceWrapper.java
DataSourceWrapper.getConnection
public Connection getConnection(String username, String password) throws SQLException { """ Always throws a SQLException. Username and password are set in the constructor and can not be changed. """ throw new SQLException(Resources.getMessage("NOT_SUPPORTED")); }
java
public Connection getConnection(String username, String password) throws SQLException { throw new SQLException(Resources.getMessage("NOT_SUPPORTED")); }
[ "public", "Connection", "getConnection", "(", "String", "username", ",", "String", "password", ")", "throws", "SQLException", "{", "throw", "new", "SQLException", "(", "Resources", ".", "getMessage", "(", "\"NOT_SUPPORTED\"", ")", ")", ";", "}" ]
Always throws a SQLException. Username and password are set in the constructor and can not be changed.
[ "Always", "throws", "a", "SQLException", ".", "Username", "and", "password", "are", "set", "in", "the", "constructor", "and", "can", "not", "be", "changed", "." ]
train
https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/tag/common/sql/DataSourceWrapper.java#L111-L114
alkacon/opencms-core
src/org/opencms/search/solr/CmsSolrIndex.java
CmsSolrIndex.select
public void select(ServletResponse response, CmsObject cms, CmsSolrQuery query, boolean ignoreMaxRows) throws Exception { """ Writes the response into the writer.<p> NOTE: Currently not available for HTTP server.<p> @param response the servlet response @param cms the CMS object to use for search @para...
java
public void select(ServletResponse response, CmsObject cms, CmsSolrQuery query, boolean ignoreMaxRows) throws Exception { throwExceptionIfSafetyRestrictionsAreViolated(cms, query, false); boolean isOnline = cms.getRequestContext().getCurrentProject().isOnlineProject(); CmsResourceFilte...
[ "public", "void", "select", "(", "ServletResponse", "response", ",", "CmsObject", "cms", ",", "CmsSolrQuery", "query", ",", "boolean", "ignoreMaxRows", ")", "throws", "Exception", "{", "throwExceptionIfSafetyRestrictionsAreViolated", "(", "cms", ",", "query", ",", "...
Writes the response into the writer.<p> NOTE: Currently not available for HTTP server.<p> @param response the servlet response @param cms the CMS object to use for search @param query the Solr query @param ignoreMaxRows if to return unlimited results @throws Exception if there is no embedded server
[ "Writes", "the", "response", "into", "the", "writer", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/solr/CmsSolrIndex.java#L1329-L1337
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcDataSource.java
WSJdbcDataSource.replaceObject
Object replaceObject(ResourceRefConfigFactory resRefConfigFactory) { """ Returns a replacement object that can be serialized instead of WSJdbcDataSource. @param resRefConfigFactory factory for resource ref config. @return a replacement object that can be serialized instead of WSJdbcDataSource. """ ...
java
Object replaceObject(ResourceRefConfigFactory resRefConfigFactory) { DSConfig config = dsConfig.get(); String filter = config.jndiName == null || config.jndiName.startsWith("java:") ? FilterUtils.createPropertyFilter("config.displayId", config.id) : Filter...
[ "Object", "replaceObject", "(", "ResourceRefConfigFactory", "resRefConfigFactory", ")", "{", "DSConfig", "config", "=", "dsConfig", ".", "get", "(", ")", ";", "String", "filter", "=", "config", ".", "jndiName", "==", "null", "||", "config", ".", "jndiName", "....
Returns a replacement object that can be serialized instead of WSJdbcDataSource. @param resRefConfigFactory factory for resource ref config. @return a replacement object that can be serialized instead of WSJdbcDataSource.
[ "Returns", "a", "replacement", "object", "that", "can", "be", "serialized", "instead", "of", "WSJdbcDataSource", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcDataSource.java#L341-L357
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/AbstractTagLibrary.java
AbstractTagLibrary.addUserTag
protected final void addUserTag(String name, URL source) { """ Add a UserTagHandler specified a the URL source. @see UserTagHandler @param name name to use, "foo" would be &lt;my:foo /> @param source source where the Facelet (Tag) source is """ if (_strictJsf2FaceletsCompatibility == null) ...
java
protected final void addUserTag(String name, URL source) { if (_strictJsf2FaceletsCompatibility == null) { MyfacesConfig config = MyfacesConfig.getCurrentInstance( FacesContext.getCurrentInstance().getExternalContext()); _strictJsf2FaceletsCompatibility =...
[ "protected", "final", "void", "addUserTag", "(", "String", "name", ",", "URL", "source", ")", "{", "if", "(", "_strictJsf2FaceletsCompatibility", "==", "null", ")", "{", "MyfacesConfig", "config", "=", "MyfacesConfig", ".", "getCurrentInstance", "(", "FacesContext...
Add a UserTagHandler specified a the URL source. @see UserTagHandler @param name name to use, "foo" would be &lt;my:foo /> @param source source where the Facelet (Tag) source is
[ "Add", "a", "UserTagHandler", "specified", "a", "the", "URL", "source", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/AbstractTagLibrary.java#L276-L293
drinkjava2/jDialects
core/src/main/java/com/github/drinkjava2/jdialects/model/TableModel.java
TableModel.sequenceGenerator
public void sequenceGenerator(String name, String sequenceName, Integer initialValue, Integer allocationSize) { """ Add a sequence definition DDL, note: some dialects do not support sequence @param name The name of sequence Java object itself @param sequenceName the name of the sequence will created in datab...
java
public void sequenceGenerator(String name, String sequenceName, Integer initialValue, Integer allocationSize) { checkReadOnly(); this.addGenerator(new SequenceIdGenerator(name, sequenceName, initialValue, allocationSize)); }
[ "public", "void", "sequenceGenerator", "(", "String", "name", ",", "String", "sequenceName", ",", "Integer", "initialValue", ",", "Integer", "allocationSize", ")", "{", "checkReadOnly", "(", ")", ";", "this", ".", "addGenerator", "(", "new", "SequenceIdGenerator",...
Add a sequence definition DDL, note: some dialects do not support sequence @param name The name of sequence Java object itself @param sequenceName the name of the sequence will created in database @param initialValue The initial value @param allocationSize The allocationSize
[ "Add", "a", "sequence", "definition", "DDL", "note", ":", "some", "dialects", "do", "not", "support", "sequence" ]
train
https://github.com/drinkjava2/jDialects/blob/1c165f09c6042a599b681c279024abcc1b848b88/core/src/main/java/com/github/drinkjava2/jdialects/model/TableModel.java#L164-L167
aoindustries/aocode-public
src/main/java/com/aoindustries/servlet/http/ServletUtil.java
ServletUtil.resourceExists
@Deprecated public static boolean resourceExists(ServletContext servletContext, String path) throws MalformedURLException { """ Checks if a resource with the possibly-relative path exists. @deprecated Use regular methods directly @see ServletContext#getResource(java.lang.String) @see ServletContextCache...
java
@Deprecated public static boolean resourceExists(ServletContext servletContext, String path) throws MalformedURLException { return getResource(servletContext, path)!=null; }
[ "@", "Deprecated", "public", "static", "boolean", "resourceExists", "(", "ServletContext", "servletContext", ",", "String", "path", ")", "throws", "MalformedURLException", "{", "return", "getResource", "(", "servletContext", ",", "path", ")", "!=", "null", ";", "}...
Checks if a resource with the possibly-relative path exists. @deprecated Use regular methods directly @see ServletContext#getResource(java.lang.String) @see ServletContextCache#getResource(java.lang.String) @see ServletContextCache#getResource(javax.servlet.ServletContext, java.lang.String)
[ "Checks", "if", "a", "resource", "with", "the", "possibly", "-", "relative", "path", "exists", "." ]
train
https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/servlet/http/ServletUtil.java#L189-L192
Azure/azure-sdk-for-java
eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java
DomainsInner.createOrUpdate
public DomainInner createOrUpdate(String resourceGroupName, String domainName, DomainInner domainInfo) { """ Create a domain. Asynchronously creates a new domain with the specified parameters. @param resourceGroupName The name of the resource group within the user's subscription. @param domainName Name of the...
java
public DomainInner createOrUpdate(String resourceGroupName, String domainName, DomainInner domainInfo) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domainInfo).toBlocking().last().body(); }
[ "public", "DomainInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "domainName", ",", "DomainInner", "domainInfo", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "domainName", ",", "domainInfo", ")",...
Create a domain. Asynchronously creates a new domain with the specified parameters. @param resourceGroupName The name of the resource group within the user's subscription. @param domainName Name of the domain @param domainInfo Domain information @throws IllegalArgumentException thrown if parameters fail the validation...
[ "Create", "a", "domain", ".", "Asynchronously", "creates", "a", "new", "domain", "with", "the", "specified", "parameters", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java#L217-L219
redisson/redisson
redisson/src/main/java/org/redisson/executor/TasksRunnerService.java
TasksRunnerService.finish
private void finish(String requestId, boolean removeTask) { """ Check shutdown state. If tasksCounter equals <code>0</code> and executor in <code>shutdown</code> state, then set <code>terminated</code> state and notify terminationTopicName <p> If <code>scheduledRequestId</code> is not null then delete schedul...
java
private void finish(String requestId, boolean removeTask) { String script = ""; if (removeTask) { script += "local scheduled = redis.call('zscore', KEYS[5], ARGV[3]);" + "if scheduled == false then " + "redis.call('hdel', KEYS[4], ARGV[3]); " ...
[ "private", "void", "finish", "(", "String", "requestId", ",", "boolean", "removeTask", ")", "{", "String", "script", "=", "\"\"", ";", "if", "(", "removeTask", ")", "{", "script", "+=", "\"local scheduled = redis.call('zscore', KEYS[5], ARGV[3]);\"", "+", "\"if sche...
Check shutdown state. If tasksCounter equals <code>0</code> and executor in <code>shutdown</code> state, then set <code>terminated</code> state and notify terminationTopicName <p> If <code>scheduledRequestId</code> is not null then delete scheduled task @param requestId
[ "Check", "shutdown", "state", ".", "If", "tasksCounter", "equals", "<code", ">", "0<", "/", "code", ">", "and", "executor", "in", "<code", ">", "shutdown<", "/", "code", ">", "state", "then", "set", "<code", ">", "terminated<", "/", "code", ">", "state",...
train
https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/executor/TasksRunnerService.java#L329-L351
lettuce-io/lettuce-core
src/main/java/io/lettuce/core/resource/Delay.java
Delay.fullJitter
public static Delay fullJitter(Duration lower, Duration upper, long base, TimeUnit targetTimeUnit) { """ Creates a new {@link FullJitterDelay}. @param lower the lower boundary, must be non-negative @param upper the upper boundary, must be greater than the lower boundary @param base the base, must be greater o...
java
public static Delay fullJitter(Duration lower, Duration upper, long base, TimeUnit targetTimeUnit) { LettuceAssert.notNull(lower, "Lower boundary must not be null"); LettuceAssert.isTrue(lower.toNanos() >= 0, "Lower boundary must be greater or equal to 0"); LettuceAssert.notNull(upper, "Upper b...
[ "public", "static", "Delay", "fullJitter", "(", "Duration", "lower", ",", "Duration", "upper", ",", "long", "base", ",", "TimeUnit", "targetTimeUnit", ")", "{", "LettuceAssert", ".", "notNull", "(", "lower", ",", "\"Lower boundary must not be null\"", ")", ";", ...
Creates a new {@link FullJitterDelay}. @param lower the lower boundary, must be non-negative @param upper the upper boundary, must be greater than the lower boundary @param base the base, must be greater or equal to 1 @param targetTimeUnit the unit of the delay. @return a created {@link FullJitterDelay}. @since 5.0
[ "Creates", "a", "new", "{", "@link", "FullJitterDelay", "}", "." ]
train
https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/resource/Delay.java#L232-L242
OpenLiberty/open-liberty
dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomManifest.java
CustomManifest.getFeatureId
protected static String getFeatureId(File featureManifest) throws IOException { """ Find corresponding feature id (i.e., user or myExt1 from the location of feature manifest file. The logic is that since the location of the feature manifest file is .../lib/features/<feature manifest> find the parent of lib direc...
java
protected static String getFeatureId(File featureManifest) throws IOException { String rootDir = CustomUtils.getCanonicalPath(featureManifest.getParentFile().getParentFile().getParentFile()); // go up two directories. String output = null; // check with user feature dir. if (rootDir.equa...
[ "protected", "static", "String", "getFeatureId", "(", "File", "featureManifest", ")", "throws", "IOException", "{", "String", "rootDir", "=", "CustomUtils", ".", "getCanonicalPath", "(", "featureManifest", ".", "getParentFile", "(", ")", ".", "getParentFile", "(", ...
Find corresponding feature id (i.e., user or myExt1 from the location of feature manifest file. The logic is that since the location of the feature manifest file is .../lib/features/<feature manifest> find the parent of lib directory, and compare the location information of the ProductionExtension objects, and if they ...
[ "Find", "corresponding", "feature", "id", "(", "i", ".", "e", ".", "user", "or", "myExt1", "from", "the", "location", "of", "feature", "manifest", "file", ".", "The", "logic", "is", "that", "since", "the", "location", "of", "the", "feature", "manifest", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomManifest.java#L288-L308
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareImage.java
DetectFiducialSquareImage.addPattern
public int addPattern(GrayU8 inputBinary, double lengthSide) { """ Adds a new image to the detector. Image must be gray-scale and is converted into a binary image using the specified threshold. All input images are rescaled to be square and of the appropriate size. Thus the original shape of the image doesn't...
java
public int addPattern(GrayU8 inputBinary, double lengthSide) { if( inputBinary == null ) { throw new IllegalArgumentException("Input image is null."); } else if( lengthSide <= 0 ) { throw new IllegalArgumentException("Parameter lengthSide must be more than zero"); } else if(ImageStatistics.max(inputBinary) ...
[ "public", "int", "addPattern", "(", "GrayU8", "inputBinary", ",", "double", "lengthSide", ")", "{", "if", "(", "inputBinary", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Input image is null.\"", ")", ";", "}", "else", "if", "(",...
Adds a new image to the detector. Image must be gray-scale and is converted into a binary image using the specified threshold. All input images are rescaled to be square and of the appropriate size. Thus the original shape of the image doesn't matter. Square shapes are highly recommended since that's what the targe...
[ "Adds", "a", "new", "image", "to", "the", "detector", ".", "Image", "must", "be", "gray", "-", "scale", "and", "is", "converted", "into", "a", "binary", "image", "using", "the", "specified", "threshold", ".", "All", "input", "images", "are", "rescaled", ...
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/DetectFiducialSquareImage.java#L114-L158
googlemaps/google-maps-services-java
src/main/java/com/google/maps/GeocodingApiRequest.java
GeocodingApiRequest.bounds
public GeocodingApiRequest bounds(LatLng southWestBound, LatLng northEastBound) { """ Sets the bounding box of the viewport within which to bias geocode results more prominently. This parameter will only influence, not fully restrict, results from the geocoder. <p>For more information see <a href="https://dev...
java
public GeocodingApiRequest bounds(LatLng southWestBound, LatLng northEastBound) { return param("bounds", join('|', southWestBound, northEastBound)); }
[ "public", "GeocodingApiRequest", "bounds", "(", "LatLng", "southWestBound", ",", "LatLng", "northEastBound", ")", "{", "return", "param", "(", "\"bounds\"", ",", "join", "(", "'", "'", ",", "southWestBound", ",", "northEastBound", ")", ")", ";", "}" ]
Sets the bounding box of the viewport within which to bias geocode results more prominently. This parameter will only influence, not fully restrict, results from the geocoder. <p>For more information see <a href="https://developers.google.com/maps/documentation/geocoding/intro?hl=pl#Viewports"> Viewport Biasing</a>. ...
[ "Sets", "the", "bounding", "box", "of", "the", "viewport", "within", "which", "to", "bias", "geocode", "results", "more", "prominently", ".", "This", "parameter", "will", "only", "influence", "not", "fully", "restrict", "results", "from", "the", "geocoder", "....
train
https://github.com/googlemaps/google-maps-services-java/blob/23d20d1930f80e310d856d2da51d72ee0db4476b/src/main/java/com/google/maps/GeocodingApiRequest.java#L99-L101
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/filesystem/PathAlterationObserver.java
PathAlterationObserver.createPathEntry
private FileStatusEntry createPathEntry(final FileStatusEntry parent, final Path childPath) throws IOException { """ Create a new FileStatusEntry for the specified file. @param parent The parent file entry @param childPath The file to create an entry for @return A new file entry """ final FileSt...
java
private FileStatusEntry createPathEntry(final FileStatusEntry parent, final Path childPath) throws IOException { final FileStatusEntry entry = parent.newChildInstance(childPath); entry.refresh(childPath); final FileStatusEntry[] children = doListPathsEntry(childPath, entry); entry.setChildren(chil...
[ "private", "FileStatusEntry", "createPathEntry", "(", "final", "FileStatusEntry", "parent", ",", "final", "Path", "childPath", ")", "throws", "IOException", "{", "final", "FileStatusEntry", "entry", "=", "parent", ".", "newChildInstance", "(", "childPath", ")", ";",...
Create a new FileStatusEntry for the specified file. @param parent The parent file entry @param childPath The file to create an entry for @return A new file entry
[ "Create", "a", "new", "FileStatusEntry", "for", "the", "specified", "file", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/filesystem/PathAlterationObserver.java#L238-L245
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getSoftwareModuleName
public static String getSoftwareModuleName(final String caption, final String name) { """ Get Label for Artifact Details. @param caption as caption of the details @param name as name @return SoftwareModuleName """ return new StringBuilder() .append(DIV_DESCRIPTION_START + caption...
java
public static String getSoftwareModuleName(final String caption, final String name) { return new StringBuilder() .append(DIV_DESCRIPTION_START + caption + " : " + getBoldHTMLText(getFormattedName(name))) .append(DIV_DESCRIPTION_END).toString(); }
[ "public", "static", "String", "getSoftwareModuleName", "(", "final", "String", "caption", ",", "final", "String", "name", ")", "{", "return", "new", "StringBuilder", "(", ")", ".", "append", "(", "DIV_DESCRIPTION_START", "+", "caption", "+", "\" : \"", "+", "g...
Get Label for Artifact Details. @param caption as caption of the details @param name as name @return SoftwareModuleName
[ "Get", "Label", "for", "Artifact", "Details", "." ]
train
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L152-L156
comapi/comapi-sdk-android
COMAPI/foundation/src/main/java/com/comapi/ComapiClient.java
ComapiClient.copyLogs
public void copyLogs(@NonNull File file, Callback<File> callback) { """ Gets the content of internal log files merged into provided file. @param file File to merge internal logs into. @param callback Callback with a same file this time containing all the internal logs merged into. """ adapter.a...
java
public void copyLogs(@NonNull File file, Callback<File> callback) { adapter.adapt(super.copyLogs(file), callback); }
[ "public", "void", "copyLogs", "(", "@", "NonNull", "File", "file", ",", "Callback", "<", "File", ">", "callback", ")", "{", "adapter", ".", "adapt", "(", "super", ".", "copyLogs", "(", "file", ")", ",", "callback", ")", ";", "}" ]
Gets the content of internal log files merged into provided file. @param file File to merge internal logs into. @param callback Callback with a same file this time containing all the internal logs merged into.
[ "Gets", "the", "content", "of", "internal", "log", "files", "merged", "into", "provided", "file", "." ]
train
https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/ComapiClient.java#L105-L107
vanilladb/vanillacore
src/main/java/org/vanilladb/core/storage/tx/concurrency/LockTable.java
LockTable.ixLock
void ixLock(Object obj, long txNum) { """ Grants an ixlock on the specified item. If any conflict lock exists when the method is called, then the calling thread will be placed on a wait list until the lock is released. If the thread remains on the wait list for a certain amount of time, then an exception is thr...
java
void ixLock(Object obj, long txNum) { Object anchor = getAnchor(obj); txWaitMap.put(txNum, anchor); synchronized (anchor) { Lockers lks = prepareLockers(obj); if (hasIxLock(lks, txNum)) return; try { long timestamp = System.currentTimeMillis(); while (!ixLockable(lks, txNum) && !...
[ "void", "ixLock", "(", "Object", "obj", ",", "long", "txNum", ")", "{", "Object", "anchor", "=", "getAnchor", "(", "obj", ")", ";", "txWaitMap", ".", "put", "(", "txNum", ",", "anchor", ")", ";", "synchronized", "(", "anchor", ")", "{", "Lockers", "l...
Grants an ixlock on the specified item. If any conflict lock exists when the method is called, then the calling thread will be placed on a wait list until the lock is released. If the thread remains on the wait list for a certain amount of time, then an exception is thrown. @param obj a lockable item @param txNum a tr...
[ "Grants", "an", "ixlock", "on", "the", "specified", "item", ".", "If", "any", "conflict", "lock", "exists", "when", "the", "method", "is", "called", "then", "the", "calling", "thread", "will", "be", "placed", "on", "a", "wait", "list", "until", "the", "l...
train
https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/tx/concurrency/LockTable.java#L346-L373
sagiegurari/fax4j
src/main/java/org/fax4j/spi/windows/WindowsFaxClientSpiHelper.java
WindowsFaxClientSpiHelper.extractNativeResources
public static void extractNativeResources() { """ This function extracts the native resources (the fax4j.exe and fax4j.dll) and pushes them to the fax4j temporary directory. """ synchronized(WindowsFaxClientSpiHelper.NATIVE_LOCK) { //get target directory File directory=...
java
public static void extractNativeResources() { synchronized(WindowsFaxClientSpiHelper.NATIVE_LOCK) { //get target directory File directory=IOHelper.getFax4jInternalTemporaryDirectory(); //extract resources String[] names=new String[]{"fax4j...
[ "public", "static", "void", "extractNativeResources", "(", ")", "{", "synchronized", "(", "WindowsFaxClientSpiHelper", ".", "NATIVE_LOCK", ")", "{", "//get target directory", "File", "directory", "=", "IOHelper", ".", "getFax4jInternalTemporaryDirectory", "(", ")", ";",...
This function extracts the native resources (the fax4j.exe and fax4j.dll) and pushes them to the fax4j temporary directory.
[ "This", "function", "extracts", "the", "native", "resources", "(", "the", "fax4j", ".", "exe", "and", "fax4j", ".", "dll", ")", "and", "pushes", "them", "to", "the", "fax4j", "temporary", "directory", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/windows/WindowsFaxClientSpiHelper.java#L43-L87
JadiraOrg/jadira
bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java
BasicBinder.findMarshaller
public <S, T> ToMarshaller<S, T> findMarshaller(Class<S> source, Class<T> target) { """ Resolve a Marshaller with the given source and target class. The marshaller is used as follows: Instances of the source can be marshalled into the target class. @param source The source (input) class @param target The target...
java
public <S, T> ToMarshaller<S, T> findMarshaller(Class<S> source, Class<T> target) { return findMarshaller(new ConverterKey<S,T>(source, target, DefaultBinding.class)); }
[ "public", "<", "S", ",", "T", ">", "ToMarshaller", "<", "S", ",", "T", ">", "findMarshaller", "(", "Class", "<", "S", ">", "source", ",", "Class", "<", "T", ">", "target", ")", "{", "return", "findMarshaller", "(", "new", "ConverterKey", "<", "S", ...
Resolve a Marshaller with the given source and target class. The marshaller is used as follows: Instances of the source can be marshalled into the target class. @param source The source (input) class @param target The target (output) class
[ "Resolve", "a", "Marshaller", "with", "the", "given", "source", "and", "target", "class", ".", "The", "marshaller", "is", "used", "as", "follows", ":", "Instances", "of", "the", "source", "can", "be", "marshalled", "into", "the", "target", "class", "." ]
train
https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L857-L859
albfernandez/javadbf
src/main/java/com/linuxense/javadbf/DBFUtils.java
DBFUtils.textPadding
public static byte[] textPadding(String text, Charset charset, int length, DBFAlignment alignment, byte paddingByte) { """ pad a string and convert it to byte[] to write to a dbf file @param text The text to be padded @param charset Charset to use to encode the string @param length Size of the padded string @p...
java
public static byte[] textPadding(String text, Charset charset, int length, DBFAlignment alignment, byte paddingByte) { byte response[] = new byte[length]; Arrays.fill(response, paddingByte); byte[] stringBytes = text.getBytes(charset); if (stringBytes.length > length) { return textPadding(text.substring(0, ...
[ "public", "static", "byte", "[", "]", "textPadding", "(", "String", "text", ",", "Charset", "charset", ",", "int", "length", ",", "DBFAlignment", "alignment", ",", "byte", "paddingByte", ")", "{", "byte", "response", "[", "]", "=", "new", "byte", "[", "l...
pad a string and convert it to byte[] to write to a dbf file @param text The text to be padded @param charset Charset to use to encode the string @param length Size of the padded string @param alignment alignment to use to padd @param paddingByte the byte used to pad the string @return bytes to write to the dbf file
[ "pad", "a", "string", "and", "convert", "it", "to", "byte", "[]", "to", "write", "to", "a", "dbf", "file" ]
train
https://github.com/albfernandez/javadbf/blob/ac9867b46786cb055bce9323e2cf074365207693/src/main/java/com/linuxense/javadbf/DBFUtils.java#L203-L226