repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
194
func_name
stringlengths
6
111
whole_func_string
stringlengths
80
3.8k
language
stringclasses
1 value
func_code_string
stringlengths
80
3.8k
func_code_tokens
listlengths
20
697
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
434
split_name
stringclasses
1 value
func_code_url
stringlengths
111
308
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/reader/impl/BasicModelUtils.java
BasicModelUtils.wordsNearestSum
@Override public Collection<String> wordsNearestSum(String word, int n) { //INDArray vec = Transforms.unitVec(this.lookupTable.vector(word)); INDArray vec = this.lookupTable.vector(word); return wordsNearestSum(vec, n); }
java
@Override public Collection<String> wordsNearestSum(String word, int n) { //INDArray vec = Transforms.unitVec(this.lookupTable.vector(word)); INDArray vec = this.lookupTable.vector(word); return wordsNearestSum(vec, n); }
[ "@", "Override", "public", "Collection", "<", "String", ">", "wordsNearestSum", "(", "String", "word", ",", "int", "n", ")", "{", "//INDArray vec = Transforms.unitVec(this.lookupTable.vector(word));", "INDArray", "vec", "=", "this", ".", "lookupTable", ".", "vector", ...
Get the top n words most similar to the given word @param word the word to compare @param n the n to get @return the top n words
[ "Get", "the", "top", "n", "words", "most", "similar", "to", "the", "given", "word" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/reader/impl/BasicModelUtils.java#L228-L233
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/seo/CmsAliasList.java
CmsAliasList.validateSingle
protected void validateSingle( CmsUUID structureId, Map<String, String> sitePaths, String newSitePath, final AsyncCallback<String> errorCallback) { Map<String, String> newMap = new HashMap<String, String>(sitePaths); newMap.put("NEW", newSitePath); //$NON-NLS-1$ AsyncCallback<Map<String, String>> callback = new AsyncCallback<Map<String, String>>() { public void onFailure(Throwable caught) { assert false; // should never happen } public void onSuccess(Map<String, String> result) { String newRes = result.get("NEW"); //$NON-NLS-1$ errorCallback.onSuccess(newRes); } }; validateAliases(structureId, newMap, callback); }
java
protected void validateSingle( CmsUUID structureId, Map<String, String> sitePaths, String newSitePath, final AsyncCallback<String> errorCallback) { Map<String, String> newMap = new HashMap<String, String>(sitePaths); newMap.put("NEW", newSitePath); //$NON-NLS-1$ AsyncCallback<Map<String, String>> callback = new AsyncCallback<Map<String, String>>() { public void onFailure(Throwable caught) { assert false; // should never happen } public void onSuccess(Map<String, String> result) { String newRes = result.get("NEW"); //$NON-NLS-1$ errorCallback.onSuccess(newRes); } }; validateAliases(structureId, newMap, callback); }
[ "protected", "void", "validateSingle", "(", "CmsUUID", "structureId", ",", "Map", "<", "String", ",", "String", ">", "sitePaths", ",", "String", "newSitePath", ",", "final", "AsyncCallback", "<", "String", ">", "errorCallback", ")", "{", "Map", "<", "String", ...
Validation method used when adding a new alias.<p> @param structureId the structure id @param sitePaths the site paths @param newSitePath the new site path @param errorCallback on error callback
[ "Validation", "method", "used", "when", "adding", "a", "new", "alias", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/seo/CmsAliasList.java#L582-L604
FXMisc/RichTextFX
richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocument.java
ReadOnlyStyledDocument.replaceParagraph
public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>> replaceParagraph( int parIdx, UnaryOperator<Paragraph<PS, SEG, S>> mapper) { ensureValidParagraphIndex(parIdx); return replace( new BiIndex(parIdx, 0), new BiIndex(parIdx, tree.getLeaf(parIdx).length()), doc -> doc.mapParagraphs(mapper)); }
java
public Tuple3<ReadOnlyStyledDocument<PS, SEG, S>, RichTextChange<PS, SEG, S>, MaterializedListModification<Paragraph<PS, SEG, S>>> replaceParagraph( int parIdx, UnaryOperator<Paragraph<PS, SEG, S>> mapper) { ensureValidParagraphIndex(parIdx); return replace( new BiIndex(parIdx, 0), new BiIndex(parIdx, tree.getLeaf(parIdx).length()), doc -> doc.mapParagraphs(mapper)); }
[ "public", "Tuple3", "<", "ReadOnlyStyledDocument", "<", "PS", ",", "SEG", ",", "S", ">", ",", "RichTextChange", "<", "PS", ",", "SEG", ",", "S", ">", ",", "MaterializedListModification", "<", "Paragraph", "<", "PS", ",", "SEG", ",", "S", ">", ">", ">",...
Maps the paragraph at the given index by calling {@link #replace(int, int, UnaryOperator)}. Returns <ol> <li> the updated version of this document that includes the replacement, </li> <li> the {@link RichTextChange} that represents the change from this document to the returned one, and </li> <li> the modification used to update an area's list of paragraphs. </li> </ol>
[ "Maps", "the", "paragraph", "at", "the", "given", "index", "by", "calling", "{" ]
train
https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocument.java#L445-L452
CleverTap/clevertap-android-sdk
clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java
DBAdapter.markReadMessageForId
synchronized boolean markReadMessageForId(String messageId, String userId){ if(messageId == null || userId == null) return false; final String tName = Table.INBOX_MESSAGES.getName(); try{ final SQLiteDatabase db = dbHelper.getWritableDatabase(); ContentValues cv = new ContentValues(); cv.put(IS_READ,1); db.update(Table.INBOX_MESSAGES.getName(), cv,_ID + " = ? AND " + USER_ID + " = ?",new String[]{messageId,userId}); return true; }catch (final SQLiteException e){ getConfigLogger().verbose("Error removing stale records from " + tName, e); return false; } finally { dbHelper.close(); } }
java
synchronized boolean markReadMessageForId(String messageId, String userId){ if(messageId == null || userId == null) return false; final String tName = Table.INBOX_MESSAGES.getName(); try{ final SQLiteDatabase db = dbHelper.getWritableDatabase(); ContentValues cv = new ContentValues(); cv.put(IS_READ,1); db.update(Table.INBOX_MESSAGES.getName(), cv,_ID + " = ? AND " + USER_ID + " = ?",new String[]{messageId,userId}); return true; }catch (final SQLiteException e){ getConfigLogger().verbose("Error removing stale records from " + tName, e); return false; } finally { dbHelper.close(); } }
[ "synchronized", "boolean", "markReadMessageForId", "(", "String", "messageId", ",", "String", "userId", ")", "{", "if", "(", "messageId", "==", "null", "||", "userId", "==", "null", ")", "return", "false", ";", "final", "String", "tName", "=", "Table", ".", ...
Marks inbox message as read for given messageId @param messageId String messageId @return boolean value depending on success of operation
[ "Marks", "inbox", "message", "as", "read", "for", "given", "messageId" ]
train
https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java#L694-L710
comapi/comapi-sdk-android
COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java
InternalService.sendMessage
public void sendMessage(@NonNull final String conversationId, @NonNull final MessageToSend message, @Nullable Callback<ComapiResult<MessageSentResponse>> callback) { adapter.adapt(sendMessage(conversationId, message), callback); }
java
public void sendMessage(@NonNull final String conversationId, @NonNull final MessageToSend message, @Nullable Callback<ComapiResult<MessageSentResponse>> callback) { adapter.adapt(sendMessage(conversationId, message), callback); }
[ "public", "void", "sendMessage", "(", "@", "NonNull", "final", "String", "conversationId", ",", "@", "NonNull", "final", "MessageToSend", "message", ",", "@", "Nullable", "Callback", "<", "ComapiResult", "<", "MessageSentResponse", ">", ">", "callback", ")", "{"...
Send message to the chanel. @param conversationId ID of a conversation to send a message to. @param message Message to be send. @param callback Callback to deliver new session instance.
[ "Send", "message", "to", "the", "chanel", "." ]
train
https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L717-L719
petergeneric/stdlib
stdlib/src/main/java/com/peterphi/std/net/IpHelper.java
IpHelper.getLocalIpAddress
public static InetAddress getLocalIpAddress() throws RuntimeException { try { List<InetAddress> ips = getLocalIpAddresses(false, true); for (InetAddress ip : ips) { log.debug("[IpHelper] {getLocalIpAddress} Considering locality of " + ip.getHostAddress()); if (!ip.isAnyLocalAddress() && (ip instanceof Inet4Address)) { // Ubuntu sets the unix hostname to resolve to 127.0.1.1; this is annoying so treat it as a loopback if (!ip.getHostAddress().startsWith("127.0.")) { log.debug("[IpHelper] {getLocalIpAddress} Found nonloopback IP: " + ip.getHostAddress()); return ip; } } } log.trace("[IpHelper] {getLocalIpAddress} Couldn't find a public IP in the ip (size " + ips.size() + ")"); return InetAddress.getLocalHost(); } catch (UnknownHostException e) { throw new RuntimeException("[FileHelper] {getLocalIp}: Unable to acquire the current machine's InetAddress", e); } }
java
public static InetAddress getLocalIpAddress() throws RuntimeException { try { List<InetAddress> ips = getLocalIpAddresses(false, true); for (InetAddress ip : ips) { log.debug("[IpHelper] {getLocalIpAddress} Considering locality of " + ip.getHostAddress()); if (!ip.isAnyLocalAddress() && (ip instanceof Inet4Address)) { // Ubuntu sets the unix hostname to resolve to 127.0.1.1; this is annoying so treat it as a loopback if (!ip.getHostAddress().startsWith("127.0.")) { log.debug("[IpHelper] {getLocalIpAddress} Found nonloopback IP: " + ip.getHostAddress()); return ip; } } } log.trace("[IpHelper] {getLocalIpAddress} Couldn't find a public IP in the ip (size " + ips.size() + ")"); return InetAddress.getLocalHost(); } catch (UnknownHostException e) { throw new RuntimeException("[FileHelper] {getLocalIp}: Unable to acquire the current machine's InetAddress", e); } }
[ "public", "static", "InetAddress", "getLocalIpAddress", "(", ")", "throws", "RuntimeException", "{", "try", "{", "List", "<", "InetAddress", ">", "ips", "=", "getLocalIpAddresses", "(", "false", ",", "true", ")", ";", "for", "(", "InetAddress", "ip", ":", "i...
Returns the primary InetAddress of localhost @return InetAddress The InetAddress of the local host @throws RuntimeException On any error @since 1.0
[ "Returns", "the", "primary", "InetAddress", "of", "localhost" ]
train
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/net/IpHelper.java#L113-L140
dvasilen/Hive-XML-SerDe
src/main/java/com/ibm/spss/hive/serde2/xml/objectinspector/XmlObjectInspectorFactory.java
XmlObjectInspectorFactory.getStandardStructObjectInspector
public static StructObjectInspector getStandardStructObjectInspector(List<String> structFieldNames, List<ObjectInspector> structFieldObjectInspectors, XmlProcessor xmlProcessor) { return new XmlStructObjectInspector(structFieldNames, structFieldObjectInspectors, xmlProcessor); }
java
public static StructObjectInspector getStandardStructObjectInspector(List<String> structFieldNames, List<ObjectInspector> structFieldObjectInspectors, XmlProcessor xmlProcessor) { return new XmlStructObjectInspector(structFieldNames, structFieldObjectInspectors, xmlProcessor); }
[ "public", "static", "StructObjectInspector", "getStandardStructObjectInspector", "(", "List", "<", "String", ">", "structFieldNames", ",", "List", "<", "ObjectInspector", ">", "structFieldObjectInspectors", ",", "XmlProcessor", "xmlProcessor", ")", "{", "return", "new", ...
Returns the struct object inspector @param structFieldNames the field names @param structFieldObjectInspectors the object inspectors @param xmlProcessor the XML processor @return the struct object inspector
[ "Returns", "the", "struct", "object", "inspector" ]
train
https://github.com/dvasilen/Hive-XML-SerDe/blob/2a7a184b2cfaeb63008529a9851cd72edb8025d9/src/main/java/com/ibm/spss/hive/serde2/xml/objectinspector/XmlObjectInspectorFactory.java#L98-L102
h2oai/h2o-3
h2o-core/src/main/java/water/init/TimelineSnapshot.java
TimelineSnapshot.isSenderRecvPair
private boolean isSenderRecvPair(Event senderCnd, Event recvCnd) { if (senderCnd.isSend() && recvCnd.isRecv() && senderCnd.match(recvCnd)) { ArrayList<Event> recvs = _sends.get(senderCnd); if (recvs.isEmpty() || senderCnd.packH2O()==null ) { for (Event e : recvs) if (e._nodeId == recvCnd._nodeId) return false; return true; } } return false; }
java
private boolean isSenderRecvPair(Event senderCnd, Event recvCnd) { if (senderCnd.isSend() && recvCnd.isRecv() && senderCnd.match(recvCnd)) { ArrayList<Event> recvs = _sends.get(senderCnd); if (recvs.isEmpty() || senderCnd.packH2O()==null ) { for (Event e : recvs) if (e._nodeId == recvCnd._nodeId) return false; return true; } } return false; }
[ "private", "boolean", "isSenderRecvPair", "(", "Event", "senderCnd", ",", "Event", "recvCnd", ")", "{", "if", "(", "senderCnd", ".", "isSend", "(", ")", "&&", "recvCnd", ".", "isRecv", "(", ")", "&&", "senderCnd", ".", "match", "(", "recvCnd", ")", ")", ...
Check whether two events can be put together in sender/recv relationship. Events must match, also each sender can have only one receiver per node. @param senderCnd @param recvCnd @return
[ "Check", "whether", "two", "events", "can", "be", "put", "together", "in", "sender", "/", "recv", "relationship", "." ]
train
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/init/TimelineSnapshot.java#L329-L340
mediathekview/MServer
src/main/java/mServer/crawler/FilmeSuchen.java
FilmeSuchen.updateSender
public void updateSender(String[] nameSender, ListeFilme listeFilme) { // nur für den Mauskontext "Sender aktualisieren" boolean starten = false; initStart(listeFilme); for (MediathekReader reader : mediathekListe) { for (String s : nameSender) { if (reader.checkNameSenderFilmliste(s)) { starten = true; new Thread(reader).start(); //reader.start(); } } } allStarted = true; if (!starten) { // dann fertig meldenFertig(""); } }
java
public void updateSender(String[] nameSender, ListeFilme listeFilme) { // nur für den Mauskontext "Sender aktualisieren" boolean starten = false; initStart(listeFilme); for (MediathekReader reader : mediathekListe) { for (String s : nameSender) { if (reader.checkNameSenderFilmliste(s)) { starten = true; new Thread(reader).start(); //reader.start(); } } } allStarted = true; if (!starten) { // dann fertig meldenFertig(""); } }
[ "public", "void", "updateSender", "(", "String", "[", "]", "nameSender", ",", "ListeFilme", "listeFilme", ")", "{", "// nur für den Mauskontext \"Sender aktualisieren\"\r", "boolean", "starten", "=", "false", ";", "initStart", "(", "listeFilme", ")", ";", "for", "("...
es werden nur einige Sender aktualisiert @param nameSender @param listeFilme
[ "es", "werden", "nur", "einige", "Sender", "aktualisiert" ]
train
https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/FilmeSuchen.java#L137-L155
hawkular/hawkular-commons
hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/WsSessions.java
WsSessions.addSession
public boolean addSession(String key, Session newSession) { SessionEntry newEntry = createSessionEntry(key, newSession); SessionEntry oldEntry = null; sessionsLockWrite.lock(); try { oldEntry = this.sessions.putIfAbsent(key, newEntry); } finally { sessionsLockWrite.unlock(); } /* check how successful we were with adding */ if (oldEntry == null) { log.debugf("A WebSocket session [%s] of [%s] has been added. The endpoint has now [%d] sessions", key, endpoint, this.sessions.size()); newEntry.added(); } else { /* a feed already had a session open, cannot open more than one */ try { log.errorClosingDuplicateWsSession(key, endpoint); newSession.close(new CloseReason(CloseReason.CloseCodes.VIOLATED_POLICY, "Cannot have multiple WebSocket sessions open, the new one will be closed")); } catch (Exception e) { log.errorCannotCloseDuplicateWsSession(key, endpoint, e); } } return oldEntry == null; }
java
public boolean addSession(String key, Session newSession) { SessionEntry newEntry = createSessionEntry(key, newSession); SessionEntry oldEntry = null; sessionsLockWrite.lock(); try { oldEntry = this.sessions.putIfAbsent(key, newEntry); } finally { sessionsLockWrite.unlock(); } /* check how successful we were with adding */ if (oldEntry == null) { log.debugf("A WebSocket session [%s] of [%s] has been added. The endpoint has now [%d] sessions", key, endpoint, this.sessions.size()); newEntry.added(); } else { /* a feed already had a session open, cannot open more than one */ try { log.errorClosingDuplicateWsSession(key, endpoint); newSession.close(new CloseReason(CloseReason.CloseCodes.VIOLATED_POLICY, "Cannot have multiple WebSocket sessions open, the new one will be closed")); } catch (Exception e) { log.errorCannotCloseDuplicateWsSession(key, endpoint, e); } } return oldEntry == null; }
[ "public", "boolean", "addSession", "(", "String", "key", ",", "Session", "newSession", ")", "{", "SessionEntry", "newEntry", "=", "createSessionEntry", "(", "key", ",", "newSession", ")", ";", "SessionEntry", "oldEntry", "=", "null", ";", "sessionsLockWrite", "....
Stores the given {@code newSession} under the given {@code key}. <p> If there is already a session associated with the given {@code key}, the given {@code newSession} is closed; it is not added or associated with the given key and an error will be logged. The original session remains associated with the {@code key}. <p> When adding a session, that new session's websocket session listeners will be told via {@link WsSessionListener#sessionAdded()}. @param key the key (feedId or sessionId) that will be associated with the new session @param newSession the new session to add @return {@code true} if the session was added; {@code false} otherwise.
[ "Stores", "the", "given", "{", "@code", "newSession", "}", "under", "the", "given", "{", "@code", "key", "}", ".", "<p", ">", "If", "there", "is", "already", "a", "session", "associated", "with", "the", "given", "{", "@code", "key", "}", "the", "given"...
train
https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/WsSessions.java#L115-L144
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java
AjaxHelper.registerContainer
static AjaxOperation registerContainer(final String triggerId, final String containerId, final List<String> containerContentIds) { AjaxOperation operation = new AjaxOperation(triggerId, containerContentIds); operation.setTargetContainerId(containerId); operation.setAction(AjaxOperation.AjaxAction.REPLACE_CONTENT); registerAjaxOperation(operation); return operation; }
java
static AjaxOperation registerContainer(final String triggerId, final String containerId, final List<String> containerContentIds) { AjaxOperation operation = new AjaxOperation(triggerId, containerContentIds); operation.setTargetContainerId(containerId); operation.setAction(AjaxOperation.AjaxAction.REPLACE_CONTENT); registerAjaxOperation(operation); return operation; }
[ "static", "AjaxOperation", "registerContainer", "(", "final", "String", "triggerId", ",", "final", "String", "containerId", ",", "final", "List", "<", "String", ">", "containerContentIds", ")", "{", "AjaxOperation", "operation", "=", "new", "AjaxOperation", "(", "...
This internal method is used to register an arbitrary target container. It must only used by components which contain implicit AJAX capability. @param triggerId the id of the trigger that will cause the component to be painted. @param containerId the target container id. This is not necessarily a WComponent id. @param containerContentIds the container content. @return the AjaxOperation control configuration object.
[ "This", "internal", "method", "is", "used", "to", "register", "an", "arbitrary", "target", "container", ".", "It", "must", "only", "used", "by", "components", "which", "contain", "implicit", "AJAX", "capability", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java#L146-L153
alkacon/opencms-core
src/org/opencms/main/CmsShellCommands.java
CmsShellCommands.createGroup
public CmsGroup createGroup(String name, String description) throws Exception { return m_cms.createGroup(name, description, I_CmsPrincipal.FLAG_ENABLED, null); }
java
public CmsGroup createGroup(String name, String description) throws Exception { return m_cms.createGroup(name, description, I_CmsPrincipal.FLAG_ENABLED, null); }
[ "public", "CmsGroup", "createGroup", "(", "String", "name", ",", "String", "description", ")", "throws", "Exception", "{", "return", "m_cms", ".", "createGroup", "(", "name", ",", "description", ",", "I_CmsPrincipal", ".", "FLAG_ENABLED", ",", "null", ")", ";"...
Creates a group.<p> @param name the name of the new group @param description the description of the new group @return the created group @throws Exception if something goes wrong @see CmsObject#createGroup(String, String, int, String)
[ "Creates", "a", "group", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L352-L355
michael-rapp/AndroidPreferenceActivity
example/src/main/java/de/mrapp/android/preference/activity/example/fragment/BehaviorPreferenceFragment.java
BehaviorPreferenceFragment.createOverrideBackButtonChangeListener
private OnPreferenceChangeListener createOverrideBackButtonChangeListener() { return new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(final Preference preference, final Object newValue) { if (newValue != null) { boolean overrideNavigationIcon = (boolean) newValue; ((PreferenceActivity) getActivity()) .overrideNavigationIcon(overrideNavigationIcon); } return true; } }; }
java
private OnPreferenceChangeListener createOverrideBackButtonChangeListener() { return new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(final Preference preference, final Object newValue) { if (newValue != null) { boolean overrideNavigationIcon = (boolean) newValue; ((PreferenceActivity) getActivity()) .overrideNavigationIcon(overrideNavigationIcon); } return true; } }; }
[ "private", "OnPreferenceChangeListener", "createOverrideBackButtonChangeListener", "(", ")", "{", "return", "new", "OnPreferenceChangeListener", "(", ")", "{", "@", "Override", "public", "boolean", "onPreferenceChange", "(", "final", "Preference", "preference", ",", "fina...
Creates a listener, which allows to adapt the behavior of the {@link PreferenceActivity} when the value, which determines, whether the action bar's back button should be overwritten, has been changed. @return The listener, which has been created, as an instance of the type {@link OnPreferenceChangeListener}
[ "Creates", "a", "listener", "which", "allows", "to", "adapt", "the", "behavior", "of", "the", "{", "@link", "PreferenceActivity", "}", "when", "the", "value", "which", "determines", "whether", "the", "action", "bar", "s", "back", "button", "should", "be", "o...
train
https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/fragment/BehaviorPreferenceFragment.java#L44-L59
openengsb/openengsb
components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java
ManipulationUtils.getFieldGetter
private static CtMethod getFieldGetter(CtField field, CtClass clazz) throws NotFoundException { if (field == null) { return null; } return getFieldGetter(field, clazz, false); }
java
private static CtMethod getFieldGetter(CtField field, CtClass clazz) throws NotFoundException { if (field == null) { return null; } return getFieldGetter(field, clazz, false); }
[ "private", "static", "CtMethod", "getFieldGetter", "(", "CtField", "field", ",", "CtClass", "clazz", ")", "throws", "NotFoundException", "{", "if", "(", "field", "==", "null", ")", "{", "return", "null", ";", "}", "return", "getFieldGetter", "(", "field", ",...
Returns the getter to a given field of the given class object and returns null if there is no getter for the given field defined.
[ "Returns", "the", "getter", "to", "a", "given", "field", "of", "the", "given", "class", "object", "and", "returns", "null", "if", "there", "is", "no", "getter", "for", "the", "given", "field", "defined", "." ]
train
https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/weaver/service/src/main/java/org/openengsb/core/weaver/service/internal/model/ManipulationUtils.java#L435-L440
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/LogGammaDistribution.java
LogGammaDistribution.quantile
public static double quantile(double p, double k, double theta, double shift) { return FastMath.exp(GammaDistribution.quantile(p, k, theta)) + shift; }
java
public static double quantile(double p, double k, double theta, double shift) { return FastMath.exp(GammaDistribution.quantile(p, k, theta)) + shift; }
[ "public", "static", "double", "quantile", "(", "double", "p", ",", "double", "k", ",", "double", "theta", ",", "double", "shift", ")", "{", "return", "FastMath", ".", "exp", "(", "GammaDistribution", ".", "quantile", "(", "p", ",", "k", ",", "theta", "...
Compute probit (inverse cdf) for LogGamma distributions. @param p Probability @param k k, alpha aka. "shape" parameter @param theta Theta = 1.0/Beta aka. "scaling" parameter @param shift Shift parameter @return Probit for Gamma distribution
[ "Compute", "probit", "(", "inverse", "cdf", ")", "for", "LogGamma", "distributions", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/LogGammaDistribution.java#L223-L225
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/config/util/BeanDefinitionParserUtils.java
BeanDefinitionParserUtils.registerBean
public static BeanDefinitionHolder registerBean(String beanId, Class<?> beanClass, ParserContext parserContext, boolean shouldFireEvents) { return registerBean(beanId, BeanDefinitionBuilder.genericBeanDefinition(beanClass).getBeanDefinition(), parserContext, shouldFireEvents); }
java
public static BeanDefinitionHolder registerBean(String beanId, Class<?> beanClass, ParserContext parserContext, boolean shouldFireEvents) { return registerBean(beanId, BeanDefinitionBuilder.genericBeanDefinition(beanClass).getBeanDefinition(), parserContext, shouldFireEvents); }
[ "public", "static", "BeanDefinitionHolder", "registerBean", "(", "String", "beanId", ",", "Class", "<", "?", ">", "beanClass", ",", "ParserContext", "parserContext", ",", "boolean", "shouldFireEvents", ")", "{", "return", "registerBean", "(", "beanId", ",", "BeanD...
Creates new bean definition from bean class and registers new bean in parser registry. Returns bean definition holder. @param beanId @param beanClass @param parserContext @param shouldFireEvents
[ "Creates", "new", "bean", "definition", "from", "bean", "class", "and", "registers", "new", "bean", "in", "parser", "registry", ".", "Returns", "bean", "definition", "holder", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/util/BeanDefinitionParserUtils.java#L118-L120
paypal/SeLion
client/src/main/java/com/paypal/selion/configuration/LocalConfig.java
LocalConfig.printConfigValues
public synchronized void printConfigValues(String testName) { if (baseConfig.isEmpty()) { return; } StringBuilder builder = new StringBuilder(String.format("Configuration for <%s>: {", testName)); boolean isFirst = true; for (ConfigProperty configProperty : ConfigProperty.values()) { if (!isFirst) { builder.append(", "); } String value = getConfigProperty(configProperty); builder.append(String.format("(%s: %s)", configProperty, value)); isFirst = false; } builder.append("}\n"); SeLionLogger.getLogger().info(builder.toString()); }
java
public synchronized void printConfigValues(String testName) { if (baseConfig.isEmpty()) { return; } StringBuilder builder = new StringBuilder(String.format("Configuration for <%s>: {", testName)); boolean isFirst = true; for (ConfigProperty configProperty : ConfigProperty.values()) { if (!isFirst) { builder.append(", "); } String value = getConfigProperty(configProperty); builder.append(String.format("(%s: %s)", configProperty, value)); isFirst = false; } builder.append("}\n"); SeLionLogger.getLogger().info(builder.toString()); }
[ "public", "synchronized", "void", "printConfigValues", "(", "String", "testName", ")", "{", "if", "(", "baseConfig", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", "String", ".", "format"...
Prints the configuration values associated with the LocalConfig. Used for logging/debug. @param testName The &lt;test&gt; to which this configuration pertains to.
[ "Prints", "the", "configuration", "values", "associated", "with", "the", "LocalConfig", ".", "Used", "for", "logging", "/", "debug", "." ]
train
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/configuration/LocalConfig.java#L193-L211
ManfredTremmel/gwt-bean-validators
gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/Assert.java
Assert.notNull
public static void notNull(@Nullable final Object object, final String message) { if (object == null) { throw new IllegalArgumentException(message); } }
java
public static void notNull(@Nullable final Object object, final String message) { if (object == null) { throw new IllegalArgumentException(message); } }
[ "public", "static", "void", "notNull", "(", "@", "Nullable", "final", "Object", "object", ",", "final", "String", "message", ")", "{", "if", "(", "object", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "message", ")", ";", "}", ...
Assert that an object is not {@code null}. <pre class="code"> Assert.notNull(clazz, "The class must not be null"); </pre> @param object the object to check @param message the exception message to use if the assertion fails @throws IllegalArgumentException if the object is {@code null}
[ "Assert", "that", "an", "object", "is", "not", "{", "@code", "null", "}", "." ]
train
https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/Assert.java#L216-L220
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java
AppsImpl.importMethodWithServiceResponseAsync
public Observable<ServiceResponse<UUID>> importMethodWithServiceResponseAsync(LuisApp luisApp, ImportMethodAppsOptionalParameter importMethodOptionalParameter) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (luisApp == null) { throw new IllegalArgumentException("Parameter luisApp is required and cannot be null."); } Validator.validate(luisApp); final String appName = importMethodOptionalParameter != null ? importMethodOptionalParameter.appName() : null; return importMethodWithServiceResponseAsync(luisApp, appName); }
java
public Observable<ServiceResponse<UUID>> importMethodWithServiceResponseAsync(LuisApp luisApp, ImportMethodAppsOptionalParameter importMethodOptionalParameter) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (luisApp == null) { throw new IllegalArgumentException("Parameter luisApp is required and cannot be null."); } Validator.validate(luisApp); final String appName = importMethodOptionalParameter != null ? importMethodOptionalParameter.appName() : null; return importMethodWithServiceResponseAsync(luisApp, appName); }
[ "public", "Observable", "<", "ServiceResponse", "<", "UUID", ">", ">", "importMethodWithServiceResponseAsync", "(", "LuisApp", "luisApp", ",", "ImportMethodAppsOptionalParameter", "importMethodOptionalParameter", ")", "{", "if", "(", "this", ".", "client", ".", "endpoin...
Imports an application to LUIS, the application's structure should be included in in the request body. @param luisApp A LUIS application structure. @param importMethodOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the UUID object
[ "Imports", "an", "application", "to", "LUIS", "the", "application", "s", "structure", "should", "be", "included", "in", "in", "the", "request", "body", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java#L441-L452
groovy/groovy-core
src/main/groovy/lang/Binding.java
Binding.setProperty
public void setProperty(String property, Object newValue) { /** @todo we should check if we have the property with the metaClass instead of try/catch */ try { super.setProperty(property, newValue); } catch (MissingPropertyException e) { setVariable(property, newValue); } }
java
public void setProperty(String property, Object newValue) { /** @todo we should check if we have the property with the metaClass instead of try/catch */ try { super.setProperty(property, newValue); } catch (MissingPropertyException e) { setVariable(property, newValue); } }
[ "public", "void", "setProperty", "(", "String", "property", ",", "Object", "newValue", ")", "{", "/** @todo we should check if we have the property with the metaClass instead of try/catch */", "try", "{", "super", ".", "setProperty", "(", "property", ",", "newValue", ")", ...
Overloaded to make variables appear as bean properties or via the subscript operator
[ "Overloaded", "to", "make", "variables", "appear", "as", "bean", "properties", "or", "via", "the", "subscript", "operator" ]
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/lang/Binding.java#L113-L121
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObjectScope.java
SharedObjectScope.isSendAllowed
protected boolean isSendAllowed(String message, List<?> arguments) { // check internal handlers first for (ISharedObjectSecurity handler : securityHandlers) { if (!handler.isSendAllowed(this, message, arguments)) { return false; } } // check global SO handlers next final Set<ISharedObjectSecurity> handlers = getSecurityHandlers(); if (handlers == null) { return true; } for (ISharedObjectSecurity handler : handlers) { if (!handler.isSendAllowed(this, message, arguments)) { return false; } } return true; }
java
protected boolean isSendAllowed(String message, List<?> arguments) { // check internal handlers first for (ISharedObjectSecurity handler : securityHandlers) { if (!handler.isSendAllowed(this, message, arguments)) { return false; } } // check global SO handlers next final Set<ISharedObjectSecurity> handlers = getSecurityHandlers(); if (handlers == null) { return true; } for (ISharedObjectSecurity handler : handlers) { if (!handler.isSendAllowed(this, message, arguments)) { return false; } } return true; }
[ "protected", "boolean", "isSendAllowed", "(", "String", "message", ",", "List", "<", "?", ">", "arguments", ")", "{", "// check internal handlers first\r", "for", "(", "ISharedObjectSecurity", "handler", ":", "securityHandlers", ")", "{", "if", "(", "!", "handler"...
Call handlers and check if sending a message to the clients connected to the SO is allowed. @param message message @param arguments arguments @return is send allowed
[ "Call", "handlers", "and", "check", "if", "sending", "a", "message", "to", "the", "clients", "connected", "to", "the", "SO", "is", "allowed", "." ]
train
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectScope.java#L585-L603
eyp/serfj
src/main/java/net/sf/serfj/RestController.java
RestController.putParam
protected void putParam(String name, Object object) { this.response.getRequest().setAttribute(name, object); }
java
protected void putParam(String name, Object object) { this.response.getRequest().setAttribute(name, object); }
[ "protected", "void", "putParam", "(", "String", "name", ",", "Object", "object", ")", "{", "this", ".", "response", ".", "getRequest", "(", ")", ".", "setAttribute", "(", "name", ",", "object", ")", ";", "}" ]
Adds an object to the request. If a page will be renderer and it needs some objects to work, with this method a developer can add objects to the request, so the page can obtain them. @param name Parameter name @param object Object to put in the request
[ "Adds", "an", "object", "to", "the", "request", ".", "If", "a", "page", "will", "be", "renderer", "and", "it", "needs", "some", "objects", "to", "work", "with", "this", "method", "a", "developer", "can", "add", "objects", "to", "the", "request", "so", ...
train
https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/RestController.java#L85-L87
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDecoratedLabelRenderer.java
WDecoratedLabelRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WDecoratedLabel label = (WDecoratedLabel) component; XmlStringBuilder xml = renderContext.getWriter(); WComponent head = label.getHead(); WComponent body = label.getBody(); WComponent tail = label.getTail(); xml.appendTagOpen("ui:decoratedlabel"); xml.appendAttribute("id", component.getId()); xml.appendOptionalAttribute("class", component.getHtmlClass()); xml.appendOptionalAttribute("track", component.isTracking(), "true"); xml.appendOptionalAttribute("hidden", label.isHidden(), "true"); xml.appendClose(); if (head != null && head.isVisible()) { xml.appendTagOpen("ui:labelhead"); xml.appendAttribute("id", label.getId() + "-head"); xml.appendClose(); head.paint(renderContext); xml.appendEndTag("ui:labelhead"); } xml.appendTagOpen("ui:labelbody"); xml.appendAttribute("id", label.getId() + "-body"); xml.appendClose(); body.paint(renderContext); xml.appendEndTag("ui:labelbody"); if (tail != null && tail.isVisible()) { xml.appendTagOpen("ui:labeltail"); xml.appendAttribute("id", label.getId() + "-tail"); xml.appendClose(); tail.paint(renderContext); xml.appendEndTag("ui:labeltail"); } xml.appendEndTag("ui:decoratedlabel"); }
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WDecoratedLabel label = (WDecoratedLabel) component; XmlStringBuilder xml = renderContext.getWriter(); WComponent head = label.getHead(); WComponent body = label.getBody(); WComponent tail = label.getTail(); xml.appendTagOpen("ui:decoratedlabel"); xml.appendAttribute("id", component.getId()); xml.appendOptionalAttribute("class", component.getHtmlClass()); xml.appendOptionalAttribute("track", component.isTracking(), "true"); xml.appendOptionalAttribute("hidden", label.isHidden(), "true"); xml.appendClose(); if (head != null && head.isVisible()) { xml.appendTagOpen("ui:labelhead"); xml.appendAttribute("id", label.getId() + "-head"); xml.appendClose(); head.paint(renderContext); xml.appendEndTag("ui:labelhead"); } xml.appendTagOpen("ui:labelbody"); xml.appendAttribute("id", label.getId() + "-body"); xml.appendClose(); body.paint(renderContext); xml.appendEndTag("ui:labelbody"); if (tail != null && tail.isVisible()) { xml.appendTagOpen("ui:labeltail"); xml.appendAttribute("id", label.getId() + "-tail"); xml.appendClose(); tail.paint(renderContext); xml.appendEndTag("ui:labeltail"); } xml.appendEndTag("ui:decoratedlabel"); }
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WDecoratedLabel", "label", "=", "(", "WDecoratedLabel", ")", "component", ";", "XmlStringBuilder", "xml", "=", ...
Paints the given WDecoratedLabel. @param component the WDecoratedLabel to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WDecoratedLabel", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDecoratedLabelRenderer.java#L23-L61
sdl/Testy
src/main/java/com/sdl/selenium/web/WebLocator.java
WebLocator.waitTextToRender
public String waitTextToRender(int seconds, String excludeText) { String text = null; if (seconds == 0 && ((text = getText(true)) != null && text.length() > 0 && !text.equals(excludeText))) { return text; } for (int i = 0, count = 5 * seconds; i < count; i++) { text = getText(true); if (text != null && text.length() > 0 && !text.equals(excludeText)) { return text; } if (i == 0) { // log only fist time LOGGER.debug("waitTextToRender"); } Utils.sleep(200); } LOGGER.warn("No text was found for Element after " + seconds + " sec; " + this); return excludeText.equals(text) ? null : text; }
java
public String waitTextToRender(int seconds, String excludeText) { String text = null; if (seconds == 0 && ((text = getText(true)) != null && text.length() > 0 && !text.equals(excludeText))) { return text; } for (int i = 0, count = 5 * seconds; i < count; i++) { text = getText(true); if (text != null && text.length() > 0 && !text.equals(excludeText)) { return text; } if (i == 0) { // log only fist time LOGGER.debug("waitTextToRender"); } Utils.sleep(200); } LOGGER.warn("No text was found for Element after " + seconds + " sec; " + this); return excludeText.equals(text) ? null : text; }
[ "public", "String", "waitTextToRender", "(", "int", "seconds", ",", "String", "excludeText", ")", "{", "String", "text", "=", "null", ";", "if", "(", "seconds", "==", "0", "&&", "(", "(", "text", "=", "getText", "(", "true", ")", ")", "!=", "null", "...
Waits for the text to be loaded by looking at the content and not take in consideration the excludeText text or what ever text is given as parameter @param seconds time in seconds @param excludeText exclude text @return string
[ "Waits", "for", "the", "text", "to", "be", "loaded", "by", "looking", "at", "the", "content", "and", "not", "take", "in", "consideration", "the", "excludeText", "text", "or", "what", "ever", "text", "is", "given", "as", "parameter" ]
train
https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/web/WebLocator.java#L459-L477
lestard/advanced-bindings
src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java
MathBindings.floorDiv
public static LongBinding floorDiv(final ObservableLongValue x, final long y) { return createLongBinding(() -> Math.floorDiv(x.get(), y), x); }
java
public static LongBinding floorDiv(final ObservableLongValue x, final long y) { return createLongBinding(() -> Math.floorDiv(x.get(), y), x); }
[ "public", "static", "LongBinding", "floorDiv", "(", "final", "ObservableLongValue", "x", ",", "final", "long", "y", ")", "{", "return", "createLongBinding", "(", "(", ")", "->", "Math", ".", "floorDiv", "(", "x", ".", "get", "(", ")", ",", "y", ")", ",...
Binding for {@link java.lang.Math#floorDiv(long, long)} @param x the dividend @param y the divisor @return the largest (closest to positive infinity) {@code long} value that is less than or equal to the algebraic quotient. @throws ArithmeticException if the divisor {@code y} is zero
[ "Binding", "for", "{", "@link", "java", ".", "lang", ".", "Math#floorDiv", "(", "long", "long", ")", "}" ]
train
https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java#L480-L482
zeroturnaround/zt-zip
src/main/java/org/zeroturnaround/zip/ZipUtil.java
ZipUtil.transformEntry
public static boolean transformEntry(final File zip, final String path, final ZipEntryTransformer transformer) { return operateInPlace(zip, new InPlaceAction() { public boolean act(File tmpFile) { return transformEntry(zip, path, transformer, tmpFile); } }); }
java
public static boolean transformEntry(final File zip, final String path, final ZipEntryTransformer transformer) { return operateInPlace(zip, new InPlaceAction() { public boolean act(File tmpFile) { return transformEntry(zip, path, transformer, tmpFile); } }); }
[ "public", "static", "boolean", "transformEntry", "(", "final", "File", "zip", ",", "final", "String", "path", ",", "final", "ZipEntryTransformer", "transformer", ")", "{", "return", "operateInPlace", "(", "zip", ",", "new", "InPlaceAction", "(", ")", "{", "pub...
Changes an existing ZIP file: transforms a given entry in it. @param zip an existing ZIP file (only read). @param path new ZIP entry path. @param transformer transformer for the given ZIP entry. @return <code>true</code> if the entry was replaced.
[ "Changes", "an", "existing", "ZIP", "file", ":", "transforms", "a", "given", "entry", "in", "it", "." ]
train
https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2794-L2800
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java
SARLEclipsePlugin.logDebugMessage
@SuppressWarnings({"static-method", "checkstyle:regexp"}) public void logDebugMessage(String message, Throwable cause) { Debug.println(message); if (cause != null) { Debug.printStackTrace(cause); } }
java
@SuppressWarnings({"static-method", "checkstyle:regexp"}) public void logDebugMessage(String message, Throwable cause) { Debug.println(message); if (cause != null) { Debug.printStackTrace(cause); } }
[ "@", "SuppressWarnings", "(", "{", "\"static-method\"", ",", "\"checkstyle:regexp\"", "}", ")", "public", "void", "logDebugMessage", "(", "String", "message", ",", "Throwable", "cause", ")", "{", "Debug", ".", "println", "(", "message", ")", ";", "if", "(", ...
Logs an internal debug message with the specified message. @param message the debug message to log @param cause the cause of the message log.
[ "Logs", "an", "internal", "debug", "message", "with", "the", "specified", "message", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/SARLEclipsePlugin.java#L316-L322
Azure/azure-sdk-for-java
sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentScansInner.java
ManagedDatabaseVulnerabilityAssessmentScansInner.beginInitiateScanAsync
public Observable<Void> beginInitiateScanAsync(String resourceGroupName, String managedInstanceName, String databaseName, String scanId) { return beginInitiateScanWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, scanId).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
java
public Observable<Void> beginInitiateScanAsync(String resourceGroupName, String managedInstanceName, String databaseName, String scanId) { return beginInitiateScanWithServiceResponseAsync(resourceGroupName, managedInstanceName, databaseName, scanId).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
[ "public", "Observable", "<", "Void", ">", "beginInitiateScanAsync", "(", "String", "resourceGroupName", ",", "String", "managedInstanceName", ",", "String", "databaseName", ",", "String", "scanId", ")", "{", "return", "beginInitiateScanWithServiceResponseAsync", "(", "r...
Executes a Vulnerability Assessment database scan. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param managedInstanceName The name of the managed instance. @param databaseName The name of the database. @param scanId The vulnerability assessment scan Id of the scan to retrieve. @throws IllegalArgumentException thrown if parameters fail the validation @return the {@link ServiceResponse} object if successful.
[ "Executes", "a", "Vulnerability", "Assessment", "database", "scan", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/ManagedDatabaseVulnerabilityAssessmentScansInner.java#L443-L450
aws/aws-sdk-java
aws-java-sdk-securityhub/src/main/java/com/amazonaws/services/securityhub/model/StandardsSubscription.java
StandardsSubscription.withStandardsInput
public StandardsSubscription withStandardsInput(java.util.Map<String, String> standardsInput) { setStandardsInput(standardsInput); return this; }
java
public StandardsSubscription withStandardsInput(java.util.Map<String, String> standardsInput) { setStandardsInput(standardsInput); return this; }
[ "public", "StandardsSubscription", "withStandardsInput", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "standardsInput", ")", "{", "setStandardsInput", "(", "standardsInput", ")", ";", "return", "this", ";", "}" ]
<p/> @param standardsInput @return Returns a reference to this object so that method calls can be chained together.
[ "<p", "/", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-securityhub/src/main/java/com/amazonaws/services/securityhub/model/StandardsSubscription.java#L209-L212
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.getAt
@SuppressWarnings("unchecked") public static List<Short> getAt(short[] array, Range range) { return primitiveArrayGet(array, range); }
java
@SuppressWarnings("unchecked") public static List<Short> getAt(short[] array, Range range) { return primitiveArrayGet(array, range); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "List", "<", "Short", ">", "getAt", "(", "short", "[", "]", "array", ",", "Range", "range", ")", "{", "return", "primitiveArrayGet", "(", "array", ",", "range", ")", ";", "}" ]
Support the subscript operator with a range for a short array @param array a short array @param range a range indicating the indices for the items to retrieve @return list of the retrieved shorts @since 1.0
[ "Support", "the", "subscript", "operator", "with", "a", "range", "for", "a", "short", "array" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L13636-L13639
wanglinsong/thx-android
uia-client/src/main/java/com/android/uiautomator/stub/UiSelector.java
UiSelector.buildSelector
private UiSelector buildSelector(int selectorId, Object selectorValue) { if (selectorId == SELECTOR_CHILD || selectorId == SELECTOR_PARENT) { throw new UnsupportedOperationException(); // selector.getLastSubSelector().mSelectorAttributes.put(selectorId, selectorValue); } else { this.mSelectorAttributes.put(selectorId, selectorValue); } return this; }
java
private UiSelector buildSelector(int selectorId, Object selectorValue) { if (selectorId == SELECTOR_CHILD || selectorId == SELECTOR_PARENT) { throw new UnsupportedOperationException(); // selector.getLastSubSelector().mSelectorAttributes.put(selectorId, selectorValue); } else { this.mSelectorAttributes.put(selectorId, selectorValue); } return this; }
[ "private", "UiSelector", "buildSelector", "(", "int", "selectorId", ",", "Object", "selectorValue", ")", "{", "if", "(", "selectorId", "==", "SELECTOR_CHILD", "||", "selectorId", "==", "SELECTOR_PARENT", ")", "{", "throw", "new", "UnsupportedOperationException", "("...
Building a UiSelector always returns a new UiSelector and never modifies the existing UiSelector being used.
[ "Building", "a", "UiSelector", "always", "returns", "a", "new", "UiSelector", "and", "never", "modifies", "the", "existing", "UiSelector", "being", "used", "." ]
train
https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/UiSelector.java#L649-L657
adorsys/hbci4java-adorsys
src/main/java/org/kapott/hbci/GV/SepaUtil.java
SepaUtil.sumBtgValueObject
public static Value sumBtgValueObject(HashMap<String, String> properties) { Integer maxIndex = maxIndex(properties); BigDecimal btg = sumBtgValue(properties, maxIndex); String curr = properties.get(insertIndex("btg.curr", maxIndex == null ? null : 0)); return new Value(btg, curr); }
java
public static Value sumBtgValueObject(HashMap<String, String> properties) { Integer maxIndex = maxIndex(properties); BigDecimal btg = sumBtgValue(properties, maxIndex); String curr = properties.get(insertIndex("btg.curr", maxIndex == null ? null : 0)); return new Value(btg, curr); }
[ "public", "static", "Value", "sumBtgValueObject", "(", "HashMap", "<", "String", ",", "String", ">", "properties", ")", "{", "Integer", "maxIndex", "=", "maxIndex", "(", "properties", ")", ";", "BigDecimal", "btg", "=", "sumBtgValue", "(", "properties", ",", ...
Liefert ein Value-Objekt mit den Summen des Auftrages. @param properties Auftrags-Properties. @return das Value-Objekt mit der Summe.
[ "Liefert", "ein", "Value", "-", "Objekt", "mit", "den", "Summen", "des", "Auftrages", "." ]
train
https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/SepaUtil.java#L171-L176
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/socks/Proxy.java
Proxy.setDefaultProxy
public static void setDefaultProxy(String hostName,int port,String user) throws UnknownHostException{ defaultProxy = new Socks4Proxy(hostName,port,user); }
java
public static void setDefaultProxy(String hostName,int port,String user) throws UnknownHostException{ defaultProxy = new Socks4Proxy(hostName,port,user); }
[ "public", "static", "void", "setDefaultProxy", "(", "String", "hostName", ",", "int", "port", ",", "String", "user", ")", "throws", "UnknownHostException", "{", "defaultProxy", "=", "new", "Socks4Proxy", "(", "hostName", ",", "port", ",", "user", ")", ";", "...
Sets SOCKS4 proxy as default. @param hostName Host name on which SOCKS4 server is running. @param port Port on which SOCKS4 server is running. @param user Username to use for communications with proxy.
[ "Sets", "SOCKS4", "proxy", "as", "default", "." ]
train
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/socks/Proxy.java#L205-L208
jbundle/jbundle
base/remote/src/main/java/org/jbundle/base/remote/proxy/BaseHolder.java
BaseHolder.doProcess
public void doProcess(InputStream in, PrintWriter out, Map<String, Object> properties) throws RemoteException { Utility.getLogger().warning("Command not handled: " + this.getProperty(REMOTE_COMMAND, properties)); }
java
public void doProcess(InputStream in, PrintWriter out, Map<String, Object> properties) throws RemoteException { Utility.getLogger().warning("Command not handled: " + this.getProperty(REMOTE_COMMAND, properties)); }
[ "public", "void", "doProcess", "(", "InputStream", "in", ",", "PrintWriter", "out", ",", "Map", "<", "String", ",", "Object", ">", "properties", ")", "throws", "RemoteException", "{", "Utility", ".", "getLogger", "(", ")", ".", "warning", "(", "\"Command not...
Handle the command send from my client peer. @param in The (optional) Inputstream to get the params from. @param out The stream to write the results. @param properties Temporary session properties.
[ "Handle", "the", "command", "send", "from", "my", "client", "peer", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/proxy/BaseHolder.java#L111-L115
redisson/redisson
redisson/src/main/java/org/redisson/api/CronSchedule.java
CronSchedule.weeklyOnDayAndHourAndMinute
public static CronSchedule weeklyOnDayAndHourAndMinute(int hour, int minute, Integer... daysOfWeek) { if (daysOfWeek == null || daysOfWeek.length == 0) { throw new IllegalArgumentException("You must specify at least one day of week."); } String expression = String.format("0 %d %d ? * %d", minute, hour, daysOfWeek[0]); for (int i = 1; i < daysOfWeek.length; i++) { expression = expression + "," + daysOfWeek[i]; } return of(expression); }
java
public static CronSchedule weeklyOnDayAndHourAndMinute(int hour, int minute, Integer... daysOfWeek) { if (daysOfWeek == null || daysOfWeek.length == 0) { throw new IllegalArgumentException("You must specify at least one day of week."); } String expression = String.format("0 %d %d ? * %d", minute, hour, daysOfWeek[0]); for (int i = 1; i < daysOfWeek.length; i++) { expression = expression + "," + daysOfWeek[i]; } return of(expression); }
[ "public", "static", "CronSchedule", "weeklyOnDayAndHourAndMinute", "(", "int", "hour", ",", "int", "minute", ",", "Integer", "...", "daysOfWeek", ")", "{", "if", "(", "daysOfWeek", "==", "null", "||", "daysOfWeek", ".", "length", "==", "0", ")", "{", "throw"...
Creates cron expression which schedule task execution every given days of the week at the given time. Use Calendar object constants to define day. @param hour of schedule @param minute of schedule @param daysOfWeek - Calendar object constants @return object
[ "Creates", "cron", "expression", "which", "schedule", "task", "execution", "every", "given", "days", "of", "the", "week", "at", "the", "given", "time", ".", "Use", "Calendar", "object", "constants", "to", "define", "day", "." ]
train
https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/api/CronSchedule.java#L75-L86
trustathsh/ifmapj
src/main/java/util/CanonicalXML.java
CanonicalXML.toCanonicalXml3
public String toCanonicalXml3(TransformerFactory factory, XMLReader resultParser, String inxml, boolean stripSpace) throws Exception { mStrip = stripSpace; mOut = new StringWriter(); Transformer t = factory.newTransformer(); SAXSource ss = new SAXSource(resultParser, new InputSource(new StringReader(inxml))); ss.setSystemId("http://localhost/string-input"); t.setOutputProperty(OutputKeys.METHOD, "xml"); t.setOutputProperty(OutputKeys.INDENT, "no"); t.transform(ss, new SAXResult(this)); return mOut.toString(); }
java
public String toCanonicalXml3(TransformerFactory factory, XMLReader resultParser, String inxml, boolean stripSpace) throws Exception { mStrip = stripSpace; mOut = new StringWriter(); Transformer t = factory.newTransformer(); SAXSource ss = new SAXSource(resultParser, new InputSource(new StringReader(inxml))); ss.setSystemId("http://localhost/string-input"); t.setOutputProperty(OutputKeys.METHOD, "xml"); t.setOutputProperty(OutputKeys.INDENT, "no"); t.transform(ss, new SAXResult(this)); return mOut.toString(); }
[ "public", "String", "toCanonicalXml3", "(", "TransformerFactory", "factory", ",", "XMLReader", "resultParser", ",", "String", "inxml", ",", "boolean", "stripSpace", ")", "throws", "Exception", "{", "mStrip", "=", "stripSpace", ";", "mOut", "=", "new", "StringWrite...
Create canonical XML silently, throwing exceptions rather than displaying messages. This version of the method uses the Saxon identityTransformer rather than parsing directly, because for some reason we seem to be able to get XML 1.1 to work this way.
[ "Create", "canonical", "XML", "silently", "throwing", "exceptions", "rather", "than", "displaying", "messages", ".", "This", "version", "of", "the", "method", "uses", "the", "Saxon", "identityTransformer", "rather", "than", "parsing", "directly", "because", "for", ...
train
https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/util/CanonicalXML.java#L147-L158
btrplace/scheduler
api/src/main/java/org/btrplace/model/view/NamingService.java
NamingService.substituteVM
@Override public boolean substituteVM(VM curId, VM nextId) { if (VM.TYPE.equals(elemId)) { if (rev.containsKey(nextId)) { //the new id already exists. It is a failure scenario. return false; } String fqn = rev.remove(curId); if (fqn != null) { //new resolution, with the substitution of the old one. rev.put((E) nextId, fqn); resolve.put(fqn, (E) nextId); } } return true; }
java
@Override public boolean substituteVM(VM curId, VM nextId) { if (VM.TYPE.equals(elemId)) { if (rev.containsKey(nextId)) { //the new id already exists. It is a failure scenario. return false; } String fqn = rev.remove(curId); if (fqn != null) { //new resolution, with the substitution of the old one. rev.put((E) nextId, fqn); resolve.put(fqn, (E) nextId); } } return true; }
[ "@", "Override", "public", "boolean", "substituteVM", "(", "VM", "curId", ",", "VM", "nextId", ")", "{", "if", "(", "VM", ".", "TYPE", ".", "equals", "(", "elemId", ")", ")", "{", "if", "(", "rev", ".", "containsKey", "(", "nextId", ")", ")", "{", ...
Re-associate the name of a registered VM to a new VM. @param curId the current VM identifier @param nextId the new VM identifier @return {@code true} if the re-association succeeded or if there is no VM {@code curId} registered. {@code false} if {@code nextId} is already associated to a name
[ "Re", "-", "associate", "the", "name", "of", "a", "registered", "VM", "to", "a", "new", "VM", "." ]
train
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/NamingService.java#L130-L146
aws/aws-sdk-java
aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/model/DocumentVersionMetadata.java
DocumentVersionMetadata.withThumbnail
public DocumentVersionMetadata withThumbnail(java.util.Map<String, String> thumbnail) { setThumbnail(thumbnail); return this; }
java
public DocumentVersionMetadata withThumbnail(java.util.Map<String, String> thumbnail) { setThumbnail(thumbnail); return this; }
[ "public", "DocumentVersionMetadata", "withThumbnail", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "thumbnail", ")", "{", "setThumbnail", "(", "thumbnail", ")", ";", "return", "this", ";", "}" ]
<p> The thumbnail of the document. </p> @param thumbnail The thumbnail of the document. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "The", "thumbnail", "of", "the", "document", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-workdocs/src/main/java/com/amazonaws/services/workdocs/model/DocumentVersionMetadata.java#L618-L621
jbundle/jbundle
thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/menu/JBaseMenuScreen.java
JBaseMenuScreen.makeMenuButton
public JComponent makeMenuButton(FieldList record) { String strDescription = this.getMenuName(record); String strLink = this.getMenuLink(record); String strIcon = this.getMenuIcon(record); strIcon = Util.getImageFilename(strIcon, "icons"); JUnderlinedButton button = null; if (strIcon == null) button = new JUnderlinedButton(strDescription); else { Icon icon = BaseApplet.getSharedInstance().loadImageIcon(strIcon, "Icon"); button = new JUnderlinedButton(strDescription, icon); } button.setName(strLink); button.setOpaque(false); String strBackgroundColor = this.getBaseApplet().getProperty(Params.BACKGROUNDCOLOR); Color colorBackground = null; if ((strBackgroundColor != null) && (strBackgroundColor.length() > 0)) colorBackground = BaseApplet.nameToColor(strBackgroundColor); if (colorBackground == null) colorBackground = Color.white; button.setBackground(colorBackground); // Since the button is opaque, this is only needed for those look and feels that want their own background color. button.setBorderPainted(false); button.addActionListener(this); return button; }
java
public JComponent makeMenuButton(FieldList record) { String strDescription = this.getMenuName(record); String strLink = this.getMenuLink(record); String strIcon = this.getMenuIcon(record); strIcon = Util.getImageFilename(strIcon, "icons"); JUnderlinedButton button = null; if (strIcon == null) button = new JUnderlinedButton(strDescription); else { Icon icon = BaseApplet.getSharedInstance().loadImageIcon(strIcon, "Icon"); button = new JUnderlinedButton(strDescription, icon); } button.setName(strLink); button.setOpaque(false); String strBackgroundColor = this.getBaseApplet().getProperty(Params.BACKGROUNDCOLOR); Color colorBackground = null; if ((strBackgroundColor != null) && (strBackgroundColor.length() > 0)) colorBackground = BaseApplet.nameToColor(strBackgroundColor); if (colorBackground == null) colorBackground = Color.white; button.setBackground(colorBackground); // Since the button is opaque, this is only needed for those look and feels that want their own background color. button.setBorderPainted(false); button.addActionListener(this); return button; }
[ "public", "JComponent", "makeMenuButton", "(", "FieldList", "record", ")", "{", "String", "strDescription", "=", "this", ".", "getMenuName", "(", "record", ")", ";", "String", "strLink", "=", "this", ".", "getMenuLink", "(", "record", ")", ";", "String", "st...
Create the button/panel for this menu item. @param record The menu record. @return The component to add to this panel.
[ "Create", "the", "button", "/", "panel", "for", "this", "menu", "item", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/menu/JBaseMenuScreen.java#L227-L255
resilience4j/resilience4j
resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/BulkheadExports.java
BulkheadExports.ofBulkhead
public static BulkheadExports ofBulkhead(String prefix, Bulkhead bulkhead) { return new BulkheadExports(prefix, Array.of(bulkhead)); }
java
public static BulkheadExports ofBulkhead(String prefix, Bulkhead bulkhead) { return new BulkheadExports(prefix, Array.of(bulkhead)); }
[ "public", "static", "BulkheadExports", "ofBulkhead", "(", "String", "prefix", ",", "Bulkhead", "bulkhead", ")", "{", "return", "new", "BulkheadExports", "(", "prefix", ",", "Array", ".", "of", "(", "bulkhead", ")", ")", ";", "}" ]
Creates a new instance of {@link BulkheadExports} with default metrics names prefix and a bulkhead as a source. @param prefix the prefix of metrics names @param bulkhead the bulkhead
[ "Creates", "a", "new", "instance", "of", "{", "@link", "BulkheadExports", "}", "with", "default", "metrics", "names", "prefix", "and", "a", "bulkhead", "as", "a", "source", "." ]
train
https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/BulkheadExports.java#L129-L131
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/Interpolate1D_F32.java
Interpolate1D_F32.bisectionSearch
protected void bisectionSearch(float val, int lowerLimit, int upperLimit) { while (upperLimit - lowerLimit > 1) { int middle = (upperLimit + lowerLimit) / 2; if (val >= x[middle] && ascend) { lowerLimit = middle; } else { upperLimit = middle; } } // decide if it should hunt or locate next time doHunt = Math.abs(lowerLimit - center) > dj; // make sure the points sampled for the polynomial are all within bounds center = lowerLimit; index0 = center - M / 2; if (index0 + M > size) { index0 = size - M; } else if (index0 < 0) { index0 = 0; } }
java
protected void bisectionSearch(float val, int lowerLimit, int upperLimit) { while (upperLimit - lowerLimit > 1) { int middle = (upperLimit + lowerLimit) / 2; if (val >= x[middle] && ascend) { lowerLimit = middle; } else { upperLimit = middle; } } // decide if it should hunt or locate next time doHunt = Math.abs(lowerLimit - center) > dj; // make sure the points sampled for the polynomial are all within bounds center = lowerLimit; index0 = center - M / 2; if (index0 + M > size) { index0 = size - M; } else if (index0 < 0) { index0 = 0; } }
[ "protected", "void", "bisectionSearch", "(", "float", "val", ",", "int", "lowerLimit", ",", "int", "upperLimit", ")", "{", "while", "(", "upperLimit", "-", "lowerLimit", ">", "1", ")", "{", "int", "middle", "=", "(", "upperLimit", "+", "lowerLimit", ")", ...
Searches the x array by bisecting it. This takes advantage of the data being monotonic. This finds a center index which has the following property: x[center] &le; val &lt; x[center+1] From that it selects index0 which is center - M/2. @param val The value that is to be interpolated. @param lowerLimit Lower limit for x index. @param upperLimit The largest possible index of x
[ "Searches", "the", "x", "array", "by", "bisecting", "it", ".", "This", "takes", "advantage", "of", "the", "data", "being", "monotonic", ".", "This", "finds", "a", "center", "index", "which", "has", "the", "following", "property", ":", "x", "[", "center", ...
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/interpolate/array/Interpolate1D_F32.java#L200-L221
aws/aws-sdk-java
aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/CreateTaskSetRequest.java
CreateTaskSetRequest.getServiceRegistries
public java.util.List<ServiceRegistry> getServiceRegistries() { if (serviceRegistries == null) { serviceRegistries = new com.amazonaws.internal.SdkInternalList<ServiceRegistry>(); } return serviceRegistries; }
java
public java.util.List<ServiceRegistry> getServiceRegistries() { if (serviceRegistries == null) { serviceRegistries = new com.amazonaws.internal.SdkInternalList<ServiceRegistry>(); } return serviceRegistries; }
[ "public", "java", ".", "util", ".", "List", "<", "ServiceRegistry", ">", "getServiceRegistries", "(", ")", "{", "if", "(", "serviceRegistries", "==", "null", ")", "{", "serviceRegistries", "=", "new", "com", ".", "amazonaws", ".", "internal", ".", "SdkIntern...
<p> The details of the service discovery registries to assign to this task set. For more information, see <a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html">Service Discovery</a>. </p> @return The details of the service discovery registries to assign to this task set. For more information, see <a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html">Service Discovery</a>.
[ "<p", ">", "The", "details", "of", "the", "service", "discovery", "registries", "to", "assign", "to", "this", "task", "set", ".", "For", "more", "information", "see", "<a", "href", "=", "http", ":", "//", "docs", ".", "aws", ".", "amazon", ".", "com", ...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/CreateTaskSetRequest.java#L393-L398
gallandarakhneorg/afc
advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/dfx/GeomFactory3dfx.java
GeomFactory3dfx.newPoint
@SuppressWarnings("static-method") public Point3dfx newPoint(DoubleProperty x, DoubleProperty y, DoubleProperty z) { return new Point3dfx(x, y, z); }
java
@SuppressWarnings("static-method") public Point3dfx newPoint(DoubleProperty x, DoubleProperty y, DoubleProperty z) { return new Point3dfx(x, y, z); }
[ "@", "SuppressWarnings", "(", "\"static-method\"", ")", "public", "Point3dfx", "newPoint", "(", "DoubleProperty", "x", ",", "DoubleProperty", "y", ",", "DoubleProperty", "z", ")", "{", "return", "new", "Point3dfx", "(", "x", ",", "y", ",", "z", ")", ";", "...
Create a point with properties. @param x the x property. @param y the y property. @param z the z property. @return the vector.
[ "Create", "a", "point", "with", "properties", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/dfx/GeomFactory3dfx.java#L116-L119
joniles/mpxj
src/main/java/net/sf/mpxj/Task.java
Task.setBaselineFinishText
public void setBaselineFinishText(int baselineNumber, String value) { set(selectField(TaskFieldLists.BASELINE_FINISHES, baselineNumber), value); }
java
public void setBaselineFinishText(int baselineNumber, String value) { set(selectField(TaskFieldLists.BASELINE_FINISHES, baselineNumber), value); }
[ "public", "void", "setBaselineFinishText", "(", "int", "baselineNumber", ",", "String", "value", ")", "{", "set", "(", "selectField", "(", "TaskFieldLists", ".", "BASELINE_FINISHES", ",", "baselineNumber", ")", ",", "value", ")", ";", "}" ]
Sets the baseline finish text value. @param baselineNumber baseline number @param value baseline finish text value
[ "Sets", "the", "baseline", "finish", "text", "value", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4141-L4144
f2prateek/dart
henson/src/main/java/dart/henson/Bundler.java
Bundler.put
public Bundler put(String key, CharSequence[] value) { delegate.putCharSequenceArray(key, value); return this; }
java
public Bundler put(String key, CharSequence[] value) { delegate.putCharSequenceArray(key, value); return this; }
[ "public", "Bundler", "put", "(", "String", "key", ",", "CharSequence", "[", "]", "value", ")", "{", "delegate", ".", "putCharSequenceArray", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Inserts a CharSequence array 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 a CharSequence array object, or null @return this bundler instance to chain method calls
[ "Inserts", "a", "CharSequence", "array", "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#L296-L299
google/closure-templates
java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java
JavaQualifiedNames.getQualifiedName
public static String getQualifiedName(Descriptors.Descriptor msg, ProtoFlavor flavor) { return getClassName(msg, flavor).replace('$', '.'); }
java
public static String getQualifiedName(Descriptors.Descriptor msg, ProtoFlavor flavor) { return getClassName(msg, flavor).replace('$', '.'); }
[ "public", "static", "String", "getQualifiedName", "(", "Descriptors", ".", "Descriptor", "msg", ",", "ProtoFlavor", "flavor", ")", "{", "return", "getClassName", "(", "msg", ",", "flavor", ")", ".", "replace", "(", "'", "'", ",", "'", "'", ")", ";", "}" ...
Returns the fully-qualified name for the message descriptor with the given flavor (uses '.' inner class seperator).
[ "Returns", "the", "fully", "-", "qualified", "name", "for", "the", "message", "descriptor", "with", "the", "given", "flavor", "(", "uses", ".", "inner", "class", "seperator", ")", "." ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java#L70-L72
Coveros/selenified
src/main/java/com/coveros/selenified/application/App.java
App.isNotPrompt
private boolean isNotPrompt(String action, String expected, String perform) { // wait for element to be present if (!is.promptPresent()) { waitFor.promptPresent(); } if (!is.promptPresent()) { reporter.fail(action, expected, "Unable to " + perform + " prompt as it is not present"); return true; // indicates element not present } return false; }
java
private boolean isNotPrompt(String action, String expected, String perform) { // wait for element to be present if (!is.promptPresent()) { waitFor.promptPresent(); } if (!is.promptPresent()) { reporter.fail(action, expected, "Unable to " + perform + " prompt as it is not present"); return true; // indicates element not present } return false; }
[ "private", "boolean", "isNotPrompt", "(", "String", "action", ",", "String", "expected", ",", "String", "perform", ")", "{", "// wait for element to be present", "if", "(", "!", "is", ".", "promptPresent", "(", ")", ")", "{", "waitFor", ".", "promptPresent", "...
Determines if a prompt is present or not, and can be interacted with. If it's not present, an indication that the confirmation can't be clicked on is written to the log file @param action - the action occurring @param expected - the expected result @param perform - the action occurring to the prompt @return Boolean: is a prompt actually present or not.
[ "Determines", "if", "a", "prompt", "is", "present", "or", "not", "and", "can", "be", "interacted", "with", ".", "If", "it", "s", "not", "present", "an", "indication", "that", "the", "confirmation", "can", "t", "be", "clicked", "on", "is", "written", "to"...
train
https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/App.java#L831-L841
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementUI.java
ElementUI.afterMoveChild
@Override protected void afterMoveChild(ElementBase child, ElementBase before) { moveChild(((ElementUI) child).getOuterComponent(), ((ElementUI) before).getOuterComponent()); updateMasks(); }
java
@Override protected void afterMoveChild(ElementBase child, ElementBase before) { moveChild(((ElementUI) child).getOuterComponent(), ((ElementUI) before).getOuterComponent()); updateMasks(); }
[ "@", "Override", "protected", "void", "afterMoveChild", "(", "ElementBase", "child", ",", "ElementBase", "before", ")", "{", "moveChild", "(", "(", "(", "ElementUI", ")", "child", ")", ".", "getOuterComponent", "(", ")", ",", "(", "(", "ElementUI", ")", "b...
Element has been moved to a different position under this parent. Adjust wrapped components accordingly. @param child Child element that was moved. @param before Child element was moved before this one.
[ "Element", "has", "been", "moved", "to", "a", "different", "position", "under", "this", "parent", ".", "Adjust", "wrapped", "components", "accordingly", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementUI.java#L506-L510
danidemi/jlubricant
jlubricant-embeddable-hsql/src/main/java/com/danidemi/jlubricant/embeddable/database/utils/DatasourceTemplate.java
DatasourceTemplate.queryForObject
public <T> T queryForObject(String sql, Class<T> requiredType) throws SQLException { return queryForObject(sql, getSingleColumnRowMapper(requiredType)); }
java
public <T> T queryForObject(String sql, Class<T> requiredType) throws SQLException { return queryForObject(sql, getSingleColumnRowMapper(requiredType)); }
[ "public", "<", "T", ">", "T", "queryForObject", "(", "String", "sql", ",", "Class", "<", "T", ">", "requiredType", ")", "throws", "SQLException", "{", "return", "queryForObject", "(", "sql", ",", "getSingleColumnRowMapper", "(", "requiredType", ")", ")", ";"...
Execute a query that returns a single value that can be cast to the given type.
[ "Execute", "a", "query", "that", "returns", "a", "single", "value", "that", "can", "be", "cast", "to", "the", "given", "type", "." ]
train
https://github.com/danidemi/jlubricant/blob/a9937c141c69ec34b768bd603b8093e496329b3a/jlubricant-embeddable-hsql/src/main/java/com/danidemi/jlubricant/embeddable/database/utils/DatasourceTemplate.java#L71-L73
aws/aws-sdk-java
aws-java-sdk-secretsmanager/src/main/java/com/amazonaws/services/secretsmanager/model/SecretListEntry.java
SecretListEntry.setSecretVersionsToStages
public void setSecretVersionsToStages(java.util.Map<String, java.util.List<String>> secretVersionsToStages) { this.secretVersionsToStages = secretVersionsToStages; }
java
public void setSecretVersionsToStages(java.util.Map<String, java.util.List<String>> secretVersionsToStages) { this.secretVersionsToStages = secretVersionsToStages; }
[ "public", "void", "setSecretVersionsToStages", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "java", ".", "util", ".", "List", "<", "String", ">", ">", "secretVersionsToStages", ")", "{", "this", ".", "secretVersionsToStages", "=", "secretVersionsT...
<p> A list of all of the currently assigned <code>SecretVersionStage</code> staging labels and the <code>SecretVersionId</code> that each is attached to. Staging labels are used to keep track of the different versions during the rotation process. </p> <note> <p> A version that does not have any <code>SecretVersionStage</code> is considered deprecated and subject to deletion. Such versions are not included in this list. </p> </note> @param secretVersionsToStages A list of all of the currently assigned <code>SecretVersionStage</code> staging labels and the <code>SecretVersionId</code> that each is attached to. Staging labels are used to keep track of the different versions during the rotation process.</p> <note> <p> A version that does not have any <code>SecretVersionStage</code> is considered deprecated and subject to deletion. Such versions are not included in this list. </p>
[ "<p", ">", "A", "list", "of", "all", "of", "the", "currently", "assigned", "<code", ">", "SecretVersionStage<", "/", "code", ">", "staging", "labels", "and", "the", "<code", ">", "SecretVersionId<", "/", "code", ">", "that", "each", "is", "attached", "to",...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-secretsmanager/src/main/java/com/amazonaws/services/secretsmanager/model/SecretListEntry.java#L794-L796
deeplearning4j/deeplearning4j
datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintManager.java
FingerprintManager.saveFingerprintAsFile
public void saveFingerprintAsFile(byte[] fingerprint, String filename) { FileOutputStream fileOutputStream; try { fileOutputStream = new FileOutputStream(filename); fileOutputStream.write(fingerprint); fileOutputStream.close(); } catch (IOException e) { e.printStackTrace(); } }
java
public void saveFingerprintAsFile(byte[] fingerprint, String filename) { FileOutputStream fileOutputStream; try { fileOutputStream = new FileOutputStream(filename); fileOutputStream.write(fingerprint); fileOutputStream.close(); } catch (IOException e) { e.printStackTrace(); } }
[ "public", "void", "saveFingerprintAsFile", "(", "byte", "[", "]", "fingerprint", ",", "String", "filename", ")", "{", "FileOutputStream", "fileOutputStream", ";", "try", "{", "fileOutputStream", "=", "new", "FileOutputStream", "(", "filename", ")", ";", "fileOutpu...
Save fingerprint to a file @param fingerprint fingerprint bytes @param filename fingerprint filename @see FingerprintManager file saved
[ "Save", "fingerprint", "to", "a", "file" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-audio/src/main/java/org/datavec/audio/fingerprint/FingerprintManager.java#L185-L195
indeedeng/util
util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java
Quicksortables.getQuicksortableIntArray
public static Quicksortable getQuicksortableIntArray(final int [] array) { return new Quicksortable() { public void swap(int i, int j) { int t = array[i]; array[i] = array[j]; array[j] = t; } public int compare(int a, int b) { int x = array[a]; int y = array[b]; if (x < y) return -1; if (x == y) return 0; return 1; } }; }
java
public static Quicksortable getQuicksortableIntArray(final int [] array) { return new Quicksortable() { public void swap(int i, int j) { int t = array[i]; array[i] = array[j]; array[j] = t; } public int compare(int a, int b) { int x = array[a]; int y = array[b]; if (x < y) return -1; if (x == y) return 0; return 1; } }; }
[ "public", "static", "Quicksortable", "getQuicksortableIntArray", "(", "final", "int", "[", "]", "array", ")", "{", "return", "new", "Quicksortable", "(", ")", "{", "public", "void", "swap", "(", "int", "i", ",", "int", "j", ")", "{", "int", "t", "=", "...
the sorting code contained in this class was copied from Arrays.java and then modified
[ "the", "sorting", "code", "contained", "in", "this", "class", "was", "copied", "from", "Arrays", ".", "java", "and", "then", "modified" ]
train
https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java#L15-L30
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java
NetworkInterfacesInner.listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync
public Observable<ServiceResponse<Page<NetworkInterfaceInner>>> listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { return listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) .concatMap(new Func1<ServiceResponse<Page<NetworkInterfaceInner>>, Observable<ServiceResponse<Page<NetworkInterfaceInner>>>>() { @Override public Observable<ServiceResponse<Page<NetworkInterfaceInner>>> call(ServiceResponse<Page<NetworkInterfaceInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); } }); }
java
public Observable<ServiceResponse<Page<NetworkInterfaceInner>>> listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { return listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) .concatMap(new Func1<ServiceResponse<Page<NetworkInterfaceInner>>, Observable<ServiceResponse<Page<NetworkInterfaceInner>>>>() { @Override public Observable<ServiceResponse<Page<NetworkInterfaceInner>>> call(ServiceResponse<Page<NetworkInterfaceInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); } }); }
[ "public", "Observable", "<", "ServiceResponse", "<", "Page", "<", "NetworkInterfaceInner", ">", ">", ">", "listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "virtualMachineScaleSetName", ...
Gets information about all network interfaces in a virtual machine in a virtual machine scale set. @param resourceGroupName The name of the resource group. @param virtualMachineScaleSetName The name of the virtual machine scale set. @param virtualmachineIndex The virtual machine index. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;NetworkInterfaceInner&gt; object
[ "Gets", "information", "about", "all", "network", "interfaces", "in", "a", "virtual", "machine", "in", "a", "virtual", "machine", "scale", "set", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java#L1557-L1569
timols/java-gitlab-api
src/main/java/org/gitlab/api/GitlabAPI.java
GitlabAPI.deleteRepositoryFile
public void deleteRepositoryFile(GitlabProject project, String path, String branchName, String commitMsg) throws IOException { Query query = new Query() .append("branch", branchName) .append("commit_message", commitMsg); String tailUrl = GitlabProject.URL + "/" + project.getId() + "/repository/files/" + sanitizePath(path) + query.toString(); retrieve().method(DELETE).to(tailUrl, Void.class); }
java
public void deleteRepositoryFile(GitlabProject project, String path, String branchName, String commitMsg) throws IOException { Query query = new Query() .append("branch", branchName) .append("commit_message", commitMsg); String tailUrl = GitlabProject.URL + "/" + project.getId() + "/repository/files/" + sanitizePath(path) + query.toString(); retrieve().method(DELETE).to(tailUrl, Void.class); }
[ "public", "void", "deleteRepositoryFile", "(", "GitlabProject", "project", ",", "String", "path", ",", "String", "branchName", ",", "String", "commitMsg", ")", "throws", "IOException", "{", "Query", "query", "=", "new", "Query", "(", ")", ".", "append", "(", ...
Deletes an existing file in the repository @param project The Project @param path The file path inside the repository @param branchName The name of a repository branch @param commitMsg The commit message @throws IOException on gitlab api call error
[ "Deletes", "an", "existing", "file", "in", "the", "repository" ]
train
https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L2250-L2256
alkacon/opencms-core
src-gwt/org/opencms/ade/galleries/client/CmsGalleryControllerHandler.java
CmsGalleryControllerHandler.setTypesTabContent
public void setTypesTabContent(List<CmsResourceTypeBean> typeInfos, List<String> selectedTypes) { m_galleryDialog.getTypesTab().fillContent(typeInfos, selectedTypes); }
java
public void setTypesTabContent(List<CmsResourceTypeBean> typeInfos, List<String> selectedTypes) { m_galleryDialog.getTypesTab().fillContent(typeInfos, selectedTypes); }
[ "public", "void", "setTypesTabContent", "(", "List", "<", "CmsResourceTypeBean", ">", "typeInfos", ",", "List", "<", "String", ">", "selectedTypes", ")", "{", "m_galleryDialog", ".", "getTypesTab", "(", ")", ".", "fillContent", "(", "typeInfos", ",", "selectedTy...
Sets the list content of the types tab.<p> @param typeInfos the type info beans @param selectedTypes the selected types
[ "Sets", "the", "list", "content", "of", "the", "types", "tab", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsGalleryControllerHandler.java#L460-L463
enriquedacostacambio/iotake-suller
iotake-sullerj/src/main/java/com/iotake/suller/sullerj/binder/server/DocumentBinderInjector.java
DocumentBinderInjector.inject
public static SolrServer inject(SolrServer server, DocumentObjectBinder binder) { checkNotNull(server, "Server cannot be null."); checkNotNull(binder, "Binder cannot be null."); Field binderField; try { binderField = SolrServer.class.getDeclaredField(BINDER_FIELD_NAME); binderField.setAccessible(true); binderField.set(server, binder); } catch (NoSuchFieldException e) { throw new UnsupportedOperationException( "Impossible to set binder. Field not present in server. New Solr version?", e); } catch (SecurityException e) { throw new UnsupportedOperationException( "Not allowed to set server's binder field.", e); } catch (IllegalAccessException e) { throw new UnsupportedOperationException( "Cannot access server's binder field.", e); } return server; }
java
public static SolrServer inject(SolrServer server, DocumentObjectBinder binder) { checkNotNull(server, "Server cannot be null."); checkNotNull(binder, "Binder cannot be null."); Field binderField; try { binderField = SolrServer.class.getDeclaredField(BINDER_FIELD_NAME); binderField.setAccessible(true); binderField.set(server, binder); } catch (NoSuchFieldException e) { throw new UnsupportedOperationException( "Impossible to set binder. Field not present in server. New Solr version?", e); } catch (SecurityException e) { throw new UnsupportedOperationException( "Not allowed to set server's binder field.", e); } catch (IllegalAccessException e) { throw new UnsupportedOperationException( "Cannot access server's binder field.", e); } return server; }
[ "public", "static", "SolrServer", "inject", "(", "SolrServer", "server", ",", "DocumentObjectBinder", "binder", ")", "{", "checkNotNull", "(", "server", ",", "\"Server cannot be null.\"", ")", ";", "checkNotNull", "(", "binder", ",", "\"Binder cannot be null.\"", ")",...
Sets the given binder to the given server's {@link SolrServer#binder} @param server The server to be altered. Cannot be null. @param binder The binder to be set. Cannot be null. @return the server. @throws IllegalArgumentException if server or binder are null. @throws UnsupportedOperationException if unable to find, access or set the field.
[ "Sets", "the", "given", "binder", "to", "the", "given", "server", "s", "{", "@link", "SolrServer#binder", "}" ]
train
https://github.com/enriquedacostacambio/iotake-suller/blob/d2af5c23207013107823892e0c586d455bf62a6a/iotake-sullerj/src/main/java/com/iotake/suller/sullerj/binder/server/DocumentBinderInjector.java#L53-L73
wnameless/rubycollect4j
src/main/java/net/sf/rubycollect4j/util/ByteUtils.java
ByteUtils.fromHexString
public static byte[] fromHexString(String hexStr) { if (!hexStr.matches("^[0-9A-Fa-f]*$")) throw new IllegalArgumentException("Invalid hexadecimal string"); if (hexStr.isEmpty()) return new byte[0]; int complementary = hexStr.length() % 2; if (complementary != 0) hexStr += "0"; return rjust(new BigInteger(hexStr, 16).toByteArray(), hexStr.length() / 2); }
java
public static byte[] fromHexString(String hexStr) { if (!hexStr.matches("^[0-9A-Fa-f]*$")) throw new IllegalArgumentException("Invalid hexadecimal string"); if (hexStr.isEmpty()) return new byte[0]; int complementary = hexStr.length() % 2; if (complementary != 0) hexStr += "0"; return rjust(new BigInteger(hexStr, 16).toByteArray(), hexStr.length() / 2); }
[ "public", "static", "byte", "[", "]", "fromHexString", "(", "String", "hexStr", ")", "{", "if", "(", "!", "hexStr", ".", "matches", "(", "\"^[0-9A-Fa-f]*$\"", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"Invalid hexadecimal string\"", ")", ";", ...
Converts a hexadecimal string into byte array. @param hexStr a hexadecimal string @return byte array @throws IllegalArgumentException if hexadecimal string is invalid
[ "Converts", "a", "hexadecimal", "string", "into", "byte", "array", "." ]
train
https://github.com/wnameless/rubycollect4j/blob/b8b8d8eccaca2254a3d09b91745882fb7a0d5add/src/main/java/net/sf/rubycollect4j/util/ByteUtils.java#L539-L547
jtablesaw/tablesaw
core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java
DataFrameJoiner.rightOuter
public Table rightOuter(boolean allowDuplicateColumnNames, Table... tables) { Table joined = table; for (Table table2 : tables) { joined = rightOuter(table2, allowDuplicateColumnNames, columnNames); } return joined; }
java
public Table rightOuter(boolean allowDuplicateColumnNames, Table... tables) { Table joined = table; for (Table table2 : tables) { joined = rightOuter(table2, allowDuplicateColumnNames, columnNames); } return joined; }
[ "public", "Table", "rightOuter", "(", "boolean", "allowDuplicateColumnNames", ",", "Table", "...", "tables", ")", "{", "Table", "joined", "=", "table", ";", "for", "(", "Table", "table2", ":", "tables", ")", "{", "joined", "=", "rightOuter", "(", "table2", ...
Joins to the given tables assuming that they have a column of the name we're joining on @param allowDuplicateColumnNames if {@code false} the join will fail if any columns other than the join column have the same name if {@code true} the join will succeed and duplicate columns are renamed @param tables The tables to join with @return The resulting table
[ "Joins", "to", "the", "given", "tables", "assuming", "that", "they", "have", "a", "column", "of", "the", "name", "we", "re", "joining", "on" ]
train
https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java#L562-L568
alkacon/opencms-core
src/org/opencms/acacia/shared/CmsEntity.java
CmsEntity.createDeepCopy
public CmsEntity createDeepCopy(String entityId) { CmsEntity result = new CmsEntity(entityId, getTypeName()); for (CmsEntityAttribute attribute : getAttributes()) { if (attribute.isSimpleValue()) { List<String> values = attribute.getSimpleValues(); for (String value : values) { result.addAttributeValue(attribute.getAttributeName(), value); } } else { List<CmsEntity> values = attribute.getComplexValues(); for (CmsEntity value : values) { result.addAttributeValue(attribute.getAttributeName(), value.createDeepCopy(null)); } } } return result; }
java
public CmsEntity createDeepCopy(String entityId) { CmsEntity result = new CmsEntity(entityId, getTypeName()); for (CmsEntityAttribute attribute : getAttributes()) { if (attribute.isSimpleValue()) { List<String> values = attribute.getSimpleValues(); for (String value : values) { result.addAttributeValue(attribute.getAttributeName(), value); } } else { List<CmsEntity> values = attribute.getComplexValues(); for (CmsEntity value : values) { result.addAttributeValue(attribute.getAttributeName(), value.createDeepCopy(null)); } } } return result; }
[ "public", "CmsEntity", "createDeepCopy", "(", "String", "entityId", ")", "{", "CmsEntity", "result", "=", "new", "CmsEntity", "(", "entityId", ",", "getTypeName", "(", ")", ")", ";", "for", "(", "CmsEntityAttribute", "attribute", ":", "getAttributes", "(", ")"...
Creates a deep copy of this entity.<p> @param entityId the id of the new entity, if <code>null</code> a generic id will be used @return the entity copy
[ "Creates", "a", "deep", "copy", "of", "this", "entity", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/acacia/shared/CmsEntity.java#L302-L319
google/truth
core/src/main/java/com/google/common/truth/Facts.java
Facts.and
Facts and(Fact... moreFacts) { return new Facts(Iterables.concat(facts, asList(moreFacts))); }
java
Facts and(Fact... moreFacts) { return new Facts(Iterables.concat(facts, asList(moreFacts))); }
[ "Facts", "and", "(", "Fact", "...", "moreFacts", ")", "{", "return", "new", "Facts", "(", "Iterables", ".", "concat", "(", "facts", ",", "asList", "(", "moreFacts", ")", ")", ")", ";", "}" ]
Returns an instance concatenating the facts wrapped by the current instance followed by the given facts.
[ "Returns", "an", "instance", "concatenating", "the", "facts", "wrapped", "by", "the", "current", "instance", "followed", "by", "the", "given", "facts", "." ]
train
https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/Facts.java#L62-L64
GeoLatte/geolatte-common
src/main/java/org/geolatte/common/expressions/Expressions.java
Expressions.isGreaterThanOrEqual
public static IsGreaterThanOrEqual isGreaterThanOrEqual(ComparableExpression<Number> left, ComparableExpression<Number> right) { return new IsGreaterThanOrEqual(left, right); }
java
public static IsGreaterThanOrEqual isGreaterThanOrEqual(ComparableExpression<Number> left, ComparableExpression<Number> right) { return new IsGreaterThanOrEqual(left, right); }
[ "public", "static", "IsGreaterThanOrEqual", "isGreaterThanOrEqual", "(", "ComparableExpression", "<", "Number", ">", "left", ",", "ComparableExpression", "<", "Number", ">", "right", ")", "{", "return", "new", "IsGreaterThanOrEqual", "(", "left", ",", "right", ")", ...
Creates an IsGreaterThanOrEqual expression from the given expressions. @param left The left expression. @param right The right expression. @return A new IsGreaterThanOrEqual binary expression.
[ "Creates", "an", "IsGreaterThanOrEqual", "expression", "from", "the", "given", "expressions", "." ]
train
https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/expressions/Expressions.java#L274-L276
netplex/json-smart-v2
json-smart/src/main/java/net/minidev/json/parser/JSONParser.java
JSONParser.parse
public <T> T parse(InputStream in, Class<T> mapTo) throws ParseException, UnsupportedEncodingException { return getPBinStream().parse(in, JSONValue.defaultReader.getMapper(mapTo)); }
java
public <T> T parse(InputStream in, Class<T> mapTo) throws ParseException, UnsupportedEncodingException { return getPBinStream().parse(in, JSONValue.defaultReader.getMapper(mapTo)); }
[ "public", "<", "T", ">", "T", "parse", "(", "InputStream", "in", ",", "Class", "<", "T", ">", "mapTo", ")", "throws", "ParseException", ",", "UnsupportedEncodingException", "{", "return", "getPBinStream", "(", ")", ".", "parse", "(", "in", ",", "JSONValue"...
use to return Primitive Type, or String, Or JsonObject or JsonArray generated by a ContainerFactory
[ "use", "to", "return", "Primitive", "Type", "or", "String", "Or", "JsonObject", "or", "JsonArray", "generated", "by", "a", "ContainerFactory" ]
train
https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/parser/JSONParser.java#L230-L232
jbundle/jbundle
base/remote/src/main/java/org/jbundle/base/remote/BaseSession.java
BaseSession.doRemoteCommand
public Object doRemoteCommand(String strCommand, Map<String, Object> properties) throws RemoteException, DBException { if (DBParams.GET_FIELD_DATA.equalsIgnoreCase(strCommand)) { return this.getFieldData(properties); } return Boolean.FALSE; // Override this to handle this command }
java
public Object doRemoteCommand(String strCommand, Map<String, Object> properties) throws RemoteException, DBException { if (DBParams.GET_FIELD_DATA.equalsIgnoreCase(strCommand)) { return this.getFieldData(properties); } return Boolean.FALSE; // Override this to handle this command }
[ "public", "Object", "doRemoteCommand", "(", "String", "strCommand", ",", "Map", "<", "String", ",", "Object", ">", "properties", ")", "throws", "RemoteException", ",", "DBException", "{", "if", "(", "DBParams", ".", "GET_FIELD_DATA", ".", "equalsIgnoreCase", "("...
Process the command. Step 1 - Process the command if possible and return true if processed. Step 2 - If I can't process, pass to all children (with me as the source). Step 3 - If children didn't process, pass to parent (with me as the source). Note: Never pass to a parent or child that matches the source (to avoid an endless loop). @param strCommand The command to process. @param sourceSField The source screen field (to avoid echos). @param bUseSameWindow If this command creates a new screen, create in a new window? @return true if success.
[ "Process", "the", "command", ".", "Step", "1", "-", "Process", "the", "command", "if", "possible", "and", "return", "true", "if", "processed", ".", "Step", "2", "-", "If", "I", "can", "t", "process", "pass", "to", "all", "children", "(", "with", "me", ...
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/BaseSession.java#L382-L389
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
Resolve.loadClass
Symbol loadClass(Env<AttrContext> env, Name name, RecoveryLoadClass recoveryLoadClass) { try { ClassSymbol c = finder.loadClass(env.toplevel.modle, name); return isAccessible(env, c) ? c : new AccessError(env, null, c); } catch (ClassFinder.BadClassFile err) { throw err; } catch (CompletionFailure ex) { Symbol candidate = recoveryLoadClass.loadClass(env, name); if (candidate != null) { return candidate; } return typeNotFound; } }
java
Symbol loadClass(Env<AttrContext> env, Name name, RecoveryLoadClass recoveryLoadClass) { try { ClassSymbol c = finder.loadClass(env.toplevel.modle, name); return isAccessible(env, c) ? c : new AccessError(env, null, c); } catch (ClassFinder.BadClassFile err) { throw err; } catch (CompletionFailure ex) { Symbol candidate = recoveryLoadClass.loadClass(env, name); if (candidate != null) { return candidate; } return typeNotFound; } }
[ "Symbol", "loadClass", "(", "Env", "<", "AttrContext", ">", "env", ",", "Name", "name", ",", "RecoveryLoadClass", "recoveryLoadClass", ")", "{", "try", "{", "ClassSymbol", "c", "=", "finder", ".", "loadClass", "(", "env", ".", "toplevel", ".", "modle", ","...
Load toplevel or member class with given fully qualified name and verify that it is accessible. @param env The current environment. @param name The fully qualified name of the class to be loaded.
[ "Load", "toplevel", "or", "member", "class", "with", "given", "fully", "qualified", "name", "and", "verify", "that", "it", "is", "accessible", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java#L1986-L2001
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.updateIntentAsync
public Observable<OperationStatus> updateIntentAsync(UUID appId, String versionId, UUID intentId, UpdateIntentOptionalParameter updateIntentOptionalParameter) { return updateIntentWithServiceResponseAsync(appId, versionId, intentId, updateIntentOptionalParameter).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() { @Override public OperationStatus call(ServiceResponse<OperationStatus> response) { return response.body(); } }); }
java
public Observable<OperationStatus> updateIntentAsync(UUID appId, String versionId, UUID intentId, UpdateIntentOptionalParameter updateIntentOptionalParameter) { return updateIntentWithServiceResponseAsync(appId, versionId, intentId, updateIntentOptionalParameter).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() { @Override public OperationStatus call(ServiceResponse<OperationStatus> response) { return response.body(); } }); }
[ "public", "Observable", "<", "OperationStatus", ">", "updateIntentAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "intentId", ",", "UpdateIntentOptionalParameter", "updateIntentOptionalParameter", ")", "{", "return", "updateIntentWithServiceResponseAs...
Updates the name of an intent classifier. @param appId The application ID. @param versionId The version ID. @param intentId The intent classifier ID. @param updateIntentOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the OperationStatus object
[ "Updates", "the", "name", "of", "an", "intent", "classifier", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L2940-L2947
lessthanoptimal/ddogleg
src/org/ddogleg/sorting/ApproximateSort_F32.java
ApproximateSort_F32.sortIndex
public void sortIndex( float input[] , int start , int length , int indexes[] ) { for( int i = 0; i < length; i++ ) indexes[i] = i; for( int i = 0; i < histIndexes.size; i++ ) { histIndexes.get(i).reset(); } for( int i = 0; i < length; i++ ) { int indexInput = i+start; int discretized = (int)((input[indexInput]-minValue)/divisor); histIndexes.data[discretized].add(indexInput); } // over wrist the input data with sorted elements int index = 0; for( int i = 0; i < histIndexes.size; i++ ) { GrowQueue_I32 matches = histIndexes.get(i); for( int j = 0; j < matches.size; j++ ) { indexes[index++] = matches.data[j]; } } }
java
public void sortIndex( float input[] , int start , int length , int indexes[] ) { for( int i = 0; i < length; i++ ) indexes[i] = i; for( int i = 0; i < histIndexes.size; i++ ) { histIndexes.get(i).reset(); } for( int i = 0; i < length; i++ ) { int indexInput = i+start; int discretized = (int)((input[indexInput]-minValue)/divisor); histIndexes.data[discretized].add(indexInput); } // over wrist the input data with sorted elements int index = 0; for( int i = 0; i < histIndexes.size; i++ ) { GrowQueue_I32 matches = histIndexes.get(i); for( int j = 0; j < matches.size; j++ ) { indexes[index++] = matches.data[j]; } } }
[ "public", "void", "sortIndex", "(", "float", "input", "[", "]", ",", "int", "start", ",", "int", "length", ",", "int", "indexes", "[", "]", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "indexes", "["...
Sort routine which does not modify the input array and instead maintains a list of indexes. @param input (Input) Data which is to be sorted. Not modified. @param start First element in input list @param length Length of the input list @param indexes Number of elements
[ "Sort", "routine", "which", "does", "not", "modify", "the", "input", "array", "and", "instead", "maintains", "a", "list", "of", "indexes", "." ]
train
https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/sorting/ApproximateSort_F32.java#L124-L146
GoogleCloudPlatform/bigdata-interop
gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystemBase.java
GoogleHadoopFileSystemBase.create
@Override public FSDataOutputStream create( Path hadoopPath, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { long startTime = System.nanoTime(); Preconditions.checkArgument(hadoopPath != null, "hadoopPath must not be null"); Preconditions.checkArgument( replication > 0, "replication must be a positive integer: %s", replication); Preconditions.checkArgument( blockSize > 0, "blockSize must be a positive integer: %s", blockSize); checkOpen(); logger.atFine().log( "GHFS.create: %s, overwrite: %s, bufferSize: %d (ignored)", hadoopPath, overwrite, bufferSize); URI gcsPath = getGcsPath(hadoopPath); OutputStreamType type = GCS_OUTPUT_STREAM_TYPE.get(getConf(), getConf()::getEnum); OutputStream out; switch (type) { case BASIC: out = new GoogleHadoopOutputStream( this, gcsPath, statistics, new CreateFileOptions(overwrite)); break; case SYNCABLE_COMPOSITE: out = new GoogleHadoopSyncableOutputStream( this, gcsPath, statistics, new CreateFileOptions(overwrite)); break; default: throw new IOException( String.format( "Unsupported output stream type given for key '%s': '%s'", GCS_OUTPUT_STREAM_TYPE.getKey(), type)); } long duration = System.nanoTime() - startTime; increment(Counter.CREATE); increment(Counter.CREATE_TIME, duration); return new FSDataOutputStream(out, null); }
java
@Override public FSDataOutputStream create( Path hadoopPath, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { long startTime = System.nanoTime(); Preconditions.checkArgument(hadoopPath != null, "hadoopPath must not be null"); Preconditions.checkArgument( replication > 0, "replication must be a positive integer: %s", replication); Preconditions.checkArgument( blockSize > 0, "blockSize must be a positive integer: %s", blockSize); checkOpen(); logger.atFine().log( "GHFS.create: %s, overwrite: %s, bufferSize: %d (ignored)", hadoopPath, overwrite, bufferSize); URI gcsPath = getGcsPath(hadoopPath); OutputStreamType type = GCS_OUTPUT_STREAM_TYPE.get(getConf(), getConf()::getEnum); OutputStream out; switch (type) { case BASIC: out = new GoogleHadoopOutputStream( this, gcsPath, statistics, new CreateFileOptions(overwrite)); break; case SYNCABLE_COMPOSITE: out = new GoogleHadoopSyncableOutputStream( this, gcsPath, statistics, new CreateFileOptions(overwrite)); break; default: throw new IOException( String.format( "Unsupported output stream type given for key '%s': '%s'", GCS_OUTPUT_STREAM_TYPE.getKey(), type)); } long duration = System.nanoTime() - startTime; increment(Counter.CREATE); increment(Counter.CREATE_TIME, duration); return new FSDataOutputStream(out, null); }
[ "@", "Override", "public", "FSDataOutputStream", "create", "(", "Path", "hadoopPath", ",", "FsPermission", "permission", ",", "boolean", "overwrite", ",", "int", "bufferSize", ",", "short", "replication", ",", "long", "blockSize", ",", "Progressable", "progress", ...
Opens the given file for writing. <p>Note: This function overrides the given bufferSize value with a higher number unless further overridden using configuration parameter {@code fs.gs.outputstream.buffer.size}. @param hadoopPath The file to open. @param permission Permissions to set on the new file. Ignored. @param overwrite If a file with this name already exists, then if true, the file will be overwritten, and if false an error will be thrown. @param bufferSize The size of the buffer to use. @param replication Required block replication for the file. Ignored. @param blockSize The block-size to be used for the new file. Ignored. @param progress Progress is reported through this. Ignored. @return A writable stream. @throws IOException if an error occurs. @see #setPermission(Path, FsPermission)
[ "Opens", "the", "given", "file", "for", "writing", "." ]
train
https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystemBase.java#L733-L783
RuntimeTools/javametrics
javaagent/src/main/java/com/ibm/javametrics/instrument/ClassTransformer.java
ClassTransformer.transform
@Override public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException { ClassReader cr = new ClassReader(classfileBuffer); ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_FRAMES); ClassVisitor cv = new ClassAdapter(cw); cr.accept(cv, ClassReader.SKIP_FRAMES); return cw.toByteArray(); }
java
@Override public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException { ClassReader cr = new ClassReader(classfileBuffer); ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_FRAMES); ClassVisitor cv = new ClassAdapter(cw); cr.accept(cv, ClassReader.SKIP_FRAMES); return cw.toByteArray(); }
[ "@", "Override", "public", "byte", "[", "]", "transform", "(", "ClassLoader", "loader", ",", "String", "className", ",", "Class", "<", "?", ">", "classBeingRedefined", ",", "ProtectionDomain", "protectionDomain", ",", "byte", "[", "]", "classfileBuffer", ")", ...
/* Called during class loading. Use ASM to modify class bytecode if necessary using the ClassAdaptor
[ "/", "*", "Called", "during", "class", "loading", "." ]
train
https://github.com/RuntimeTools/javametrics/blob/e167a565d0878b535585329c42a29a86516dd741/javaagent/src/main/java/com/ibm/javametrics/instrument/ClassTransformer.java#L37-L46
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java
LegacyBehavior.wasNoScope
protected static boolean wasNoScope(ActivityImpl activity, PvmExecutionImpl scopeExecutionCandidate) { return wasNoScope72(activity) || wasNoScope73(activity, scopeExecutionCandidate); }
java
protected static boolean wasNoScope(ActivityImpl activity, PvmExecutionImpl scopeExecutionCandidate) { return wasNoScope72(activity) || wasNoScope73(activity, scopeExecutionCandidate); }
[ "protected", "static", "boolean", "wasNoScope", "(", "ActivityImpl", "activity", ",", "PvmExecutionImpl", "scopeExecutionCandidate", ")", "{", "return", "wasNoScope72", "(", "activity", ")", "||", "wasNoScope73", "(", "activity", ",", "scopeExecutionCandidate", ")", "...
Determines whether the given scope was a scope in previous versions
[ "Determines", "whether", "the", "given", "scope", "was", "a", "scope", "in", "previous", "versions" ]
train
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L320-L322
UrielCh/ovh-java-sdk
ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java
ApiOvhXdsl.serviceName_modem_lan_lanName_dhcp_dhcpName_GET
public OvhDHCP serviceName_modem_lan_lanName_dhcp_dhcpName_GET(String serviceName, String lanName, String dhcpName) throws IOException { String qPath = "/xdsl/{serviceName}/modem/lan/{lanName}/dhcp/{dhcpName}"; StringBuilder sb = path(qPath, serviceName, lanName, dhcpName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhDHCP.class); }
java
public OvhDHCP serviceName_modem_lan_lanName_dhcp_dhcpName_GET(String serviceName, String lanName, String dhcpName) throws IOException { String qPath = "/xdsl/{serviceName}/modem/lan/{lanName}/dhcp/{dhcpName}"; StringBuilder sb = path(qPath, serviceName, lanName, dhcpName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhDHCP.class); }
[ "public", "OvhDHCP", "serviceName_modem_lan_lanName_dhcp_dhcpName_GET", "(", "String", "serviceName", ",", "String", "lanName", ",", "String", "dhcpName", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/xdsl/{serviceName}/modem/lan/{lanName}/dhcp/{dhcpName}\"", ...
Get this object properties REST: GET /xdsl/{serviceName}/modem/lan/{lanName}/dhcp/{dhcpName} @param serviceName [required] The internal name of your XDSL offer @param lanName [required] Name of the LAN @param dhcpName [required] Name of the DHCP
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1022-L1027
algorithmiaio/algorithmia-java
src/main/java/com/algorithmia/data/DataDirectory.java
DataDirectory.putFile
public DataFile putFile(File file) throws APIException, FileNotFoundException { DataFile dataFile = new DataFile(client, trimmedPath + "/" + file.getName()); dataFile.put(file); return dataFile; }
java
public DataFile putFile(File file) throws APIException, FileNotFoundException { DataFile dataFile = new DataFile(client, trimmedPath + "/" + file.getName()); dataFile.put(file); return dataFile; }
[ "public", "DataFile", "putFile", "(", "File", "file", ")", "throws", "APIException", ",", "FileNotFoundException", "{", "DataFile", "dataFile", "=", "new", "DataFile", "(", "client", ",", "trimmedPath", "+", "\"/\"", "+", "file", ".", "getName", "(", ")", ")...
Convenience wrapper for putting a File @param file a file to put into this data directory @return a handle to the requested file @throws APIException if there were any problems communicating with the Algorithmia API @throws FileNotFoundException if the specified file does not exist
[ "Convenience", "wrapper", "for", "putting", "a", "File" ]
train
https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataDirectory.java#L88-L92
Azure/azure-sdk-for-java
cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java
DatabaseAccountsInner.beginOfflineRegionAsync
public Observable<Void> beginOfflineRegionAsync(String resourceGroupName, String accountName, String region) { return beginOfflineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
java
public Observable<Void> beginOfflineRegionAsync(String resourceGroupName, String accountName, String region) { return beginOfflineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
[ "public", "Observable", "<", "Void", ">", "beginOfflineRegionAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "region", ")", "{", "return", "beginOfflineRegionWithServiceResponseAsync", "(", "resourceGroupName", ",", "accountName", ...
Offline the specified region for the specified Azure Cosmos DB database account. @param resourceGroupName Name of an Azure resource group. @param accountName Cosmos DB database account name. @param region Cosmos DB region, with spaces between words and each word capitalized. @throws IllegalArgumentException thrown if parameters fail the validation @return the {@link ServiceResponse} object if successful.
[ "Offline", "the", "specified", "region", "for", "the", "specified", "Azure", "Cosmos", "DB", "database", "account", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java#L1388-L1395
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java
TransformerIdentityImpl.internalEntityDecl
public void internalEntityDecl (String name, String value) throws SAXException { if (null != m_resultDeclHandler) m_resultDeclHandler.internalEntityDecl(name, value); }
java
public void internalEntityDecl (String name, String value) throws SAXException { if (null != m_resultDeclHandler) m_resultDeclHandler.internalEntityDecl(name, value); }
[ "public", "void", "internalEntityDecl", "(", "String", "name", ",", "String", "value", ")", "throws", "SAXException", "{", "if", "(", "null", "!=", "m_resultDeclHandler", ")", "m_resultDeclHandler", ".", "internalEntityDecl", "(", "name", ",", "value", ")", ";",...
Report an internal entity declaration. <p>Only the effective (first) declaration for each entity will be reported.</p> @param name The name of the entity. If it is a parameter entity, the name will begin with '%'. @param value The replacement text of the entity. @exception SAXException The application may raise an exception. @see #externalEntityDecl @see org.xml.sax.DTDHandler#unparsedEntityDecl
[ "Report", "an", "internal", "entity", "declaration", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java#L1394-L1399
kaazing/java.client
amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/impl/AmqpBuffer.java
AmqpBuffer.putMethodArguments
AmqpBuffer putMethodArguments(Object[] args, List<Parameter> formalParams) { for (int i = 0; i < formalParams.size(); i++) { String type = formalParams.get(i).type; if (type == null) { throw new IllegalStateException("Unknown AMQP domain " + type); } String typeMap = getMappedType(type); putObjectOfType(typeMap, args[i]); // support packing of consecutive bits into a single byte this.bitCount = (byte)((typeMap == "Bit") ? this.bitCount + 1 : 0); } return this; }
java
AmqpBuffer putMethodArguments(Object[] args, List<Parameter> formalParams) { for (int i = 0; i < formalParams.size(); i++) { String type = formalParams.get(i).type; if (type == null) { throw new IllegalStateException("Unknown AMQP domain " + type); } String typeMap = getMappedType(type); putObjectOfType(typeMap, args[i]); // support packing of consecutive bits into a single byte this.bitCount = (byte)((typeMap == "Bit") ? this.bitCount + 1 : 0); } return this; }
[ "AmqpBuffer", "putMethodArguments", "(", "Object", "[", "]", "args", ",", "List", "<", "Parameter", ">", "formalParams", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "formalParams", ".", "size", "(", ")", ";", "i", "++", ")", "{", "St...
Encodes arguments given a method's parameter list and the provided arguments
[ "Encodes", "arguments", "given", "a", "method", "s", "parameter", "list", "and", "the", "provided", "arguments" ]
train
https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/impl/AmqpBuffer.java#L531-L550
fernandospr/java-wns
src/main/java/ar/com/fernandospr/wns/WnsService.java
WnsService.pushToast
public List<WnsNotificationResponse> pushToast(List<String> channelUris, WnsToast toast) throws WnsException { return this.pushToast(channelUris, null, toast); }
java
public List<WnsNotificationResponse> pushToast(List<String> channelUris, WnsToast toast) throws WnsException { return this.pushToast(channelUris, null, toast); }
[ "public", "List", "<", "WnsNotificationResponse", ">", "pushToast", "(", "List", "<", "String", ">", "channelUris", ",", "WnsToast", "toast", ")", "throws", "WnsException", "{", "return", "this", ".", "pushToast", "(", "channelUris", ",", "null", ",", "toast",...
Pushes a toast to channelUris @param channelUris @param toast which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsToastBuilder} @return list of WnsNotificationResponse for each channelUri, please see response headers from <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465435.aspx#send_notification_response">http://msdn.microsoft.com/en-us/library/windows/apps/hh465435.aspx#send_notification_response</a> @throws WnsException when authentication fails
[ "Pushes", "a", "toast", "to", "channelUris" ]
train
https://github.com/fernandospr/java-wns/blob/cd621b9c17d1e706f6284e0913531d834904a90d/src/main/java/ar/com/fernandospr/wns/WnsService.java#L145-L147
OpenLiberty/open-liberty
dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/impl/AbstractConfig.java
AbstractConfig.getValue
protected Object getValue(String propertyName, Type propertyType, boolean optional, String defaultString) { Object value = null; assertNotClosed(); SourcedValue sourced = getSourcedValue(propertyName, propertyType); if (sourced != null) { value = sourced.getValue(); } else { if (optional) { value = convertValue(defaultString, propertyType); } else { throw new NoSuchElementException(Tr.formatMessage(tc, "no.such.element.CWMCG0015E", propertyName)); } } return value; }
java
protected Object getValue(String propertyName, Type propertyType, boolean optional, String defaultString) { Object value = null; assertNotClosed(); SourcedValue sourced = getSourcedValue(propertyName, propertyType); if (sourced != null) { value = sourced.getValue(); } else { if (optional) { value = convertValue(defaultString, propertyType); } else { throw new NoSuchElementException(Tr.formatMessage(tc, "no.such.element.CWMCG0015E", propertyName)); } } return value; }
[ "protected", "Object", "getValue", "(", "String", "propertyName", ",", "Type", "propertyType", ",", "boolean", "optional", ",", "String", "defaultString", ")", "{", "Object", "value", "=", "null", ";", "assertNotClosed", "(", ")", ";", "SourcedValue", "sourced",...
Get the converted value of the given property. If the property is not found and optional is true then use the default string to create a value to return. If the property is not found and optional is false then throw an exception. @param propertyName the property to get @param propertyType the type to convert to @param optional is the property optional @param defaultString the default string to use if the property was not found and optional is true @return the converted value @throws NoSuchElementException thrown if the property was not found and optional was false
[ "Get", "the", "converted", "value", "of", "the", "given", "property", ".", "If", "the", "property", "is", "not", "found", "and", "optional", "is", "true", "then", "use", "the", "default", "string", "to", "create", "a", "value", "to", "return", ".", "If",...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/impl/AbstractConfig.java#L164-L179
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java
EmvParser.extractPublicData
protected boolean extractPublicData(final Application pApplication) throws CommunicationException { boolean ret = false; // Select AID byte[] data = selectAID(pApplication.getAid()); // check response // Add SW_6285 to fix Interact issue if (ResponseUtils.contains(data, SwEnum.SW_9000, SwEnum.SW_6285)) { // Update reading state pApplication.setReadingStep(ApplicationStepEnum.SELECTED); // Parse select response ret = parse(data, pApplication); if (ret) { // Get AID String aid = BytesUtils.bytesToStringNoSpace(TlvUtil.getValue(data, EmvTags.DEDICATED_FILE_NAME)); String applicationLabel = extractApplicationLabel(data); if (applicationLabel == null) { applicationLabel = pApplication.getApplicationLabel(); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Application label:" + applicationLabel + " with Aid:" + aid); } template.get().getCard().setType(findCardScheme(aid, template.get().getCard().getCardNumber())); pApplication.setAid(BytesUtils.fromString(aid)); pApplication.setApplicationLabel(applicationLabel); pApplication.setLeftPinTry(getLeftPinTry()); pApplication.setTransactionCounter(getTransactionCounter()); template.get().getCard().setState(CardStateEnum.ACTIVE); } } return ret; }
java
protected boolean extractPublicData(final Application pApplication) throws CommunicationException { boolean ret = false; // Select AID byte[] data = selectAID(pApplication.getAid()); // check response // Add SW_6285 to fix Interact issue if (ResponseUtils.contains(data, SwEnum.SW_9000, SwEnum.SW_6285)) { // Update reading state pApplication.setReadingStep(ApplicationStepEnum.SELECTED); // Parse select response ret = parse(data, pApplication); if (ret) { // Get AID String aid = BytesUtils.bytesToStringNoSpace(TlvUtil.getValue(data, EmvTags.DEDICATED_FILE_NAME)); String applicationLabel = extractApplicationLabel(data); if (applicationLabel == null) { applicationLabel = pApplication.getApplicationLabel(); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Application label:" + applicationLabel + " with Aid:" + aid); } template.get().getCard().setType(findCardScheme(aid, template.get().getCard().getCardNumber())); pApplication.setAid(BytesUtils.fromString(aid)); pApplication.setApplicationLabel(applicationLabel); pApplication.setLeftPinTry(getLeftPinTry()); pApplication.setTransactionCounter(getTransactionCounter()); template.get().getCard().setState(CardStateEnum.ACTIVE); } } return ret; }
[ "protected", "boolean", "extractPublicData", "(", "final", "Application", "pApplication", ")", "throws", "CommunicationException", "{", "boolean", "ret", "=", "false", ";", "// Select AID", "byte", "[", "]", "data", "=", "selectAID", "(", "pApplication", ".", "get...
Read public card data from parameter AID @param pApplication application data @return true if succeed false otherwise @throws CommunicationException communication error
[ "Read", "public", "card", "data", "from", "parameter", "AID" ]
train
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java#L96-L126
eclipse/xtext-lib
org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/BigIntegerExtensions.java
BigIntegerExtensions.operator_power
@Inline(value="$1.pow($2)") @Pure public static BigInteger operator_power(BigInteger a, int exponent) { return a.pow(exponent); }
java
@Inline(value="$1.pow($2)") @Pure public static BigInteger operator_power(BigInteger a, int exponent) { return a.pow(exponent); }
[ "@", "Inline", "(", "value", "=", "\"$1.pow($2)\"", ")", "@", "Pure", "public", "static", "BigInteger", "operator_power", "(", "BigInteger", "a", ",", "int", "exponent", ")", "{", "return", "a", ".", "pow", "(", "exponent", ")", ";", "}" ]
The <code>power</code> operator. @param a a BigInteger. May not be <code>null</code>. @param exponent the exponent. @return <code>a.pow(b)</code> @throws NullPointerException if {@code a} <code>null</code>.
[ "The", "<code", ">", "power<", "/", "code", ">", "operator", "." ]
train
https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/BigIntegerExtensions.java#L82-L86
aalmiray/Json-lib
src/main/java/net/sf/json/JSONArray.java
JSONArray.addValue
private JSONArray addValue( Object value, JsonConfig jsonConfig ) { return _addValue( processValue( value, jsonConfig ), jsonConfig ); }
java
private JSONArray addValue( Object value, JsonConfig jsonConfig ) { return _addValue( processValue( value, jsonConfig ), jsonConfig ); }
[ "private", "JSONArray", "addValue", "(", "Object", "value", ",", "JsonConfig", "jsonConfig", ")", "{", "return", "_addValue", "(", "processValue", "(", "value", ",", "jsonConfig", ")", ",", "jsonConfig", ")", ";", "}" ]
Append an object value. This increases the array's length by one. @param value An object value. The value should be a Boolean, Double, Integer, JSONArray, JSONObject, JSONFunction, Long, String, JSONString or the JSONNull object. @return this.
[ "Append", "an", "object", "value", ".", "This", "increases", "the", "array", "s", "length", "by", "one", "." ]
train
https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONArray.java#L2347-L2349
eurekaclinical/javautil
src/main/java/org/arp/javautil/arrays/Arrays.java
Arrays.matrixCopy
public static void matrixCopy(Object[][] src, Object[][] dest) { if (src != null && dest != null) { for (int i = 0; i < src.length; i++) { System.arraycopy(src[i], 0, dest[i], 0, src[i].length); } } }
java
public static void matrixCopy(Object[][] src, Object[][] dest) { if (src != null && dest != null) { for (int i = 0; i < src.length; i++) { System.arraycopy(src[i], 0, dest[i], 0, src[i].length); } } }
[ "public", "static", "void", "matrixCopy", "(", "Object", "[", "]", "[", "]", "src", ",", "Object", "[", "]", "[", "]", "dest", ")", "{", "if", "(", "src", "!=", "null", "&&", "dest", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", "...
Copies a 2D array. Nothing happens if either argument is <code>null</code>. @param src an array. @param dest an array.
[ "Copies", "a", "2D", "array", ".", "Nothing", "happens", "if", "either", "argument", "is", "<code", ">", "null<", "/", "code", ">", "." ]
train
https://github.com/eurekaclinical/javautil/blob/779bbc5bf096c75f8eed4f99ca45b99c1d44df43/src/main/java/org/arp/javautil/arrays/Arrays.java#L49-L55
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java
UCharacter.foldCase
public static String foldCase(String str, boolean defaultmapping) { return foldCase(str, defaultmapping ? FOLD_CASE_DEFAULT : FOLD_CASE_EXCLUDE_SPECIAL_I); }
java
public static String foldCase(String str, boolean defaultmapping) { return foldCase(str, defaultmapping ? FOLD_CASE_DEFAULT : FOLD_CASE_EXCLUDE_SPECIAL_I); }
[ "public", "static", "String", "foldCase", "(", "String", "str", ",", "boolean", "defaultmapping", ")", "{", "return", "foldCase", "(", "str", ",", "defaultmapping", "?", "FOLD_CASE_DEFAULT", ":", "FOLD_CASE_EXCLUDE_SPECIAL_I", ")", ";", "}" ]
<strong>[icu]</strong> The given string is mapped to its case folding equivalent according to UnicodeData.txt and CaseFolding.txt; if any character has no case folding equivalent, the character itself is returned. "Full", multiple-code point case folding mappings are returned here. For "simple" single-code point mappings use the API foldCase(int ch, boolean defaultmapping). @param str the String to be converted @param defaultmapping Indicates whether the default mappings defined in CaseFolding.txt are to be used, otherwise the mappings for dotted I and dotless i marked with 'T' in CaseFolding.txt are included. @return the case folding equivalent of the character, if any; otherwise the character itself. @see #foldCase(int, boolean)
[ "<strong", ">", "[", "icu", "]", "<", "/", "strong", ">", "The", "given", "string", "is", "mapped", "to", "its", "case", "folding", "equivalent", "according", "to", "UnicodeData", ".", "txt", "and", "CaseFolding", ".", "txt", ";", "if", "any", "character...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java#L4678-L4680
opencb/biodata
biodata-tools/src/main/java/org/opencb/biodata/tools/variant/stats/VariantAggregatedExacStatsCalculator.java
VariantAggregatedExacStatsCalculator.getHeterozygousGenotype
public static void getHeterozygousGenotype(int index, int numAlternativeAlleles, Integer alleles[]) { // index++; // double value = (-3 + Math.sqrt(1 + 8 * index)) / 2; // slower than the iterating version, right? // alleles[1] = new Double(Math.ceil(value)).intValue(); // alleles[0] = alleles[1] - ((alleles[1] + 1) * (alleles[1] +2) / 2 - index); int cursor = 0; for (int i = 0; i < numAlternativeAlleles; i++) { for (int j = i+1; j < numAlternativeAlleles +1; j++) { if (i != j) { if (cursor == index) { alleles[0] = i; alleles[1] = j; return; } cursor++; } } } }
java
public static void getHeterozygousGenotype(int index, int numAlternativeAlleles, Integer alleles[]) { // index++; // double value = (-3 + Math.sqrt(1 + 8 * index)) / 2; // slower than the iterating version, right? // alleles[1] = new Double(Math.ceil(value)).intValue(); // alleles[0] = alleles[1] - ((alleles[1] + 1) * (alleles[1] +2) / 2 - index); int cursor = 0; for (int i = 0; i < numAlternativeAlleles; i++) { for (int j = i+1; j < numAlternativeAlleles +1; j++) { if (i != j) { if (cursor == index) { alleles[0] = i; alleles[1] = j; return; } cursor++; } } } }
[ "public", "static", "void", "getHeterozygousGenotype", "(", "int", "index", ",", "int", "numAlternativeAlleles", ",", "Integer", "alleles", "[", "]", ")", "{", "// index++;", "// double value = (-3 + Math.sqrt(1 + 8 * index)) / 2; // slower than the iterating ver...
returns in alleles[] the heterozygous genotype specified in index in the sequence (in this example for 3 ALT alleles): 0/1, 0/2, 0/3, 1/2, 1/3, 2/3 @param index in this sequence, starting in 0 @param numAlternativeAlleles note that this ordering requires knowing how many alleles there are @param alleles returned genotype.
[ "returns", "in", "alleles", "[]", "the", "heterozygous", "genotype", "specified", "in", "index", "in", "the", "sequence", "(", "in", "this", "example", "for", "3", "ALT", "alleles", ")", ":", "0", "/", "1", "0", "/", "2", "0", "/", "3", "1", "/", "...
train
https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/stats/VariantAggregatedExacStatsCalculator.java#L275-L294
enioka/jqm
jqm-all/jqm-xml/src/main/java/com/enioka/jqm/tools/XmlJobDefParser.java
XmlJobDefParser.parse
static void parse(String path, DbConn cnx) throws JqmXmlException { parse(path, cnx, null); }
java
static void parse(String path, DbConn cnx) throws JqmXmlException { parse(path, cnx, null); }
[ "static", "void", "parse", "(", "String", "path", ",", "DbConn", "cnx", ")", "throws", "JqmXmlException", "{", "parse", "(", "path", ",", "cnx", ",", "null", ")", ";", "}" ]
Will import all JobDef from an XML file. Creates and commits a transaction. @param path full or relative path to the deployment descriptor to read. @param cnx a database connection to use with no active transaction. @throws JqmEngineException
[ "Will", "import", "all", "JobDef", "from", "an", "XML", "file", ".", "Creates", "and", "commits", "a", "transaction", "." ]
train
https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-xml/src/main/java/com/enioka/jqm/tools/XmlJobDefParser.java#L67-L70
real-logic/agrona
agrona/src/main/java/org/agrona/IoUtil.java
IoUtil.ensureDirectoryExists
public static void ensureDirectoryExists(final File directory, final String descriptionLabel) { if (!directory.exists()) { if (!directory.mkdirs()) { throw new IllegalArgumentException("could not create " + descriptionLabel + " directory: " + directory); } } }
java
public static void ensureDirectoryExists(final File directory, final String descriptionLabel) { if (!directory.exists()) { if (!directory.mkdirs()) { throw new IllegalArgumentException("could not create " + descriptionLabel + " directory: " + directory); } } }
[ "public", "static", "void", "ensureDirectoryExists", "(", "final", "File", "directory", ",", "final", "String", "descriptionLabel", ")", "{", "if", "(", "!", "directory", ".", "exists", "(", ")", ")", "{", "if", "(", "!", "directory", ".", "mkdirs", "(", ...
Create a directory if it doesn't already exist. @param directory the directory which definitely exists after this method call. @param descriptionLabel to associate with the directory for any exceptions.
[ "Create", "a", "directory", "if", "it", "doesn", "t", "already", "exist", "." ]
train
https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/IoUtil.java#L171-L180
osiam/connector4java
src/main/java/org/osiam/client/OsiamConnector.java
OsiamConnector.retrieveAccessToken
public AccessToken retrieveAccessToken(String userName, String password, Scope... scopes) { return getAuthService().retrieveAccessToken(userName, password, scopes); }
java
public AccessToken retrieveAccessToken(String userName, String password, Scope... scopes) { return getAuthService().retrieveAccessToken(userName, password, scopes); }
[ "public", "AccessToken", "retrieveAccessToken", "(", "String", "userName", ",", "String", "password", ",", "Scope", "...", "scopes", ")", "{", "return", "getAuthService", "(", ")", ".", "retrieveAccessToken", "(", "userName", ",", "password", ",", "scopes", ")",...
Provide an {@link AccessToken} for the {@link org.osiam.client.oauth.GrantType} RESOURCE_OWNER_PASSWORD_CREDENTIALS. @param userName the userName of the actual User @param password the password of the actual User @param scopes the wanted Scopes of the {@link AccessToken} @return an valid {@link AccessToken} @throws IllegalStateException if OSIAM's endpoint(s) are not properly configured
[ "Provide", "an", "{", "@link", "AccessToken", "}", "for", "the", "{", "@link", "org", ".", "osiam", ".", "client", ".", "oauth", ".", "GrantType", "}", "RESOURCE_OWNER_PASSWORD_CREDENTIALS", "." ]
train
https://github.com/osiam/connector4java/blob/a5e6ae1e706f4889d662a069fe2f3bf8e3848d12/src/main/java/org/osiam/client/OsiamConnector.java#L420-L422
sababado/CircularView
library/src/main/java/com/sababado/circularview/CircularView.java
CircularView.animateHighlightedDegree
public void animateHighlightedDegree(final float startDegree, final float endDegree, final long duration, final boolean animateMarkers) { mHighlightedDegreeObjectAnimator.cancel(); mHighlightedDegreeObjectAnimator.setFloatValues(startDegree, endDegree); mHighlightedDegreeObjectAnimator.setDuration(duration); mAnimateMarkersOnHighlightAnimation = animateMarkers; mIsAnimating = true; mHighlightedDegreeObjectAnimator.start(); }
java
public void animateHighlightedDegree(final float startDegree, final float endDegree, final long duration, final boolean animateMarkers) { mHighlightedDegreeObjectAnimator.cancel(); mHighlightedDegreeObjectAnimator.setFloatValues(startDegree, endDegree); mHighlightedDegreeObjectAnimator.setDuration(duration); mAnimateMarkersOnHighlightAnimation = animateMarkers; mIsAnimating = true; mHighlightedDegreeObjectAnimator.start(); }
[ "public", "void", "animateHighlightedDegree", "(", "final", "float", "startDegree", ",", "final", "float", "endDegree", ",", "final", "long", "duration", ",", "final", "boolean", "animateMarkers", ")", "{", "mHighlightedDegreeObjectAnimator", ".", "cancel", "(", ")"...
Start animating the highlighted degree. This will cancel any current animations of this type. Pass <code>true</code> to {@link #setAnimateMarkerOnStillHighlight(boolean)} in order to see individual marker animations when the highlighted degree reaches each marker. @param startDegree Degree to start the animation at. @param endDegree Degree to end the animation at. @param duration Duration the animation should be. @param animateMarkers True to animate markers during the animation. False to not animate the markers.
[ "Start", "animating", "the", "highlighted", "degree", ".", "This", "will", "cancel", "any", "current", "animations", "of", "this", "type", ".", "Pass", "<code", ">", "true<", "/", "code", ">", "to", "{", "@link", "#setAnimateMarkerOnStillHighlight", "(", "bool...
train
https://github.com/sababado/CircularView/blob/c9ab818d063bcc0796183616f8a82166a9b80aac/library/src/main/java/com/sababado/circularview/CircularView.java#L748-L755
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/PdfTemplate.java
PdfTemplate.createTemplate
public static PdfTemplate createTemplate(PdfWriter writer, float width, float height) { return createTemplate(writer, width, height, null); }
java
public static PdfTemplate createTemplate(PdfWriter writer, float width, float height) { return createTemplate(writer, width, height, null); }
[ "public", "static", "PdfTemplate", "createTemplate", "(", "PdfWriter", "writer", ",", "float", "width", ",", "float", "height", ")", "{", "return", "createTemplate", "(", "writer", ",", "width", ",", "height", ",", "null", ")", ";", "}" ]
Creates a new template. <P> Creates a new template that is nothing more than a form XObject. This template can be included in this template or in another template. Templates are only written to the output when the document is closed permitting things like showing text in the first page that is only defined in the last page. @param writer the PdfWriter to use @param width the bounding box width @param height the bounding box height @return the created template
[ "Creates", "a", "new", "template", ".", "<P", ">", "Creates", "a", "new", "template", "that", "is", "nothing", "more", "than", "a", "form", "XObject", ".", "This", "template", "can", "be", "included", "in", "this", "template", "or", "in", "another", "tem...
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfTemplate.java#L116-L118
indeedeng/util
io/src/main/java/com/indeed/util/io/Files.java
Files.writeObjectToFileOrDie
public static void writeObjectToFileOrDie(@Nonnull final Object obj, @Nonnull final String file) throws IOException { writeObjectToFileOrDie(obj, file, LOGGER); }
java
public static void writeObjectToFileOrDie(@Nonnull final Object obj, @Nonnull final String file) throws IOException { writeObjectToFileOrDie(obj, file, LOGGER); }
[ "public", "static", "void", "writeObjectToFileOrDie", "(", "@", "Nonnull", "final", "Object", "obj", ",", "@", "Nonnull", "final", "String", "file", ")", "throws", "IOException", "{", "writeObjectToFileOrDie", "(", "obj", ",", "file", ",", "LOGGER", ")", ";", ...
Serializes an object to a file, throws an exception if it fails @param obj object to write to a file @param file path to save the object to @throws java.io.IOException if the existing file could not be erased, or the file could not be written, flushed, synced, or closed
[ "Serializes", "an", "object", "to", "a", "file", "throws", "an", "exception", "if", "it", "fails" ]
train
https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/io/src/main/java/com/indeed/util/io/Files.java#L53-L55
RestComm/sipunit
src/main/java/org/cafesip/sipunit/SipSession.java
SipSession.sendRequestWithTransaction
public SipTransaction sendRequestWithTransaction(String reqMessage, boolean viaProxy, Dialog dialog) throws ParseException { Request request = parent.getMessageFactory().createRequest(reqMessage); return sendRequestWithTransaction(request, viaProxy, dialog); }
java
public SipTransaction sendRequestWithTransaction(String reqMessage, boolean viaProxy, Dialog dialog) throws ParseException { Request request = parent.getMessageFactory().createRequest(reqMessage); return sendRequestWithTransaction(request, viaProxy, dialog); }
[ "public", "SipTransaction", "sendRequestWithTransaction", "(", "String", "reqMessage", ",", "boolean", "viaProxy", ",", "Dialog", "dialog", ")", "throws", "ParseException", "{", "Request", "request", "=", "parent", ".", "getMessageFactory", "(", ")", ".", "createReq...
This basic method sends out a request message as part of a transaction. A test program should use this method when a response to a request is expected. A Request object is constructed from the string passed in. <p> This method returns when the request message has been sent out. The calling program must subsequently call the waitResponse() method to wait for the result (response, timeout, etc.). @param reqMessage A request message in the form of a String with everything from the request line and headers to the body. It must be in the proper format per RFC-3261. @param viaProxy If true, send the message to the proxy. In this case the request URI is modified by this method. Else send it to the user specified in the given request URI. In this case, for an INVITE request, a route header must be present for the request routing to complete. This method does NOT add a route header. @param dialog If not null, send the request via the given dialog. Else send it outside of any dialog. @return A SipTransaction object if the message was built and sent successfully, null otherwise. The calling program doesn't need to do anything with the returned SipTransaction other than pass it in to a subsequent call to waitResponse(). @throws ParseException if an error is encountered while parsing the string.
[ "This", "basic", "method", "sends", "out", "a", "request", "message", "as", "part", "of", "a", "transaction", ".", "A", "test", "program", "should", "use", "this", "method", "when", "a", "response", "to", "a", "request", "is", "expected", ".", "A", "Requ...
train
https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipSession.java#L826-L830
umano/AndroidSlidingUpPanel
library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java
ViewDragHelper.smoothSlideViewTo
public boolean smoothSlideViewTo(View child, int finalLeft, int finalTop) { mCapturedView = child; mActivePointerId = INVALID_POINTER; return forceSettleCapturedViewAt(finalLeft, finalTop, 0, 0); }
java
public boolean smoothSlideViewTo(View child, int finalLeft, int finalTop) { mCapturedView = child; mActivePointerId = INVALID_POINTER; return forceSettleCapturedViewAt(finalLeft, finalTop, 0, 0); }
[ "public", "boolean", "smoothSlideViewTo", "(", "View", "child", ",", "int", "finalLeft", ",", "int", "finalTop", ")", "{", "mCapturedView", "=", "child", ";", "mActivePointerId", "=", "INVALID_POINTER", ";", "return", "forceSettleCapturedViewAt", "(", "finalLeft", ...
Animate the view <code>child</code> to the given (left, top) position. If this method returns true, the caller should invoke {@link #continueSettling(boolean)} on each subsequent frame to continue the motion until it returns false. If this method returns false there is no further work to do to complete the movement. <p>This operation does not count as a capture event, though {@link #getCapturedView()} will still report the sliding view while the slide is in progress.</p> @param child Child view to capture and animate @param finalLeft Final left position of child @param finalTop Final top position of child @return true if animation should continue through {@link #continueSettling(boolean)} calls
[ "Animate", "the", "view", "<code", ">", "child<", "/", "code", ">", "to", "the", "given", "(", "left", "top", ")", "position", ".", "If", "this", "method", "returns", "true", "the", "caller", "should", "invoke", "{", "@link", "#continueSettling", "(", "b...
train
https://github.com/umano/AndroidSlidingUpPanel/blob/45a460435b07e764138a700328836cafc1ed5c42/library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java#L569-L574
rnorth/visible-assertions
src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java
VisibleAssertions.assertThrows
public static void assertThrows(String message, Class<? extends Exception> exceptionClass, Runnable runnable) { try { runnable.run(); fail(message, "No exception was thrown (expected " + exceptionClass.getSimpleName() + ")"); } catch (Exception e) { if (!e.getClass().equals(exceptionClass)) { fail(message, e.getClass().getSimpleName() + " was thrown instead of " + exceptionClass.getSimpleName()); } } pass(message); }
java
public static void assertThrows(String message, Class<? extends Exception> exceptionClass, Runnable runnable) { try { runnable.run(); fail(message, "No exception was thrown (expected " + exceptionClass.getSimpleName() + ")"); } catch (Exception e) { if (!e.getClass().equals(exceptionClass)) { fail(message, e.getClass().getSimpleName() + " was thrown instead of " + exceptionClass.getSimpleName()); } } pass(message); }
[ "public", "static", "void", "assertThrows", "(", "String", "message", ",", "Class", "<", "?", "extends", "Exception", ">", "exceptionClass", ",", "Runnable", "runnable", ")", "{", "try", "{", "runnable", ".", "run", "(", ")", ";", "fail", "(", "message", ...
Assert that a given runnable throws an exception of a particular class. <p> The assertion passes if the runnable throws exactly the same class of exception (not a subclass). <p> If the runnable doesn't throw an exception at all, or if another class of exception is thrown, the assertion fails. <p> If the assertion passes, a green tick will be shown. If the assertion fails, a red cross will be shown. @param message message to display alongside the assertion outcome @param exceptionClass the expected exception class @param runnable a Runnable to invoke
[ "Assert", "that", "a", "given", "runnable", "throws", "an", "exception", "of", "a", "particular", "class", ".", "<p", ">", "The", "assertion", "passes", "if", "the", "runnable", "throws", "exactly", "the", "same", "class", "of", "exception", "(", "not", "a...
train
https://github.com/rnorth/visible-assertions/blob/6d7a7724db40ac0e9f87279553f814b790310b3b/src/main/java/org/rnorth/visibleassertions/VisibleAssertions.java#L404-L415
alkacon/opencms-core
src/org/opencms/file/wrapper/CmsResourceWrapperModules.java
CmsResourceWrapperModules.matchPath
private boolean matchPath(String expected, String actual) { return CmsStringUtil.joinPaths(actual, "/").equals(CmsStringUtil.joinPaths(expected, "/")); }
java
private boolean matchPath(String expected, String actual) { return CmsStringUtil.joinPaths(actual, "/").equals(CmsStringUtil.joinPaths(expected, "/")); }
[ "private", "boolean", "matchPath", "(", "String", "expected", ",", "String", "actual", ")", "{", "return", "CmsStringUtil", ".", "joinPaths", "(", "actual", ",", "\"/\"", ")", ".", "equals", "(", "CmsStringUtil", ".", "joinPaths", "(", "expected", ",", "\"/\...
Checks if a path matches another part.<p> This is basically an equality test, but ignores the presence/absence of trailing slashes. @param expected the expected path @param actual the actual path @return true if the actual path matches the expected path
[ "Checks", "if", "a", "path", "matches", "another", "part", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/wrapper/CmsResourceWrapperModules.java#L571-L574
groupby/api-java
src/main/java/com/groupbyinc/util/UrlBeautifier.java
UrlBeautifier.toUrl
public String toUrl(String searchString, Map<String, Navigation> navigations) throws UrlBeautifier.UrlBeautificationException { StringBuilder pathSegmentLookup = new StringBuilder("/"); Query query = createQuery(); if (StringUtils.isNotBlank(searchString)) { query.setQuery(searchString); } URIBuilder uri = new URIBuilder(); uri.setPath(""); if (MapUtils.isNotEmpty(navigations)) { for (Navigation n : navigations.values()) { for (Refinement r : n.getRefinements()) { if (r instanceof RefinementRange) { RefinementRange rr = (RefinementRange) r; query.addRangeRefinement(n.getName(), rr.getLow(), rr.getHigh()); } else { query.addValueRefinement(n.getName(), ((RefinementValue) r).getValue()); } } } } Map<String, Navigation> groupedRefinements = getDistinctRefinements(query); addRefinements(query.getQuery(), groupedRefinements, pathSegmentLookup, uri); addReferenceBlock(pathSegmentLookup, uri); addAppend(uri); addUnmappedRefinements(groupedRefinements, uri); String uriString = uri.toString(); return uriString.startsWith("null") ? uriString.substring(4) : uriString; }
java
public String toUrl(String searchString, Map<String, Navigation> navigations) throws UrlBeautifier.UrlBeautificationException { StringBuilder pathSegmentLookup = new StringBuilder("/"); Query query = createQuery(); if (StringUtils.isNotBlank(searchString)) { query.setQuery(searchString); } URIBuilder uri = new URIBuilder(); uri.setPath(""); if (MapUtils.isNotEmpty(navigations)) { for (Navigation n : navigations.values()) { for (Refinement r : n.getRefinements()) { if (r instanceof RefinementRange) { RefinementRange rr = (RefinementRange) r; query.addRangeRefinement(n.getName(), rr.getLow(), rr.getHigh()); } else { query.addValueRefinement(n.getName(), ((RefinementValue) r).getValue()); } } } } Map<String, Navigation> groupedRefinements = getDistinctRefinements(query); addRefinements(query.getQuery(), groupedRefinements, pathSegmentLookup, uri); addReferenceBlock(pathSegmentLookup, uri); addAppend(uri); addUnmappedRefinements(groupedRefinements, uri); String uriString = uri.toString(); return uriString.startsWith("null") ? uriString.substring(4) : uriString; }
[ "public", "String", "toUrl", "(", "String", "searchString", ",", "Map", "<", "String", ",", "Navigation", ">", "navigations", ")", "throws", "UrlBeautifier", ".", "UrlBeautificationException", "{", "StringBuilder", "pathSegmentLookup", "=", "new", "StringBuilder", "...
<code> Convert a search term and a list of refinements into a beautified URL. Each refinement that has a mapping will be turned into a path segment. If a mapping has been created for search, the search term will also be placed into a URL path segment. </code> @param searchString The current search state. @param navigations The current refinement state @throws UrlBeautifier.UrlBeautificationException
[ "<code", ">", "Convert", "a", "search", "term", "and", "a", "list", "of", "refinements", "into", "a", "beautified", "URL", ".", "Each", "refinement", "that", "has", "a", "mapping", "will", "be", "turned", "into", "a", "path", "segment", ".", "If", "a", ...
train
https://github.com/groupby/api-java/blob/257c4ed0777221e5e4ade3b29b9921300fac4e2e/src/main/java/com/groupbyinc/util/UrlBeautifier.java#L255-L282
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java
SiftDetector.processFeatureCandidate
protected void processFeatureCandidate( int x , int y , float value ,boolean maximum ) { // suppress response along edges if( isEdge(x,y) ) return; // Estimate the scale and 2D point by fitting 2nd order polynomials // This is different from the original paper float signAdj = maximum ? 1 : -1; value *= signAdj; float x0 = dogTarget.unsafe_get(x - 1, y)*signAdj; float x2 = dogTarget.unsafe_get(x + 1, y)*signAdj; float y0 = dogTarget.unsafe_get(x , y - 1)*signAdj; float y2 = dogTarget.unsafe_get(x , y + 1)*signAdj; float s0 = dogLower.unsafe_get(x , y )*signAdj; float s2 = dogUpper.unsafe_get(x , y )*signAdj; ScalePoint p = detections.grow(); // Compute the interpolated coordinate of the point in the original image coordinates p.x = pixelScaleToInput*(x + polyPeak(x0, value, x2)); p.y = pixelScaleToInput*(y + polyPeak(y0, value, y2)); // find the peak then do bilinear interpolate between the two appropriate sigmas double sigmaInterp = polyPeak(s0, value, s2); // scaled from -1 to 1 if( sigmaInterp < 0 ) { p.scale = sigmaLower*(-sigmaInterp) + (1+sigmaInterp)*sigmaTarget; } else { p.scale = sigmaUpper*sigmaInterp + (1-sigmaInterp)*sigmaTarget; } // a maximum corresponds to a dark object and a minimum to a whiter object p.white = !maximum; handleDetection(p); }
java
protected void processFeatureCandidate( int x , int y , float value ,boolean maximum ) { // suppress response along edges if( isEdge(x,y) ) return; // Estimate the scale and 2D point by fitting 2nd order polynomials // This is different from the original paper float signAdj = maximum ? 1 : -1; value *= signAdj; float x0 = dogTarget.unsafe_get(x - 1, y)*signAdj; float x2 = dogTarget.unsafe_get(x + 1, y)*signAdj; float y0 = dogTarget.unsafe_get(x , y - 1)*signAdj; float y2 = dogTarget.unsafe_get(x , y + 1)*signAdj; float s0 = dogLower.unsafe_get(x , y )*signAdj; float s2 = dogUpper.unsafe_get(x , y )*signAdj; ScalePoint p = detections.grow(); // Compute the interpolated coordinate of the point in the original image coordinates p.x = pixelScaleToInput*(x + polyPeak(x0, value, x2)); p.y = pixelScaleToInput*(y + polyPeak(y0, value, y2)); // find the peak then do bilinear interpolate between the two appropriate sigmas double sigmaInterp = polyPeak(s0, value, s2); // scaled from -1 to 1 if( sigmaInterp < 0 ) { p.scale = sigmaLower*(-sigmaInterp) + (1+sigmaInterp)*sigmaTarget; } else { p.scale = sigmaUpper*sigmaInterp + (1-sigmaInterp)*sigmaTarget; } // a maximum corresponds to a dark object and a minimum to a whiter object p.white = !maximum; handleDetection(p); }
[ "protected", "void", "processFeatureCandidate", "(", "int", "x", ",", "int", "y", ",", "float", "value", ",", "boolean", "maximum", ")", "{", "// suppress response along edges", "if", "(", "isEdge", "(", "x", ",", "y", ")", ")", "return", ";", "// Estimate t...
Examines a local spatial extremum and interpolates its coordinates using a quadratic function. Very first thing it does is check to see if the feature is really an edge/false positive. After that interpolates the coordinate independently using a quadratic function along each axis. Resulting coordinate will be in the image image's coordinate system. @param x x-coordinate of extremum @param y y-coordinate of extremum @param value value of the extremum @param maximum true if it was a maximum
[ "Examines", "a", "local", "spatial", "extremum", "and", "interpolates", "its", "coordinates", "using", "a", "quadratic", "function", ".", "Very", "first", "thing", "it", "does", "is", "check", "to", "see", "if", "the", "feature", "is", "really", "an", "edge"...
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftDetector.java#L262-L299
phax/ph-masterdata
ph-masterdata/src/main/java/com/helger/masterdata/currency/CurrencyHelper.java
CurrencyHelper.parseValueFormatUnchanged
@Nullable public static BigDecimal parseValueFormatUnchanged (@Nullable final ECurrency eCurrency, @Nullable final String sTextValue, @Nullable final BigDecimal aDefault) { final PerCurrencySettings aPCS = getSettings (eCurrency); final DecimalFormat aValueFormat = aPCS.getValueFormat (); return parseCurrency (sTextValue, aValueFormat, aDefault, aPCS.getRoundingMode ()); }
java
@Nullable public static BigDecimal parseValueFormatUnchanged (@Nullable final ECurrency eCurrency, @Nullable final String sTextValue, @Nullable final BigDecimal aDefault) { final PerCurrencySettings aPCS = getSettings (eCurrency); final DecimalFormat aValueFormat = aPCS.getValueFormat (); return parseCurrency (sTextValue, aValueFormat, aDefault, aPCS.getRoundingMode ()); }
[ "@", "Nullable", "public", "static", "BigDecimal", "parseValueFormatUnchanged", "(", "@", "Nullable", "final", "ECurrency", "eCurrency", ",", "@", "Nullable", "final", "String", "sTextValue", ",", "@", "Nullable", "final", "BigDecimal", "aDefault", ")", "{", "fina...
Try to parse a string value formatted by the {@link DecimalFormat} object returned from {@link #getValueFormat(ECurrency)} @param eCurrency The currency it is about. If <code>null</code> is provided {@link #DEFAULT_CURRENCY} is used instead. @param sTextValue The string value. It will be parsed unmodified! @param aDefault The default value to be used in case parsing fails. May be <code>null</code>. @return The {@link BigDecimal} value matching the string value or the passed default value.
[ "Try", "to", "parse", "a", "string", "value", "formatted", "by", "the", "{", "@link", "DecimalFormat", "}", "object", "returned", "from", "{", "@link", "#getValueFormat", "(", "ECurrency", ")", "}" ]
train
https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/currency/CurrencyHelper.java#L563-L572
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java
SimpleDocTreeVisitor.visitSerialData
@Override public R visitSerialData(SerialDataTree node, P p) { return defaultAction(node, p); }
java
@Override public R visitSerialData(SerialDataTree node, P p) { return defaultAction(node, p); }
[ "@", "Override", "public", "R", "visitSerialData", "(", "SerialDataTree", "node", ",", "P", "p", ")", "{", "return", "defaultAction", "(", "node", ",", "p", ")", ";", "}" ]
{@inheritDoc} This implementation calls {@code defaultAction}. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of {@code defaultAction}
[ "{", "@inheritDoc", "}", "This", "implementation", "calls", "{", "@code", "defaultAction", "}", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L357-L360
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/LauncherDelegateImpl.java
LauncherDelegateImpl.getLogProviderImpl
protected LogProvider getLogProviderImpl(ClassLoader loader, BootstrapConfig config) { // consume/remove ras provider from the map String providerClassName = config.getKernelResolver().getLogProvider(); LogProvider p = null; try { Class<?> providerClass = loader.loadClass(providerClassName); if (providerClass != null) { p = (LogProvider) providerClass.newInstance(); p.configure(new ReadOnlyFrameworkProperties(config), config.getLogDirectory(), fileStreamFactory); } } catch (RuntimeException e) { // unexpected NPE, etc. -- no need to re-wrap a runtime exception throw e; } catch (Exception e) { // InstantiationException, ClassNotFoundException, IllegalAccessException throw new RuntimeException("Could not create framework configurator", e); } return p; }
java
protected LogProvider getLogProviderImpl(ClassLoader loader, BootstrapConfig config) { // consume/remove ras provider from the map String providerClassName = config.getKernelResolver().getLogProvider(); LogProvider p = null; try { Class<?> providerClass = loader.loadClass(providerClassName); if (providerClass != null) { p = (LogProvider) providerClass.newInstance(); p.configure(new ReadOnlyFrameworkProperties(config), config.getLogDirectory(), fileStreamFactory); } } catch (RuntimeException e) { // unexpected NPE, etc. -- no need to re-wrap a runtime exception throw e; } catch (Exception e) { // InstantiationException, ClassNotFoundException, IllegalAccessException throw new RuntimeException("Could not create framework configurator", e); } return p; }
[ "protected", "LogProvider", "getLogProviderImpl", "(", "ClassLoader", "loader", ",", "BootstrapConfig", "config", ")", "{", "// consume/remove ras provider from the map", "String", "providerClassName", "=", "config", ".", "getKernelResolver", "(", ")", ".", "getLogProvider"...
Initialize RAS/FFDC LogProviders @param loader Classloader to use when locating the log provider impl @param config BootstrapConfig containing log provider class name. @return LogProvider instance initial properties containing install directory locations @throws RuntimeException If a RuntimeException is thrown during the initialization of log providers, it is propagated to the caller unchanged. Other Exceptions are caught and re-wrapped as RuntimeExceptions
[ "Initialize", "RAS", "/", "FFDC", "LogProviders" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/LauncherDelegateImpl.java#L175-L198
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java
AppServiceCertificateOrdersInner.retrieveSiteSealAsync
public Observable<SiteSealInner> retrieveSiteSealAsync(String resourceGroupName, String certificateOrderName, SiteSealRequest siteSealRequest) { return retrieveSiteSealWithServiceResponseAsync(resourceGroupName, certificateOrderName, siteSealRequest).map(new Func1<ServiceResponse<SiteSealInner>, SiteSealInner>() { @Override public SiteSealInner call(ServiceResponse<SiteSealInner> response) { return response.body(); } }); }
java
public Observable<SiteSealInner> retrieveSiteSealAsync(String resourceGroupName, String certificateOrderName, SiteSealRequest siteSealRequest) { return retrieveSiteSealWithServiceResponseAsync(resourceGroupName, certificateOrderName, siteSealRequest).map(new Func1<ServiceResponse<SiteSealInner>, SiteSealInner>() { @Override public SiteSealInner call(ServiceResponse<SiteSealInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "SiteSealInner", ">", "retrieveSiteSealAsync", "(", "String", "resourceGroupName", ",", "String", "certificateOrderName", ",", "SiteSealRequest", "siteSealRequest", ")", "{", "return", "retrieveSiteSealWithServiceResponseAsync", "(", "resourceGrou...
Verify domain ownership for this certificate order. Verify domain ownership for this certificate order. @param resourceGroupName Name of the resource group to which the resource belongs. @param certificateOrderName Name of the certificate order. @param siteSealRequest Site seal request. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the SiteSealInner object
[ "Verify", "domain", "ownership", "for", "this", "certificate", "order", ".", "Verify", "domain", "ownership", "for", "this", "certificate", "order", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L2077-L2084
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.updateCertificate
public CertificateBundle updateCertificate(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map<String, String> tags) { return updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion, certificatePolicy, certificateAttributes, tags).toBlocking().single().body(); }
java
public CertificateBundle updateCertificate(String vaultBaseUrl, String certificateName, String certificateVersion, CertificatePolicy certificatePolicy, CertificateAttributes certificateAttributes, Map<String, String> tags) { return updateCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersion, certificatePolicy, certificateAttributes, tags).toBlocking().single().body(); }
[ "public", "CertificateBundle", "updateCertificate", "(", "String", "vaultBaseUrl", ",", "String", "certificateName", ",", "String", "certificateVersion", ",", "CertificatePolicy", "certificatePolicy", ",", "CertificateAttributes", "certificateAttributes", ",", "Map", "<", "...
Updates the specified attributes associated with the given certificate. The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate's attributes. This operation requires the certificates/update permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param certificateName The name of the certificate in the given key vault. @param certificateVersion The version of the certificate. @param certificatePolicy The management policy for the certificate. @param certificateAttributes The attributes of the certificate (optional). @param tags Application specific metadata in the form of key-value pairs. @throws IllegalArgumentException thrown if parameters fail the validation @throws KeyVaultErrorException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the CertificateBundle object if successful.
[ "Updates", "the", "specified", "attributes", "associated", "with", "the", "given", "certificate", ".", "The", "UpdateCertificate", "operation", "applies", "the", "specified", "update", "on", "the", "given", "certificate", ";", "the", "only", "elements", "updated", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L7435-L7437
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java
MatchSpaceImpl.getCacheEntry
private CacheEntry getCacheEntry(Object value, boolean create) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry( this,cclass, "getCacheEntry", new Object[] { value, new Boolean(create), matchCache }); CacheEntry e = (CacheEntry) matchCache.get(value); if (e == null) { if (create) { e = new CacheEntry(); // The following method call may stimulate multiple callbacks to the shouldRetain // method if the Hashtable is at the rehash threshold. matchCache.put(value, e); cacheCreates++; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "getCacheEntry", e); return e; }
java
private CacheEntry getCacheEntry(Object value, boolean create) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry( this,cclass, "getCacheEntry", new Object[] { value, new Boolean(create), matchCache }); CacheEntry e = (CacheEntry) matchCache.get(value); if (e == null) { if (create) { e = new CacheEntry(); // The following method call may stimulate multiple callbacks to the shouldRetain // method if the Hashtable is at the rehash threshold. matchCache.put(value, e); cacheCreates++; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "getCacheEntry", e); return e; }
[ "private", "CacheEntry", "getCacheEntry", "(", "Object", "value", ",", "boolean", "create", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "entry", "(", "this", ",",...
Gets the appropriate CacheEntry for a value of the root Identifier @param value the value whose CacheEntry is desired @param create if true, the CacheEntry is created (empty) if it doesn't already exist. This should only be done in synchronized methods.
[ "Gets", "the", "appropriate", "CacheEntry", "for", "a", "value", "of", "the", "root", "Identifier" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java#L315-L341