repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
188
func_name
stringlengths
7
127
whole_func_string
stringlengths
77
3.91k
language
stringclasses
1 value
func_code_string
stringlengths
77
3.91k
func_code_tokens
listlengths
20
745
func_documentation_string
stringlengths
61
1.98k
func_documentation_tokens
listlengths
1
477
split_name
stringclasses
1 value
func_code_url
stringlengths
111
288
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/DialogUtils.java
DialogUtils.isDialog
private boolean isDialog(Activity activity, View decorView){ if(decorView == null || !decorView.isShown() || activity == null){ return false; } Context viewContext = null; if(decorView != null){ viewContext = decorView.getContext(); } if (viewContext instanceof ContextThemeWrapper) { ContextThemeWrapper ctw = (ContextThemeWrapper) viewContext; viewContext = ctw.getBaseContext(); } Context activityContext = activity; Context activityBaseContext = activity.getBaseContext(); return (activityContext.equals(viewContext) || activityBaseContext.equals(viewContext)) && (decorView != activity.getWindow().getDecorView()); }
java
private boolean isDialog(Activity activity, View decorView){ if(decorView == null || !decorView.isShown() || activity == null){ return false; } Context viewContext = null; if(decorView != null){ viewContext = decorView.getContext(); } if (viewContext instanceof ContextThemeWrapper) { ContextThemeWrapper ctw = (ContextThemeWrapper) viewContext; viewContext = ctw.getBaseContext(); } Context activityContext = activity; Context activityBaseContext = activity.getBaseContext(); return (activityContext.equals(viewContext) || activityBaseContext.equals(viewContext)) && (decorView != activity.getWindow().getDecorView()); }
[ "private", "boolean", "isDialog", "(", "Activity", "activity", ",", "View", "decorView", ")", "{", "if", "(", "decorView", "==", "null", "||", "!", "decorView", ".", "isShown", "(", ")", "||", "activity", "==", "null", ")", "{", "return", "false", ";", ...
Checks that the specified DecorView and the Activity DecorView are not equal. @param activity the activity which DecorView is to be compared @param decorView the DecorView to compare @return true if not equal
[ "Checks", "that", "the", "specified", "DecorView", "and", "the", "Activity", "DecorView", "are", "not", "equal", "." ]
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/DialogUtils.java#L129-L145
joniles/mpxj
src/main/java/net/sf/mpxj/phoenix/PhoenixReader.java
PhoenixReader.getCurrentStorepoint
private Storepoint getCurrentStorepoint(Project phoenixProject) { List<Storepoint> storepoints = phoenixProject.getStorepoints().getStorepoint(); Collections.sort(storepoints, new Comparator<Storepoint>() { @Override public int compare(Storepoint o1, Storepoint o2) { return DateHelper.compare(o2.getCreationTime(), o1.getCreationTime()); } }); return storepoints.get(0); }
java
private Storepoint getCurrentStorepoint(Project phoenixProject) { List<Storepoint> storepoints = phoenixProject.getStorepoints().getStorepoint(); Collections.sort(storepoints, new Comparator<Storepoint>() { @Override public int compare(Storepoint o1, Storepoint o2) { return DateHelper.compare(o2.getCreationTime(), o1.getCreationTime()); } }); return storepoints.get(0); }
[ "private", "Storepoint", "getCurrentStorepoint", "(", "Project", "phoenixProject", ")", "{", "List", "<", "Storepoint", ">", "storepoints", "=", "phoenixProject", ".", "getStorepoints", "(", ")", ".", "getStorepoint", "(", ")", ";", "Collections", ".", "sort", "...
Retrieve the most recent storepoint. @param phoenixProject project data @return Storepoint instance
[ "Retrieve", "the", "most", "recent", "storepoint", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/phoenix/PhoenixReader.java#L713-L724
CenturyLinkCloud/mdw
mdw-services/src/com/centurylink/mdw/services/process/ProcessExecutor.java
ProcessExecutor.createTransitionInstance
public TransitionInstance createTransitionInstance(Transition transition, Long pProcessInstId) throws DataAccessException { TransactionWrapper transaction=null; try { transaction = startTransaction(); return engineImpl.createTransitionInstance(transition, pProcessInstId); } catch (DataAccessException e) { if (canRetryTransaction(e)) { transaction = (TransactionWrapper)initTransactionRetry(transaction); return ((ProcessExecutor)getTransactionRetrier()).createTransitionInstance(transition, pProcessInstId); } else throw e; } finally { stopTransaction(transaction); } }
java
public TransitionInstance createTransitionInstance(Transition transition, Long pProcessInstId) throws DataAccessException { TransactionWrapper transaction=null; try { transaction = startTransaction(); return engineImpl.createTransitionInstance(transition, pProcessInstId); } catch (DataAccessException e) { if (canRetryTransaction(e)) { transaction = (TransactionWrapper)initTransactionRetry(transaction); return ((ProcessExecutor)getTransactionRetrier()).createTransitionInstance(transition, pProcessInstId); } else throw e; } finally { stopTransaction(transaction); } }
[ "public", "TransitionInstance", "createTransitionInstance", "(", "Transition", "transition", ",", "Long", "pProcessInstId", ")", "throws", "DataAccessException", "{", "TransactionWrapper", "transaction", "=", "null", ";", "try", "{", "transaction", "=", "startTransaction"...
Creates a new instance of the WorkTransationInstance entity @param transition @param pProcessInstId @return WorkTransitionInstance object
[ "Creates", "a", "new", "instance", "of", "the", "WorkTransationInstance", "entity" ]
train
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/process/ProcessExecutor.java#L631-L647
zackpollard/JavaTelegramBot-API
core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java
TelegramBot.editMessageReplyMarkup
public Message editMessageReplyMarkup(Message oldMessage, InlineReplyMarkup inlineReplyMarkup) { return this.editMessageReplyMarkup(oldMessage.getChat().getId(), oldMessage.getMessageId(), inlineReplyMarkup); }
java
public Message editMessageReplyMarkup(Message oldMessage, InlineReplyMarkup inlineReplyMarkup) { return this.editMessageReplyMarkup(oldMessage.getChat().getId(), oldMessage.getMessageId(), inlineReplyMarkup); }
[ "public", "Message", "editMessageReplyMarkup", "(", "Message", "oldMessage", ",", "InlineReplyMarkup", "inlineReplyMarkup", ")", "{", "return", "this", ".", "editMessageReplyMarkup", "(", "oldMessage", ".", "getChat", "(", ")", ".", "getId", "(", ")", ",", "oldMes...
This allows you to edit the InlineReplyMarkup of any message that you have sent previously. @param oldMessage The Message object that represents the message you want to edit @param inlineReplyMarkup Any InlineReplyMarkup object you want to edit into the message @return A new Message object representing the edited message
[ "This", "allows", "you", "to", "edit", "the", "InlineReplyMarkup", "of", "any", "message", "that", "you", "have", "sent", "previously", "." ]
train
https://github.com/zackpollard/JavaTelegramBot-API/blob/9d100f351824042ca5fc0ea735d1fa376a13e81d/core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java#L844-L847
kmi/iserve
iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/SparqlLogicConceptMatcher.java
SparqlLogicConceptMatcher.listMatchesAtLeastOfType
@Override public Table<URI, URI, MatchResult> listMatchesAtLeastOfType(Set<URI> origins, MatchType minType) { Table<URI, URI, MatchResult> matchTable = HashBasedTable.create(); Stopwatch w = new Stopwatch(); for (URI origin : origins) { w.start(); Map<URI, MatchResult> result = listMatchesAtLeastOfType(origin, minType); for (Map.Entry<URI, MatchResult> dest : result.entrySet()) { matchTable.put(origin, dest.getKey(), dest.getValue()); } log.debug("Computed matched types for {} in {}. {} total matches.", origin, w.stop().toString(), result.size()); w.reset(); } return matchTable; // return obtainMatchResults(origins, minType, this.getMatchTypesSupported().getHighest()); // TODO: Use the proper implementation for this }
java
@Override public Table<URI, URI, MatchResult> listMatchesAtLeastOfType(Set<URI> origins, MatchType minType) { Table<URI, URI, MatchResult> matchTable = HashBasedTable.create(); Stopwatch w = new Stopwatch(); for (URI origin : origins) { w.start(); Map<URI, MatchResult> result = listMatchesAtLeastOfType(origin, minType); for (Map.Entry<URI, MatchResult> dest : result.entrySet()) { matchTable.put(origin, dest.getKey(), dest.getValue()); } log.debug("Computed matched types for {} in {}. {} total matches.", origin, w.stop().toString(), result.size()); w.reset(); } return matchTable; // return obtainMatchResults(origins, minType, this.getMatchTypesSupported().getHighest()); // TODO: Use the proper implementation for this }
[ "@", "Override", "public", "Table", "<", "URI", ",", "URI", ",", "MatchResult", ">", "listMatchesAtLeastOfType", "(", "Set", "<", "URI", ">", "origins", ",", "MatchType", "minType", ")", "{", "Table", "<", "URI", ",", "URI", ",", "MatchResult", ">", "mat...
Obtains all the matching resources that have a MatchType with the URIs of {@code origin} of the type provided (inclusive) or more. @param origins URIs to match @param minType the minimum MatchType we want to obtain @return a {@link com.google.common.collect.Table} with the result of the matching indexed by origin URI and then destination URI.
[ "Obtains", "all", "the", "matching", "resources", "that", "have", "a", "MatchType", "with", "the", "URIs", "of", "{", "@code", "origin", "}", "of", "the", "type", "provided", "(", "inclusive", ")", "or", "more", "." ]
train
https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/impl/SparqlLogicConceptMatcher.java#L277-L293
ArcBees/gwtquery
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java
WidgetsUtils.replaceOrAppend
public static void replaceOrAppend(Element e, Widget widget) { assert e != null && widget != null; if ($(e).widget() != null && $(e).widget().isAttached()) { replaceWidget($(e).widget(), widget, true); } else { detachWidget(widget); replaceOrAppend(e, widget.getElement()); attachWidget(widget, getFirstParentWidget(widget)); } }
java
public static void replaceOrAppend(Element e, Widget widget) { assert e != null && widget != null; if ($(e).widget() != null && $(e).widget().isAttached()) { replaceWidget($(e).widget(), widget, true); } else { detachWidget(widget); replaceOrAppend(e, widget.getElement()); attachWidget(widget, getFirstParentWidget(widget)); } }
[ "public", "static", "void", "replaceOrAppend", "(", "Element", "e", ",", "Widget", "widget", ")", "{", "assert", "e", "!=", "null", "&&", "widget", "!=", "null", ";", "if", "(", "$", "(", "e", ")", ".", "widget", "(", ")", "!=", "null", "&&", "$", ...
Replace a dom element by a widget. Old element classes will be copied to the new widget.
[ "Replace", "a", "dom", "element", "by", "a", "widget", ".", "Old", "element", "classes", "will", "be", "copied", "to", "the", "new", "widget", "." ]
train
https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/WidgetsUtils.java#L88-L97
mikepenz/ItemAnimators
library/src/main/java/com/mikepenz/itemanimators/BaseItemAnimator.java
BaseItemAnimator.changeAnimation
public void changeAnimation(ViewHolder oldHolder, ViewHolder newHolder, int fromX, int fromY, int toX, int toY) { final float prevTranslationX = ViewCompat.getTranslationX(oldHolder.itemView); final float prevTranslationY = ViewCompat.getTranslationY(oldHolder.itemView); final float prevValue = ViewCompat.getAlpha(oldHolder.itemView); resetAnimation(oldHolder); int deltaX = (int) (toX - fromX - prevTranslationX); int deltaY = (int) (toY - fromY - prevTranslationY); // recover prev translation state after ending animation ViewCompat.setTranslationX(oldHolder.itemView, prevTranslationX); ViewCompat.setTranslationY(oldHolder.itemView, prevTranslationY); ViewCompat.setAlpha(oldHolder.itemView, prevValue); if (newHolder != null) { // carry over translation values resetAnimation(newHolder); ViewCompat.setTranslationX(newHolder.itemView, -deltaX); ViewCompat.setTranslationY(newHolder.itemView, -deltaY); ViewCompat.setAlpha(newHolder.itemView, 0); } }
java
public void changeAnimation(ViewHolder oldHolder, ViewHolder newHolder, int fromX, int fromY, int toX, int toY) { final float prevTranslationX = ViewCompat.getTranslationX(oldHolder.itemView); final float prevTranslationY = ViewCompat.getTranslationY(oldHolder.itemView); final float prevValue = ViewCompat.getAlpha(oldHolder.itemView); resetAnimation(oldHolder); int deltaX = (int) (toX - fromX - prevTranslationX); int deltaY = (int) (toY - fromY - prevTranslationY); // recover prev translation state after ending animation ViewCompat.setTranslationX(oldHolder.itemView, prevTranslationX); ViewCompat.setTranslationY(oldHolder.itemView, prevTranslationY); ViewCompat.setAlpha(oldHolder.itemView, prevValue); if (newHolder != null) { // carry over translation values resetAnimation(newHolder); ViewCompat.setTranslationX(newHolder.itemView, -deltaX); ViewCompat.setTranslationY(newHolder.itemView, -deltaY); ViewCompat.setAlpha(newHolder.itemView, 0); } }
[ "public", "void", "changeAnimation", "(", "ViewHolder", "oldHolder", ",", "ViewHolder", "newHolder", ",", "int", "fromX", ",", "int", "fromY", ",", "int", "toX", ",", "int", "toY", ")", "{", "final", "float", "prevTranslationX", "=", "ViewCompat", ".", "getT...
the whole change animation if we have to cross animate two views @param oldHolder @param newHolder @param fromX @param fromY @param toX @param toY
[ "the", "whole", "change", "animation", "if", "we", "have", "to", "cross", "animate", "two", "views" ]
train
https://github.com/mikepenz/ItemAnimators/blob/dacfdbd7bfe8a281670e9378a74f54e362678c43/library/src/main/java/com/mikepenz/itemanimators/BaseItemAnimator.java#L461-L480
OpenLiberty/open-liberty
dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/LicenseUtility.java
LicenseUtility.getLicenseFile
public final File getLicenseFile(File installLicenseDir, String prefix) throws FileNotFoundException { if (!!!prefix.endsWith("_")) { prefix = prefix + "_"; } Locale locale = Locale.getDefault(); String lang = locale.getLanguage(); String country = locale.getCountry(); String[] suffixes = new String[] { lang + '_' + country, lang, "en" }; File[] listOfFiles = installLicenseDir.listFiles(); File licenseFile = null; outer: for (File file : listOfFiles) { for (String suffix : suffixes) { if (file.getName().startsWith(prefix) && file.getName().endsWith(suffix)) { licenseFile = new File(file.getAbsolutePath()); break outer; } } } return licenseFile; }
java
public final File getLicenseFile(File installLicenseDir, String prefix) throws FileNotFoundException { if (!!!prefix.endsWith("_")) { prefix = prefix + "_"; } Locale locale = Locale.getDefault(); String lang = locale.getLanguage(); String country = locale.getCountry(); String[] suffixes = new String[] { lang + '_' + country, lang, "en" }; File[] listOfFiles = installLicenseDir.listFiles(); File licenseFile = null; outer: for (File file : listOfFiles) { for (String suffix : suffixes) { if (file.getName().startsWith(prefix) && file.getName().endsWith(suffix)) { licenseFile = new File(file.getAbsolutePath()); break outer; } } } return licenseFile; }
[ "public", "final", "File", "getLicenseFile", "(", "File", "installLicenseDir", ",", "String", "prefix", ")", "throws", "FileNotFoundException", "{", "if", "(", "!", "!", "!", "prefix", ".", "endsWith", "(", "\"_\"", ")", ")", "{", "prefix", "=", "prefix", ...
Gets the license information and agreement from wlp/lafiles directory depending on Locale @param licenseFile location of directory containing the licenses @param prefix LA/LI prefix @return licensefile @throws FileNotFoundException
[ "Gets", "the", "license", "information", "and", "agreement", "from", "wlp", "/", "lafiles", "directory", "depending", "on", "Locale" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/LicenseUtility.java#L57-L81
ginere/ginere-base
src/main/java/eu/ginere/base/util/i18n/I18NConnector.java
I18NConnector.getLabel
public static String getLabel(Class<?> clazz, String label) { Language language=getThreadLocalLanguage(null); if (language==null){ return label; } else { return getLabel(language, clazz.getName(), label); } }
java
public static String getLabel(Class<?> clazz, String label) { Language language=getThreadLocalLanguage(null); if (language==null){ return label; } else { return getLabel(language, clazz.getName(), label); } }
[ "public", "static", "String", "getLabel", "(", "Class", "<", "?", ">", "clazz", ",", "String", "label", ")", "{", "Language", "language", "=", "getThreadLocalLanguage", "(", "null", ")", ";", "if", "(", "language", "==", "null", ")", "{", "return", "labe...
Returns the value for this label ussing the getThreadLocaleLanguage @param section @param idInSection @return
[ "Returns", "the", "value", "for", "this", "label", "ussing", "the", "getThreadLocaleLanguage" ]
train
https://github.com/ginere/ginere-base/blob/b1cc1c5834bd8a31df475c6f3fc0ee51273c5a24/src/main/java/eu/ginere/base/util/i18n/I18NConnector.java#L102-L110
glyptodon/guacamole-client
guacamole/src/main/java/org/apache/guacamole/tunnel/InputStreamInterceptingFilter.java
InputStreamInterceptingFilter.sendBlob
private void sendBlob(String index, byte[] blob) { // Send "blob" containing provided data sendInstruction(new GuacamoleInstruction("blob", index, BaseEncoding.base64().encode(blob))); }
java
private void sendBlob(String index, byte[] blob) { // Send "blob" containing provided data sendInstruction(new GuacamoleInstruction("blob", index, BaseEncoding.base64().encode(blob))); }
[ "private", "void", "sendBlob", "(", "String", "index", ",", "byte", "[", "]", "blob", ")", "{", "// Send \"blob\" containing provided data", "sendInstruction", "(", "new", "GuacamoleInstruction", "(", "\"blob\"", ",", "index", ",", "BaseEncoding", ".", "base64", "...
Injects a "blob" instruction into the outbound Guacamole protocol stream, as if sent by the connected client. "blob" instructions are used to send chunks of data along a stream. @param index The index of the stream that this "blob" instruction relates to. @param blob The chunk of data to send within the "blob" instruction.
[ "Injects", "a", "blob", "instruction", "into", "the", "outbound", "Guacamole", "protocol", "stream", "as", "if", "sent", "by", "the", "connected", "client", ".", "blob", "instructions", "are", "used", "to", "send", "chunks", "of", "data", "along", "a", "stre...
train
https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/tunnel/InputStreamInterceptingFilter.java#L74-L80
JosePaumard/streams-utils
src/main/java/org/paumard/streams/StreamsUtils.java
StreamsUtils.shiftingWindowAveragingInt
public static <E> DoubleStream shiftingWindowAveragingInt(Stream<E> stream, int rollingFactor, ToIntFunction<? super E> mapper) { Objects.requireNonNull(stream); Objects.requireNonNull(mapper); IntStream intStream = stream.mapToInt(mapper); return shiftingWindowAveragingInt(intStream, rollingFactor); }
java
public static <E> DoubleStream shiftingWindowAveragingInt(Stream<E> stream, int rollingFactor, ToIntFunction<? super E> mapper) { Objects.requireNonNull(stream); Objects.requireNonNull(mapper); IntStream intStream = stream.mapToInt(mapper); return shiftingWindowAveragingInt(intStream, rollingFactor); }
[ "public", "static", "<", "E", ">", "DoubleStream", "shiftingWindowAveragingInt", "(", "Stream", "<", "E", ">", "stream", ",", "int", "rollingFactor", ",", "ToIntFunction", "<", "?", "super", "E", ">", "mapper", ")", "{", "Objects", ".", "requireNonNull", "("...
<p>Generates a stream that is computed from a provided stream following two steps.</p> <p>The first steps maps this stream to an <code>IntStream</code> that is then rolled following the same principle as the <code>roll()</code> method. This steps builds a <code>Stream&lt;IntStream&gt;</code>. </p> <p>Then the <code>average()</code> method is called on each <code>IntStream</code> using a mapper, and a <code>DoubleStream</code> of averages is returned.</p> <p>The resulting stream has the same number of elements as the provided stream, minus the size of the window width, to preserve consistency of each collection. </p> <p>A <code>NullPointerException</code> will be thrown if the provided stream or the mapper is null.</p> @param stream the processed stream @param rollingFactor the size of the window to apply the collector on @param mapper the mapper applied @param <E> the type of the provided stream @return a stream in which each value is the average of the provided stream
[ "<p", ">", "Generates", "a", "stream", "that", "is", "computed", "from", "a", "provided", "stream", "following", "two", "steps", ".", "<", "/", "p", ">", "<p", ">", "The", "first", "steps", "maps", "this", "stream", "to", "an", "<code", ">", "IntStream...
train
https://github.com/JosePaumard/streams-utils/blob/56152574af0aca44c5f679761202a8f90984ab73/src/main/java/org/paumard/streams/StreamsUtils.java#L560-L566
appium/java-client
src/main/java/io/appium/java_client/MobileCommand.java
MobileCommand.compareImagesCommand
public static Map.Entry<String, Map<String, ?>> compareImagesCommand(ComparisonMode mode, byte[] img1Data, byte[] img2Data, @Nullable BaseComparisonOptions options) { String[] parameters = options == null ? new String[]{"mode", "firstImage", "secondImage"} : new String[]{"mode", "firstImage", "secondImage", "options"}; Object[] values = options == null ? new Object[]{mode.toString(), new String(img1Data, StandardCharsets.UTF_8), new String(img2Data, StandardCharsets.UTF_8)} : new Object[]{mode.toString(), new String(img1Data, StandardCharsets.UTF_8), new String(img2Data, StandardCharsets.UTF_8), options.build()}; return new AbstractMap.SimpleEntry<>(COMPARE_IMAGES, prepareArguments(parameters, values)); }
java
public static Map.Entry<String, Map<String, ?>> compareImagesCommand(ComparisonMode mode, byte[] img1Data, byte[] img2Data, @Nullable BaseComparisonOptions options) { String[] parameters = options == null ? new String[]{"mode", "firstImage", "secondImage"} : new String[]{"mode", "firstImage", "secondImage", "options"}; Object[] values = options == null ? new Object[]{mode.toString(), new String(img1Data, StandardCharsets.UTF_8), new String(img2Data, StandardCharsets.UTF_8)} : new Object[]{mode.toString(), new String(img1Data, StandardCharsets.UTF_8), new String(img2Data, StandardCharsets.UTF_8), options.build()}; return new AbstractMap.SimpleEntry<>(COMPARE_IMAGES, prepareArguments(parameters, values)); }
[ "public", "static", "Map", ".", "Entry", "<", "String", ",", "Map", "<", "String", ",", "?", ">", ">", "compareImagesCommand", "(", "ComparisonMode", "mode", ",", "byte", "[", "]", "img1Data", ",", "byte", "[", "]", "img2Data", ",", "@", "Nullable", "B...
Forms a {@link java.util.Map} of parameters for images comparison. @param mode one of possible comparison modes @param img1Data base64-encoded data of the first image @param img2Data base64-encoded data of the second image @param options comparison options @return key-value pairs
[ "Forms", "a", "{", "@link", "java", ".", "util", ".", "Map", "}", "of", "parameters", "for", "images", "comparison", "." ]
train
https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/MobileCommand.java#L505-L517
graphql-java/graphql-java
src/main/java/graphql/execution/ExecutionStrategy.java
ExecutionStrategy.getFieldDef
protected GraphQLFieldDefinition getFieldDef(GraphQLSchema schema, GraphQLObjectType parentType, Field field) { return Introspection.getFieldDef(schema, parentType, field.getName()); }
java
protected GraphQLFieldDefinition getFieldDef(GraphQLSchema schema, GraphQLObjectType parentType, Field field) { return Introspection.getFieldDef(schema, parentType, field.getName()); }
[ "protected", "GraphQLFieldDefinition", "getFieldDef", "(", "GraphQLSchema", "schema", ",", "GraphQLObjectType", "parentType", ",", "Field", "field", ")", "{", "return", "Introspection", ".", "getFieldDef", "(", "schema", ",", "parentType", ",", "field", ".", "getNam...
Called to discover the field definition give the current parameters and the AST {@link Field} @param schema the schema in play @param parentType the parent type of the field @param field the field to find the definition of @return a {@link GraphQLFieldDefinition}
[ "Called", "to", "discover", "the", "field", "definition", "give", "the", "current", "parameters", "and", "the", "AST", "{", "@link", "Field", "}" ]
train
https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/execution/ExecutionStrategy.java#L713-L715
UrielCh/ovh-java-sdk
ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java
ApiOvhDbaaslogs.serviceName_role_roleId_PUT
public OvhOperation serviceName_role_roleId_PUT(String serviceName, String roleId, String description, String name, String optionId) throws IOException { String qPath = "/dbaas/logs/{serviceName}/role/{roleId}"; StringBuilder sb = path(qPath, serviceName, roleId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "description", description); addBody(o, "name", name); addBody(o, "optionId", optionId); String resp = exec(qPath, "PUT", sb.toString(), o); return convertTo(resp, OvhOperation.class); }
java
public OvhOperation serviceName_role_roleId_PUT(String serviceName, String roleId, String description, String name, String optionId) throws IOException { String qPath = "/dbaas/logs/{serviceName}/role/{roleId}"; StringBuilder sb = path(qPath, serviceName, roleId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "description", description); addBody(o, "name", name); addBody(o, "optionId", optionId); String resp = exec(qPath, "PUT", sb.toString(), o); return convertTo(resp, OvhOperation.class); }
[ "public", "OvhOperation", "serviceName_role_roleId_PUT", "(", "String", "serviceName", ",", "String", "roleId", ",", "String", "description", ",", "String", "name", ",", "String", "optionId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/dbaas/logs/...
Update information of specified role REST: PUT /dbaas/logs/{serviceName}/role/{roleId} @param serviceName [required] Service name @param roleId [required] Role ID @param optionId [required] Option ID @param name [required] Name @param description [required] Description
[ "Update", "information", "of", "specified", "role" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L750-L759
apache/groovy
subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
Sql.callWithRows
public List<GroovyRowResult> callWithRows(String sql, List<Object> params, Closure closure) throws SQLException { return callWithRows(sql, params, FIRST_RESULT_SET, closure).get(0); }
java
public List<GroovyRowResult> callWithRows(String sql, List<Object> params, Closure closure) throws SQLException { return callWithRows(sql, params, FIRST_RESULT_SET, closure).get(0); }
[ "public", "List", "<", "GroovyRowResult", ">", "callWithRows", "(", "String", "sql", ",", "List", "<", "Object", ">", "params", ",", "Closure", "closure", ")", "throws", "SQLException", "{", "return", "callWithRows", "(", "sql", ",", "params", ",", "FIRST_RE...
Performs a stored procedure call with the given parameters, calling the closure once with all result objects, and also returning the rows of the ResultSet. <p> Use this when calling a stored procedure that utilizes both output parameters and returns a single ResultSet. <p> Once created, the stored procedure can be called like this: <pre> def rows = sql.callWithRows '{call Hemisphere2(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells {@code ->} println dwells } </pre> <p> Resource handling is performed automatically where appropriate. @param sql the sql statement @param params a list of parameters @param closure called once with all out parameter results @return a list of GroovyRowResult objects @throws SQLException if a database access error occurs @see #callWithRows(GString, Closure)
[ "Performs", "a", "stored", "procedure", "call", "with", "the", "given", "parameters", "calling", "the", "closure", "once", "with", "all", "result", "objects", "and", "also", "returning", "the", "rows", "of", "the", "ResultSet", ".", "<p", ">", "Use", "this",...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L3266-L3268
geomajas/geomajas-project-client-gwt2
impl/src/main/java/org/geomajas/gwt2/client/service/DomService.java
DomService.setLeft
public static void setLeft(Element element, int left) { if (Dom.isIE()) { // Limitation in IE8... while (left > 1000000) { left -= 1000000; } while (left < -1000000) { left += 1000000; } } Dom.setStyleAttribute(element, "left", left + "px"); }
java
public static void setLeft(Element element, int left) { if (Dom.isIE()) { // Limitation in IE8... while (left > 1000000) { left -= 1000000; } while (left < -1000000) { left += 1000000; } } Dom.setStyleAttribute(element, "left", left + "px"); }
[ "public", "static", "void", "setLeft", "(", "Element", "element", ",", "int", "left", ")", "{", "if", "(", "Dom", ".", "isIE", "(", ")", ")", "{", "// Limitation in IE8...", "while", "(", "left", ">", "1000000", ")", "{", "left", "-=", "1000000", ";", ...
Apply the "left" style attribute on the given element. @param element The DOM element. @param left The left value.
[ "Apply", "the", "left", "style", "attribute", "on", "the", "given", "element", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/service/DomService.java#L80-L90
wcm-io/wcm-io-handler
media/src/main/java/io/wcm/handler/media/CropDimension.java
CropDimension.fromCropString
public static @NotNull CropDimension fromCropString(@NotNull String cropString) { if (StringUtils.isEmpty(cropString)) { throw new IllegalArgumentException("Invalid crop string: '" + cropString + "'."); } // strip off optional size parameter after "/" String crop = cropString; if (StringUtils.contains(crop, "/")) { crop = StringUtils.substringBefore(crop, "/"); } String[] parts = StringUtils.split(crop, ","); if (parts.length != 4) { throw new IllegalArgumentException("Invalid crop string: '" + cropString + "'."); } long x1 = NumberUtils.toLong(parts[0]); long y1 = NumberUtils.toLong(parts[1]); long x2 = NumberUtils.toLong(parts[2]); long y2 = NumberUtils.toLong(parts[3]); long width = x2 - x1; long height = y2 - y1; if (x1 < 0 || y1 < 0 || width <= 0 || height <= 0) { throw new IllegalArgumentException("Invalid crop string: '" + cropString + "'."); } return new CropDimension(x1, y1, width, height); }
java
public static @NotNull CropDimension fromCropString(@NotNull String cropString) { if (StringUtils.isEmpty(cropString)) { throw new IllegalArgumentException("Invalid crop string: '" + cropString + "'."); } // strip off optional size parameter after "/" String crop = cropString; if (StringUtils.contains(crop, "/")) { crop = StringUtils.substringBefore(crop, "/"); } String[] parts = StringUtils.split(crop, ","); if (parts.length != 4) { throw new IllegalArgumentException("Invalid crop string: '" + cropString + "'."); } long x1 = NumberUtils.toLong(parts[0]); long y1 = NumberUtils.toLong(parts[1]); long x2 = NumberUtils.toLong(parts[2]); long y2 = NumberUtils.toLong(parts[3]); long width = x2 - x1; long height = y2 - y1; if (x1 < 0 || y1 < 0 || width <= 0 || height <= 0) { throw new IllegalArgumentException("Invalid crop string: '" + cropString + "'."); } return new CropDimension(x1, y1, width, height); }
[ "public", "static", "@", "NotNull", "CropDimension", "fromCropString", "(", "@", "NotNull", "String", "cropString", ")", "{", "if", "(", "StringUtils", ".", "isEmpty", "(", "cropString", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Invalid ...
Get crop dimension from crop string. Please note: Crop string contains not width/height as 3rd/4th parameter but right, bottom. @param cropString Cropping string from CQ5 smartimage widget @return Crop dimension instance @throws IllegalArgumentException if crop string syntax is invalid
[ "Get", "crop", "dimension", "from", "crop", "string", ".", "Please", "note", ":", "Crop", "string", "contains", "not", "width", "/", "height", "as", "3rd", "/", "4th", "parameter", "but", "right", "bottom", "." ]
train
https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/CropDimension.java#L121-L146
f2prateek/dart
henson/src/main/java/dart/henson/Bundler.java
Bundler.putIntegerArrayList
public Bundler putIntegerArrayList(String key, ArrayList<Integer> value) { delegate.putIntegerArrayList(key, value); return this; }
java
public Bundler putIntegerArrayList(String key, ArrayList<Integer> value) { delegate.putIntegerArrayList(key, value); return this; }
[ "public", "Bundler", "putIntegerArrayList", "(", "String", "key", ",", "ArrayList", "<", "Integer", ">", "value", ")", "{", "delegate", ".", "putIntegerArrayList", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Inserts an ArrayList<Integer> value into the mapping of the underlying Bundle, replacing any existing value for the given key. Either key or value may be null. @param key a String, or null @param value an ArrayList<Integer> object, or null @return this bundler instance to chain method calls
[ "Inserts", "an", "ArrayList<Integer", ">", "value", "into", "the", "mapping", "of", "the", "underlying", "Bundle", "replacing", "any", "existing", "value", "for", "the", "given", "key", ".", "Either", "key", "or", "value", "may", "be", "null", "." ]
train
https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L114-L117
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/jboss/logging/Logger.java
Logger.tracev
public void tracev(Throwable t, String format, Object... params) { doLog(Level.TRACE, FQCN, format, params, t); }
java
public void tracev(Throwable t, String format, Object... params) { doLog(Level.TRACE, FQCN, format, params, t); }
[ "public", "void", "tracev", "(", "Throwable", "t", ",", "String", "format", ",", "Object", "...", "params", ")", "{", "doLog", "(", "Level", ".", "TRACE", ",", "FQCN", ",", "format", ",", "params", ",", "t", ")", ";", "}" ]
Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting. @param t the throwable @param format the message format string @param params the parameters
[ "Issue", "a", "log", "message", "with", "a", "level", "of", "TRACE", "using", "{", "@link", "java", ".", "text", ".", "MessageFormat", "}", "-", "style", "formatting", "." ]
train
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L224-L226
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/util/LogQueryTool.java
LogQueryTool.exceptionWithQuery
public SQLException exceptionWithQuery(SQLException sqlEx, PrepareResult prepareResult) { if (options.dumpQueriesOnException || sqlEx.getErrorCode() == 1064) { String querySql = prepareResult.getSql(); String message = sqlEx.getMessage(); if (options.maxQuerySizeToLog != 0 && querySql.length() > options.maxQuerySizeToLog - 3) { message += "\nQuery is: " + querySql.substring(0, options.maxQuerySizeToLog - 3) + "..."; } else { message += "\nQuery is: " + querySql; } message += "\njava thread: " + Thread.currentThread().getName(); return new SQLException(message, sqlEx.getSQLState(), sqlEx.getErrorCode(), sqlEx.getCause()); } return sqlEx; }
java
public SQLException exceptionWithQuery(SQLException sqlEx, PrepareResult prepareResult) { if (options.dumpQueriesOnException || sqlEx.getErrorCode() == 1064) { String querySql = prepareResult.getSql(); String message = sqlEx.getMessage(); if (options.maxQuerySizeToLog != 0 && querySql.length() > options.maxQuerySizeToLog - 3) { message += "\nQuery is: " + querySql.substring(0, options.maxQuerySizeToLog - 3) + "..."; } else { message += "\nQuery is: " + querySql; } message += "\njava thread: " + Thread.currentThread().getName(); return new SQLException(message, sqlEx.getSQLState(), sqlEx.getErrorCode(), sqlEx.getCause()); } return sqlEx; }
[ "public", "SQLException", "exceptionWithQuery", "(", "SQLException", "sqlEx", ",", "PrepareResult", "prepareResult", ")", "{", "if", "(", "options", ".", "dumpQueriesOnException", "||", "sqlEx", ".", "getErrorCode", "(", ")", "==", "1064", ")", "{", "String", "q...
Return exception with query information's. @param sqlEx current exception @param prepareResult prepare results @return exception with query information
[ "Return", "exception", "with", "query", "information", "s", "." ]
train
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/LogQueryTool.java#L175-L188
greenrobot/essentials
java-essentials/src/main/java/org/greenrobot/essentials/io/IoUtils.java
IoUtils.copyAllBytes
public static int copyAllBytes(InputStream in, OutputStream out) throws IOException { int byteCount = 0; byte[] buffer = new byte[BUFFER_SIZE]; while (true) { int read = in.read(buffer); if (read == -1) { break; } out.write(buffer, 0, read); byteCount += read; } return byteCount; }
java
public static int copyAllBytes(InputStream in, OutputStream out) throws IOException { int byteCount = 0; byte[] buffer = new byte[BUFFER_SIZE]; while (true) { int read = in.read(buffer); if (read == -1) { break; } out.write(buffer, 0, read); byteCount += read; } return byteCount; }
[ "public", "static", "int", "copyAllBytes", "(", "InputStream", "in", ",", "OutputStream", "out", ")", "throws", "IOException", "{", "int", "byteCount", "=", "0", ";", "byte", "[", "]", "buffer", "=", "new", "byte", "[", "BUFFER_SIZE", "]", ";", "while", ...
Copies all available data from in to out without closing any stream. @return number of bytes copied
[ "Copies", "all", "available", "data", "from", "in", "to", "out", "without", "closing", "any", "stream", "." ]
train
https://github.com/greenrobot/essentials/blob/31eaaeb410174004196c9ef9c9469e0d02afd94b/java-essentials/src/main/java/org/greenrobot/essentials/io/IoUtils.java#L130-L142
sarl/sarl
sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/Services.java
Services.stopServices
public static void stopServices(IServiceManager manager) { final List<Service> otherServices = new ArrayList<>(); final List<Service> infraServices = new ArrayList<>(); final LinkedList<DependencyNode> serviceQueue = new LinkedList<>(); final Accessors accessors = new StoppingPhaseAccessors(); // Build the dependency graph buildInvertedDependencyGraph(manager, serviceQueue, infraServices, otherServices, accessors); // Launch the services runDependencyGraph(serviceQueue, infraServices, otherServices, accessors); manager.awaitStopped(); }
java
public static void stopServices(IServiceManager manager) { final List<Service> otherServices = new ArrayList<>(); final List<Service> infraServices = new ArrayList<>(); final LinkedList<DependencyNode> serviceQueue = new LinkedList<>(); final Accessors accessors = new StoppingPhaseAccessors(); // Build the dependency graph buildInvertedDependencyGraph(manager, serviceQueue, infraServices, otherServices, accessors); // Launch the services runDependencyGraph(serviceQueue, infraServices, otherServices, accessors); manager.awaitStopped(); }
[ "public", "static", "void", "stopServices", "(", "IServiceManager", "manager", ")", "{", "final", "List", "<", "Service", ">", "otherServices", "=", "new", "ArrayList", "<>", "(", ")", ";", "final", "List", "<", "Service", ">", "infraServices", "=", "new", ...
Stop the services associated to the given service manager. <p>This stopping function supports the {@link DependentService prioritized services}. @param manager the manager of the services to stop.
[ "Stop", "the", "services", "associated", "to", "the", "given", "service", "manager", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/services/Services.java#L108-L121
jferard/fastods
fastods/src/main/java/com/github/jferard/fastods/AnonymousOdsFileWriter.java
AnonymousOdsFileWriter.saveAs
public void saveAs(final String filename, final ZipUTF8WriterBuilder builder) throws IOException { try { final FileOutputStream out = new FileOutputStream(filename); final ZipUTF8Writer writer = builder.build(out); try { this.save(writer); } finally { writer.close(); } } catch (final FileNotFoundException e) { this.logger.log(Level.SEVERE, "Can't open " + filename, e); throw new IOException(e); } }
java
public void saveAs(final String filename, final ZipUTF8WriterBuilder builder) throws IOException { try { final FileOutputStream out = new FileOutputStream(filename); final ZipUTF8Writer writer = builder.build(out); try { this.save(writer); } finally { writer.close(); } } catch (final FileNotFoundException e) { this.logger.log(Level.SEVERE, "Can't open " + filename, e); throw new IOException(e); } }
[ "public", "void", "saveAs", "(", "final", "String", "filename", ",", "final", "ZipUTF8WriterBuilder", "builder", ")", "throws", "IOException", "{", "try", "{", "final", "FileOutputStream", "out", "=", "new", "FileOutputStream", "(", "filename", ")", ";", "final"...
Save the document to filename. @param filename the name of the destination file @param builder a builder for the ZipOutputStream and the Writer (buffers, level, ...) @throws IOException if the file was not saved
[ "Save", "the", "document", "to", "filename", "." ]
train
https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/AnonymousOdsFileWriter.java#L136-L150
aws/aws-sdk-java
aws-java-sdk-gamelift/src/main/java/com/amazonaws/services/gamelift/model/Player.java
Player.withPlayerAttributes
public Player withPlayerAttributes(java.util.Map<String, AttributeValue> playerAttributes) { setPlayerAttributes(playerAttributes); return this; }
java
public Player withPlayerAttributes(java.util.Map<String, AttributeValue> playerAttributes) { setPlayerAttributes(playerAttributes); return this; }
[ "public", "Player", "withPlayerAttributes", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "AttributeValue", ">", "playerAttributes", ")", "{", "setPlayerAttributes", "(", "playerAttributes", ")", ";", "return", "this", ";", "}" ]
<p> Collection of key:value pairs containing player information for use in matchmaking. Player attribute keys must match the <i>playerAttributes</i> used in a matchmaking rule set. Example: <code>"PlayerAttributes": {"skill": {"N": "23"}, "gameMode": {"S": "deathmatch"}}</code>. </p> @param playerAttributes Collection of key:value pairs containing player information for use in matchmaking. Player attribute keys must match the <i>playerAttributes</i> used in a matchmaking rule set. Example: <code>"PlayerAttributes": {"skill": {"N": "23"}, "gameMode": {"S": "deathmatch"}}</code>. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "Collection", "of", "key", ":", "value", "pairs", "containing", "player", "information", "for", "use", "in", "matchmaking", ".", "Player", "attribute", "keys", "must", "match", "the", "<i", ">", "playerAttributes<", "/", "i", ">", "used", "in", ...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-gamelift/src/main/java/com/amazonaws/services/gamelift/model/Player.java#L153-L156
scravy/java-pair
src/main/java/de/scravy/pair/Pairs.java
Pairs.toMap
public static <K, V, M extends Map<K, V>> M toMap( final Iterable<Pair<K, V>> pairs, final Class<M> mapType) { try { final M map = mapType.newInstance(); return toMap(pairs, map); } catch (final Exception exc) { return null; } }
java
public static <K, V, M extends Map<K, V>> M toMap( final Iterable<Pair<K, V>> pairs, final Class<M> mapType) { try { final M map = mapType.newInstance(); return toMap(pairs, map); } catch (final Exception exc) { return null; } }
[ "public", "static", "<", "K", ",", "V", ",", "M", "extends", "Map", "<", "K", ",", "V", ">", ">", "M", "toMap", "(", "final", "Iterable", "<", "Pair", "<", "K", ",", "V", ">", ">", "pairs", ",", "final", "Class", "<", "M", ">", "mapType", ")"...
Creates a {@link Map} of the given <code>mapType</code> from an {@link Iterable} of pairs <code>(k, v)</code>. @since 1.0.0 @param pairs The pairs. @param mapType The map type (must have a public default constructor). @return The map populated with the values from <code>pairs</code> or <code>null</code>, if the Map could not be instantiated.
[ "Creates", "a", "{", "@link", "Map", "}", "of", "the", "given", "<code", ">", "mapType<", "/", "code", ">", "from", "an", "{", "@link", "Iterable", "}", "of", "pairs", "<code", ">", "(", "k", "v", ")", "<", "/", "code", ">", "." ]
train
https://github.com/scravy/java-pair/blob/d8792e86c4f8e977826a4ccb940e4416a1119ccb/src/main/java/de/scravy/pair/Pairs.java#L243-L251
Wadpam/guja
guja-core/src/main/java/com/wadpam/guja/i18n/dao/GeneratedDi18nDaoImpl.java
GeneratedDi18nDaoImpl.queryByCreatedDate
public Iterable<Di18n> queryByCreatedDate(java.util.Date createdDate) { return queryByField(null, Di18nMapper.Field.CREATEDDATE.getFieldName(), createdDate); }
java
public Iterable<Di18n> queryByCreatedDate(java.util.Date createdDate) { return queryByField(null, Di18nMapper.Field.CREATEDDATE.getFieldName(), createdDate); }
[ "public", "Iterable", "<", "Di18n", ">", "queryByCreatedDate", "(", "java", ".", "util", ".", "Date", "createdDate", ")", "{", "return", "queryByField", "(", "null", ",", "Di18nMapper", ".", "Field", ".", "CREATEDDATE", ".", "getFieldName", "(", ")", ",", ...
query-by method for field createdDate @param createdDate the specified attribute @return an Iterable of Di18ns for the specified createdDate
[ "query", "-", "by", "method", "for", "field", "createdDate" ]
train
https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/i18n/dao/GeneratedDi18nDaoImpl.java#L61-L63
spockframework/spock
spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java
GroovyRuntimeUtil.instantiateClosure
public static <T extends Closure<?>> T instantiateClosure(Class<T> closureType, Object owner, Object thisObject) { try { Constructor<T> constructor = closureType.getConstructor(Object.class, Object.class); return constructor.newInstance(owner, thisObject); } catch (Exception e) { ExceptionUtil.sneakyThrow(e.getCause()); return null; // never reached } }
java
public static <T extends Closure<?>> T instantiateClosure(Class<T> closureType, Object owner, Object thisObject) { try { Constructor<T> constructor = closureType.getConstructor(Object.class, Object.class); return constructor.newInstance(owner, thisObject); } catch (Exception e) { ExceptionUtil.sneakyThrow(e.getCause()); return null; // never reached } }
[ "public", "static", "<", "T", "extends", "Closure", "<", "?", ">", ">", "T", "instantiateClosure", "(", "Class", "<", "T", ">", "closureType", ",", "Object", "owner", ",", "Object", "thisObject", ")", "{", "try", "{", "Constructor", "<", "T", ">", "con...
Note: This method may throw checked exceptions although it doesn't say so.
[ "Note", ":", "This", "method", "may", "throw", "checked", "exceptions", "although", "it", "doesn", "t", "say", "so", "." ]
train
https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java#L211-L219
pip-services3-java/pip-services3-components-java
src/org/pipservices3/components/count/CompositeCounters.java
CompositeCounters.setReferences
public void setReferences(IReferences references) throws ReferenceException { List<Object> counters = references.getOptional(new Descriptor(null, "counters", null, null, null)); for (Object counter : counters) { if (counter instanceof ICounters && counter != this) _counters.add((ICounters) counter); } }
java
public void setReferences(IReferences references) throws ReferenceException { List<Object> counters = references.getOptional(new Descriptor(null, "counters", null, null, null)); for (Object counter : counters) { if (counter instanceof ICounters && counter != this) _counters.add((ICounters) counter); } }
[ "public", "void", "setReferences", "(", "IReferences", "references", ")", "throws", "ReferenceException", "{", "List", "<", "Object", ">", "counters", "=", "references", ".", "getOptional", "(", "new", "Descriptor", "(", "null", ",", "\"counters\"", ",", "null",...
Sets references to dependent components. @param references references to locate the component dependencies. @throws ReferenceException when no references found.
[ "Sets", "references", "to", "dependent", "components", "." ]
train
https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/count/CompositeCounters.java#L58-L64
ontop/ontop
client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/treemodels/QueryControllerTreeModel.java
QueryControllerTreeModel.getElementQuery
public QueryTreeElement getElementQuery(String element, String group) { QueryTreeElement node = null; Enumeration<TreeNode> elements = root.children(); while (elements.hasMoreElements()) { TreeElement currentNode = (TreeElement) elements.nextElement(); if (currentNode instanceof QueryGroupTreeElement && currentNode.getID().equals(group)) { QueryGroupTreeElement groupTElement = (QueryGroupTreeElement) currentNode; Enumeration<TreeNode> queries = groupTElement.children(); while (queries.hasMoreElements()) { QueryTreeElement queryTElement = (QueryTreeElement) queries.nextElement(); if (queryTElement.getID().equals(element)) { node = queryTElement; break; } } } else { continue; } } return node; }
java
public QueryTreeElement getElementQuery(String element, String group) { QueryTreeElement node = null; Enumeration<TreeNode> elements = root.children(); while (elements.hasMoreElements()) { TreeElement currentNode = (TreeElement) elements.nextElement(); if (currentNode instanceof QueryGroupTreeElement && currentNode.getID().equals(group)) { QueryGroupTreeElement groupTElement = (QueryGroupTreeElement) currentNode; Enumeration<TreeNode> queries = groupTElement.children(); while (queries.hasMoreElements()) { QueryTreeElement queryTElement = (QueryTreeElement) queries.nextElement(); if (queryTElement.getID().equals(element)) { node = queryTElement; break; } } } else { continue; } } return node; }
[ "public", "QueryTreeElement", "getElementQuery", "(", "String", "element", ",", "String", "group", ")", "{", "QueryTreeElement", "node", "=", "null", ";", "Enumeration", "<", "TreeNode", ">", "elements", "=", "root", ".", "children", "(", ")", ";", "while", ...
Search a query node in a group and returns the object else returns null.
[ "Search", "a", "query", "node", "in", "a", "group", "and", "returns", "the", "object", "else", "returns", "null", "." ]
train
https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/client/protege/src/main/java/it/unibz/inf/ontop/protege/gui/treemodels/QueryControllerTreeModel.java#L262-L282
hal/core
gui/src/main/java/org/jboss/as/console/client/v3/elemento/Elements.java
Elements.innerHtml
public static void innerHtml(Element element, SafeHtml html) { if (element != null) { element.setInnerHTML(html.asString()); } }
java
public static void innerHtml(Element element, SafeHtml html) { if (element != null) { element.setInnerHTML(html.asString()); } }
[ "public", "static", "void", "innerHtml", "(", "Element", "element", ",", "SafeHtml", "html", ")", "{", "if", "(", "element", "!=", "null", ")", "{", "element", ".", "setInnerHTML", "(", "html", ".", "asString", "(", ")", ")", ";", "}", "}" ]
Convenience method to set the inner HTML of the given element.
[ "Convenience", "method", "to", "set", "the", "inner", "HTML", "of", "the", "given", "element", "." ]
train
https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/v3/elemento/Elements.java#L556-L560
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRulePersistenceImpl.java
CPRulePersistenceImpl.findAll
@Override public List<CPRule> findAll(int start, int end) { return findAll(start, end, null); }
java
@Override public List<CPRule> findAll(int start, int end) { return findAll(start, end, null); }
[ "@", "Override", "public", "List", "<", "CPRule", ">", "findAll", "(", "int", "start", ",", "int", "end", ")", "{", "return", "findAll", "(", "start", ",", "end", ",", "null", ")", ";", "}" ]
Returns a range of all the cp rules. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CPRuleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. </p> @param start the lower bound of the range of cp rules @param end the upper bound of the range of cp rules (not inclusive) @return the range of cp rules
[ "Returns", "a", "range", "of", "all", "the", "cp", "rules", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRulePersistenceImpl.java#L1467-L1470
osglworks/java-tool
src/main/java/org/osgl/util/IO.java
IO.writeContent
@Deprecated public static void writeContent(CharSequence content, File file, String encoding) { write(content, file, encoding); }
java
@Deprecated public static void writeContent(CharSequence content, File file, String encoding) { write(content, file, encoding); }
[ "@", "Deprecated", "public", "static", "void", "writeContent", "(", "CharSequence", "content", ",", "File", "file", ",", "String", "encoding", ")", "{", "write", "(", "content", ",", "file", ",", "encoding", ")", ";", "}" ]
Write string content to a file with encoding specified. This is deprecated. Please use {@link #write(CharSequence, File, String)} instead
[ "Write", "string", "content", "to", "a", "file", "with", "encoding", "specified", "." ]
train
https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/IO.java#L1702-L1705
pryzach/midao
midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java
TypeHandlerUtils.convertBlob
public static Object convertBlob(Connection conn, InputStream input) throws SQLException { return convertBlob(conn, toByteArray(input)); }
java
public static Object convertBlob(Connection conn, InputStream input) throws SQLException { return convertBlob(conn, toByteArray(input)); }
[ "public", "static", "Object", "convertBlob", "(", "Connection", "conn", ",", "InputStream", "input", ")", "throws", "SQLException", "{", "return", "convertBlob", "(", "conn", ",", "toByteArray", "(", "input", ")", ")", ";", "}" ]
Transfers data from InputStream into sql.Blob @param conn connection for which sql.Blob object would be created @param input InputStream @return sql.Blob from InputStream @throws SQLException
[ "Transfers", "data", "from", "InputStream", "into", "sql", ".", "Blob" ]
train
https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java#L95-L97
deeplearning4j/deeplearning4j
nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/v2/ModelParameterServer.java
ModelParameterServer.configure
public void configure(@NonNull VoidConfiguration configuration, @NonNull Transport transport, @NonNull UpdaterParametersProvider updaterProvider) { this.transport = transport; this.masterMode = false; this.configuration = configuration; this.updaterParametersProvider = updaterProvider; }
java
public void configure(@NonNull VoidConfiguration configuration, @NonNull Transport transport, @NonNull UpdaterParametersProvider updaterProvider) { this.transport = transport; this.masterMode = false; this.configuration = configuration; this.updaterParametersProvider = updaterProvider; }
[ "public", "void", "configure", "(", "@", "NonNull", "VoidConfiguration", "configuration", ",", "@", "NonNull", "Transport", "transport", ",", "@", "NonNull", "UpdaterParametersProvider", "updaterProvider", ")", "{", "this", ".", "transport", "=", "transport", ";", ...
This method stores provided entities for MPS internal use @param configuration @param transport @param isMasterNode
[ "This", "method", "stores", "provided", "entities", "for", "MPS", "internal", "use" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/v2/ModelParameterServer.java#L166-L171
zaproxy/zaproxy
src/org/parosproxy/paros/network/HttpSender.java
HttpSender.sendAndReceiveImpl
private void sendAndReceiveImpl(HttpMessage message, HttpRequestConfig requestConfig) throws IOException { if (log.isDebugEnabled()) { log.debug("Sending " + message.getRequestHeader().getMethod() + " " + message.getRequestHeader().getURI()); } message.setTimeSentMillis(System.currentTimeMillis()); try { if (requestConfig.isNotifyListeners()) { notifyRequestListeners(message); } HttpMethodParams params = null; if (requestConfig.getSoTimeout() != HttpRequestConfig.NO_VALUE_SET) { params = new HttpMethodParams(); params.setSoTimeout(requestConfig.getSoTimeout()); } sendAuthenticated(message, false, params); } finally { message.setTimeElapsedMillis((int) (System.currentTimeMillis() - message.getTimeSentMillis())); if (log.isDebugEnabled()) { log.debug( "Received response after " + message.getTimeElapsedMillis() + "ms for " + message.getRequestHeader().getMethod() + " " + message.getRequestHeader().getURI()); } if (requestConfig.isNotifyListeners()) { notifyResponseListeners(message); } } }
java
private void sendAndReceiveImpl(HttpMessage message, HttpRequestConfig requestConfig) throws IOException { if (log.isDebugEnabled()) { log.debug("Sending " + message.getRequestHeader().getMethod() + " " + message.getRequestHeader().getURI()); } message.setTimeSentMillis(System.currentTimeMillis()); try { if (requestConfig.isNotifyListeners()) { notifyRequestListeners(message); } HttpMethodParams params = null; if (requestConfig.getSoTimeout() != HttpRequestConfig.NO_VALUE_SET) { params = new HttpMethodParams(); params.setSoTimeout(requestConfig.getSoTimeout()); } sendAuthenticated(message, false, params); } finally { message.setTimeElapsedMillis((int) (System.currentTimeMillis() - message.getTimeSentMillis())); if (log.isDebugEnabled()) { log.debug( "Received response after " + message.getTimeElapsedMillis() + "ms for " + message.getRequestHeader().getMethod() + " " + message.getRequestHeader().getURI()); } if (requestConfig.isNotifyListeners()) { notifyResponseListeners(message); } } }
[ "private", "void", "sendAndReceiveImpl", "(", "HttpMessage", "message", ",", "HttpRequestConfig", "requestConfig", ")", "throws", "IOException", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log", ".", "debug", "(", "\"Sending \"", "+", "m...
Helper method that sends the request of the given HTTP {@code message} with the given configurations. <p> No redirections are followed (see {@link #followRedirections(HttpMessage, HttpRequestConfig)}). @param message the message that will be sent. @param requestConfig the request configurations. @throws IOException if an error occurred while sending the message or following the redirections.
[ "Helper", "method", "that", "sends", "the", "request", "of", "the", "given", "HTTP", "{", "@code", "message", "}", "with", "the", "given", "configurations", ".", "<p", ">", "No", "redirections", "are", "followed", "(", "see", "{", "@link", "#followRedirectio...
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/HttpSender.java#L901-L932
phax/ph-masterdata
ph-masterdata/src/main/java/com/helger/masterdata/price/Price.java
Price.createFromGrossAmount
@Nonnull public static Price createFromGrossAmount (@Nonnull final ECurrency eCurrency, @Nonnull final BigDecimal aGrossAmount, @Nonnull final IVATItem aVATItem, @Nonnegative final int nScale, @Nonnull final RoundingMode eRoundingMode) { ValueEnforcer.notNull (aVATItem, "VATItem"); final BigDecimal aFactor = aVATItem.getMultiplicationFactorNetToGross (); if (MathHelper.isEQ1 (aFactor)) { // Shortcut for no VAT (net == gross) return new Price (eCurrency, aGrossAmount, aVATItem); } return new Price (eCurrency, aGrossAmount.divide (aFactor, nScale, eRoundingMode), aVATItem); }
java
@Nonnull public static Price createFromGrossAmount (@Nonnull final ECurrency eCurrency, @Nonnull final BigDecimal aGrossAmount, @Nonnull final IVATItem aVATItem, @Nonnegative final int nScale, @Nonnull final RoundingMode eRoundingMode) { ValueEnforcer.notNull (aVATItem, "VATItem"); final BigDecimal aFactor = aVATItem.getMultiplicationFactorNetToGross (); if (MathHelper.isEQ1 (aFactor)) { // Shortcut for no VAT (net == gross) return new Price (eCurrency, aGrossAmount, aVATItem); } return new Price (eCurrency, aGrossAmount.divide (aFactor, nScale, eRoundingMode), aVATItem); }
[ "@", "Nonnull", "public", "static", "Price", "createFromGrossAmount", "(", "@", "Nonnull", "final", "ECurrency", "eCurrency", ",", "@", "Nonnull", "final", "BigDecimal", "aGrossAmount", ",", "@", "Nonnull", "final", "IVATItem", "aVATItem", ",", "@", "Nonnegative",...
Create a price from a gross amount. @param eCurrency Currency to use. May not be <code>null</code>. @param aGrossAmount The gross amount to use. May not be <code>null</code>. @param aVATItem The VAT item to use. May not be <code>null</code>. @param nScale The scaling to be used for the resulting amount, in case <code>grossAmount / (1 + perc/100)</code> delivery an inexact result. @param eRoundingMode The rounding mode to be used to create a valid result. @return The created {@link Price}
[ "Create", "a", "price", "from", "a", "gross", "amount", "." ]
train
https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/price/Price.java#L290-L306
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java
PathOverlay.addGreatCircle
public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint) { // get the great circle path length in meters final int greatCircleLength = (int) startPoint.distanceToAsDouble(endPoint); // add one point for every 100kms of the great circle path final int numberOfPoints = greatCircleLength/100000; addGreatCircle(startPoint, endPoint, numberOfPoints); }
java
public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint) { // get the great circle path length in meters final int greatCircleLength = (int) startPoint.distanceToAsDouble(endPoint); // add one point for every 100kms of the great circle path final int numberOfPoints = greatCircleLength/100000; addGreatCircle(startPoint, endPoint, numberOfPoints); }
[ "public", "void", "addGreatCircle", "(", "final", "GeoPoint", "startPoint", ",", "final", "GeoPoint", "endPoint", ")", "{", "//\tget the great circle path length in meters", "final", "int", "greatCircleLength", "=", "(", "int", ")", "startPoint", ".", "distanceToAsDoubl...
Draw a great circle. Calculate a point for every 100km along the path. @param startPoint start point of the great circle @param endPoint end point of the great circle
[ "Draw", "a", "great", "circle", ".", "Calculate", "a", "point", "for", "every", "100km", "along", "the", "path", "." ]
train
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java#L109-L117
chhh/MSFTBX
MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java
JaxbUtils.unmarshal
public static <T> T unmarshal(Class<T> cl, Source s) throws JAXBException { JAXBContext ctx = JAXBContext.newInstance(cl); Unmarshaller u = ctx.createUnmarshaller(); return u.unmarshal(s, cl).getValue(); }
java
public static <T> T unmarshal(Class<T> cl, Source s) throws JAXBException { JAXBContext ctx = JAXBContext.newInstance(cl); Unmarshaller u = ctx.createUnmarshaller(); return u.unmarshal(s, cl).getValue(); }
[ "public", "static", "<", "T", ">", "T", "unmarshal", "(", "Class", "<", "T", ">", "cl", ",", "Source", "s", ")", "throws", "JAXBException", "{", "JAXBContext", "ctx", "=", "JAXBContext", ".", "newInstance", "(", "cl", ")", ";", "Unmarshaller", "u", "="...
Convert the contents of a Source to an object of a given class. @param cl Type of object @param s Source to be used @return Object of the given type
[ "Convert", "the", "contents", "of", "a", "Source", "to", "an", "object", "of", "a", "given", "class", "." ]
train
https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java#L286-L290
hector-client/hector
core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java
HFactory.createColumnFamilyDefinition
public static ColumnFamilyDefinition createColumnFamilyDefinition( String keyspace, String cfName, ComparatorType comparatorType) { return new ThriftCfDef(keyspace, cfName, comparatorType); }
java
public static ColumnFamilyDefinition createColumnFamilyDefinition( String keyspace, String cfName, ComparatorType comparatorType) { return new ThriftCfDef(keyspace, cfName, comparatorType); }
[ "public", "static", "ColumnFamilyDefinition", "createColumnFamilyDefinition", "(", "String", "keyspace", ",", "String", "cfName", ",", "ComparatorType", "comparatorType", ")", "{", "return", "new", "ThriftCfDef", "(", "keyspace", ",", "cfName", ",", "comparatorType", ...
Create a column family for a given keyspace without comparator type. Example: String keyspace = "testKeyspace"; String column1 = "testcolumn"; ColumnFamilyDefinition columnFamily1 = HFactory.createColumnFamilyDefinition(keyspace, column1, ComparatorType.UTF8TYPE); List<ColumnFamilyDefinition> columns = new ArrayList<ColumnFamilyDefinition>(); columns.add(columnFamily1); KeyspaceDefinition testKeyspace = HFactory.createKeyspaceDefinition(keyspace, org.apache.cassandra.locator.SimpleStrategy.class.getName(), 1, columns); cluster.addKeyspace(testKeyspace); @param keyspace @param cfName @param comparatorType
[ "Create", "a", "column", "family", "for", "a", "given", "keyspace", "without", "comparator", "type", ".", "Example", ":", "String", "keyspace", "=", "testKeyspace", ";", "String", "column1", "=", "testcolumn", ";", "ColumnFamilyDefinition", "columnFamily1", "=", ...
train
https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java#L735-L738
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/map/impl/recordstore/BasicRecordStoreLoader.java
BasicRecordStoreLoader.loadValuesInternal
private void loadValuesInternal(List<Data> keys, boolean replaceExistingValues) throws Exception { if (!replaceExistingValues) { Future removeKeysFuture = removeExistingKeys(keys); removeKeysFuture.get(); } removeUnloadableKeys(keys); if (keys.isEmpty()) { return; } List<Future> futures = doBatchLoad(keys); for (Future future : futures) { future.get(); } }
java
private void loadValuesInternal(List<Data> keys, boolean replaceExistingValues) throws Exception { if (!replaceExistingValues) { Future removeKeysFuture = removeExistingKeys(keys); removeKeysFuture.get(); } removeUnloadableKeys(keys); if (keys.isEmpty()) { return; } List<Future> futures = doBatchLoad(keys); for (Future future : futures) { future.get(); } }
[ "private", "void", "loadValuesInternal", "(", "List", "<", "Data", ">", "keys", ",", "boolean", "replaceExistingValues", ")", "throws", "Exception", "{", "if", "(", "!", "replaceExistingValues", ")", "{", "Future", "removeKeysFuture", "=", "removeExistingKeys", "(...
Loads the values for the provided keys and invokes partition operations to put the loaded entries into the partition record store. The method will block until all entries have been put into the partition record store. <p> Unloadable keys will be removed before loading the values. Also, if {@code replaceExistingValues} is {@code false}, the list of keys will be filtered for existing keys in the partition record store. @param keys the keys for which values will be loaded @param replaceExistingValues if the existing entries for the keys should be replaced with the loaded values @throws Exception if there is an exception when invoking partition operations to remove the existing keys or to put the loaded values into the record store
[ "Loads", "the", "values", "for", "the", "provided", "keys", "and", "invokes", "partition", "operations", "to", "put", "the", "loaded", "entries", "into", "the", "partition", "record", "store", ".", "The", "method", "will", "block", "until", "all", "entries", ...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/recordstore/BasicRecordStoreLoader.java#L129-L142
lucee/Lucee
core/src/main/java/lucee/runtime/net/mail/MailClient.java
MailClient.getMails
public Query getMails(String[] messageNumbers, String[] uids, boolean all) throws MessagingException, IOException { Query qry = new QueryImpl(all ? _fldnew : _flddo, 0, "query"); Folder folder = _store.getFolder("INBOX"); folder.open(Folder.READ_ONLY); try { getMessages(qry, folder, uids, messageNumbers, startrow, maxrows, all); } finally { folder.close(false); } return qry; }
java
public Query getMails(String[] messageNumbers, String[] uids, boolean all) throws MessagingException, IOException { Query qry = new QueryImpl(all ? _fldnew : _flddo, 0, "query"); Folder folder = _store.getFolder("INBOX"); folder.open(Folder.READ_ONLY); try { getMessages(qry, folder, uids, messageNumbers, startrow, maxrows, all); } finally { folder.close(false); } return qry; }
[ "public", "Query", "getMails", "(", "String", "[", "]", "messageNumbers", ",", "String", "[", "]", "uids", ",", "boolean", "all", ")", "throws", "MessagingException", ",", "IOException", "{", "Query", "qry", "=", "new", "QueryImpl", "(", "all", "?", "_fldn...
return all messages from inbox @param messageNumbers all messages with this ids @param uIds all messages with this uids @param withBody also return body @return all messages from inbox @throws MessagingException @throws IOException
[ "return", "all", "messages", "from", "inbox" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/mail/MailClient.java#L309-L320
Syncleus/aparapi
src/main/java/com/aparapi/internal/model/ClassModel.java
ClassModel.getMethodModel
public MethodModel getMethodModel(String _name, String _signature) throws AparapiException { if (CacheEnabler.areCachesEnabled()) return methodModelCache.computeIfAbsent(MethodKey.of(_name, _signature)); else { final ClassModelMethod method = getMethod(_name, _signature); return new MethodModel(method); } }
java
public MethodModel getMethodModel(String _name, String _signature) throws AparapiException { if (CacheEnabler.areCachesEnabled()) return methodModelCache.computeIfAbsent(MethodKey.of(_name, _signature)); else { final ClassModelMethod method = getMethod(_name, _signature); return new MethodModel(method); } }
[ "public", "MethodModel", "getMethodModel", "(", "String", "_name", ",", "String", "_signature", ")", "throws", "AparapiException", "{", "if", "(", "CacheEnabler", ".", "areCachesEnabled", "(", ")", ")", "return", "methodModelCache", ".", "computeIfAbsent", "(", "M...
Create a MethodModel for a given method name and signature. @param _name @param _signature @return @throws AparapiException
[ "Create", "a", "MethodModel", "for", "a", "given", "method", "name", "and", "signature", "." ]
train
https://github.com/Syncleus/aparapi/blob/6d5892c8e69854b3968c541023de37cf4762bd24/src/main/java/com/aparapi/internal/model/ClassModel.java#L2993-L3000
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/CapabilityRegistry.java
CapabilityRegistry.createShadowCopy
CapabilityRegistry createShadowCopy() { CapabilityRegistry result = new CapabilityRegistry(forServer, this); readLock.lock(); try { try { result.writeLock.lock(); copy(this, result); } finally { result.writeLock.unlock(); } } finally { readLock.unlock(); } return result; }
java
CapabilityRegistry createShadowCopy() { CapabilityRegistry result = new CapabilityRegistry(forServer, this); readLock.lock(); try { try { result.writeLock.lock(); copy(this, result); } finally { result.writeLock.unlock(); } } finally { readLock.unlock(); } return result; }
[ "CapabilityRegistry", "createShadowCopy", "(", ")", "{", "CapabilityRegistry", "result", "=", "new", "CapabilityRegistry", "(", "forServer", ",", "this", ")", ";", "readLock", ".", "lock", "(", ")", ";", "try", "{", "try", "{", "result", ".", "writeLock", "....
Creates updateable version of capability registry that on publish pushes all changes to main registry this is used to create context local registry that only on completion commits changes to main registry @return writable registry
[ "Creates", "updateable", "version", "of", "capability", "registry", "that", "on", "publish", "pushes", "all", "changes", "to", "main", "registry", "this", "is", "used", "to", "create", "context", "local", "registry", "that", "only", "on", "completion", "commits"...
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/CapabilityRegistry.java#L103-L117
haraldk/TwelveMonkeys
servlet/src/main/java/com/twelvemonkeys/servlet/BrowserHelperFilter.java
BrowserHelperFilter.setAcceptMappingsFile
@InitParam(name = "accept-mappings-file") public void setAcceptMappingsFile(String pPropertiesFile) throws ServletConfigException { // NOTE: Format is: // <agent-name>=<reg-exp> // <agent-name>.accept=<http-accept-header> Properties mappings = new Properties(); try { log("Reading Accept-mappings properties file: " + pPropertiesFile); mappings.load(getServletContext().getResourceAsStream(pPropertiesFile)); //System.out.println("--> Loaded file: " + pPropertiesFile); } catch (IOException e) { throw new ServletConfigException("Could not read Accept-mappings properties file: " + pPropertiesFile, e); } parseMappings(mappings); }
java
@InitParam(name = "accept-mappings-file") public void setAcceptMappingsFile(String pPropertiesFile) throws ServletConfigException { // NOTE: Format is: // <agent-name>=<reg-exp> // <agent-name>.accept=<http-accept-header> Properties mappings = new Properties(); try { log("Reading Accept-mappings properties file: " + pPropertiesFile); mappings.load(getServletContext().getResourceAsStream(pPropertiesFile)); //System.out.println("--> Loaded file: " + pPropertiesFile); } catch (IOException e) { throw new ServletConfigException("Could not read Accept-mappings properties file: " + pPropertiesFile, e); } parseMappings(mappings); }
[ "@", "InitParam", "(", "name", "=", "\"accept-mappings-file\"", ")", "public", "void", "setAcceptMappingsFile", "(", "String", "pPropertiesFile", ")", "throws", "ServletConfigException", "{", "// NOTE: Format is:", "// <agent-name>=<reg-exp>", "// <agent-name>.accept=<http-acce...
Sets the accept-mappings for this filter @param pPropertiesFile name of accept-mappings properties files @throws ServletConfigException if the accept-mappings properties file cannot be read.
[ "Sets", "the", "accept", "-", "mappings", "for", "this", "filter" ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/BrowserHelperFilter.java#L68-L87
joniles/mpxj
src/main/java/net/sf/mpxj/turboproject/PEPUtility.java
PEPUtility.getString
public static final String getString(byte[] data, int offset) { return getString(data, offset, data.length - offset); }
java
public static final String getString(byte[] data, int offset) { return getString(data, offset, data.length - offset); }
[ "public", "static", "final", "String", "getString", "(", "byte", "[", "]", "data", ",", "int", "offset", ")", "{", "return", "getString", "(", "data", ",", "offset", ",", "data", ".", "length", "-", "offset", ")", ";", "}" ]
Retrieve a string value. @param data byte array @param offset offset into byte array @return string value
[ "Retrieve", "a", "string", "value", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/PEPUtility.java#L80-L83
fcrepo3/fcrepo
fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalReader.java
JournalReader.getInstance
public static JournalReader getInstance(Map<String, String> parameters, String role, JournalRecoveryLog recoveryLog, ServerInterface server) throws ModuleInitializationException { try { Object journalReader = JournalHelper .createInstanceAccordingToParameter(PARAMETER_JOURNAL_READER_CLASSNAME, new Class[] { Map.class, String.class, JournalRecoveryLog.class, ServerInterface.class}, new Object[] { parameters, role, recoveryLog, server}, parameters); logger.info("JournalReader is " + journalReader.toString()); return (JournalReader) journalReader; } catch (JournalException e) { String msg = "Can't create JournalReader"; logger.error(msg, e); throw new ModuleInitializationException(msg, role, e); } }
java
public static JournalReader getInstance(Map<String, String> parameters, String role, JournalRecoveryLog recoveryLog, ServerInterface server) throws ModuleInitializationException { try { Object journalReader = JournalHelper .createInstanceAccordingToParameter(PARAMETER_JOURNAL_READER_CLASSNAME, new Class[] { Map.class, String.class, JournalRecoveryLog.class, ServerInterface.class}, new Object[] { parameters, role, recoveryLog, server}, parameters); logger.info("JournalReader is " + journalReader.toString()); return (JournalReader) journalReader; } catch (JournalException e) { String msg = "Can't create JournalReader"; logger.error(msg, e); throw new ModuleInitializationException(msg, role, e); } }
[ "public", "static", "JournalReader", "getInstance", "(", "Map", "<", "String", ",", "String", ">", "parameters", ",", "String", "role", ",", "JournalRecoveryLog", "recoveryLog", ",", "ServerInterface", "server", ")", "throws", "ModuleInitializationException", "{", "...
Create an instance of the proper JournalReader child class, as determined by the server parameters.
[ "Create", "an", "instance", "of", "the", "proper", "JournalReader", "child", "class", "as", "determined", "by", "the", "server", "parameters", "." ]
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalReader.java#L66-L94
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java
GeneratorXMLDatabaseConnection.processElementTranslate
private void processElementTranslate(GeneratorSingleCluster cluster, Node cur) { double[] offset = null; String vstr = ((Element) cur).getAttribute(ATTR_VECTOR); if(vstr != null && vstr.length() > 0) { offset = parseVector(vstr); } if(offset == null) { throw new AbortException("No translation vector given."); } // *** add new translation cluster.addTranslation(offset); // TODO: check for unknown attributes. XMLNodeIterator iter = new XMLNodeIterator(cur.getFirstChild()); while(iter.hasNext()) { Node child = iter.next(); if(child.getNodeType() == Node.ELEMENT_NODE) { LOG.warning("Unknown element in XML specification file: " + child.getNodeName()); } } }
java
private void processElementTranslate(GeneratorSingleCluster cluster, Node cur) { double[] offset = null; String vstr = ((Element) cur).getAttribute(ATTR_VECTOR); if(vstr != null && vstr.length() > 0) { offset = parseVector(vstr); } if(offset == null) { throw new AbortException("No translation vector given."); } // *** add new translation cluster.addTranslation(offset); // TODO: check for unknown attributes. XMLNodeIterator iter = new XMLNodeIterator(cur.getFirstChild()); while(iter.hasNext()) { Node child = iter.next(); if(child.getNodeType() == Node.ELEMENT_NODE) { LOG.warning("Unknown element in XML specification file: " + child.getNodeName()); } } }
[ "private", "void", "processElementTranslate", "(", "GeneratorSingleCluster", "cluster", ",", "Node", "cur", ")", "{", "double", "[", "]", "offset", "=", "null", ";", "String", "vstr", "=", "(", "(", "Element", ")", "cur", ")", ".", "getAttribute", "(", "AT...
Process a 'translate' Element in the XML stream. @param cluster @param cur Current document nod
[ "Process", "a", "translate", "Element", "in", "the", "XML", "stream", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L572-L593
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/util/FileUtils.java
FileUtils.doCopyFile
private static void doCopyFile(File srcFile, File destFile, boolean preserveFileDate) throws IOException { if (destFile.exists() && destFile.isDirectory()) { throw new IOException("Destination '" + destFile + "' exists but is a directory"); } FileInputStream input = new FileInputStream(srcFile); FileOutputStream output = new FileOutputStream(destFile); IOUtils.copy(input, output, true); if (srcFile.length() != destFile.length()) { throw new IOException("Failed to copy full contents from '" + srcFile + "' to '" + destFile + "'"); } if (preserveFileDate) { destFile.setLastModified(srcFile.lastModified()); } }
java
private static void doCopyFile(File srcFile, File destFile, boolean preserveFileDate) throws IOException { if (destFile.exists() && destFile.isDirectory()) { throw new IOException("Destination '" + destFile + "' exists but is a directory"); } FileInputStream input = new FileInputStream(srcFile); FileOutputStream output = new FileOutputStream(destFile); IOUtils.copy(input, output, true); if (srcFile.length() != destFile.length()) { throw new IOException("Failed to copy full contents from '" + srcFile + "' to '" + destFile + "'"); } if (preserveFileDate) { destFile.setLastModified(srcFile.lastModified()); } }
[ "private", "static", "void", "doCopyFile", "(", "File", "srcFile", ",", "File", "destFile", ",", "boolean", "preserveFileDate", ")", "throws", "IOException", "{", "if", "(", "destFile", ".", "exists", "(", ")", "&&", "destFile", ".", "isDirectory", "(", ")",...
Internal copy file method. @param srcFile the validated source file, must not be <code>null</code> @param destFile the validated destination file, must not be <code>null</code> @param preserveFileDate whether to preserve the file date @throws IOException if an error occurs
[ "Internal", "copy", "file", "method", "." ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/util/FileUtils.java#L228-L243
w3c/epubcheck
src/main/java/com/adobe/epubcheck/util/SearchDictionary.java
SearchDictionary.buildCSSTypesDictionary
void buildCSSTypesDictionary() { String description; String value; TextSearchDictionaryEntry de; //search eval() expression description = "text/css"; value = "text/css"; de = new TextSearchDictionaryEntry(description, value, MessageId.CSS_009); v.add(de); }
java
void buildCSSTypesDictionary() { String description; String value; TextSearchDictionaryEntry de; //search eval() expression description = "text/css"; value = "text/css"; de = new TextSearchDictionaryEntry(description, value, MessageId.CSS_009); v.add(de); }
[ "void", "buildCSSTypesDictionary", "(", ")", "{", "String", "description", ";", "String", "value", ";", "TextSearchDictionaryEntry", "de", ";", "//search eval() expression", "description", "=", "\"text/css\"", ";", "value", "=", "\"text/css\"", ";", "de", "=", "new"...
/* String[] validTypes = new String[] { "application/xhtml+xml", "application/x-dtbncx+xml", "text/css" };
[ "/", "*", "String", "[]", "validTypes", "=", "new", "String", "[]", "{", "application", "/", "xhtml", "+", "xml", "application", "/", "x", "-", "dtbncx", "+", "xml", "text", "/", "css", "}", ";" ]
train
https://github.com/w3c/epubcheck/blob/4d5a24d9f2878a2a5497eb11c036cc18fe2c0a78/src/main/java/com/adobe/epubcheck/util/SearchDictionary.java#L49-L63
jglobus/JGlobus
io/src/main/java/org/globus/io/gass/client/internal/GASSProtocol.java
GASSProtocol.GET
public static String GET(String path, String host) { return HTTPProtocol.createGETHeader("/" + path, host, USER_AGENT); }
java
public static String GET(String path, String host) { return HTTPProtocol.createGETHeader("/" + path, host, USER_AGENT); }
[ "public", "static", "String", "GET", "(", "String", "path", ",", "String", "host", ")", "{", "return", "HTTPProtocol", ".", "createGETHeader", "(", "\"/\"", "+", "path", ",", "host", ",", "USER_AGENT", ")", ";", "}" ]
This method concatenates a properly formatted header for performing Globus Gass GETs with the given information. @param path the path of the file to get @param host the host which contains the file to get @return <code>String</code> the properly formatted header to be sent to a gass server
[ "This", "method", "concatenates", "a", "properly", "formatted", "header", "for", "performing", "Globus", "Gass", "GETs", "with", "the", "given", "information", "." ]
train
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/io/src/main/java/org/globus/io/gass/client/internal/GASSProtocol.java#L43-L45
wcm-io/wcm-io-handler
media/src/main/java/io/wcm/handler/media/spi/MediaSource.java
MediaSource.getMediaRefProperty
@Deprecated protected final @Nullable String getMediaRefProperty(@NotNull MediaRequest mediaRequest) { return getMediaRefProperty(mediaRequest, null); }
java
@Deprecated protected final @Nullable String getMediaRefProperty(@NotNull MediaRequest mediaRequest) { return getMediaRefProperty(mediaRequest, null); }
[ "@", "Deprecated", "protected", "final", "@", "Nullable", "String", "getMediaRefProperty", "(", "@", "NotNull", "MediaRequest", "mediaRequest", ")", "{", "return", "getMediaRefProperty", "(", "mediaRequest", ",", "null", ")", ";", "}" ]
Get property name containing the media request path @param mediaRequest Media request @return Property name @deprecated Use {@link #getMediaRefProperty(MediaRequest, MediaHandlerConfig)}
[ "Get", "property", "name", "containing", "the", "media", "request", "path" ]
train
https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/spi/MediaSource.java#L161-L164
apache/predictionio-sdk-java
client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java
EventClient.unsetItemAsFuture
public FutureAPIResponse unsetItemAsFuture(String iid, List<String> properties) throws IOException { return unsetItemAsFuture(iid, properties, new DateTime()); }
java
public FutureAPIResponse unsetItemAsFuture(String iid, List<String> properties) throws IOException { return unsetItemAsFuture(iid, properties, new DateTime()); }
[ "public", "FutureAPIResponse", "unsetItemAsFuture", "(", "String", "iid", ",", "List", "<", "String", ">", "properties", ")", "throws", "IOException", "{", "return", "unsetItemAsFuture", "(", "iid", ",", "properties", ",", "new", "DateTime", "(", ")", ")", ";"...
Sends an unset item properties request. Same as {@link #unsetItemAsFuture(String, List, DateTime) unsetItemAsFuture(String, List&lt;String&gt;, DateTime)} except event time is not specified and recorded as the time when the function is called.
[ "Sends", "an", "unset", "item", "properties", "request", ".", "Same", "as", "{" ]
train
https://github.com/apache/predictionio-sdk-java/blob/16052c96b136340c175c3f9c2692e720850df219/client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java#L528-L531
alkacon/opencms-core
src-gwt/org/opencms/ade/upload/client/ui/A_CmsUploadDialog.java
A_CmsUploadDialog.addClickHandlerToCheckBox
private void addClickHandlerToCheckBox(final CmsCheckBox check, final Widget unzipWidget, final CmsFileInfo file) { check.addClickHandler(new ClickHandler() { /** * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent) */ public void onClick(ClickEvent event) { // add or remove the file from the list of files to upload if (check.isChecked()) { getFilesToUpload().put(file.getFileName(), file); if (unzipWidget != null) { enableUnzip(unzipWidget); } } else { getFilesToUpload().remove(file.getFileName()); if (unzipWidget != null) { disableUnzip(unzipWidget); } } // disable or enable the OK button if (getFilesToUpload().isEmpty()) { disableOKButton(Messages.get().key(Messages.GUI_UPLOAD_NOTIFICATION_NO_FILES_0)); } else { enableOKButton(); } // update summary updateSummary(); } /** * Disables the 'unzip' button * * @param unzip the unzip button */ private void disableUnzip(Widget unzip) { ((CmsToggleButton)unzip).setEnabled(false); } /** * Enables the 'unzip' button * * @param unzip the unzip button */ private void enableUnzip(Widget unzip) { ((CmsToggleButton)unzip).setEnabled(true); } }); }
java
private void addClickHandlerToCheckBox(final CmsCheckBox check, final Widget unzipWidget, final CmsFileInfo file) { check.addClickHandler(new ClickHandler() { /** * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent) */ public void onClick(ClickEvent event) { // add or remove the file from the list of files to upload if (check.isChecked()) { getFilesToUpload().put(file.getFileName(), file); if (unzipWidget != null) { enableUnzip(unzipWidget); } } else { getFilesToUpload().remove(file.getFileName()); if (unzipWidget != null) { disableUnzip(unzipWidget); } } // disable or enable the OK button if (getFilesToUpload().isEmpty()) { disableOKButton(Messages.get().key(Messages.GUI_UPLOAD_NOTIFICATION_NO_FILES_0)); } else { enableOKButton(); } // update summary updateSummary(); } /** * Disables the 'unzip' button * * @param unzip the unzip button */ private void disableUnzip(Widget unzip) { ((CmsToggleButton)unzip).setEnabled(false); } /** * Enables the 'unzip' button * * @param unzip the unzip button */ private void enableUnzip(Widget unzip) { ((CmsToggleButton)unzip).setEnabled(true); } }); }
[ "private", "void", "addClickHandlerToCheckBox", "(", "final", "CmsCheckBox", "check", ",", "final", "Widget", "unzipWidget", ",", "final", "CmsFileInfo", "file", ")", "{", "check", ".", "addClickHandler", "(", "new", "ClickHandler", "(", ")", "{", "/**\n ...
Adds a click handler for the given check box.<p> @param check the check box @param unzipWidget the un-zip check box @param file the file
[ "Adds", "a", "click", "handler", "for", "the", "given", "check", "box", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/upload/client/ui/A_CmsUploadDialog.java#L992-L1046
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java
SqlQueryStatement.appendBetweenCriteria
private void appendBetweenCriteria(TableAlias alias, PathInfo pathInfo, BetweenCriteria c, StringBuffer buf) { appendColName(alias, pathInfo, c.isTranslateAttribute(), buf); buf.append(c.getClause()); appendParameter(c.getValue(), buf); buf.append(" AND "); appendParameter(c.getValue2(), buf); }
java
private void appendBetweenCriteria(TableAlias alias, PathInfo pathInfo, BetweenCriteria c, StringBuffer buf) { appendColName(alias, pathInfo, c.isTranslateAttribute(), buf); buf.append(c.getClause()); appendParameter(c.getValue(), buf); buf.append(" AND "); appendParameter(c.getValue2(), buf); }
[ "private", "void", "appendBetweenCriteria", "(", "TableAlias", "alias", ",", "PathInfo", "pathInfo", ",", "BetweenCriteria", "c", ",", "StringBuffer", "buf", ")", "{", "appendColName", "(", "alias", ",", "pathInfo", ",", "c", ".", "isTranslateAttribute", "(", ")...
Answer the SQL-Clause for a BetweenCriteria @param alias @param pathInfo @param c BetweenCriteria @param buf
[ "Answer", "the", "SQL", "-", "Clause", "for", "a", "BetweenCriteria" ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L698-L705
apache/flink
flink-core/src/main/java/org/apache/flink/util/AbstractCloseableRegistry.java
AbstractCloseableRegistry.unregisterCloseable
public final boolean unregisterCloseable(C closeable) { if (null == closeable) { return false; } synchronized (getSynchronizationLock()) { return doUnRegister(closeable, closeableToRef); } }
java
public final boolean unregisterCloseable(C closeable) { if (null == closeable) { return false; } synchronized (getSynchronizationLock()) { return doUnRegister(closeable, closeableToRef); } }
[ "public", "final", "boolean", "unregisterCloseable", "(", "C", "closeable", ")", "{", "if", "(", "null", "==", "closeable", ")", "{", "return", "false", ";", "}", "synchronized", "(", "getSynchronizationLock", "(", ")", ")", "{", "return", "doUnRegister", "(...
Removes a {@link Closeable} from the registry. @param closeable instance to remove from the registry. @return true if the closeable was previously registered and became unregistered through this call.
[ "Removes", "a", "{", "@link", "Closeable", "}", "from", "the", "registry", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/AbstractCloseableRegistry.java#L94-L103
openbase/jul
pattern/default/src/main/java/org/openbase/jul/pattern/CompletableFutureLite.java
CompletableFutureLite.get
@Override public V get() throws InterruptedException, ExecutionException { synchronized (lock) { if (value != null) { return value; } lock.wait(); if (value != null) { return value; } if (throwable != null) { throw new ExecutionException(throwable); } throw new ExecutionException(new FatalImplementationErrorException("Not terminated after notification!", this)); } }
java
@Override public V get() throws InterruptedException, ExecutionException { synchronized (lock) { if (value != null) { return value; } lock.wait(); if (value != null) { return value; } if (throwable != null) { throw new ExecutionException(throwable); } throw new ExecutionException(new FatalImplementationErrorException("Not terminated after notification!", this)); } }
[ "@", "Override", "public", "V", "get", "(", ")", "throws", "InterruptedException", ",", "ExecutionException", "{", "synchronized", "(", "lock", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "return", "value", ";", "}", "lock", ".", "wait", "(", ...
Method blocks until the future is done. The method return the result if the future was normally completed. If the future was exceptionally completed or canceled an exception is thrown. @return the result of the task. @throws InterruptedException is thrown if the thread was externally interrupted. @throws ExecutionException is thrown if the task was canceled or exceptionally completed.
[ "Method", "blocks", "until", "the", "future", "is", "done", ".", "The", "method", "return", "the", "result", "if", "the", "future", "was", "normally", "completed", ".", "If", "the", "future", "was", "exceptionally", "completed", "or", "canceled", "an", "exce...
train
https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/pattern/default/src/main/java/org/openbase/jul/pattern/CompletableFutureLite.java#L150-L167
intendia-oss/rxjava-gwt
src/main/modified/io/reactivex/super/io/reactivex/Flowable.java
Flowable.onBackpressureBuffer
@CheckReturnValue @BackpressureSupport(BackpressureKind.SPECIAL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> onBackpressureBuffer(int capacity, boolean delayError, boolean unbounded, Action onOverflow) { ObjectHelper.requireNonNull(onOverflow, "onOverflow is null"); ObjectHelper.verifyPositive(capacity, "capacity"); return RxJavaPlugins.onAssembly(new FlowableOnBackpressureBuffer<T>(this, capacity, unbounded, delayError, onOverflow)); }
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.SPECIAL) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> onBackpressureBuffer(int capacity, boolean delayError, boolean unbounded, Action onOverflow) { ObjectHelper.requireNonNull(onOverflow, "onOverflow is null"); ObjectHelper.verifyPositive(capacity, "capacity"); return RxJavaPlugins.onAssembly(new FlowableOnBackpressureBuffer<T>(this, capacity, unbounded, delayError, onOverflow)); }
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "SPECIAL", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Flowable", "<", "T", ">", "onBackpressureBuffer", "(", "int", "capacity", ","...
Instructs a Publisher that is emitting items faster than its Subscriber can consume them to buffer up to a given amount of items until they can be emitted. The resulting Publisher will signal a {@code BufferOverflowException} via {@code onError} as soon as the buffer's capacity is exceeded, dropping all undelivered items, canceling the source, and notifying the producer with {@code onOverflow}. <p> <img width="640" height="300" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/bp.obp.buffer.png" alt=""> <dl> <dt><b>Backpressure:</b></dt> <dd>The operator honors backpressure from downstream and consumes the source {@code Publisher} in an unbounded manner (i.e., not applying backpressure to it).</dd> <dt><b>Scheduler:</b></dt> <dd>{@code onBackpressureBuffer} does not operate by default on a particular {@link Scheduler}.</dd> </dl> @param capacity number of slots available in the buffer. @param delayError if true, an exception from the current Flowable is delayed until all buffered elements have been consumed by the downstream; if false, an exception is immediately signaled to the downstream, skipping any buffered element @param unbounded if true, the capacity value is interpreted as the internal "island" size of the unbounded buffer @param onOverflow action to execute if an item needs to be buffered, but there are no available slots. Null is allowed. @return the source {@code Publisher} modified to buffer items up to the given capacity @see <a href="http://reactivex.io/documentation/operators/backpressure.html">ReactiveX operators documentation: backpressure operators</a> @since 1.1.0
[ "Instructs", "a", "Publisher", "that", "is", "emitting", "items", "faster", "than", "its", "Subscriber", "can", "consume", "them", "to", "buffer", "up", "to", "a", "given", "amount", "of", "items", "until", "they", "can", "be", "emitted", ".", "The", "resu...
train
https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Flowable.java#L11496-L11504
alkacon/opencms-core
src/org/opencms/ade/sitemap/CmsModelPageHelper.java
CmsModelPageHelper.createPageInModelFolder
public CmsResource createPageInModelFolder(String name, String description, CmsUUID copyId) throws CmsException { CmsResource modelFolder = ensureModelFolder(m_rootResource); String pattern = "templatemodel_%(number).html"; String newFilePath = OpenCms.getResourceManager().getNameGenerator().getNewFileName( m_cms, CmsStringUtil.joinPaths(modelFolder.getRootPath(), pattern), 4); CmsProperty titleProp = new CmsProperty(CmsPropertyDefinition.PROPERTY_TITLE, name, null); CmsProperty descriptionProp = new CmsProperty(CmsPropertyDefinition.PROPERTY_DESCRIPTION, description, null); CmsResource newPage = null; if (copyId == null) { newPage = m_cms.createResource( newFilePath, getType(CmsResourceTypeXmlContainerPage.getStaticTypeName()), null, Arrays.asList(titleProp, descriptionProp)); } else { CmsResource copyResource = m_cms.readResource(copyId); m_cms.copyResource(copyResource.getRootPath(), newFilePath); m_cms.writePropertyObject(newFilePath, titleProp); m_cms.writePropertyObject(newFilePath, descriptionProp); newPage = m_cms.readResource(newFilePath); } tryUnlock(newPage); return newPage; }
java
public CmsResource createPageInModelFolder(String name, String description, CmsUUID copyId) throws CmsException { CmsResource modelFolder = ensureModelFolder(m_rootResource); String pattern = "templatemodel_%(number).html"; String newFilePath = OpenCms.getResourceManager().getNameGenerator().getNewFileName( m_cms, CmsStringUtil.joinPaths(modelFolder.getRootPath(), pattern), 4); CmsProperty titleProp = new CmsProperty(CmsPropertyDefinition.PROPERTY_TITLE, name, null); CmsProperty descriptionProp = new CmsProperty(CmsPropertyDefinition.PROPERTY_DESCRIPTION, description, null); CmsResource newPage = null; if (copyId == null) { newPage = m_cms.createResource( newFilePath, getType(CmsResourceTypeXmlContainerPage.getStaticTypeName()), null, Arrays.asList(titleProp, descriptionProp)); } else { CmsResource copyResource = m_cms.readResource(copyId); m_cms.copyResource(copyResource.getRootPath(), newFilePath); m_cms.writePropertyObject(newFilePath, titleProp); m_cms.writePropertyObject(newFilePath, descriptionProp); newPage = m_cms.readResource(newFilePath); } tryUnlock(newPage); return newPage; }
[ "public", "CmsResource", "createPageInModelFolder", "(", "String", "name", ",", "String", "description", ",", "CmsUUID", "copyId", ")", "throws", "CmsException", "{", "CmsResource", "modelFolder", "=", "ensureModelFolder", "(", "m_rootResource", ")", ";", "String", ...
Creates a new potential model page in the default folder for new model pages.<p> @param name the title for the model page @param description the description for the model page @param copyId structure id of the resource to use as a model for the model page, if any (may be null) @return the created resource @throws CmsException if something goes wrong
[ "Creates", "a", "new", "potential", "model", "page", "in", "the", "default", "folder", "for", "new", "model", "pages", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/sitemap/CmsModelPageHelper.java#L207-L234
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRCursorController.java
GVRCursorController.setPosition
public void setPosition(float x, float y, float z) { if (isEnabled()) { position.set(x, y, z); } }
java
public void setPosition(float x, float y, float z) { if (isEnabled()) { position.set(x, y, z); } }
[ "public", "void", "setPosition", "(", "float", "x", ",", "float", "y", ",", "float", "z", ")", "{", "if", "(", "isEnabled", "(", ")", ")", "{", "position", ".", "set", "(", "x", ",", "y", ",", "z", ")", ";", "}", "}" ]
This call sets the position of the {@link GVRCursorController}. Use this call to also set an initial position for the Cursor when a new {@link GVRCursorController} is selected. @param x the x value of the position. @param y the y value of the position. @param z the z value of the position.
[ "This", "call", "sets", "the", "position", "of", "the", "{", "@link", "GVRCursorController", "}", "." ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRCursorController.java#L639-L645
alkacon/opencms-core
src-modules/org/opencms/workplace/tools/scheduler/CmsEditScheduledJobInfoDialog.java
CmsEditScheduledJobInfoDialog.getComboCronExpressions
protected List<CmsSelectWidgetOption> getComboCronExpressions() { List<CmsSelectWidgetOption> result = new ArrayList<CmsSelectWidgetOption>(); // 0 0 3 * * ? (daily at 3 am) result.add(new CmsSelectWidgetOption("0 0 3 * * ?", false, null, key(Messages.GUI_EDITOR_CRONJOB_EXAMPLE1_0))); // 0 0/30 * * * ? (daily every thirty minutes) result.add( new CmsSelectWidgetOption("0 0/30 * * * ?", false, null, key(Messages.GUI_EDITOR_CRONJOB_EXAMPLE2_0))); // 0 30 8 ? * 4 (every Wednesday at 8:30 am) result.add(new CmsSelectWidgetOption("0 30 8 ? * 4", false, null, key(Messages.GUI_EDITOR_CRONJOB_EXAMPLE3_0))); // 0 15 18 15 * ? (on the 20th day of the month at 6:15 pm) result.add( new CmsSelectWidgetOption("0 15 18 20 * ?", false, null, key(Messages.GUI_EDITOR_CRONJOB_EXAMPLE4_0))); // 0 45 15 ? * 1 2007-2009 (every Sunday from the year 2007 to 2009 at 3:45 pm) result.add( new CmsSelectWidgetOption( "0 45 15 ? * 1 2007-2009", false, null, key(Messages.GUI_EDITOR_CRONJOB_EXAMPLE5_0))); return result; }
java
protected List<CmsSelectWidgetOption> getComboCronExpressions() { List<CmsSelectWidgetOption> result = new ArrayList<CmsSelectWidgetOption>(); // 0 0 3 * * ? (daily at 3 am) result.add(new CmsSelectWidgetOption("0 0 3 * * ?", false, null, key(Messages.GUI_EDITOR_CRONJOB_EXAMPLE1_0))); // 0 0/30 * * * ? (daily every thirty minutes) result.add( new CmsSelectWidgetOption("0 0/30 * * * ?", false, null, key(Messages.GUI_EDITOR_CRONJOB_EXAMPLE2_0))); // 0 30 8 ? * 4 (every Wednesday at 8:30 am) result.add(new CmsSelectWidgetOption("0 30 8 ? * 4", false, null, key(Messages.GUI_EDITOR_CRONJOB_EXAMPLE3_0))); // 0 15 18 15 * ? (on the 20th day of the month at 6:15 pm) result.add( new CmsSelectWidgetOption("0 15 18 20 * ?", false, null, key(Messages.GUI_EDITOR_CRONJOB_EXAMPLE4_0))); // 0 45 15 ? * 1 2007-2009 (every Sunday from the year 2007 to 2009 at 3:45 pm) result.add( new CmsSelectWidgetOption( "0 45 15 ? * 1 2007-2009", false, null, key(Messages.GUI_EDITOR_CRONJOB_EXAMPLE5_0))); return result; }
[ "protected", "List", "<", "CmsSelectWidgetOption", ">", "getComboCronExpressions", "(", ")", "{", "List", "<", "CmsSelectWidgetOption", ">", "result", "=", "new", "ArrayList", "<", "CmsSelectWidgetOption", ">", "(", ")", ";", "// 0 0 3 * * ? (daily at 3 am)", "result"...
Returns the example cron expressions to show in the combo box.<p> The result list elements are of type <code>{@link org.opencms.widgets.CmsSelectWidgetOption}</code>.<p> @return the example cron expressions to show in the combo box
[ "Returns", "the", "example", "cron", "expressions", "to", "show", "in", "the", "combo", "box", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/scheduler/CmsEditScheduledJobInfoDialog.java#L400-L422
comapi/comapi-sdk-android
COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java
InternalService.queryEvents
public Observable<ComapiResult<EventsQueryResponse>> queryEvents(@NonNull final String conversationId, @NonNull final Long from, @NonNull final Integer limit) { final String token = getToken(); if (sessionController.isCreatingSession()) { return getTaskQueue().queueQueryEvents(conversationId, from, limit); } else if (TextUtils.isEmpty(token)) { return Observable.error(getSessionStateErrorDescription()); } else { return doQueryEvents(token, conversationId, from, limit); } }
java
public Observable<ComapiResult<EventsQueryResponse>> queryEvents(@NonNull final String conversationId, @NonNull final Long from, @NonNull final Integer limit) { final String token = getToken(); if (sessionController.isCreatingSession()) { return getTaskQueue().queueQueryEvents(conversationId, from, limit); } else if (TextUtils.isEmpty(token)) { return Observable.error(getSessionStateErrorDescription()); } else { return doQueryEvents(token, conversationId, from, limit); } }
[ "public", "Observable", "<", "ComapiResult", "<", "EventsQueryResponse", ">", ">", "queryEvents", "(", "@", "NonNull", "final", "String", "conversationId", ",", "@", "NonNull", "final", "Long", "from", ",", "@", "NonNull", "final", "Integer", "limit", ")", "{"...
Query events. Use {@link #queryConversationEvents(String, Long, Integer)} for better visibility of possible events. @param conversationId ID of a conversation to query events in it. @param from ID of the event to start from. @param limit Limit of events to obtain in this call. @return Observable to get events from a conversation.
[ "Query", "events", ".", "Use", "{", "@link", "#queryConversationEvents", "(", "String", "Long", "Integer", ")", "}", "for", "better", "visibility", "of", "possible", "events", "." ]
train
https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L815-L826
GoogleCloudPlatform/bigdata-interop
util/src/main/java/com/google/cloud/hadoop/util/ApiErrorExtractor.java
ApiErrorExtractor.toUserPresentableMessage
public String toUserPresentableMessage(IOException ioe, @Nullable String action) { String message = "Internal server error"; if (isClientError(ioe)) { message = getErrorMessage(ioe); } if (action == null) { return message; } else { return String.format("Encountered an error while %s: %s", action, message); } }
java
public String toUserPresentableMessage(IOException ioe, @Nullable String action) { String message = "Internal server error"; if (isClientError(ioe)) { message = getErrorMessage(ioe); } if (action == null) { return message; } else { return String.format("Encountered an error while %s: %s", action, message); } }
[ "public", "String", "toUserPresentableMessage", "(", "IOException", "ioe", ",", "@", "Nullable", "String", "action", ")", "{", "String", "message", "=", "\"Internal server error\"", ";", "if", "(", "isClientError", "(", "ioe", ")", ")", "{", "message", "=", "g...
Converts the exception to a user-presentable error message. Specifically, extracts message field for HTTP 4xx codes, and creates a generic "Internal Server Error" for HTTP 5xx codes.
[ "Converts", "the", "exception", "to", "a", "user", "-", "presentable", "error", "message", ".", "Specifically", "extracts", "message", "field", "for", "HTTP", "4xx", "codes", "and", "creates", "a", "generic", "Internal", "Server", "Error", "for", "HTTP", "5xx"...
train
https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/ApiErrorExtractor.java#L382-L393
jfinal/jfinal
src/main/java/com/jfinal/config/JFinalConfig.java
JFinalConfig.loadPropertyFile
public Properties loadPropertyFile(File file, String encoding) { prop = new Prop(file, encoding); return prop.getProperties(); }
java
public Properties loadPropertyFile(File file, String encoding) { prop = new Prop(file, encoding); return prop.getProperties(); }
[ "public", "Properties", "loadPropertyFile", "(", "File", "file", ",", "String", "encoding", ")", "{", "prop", "=", "new", "Prop", "(", "file", ",", "encoding", ")", ";", "return", "prop", ".", "getProperties", "(", ")", ";", "}" ]
Load property file Example:<br> loadPropertyFile(new File("/var/config/my_config.txt"), "UTF-8"); @param file the properties File object @param encoding the encoding
[ "Load", "property", "file", "Example", ":", "<br", ">", "loadPropertyFile", "(", "new", "File", "(", "/", "var", "/", "config", "/", "my_config", ".", "txt", ")", "UTF", "-", "8", ")", ";" ]
train
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/config/JFinalConfig.java#L125-L128
lambdazen/bitsy
src/main/java/com/lambdazen/bitsy/store/Record.java
Record.generateVertexLine
public static void generateVertexLine(StringWriter sw, ObjectMapper mapper, VertexBean vBean) throws JsonGenerationException, JsonMappingException, IOException { sw.getBuffer().setLength(0); sw.append('V'); // Record type sw.append('='); mapper.writeValue(sw, vBean); sw.append('#'); int hashCode = sw.toString().hashCode(); sw.append(toHex(hashCode)); sw.append('\n'); }
java
public static void generateVertexLine(StringWriter sw, ObjectMapper mapper, VertexBean vBean) throws JsonGenerationException, JsonMappingException, IOException { sw.getBuffer().setLength(0); sw.append('V'); // Record type sw.append('='); mapper.writeValue(sw, vBean); sw.append('#'); int hashCode = sw.toString().hashCode(); sw.append(toHex(hashCode)); sw.append('\n'); }
[ "public", "static", "void", "generateVertexLine", "(", "StringWriter", "sw", ",", "ObjectMapper", "mapper", ",", "VertexBean", "vBean", ")", "throws", "JsonGenerationException", ",", "JsonMappingException", ",", "IOException", "{", "sw", ".", "getBuffer", "(", ")", ...
Efficient method to write a vertex -- avoids writeValueAsString
[ "Efficient", "method", "to", "write", "a", "vertex", "--", "avoids", "writeValueAsString" ]
train
https://github.com/lambdazen/bitsy/blob/c0dd4b6c9d6dc9987d0168c91417eb04d80bf712/src/main/java/com/lambdazen/bitsy/store/Record.java#L71-L84
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java
SvgGraphicsContext.drawLine
public void drawLine(Object parent, String name, LineString line, ShapeStyle style) { if (isAttached()) { Element element = helper.createOrUpdateElement(parent, name, "path", style); if (line != null) { Dom.setElementAttribute(element, "d", SvgPathDecoder.decode(line)); } } }
java
public void drawLine(Object parent, String name, LineString line, ShapeStyle style) { if (isAttached()) { Element element = helper.createOrUpdateElement(parent, name, "path", style); if (line != null) { Dom.setElementAttribute(element, "d", SvgPathDecoder.decode(line)); } } }
[ "public", "void", "drawLine", "(", "Object", "parent", ",", "String", "name", ",", "LineString", "line", ",", "ShapeStyle", "style", ")", "{", "if", "(", "isAttached", "(", ")", ")", "{", "Element", "element", "=", "helper", ".", "createOrUpdateElement", "...
Draw a {@link LineString} geometry onto the <code>GraphicsContext</code>. @param parent parent group object @param name The LineString's name. @param line The LineString to be drawn. @param style The styling object for the LineString. Watch out for fill colors! If the fill opacity is not 0, then the LineString will have a fill surface.
[ "Draw", "a", "{", "@link", "LineString", "}", "geometry", "onto", "the", "<code", ">", "GraphicsContext<", "/", "code", ">", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java#L295-L302
alkacon/opencms-core
src/org/opencms/db/CmsSecurityManager.java
CmsSecurityManager.deletePropertyDefinition
public void deletePropertyDefinition(CmsRequestContext context, String name) throws CmsException, CmsSecurityException, CmsRoleViolationException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { checkOfflineProject(dbc); checkRole(dbc, CmsRole.WORKPLACE_MANAGER.forOrgUnit(null)); m_driverManager.deletePropertyDefinition(dbc, name); } catch (Exception e) { dbc.report(null, Messages.get().container(Messages.ERR_DELETE_PROPERTY_1, name), e); } finally { dbc.clear(); } }
java
public void deletePropertyDefinition(CmsRequestContext context, String name) throws CmsException, CmsSecurityException, CmsRoleViolationException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { checkOfflineProject(dbc); checkRole(dbc, CmsRole.WORKPLACE_MANAGER.forOrgUnit(null)); m_driverManager.deletePropertyDefinition(dbc, name); } catch (Exception e) { dbc.report(null, Messages.get().container(Messages.ERR_DELETE_PROPERTY_1, name), e); } finally { dbc.clear(); } }
[ "public", "void", "deletePropertyDefinition", "(", "CmsRequestContext", "context", ",", "String", "name", ")", "throws", "CmsException", ",", "CmsSecurityException", ",", "CmsRoleViolationException", "{", "CmsDbContext", "dbc", "=", "m_dbContextFactory", ".", "getDbContex...
Deletes a property definition.<p> @param context the current request context @param name the name of the property definition to delete @throws CmsException if something goes wrong @throws CmsSecurityException if the project to delete is the "Online" project @throws CmsRoleViolationException if the current user does not own the role {@link CmsRole#WORKPLACE_MANAGER}
[ "Deletes", "a", "property", "definition", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L1516-L1529
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java
SDNN.layerNorm
public SDVariable layerNorm(String name, SDVariable input, SDVariable gain, SDVariable bias, int... dimensions) { validateFloatingPoint("layerNorm", "input", input); validateFloatingPoint("layerNorm", "gain", gain); validateFloatingPoint("layerNorm", "bias", bias); SDVariable result = f().layerNorm(input, gain, bias, dimensions); return updateVariableNameAndReference(result, name); }
java
public SDVariable layerNorm(String name, SDVariable input, SDVariable gain, SDVariable bias, int... dimensions) { validateFloatingPoint("layerNorm", "input", input); validateFloatingPoint("layerNorm", "gain", gain); validateFloatingPoint("layerNorm", "bias", bias); SDVariable result = f().layerNorm(input, gain, bias, dimensions); return updateVariableNameAndReference(result, name); }
[ "public", "SDVariable", "layerNorm", "(", "String", "name", ",", "SDVariable", "input", ",", "SDVariable", "gain", ",", "SDVariable", "bias", ",", "int", "...", "dimensions", ")", "{", "validateFloatingPoint", "(", "\"layerNorm\"", ",", "\"input\"", ",", "input"...
Apply Layer Normalization y = gain * standardize(x) + bias @param name Name of the output variable @param input Input variable @param gain gain @param bias bias @return Output variable
[ "Apply", "Layer", "Normalization" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java#L716-L722
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java
MethodReturnsConstant.visitCode
@Override public void visitCode(Code obj) { Method m = getMethod(); if (overloadedMethods.contains(m)) { return; } int aFlags = m.getAccessFlags(); if ((((aFlags & Const.ACC_PRIVATE) != 0) || ((aFlags & Const.ACC_STATIC) != 0)) && ((aFlags & Const.ACC_SYNTHETIC) == 0) && (!m.getSignature().endsWith(")Z"))) { stack.resetForMethodEntry(this); returnRegister = Values.NEGATIVE_ONE; returnConstant = null; registerConstants.clear(); returnPC = -1; try { super.visitCode(obj); if ((returnConstant != null)) { BugInstance bi = new BugInstance(this, BugType.MRC_METHOD_RETURNS_CONSTANT.name(), ((aFlags & Const.ACC_PRIVATE) != 0) ? NORMAL_PRIORITY : LOW_PRIORITY).addClass(this).addMethod(this); if (returnPC >= 0) { bi.addSourceLine(this, returnPC); } bi.addString(returnConstant.toString()); bugReporter.reportBug(bi); } } catch (StopOpcodeParsingException e) { // method was not suspect } } }
java
@Override public void visitCode(Code obj) { Method m = getMethod(); if (overloadedMethods.contains(m)) { return; } int aFlags = m.getAccessFlags(); if ((((aFlags & Const.ACC_PRIVATE) != 0) || ((aFlags & Const.ACC_STATIC) != 0)) && ((aFlags & Const.ACC_SYNTHETIC) == 0) && (!m.getSignature().endsWith(")Z"))) { stack.resetForMethodEntry(this); returnRegister = Values.NEGATIVE_ONE; returnConstant = null; registerConstants.clear(); returnPC = -1; try { super.visitCode(obj); if ((returnConstant != null)) { BugInstance bi = new BugInstance(this, BugType.MRC_METHOD_RETURNS_CONSTANT.name(), ((aFlags & Const.ACC_PRIVATE) != 0) ? NORMAL_PRIORITY : LOW_PRIORITY).addClass(this).addMethod(this); if (returnPC >= 0) { bi.addSourceLine(this, returnPC); } bi.addString(returnConstant.toString()); bugReporter.reportBug(bi); } } catch (StopOpcodeParsingException e) { // method was not suspect } } }
[ "@", "Override", "public", "void", "visitCode", "(", "Code", "obj", ")", "{", "Method", "m", "=", "getMethod", "(", ")", ";", "if", "(", "overloadedMethods", ".", "contains", "(", "m", ")", ")", "{", "return", ";", "}", "int", "aFlags", "=", "m", "...
implements the visitor to reset the stack and proceed for private methods @param obj the context object of the currently parsed code block
[ "implements", "the", "visitor", "to", "reset", "the", "stack", "and", "proceed", "for", "private", "methods" ]
train
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java#L98-L131
dropbox/dropbox-sdk-java
src/main/java/com/dropbox/core/android/DbxOfficialAppConnector.java
DbxOfficialAppConnector.addExtrasToIntent
protected void addExtrasToIntent(Context context, Intent intent) { intent.putExtra(EXTRA_DROPBOX_UID, uid); intent.putExtra(EXTRA_CALLING_PACKAGE, context.getPackageName()); }
java
protected void addExtrasToIntent(Context context, Intent intent) { intent.putExtra(EXTRA_DROPBOX_UID, uid); intent.putExtra(EXTRA_CALLING_PACKAGE, context.getPackageName()); }
[ "protected", "void", "addExtrasToIntent", "(", "Context", "context", ",", "Intent", "intent", ")", "{", "intent", ".", "putExtra", "(", "EXTRA_DROPBOX_UID", ",", "uid", ")", ";", "intent", ".", "putExtra", "(", "EXTRA_CALLING_PACKAGE", ",", "context", ".", "ge...
Add uid information to an explicit intent directed to DropboxApp
[ "Add", "uid", "information", "to", "an", "explicit", "intent", "directed", "to", "DropboxApp" ]
train
https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/android/DbxOfficialAppConnector.java#L117-L120
looly/hutool
hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java
SqlConnRunner.findAll
public List<Entity> findAll(Connection conn, String tableName) throws SQLException{ return findAll(conn, Entity.create(tableName)); }
java
public List<Entity> findAll(Connection conn, String tableName) throws SQLException{ return findAll(conn, Entity.create(tableName)); }
[ "public", "List", "<", "Entity", ">", "findAll", "(", "Connection", "conn", ",", "String", "tableName", ")", "throws", "SQLException", "{", "return", "findAll", "(", "conn", ",", "Entity", ".", "create", "(", "tableName", ")", ")", ";", "}" ]
查询数据列表,返回所有字段 @param conn 数据库连接对象 @param tableName 表名 @return 数据对象列表 @throws SQLException SQL执行异常
[ "查询数据列表,返回所有字段" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java#L385-L387
samskivert/samskivert
src/main/java/com/samskivert/util/CollectionUtil.java
CollectionUtil.addAll
@ReplacedBy("com.google.common.collect.Iterators#addAll()") public static <T, C extends Collection<T>> C addAll (C col, Iterator<? extends T> iter) { while (iter.hasNext()) { col.add(iter.next()); } return col; }
java
@ReplacedBy("com.google.common.collect.Iterators#addAll()") public static <T, C extends Collection<T>> C addAll (C col, Iterator<? extends T> iter) { while (iter.hasNext()) { col.add(iter.next()); } return col; }
[ "@", "ReplacedBy", "(", "\"com.google.common.collect.Iterators#addAll()\"", ")", "public", "static", "<", "T", ",", "C", "extends", "Collection", "<", "T", ">", ">", "C", "addAll", "(", "C", "col", ",", "Iterator", "<", "?", "extends", "T", ">", "iter", ")...
Adds all items returned by the iterator to the supplied collection and returns the supplied collection.
[ "Adds", "all", "items", "returned", "by", "the", "iterator", "to", "the", "supplied", "collection", "and", "returns", "the", "supplied", "collection", "." ]
train
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CollectionUtil.java#L43-L50
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/CommandUtil.java
CommandUtil.associateCommand
public static void associateCommand(String commandName, BaseUIComponent component) { associateCommand(commandName, component, (BaseUIComponent) null); }
java
public static void associateCommand(String commandName, BaseUIComponent component) { associateCommand(commandName, component, (BaseUIComponent) null); }
[ "public", "static", "void", "associateCommand", "(", "String", "commandName", ",", "BaseUIComponent", "component", ")", "{", "associateCommand", "(", "commandName", ",", "component", ",", "(", "BaseUIComponent", ")", "null", ")", ";", "}" ]
Associates a UI component with a command. @param commandName Name of the command. @param component Component to be associated.
[ "Associates", "a", "UI", "component", "with", "a", "command", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/CommandUtil.java#L176-L178
wcm-io/wcm-io-handler
url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java
SuffixParser.getResource
public @Nullable Resource getResource(@NotNull Predicate<Resource> filter) { return getResource(filter, (Resource)null); }
java
public @Nullable Resource getResource(@NotNull Predicate<Resource> filter) { return getResource(filter, (Resource)null); }
[ "public", "@", "Nullable", "Resource", "getResource", "(", "@", "NotNull", "Predicate", "<", "Resource", ">", "filter", ")", "{", "return", "getResource", "(", "filter", ",", "(", "Resource", ")", "null", ")", ";", "}" ]
Parse the suffix as resource paths, return the first resource from the suffix (relativ to the current page's content) that matches the given filter. @param filter a filter that selects only the resource you're interested in. @return the resource or null if no such resource was selected by suffix
[ "Parse", "the", "suffix", "as", "resource", "paths", "return", "the", "first", "resource", "from", "the", "suffix", "(", "relativ", "to", "the", "current", "page", "s", "content", ")", "that", "matches", "the", "given", "filter", "." ]
train
https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java#L208-L210
knowm/XChange
xchange-bitcoinium/src/main/java/org/knowm/xchange/bitcoinium/BitcoiniumAdapters.java
BitcoiniumAdapters.adaptOrderbook
public static OrderBook adaptOrderbook( BitcoiniumOrderbook bitcoiniumOrderbook, CurrencyPair currencyPair) { List<LimitOrder> asks = createOrders(currencyPair, Order.OrderType.ASK, bitcoiniumOrderbook.getAsks()); List<LimitOrder> bids = createOrders(currencyPair, Order.OrderType.BID, bitcoiniumOrderbook.getBids()); Date date = new Date( bitcoiniumOrderbook .getBitcoiniumTicker() .getTimestamp()); // Note, this is the timestamp of the piggy-backed Ticker. return new OrderBook(date, asks, bids); }
java
public static OrderBook adaptOrderbook( BitcoiniumOrderbook bitcoiniumOrderbook, CurrencyPair currencyPair) { List<LimitOrder> asks = createOrders(currencyPair, Order.OrderType.ASK, bitcoiniumOrderbook.getAsks()); List<LimitOrder> bids = createOrders(currencyPair, Order.OrderType.BID, bitcoiniumOrderbook.getBids()); Date date = new Date( bitcoiniumOrderbook .getBitcoiniumTicker() .getTimestamp()); // Note, this is the timestamp of the piggy-backed Ticker. return new OrderBook(date, asks, bids); }
[ "public", "static", "OrderBook", "adaptOrderbook", "(", "BitcoiniumOrderbook", "bitcoiniumOrderbook", ",", "CurrencyPair", "currencyPair", ")", "{", "List", "<", "LimitOrder", ">", "asks", "=", "createOrders", "(", "currencyPair", ",", "Order", ".", "OrderType", "."...
Adapts a BitcoiniumOrderbook to a OrderBook Object @param bitcoiniumOrderbook @return the XChange OrderBook
[ "Adapts", "a", "BitcoiniumOrderbook", "to", "a", "OrderBook", "Object" ]
train
https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-bitcoinium/src/main/java/org/knowm/xchange/bitcoinium/BitcoiniumAdapters.java#L54-L67
mgormley/pacaya
src/main/java/edu/jhu/pacaya/util/Threads.java
Threads.initDefaultPool
public static void initDefaultPool(int numThreads, boolean isDaemon) { if (numThreads == 1) { Threads.defaultPool = MoreExecutors.newDirectExecutorService(); Threads.numThreads = 1; } else { log.info("Initialized default thread pool to {} threads. (This must be closed by Threads.shutdownDefaultPool)", numThreads); Threads.defaultPool = Executors.newFixedThreadPool(numThreads, new ThreadFactory() { public Thread newThread(Runnable r) { Thread t = Executors.defaultThreadFactory().newThread(r); t.setDaemon(isDaemon); return t; } }); Threads.numThreads = numThreads; // Shutdown the thread pool on System.exit(). Runtime.getRuntime().addShutdownHook(new Thread(){ @Override public void run() { Threads.shutdownDefaultPool(); } }); } }
java
public static void initDefaultPool(int numThreads, boolean isDaemon) { if (numThreads == 1) { Threads.defaultPool = MoreExecutors.newDirectExecutorService(); Threads.numThreads = 1; } else { log.info("Initialized default thread pool to {} threads. (This must be closed by Threads.shutdownDefaultPool)", numThreads); Threads.defaultPool = Executors.newFixedThreadPool(numThreads, new ThreadFactory() { public Thread newThread(Runnable r) { Thread t = Executors.defaultThreadFactory().newThread(r); t.setDaemon(isDaemon); return t; } }); Threads.numThreads = numThreads; // Shutdown the thread pool on System.exit(). Runtime.getRuntime().addShutdownHook(new Thread(){ @Override public void run() { Threads.shutdownDefaultPool(); } }); } }
[ "public", "static", "void", "initDefaultPool", "(", "int", "numThreads", ",", "boolean", "isDaemon", ")", "{", "if", "(", "numThreads", "==", "1", ")", "{", "Threads", ".", "defaultPool", "=", "MoreExecutors", ".", "newDirectExecutorService", "(", ")", ";", ...
Initializes the default thread pool and adds a shutdown hook which will attempt to shutdown the thread pool on a call to System.exit(). If numThreads > 1 and isDaemon = true, then System.exit() or Threads.shutdownDefaultPool() must be explicitly called. Otherwise, the JVM may hang. @param numThreads The number of threads. @param isDaemon Whether the thread pool should consist of daemon threads.
[ "Initializes", "the", "default", "thread", "pool", "and", "adds", "a", "shutdown", "hook", "which", "will", "attempt", "to", "shutdown", "the", "thread", "pool", "on", "a", "call", "to", "System", ".", "exit", "()", "." ]
train
https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/util/Threads.java#L64-L86
jenkinsci/jenkins
core/src/main/java/hudson/model/User.java
User.getOrCreateById
private static @Nullable User getOrCreateById(@Nonnull String id, @Nonnull String fullName, boolean create) { User u = AllUsers.get(id); if (u == null && (create || UserIdMapper.getInstance().isMapped(id))) { u = new User(id, fullName); AllUsers.put(id, u); if (!id.equals(fullName) && !UserIdMapper.getInstance().isMapped(id)) { try { u.save(); } catch (IOException x) { LOGGER.log(Level.WARNING, "Failed to save user configuration for " + id, x); } } } return u; }
java
private static @Nullable User getOrCreateById(@Nonnull String id, @Nonnull String fullName, boolean create) { User u = AllUsers.get(id); if (u == null && (create || UserIdMapper.getInstance().isMapped(id))) { u = new User(id, fullName); AllUsers.put(id, u); if (!id.equals(fullName) && !UserIdMapper.getInstance().isMapped(id)) { try { u.save(); } catch (IOException x) { LOGGER.log(Level.WARNING, "Failed to save user configuration for " + id, x); } } } return u; }
[ "private", "static", "@", "Nullable", "User", "getOrCreateById", "(", "@", "Nonnull", "String", "id", ",", "@", "Nonnull", "String", "fullName", ",", "boolean", "create", ")", "{", "User", "u", "=", "AllUsers", ".", "get", "(", "id", ")", ";", "if", "(...
Retrieve a user by its ID, and create a new one if requested. @return An existing or created user. May be {@code null} if a user does not exist and {@code create} is false.
[ "Retrieve", "a", "user", "by", "its", "ID", "and", "create", "a", "new", "one", "if", "requested", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/User.java#L515-L530
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/wan/merkletree/MerkleTreeUtil.java
MerkleTreeUtil.getLeafOrderForHash
static int getLeafOrderForHash(int hash, int level) { long hashStepForLevel = getNodeHashRangeOnLevel(level); long hashDistanceFromMin = ((long) hash) - Integer.MIN_VALUE; int steps = (int) (hashDistanceFromMin / hashStepForLevel); int leftMostNodeOrderOnLevel = getLeftMostNodeOrderOnLevel(level); return leftMostNodeOrderOnLevel + steps; }
java
static int getLeafOrderForHash(int hash, int level) { long hashStepForLevel = getNodeHashRangeOnLevel(level); long hashDistanceFromMin = ((long) hash) - Integer.MIN_VALUE; int steps = (int) (hashDistanceFromMin / hashStepForLevel); int leftMostNodeOrderOnLevel = getLeftMostNodeOrderOnLevel(level); return leftMostNodeOrderOnLevel + steps; }
[ "static", "int", "getLeafOrderForHash", "(", "int", "hash", ",", "int", "level", ")", "{", "long", "hashStepForLevel", "=", "getNodeHashRangeOnLevel", "(", "level", ")", ";", "long", "hashDistanceFromMin", "=", "(", "(", "long", ")", "hash", ")", "-", "Integ...
Returns the breadth-first order of the leaf that a given {@code hash} belongs to @param hash The hash for which the leaf order to be calculated @param level The level @return the breadth-first order of the leaf for the given {@code hash}
[ "Returns", "the", "breadth", "-", "first", "order", "of", "the", "leaf", "that", "a", "given", "{", "@code", "hash", "}", "belongs", "to" ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/wan/merkletree/MerkleTreeUtil.java#L48-L55
eduarddrenth/ConfigurableReports
src/main/java/com/vectorprint/report/itext/style/stylers/Image.java
Image.style
@Override public final <E> E style(E element, Object data) throws VectorPrintException { initURL(String.valueOf((data != null) ? convert(data) : getData())); try { /* always call createImage when styling, subclasses may do their own document writing etc. in createImage */ com.itextpdf.text.Image img = createImage(getWriter().getDirectContent(), (data != null) ? convert(data) : getData(), getValue(OPACITY, Float.class)); if (data != null) { setData(convert(data)); } applySettings(img); VectorPrintDocument document = (VectorPrintDocument) getDocument(); if (getValue(SHADOW, Boolean.class)) { // draw a shadow, but we do not know our position document.addHook(new VectorPrintDocument.AddElementHook(VectorPrintDocument.AddElementHook.INTENTION.PRINTIMAGESHADOW, img, this, getStyleClass())); } document.addHook(new VectorPrintDocument.AddElementHook(VectorPrintDocument.AddElementHook.INTENTION.DRAWNEARIMAGE, img, this, getStyleClass())); if (element != null) { // if we got here with an element, proceed no further, this element should finaly be added to the document return element; } return (E) img; } catch (BadElementException ex) { throw new VectorPrintException(ex); } }
java
@Override public final <E> E style(E element, Object data) throws VectorPrintException { initURL(String.valueOf((data != null) ? convert(data) : getData())); try { /* always call createImage when styling, subclasses may do their own document writing etc. in createImage */ com.itextpdf.text.Image img = createImage(getWriter().getDirectContent(), (data != null) ? convert(data) : getData(), getValue(OPACITY, Float.class)); if (data != null) { setData(convert(data)); } applySettings(img); VectorPrintDocument document = (VectorPrintDocument) getDocument(); if (getValue(SHADOW, Boolean.class)) { // draw a shadow, but we do not know our position document.addHook(new VectorPrintDocument.AddElementHook(VectorPrintDocument.AddElementHook.INTENTION.PRINTIMAGESHADOW, img, this, getStyleClass())); } document.addHook(new VectorPrintDocument.AddElementHook(VectorPrintDocument.AddElementHook.INTENTION.DRAWNEARIMAGE, img, this, getStyleClass())); if (element != null) { // if we got here with an element, proceed no further, this element should finaly be added to the document return element; } return (E) img; } catch (BadElementException ex) { throw new VectorPrintException(ex); } }
[ "@", "Override", "public", "final", "<", "E", ">", "E", "style", "(", "E", "element", ",", "Object", "data", ")", "throws", "VectorPrintException", "{", "initURL", "(", "String", ".", "valueOf", "(", "(", "data", "!=", "null", ")", "?", "convert", "(",...
Calls {@link #initURL(String) }, {@link #createImage(com.itextpdf.text.pdf.PdfContentByte, java.lang.Object, float) }, {@link #applySettings(com.itextpdf.text.Image) }. Calls {@link VectorPrintDocument#addHook(com.vectorprint.report.itext.VectorPrintDocument.AddElementHook) } for drawing image shadow and for drawing near this image. @param <E> @param element @param data when null use {@link #getData() } @return @throws VectorPrintException
[ "Calls", "{", "@link", "#initURL", "(", "String", ")", "}", "{", "@link", "#createImage", "(", "com", ".", "itextpdf", ".", "text", ".", "pdf", ".", "PdfContentByte", "java", ".", "lang", ".", "Object", "float", ")", "}", "{", "@link", "#applySettings", ...
train
https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/stylers/Image.java#L173-L200
VoltDB/voltdb
src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java
JDBC4PreparedStatement.setArray
@Override public void setArray(int parameterIndex, Array x) throws SQLException { checkParameterBounds(parameterIndex); throw SQLError.noSupport(); }
java
@Override public void setArray(int parameterIndex, Array x) throws SQLException { checkParameterBounds(parameterIndex); throw SQLError.noSupport(); }
[ "@", "Override", "public", "void", "setArray", "(", "int", "parameterIndex", ",", "Array", "x", ")", "throws", "SQLException", "{", "checkParameterBounds", "(", "parameterIndex", ")", ";", "throw", "SQLError", ".", "noSupport", "(", ")", ";", "}" ]
Sets the designated parameter to the given java.sql.Array object.
[ "Sets", "the", "designated", "parameter", "to", "the", "given", "java", ".", "sql", ".", "Array", "object", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java#L158-L163
JodaOrg/joda-time
src/main/java/org/joda/time/DateTimeZone.java
DateTimeZone.forOffsetMillis
public static DateTimeZone forOffsetMillis(int millisOffset) { if (millisOffset < -MAX_MILLIS || millisOffset > MAX_MILLIS) { throw new IllegalArgumentException("Millis out of range: " + millisOffset); } String id = printOffset(millisOffset); return fixedOffsetZone(id, millisOffset); }
java
public static DateTimeZone forOffsetMillis(int millisOffset) { if (millisOffset < -MAX_MILLIS || millisOffset > MAX_MILLIS) { throw new IllegalArgumentException("Millis out of range: " + millisOffset); } String id = printOffset(millisOffset); return fixedOffsetZone(id, millisOffset); }
[ "public", "static", "DateTimeZone", "forOffsetMillis", "(", "int", "millisOffset", ")", "{", "if", "(", "millisOffset", "<", "-", "MAX_MILLIS", "||", "millisOffset", ">", "MAX_MILLIS", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Millis out of range...
Gets a time zone instance for the specified offset to UTC in milliseconds. @param millisOffset the offset in millis from UTC, from -23:59:59.999 to +23:59:59.999 @return the DateTimeZone object for the offset
[ "Gets", "a", "time", "zone", "instance", "for", "the", "specified", "offset", "to", "UTC", "in", "milliseconds", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L316-L322
wisdom-framework/wisdom
core/application-configuration/src/main/java/org/wisdom/configuration/ApplicationConfigurationImpl.java
ApplicationConfigurationImpl.getFileWithDefault
@Override public File getFileWithDefault(String key, String file) { String value = get(key); if (value == null) { return new File(baseDirectory, file); } else { return new File(baseDirectory, value); } }
java
@Override public File getFileWithDefault(String key, String file) { String value = get(key); if (value == null) { return new File(baseDirectory, file); } else { return new File(baseDirectory, value); } }
[ "@", "Override", "public", "File", "getFileWithDefault", "(", "String", "key", ",", "String", "file", ")", "{", "String", "value", "=", "get", "(", "key", ")", ";", "if", "(", "value", "==", "null", ")", "{", "return", "new", "File", "(", "baseDirector...
Get a File property or a default value when property cannot be found in any configuration file. The file object is constructed using <code>new File(basedir, value)</code>. @param key the key @param file the default file @return the file object
[ "Get", "a", "File", "property", "or", "a", "default", "value", "when", "property", "cannot", "be", "found", "in", "any", "configuration", "file", ".", "The", "file", "object", "is", "constructed", "using", "<code", ">", "new", "File", "(", "basedir", "valu...
train
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ApplicationConfigurationImpl.java#L291-L299
alkacon/opencms-core
src/org/opencms/db/CmsSecurityManager.java
CmsSecurityManager.unsubscribeAllDeletedResources
public void unsubscribeAllDeletedResources(CmsRequestContext context, String poolName, long deletedTo) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { m_driverManager.unsubscribeAllDeletedResources(dbc, poolName, deletedTo); } catch (Exception e) { dbc.report(null, Messages.get().container(Messages.ERR_UNSUBSCRIBE_ALL_DELETED_RESOURCES_USER_0), e); } finally { dbc.clear(); } }
java
public void unsubscribeAllDeletedResources(CmsRequestContext context, String poolName, long deletedTo) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { m_driverManager.unsubscribeAllDeletedResources(dbc, poolName, deletedTo); } catch (Exception e) { dbc.report(null, Messages.get().container(Messages.ERR_UNSUBSCRIBE_ALL_DELETED_RESOURCES_USER_0), e); } finally { dbc.clear(); } }
[ "public", "void", "unsubscribeAllDeletedResources", "(", "CmsRequestContext", "context", ",", "String", "poolName", ",", "long", "deletedTo", ")", "throws", "CmsException", "{", "CmsDbContext", "dbc", "=", "m_dbContextFactory", ".", "getDbContext", "(", "context", ")"...
Unsubscribes all deleted resources that were deleted before the specified time stamp.<p> @param context the request context @param poolName the name of the database pool to use @param deletedTo the time stamp to which the resources have been deleted @throws CmsException if something goes wrong
[ "Unsubscribes", "all", "deleted", "resources", "that", "were", "deleted", "before", "the", "specified", "time", "stamp", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L6331-L6344
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.getUsersInfoForType
private static Iterable<BoxUser.Info> getUsersInfoForType(final BoxAPIConnection api, final String filterTerm, final String userType, final String externalAppUserId, final String... fields) { return new Iterable<BoxUser.Info>() { public Iterator<BoxUser.Info> iterator() { QueryStringBuilder builder = new QueryStringBuilder(); if (filterTerm != null) { builder.appendParam("filter_term", filterTerm); } if (userType != null) { builder.appendParam("user_type", userType); } if (externalAppUserId != null) { builder.appendParam("external_app_user_id", externalAppUserId); } if (fields.length > 0) { builder.appendParam("fields", fields); } URL url = USERS_URL_TEMPLATE.buildWithQuery(api.getBaseURL(), builder.toString()); return new BoxUserIterator(api, url); } }; }
java
private static Iterable<BoxUser.Info> getUsersInfoForType(final BoxAPIConnection api, final String filterTerm, final String userType, final String externalAppUserId, final String... fields) { return new Iterable<BoxUser.Info>() { public Iterator<BoxUser.Info> iterator() { QueryStringBuilder builder = new QueryStringBuilder(); if (filterTerm != null) { builder.appendParam("filter_term", filterTerm); } if (userType != null) { builder.appendParam("user_type", userType); } if (externalAppUserId != null) { builder.appendParam("external_app_user_id", externalAppUserId); } if (fields.length > 0) { builder.appendParam("fields", fields); } URL url = USERS_URL_TEMPLATE.buildWithQuery(api.getBaseURL(), builder.toString()); return new BoxUserIterator(api, url); } }; }
[ "private", "static", "Iterable", "<", "BoxUser", ".", "Info", ">", "getUsersInfoForType", "(", "final", "BoxAPIConnection", "api", ",", "final", "String", "filterTerm", ",", "final", "String", "userType", ",", "final", "String", "externalAppUserId", ",", "final", ...
Helper method to abstract out the common logic from the various users methods. @param api the API connection to be used when retrieving the users. @param filterTerm The filter term to lookup users by (login for external, login or name for managed) @param userType The type of users we want to search with this request. Valid values are 'managed' (enterprise users), 'external' or 'all' @param externalAppUserId the external app user id that has been set for an app user @param fields the fields to retrieve. Leave this out for the standard fields. @return An iterator over the selected users.
[ "Helper", "method", "to", "abstract", "out", "the", "common", "logic", "from", "the", "various", "users", "methods", "." ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L251-L272
revelc/formatter-maven-plugin
src/main/java/net/revelc/code/formatter/FormatterMojo.java
FormatterMojo.readFileAsString
private String readFileAsString(File file) throws java.io.IOException { StringBuilder fileData = new StringBuilder(1000); try (BufferedReader reader = new BufferedReader(ReaderFactory.newReader(file, this.encoding))) { char[] buf = new char[1024]; int numRead = 0; while ((numRead = reader.read(buf)) != -1) { String readData = String.valueOf(buf, 0, numRead); fileData.append(readData); buf = new char[1024]; } } return fileData.toString(); }
java
private String readFileAsString(File file) throws java.io.IOException { StringBuilder fileData = new StringBuilder(1000); try (BufferedReader reader = new BufferedReader(ReaderFactory.newReader(file, this.encoding))) { char[] buf = new char[1024]; int numRead = 0; while ((numRead = reader.read(buf)) != -1) { String readData = String.valueOf(buf, 0, numRead); fileData.append(readData); buf = new char[1024]; } } return fileData.toString(); }
[ "private", "String", "readFileAsString", "(", "File", "file", ")", "throws", "java", ".", "io", ".", "IOException", "{", "StringBuilder", "fileData", "=", "new", "StringBuilder", "(", "1000", ")", ";", "try", "(", "BufferedReader", "reader", "=", "new", "Buf...
Read the given file and return the content as a string. @param file the file @return the string @throws IOException Signals that an I/O exception has occurred.
[ "Read", "the", "given", "file", "and", "return", "the", "content", "as", "a", "string", "." ]
train
https://github.com/revelc/formatter-maven-plugin/blob/a237073ce6220e73ad6b1faef412fe0660485cf4/src/main/java/net/revelc/code/formatter/FormatterMojo.java#L597-L609
lucee/Lucee
core/src/main/java/lucee/intergral/fusiondebug/server/FDControllerImpl.java
FDControllerImpl.getByNativeIdentifier
private FDThreadImpl getByNativeIdentifier(String name, CFMLFactoryImpl factory, String id) { Map<Integer, PageContextImpl> pcs = factory.getActivePageContexts(); Iterator<PageContextImpl> it = pcs.values().iterator(); PageContextImpl pc; while (it.hasNext()) { pc = it.next(); if (equals(pc, id)) return new FDThreadImpl(this, factory, name, pc); } return null; }
java
private FDThreadImpl getByNativeIdentifier(String name, CFMLFactoryImpl factory, String id) { Map<Integer, PageContextImpl> pcs = factory.getActivePageContexts(); Iterator<PageContextImpl> it = pcs.values().iterator(); PageContextImpl pc; while (it.hasNext()) { pc = it.next(); if (equals(pc, id)) return new FDThreadImpl(this, factory, name, pc); } return null; }
[ "private", "FDThreadImpl", "getByNativeIdentifier", "(", "String", "name", ",", "CFMLFactoryImpl", "factory", ",", "String", "id", ")", "{", "Map", "<", "Integer", ",", "PageContextImpl", ">", "pcs", "=", "factory", ".", "getActivePageContexts", "(", ")", ";", ...
checks a single CFMLFactory for the thread @param name @param factory @param id @return matching thread or null
[ "checks", "a", "single", "CFMLFactory", "for", "the", "thread" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/intergral/fusiondebug/server/FDControllerImpl.java#L167-L177
shinesolutions/swagger-aem
java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/CrxApi.java
CrxApi.postPackageServiceJsonAsync
public com.squareup.okhttp.Call postPackageServiceJsonAsync(String path, String cmd, String groupName, String packageName, String packageVersion, String charset_, Boolean force, Boolean recursive, File _package, final ApiCallback<String> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = postPackageServiceJsonValidateBeforeCall(path, cmd, groupName, packageName, packageVersion, charset_, force, recursive, _package, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<String>(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; }
java
public com.squareup.okhttp.Call postPackageServiceJsonAsync(String path, String cmd, String groupName, String packageName, String packageVersion, String charset_, Boolean force, Boolean recursive, File _package, final ApiCallback<String> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = postPackageServiceJsonValidateBeforeCall(path, cmd, groupName, packageName, packageVersion, charset_, force, recursive, _package, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<String>(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; }
[ "public", "com", ".", "squareup", ".", "okhttp", ".", "Call", "postPackageServiceJsonAsync", "(", "String", "path", ",", "String", "cmd", ",", "String", "groupName", ",", "String", "packageName", ",", "String", "packageVersion", ",", "String", "charset_", ",", ...
(asynchronously) @param path (required) @param cmd (required) @param groupName (optional) @param packageName (optional) @param packageVersion (optional) @param charset_ (optional) @param force (optional) @param recursive (optional) @param _package (optional) @param callback The callback to be executed when the API call finishes @return The request call @throws ApiException If fail to process the API call, e.g. serializing the request body object
[ "(", "asynchronously", ")" ]
train
https://github.com/shinesolutions/swagger-aem/blob/ae7da4df93e817dc2bad843779b2069d9c4e7c6b/java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/CrxApi.java#L574-L599
playn/playn
html/src/playn/super/java/nio/ByteBuffer.java
ByteBuffer.putInt
public final ByteBuffer putInt (int baseOffset, int value) { if (order == ByteOrder.BIG_ENDIAN) { for (int i = 3; i >= 0; i--) { byteArray.set(baseOffset + i, (byte)(value & 0xFF)); value = value >> 8; } } else { for (int i = 0; i <= 3; i++) { byteArray.set(baseOffset + i, (byte)(value & 0xFF)); value = value >> 8; } } return this; }
java
public final ByteBuffer putInt (int baseOffset, int value) { if (order == ByteOrder.BIG_ENDIAN) { for (int i = 3; i >= 0; i--) { byteArray.set(baseOffset + i, (byte)(value & 0xFF)); value = value >> 8; } } else { for (int i = 0; i <= 3; i++) { byteArray.set(baseOffset + i, (byte)(value & 0xFF)); value = value >> 8; } } return this; }
[ "public", "final", "ByteBuffer", "putInt", "(", "int", "baseOffset", ",", "int", "value", ")", "{", "if", "(", "order", "==", "ByteOrder", ".", "BIG_ENDIAN", ")", "{", "for", "(", "int", "i", "=", "3", ";", "i", ">=", "0", ";", "i", "--", ")", "{...
Writes the given int to the specified index of this buffer. <p> The int is converted to bytes using the current byte order. The position is not changed. </p> @param index the index, must not be negative and equal or less than {@code limit - 4}. @param value the int to write. @return this buffer. @exception IndexOutOfBoundsException if {@code index} is invalid. @exception ReadOnlyBufferException if no changes may be made to the contents of this buffer.
[ "Writes", "the", "given", "int", "to", "the", "specified", "index", "of", "this", "buffer", ".", "<p", ">", "The", "int", "is", "converted", "to", "bytes", "using", "the", "current", "byte", "order", ".", "The", "position", "is", "not", "changed", ".", ...
train
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/html/src/playn/super/java/nio/ByteBuffer.java#L802-L815
Swagger2Markup/swagger2markup
src/main/java/io/github/swagger2markup/internal/document/DefinitionsDocument.java
DefinitionsDocument.buildDefinitionTitle
private void buildDefinitionTitle(MarkupDocBuilder markupDocBuilder, String title, String anchor) { markupDocBuilder.sectionTitleWithAnchorLevel2(title, anchor); }
java
private void buildDefinitionTitle(MarkupDocBuilder markupDocBuilder, String title, String anchor) { markupDocBuilder.sectionTitleWithAnchorLevel2(title, anchor); }
[ "private", "void", "buildDefinitionTitle", "(", "MarkupDocBuilder", "markupDocBuilder", ",", "String", "title", ",", "String", "anchor", ")", "{", "markupDocBuilder", ".", "sectionTitleWithAnchorLevel2", "(", "title", ",", "anchor", ")", ";", "}" ]
Builds definition title @param markupDocBuilder the markupDocBuilder do use for output @param title definition title @param anchor optional anchor (null => auto-generate from title)
[ "Builds", "definition", "title" ]
train
https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/internal/document/DefinitionsDocument.java#L182-L184
apache/incubator-druid
core/src/main/java/org/apache/druid/timeline/SegmentId.java
SegmentId.iterateAllPossibleParsings
public static Iterable<SegmentId> iterateAllPossibleParsings(String segmentId) { List<String> splits = DELIMITER_SPLITTER.splitToList(segmentId); String probableDataSource = tryExtractMostProbableDataSource(segmentId); // Iterate parsings with the most probably data source first to allow the users of iterateAllPossibleParsings() to // break from the iteration earlier with higher probability. if (probableDataSource != null) { List<SegmentId> probableParsings = iteratePossibleParsingsWithDataSource(probableDataSource, segmentId); Iterable<SegmentId> otherPossibleParsings = () -> IntStream .range(1, splits.size() - 3) .mapToObj(dataSourceDelimiterOrder -> DELIMITER_JOINER.join(splits.subList(0, dataSourceDelimiterOrder))) .filter(dataSource -> dataSource.length() != probableDataSource.length()) .flatMap(dataSource -> iteratePossibleParsingsWithDataSource(dataSource, segmentId).stream()) .iterator(); return Iterables.concat(probableParsings, otherPossibleParsings); } else { return () -> IntStream .range(1, splits.size() - 3) .mapToObj(dataSourceDelimiterOrder -> { String dataSource = DELIMITER_JOINER.join(splits.subList(0, dataSourceDelimiterOrder)); return iteratePossibleParsingsWithDataSource(dataSource, segmentId); }) .flatMap(List::stream) .iterator(); } }
java
public static Iterable<SegmentId> iterateAllPossibleParsings(String segmentId) { List<String> splits = DELIMITER_SPLITTER.splitToList(segmentId); String probableDataSource = tryExtractMostProbableDataSource(segmentId); // Iterate parsings with the most probably data source first to allow the users of iterateAllPossibleParsings() to // break from the iteration earlier with higher probability. if (probableDataSource != null) { List<SegmentId> probableParsings = iteratePossibleParsingsWithDataSource(probableDataSource, segmentId); Iterable<SegmentId> otherPossibleParsings = () -> IntStream .range(1, splits.size() - 3) .mapToObj(dataSourceDelimiterOrder -> DELIMITER_JOINER.join(splits.subList(0, dataSourceDelimiterOrder))) .filter(dataSource -> dataSource.length() != probableDataSource.length()) .flatMap(dataSource -> iteratePossibleParsingsWithDataSource(dataSource, segmentId).stream()) .iterator(); return Iterables.concat(probableParsings, otherPossibleParsings); } else { return () -> IntStream .range(1, splits.size() - 3) .mapToObj(dataSourceDelimiterOrder -> { String dataSource = DELIMITER_JOINER.join(splits.subList(0, dataSourceDelimiterOrder)); return iteratePossibleParsingsWithDataSource(dataSource, segmentId); }) .flatMap(List::stream) .iterator(); } }
[ "public", "static", "Iterable", "<", "SegmentId", ">", "iterateAllPossibleParsings", "(", "String", "segmentId", ")", "{", "List", "<", "String", ">", "splits", "=", "DELIMITER_SPLITTER", ".", "splitToList", "(", "segmentId", ")", ";", "String", "probableDataSourc...
Returns a (potentially empty) lazy iteration of all possible valid parsings of the given segment id string into {@code SegmentId} objects. Warning: most of the parsing work is repeated each time {@link Iterable#iterator()} of this iterable is consumed, so it should be consumed only once if possible.
[ "Returns", "a", "(", "potentially", "empty", ")", "lazy", "iteration", "of", "all", "possible", "valid", "parsings", "of", "the", "given", "segment", "id", "string", "into", "{", "@code", "SegmentId", "}", "objects", "." ]
train
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/timeline/SegmentId.java#L133-L158
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/PoissonDistribution.java
PoissonDistribution.poissonPDFm1
public static double poissonPDFm1(double x_plus_1, double lambda) { if(Double.isInfinite(lambda)) { return 0.; } if(x_plus_1 > 1) { return rawProbability(x_plus_1 - 1, lambda); } if(lambda > Math.abs(x_plus_1 - 1) * MathUtil.LOG2 * Double.MAX_EXPONENT / 1e-14) { return FastMath.exp(-lambda - GammaDistribution.logGamma(x_plus_1)); } else { return rawProbability(x_plus_1, lambda) * (x_plus_1 / lambda); } }
java
public static double poissonPDFm1(double x_plus_1, double lambda) { if(Double.isInfinite(lambda)) { return 0.; } if(x_plus_1 > 1) { return rawProbability(x_plus_1 - 1, lambda); } if(lambda > Math.abs(x_plus_1 - 1) * MathUtil.LOG2 * Double.MAX_EXPONENT / 1e-14) { return FastMath.exp(-lambda - GammaDistribution.logGamma(x_plus_1)); } else { return rawProbability(x_plus_1, lambda) * (x_plus_1 / lambda); } }
[ "public", "static", "double", "poissonPDFm1", "(", "double", "x_plus_1", ",", "double", "lambda", ")", "{", "if", "(", "Double", ".", "isInfinite", "(", "lambda", ")", ")", "{", "return", "0.", ";", "}", "if", "(", "x_plus_1", ">", "1", ")", "{", "re...
Compute the poisson distribution PDF with an offset of + 1 <p> pdf(x_plus_1 - 1, lambda) @param x_plus_1 x+1 @param lambda Lambda @return pdf
[ "Compute", "the", "poisson", "distribution", "PDF", "with", "an", "offset", "of", "+", "1", "<p", ">", "pdf", "(", "x_plus_1", "-", "1", "lambda", ")" ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/PoissonDistribution.java#L288-L301
aws/aws-sdk-java
aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/CreateTransformJobRequest.java
CreateTransformJobRequest.withEnvironment
public CreateTransformJobRequest withEnvironment(java.util.Map<String, String> environment) { setEnvironment(environment); return this; }
java
public CreateTransformJobRequest withEnvironment(java.util.Map<String, String> environment) { setEnvironment(environment); return this; }
[ "public", "CreateTransformJobRequest", "withEnvironment", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "environment", ")", "{", "setEnvironment", "(", "environment", ")", ";", "return", "this", ";", "}" ]
<p> The environment variables to set in the Docker container. We support up to 16 key and values entries in the map. </p> @param environment The environment variables to set in the Docker container. We support up to 16 key and values entries in the map. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "The", "environment", "variables", "to", "set", "in", "the", "Docker", "container", ".", "We", "support", "up", "to", "16", "key", "and", "values", "entries", "in", "the", "map", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/CreateTransformJobRequest.java#L546-L549
KayLerch/alexa-skills-kit-tellask-java
src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java
AlexaInput.hasSlotIsEqual
public boolean hasSlotIsEqual(final String slotName, final String value) { final String slotValue = getSlotValue(slotName); return (slotValue != null && slotValue.equals(value)) || slotValue == value; }
java
public boolean hasSlotIsEqual(final String slotName, final String value) { final String slotValue = getSlotValue(slotName); return (slotValue != null && slotValue.equals(value)) || slotValue == value; }
[ "public", "boolean", "hasSlotIsEqual", "(", "final", "String", "slotName", ",", "final", "String", "value", ")", "{", "final", "String", "slotValue", "=", "getSlotValue", "(", "slotName", ")", ";", "return", "(", "slotValue", "!=", "null", "&&", "slotValue", ...
Checks if a slot is contained in the intent request and also got the value provided. @param slotName name of the slot to look after @param value the value @return True, if slot with slotName has a value equal to the given value
[ "Checks", "if", "a", "slot", "is", "contained", "in", "the", "intent", "request", "and", "also", "got", "the", "value", "provided", "." ]
train
https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L123-L127
Azure/azure-sdk-for-java
containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java
TasksInner.getAsync
public Observable<TaskInner> getAsync(String resourceGroupName, String registryName, String taskName) { return getWithServiceResponseAsync(resourceGroupName, registryName, taskName).map(new Func1<ServiceResponse<TaskInner>, TaskInner>() { @Override public TaskInner call(ServiceResponse<TaskInner> response) { return response.body(); } }); }
java
public Observable<TaskInner> getAsync(String resourceGroupName, String registryName, String taskName) { return getWithServiceResponseAsync(resourceGroupName, registryName, taskName).map(new Func1<ServiceResponse<TaskInner>, TaskInner>() { @Override public TaskInner call(ServiceResponse<TaskInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "TaskInner", ">", "getAsync", "(", "String", "resourceGroupName", ",", "String", "registryName", ",", "String", "taskName", ")", "{", "return", "getWithServiceResponseAsync", "(", "resourceGroupName", ",", "registryName", ",", "taskName", ...
Get the properties of a specified task. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName The name of the container registry. @param taskName The name of the container registry task. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the TaskInner object
[ "Get", "the", "properties", "of", "a", "specified", "task", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java#L268-L275
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java
JimfsFileStore.setAttribute
void setAttribute(File file, String attribute, Object value) { state.checkOpen(); // TODO(cgdecker): Change attribute stuff to avoid the sad boolean parameter attributes.setAttribute(file, attribute, value, false); }
java
void setAttribute(File file, String attribute, Object value) { state.checkOpen(); // TODO(cgdecker): Change attribute stuff to avoid the sad boolean parameter attributes.setAttribute(file, attribute, value, false); }
[ "void", "setAttribute", "(", "File", "file", ",", "String", "attribute", ",", "Object", "value", ")", "{", "state", ".", "checkOpen", "(", ")", ";", "// TODO(cgdecker): Change attribute stuff to avoid the sad boolean parameter", "attributes", ".", "setAttribute", "(", ...
Sets the given attribute to the given value for the given file.
[ "Sets", "the", "given", "attribute", "to", "the", "given", "value", "for", "the", "given", "file", "." ]
train
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java#L198-L202
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowControlContainerFactory.java
PageFlowControlContainerFactory.getControlContainer
public static synchronized PageFlowControlContainer getControlContainer(HttpServletRequest request, ServletContext servletContext) { PageFlowControlContainer pfcc = (PageFlowControlContainer) getSessionVar(request, servletContext, PAGEFLOW_CONTROL_CONTAINER); if (pfcc != null) return pfcc; pfcc = new PageFlowControlContainerImpl(); setSessionVar(request,servletContext,PAGEFLOW_CONTROL_CONTAINER,pfcc); return pfcc; }
java
public static synchronized PageFlowControlContainer getControlContainer(HttpServletRequest request, ServletContext servletContext) { PageFlowControlContainer pfcc = (PageFlowControlContainer) getSessionVar(request, servletContext, PAGEFLOW_CONTROL_CONTAINER); if (pfcc != null) return pfcc; pfcc = new PageFlowControlContainerImpl(); setSessionVar(request,servletContext,PAGEFLOW_CONTROL_CONTAINER,pfcc); return pfcc; }
[ "public", "static", "synchronized", "PageFlowControlContainer", "getControlContainer", "(", "HttpServletRequest", "request", ",", "ServletContext", "servletContext", ")", "{", "PageFlowControlContainer", "pfcc", "=", "(", "PageFlowControlContainer", ")", "getSessionVar", "(",...
This method will return the <code>PageFlowControlContainer</code> that is acting as the control container for the page flow runtime. @param request The current request @param servletContext The servlet context @return The <code>pageFLowControlContainer</code> acting as the control container.
[ "This", "method", "will", "return", "the", "<code", ">", "PageFlowControlContainer<", "/", "code", ">", "that", "is", "acting", "as", "the", "control", "container", "for", "the", "page", "flow", "runtime", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowControlContainerFactory.java#L40-L49
jbundle/jbundle
base/remote/src/main/java/org/jbundle/base/remote/lock/LockSession.java
LockSession.getLockTable
public LockTable getLockTable(String strDatabaseName, String strRecordName) { String strKey = strDatabaseName + ':' + strRecordName; LockTable lockTable = (LockTable)m_htLockTables.get(strKey); if (lockTable == null) { synchronized (m_htLockTables) { if ((lockTable = (LockTable)m_htLockTables.get(strKey)) == null) m_htLockTables.put(strKey, lockTable = new LockTable()); } m_hsMyLockTables.add(lockTable); // Keep track of the lock tables that I used } return lockTable; }
java
public LockTable getLockTable(String strDatabaseName, String strRecordName) { String strKey = strDatabaseName + ':' + strRecordName; LockTable lockTable = (LockTable)m_htLockTables.get(strKey); if (lockTable == null) { synchronized (m_htLockTables) { if ((lockTable = (LockTable)m_htLockTables.get(strKey)) == null) m_htLockTables.put(strKey, lockTable = new LockTable()); } m_hsMyLockTables.add(lockTable); // Keep track of the lock tables that I used } return lockTable; }
[ "public", "LockTable", "getLockTable", "(", "String", "strDatabaseName", ",", "String", "strRecordName", ")", "{", "String", "strKey", "=", "strDatabaseName", "+", "'", "'", "+", "strRecordName", ";", "LockTable", "lockTable", "=", "(", "LockTable", ")", "m_htLo...
Get the lock table for this record. @param strRecordName The record to look up. @return The lock table for this record (create if it doesn't exist).
[ "Get", "the", "lock", "table", "for", "this", "record", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/lock/LockSession.java#L181-L195
pawelprazak/java-extended
guava/src/main/java/com/bluecatcode/common/base/Environment.java
Environment.getNextAvailablePort
public static int getNextAvailablePort(int fromPort, int toPort) { if (fromPort < MIN_PORT_NUMBER || toPort > MAX_PORT_NUMBER || fromPort > toPort) { throw new IllegalArgumentException(format("Invalid port range: %d ~ %d", fromPort, toPort)); } int nextPort = fromPort; //noinspection StatementWithEmptyBody while (!isPortAvailable(nextPort++)) { /* Empty */ } return nextPort; }
java
public static int getNextAvailablePort(int fromPort, int toPort) { if (fromPort < MIN_PORT_NUMBER || toPort > MAX_PORT_NUMBER || fromPort > toPort) { throw new IllegalArgumentException(format("Invalid port range: %d ~ %d", fromPort, toPort)); } int nextPort = fromPort; //noinspection StatementWithEmptyBody while (!isPortAvailable(nextPort++)) { /* Empty */ } return nextPort; }
[ "public", "static", "int", "getNextAvailablePort", "(", "int", "fromPort", ",", "int", "toPort", ")", "{", "if", "(", "fromPort", "<", "MIN_PORT_NUMBER", "||", "toPort", ">", "MAX_PORT_NUMBER", "||", "fromPort", ">", "toPort", ")", "{", "throw", "new", "Ille...
Returns a currently available port number in the specified range. @param fromPort the lower port limit @param toPort the upper port limit @throws IllegalArgumentException if port range is not between {@link #MIN_PORT_NUMBER} and {@link #MAX_PORT_NUMBER} or <code>fromPort</code> if greater than <code>toPort</code>. @return an available port
[ "Returns", "a", "currently", "available", "port", "number", "in", "the", "specified", "range", "." ]
train
https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/base/Environment.java#L116-L125
jhalterman/lyra
src/main/java/net/jodah/lyra/ConnectionOptions.java
ConnectionOptions.withClientProperties
public ConnectionOptions withClientProperties(Map<String, Object> clientProperties) { factory.setClientProperties(Assert.notNull(clientProperties, "clientProperties")); return this; }
java
public ConnectionOptions withClientProperties(Map<String, Object> clientProperties) { factory.setClientProperties(Assert.notNull(clientProperties, "clientProperties")); return this; }
[ "public", "ConnectionOptions", "withClientProperties", "(", "Map", "<", "String", ",", "Object", ">", "clientProperties", ")", "{", "factory", ".", "setClientProperties", "(", "Assert", ".", "notNull", "(", "clientProperties", ",", "\"clientProperties\"", ")", ")", ...
Sets the client properties. @throws NullPointerException if {@code clientProperties} is null
[ "Sets", "the", "client", "properties", "." ]
train
https://github.com/jhalterman/lyra/blob/ce347a69357fef1b34e92d92a4f9e68792d81255/src/main/java/net/jodah/lyra/ConnectionOptions.java#L181-L184
mygreen/super-csv-annotation
src/main/java/com/github/mygreen/supercsv/cellprocessor/constraint/LengthExact.java
LengthExact.execute
@SuppressWarnings("unchecked") public Object execute(final Object value, final CsvContext context) { if(value == null) { return next.execute(value, context); } final String stringValue = value.toString(); final int length = stringValue.length(); if( !requriedLengths.contains(length)) { final String joinedLength = requriedLengths.stream() .map(String::valueOf).collect(Collectors.joining(", ")); throw createValidationException(context) .messageFormat("the length (%d) of value '%s' not any of required lengths (%s)", length, stringValue, joinedLength) .rejectedValue(stringValue) .messageVariables("length", length) .messageVariables("requiredLengths", getRequiredLengths()) .build(); } return next.execute(stringValue, context); }
java
@SuppressWarnings("unchecked") public Object execute(final Object value, final CsvContext context) { if(value == null) { return next.execute(value, context); } final String stringValue = value.toString(); final int length = stringValue.length(); if( !requriedLengths.contains(length)) { final String joinedLength = requriedLengths.stream() .map(String::valueOf).collect(Collectors.joining(", ")); throw createValidationException(context) .messageFormat("the length (%d) of value '%s' not any of required lengths (%s)", length, stringValue, joinedLength) .rejectedValue(stringValue) .messageVariables("length", length) .messageVariables("requiredLengths", getRequiredLengths()) .build(); } return next.execute(stringValue, context); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "Object", "execute", "(", "final", "Object", "value", ",", "final", "CsvContext", "context", ")", "{", "if", "(", "value", "==", "null", ")", "{", "return", "next", ".", "execute", "(", "value",...
{@inheritDoc} @throws SuperCsvCellProcessorException {@literal if value is null} @throws SuperCsvConstraintViolationException {@literal if length is < min or length > max}
[ "{", "@inheritDoc", "}" ]
train
https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/cellprocessor/constraint/LengthExact.java#L67-L92
pawelprazak/java-extended
guava/src/main/java/com/bluecatcode/common/contract/Checks.java
Checks.checkUri
public static String checkUri(String uri, @Nullable Object errorMessage) { return checkUri(uri, String.valueOf(errorMessage), EMPTY_ERROR_MESSAGE_ARGS); }
java
public static String checkUri(String uri, @Nullable Object errorMessage) { return checkUri(uri, String.valueOf(errorMessage), EMPTY_ERROR_MESSAGE_ARGS); }
[ "public", "static", "String", "checkUri", "(", "String", "uri", ",", "@", "Nullable", "Object", "errorMessage", ")", "{", "return", "checkUri", "(", "uri", ",", "String", ".", "valueOf", "(", "errorMessage", ")", ",", "EMPTY_ERROR_MESSAGE_ARGS", ")", ";", "}...
Performs URI check against RFC 2396 specification @param uri the URI to check @return the checked uri @throws IllegalArgumentException if the {@code uri} is invalid @throws NullPointerException if the {@code uri} is null @see Checks#checkUri(String, String, Object...)
[ "Performs", "URI", "check", "against", "RFC", "2396", "specification" ]
train
https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/contract/Checks.java#L448-L450