method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public Node node(final String id, final Model model) { final Node node = new Node(); node.id = id; node.addChildren(model.nodes); node(node); for (final Disposable disposable : model.getManagedDisposables()) manage(disposable); return node; }
Node function(final String id, final Model model) { final Node node = new Node(); node.id = id; node.addChildren(model.nodes); node(node); for (final Disposable disposable : model.getManagedDisposables()) manage(disposable); return node; }
/** * Adds the nodes of the specified model to a new node of the model being * build. After this method the given model can no longer be used. Do not * call the {@link Model#dispose()} method on that model. * * @return The newly created node containing the nodes of the given model. */
Adds the nodes of the specified model to a new node of the model being build. After this method the given model can no longer be used. Do not call the <code>Model#dispose()</code> method on that model
node
{ "repo_name": "ari-zah/gaiasky", "path": "core/src/gaia/cu9/ari/gaiaorbit/util/g3d/ModelBuilder2.java", "license": "lgpl-3.0", "size": 43207 }
[ "com.badlogic.gdx.graphics.g3d.Model", "com.badlogic.gdx.graphics.g3d.model.Node", "com.badlogic.gdx.utils.Disposable" ]
import com.badlogic.gdx.graphics.g3d.Model; import com.badlogic.gdx.graphics.g3d.model.Node; import com.badlogic.gdx.utils.Disposable;
import com.badlogic.gdx.graphics.g3d.*; import com.badlogic.gdx.graphics.g3d.model.*; import com.badlogic.gdx.utils.*;
[ "com.badlogic.gdx" ]
com.badlogic.gdx;
990,528
public ArrayList<MyMTObject> getMyobjectList() { return myobjectList; }
ArrayList<MyMTObject> function() { return myobjectList; }
/**Returns the MyMTObject ArrayList for drawing. * @return the myobjectList */
Returns the MyMTObject ArrayList for drawing
getMyobjectList
{ "repo_name": "steffe/MT4J_KTSI", "path": "ktsi/ch/mitoco/dataController/DataController.java", "license": "gpl-2.0", "size": 11373 }
[ "ch.mitoco.components.visibleComponents.MyMTObject", "java.util.ArrayList" ]
import ch.mitoco.components.visibleComponents.MyMTObject; import java.util.ArrayList;
import ch.mitoco.components.*; import java.util.*;
[ "ch.mitoco.components", "java.util" ]
ch.mitoco.components; java.util;
297,060
@Override public Measure sinh(Measure measure) { try { double angle = this.getAngle(measure); Measure result = factory.createScalarMeasure(Math.sinh(angle),factory.getOne()); return result; } catch (FactoryException e) { throw new MathException("Could not create result measure because the unit One was not defined.", e); } }
Measure function(Measure measure) { try { double angle = this.getAngle(measure); Measure result = factory.createScalarMeasure(Math.sinh(angle),factory.getOne()); return result; } catch (FactoryException e) { throw new MathException(STR, e); } }
/** * Returns the hyperbolic sine of the measure. The unit of the parameter should be an angle unit (e.g. radian or degree) or * should have the same dimension as the angle units, i.e. be dimensionless. The unit of the result will also * be dimensionless. * * @param measure The measure whose hyperbolic sine is to be determined. * @return The hyperbolic sine of the measure. * @throws MathException When the measure contains a vector, which cannot be converted to an angle or * when the unit of the measure is not dimensionless, or when the unit One was not defined. */
Returns the hyperbolic sine of the measure. The unit of the parameter should be an angle unit (e.g. radian or degree) or should have the same dimension as the angle units, i.e. be dimensionless. The unit of the result will also be dimensionless
sinh
{ "repo_name": "dieudonne-willems/om-java-libs", "path": "OM-java-math-impl/src/main/java/nl/wur/fbr/om/math/impl/MathProcessorImpl.java", "license": "lgpl-3.0", "size": 56166 }
[ "nl.wur.fbr.om.exceptions.FactoryException", "nl.wur.fbr.om.math.processors.MathException", "nl.wur.fbr.om.model.measures.Measure" ]
import nl.wur.fbr.om.exceptions.FactoryException; import nl.wur.fbr.om.math.processors.MathException; import nl.wur.fbr.om.model.measures.Measure;
import nl.wur.fbr.om.exceptions.*; import nl.wur.fbr.om.math.processors.*; import nl.wur.fbr.om.model.measures.*;
[ "nl.wur.fbr" ]
nl.wur.fbr;
2,455,302
public void writeTo(Writer writer) throws IOException { if (mSign < 0 && (mDays > 0 || mTime > 0)) { writer.append('-'); } writer.append('P'); int weeks = getWeeks(); if (weeks > 0) { writer.write(Integer.toString(weeks)); writer.write('W'); } else { if (mDays > 0) { writer.write(Integer.toString(mDays)); writer.write('D'); } if (mTime != 0) { int hours = getHours(); int minutes = getMinutes(); int seconds = getSeconds(); writer.write('T'); if (hours > 0) { writer.write(Integer.toString(hours)); writer.write('H'); } if (minutes > 0) { writer.write(Integer.toString(minutes)); writer.write('M'); } if (seconds > 0) { writer.write(Integer.toString(seconds)); writer.write('S'); } } else if (mDays == 0) { writer.write("0D"); } } }
void function(Writer writer) throws IOException { if (mSign < 0 && (mDays > 0 mTime > 0)) { writer.append('-'); } writer.append('P'); int weeks = getWeeks(); if (weeks > 0) { writer.write(Integer.toString(weeks)); writer.write('W'); } else { if (mDays > 0) { writer.write(Integer.toString(mDays)); writer.write('D'); } if (mTime != 0) { int hours = getHours(); int minutes = getMinutes(); int seconds = getSeconds(); writer.write('T'); if (hours > 0) { writer.write(Integer.toString(hours)); writer.write('H'); } if (minutes > 0) { writer.write(Integer.toString(minutes)); writer.write('M'); } if (seconds > 0) { writer.write(Integer.toString(seconds)); writer.write('S'); } } else if (mDays == 0) { writer.write("0D"); } } }
/** * Write the Duration String to the given {@link Writer}. * * @param writer * A {@link Writer} to write to. * * @throws IOException */
Write the Duration String to the given <code>Writer</code>
writeTo
{ "repo_name": "dmfs/rfc5545-datetime", "path": "src/main/java/org/dmfs/rfc5545/Duration.java", "license": "apache-2.0", "size": 16666 }
[ "java.io.IOException", "java.io.Writer" ]
import java.io.IOException; import java.io.Writer;
import java.io.*;
[ "java.io" ]
java.io;
1,673,267
public boolean isPanningEvent(MouseEvent event) { return (event != null) ? event.isShiftDown() && event.isControlDown() : false; }
boolean function(MouseEvent event) { return (event != null) ? event.isShiftDown() && event.isControlDown() : false; }
/** * Note: This is not used during drag and drop operations due to limitations * of the underlying API. To enable this for move operations set dragEnabled * to false. * * @param event * @return Returns true if the given event is a panning event. */
Note: This is not used during drag and drop operations due to limitations of the underlying API. To enable this for move operations set dragEnabled to false
isPanningEvent
{ "repo_name": "pygospa/jgraphx", "path": "src/com/mxgraph/swing/mxGraphComponent.java", "license": "bsd-3-clause", "size": 102317 }
[ "java.awt.event.MouseEvent" ]
import java.awt.event.MouseEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
80,565
public XPathValue getValue() { return this.value; }
XPathValue function() { return this.value; }
/** * Missing description at method getValue. * * @return the XPathValue. */
Missing description at method getValue
getValue
{ "repo_name": "NABUCCO/org.nabucco.testautomation", "path": "org.nabucco.testautomation.facade.datatype/src/main/gen/org/nabucco/testautomation/facade/datatype/property/XPathProperty.java", "license": "epl-1.0", "size": 6241 }
[ "org.nabucco.testautomation.facade.datatype.base.XPathValue" ]
import org.nabucco.testautomation.facade.datatype.base.XPathValue;
import org.nabucco.testautomation.facade.datatype.base.*;
[ "org.nabucco.testautomation" ]
org.nabucco.testautomation;
206,177
@Override protected void actionPerformed(GuiButton button) { if (button.id == 2000) { try { this.entryList.saveListChanges(); } catch (Throwable e) { e.printStackTrace(); } this.mc.displayGuiScreen(this.parentScreen); } else if (button.id == 2001) { this.currentValues = configElement.getDefaults(); this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues); } else if (button.id == 2002) { this.currentValues = Arrays.copyOf(beforeValues, beforeValues.length); this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues); } }
void function(GuiButton button) { if (button.id == 2000) { try { this.entryList.saveListChanges(); } catch (Throwable e) { e.printStackTrace(); } this.mc.displayGuiScreen(this.parentScreen); } else if (button.id == 2001) { this.currentValues = configElement.getDefaults(); this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues); } else if (button.id == 2002) { this.currentValues = Arrays.copyOf(beforeValues, beforeValues.length); this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues); } }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */
Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
actionPerformed
{ "repo_name": "tomtomtom09/CampCraft", "path": "build/tmp/recompileMc/sources/net/minecraftforge/fml/client/config/GuiEditArray.java", "license": "gpl-3.0", "size": 9633 }
[ "java.util.Arrays", "net.minecraft.client.gui.GuiButton" ]
import java.util.Arrays; import net.minecraft.client.gui.GuiButton;
import java.util.*; import net.minecraft.client.gui.*;
[ "java.util", "net.minecraft.client" ]
java.util; net.minecraft.client;
2,847,180
private void initToolBar() { IActionBars bars = getViewSite().getActionBars(); IToolBarManager tm = bars.getToolBarManager(); createFilterAction(); tm.add(new Separator("FilterGroup")); //$NON-NLS-1$ tm.add(filterAction); }
void function() { IActionBars bars = getViewSite().getActionBars(); IToolBarManager tm = bars.getToolBarManager(); createFilterAction(); tm.add(new Separator(STR)); tm.add(filterAction); }
/** * Add additional actions to the tool bar. */
Add additional actions to the tool bar
initToolBar
{ "repo_name": "elucash/eclipse-oxygen", "path": "org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/ExtendedMarkersView.java", "license": "epl-1.0", "size": 48948 }
[ "org.eclipse.jface.action.IToolBarManager", "org.eclipse.jface.action.Separator", "org.eclipse.ui.IActionBars" ]
import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.Separator; import org.eclipse.ui.IActionBars;
import org.eclipse.jface.action.*; import org.eclipse.ui.*;
[ "org.eclipse.jface", "org.eclipse.ui" ]
org.eclipse.jface; org.eclipse.ui;
1,798,681
public void onMinecartPass(EntityMinecart cart);
void function(EntityMinecart cart);
/** * This function is called by any minecart that passes over this rail. It is * called once per update tick that the minecart is on the rail. * * @param cart The cart on the rail. */
This function is called by any minecart that passes over this rail. It is called once per update tick that the minecart is on the rail
onMinecartPass
{ "repo_name": "lf-/lftweaks", "path": "src/api/java/mods/railcraft/api/tracks/ITrackInstance.java", "license": "epl-1.0", "size": 3897 }
[ "net.minecraft.entity.item.EntityMinecart" ]
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.item.*;
[ "net.minecraft.entity" ]
net.minecraft.entity;
2,137,451
private byte[] read() throws IOException { byte [] ret = nxtComm.read(false); if (ret == null || ret.length == 0) throw new IOException("Read timeout"); // System.out.println("Debug: "+new String(ret, CHARSET)); return ret; }
byte[] function() throws IOException { byte [] ret = nxtComm.read(false); if (ret == null ret.length == 0) throw new IOException(STR); return ret; }
/** * Helper function perform a read with timeout. * @return Bytes read from the device. * @throws java.io.IOException */
Helper function perform a read with timeout
read
{ "repo_name": "marianmoldovan/atclegonxt", "path": "ATC Lego NXT/src/lejos/pc/comm/NXTSamba.java", "license": "gpl-2.0", "size": 17464 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,696,675
@NotAuditable Collection<QName> getProperties(QName model, QName dataType);
Collection<QName> getProperties(QName model, QName dataType);
/** * Get all properties defined for the given model with the given data type. * * Note that DataTypeDefinition.ANY will only match this type and can not be used as get all properties. * * If dataType is null then this method will return *ALL* properties regardless of data type. * * @param model QName * @param dataType QName * @return Collection<QName> */
Get all properties defined for the given model with the given data type. Note that DataTypeDefinition.ANY will only match this type and can not be used as get all properties. If dataType is null then this method will return *ALL* properties regardless of data type
getProperties
{ "repo_name": "nguyentienlong/community-edition", "path": "projects/data-model/source/java/org/alfresco/service/cmr/dictionary/DictionaryService.java", "license": "lgpl-3.0", "size": 10139 }
[ "java.util.Collection", "org.alfresco.service.namespace.QName" ]
import java.util.Collection; import org.alfresco.service.namespace.QName;
import java.util.*; import org.alfresco.service.namespace.*;
[ "java.util", "org.alfresco.service" ]
java.util; org.alfresco.service;
1,667,469
protected void loadConfig() throws IOException { Properties properties = new Properties(); properties.load(getConfigResource().getInputStream()); _jdbcDriver = properties.getProperty("jdbcdriver"); _url = properties.getProperty("url"); _userName = properties.getProperty("username"); _password = properties.getProperty("password"); _userTable = properties.getProperty("usertable"); _userTableKey = properties.getProperty("usertablekey"); _userTableUserField = properties.getProperty("usertableuserfield"); _userTablePasswordField = properties.getProperty("usertablepasswordfield"); _roleTable = properties.getProperty("roletable"); _roleTableKey = properties.getProperty("roletablekey"); _roleTableRoleField = properties.getProperty("roletablerolefield"); _userRoleTable = properties.getProperty("userroletable"); _userRoleTableUserKey = properties.getProperty("userroletableuserkey"); _userRoleTableRoleKey = properties.getProperty("userroletablerolekey"); // default cachetime = 30s String cachetime = properties.getProperty("cachetime"); _cacheTime = cachetime!=null ? new Integer(cachetime).intValue() : 30; if (_jdbcDriver == null || _jdbcDriver.equals("") || _url == null || _url.equals("") || _userName == null || _userName.equals("") || _password == null || _cacheTime < 0) { if(Log.isDebugEnabled())Log.debug("UserRealm " + getName() + " has not been properly configured"); } _cacheTime *= 1000; _lastHashPurge = 0; _userSql = "select " + _userTableKey + "," + _userTablePasswordField + " from " + _userTable + " where " + _userTableUserField + " = ?"; _roleSql = "select r." + _roleTableRoleField + " from " + _roleTable + " r, " + _userRoleTable + " u where u." + _userRoleTableUserKey + " = ?" + " and r." + _roleTableKey + " = u." + _userRoleTableRoleKey; }
void function() throws IOException { Properties properties = new Properties(); properties.load(getConfigResource().getInputStream()); _jdbcDriver = properties.getProperty(STR); _url = properties.getProperty("url"); _userName = properties.getProperty(STR); _password = properties.getProperty(STR); _userTable = properties.getProperty(STR); _userTableKey = properties.getProperty(STR); _userTableUserField = properties.getProperty(STR); _userTablePasswordField = properties.getProperty(STR); _roleTable = properties.getProperty(STR); _roleTableKey = properties.getProperty(STR); _roleTableRoleField = properties.getProperty(STR); _userRoleTable = properties.getProperty(STR); _userRoleTableUserKey = properties.getProperty(STR); _userRoleTableRoleKey = properties.getProperty(STR); String cachetime = properties.getProperty(STR); _cacheTime = cachetime!=null ? new Integer(cachetime).intValue() : 30; if (_jdbcDriver == null _jdbcDriver.equals(STRSTRSTRUserRealm STR has not been properly configuredSTRselect STR,STR from STR where STR = ?STRselect r.STR from STR r, STR u where u.STR = ?STR and r.STR = u." + _userRoleTableRoleKey; }
/** Load JDBC connection configuration from properties file. * * @exception IOException */
Load JDBC connection configuration from properties file
loadConfig
{ "repo_name": "napcs/qedserver", "path": "jetty/modules/jetty/src/main/java/org/mortbay/jetty/security/JDBCUserRealm.java", "license": "mit", "size": 10230 }
[ "java.io.IOException", "java.util.Properties" ]
import java.io.IOException; import java.util.Properties;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,886,042
@VisibleForTesting public Set testHookKeys() { checkReadiness(); checkForNoAccess(); return new EntriesSet(this, false, IteratorType.KEYS, false ); }
Set function() { checkReadiness(); checkForNoAccess(); return new EntriesSet(this, false, IteratorType.KEYS, false ); }
/** * Flavor of keys that will not do repeatable read * * @since GemFire 5.5 */
Flavor of keys that will not do repeatable read
testHookKeys
{ "repo_name": "PurelyApplied/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java", "license": "apache-2.0", "size": 391137 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,585,762
public Collection<String> getManagingSiteIdentifiers() { return managingSiteIdentifiers; }
Collection<String> function() { return managingSiteIdentifiers; }
/** * The semantics for this collection are defined by the subclasses. */
The semantics for this collection are defined by the subclasses
getManagingSiteIdentifiers
{ "repo_name": "NUBIC/psc-mirror", "path": "authorization/definitions/src/main/java/edu/northwestern/bioinformatics/studycalendar/security/authorization/VisibleDomainObjectParameters.java", "license": "bsd-3-clause", "size": 4543 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
177,804
public void close() throws IOException { if (epilogue) { os.close(); if (!invalidObject) { try { fo.parseEpilogue(buffer.toString()); } catch (Exception e) { Log.error("Error parsing file object epilogue: " + e.toString()); throw new IOException("Error parsing file object epilogue: " + e.toString()); } } } else if (prologue) { // It is possible the entire file object fits in 1024 bytes, // so we can try to parse everything try { if (!invalidObject) { String obj = buffer.toString(); ByteArrayInputStream bis = new ByteArrayInputStream(obj.getBytes()); String bod = fo.parse(bis); if (bod != null) { if (fo.isBodyBase64()) { byte tBuf[] = Base64.decode(bod.getBytes()); os.write(tBuf); } else { os.write(bod.getBytes()); } os.close(); } else { // The file has an empty content Log.debug("Received an emtpy file"); } } else { os.close(); } } catch (Exception e) { Log.error("Error while parsing file object: " + e.toString()); throw new IOException("Error parsing file object epilogue: " + e.toString()); } } else { os.close(); // The stream is interrupted in the middle of the // body or the prologue. We shall throw an exception to signal that this // item is invalid throw new IOException("Incomplete file object item"); } }
void function() throws IOException { if (epilogue) { os.close(); if (!invalidObject) { try { fo.parseEpilogue(buffer.toString()); } catch (Exception e) { Log.error(STR + e.toString()); throw new IOException(STR + e.toString()); } } } else if (prologue) { try { if (!invalidObject) { String obj = buffer.toString(); ByteArrayInputStream bis = new ByteArrayInputStream(obj.getBytes()); String bod = fo.parse(bis); if (bod != null) { if (fo.isBodyBase64()) { byte tBuf[] = Base64.decode(bod.getBytes()); os.write(tBuf); } else { os.write(bod.getBytes()); } os.close(); } else { Log.debug(STR); } } else { os.close(); } } catch (Exception e) { Log.error(STR + e.toString()); throw new IOException(STR + e.toString()); } } else { os.close(); throw new IOException(STR); } }
/** * Close the output stream. When the stream is closed, the method makes sure * that no pending bytes are present. If there are, then the body and the * FileObject may get updated. After the stream has been closed, it is safe * to read the FileObject. * * @throws IOException if the operation cannot be performed. Either because * the underlying output stream has a failure or because the the meta * information cannot be parsed properly. */
Close the output stream. When the stream is closed, the method makes sure that no pending bytes are present. If there are, then the body and the FileObject may get updated. After the stream has been closed, it is safe to read the FileObject
close
{ "repo_name": "accesstest3/AndroidFunambol", "path": "externals/jme-sdk/syncml/src/com/funambol/syncml/client/FileObjectOutputStream.java", "license": "agpl-3.0", "size": 10576 }
[ "com.funambol.util.Base64", "com.funambol.util.Log", "java.io.ByteArrayInputStream", "java.io.IOException" ]
import com.funambol.util.Base64; import com.funambol.util.Log; import java.io.ByteArrayInputStream; import java.io.IOException;
import com.funambol.util.*; import java.io.*;
[ "com.funambol.util", "java.io" ]
com.funambol.util; java.io;
2,736,008
@NotNull public static MvccQueryTracker mvccTracker(GridCacheContext cctx, GridNearTxLocal tx) throws IgniteCheckedException { MvccQueryTracker tracker; if (tx == null) tracker = new MvccQueryTrackerImpl(cctx); else if ((tracker = tx.mvccQueryTracker()) == null) tracker = new StaticMvccQueryTracker(cctx, requestSnapshot(cctx, tx)); if (tracker.snapshot() == null) // TODO IGNITE-7388 tracker.requestSnapshot().get(); return tracker; }
@NotNull static MvccQueryTracker function(GridCacheContext cctx, GridNearTxLocal tx) throws IgniteCheckedException { MvccQueryTracker tracker; if (tx == null) tracker = new MvccQueryTrackerImpl(cctx); else if ((tracker = tx.mvccQueryTracker()) == null) tracker = new StaticMvccQueryTracker(cctx, requestSnapshot(cctx, tx)); if (tracker.snapshot() == null) tracker.requestSnapshot().get(); return tracker; }
/** * Initialises MVCC filter and returns MVCC query tracker if needed. * @param cctx Cache context. * @param tx Transaction. * @return MVCC query tracker. * @throws IgniteCheckedException If failed. */
Initialises MVCC filter and returns MVCC query tracker if needed
mvccTracker
{ "repo_name": "amirakhmedov/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/mvcc/MvccUtils.java", "license": "apache-2.0", "size": 34219 }
[ "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.internal.processors.cache.GridCacheContext", "org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal", "org.jetbrains.annotations.NotNull" ]
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.processors.cache.GridCacheContext; import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal; import org.jetbrains.annotations.NotNull;
import org.apache.ignite.*; import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.distributed.near.*; import org.jetbrains.annotations.*;
[ "org.apache.ignite", "org.jetbrains.annotations" ]
org.apache.ignite; org.jetbrains.annotations;
1,429,960
public HttpClient build() { return new HttpClient(new TestingHttpClientFactory(requestMap.build(), observers)); } /** * Match with a fully customizable {@link RequestMatcher}
HttpClient function() { return new HttpClient(new TestingHttpClientFactory(requestMap.build(), observers)); } /** * Match with a fully customizable {@link RequestMatcher}
/** * Build the {@link HttpClient}. The builder is unchanged. * @return a new HttpClient. The returned client is immutable or thread safe * if and only if all provided request matchers and response generators are. */
Build the <code>HttpClient</code>. The builder is unchanged
build
{ "repo_name": "NessComputing/components-ness-httpclient", "path": "testing/src/main/java/com/nesscomputing/httpclient/testing/TestingHttpClientBuilder.java", "license": "apache-2.0", "size": 5606 }
[ "com.nesscomputing.httpclient.HttpClient" ]
import com.nesscomputing.httpclient.HttpClient;
import com.nesscomputing.httpclient.*;
[ "com.nesscomputing.httpclient" ]
com.nesscomputing.httpclient;
994,556
public NewAction addSelectionModeParam() { createParam(Param.SELECTED) .setDescription("Depending on the value, show only selected items (selected=selected), deselected items (selected=deselected), " + "or all items with their selection status (selected=all).") .setDefaultValue(SelectionMode.SELECTED.value()) .setPossibleValues(SelectionMode.possibleValues()); return this; } } @Immutable class Action { private static final Logger LOGGER = Loggers.get(Action.class); private final String key; private final String deprecatedKey; private final String path; private final String description; private final String since; private final String deprecatedSince; private final boolean post; private final boolean isInternal; private final RequestHandler handler; private final Map<String, Param> params; private final URL responseExample; private Action(Controller controller, NewAction newAction) { this.key = newAction.key; this.deprecatedKey = newAction.deprecatedKey; this.path = format("%s/%s", controller.path(), key); this.description = newAction.description; this.since = newAction.since; this.deprecatedSince = newAction.deprecatedSince; this.post = newAction.post; this.isInternal = newAction.isInternal; this.responseExample = newAction.responseExample; this.handler = newAction.handler; checkState(this.handler != null, "RequestHandler is not set on action " + path); logWarningIf(isNullOrEmpty(this.description), "Description is not set on action " + path); logWarningIf(isNullOrEmpty(this.since), "Since is not set on action " + path); logWarningIf(!this.post && this.responseExample == null, "The response example is not set on action " + path); ImmutableMap.Builder<String, Param> paramsBuilder = ImmutableMap.builder(); for (NewParam newParam : newAction.newParams.values()) { paramsBuilder.put(newParam.key, new Param(this, newParam)); } this.params = paramsBuilder.build(); }
NewAction function() { createParam(Param.SELECTED) .setDescription(STR + STR) .setDefaultValue(SelectionMode.SELECTED.value()) .setPossibleValues(SelectionMode.possibleValues()); return this; } } class Action { private static final Logger LOGGER = Loggers.get(Action.class); private final String key; private final String deprecatedKey; private final String path; private final String description; private final String since; private final String deprecatedSince; private final boolean post; private final boolean isInternal; private final RequestHandler handler; private final Map<String, Param> params; private final URL responseExample; private Action(Controller controller, NewAction newAction) { this.key = newAction.key; this.deprecatedKey = newAction.deprecatedKey; this.path = format("%s/%s", controller.path(), key); this.description = newAction.description; this.since = newAction.since; this.deprecatedSince = newAction.deprecatedSince; this.post = newAction.post; this.isInternal = newAction.isInternal; this.responseExample = newAction.responseExample; this.handler = newAction.handler; checkState(this.handler != null, STR + path); logWarningIf(isNullOrEmpty(this.description), STR + path); logWarningIf(isNullOrEmpty(this.since), STR + path); logWarningIf(!this.post && this.responseExample == null, STR + path); ImmutableMap.Builder<String, Param> paramsBuilder = ImmutableMap.builder(); for (NewParam newParam : newAction.newParams.values()) { paramsBuilder.put(newParam.key, new Param(this, newParam)); } this.params = paramsBuilder.build(); }
/** * Add 'selected=(selected|deselected|all)' for select-list oriented WS. */
Add 'selected=(selected|deselected|all)' for select-list oriented WS
addSelectionModeParam
{ "repo_name": "vamsirajendra/sonarqube", "path": "sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java", "license": "lgpl-3.0", "size": 24949 }
[ "com.google.common.base.Preconditions", "com.google.common.collect.ImmutableMap", "java.lang.String", "java.util.Map", "org.sonar.api.utils.log.Logger", "org.sonar.api.utils.log.Loggers" ]
import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.lang.String; import java.util.Map; import org.sonar.api.utils.log.Logger; import org.sonar.api.utils.log.Loggers;
import com.google.common.base.*; import com.google.common.collect.*; import java.lang.*; import java.util.*; import org.sonar.api.utils.log.*;
[ "com.google.common", "java.lang", "java.util", "org.sonar.api" ]
com.google.common; java.lang; java.util; org.sonar.api;
1,282,649
public synchronized void updateShortCuts(int skillId, int skillLevel) { // Update all the shortcuts for this skill for (Shortcut sc : _shortCuts.values()) { if ((sc.getId() == skillId) && (sc.getType() == ShortcutType.SKILL)) { final Shortcut newsc = new Shortcut(sc.getSlot(), sc.getPage(), sc.getType(), sc.getId(), skillLevel, 1); _owner.sendPacket(new ShortCutRegister(newsc)); _owner.registerShortCut(newsc); } } }
synchronized void function(int skillId, int skillLevel) { for (Shortcut sc : _shortCuts.values()) { if ((sc.getId() == skillId) && (sc.getType() == ShortcutType.SKILL)) { final Shortcut newsc = new Shortcut(sc.getSlot(), sc.getPage(), sc.getType(), sc.getId(), skillLevel, 1); _owner.sendPacket(new ShortCutRegister(newsc)); _owner.registerShortCut(newsc); } } }
/** * Updates the shortcut bars with the new skill. * @param skillId the skill Id to search and update. * @param skillLevel the skill level to update. */
Updates the shortcut bars with the new skill
updateShortCuts
{ "repo_name": "rubenswagner/L2J-Global", "path": "java/com/l2jglobal/gameserver/model/ShortCuts.java", "license": "gpl-3.0", "size": 7530 }
[ "com.l2jglobal.gameserver.enums.ShortcutType", "com.l2jglobal.gameserver.network.serverpackets.ShortCutRegister" ]
import com.l2jglobal.gameserver.enums.ShortcutType; import com.l2jglobal.gameserver.network.serverpackets.ShortCutRegister;
import com.l2jglobal.gameserver.enums.*; import com.l2jglobal.gameserver.network.serverpackets.*;
[ "com.l2jglobal.gameserver" ]
com.l2jglobal.gameserver;
2,858,595
public static void saveToStorage() throws BackingStoreException { preferences.flush(); }
static void function() throws BackingStoreException { preferences.flush(); }
/** * Saves the current preferences to storage. This is only needed if the * preferences files are going to be copied to another location while * Autopsy is running. * * @throws BackingStoreException */
Saves the current preferences to storage. This is only needed if the preferences files are going to be copied to another location while Autopsy is running
saveToStorage
{ "repo_name": "sleuthkit/autopsy", "path": "KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/UserPreferences.java", "license": "apache-2.0", "size": 3814 }
[ "java.util.prefs.BackingStoreException" ]
import java.util.prefs.BackingStoreException;
import java.util.prefs.*;
[ "java.util" ]
java.util;
399,810
private Query createWildcardQuery(String fieldName, String fieldValue) { BooleanQuery query = new BooleanQuery(); String termValue = fieldValue + LuceneConstants.CHAR_WILDCARD; Term term = new Term(fieldName, termValue); query.add(new WildcardQuery(term), Occur.SHOULD); // Additional Search Field (Column) String searchTermValue = LuceneAccentConverter.removeAccents(fieldValue).toLowerCase() + LuceneConstants.CHAR_WILDCARD; Term searchTerm = new Term(fieldName + LuceneConstants.SEARCH_FIELD_SUFFIX, searchTermValue); query.add(new WildcardQuery(searchTerm), Occur.SHOULD); return query; }
Query function(String fieldName, String fieldValue) { BooleanQuery query = new BooleanQuery(); String termValue = fieldValue + LuceneConstants.CHAR_WILDCARD; Term term = new Term(fieldName, termValue); query.add(new WildcardQuery(term), Occur.SHOULD); String searchTermValue = LuceneAccentConverter.removeAccents(fieldValue).toLowerCase() + LuceneConstants.CHAR_WILDCARD; Term searchTerm = new Term(fieldName + LuceneConstants.SEARCH_FIELD_SUFFIX, searchTermValue); query.add(new WildcardQuery(searchTerm), Occur.SHOULD); return query; }
/** * Create a wildcard search query. The result must only start with the field value. * * @param fieldName * name of the field * @param fieldValue * value of the field * * @return the query */
Create a wildcard search query. The result must only start with the field value
createWildcardQuery
{ "repo_name": "NABUCCO/org.nabucco.adapter.lucene", "path": "org.nabucco.adapter.lucene.impl.connector/src/main/man/org/nabucco/adapter/lucene/impl/connector/ra/spi/LuceneSearchServiceImpl.java", "license": "epl-1.0", "size": 16717 }
[ "org.apache.lucene.index.Term", "org.apache.lucene.search.BooleanClause", "org.apache.lucene.search.BooleanQuery", "org.apache.lucene.search.Query", "org.apache.lucene.search.WildcardQuery", "org.nabucco.adapter.lucene.impl.connector.ra.spi.util.LuceneAccentConverter" ]
import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.WildcardQuery; import org.nabucco.adapter.lucene.impl.connector.ra.spi.util.LuceneAccentConverter;
import org.apache.lucene.index.*; import org.apache.lucene.search.*; import org.nabucco.adapter.lucene.impl.connector.ra.spi.util.*;
[ "org.apache.lucene", "org.nabucco.adapter" ]
org.apache.lucene; org.nabucco.adapter;
1,635,664
@ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable<EventhubInner> listByNamespace( String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top, context)); }
@ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<EventhubInner> function( String resourceGroupName, String namespaceName, Integer skip, Integer top, Context context) { return new PagedIterable<>(listByNamespaceAsync(resourceGroupName, namespaceName, skip, top, context)); }
/** * Gets all the Event Hubs in a Namespace. * * @param resourceGroupName Name of the resource group within the azure subscription. * @param namespaceName The Namespace name. * @param skip Skip is only used if a previous operation returned a partial result. If a previous response contains * a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting * point to use for subsequent calls. * @param top May be used to limit the number of results to the most recent N usageDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all the Event Hubs in a Namespace. */
Gets all the Event Hubs in a Namespace
listByNamespace
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubsClientImpl.java", "license": "mit", "size": 114749 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedIterable", "com.azure.core.util.Context", "com.azure.resourcemanager.eventhubs.fluent.models.EventhubInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.resourcemanager.eventhubs.fluent.models.EventhubInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.eventhubs.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,998,407
@ServiceMethod(returns = ReturnType.SINGLE) public Mono<Response<Flux<ByteBuffer>>> createWithResponseAsync( String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } if (agentPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); } if (agentPool == null) { return Mono.error(new IllegalArgumentException("Parameter agentPool is required and cannot be null.")); } else { agentPool.validate(); } final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( context -> service .create( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, apiVersion, agentPoolName, agentPool, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<Flux<ByteBuffer>>> function( String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (registryName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (agentPoolName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (agentPool == null) { return Mono.error(new IllegalArgumentException(STR)); } else { agentPool.validate(); } final String apiVersion = STR; final String accept = STR; return FluxUtil .withContext( context -> service .create( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, apiVersion, agentPoolName, agentPool, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); }
/** * Creates an agent pool for a container registry with the specified parameters. * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param registryName The name of the container registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the agentpool that has the ARM resource and properties. */
Creates an agent pool for a container registry with the specified parameters
createWithResponseAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/AgentPoolsClientImpl.java", "license": "mit", "size": 81743 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.FluxUtil", "com.azure.resourcemanager.containerregistry.fluent.models.AgentPoolInner", "java.nio.ByteBuffer" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.containerregistry.fluent.models.AgentPoolInner; import java.nio.ByteBuffer;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.containerregistry.fluent.models.*; import java.nio.*;
[ "com.azure.core", "com.azure.resourcemanager", "java.nio" ]
com.azure.core; com.azure.resourcemanager; java.nio;
1,726,173
public static void d(String tag, String msg) { if (VenvyDebug.getInstance().isDebug()) { Log.d(venvyLogTag + ":" + tag, buildMessage(msg)); } }
static void function(String tag, String msg) { if (VenvyDebug.getInstance().isDebug()) { Log.d(venvyLogTag + ":" + tag, buildMessage(msg)); } }
/** * Send a DEBGU log message. * * @param msg The message you would like logged. */
Send a DEBGU log message
d
{ "repo_name": "yanjiangbo06/libraryDemo", "path": "commonlibrary/src/main/java/cn/com/venvy/common/utils/VenvyLog.java", "license": "epl-1.0", "size": 6188 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
866,021
ForumStats getBoardStatus() ;
ForumStats getBoardStatus() ;
/** * Gets general statistics from the board * @return ForumStats */
Gets general statistics from the board
getBoardStatus
{ "repo_name": "3mtee/jforum", "path": "target/jforum/src/main/java/net/jforum/dao/ForumDAO.java", "license": "bsd-3-clause", "size": 7875 }
[ "net.jforum.entities.ForumStats" ]
import net.jforum.entities.ForumStats;
import net.jforum.entities.*;
[ "net.jforum.entities" ]
net.jforum.entities;
855,625
public Widget getDragWidget() { return createMockComponent(name, editor); }
Widget function() { return createMockComponent(name, editor); }
/** * Returns a draggable image for the component. Used when dragging a * component from the palette onto the form. * * @return draggable widget for component */
Returns a draggable image for the component. Used when dragging a component from the palette onto the form
getDragWidget
{ "repo_name": "ZachLamb/appinventor-sources", "path": "appinventor/appengine/src/com/google/appinventor/client/editor/simple/palette/SimpleComponentDescriptor.java", "license": "apache-2.0", "size": 13462 }
[ "com.google.gwt.user.client.ui.Widget" ]
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.*;
[ "com.google.gwt" ]
com.google.gwt;
143,963
public void setPermazen(Permazen jdb) { this.jdb = jdb; }
void function(Permazen jdb) { this.jdb = jdb; }
/** * Configure the {@link Permazen} that this instance will operate on. * * <p> * Required property. * * @param jdb associated database */
Configure the <code>Permazen</code> that this instance will operate on. Required property
setPermazen
{ "repo_name": "permazen/permazen", "path": "permazen-spring/src/main/java/io/permazen/spring/PermazenTransactionManager.java", "license": "apache-2.0", "size": 18279 }
[ "io.permazen.Permazen" ]
import io.permazen.Permazen;
import io.permazen.*;
[ "io.permazen" ]
io.permazen;
792,785
public static void help(JConsole jc){ //Clean the report area jc.clearArea(0,yMax+3,30,1); //move the cursor jc.setCursorPos(0,yMax+3); //write the report jc.write("little help: \n",Color.GREEN,Color.BLACK); //refresh the console jc.repaint(0,yMax+3,30,1); }
static void function(JConsole jc){ jc.clearArea(0,yMax+3,30,1); jc.setCursorPos(0,yMax+3); jc.write(STR,Color.GREEN,Color.BLACK); jc.repaint(0,yMax+3,30,1); }
/** * Print the ingame help */
Print the ingame help
help
{ "repo_name": "slavni96/iRogue", "path": "src/User/Player.java", "license": "mit", "size": 3600 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
785,624
public static void copyToDevice(GPUContext gCtx, CSRPointer dest, int rows, long nnz, int[] rowPtr, int[] colInd, double[] values) { CSRPointer r = dest; long t0 = 0; if (ConfigurationManager.isStatistics()) t0 = System.nanoTime(); r.nnz = nnz; if(rows < 0) throw new DMLRuntimeException("Incorrect input parameter: rows=" + rows); if(nnz < 0) throw new DMLRuntimeException("Incorrect input parameter: nnz=" + nnz); if(rowPtr.length < rows + 1) throw new DMLRuntimeException("The length of rowPtr needs to be greater than or equal to " + (rows + 1)); if(colInd.length < nnz) throw new DMLRuntimeException("The length of colInd needs to be greater than or equal to " + nnz); if(values.length < nnz) throw new DMLRuntimeException("The length of values needs to be greater than or equal to " + nnz); LibMatrixCUDA.cudaSupportFunctions.hostToDevice(gCtx, values, r.val, null); cudaMemcpy(r.rowPtr, Pointer.to(rowPtr), getIntSizeOf(rows + 1), cudaMemcpyHostToDevice); cudaMemcpy(r.colInd, Pointer.to(colInd), getIntSizeOf(nnz), cudaMemcpyHostToDevice); if (ConfigurationManager.isStatistics()) GPUStatistics.cudaToDevTime.add(System.nanoTime() - t0); if (ConfigurationManager.isStatistics()) GPUStatistics.cudaToDevCount.add(3); }
static void function(GPUContext gCtx, CSRPointer dest, int rows, long nnz, int[] rowPtr, int[] colInd, double[] values) { CSRPointer r = dest; long t0 = 0; if (ConfigurationManager.isStatistics()) t0 = System.nanoTime(); r.nnz = nnz; if(rows < 0) throw new DMLRuntimeException(STR + rows); if(nnz < 0) throw new DMLRuntimeException(STR + nnz); if(rowPtr.length < rows + 1) throw new DMLRuntimeException(STR + (rows + 1)); if(colInd.length < nnz) throw new DMLRuntimeException(STR + nnz); if(values.length < nnz) throw new DMLRuntimeException(STR + nnz); LibMatrixCUDA.cudaSupportFunctions.hostToDevice(gCtx, values, r.val, null); cudaMemcpy(r.rowPtr, Pointer.to(rowPtr), getIntSizeOf(rows + 1), cudaMemcpyHostToDevice); cudaMemcpy(r.colInd, Pointer.to(colInd), getIntSizeOf(nnz), cudaMemcpyHostToDevice); if (ConfigurationManager.isStatistics()) GPUStatistics.cudaToDevTime.add(System.nanoTime() - t0); if (ConfigurationManager.isStatistics()) GPUStatistics.cudaToDevCount.add(3); }
/** * Static method to copy a CSR sparse matrix from Host to Device * * @param gCtx GPUContext * @param dest [input] destination location (on GPU) * @param rows number of rows * @param nnz number of non-zeroes * @param rowPtr integer array of row pointers * @param colInd integer array of column indices * @param values double array of non zero values */
Static method to copy a CSR sparse matrix from Host to Device
copyToDevice
{ "repo_name": "niketanpansare/systemml", "path": "src/main/java/org/apache/sysml/runtime/instructions/gpu/context/CSRPointer.java", "license": "apache-2.0", "size": 21549 }
[ "org.apache.sysml.conf.ConfigurationManager", "org.apache.sysml.runtime.DMLRuntimeException", "org.apache.sysml.runtime.matrix.data.LibMatrixCUDA", "org.apache.sysml.utils.GPUStatistics" ]
import org.apache.sysml.conf.ConfigurationManager; import org.apache.sysml.runtime.DMLRuntimeException; import org.apache.sysml.runtime.matrix.data.LibMatrixCUDA; import org.apache.sysml.utils.GPUStatistics;
import org.apache.sysml.conf.*; import org.apache.sysml.runtime.*; import org.apache.sysml.runtime.matrix.data.*; import org.apache.sysml.utils.*;
[ "org.apache.sysml" ]
org.apache.sysml;
1,168,870
Users getUsersByProject(Long projectId);
Users getUsersByProject(Long projectId);
/** * Gets user list assigned to the given project.<br> * {@link VcmsObjectNotFoundException} is thrown when when the project with specified id does not exist. * @param projectId * @return */
Gets user list assigned to the given project. <code>VcmsObjectNotFoundException</code> is thrown when when the project with specified id does not exist
getUsersByProject
{ "repo_name": "ow2-xlcloud/vcms", "path": "impl/src/main/java/org/xlcloud/service/manager/UsersManager.java", "license": "apache-2.0", "size": 3418 }
[ "org.xlcloud.service.Users" ]
import org.xlcloud.service.Users;
import org.xlcloud.service.*;
[ "org.xlcloud.service" ]
org.xlcloud.service;
464,071
@ApiModelProperty(value = "") public SettingsMetadata getCanManageUsersMetadata() { return canManageUsersMetadata; }
@ApiModelProperty(value = "") SettingsMetadata function() { return canManageUsersMetadata; }
/** * Get canManageUsersMetadata. * @return canManageUsersMetadata **/
Get canManageUsersMetadata
getCanManageUsersMetadata
{ "repo_name": "docusign/docusign-java-client", "path": "src/main/java/com/docusign/esign/model/UserAccountManagementGranularInformation.java", "license": "mit", "size": 26315 }
[ "com.docusign.esign.model.SettingsMetadata", "io.swagger.annotations.ApiModelProperty" ]
import com.docusign.esign.model.SettingsMetadata; import io.swagger.annotations.ApiModelProperty;
import com.docusign.esign.model.*; import io.swagger.annotations.*;
[ "com.docusign.esign", "io.swagger.annotations" ]
com.docusign.esign; io.swagger.annotations;
778,354
@Transactional(readOnly = true) public List<DataDict> findChildrenByRootPrimaryKey(String primaryKey, boolean withFlatChildren) { return findChildrens(dataDictDao.findByRootPrimaryKey(primaryKey), withFlatChildren); }
@Transactional(readOnly = true) List<DataDict> function(String primaryKey, boolean withFlatChildren) { return findChildrens(dataDictDao.findByRootPrimaryKey(primaryKey), withFlatChildren); }
/** * Based directly on the root primaryKey returns the corresponding set of data dictionary * @param PrimaryKey the root primaryKey Whether the association * @param withFlatChildren flat structure returns the child node data * @return */
Based directly on the root primaryKey returns the corresponding set of data dictionary
findChildrenByRootPrimaryKey
{ "repo_name": "mugenya/arch_app", "path": "src/main/java/lab/s2jh/module/sys/service/DataDictService.java", "license": "lgpl-3.0", "size": 5942 }
[ "java.util.List", "org.springframework.transaction.annotation.Transactional" ]
import java.util.List; import org.springframework.transaction.annotation.Transactional;
import java.util.*; import org.springframework.transaction.annotation.*;
[ "java.util", "org.springframework.transaction" ]
java.util; org.springframework.transaction;
1,027,507
protected void repopulateSearchTypeFlags() { boolean advancedSearch = isAdvancedSearch(); boolean superUserSearch = isSuperUserSearch(); int fieldsRepopulated = 0; Map<String, String[]> values = new HashMap<String, String[]>(); values.put(KRADConstants.ADVANCED_SEARCH_FIELD, new String[] { advancedSearch ? "YES" : "NO" }); values.put(DocumentSearchCriteriaProcessorKEWAdapter.SUPERUSER_SEARCH_FIELD, new String[] { superUserSearch ? "YES" : "NO" }); getFormFields().setFieldValues(values); }
void function() { boolean advancedSearch = isAdvancedSearch(); boolean superUserSearch = isSuperUserSearch(); int fieldsRepopulated = 0; Map<String, String[]> values = new HashMap<String, String[]>(); values.put(KRADConstants.ADVANCED_SEARCH_FIELD, new String[] { advancedSearch ? "YES" : "NO" }); values.put(DocumentSearchCriteriaProcessorKEWAdapter.SUPERUSER_SEARCH_FIELD, new String[] { superUserSearch ? "YES" : "NO" }); getFormFields().setFieldValues(values); }
/** * Repopulate the fields indicating advanced/superuser search type. */
Repopulate the fields indicating advanced/superuser search type
repopulateSearchTypeFlags
{ "repo_name": "smith750/rice", "path": "rice-middleware/impl/src/main/java/org/kuali/rice/kew/impl/document/search/DocumentSearchCriteriaBoLookupableHelperService.java", "license": "apache-2.0", "size": 51947 }
[ "java.util.HashMap", "java.util.Map", "org.kuali.rice.kew.docsearch.DocumentSearchCriteriaProcessorKEWAdapter", "org.kuali.rice.krad.util.KRADConstants" ]
import java.util.HashMap; import java.util.Map; import org.kuali.rice.kew.docsearch.DocumentSearchCriteriaProcessorKEWAdapter; import org.kuali.rice.krad.util.KRADConstants;
import java.util.*; import org.kuali.rice.kew.docsearch.*; import org.kuali.rice.krad.util.*;
[ "java.util", "org.kuali.rice" ]
java.util; org.kuali.rice;
902,231
public static HashMap<String, Integer> loadDocForWord(String docset) { HashMap<String, Integer> postings = new HashMap<String, Integer>(); String docs[] = docset.split(","); for(String doc : docs) { String posting[] = doc.split("="); postings.put(posting[0], Integer.parseInt(posting[1])); } return postings; }
static HashMap<String, Integer> function(String docset) { HashMap<String, Integer> postings = new HashMap<String, Integer>(); String docs[] = docset.split(","); for(String doc : docs) { String posting[] = doc.split("="); postings.put(posting[0], Integer.parseInt(posting[1])); } return postings; }
/** * Splits the given docset per word and creates a posting in the form * of [docId,term-frequency]. * This posting is then put in a hashmap against the word. * @param docset * @return */
Splits the given docset per word and creates a posting in the form of [docId,term-frequency]. This posting is then put in a hashmap against the word
loadDocForWord
{ "repo_name": "ashish-kalbhor/SearchEngine", "path": "AshishBM25SearchEngine/src/ir/search/indexer/BM25.java", "license": "apache-2.0", "size": 8013 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,221,505
String contextPath = GWT.getHostPageBaseURL(); setContentsURL(contextPath + "data/pages/help/manual.htm"); }
String contextPath = GWT.getHostPageBaseURL(); setContentsURL(contextPath + STR); }
/** * Load the help html page. */
Load the help html page
init
{ "repo_name": "SHARP-HTP/phenotype-portal", "path": "src/edu/mayo/phenoportal/client/help/GuideHtmlPane.java", "license": "apache-2.0", "size": 498 }
[ "com.google.gwt.core.client.GWT" ]
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.*;
[ "com.google.gwt" ]
com.google.gwt;
426,640
private static String generateLabelName(Set<String> usedLabelNames, String originalLabelName, int portIndex) { String labelName = originalLabelName; if (!usedLabelNames.contains(labelName)) { usedLabelNames.add(labelName); return labelName; } originalLabelName = originalLabelName + "_port" + portIndex; labelName = originalLabelName; int i = 1; while (usedLabelNames.contains(labelName)) { labelName = originalLabelName + "_" + i ++; } usedLabelNames.add(labelName); return labelName; }
static String function(Set<String> usedLabelNames, String originalLabelName, int portIndex) { String labelName = originalLabelName; if (!usedLabelNames.contains(labelName)) { usedLabelNames.add(labelName); return labelName; } originalLabelName = originalLabelName + "_port" + portIndex; labelName = originalLabelName; int i = 1; while (usedLabelNames.contains(labelName)) { labelName = originalLabelName + "_" + i ++; } usedLabelNames.add(labelName); return labelName; }
/** * Generates label names that will be used in the prediction attributes. * Resolves collisions between label names by generating a unique postfix if necessary. * If all label names are different, this method does not change the names. * * @param usedLabelNames * Already accepted unique label names * @param originalLabelName * The label name to be inserted * @param portIndex * The input port index of the unrelated ExampleSet holding {@code originalLabelName} as label * @return */
Generates label names that will be used in the prediction attributes. Resolves collisions between label names by generating a unique postfix if necessary. If all label names are different, this method does not change the names
generateLabelName
{ "repo_name": "aborg0/rapidminer-studio", "path": "src/main/java/com/rapidminer/operator/learner/functions/SeeminglyUnrelatedRegressionModel.java", "license": "agpl-3.0", "size": 8384 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,203,244
public void recordDataSource(Connection c, String dataSource) throws BadServerResponse, XenAPIException, XmlRpcException { String method_call = "VM.record_data_source"; String session = c.getSessionReference(); Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(dataSource)}; Map response = c.dispatch(method_call, method_params); return; }
void function(Connection c, String dataSource) throws BadServerResponse, XenAPIException, XmlRpcException { String method_call = STR; String session = c.getSessionReference(); Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(dataSource)}; Map response = c.dispatch(method_call, method_params); return; }
/** * Start recording the specified data source * * @param dataSource The data source to record */
Start recording the specified data source
recordDataSource
{ "repo_name": "cinderella/incubator-cloudstack", "path": "deps/XenServerJava/com/xensource/xenapi/VM.java", "license": "apache-2.0", "size": 169722 }
[ "com.xensource.xenapi.Types", "java.util.Map", "org.apache.xmlrpc.XmlRpcException" ]
import com.xensource.xenapi.Types; import java.util.Map; import org.apache.xmlrpc.XmlRpcException;
import com.xensource.xenapi.*; import java.util.*; import org.apache.xmlrpc.*;
[ "com.xensource.xenapi", "java.util", "org.apache.xmlrpc" ]
com.xensource.xenapi; java.util; org.apache.xmlrpc;
1,830,854
AdminResponse sendAndWait(AdminRequest msg) { if (unreachable) { throw new OperationCancelledException(LocalizedStrings.RemoteGemFireVM_0_IS_UNREACHABLE_IT_HAS_EITHER_LEFT_OR_CRASHED.toLocalizedString(this.name)); } if (this.id == null) { throw new NullPointerException(LocalizedStrings.RemoteGemFireVM_THE_ID_IF_THIS_REMOTEGEMFIREVM_IS_NULL.toLocalizedString()); } msg.setRecipient(this.id); msg.setModifiedClasspath(inspectionClasspath); return agent.sendAndWait(msg); }
AdminResponse sendAndWait(AdminRequest msg) { if (unreachable) { throw new OperationCancelledException(LocalizedStrings.RemoteGemFireVM_0_IS_UNREACHABLE_IT_HAS_EITHER_LEFT_OR_CRASHED.toLocalizedString(this.name)); } if (this.id == null) { throw new NullPointerException(LocalizedStrings.RemoteGemFireVM_THE_ID_IF_THIS_REMOTEGEMFIREVM_IS_NULL.toLocalizedString()); } msg.setRecipient(this.id); msg.setModifiedClasspath(inspectionClasspath); return agent.sendAndWait(msg); }
/** * Sends an AdminRequest to this dm (that is, to member of the * distributed system represented by this * <code>RemoteGemFireVM</code>) and waits for the AdminReponse. */
Sends an AdminRequest to this dm (that is, to member of the distributed system represented by this <code>RemoteGemFireVM</code>) and waits for the AdminReponse
sendAndWait
{ "repo_name": "papicella/snappy-store", "path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/admin/remote/RemoteGemFireVM.java", "license": "apache-2.0", "size": 32334 }
[ "com.gemstone.gemfire.admin.OperationCancelledException", "com.gemstone.gemfire.internal.i18n.LocalizedStrings" ]
import com.gemstone.gemfire.admin.OperationCancelledException; import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
import com.gemstone.gemfire.admin.*; import com.gemstone.gemfire.internal.i18n.*;
[ "com.gemstone.gemfire" ]
com.gemstone.gemfire;
462,695
public void writeString(String text) throws IOException { out.write(text.getBytes()); }
void function(String text) throws IOException { out.write(text.getBytes()); }
/** * Writes a string to the terminal using the current font, color and cursor * position settings. * * @param text the text to write */
Writes a string to the terminal using the current font, color and cursor position settings
writeString
{ "repo_name": "dslomov/bazel", "path": "src/main/java/com/google/devtools/build/lib/util/io/AnsiTerminal.java", "license": "apache-2.0", "size": 6290 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,802,420
@ServiceMethod(returns = ReturnType.SINGLE) BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName);
@ServiceMethod(returns = ReturnType.SINGLE) BgpPeerStatusListResultInner getBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName);
/** * The GetBgpPeerStatus operation retrieves the status of all BGP peers. * * @param resourceGroupName The name of the resource group. * @param virtualNetworkGatewayName The name of the virtual network gateway. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response for list BGP peer status API service call. */
The GetBgpPeerStatus operation retrieves the status of all BGP peers
getBgpPeerStatus
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualNetworkGatewaysClient.java", "license": "mit", "size": 135947 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.network.fluent.models.BgpPeerStatusListResultInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.network.fluent.models.BgpPeerStatusListResultInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.network.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,644,743
private void addListeners() { networkSearchBar.addPropertyChangeListener("selectedProvider", evt -> { NetworkSearchTaskFactory tf = (NetworkSearchTaskFactory) evt.getNewValue(); if (tf != null) updateSelectedProvider(tf); updateSelectedSearchComponent(tf);
void function() { networkSearchBar.addPropertyChangeListener(STR, evt -> { NetworkSearchTaskFactory tf = (NetworkSearchTaskFactory) evt.getNewValue(); if (tf != null) updateSelectedProvider(tf); updateSelectedSearchComponent(tf);
/** * Add listeners to UI components. */
Add listeners to UI components
addListeners
{ "repo_name": "cytoscape/cytoscape-impl", "path": "swing-application-impl/src/main/java/org/cytoscape/internal/view/NetworkSearchMediator.java", "license": "lgpl-2.1", "size": 9327 }
[ "org.cytoscape.application.swing.search.NetworkSearchTaskFactory" ]
import org.cytoscape.application.swing.search.NetworkSearchTaskFactory;
import org.cytoscape.application.swing.search.*;
[ "org.cytoscape.application" ]
org.cytoscape.application;
152,686
public static void validateParam(HttpServletRequest request, String name, String type) throws Exception { CaseInsensitiveMap params = new CaseInsensitiveMap(request.getParameterMap()); if (params.containsKey(name)) { String value = ((String[]) params.get(name))[0]; if (StringUtils.isEmpty(value)) { throw new IllegalArgumentException("Missing request parameter: " + name); } if (type.equals("integer")) { try { Integer.parseInt(value); } catch (NumberFormatException e) { throw new IllegalArgumentException("Invalid request parameter: " + name); } } if (type.equals("double")) { try { Double.parseDouble(value); } catch (NumberFormatException e) { throw new IllegalArgumentException("Invalid request parameter: " + name); } } } else { throw new IllegalArgumentException("Missing request parameter: " + name); } }
static void function(HttpServletRequest request, String name, String type) throws Exception { CaseInsensitiveMap params = new CaseInsensitiveMap(request.getParameterMap()); if (params.containsKey(name)) { String value = ((String[]) params.get(name))[0]; if (StringUtils.isEmpty(value)) { throw new IllegalArgumentException(STR + name); } if (type.equals(STR)) { try { Integer.parseInt(value); } catch (NumberFormatException e) { throw new IllegalArgumentException(STR + name); } } if (type.equals(STR)) { try { Double.parseDouble(value); } catch (NumberFormatException e) { throw new IllegalArgumentException(STR + name); } } } else { throw new IllegalArgumentException(STR + name); } }
/** * Validates the existence and type of an HTTP parameter. * @param request servlet request * @param name parameter name * @param type parameter data type * @throws Exception if the parameter does not exist or cannot be cast to the requested data type */
Validates the existence and type of an HTTP parameter
validateParam
{ "repo_name": "tjkrell/MrGEO", "path": "mrgeo-services/mrgeo-services-core/src/main/java/org/mrgeo/services/ServletUtils.java", "license": "apache-2.0", "size": 7578 }
[ "javax.servlet.http.HttpServletRequest", "org.apache.commons.collections.map.CaseInsensitiveMap", "org.apache.commons.lang.StringUtils" ]
import javax.servlet.http.HttpServletRequest; import org.apache.commons.collections.map.CaseInsensitiveMap; import org.apache.commons.lang.StringUtils;
import javax.servlet.http.*; import org.apache.commons.collections.map.*; import org.apache.commons.lang.*;
[ "javax.servlet", "org.apache.commons" ]
javax.servlet; org.apache.commons;
2,644,190
@Test @Ignore("As of OAK-622 this should no longer be used. Removing later.") public void costLessThanAscendingDirection() throws IllegalArgumentException, RepositoryException { OrderedPropertyIndex index = new OrderedPropertyIndex(new OrderedPropertyIndexProvider()); NodeBuilder builder = InitialContent.INITIAL_CONTENT.builder(); defineAscendingIndex(builder); NodeState root = builder.getNodeState(); Filter filter = createNiceMock(Filter.class); Filter.PropertyRestriction restriction = new Filter.PropertyRestriction(); restriction.last = PropertyValues.newDate("2013-01-01"); restriction.propertyName = ORDERED_PROPERTY; expect(filter.getPropertyRestrictions()).andReturn(ImmutableList.of(restriction)) .anyTimes(); expect(filter.containsNativeConstraint()).andReturn(false).anyTimes(); replay(filter); assertEquals("in ascending index we're not expecting to serve '<' queries", Double.POSITIVE_INFINITY, index.getCost(filter, root), 0); }
@Test @Ignore(STR) void function() throws IllegalArgumentException, RepositoryException { OrderedPropertyIndex index = new OrderedPropertyIndex(new OrderedPropertyIndexProvider()); NodeBuilder builder = InitialContent.INITIAL_CONTENT.builder(); defineAscendingIndex(builder); NodeState root = builder.getNodeState(); Filter filter = createNiceMock(Filter.class); Filter.PropertyRestriction restriction = new Filter.PropertyRestriction(); restriction.last = PropertyValues.newDate(STR); restriction.propertyName = ORDERED_PROPERTY; expect(filter.getPropertyRestrictions()).andReturn(ImmutableList.of(restriction)) .anyTimes(); expect(filter.containsNativeConstraint()).andReturn(false).anyTimes(); replay(filter); assertEquals(STR, Double.POSITIVE_INFINITY, index.getCost(filter, root), 0); }
/** * when we run a '<' in an Ascending index it should not serve it * @throws RepositoryException * @throws IllegalArgumentException */
when we run a '<' in an Ascending index it should not serve it
costLessThanAscendingDirection
{ "repo_name": "afilimonov/jackrabbit-oak", "path": "oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedIndexCostTest.java", "license": "apache-2.0", "size": 16956 }
[ "com.google.common.collect.ImmutableList", "javax.jcr.RepositoryException", "org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent", "org.apache.jackrabbit.oak.spi.query.Filter", "org.apache.jackrabbit.oak.spi.query.PropertyValues", "org.apache.jackrabbit.oak.spi.state.NodeBuilder", "org.apache.jackrabbit.oak.spi.state.NodeState", "org.easymock.EasyMock", "org.junit.Assert", "org.junit.Ignore", "org.junit.Test" ]
import com.google.common.collect.ImmutableList; import javax.jcr.RepositoryException; import org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent; import org.apache.jackrabbit.oak.spi.query.Filter; import org.apache.jackrabbit.oak.spi.query.PropertyValues; import org.apache.jackrabbit.oak.spi.state.NodeBuilder; import org.apache.jackrabbit.oak.spi.state.NodeState; import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test;
import com.google.common.collect.*; import javax.jcr.*; import org.apache.jackrabbit.oak.plugins.nodetype.write.*; import org.apache.jackrabbit.oak.spi.query.*; import org.apache.jackrabbit.oak.spi.state.*; import org.easymock.*; import org.junit.*;
[ "com.google.common", "javax.jcr", "org.apache.jackrabbit", "org.easymock", "org.junit" ]
com.google.common; javax.jcr; org.apache.jackrabbit; org.easymock; org.junit;
317,570
public static AllocateUnassignedDecision yes(DiscoveryNode assignedNode, @Nullable String allocationId, @Nullable List<NodeAllocationResult> decisions, boolean reuseStore) { return new AllocateUnassignedDecision(null, assignedNode, allocationId, decisions, reuseStore, 0L, 0L); }
static AllocateUnassignedDecision function(DiscoveryNode assignedNode, @Nullable String allocationId, @Nullable List<NodeAllocationResult> decisions, boolean reuseStore) { return new AllocateUnassignedDecision(null, assignedNode, allocationId, decisions, reuseStore, 0L, 0L); }
/** * Creates a YES decision with the given individual node-level decisions that * comprised the final YES decision, along with the node id to which the shard is assigned and * the allocation id for the shard, if available. */
Creates a YES decision with the given individual node-level decisions that comprised the final YES decision, along with the node id to which the shard is assigned and the allocation id for the shard, if available
yes
{ "repo_name": "robin13/elasticsearch", "path": "server/src/main/java/org/elasticsearch/cluster/routing/allocation/AllocateUnassignedDecision.java", "license": "apache-2.0", "size": 16118 }
[ "java.util.List", "org.elasticsearch.cluster.node.DiscoveryNode", "org.elasticsearch.common.Nullable" ]
import java.util.List; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.Nullable;
import java.util.*; import org.elasticsearch.cluster.node.*; import org.elasticsearch.common.*;
[ "java.util", "org.elasticsearch.cluster", "org.elasticsearch.common" ]
java.util; org.elasticsearch.cluster; org.elasticsearch.common;
1,608,095
@Test public void testOneAuthorCommonName() { Assert.assertEquals("Abbreviator Test", "Lastname, N. M.", abbreviate("Lastname, Name Middlename")); }
void function() { Assert.assertEquals(STR, STR, abbreviate(STR)); }
/** * Verifies the Abbreviation of one single author with a common name. * <p/> * Ex: Lastname, Name Middlename */
Verifies the Abbreviation of one single author with a common name. Ex: Lastname, Name Middlename
testOneAuthorCommonName
{ "repo_name": "luizvneto/DC-UFSCar-ES2-201701-Grupo-NichRosaHugoLuizRodr", "path": "src/test/java/net/sf/jabref/logic/layout/format/AuthorLastFirstAbbreviatorTester.java", "license": "mit", "size": 2023 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,368,917
public static TableDesc getTableDesc( Class<? extends Deserializer> serdeClass, String separatorCode, String columns) { return getTableDesc(serdeClass, separatorCode, columns, false); }
static TableDesc function( Class<? extends Deserializer> serdeClass, String separatorCode, String columns) { return getTableDesc(serdeClass, separatorCode, columns, false); }
/** * Generate the table descriptor of given serde with the separatorCode and * column names (comma separated string). */
Generate the table descriptor of given serde with the separatorCode and column names (comma separated string)
getTableDesc
{ "repo_name": "cschenyuan/hive-hack", "path": "ql/src/java/org/apache/hadoop/hive/ql/plan/PlanUtils.java", "license": "apache-2.0", "size": 38831 }
[ "org.apache.hadoop.hive.serde2.Deserializer" ]
import org.apache.hadoop.hive.serde2.Deserializer;
import org.apache.hadoop.hive.serde2.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,426,962
@Test public void testNoActionInstructionHashCode() { assertThat(noAction1.hashCode(), is(equalTo(noAction2.hashCode()))); } // OutputInstruction private final PortNumber port1 = portNumber(1); private final PortNumber port2 = portNumber(2); private final Instructions.OutputInstruction output1 = Instructions.createOutput(port1); private final Instructions.OutputInstruction sameAsOutput1 = Instructions.createOutput(port1); private final Instructions.OutputInstruction output2 = Instructions.createOutput(port2);
void function() { assertThat(noAction1.hashCode(), is(equalTo(noAction2.hashCode()))); } private final PortNumber port1 = portNumber(1); private final PortNumber port2 = portNumber(2); private final Instructions.OutputInstruction output1 = Instructions.createOutput(port1); private final Instructions.OutputInstruction sameAsOutput1 = Instructions.createOutput(port1); private final Instructions.OutputInstruction output2 = Instructions.createOutput(port2);
/** * Test the hashCode() method of the NoActionInstruction class. */
Test the hashCode() method of the NoActionInstruction class
testNoActionInstructionHashCode
{ "repo_name": "LorenzReinhart/ONOSnew", "path": "core/api/src/test/java/org/onosproject/net/flow/instructions/InstructionsTest.java", "license": "apache-2.0", "size": 53514 }
[ "org.hamcrest.MatcherAssert", "org.hamcrest.Matchers", "org.onosproject.net.PortNumber" ]
import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.onosproject.net.PortNumber;
import org.hamcrest.*; import org.onosproject.net.*;
[ "org.hamcrest", "org.onosproject.net" ]
org.hamcrest; org.onosproject.net;
2,252,365
public boolean isOpaqueCube(IBlockState state) { return false; }
boolean function(IBlockState state) { return false; }
/** * Used to determine ambient occlusion and culling when rebuilding chunks for render */
Used to determine ambient occlusion and culling when rebuilding chunks for render
isOpaqueCube
{ "repo_name": "F1r3w477/CustomWorldGen", "path": "build/tmp/recompileMc/sources/net/minecraft/block/BlockVine.java", "license": "lgpl-3.0", "size": 20804 }
[ "net.minecraft.block.state.IBlockState" ]
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.state.*;
[ "net.minecraft.block" ]
net.minecraft.block;
2,495,517
boolean isTrulyRequiredAttribute(PerunSession sess, Facility facility, User user, AttributeDefinition attributeDefinition) throws WrongAttributeAssignmentException;
boolean isTrulyRequiredAttribute(PerunSession sess, Facility facility, User user, AttributeDefinition attributeDefinition) throws WrongAttributeAssignmentException;
/** * Check if this the attribute is truly required for the user and the facility right now. Truly means that the nothing (member, resource...) is invalid. * * @param sess * @param facility * @param user * @param attributeDefinition * @return * * @throws InternalErrorException * @throws WrongAttributeAssignmentException */
Check if this the attribute is truly required for the user and the facility right now. Truly means that the nothing (member, resource...) is invalid
isTrulyRequiredAttribute
{ "repo_name": "zlamalp/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/AttributesManagerBl.java", "license": "bsd-2-clause", "size": 244560 }
[ "cz.metacentrum.perun.core.api.AttributeDefinition", "cz.metacentrum.perun.core.api.Facility", "cz.metacentrum.perun.core.api.PerunSession", "cz.metacentrum.perun.core.api.User", "cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException" ]
import cz.metacentrum.perun.core.api.AttributeDefinition; import cz.metacentrum.perun.core.api.Facility; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.User; import cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException;
import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*;
[ "cz.metacentrum.perun" ]
cz.metacentrum.perun;
1,814,219
@SuppressWarnings({"rawtypes", "unchecked"}) @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { final java.util.ArrayList elementList = new java.util.ArrayList(); final java.util.ArrayList attribList = new java.util.ArrayList(); if (this.localCUFTracker) { elementList.add(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/mdfe/wsdl/MDFeStatusServico", "cUF")); if (this.localCUF != null) { elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCUF)); } else { throw new org.apache.axis2.databinding.ADBException("cUF cannot be null!!"); } } if (this.localVersaoDadosTracker) { elementList.add(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/mdfe/wsdl/MDFeStatusServico", "versaoDados")); if (this.localVersaoDados != null) { elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localVersaoDados)); } else { throw new org.apache.axis2.databinding.ADBException("versaoDados cannot be null!!"); } } for (final OMAttribute localExtraAttribute : this.localExtraAttributes) { attribList.add(org.apache.axis2.databinding.utils.Constants.OM_ATTRIBUTE_KEY); attribList.add(localExtraAttribute); } return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); } public static class Factory {
@SuppressWarnings({STR, STR}) javax.xml.stream.XMLStreamReader function(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { final java.util.ArrayList elementList = new java.util.ArrayList(); final java.util.ArrayList attribList = new java.util.ArrayList(); if (this.localCUFTracker) { elementList.add(new javax.xml.namespace.QName(STRcUF cannot be null!!STRhttp: if (this.localVersaoDados != null) { elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localVersaoDados)); } else { throw new org.apache.axis2.databinding.ADBException(STR); } } for (final OMAttribute localExtraAttribute : this.localExtraAttributes) { attribList.add(org.apache.axis2.databinding.utils.Constants.OM_ATTRIBUTE_KEY); attribList.add(localExtraAttribute); } return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); } public static class Factory {
/** * databinding method to get an XML representation of this object */
databinding method to get an XML representation of this object
getPullParser
{ "repo_name": "fincatto/nfe", "path": "src/main/java/com/fincatto/documentofiscal/mdfe3/webservices/statusservico/MDFeStatusServicoStub.java", "license": "apache-2.0", "size": 93683 }
[ "javax.xml.namespace.QName", "org.apache.axiom.om.OMAttribute" ]
import javax.xml.namespace.QName; import org.apache.axiom.om.OMAttribute;
import javax.xml.namespace.*; import org.apache.axiom.om.*;
[ "javax.xml", "org.apache.axiom" ]
javax.xml; org.apache.axiom;
1,292,076
@Nonnull public java.util.List<com.microsoft.graph.options.FunctionOption> getFunctionOptions() { final ArrayList<com.microsoft.graph.options.FunctionOption> result = new ArrayList<>(); if(this.deviceTag != null) { result.add(new com.microsoft.graph.options.FunctionOption("deviceTag", deviceTag)); } return result; }
java.util.List<com.microsoft.graph.options.FunctionOption> function() { final ArrayList<com.microsoft.graph.options.FunctionOption> result = new ArrayList<>(); if(this.deviceTag != null) { result.add(new com.microsoft.graph.options.FunctionOption(STR, deviceTag)); } return result; }
/** * Gets the functions options from the properties that have been set * @return a list of function options for the request */
Gets the functions options from the properties that have been set
getFunctionOptions
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/models/UserWipeManagedAppRegistrationsByDeviceTagParameterSet.java", "license": "mit", "size": 3660 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,419,126
Collection<Country> findAllCountries();
Collection<Country> findAllCountries();
/** * Finds all countries into a storage. * @return a collection with countries. */
Finds all countries into a storage
findAllCountries
{ "repo_name": "OleksandrProshak/Alexandr_Proshak", "path": "Level_Junior/Part_004_Servlet_JSP/8_HTML_CSS_JS/src/main/java/ru/job4j/task5/model/logic/ValidateService.java", "license": "apache-2.0", "size": 1880 }
[ "java.util.Collection", "ru.job4j.task5.model.entity.Country" ]
import java.util.Collection; import ru.job4j.task5.model.entity.Country;
import java.util.*; import ru.job4j.task5.model.entity.*;
[ "java.util", "ru.job4j.task5" ]
java.util; ru.job4j.task5;
1,567,571
public void removePartition(String partitionIdStr) { PartitionId partitionId = partitionIdMap.get(partitionIdStr); if (partitionId != null) { if (assignedPartitionIds.remove(partitionId)) { for (VirtualReplicatorClusterListener listener : listeners) { listener.onPartitionRemoved(partitionId); } logger.info("Partition {} is removed from current VCR: {}.", partitionIdStr, vcrInstanceName); } else { logger.info("Partition {} not exists on current VCR: {}", partitionIdStr, vcrInstanceName); } } else { logger.error("Partition {} not in clusterMap on remove.", partitionIdStr); metrics.partitionIdNotInClusterMapOnRemove.inc(); } }
void function(String partitionIdStr) { PartitionId partitionId = partitionIdMap.get(partitionIdStr); if (partitionId != null) { if (assignedPartitionIds.remove(partitionId)) { for (VirtualReplicatorClusterListener listener : listeners) { listener.onPartitionRemoved(partitionId); } logger.info(STR, partitionIdStr, vcrInstanceName); } else { logger.info(STR, partitionIdStr, vcrInstanceName); } } else { logger.error(STR, partitionIdStr); metrics.partitionIdNotInClusterMapOnRemove.inc(); } }
/** * Remove {@link PartitionId} from assignedPartitionIds set, if {@parm partitionIdStr} valid. * Used in {@link HelixVcrStateModel} if current VCR becomes offline or standby a partition. * @param partitionIdStr The partitionIdStr notified by Helix. */
Remove <code>PartitionId</code> from assignedPartitionIds set, if partitionIdStr valid. Used in <code>HelixVcrStateModel</code> if current VCR becomes offline or standby a partition
removePartition
{ "repo_name": "pnarayanan/ambry", "path": "ambry-cloud/src/main/java/com.github.ambry.cloud/HelixVcrCluster.java", "license": "apache-2.0", "size": 6501 }
[ "com.github.ambry.clustermap.PartitionId", "com.github.ambry.clustermap.VirtualReplicatorClusterListener" ]
import com.github.ambry.clustermap.PartitionId; import com.github.ambry.clustermap.VirtualReplicatorClusterListener;
import com.github.ambry.clustermap.*;
[ "com.github.ambry" ]
com.github.ambry;
1,056,832
@SuppressWarnings("unchecked") public static <T> T asType(Object[] ary, Class<T> clazz) { if (clazz == List.class) { return (T) new ArrayList(Arrays.asList(ary)); } if (clazz == Set.class) { return (T) new HashSet(Arrays.asList(ary)); } if (clazz == SortedSet.class) { return (T) new TreeSet(Arrays.asList(ary)); } return asType((Object) ary, clazz); }
@SuppressWarnings(STR) static <T> T function(Object[] ary, Class<T> clazz) { if (clazz == List.class) { return (T) new ArrayList(Arrays.asList(ary)); } if (clazz == Set.class) { return (T) new HashSet(Arrays.asList(ary)); } if (clazz == SortedSet.class) { return (T) new TreeSet(Arrays.asList(ary)); } return asType((Object) ary, clazz); }
/** * Converts the given array to either a List, Set, or * SortedSet. If the given class is something else, the * call is deferred to {link #asType(Object,Class)}. * * @param ary an array * @param clazz the desired class * @return the object resulting from this type conversion * @see #asType(java.lang.Object, java.lang.Class) * @since 1.5.1 */
Converts the given array to either a List, Set, or SortedSet. If the given class is something else, the call is deferred to {link #asType(Object,Class)}
asType
{ "repo_name": "xien777/yajsw", "path": "yajsw/wrapper/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java", "license": "lgpl-2.1", "size": 704150 }
[ "java.util.ArrayList", "java.util.Arrays", "java.util.HashSet", "java.util.List", "java.util.Set", "java.util.SortedSet", "java.util.TreeSet" ]
import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet;
import java.util.*;
[ "java.util" ]
java.util;
2,415,851
private void startDevice() throws IOException { String commandToWrite = String.format(GET_ADDRESS_COMMAND, deviceAddress); this.writeWithOKResponse(commandToWrite); }
void function() throws IOException { String commandToWrite = String.format(GET_ADDRESS_COMMAND, deviceAddress); this.writeWithOKResponse(commandToWrite); }
/** * Initializes the device by sending the * {@link PowerSupply#GET_ADDRESS_COMMAND} with the address being * {@link TDKLambdaPowerSupply#deviceName}. * * @throws IOException If the command could not be sent */
Initializes the device by sending the <code>PowerSupply#GET_ADDRESS_COMMAND</code> with the address being <code>TDKLambdaPowerSupply#deviceName</code>
startDevice
{ "repo_name": "OmicronProject/BakeoutController", "path": "src/main/java/devices/TDKLambdaPowerSupply.java", "license": "mit", "size": 5716 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,383,296
private ColumnDef getColumnMetadata(ColumnInfo columnInfo, TableInfo tableInfo) { ColumnDef columnDef = new ColumnDef(); columnDef.setName(columnInfo.getColumnName().getBytes()); columnDef.setValidation_class(CassandraValidationClassMapper.getValidationClass(columnInfo.getType(), isCql3Enabled(tableInfo))); if (columnInfo.isIndexable()) { IndexInfo indexInfo = tableInfo.getColumnToBeIndexed(columnInfo.getColumnName()); columnDef.setIndex_type(CassandraIndexHelper.getIndexType(indexInfo.getIndexType())); // if (!indexInfo.getIndexName().equals(indexInfo.getColumnName())) // { // columnDef.setIndex_name(indexInfo.getIndexName()); // } } return columnDef; }
ColumnDef function(ColumnInfo columnInfo, TableInfo tableInfo) { ColumnDef columnDef = new ColumnDef(); columnDef.setName(columnInfo.getColumnName().getBytes()); columnDef.setValidation_class(CassandraValidationClassMapper.getValidationClass(columnInfo.getType(), isCql3Enabled(tableInfo))); if (columnInfo.isIndexable()) { IndexInfo indexInfo = tableInfo.getColumnToBeIndexed(columnInfo.getColumnName()); columnDef.setIndex_type(CassandraIndexHelper.getIndexType(indexInfo.getIndexType())); } return columnDef; }
/** * getColumnMetadata use for getting column metadata for specific * columnInfo. * * @param columnInfo * the column info * @param tableInfo * the table info * @return the column metadata */
getColumnMetadata use for getting column metadata for specific columnInfo
getColumnMetadata
{ "repo_name": "impetus-opensource/Kundera", "path": "src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java", "license": "apache-2.0", "size": 123023 }
[ "com.impetus.client.cassandra.index.CassandraIndexHelper", "com.impetus.kundera.configure.schema.ColumnInfo", "com.impetus.kundera.configure.schema.IndexInfo", "com.impetus.kundera.configure.schema.TableInfo", "org.apache.cassandra.thrift.ColumnDef" ]
import com.impetus.client.cassandra.index.CassandraIndexHelper; import com.impetus.kundera.configure.schema.ColumnInfo; import com.impetus.kundera.configure.schema.IndexInfo; import com.impetus.kundera.configure.schema.TableInfo; import org.apache.cassandra.thrift.ColumnDef;
import com.impetus.client.cassandra.index.*; import com.impetus.kundera.configure.schema.*; import org.apache.cassandra.thrift.*;
[ "com.impetus.client", "com.impetus.kundera", "org.apache.cassandra" ]
com.impetus.client; com.impetus.kundera; org.apache.cassandra;
28,691
public String getPartition() { if (this.labels == null || this.labels.isEmpty()) { return RMNodeLabelsManager.NO_LABEL; } else { return this.labels.iterator().next(); } }
String function() { if (this.labels == null this.labels.isEmpty()) { return RMNodeLabelsManager.NO_LABEL; } else { return this.labels.iterator().next(); } }
/** * Get partition of which the node belongs to, if node-labels of this node is * empty or null, it belongs to NO_LABEL partition. And since we only support * one partition for each node (YARN-2694), first label will be its partition. */
Get partition of which the node belongs to, if node-labels of this node is empty or null, it belongs to NO_LABEL partition. And since we only support one partition for each node (YARN-2694), first label will be its partition
getPartition
{ "repo_name": "aliyun-beta/aliyun-oss-hadoop-fs", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerNode.java", "license": "apache-2.0", "size": 12125 }
[ "org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager" ]
import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager;
import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,100,968
public List<ThesaurusSense> getSenses() { return senses; }
List<ThesaurusSense> function() { return senses; }
/** * Complete list of senses * @return senses **/
Complete list of senses
getSenses
{ "repo_name": "psh/OxfordDictionarySample", "path": "app/src/main/java/com/gatebuzz/oxfordapi/model/ThesaurusEntry.java", "license": "apache-2.0", "size": 4052 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,285,702
public Observable<ServiceResponse<List<ClusterInner>>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); }
Observable<ServiceResponse<List<ClusterInner>>> function(String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); }
/** * Lists all Kusto clusters within a resource group. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @return the observable to the List&lt;ClusterInner&gt; object */
Lists all Kusto clusters within a resource group
listByResourceGroupWithServiceResponseAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersInner.java", "license": "mit", "size": 159457 }
[ "com.microsoft.rest.ServiceResponse", "java.util.List" ]
import com.microsoft.rest.ServiceResponse; import java.util.List;
import com.microsoft.rest.*; import java.util.*;
[ "com.microsoft.rest", "java.util" ]
com.microsoft.rest; java.util;
1,251,737
public int getBitsPerComponent() { if (bitsPerColorComponent == -1) { bitsPerColorComponent = getCOSObject().getInt(COSName.BITS_PER_COMPONENT, -1); LOG.debug("bitsPerColorComponent: " + bitsPerColorComponent); } return bitsPerColorComponent; }
int function() { if (bitsPerColorComponent == -1) { bitsPerColorComponent = getCOSObject().getInt(COSName.BITS_PER_COMPONENT, -1); LOG.debug(STR + bitsPerColorComponent); } return bitsPerColorComponent; }
/** * The bits per component of this shading. This will return -1 if one has not been set. * * @return the number of bits per component */
The bits per component of this shading. This will return -1 if one has not been set
getBitsPerComponent
{ "repo_name": "kalaspuffar/pdfbox", "path": "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PDTriangleBasedShadingType.java", "license": "apache-2.0", "size": 8726 }
[ "org.apache.pdfbox.cos.COSName" ]
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.cos.*;
[ "org.apache.pdfbox" ]
org.apache.pdfbox;
865,394
public static URI getIssueURI(String title, String body) { try { return URI.create(String.format(OpsuConstants.ISSUES_URL, URLEncoder.encode(title, "UTF-8"), URLEncoder.encode(body, "UTF-8")) ); } catch (UnsupportedEncodingException e) { Log.warn("URLEncoder failed to encode the auto-filled issue report URL."); return URI.create(String.format(OpsuConstants.ISSUES_URL, "", "")); } }
static URI function(String title, String body) { try { return URI.create(String.format(OpsuConstants.ISSUES_URL, URLEncoder.encode(title, "UTF-8"), URLEncoder.encode(body, "UTF-8")) ); } catch (UnsupportedEncodingException e) { Log.warn(STR); return URI.create(String.format(OpsuConstants.ISSUES_URL, STR")); } }
/** * Returns the issue reporting URI with the given title and body. * @param title the issue title * @param body the issue body * @return the encoded URI */
Returns the issue reporting URI with the given title and body
getIssueURI
{ "repo_name": "Lyonlancer5/opsu", "path": "src/itdelatrisu/opsu/ErrorHandler.java", "license": "gpl-3.0", "size": 8427 }
[ "java.io.UnsupportedEncodingException", "java.net.URI", "java.net.URLEncoder", "org.newdawn.slick.util.Log" ]
import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URLEncoder; import org.newdawn.slick.util.Log;
import java.io.*; import java.net.*; import org.newdawn.slick.util.*;
[ "java.io", "java.net", "org.newdawn.slick" ]
java.io; java.net; org.newdawn.slick;
2,145,228
protected void createMBeans(String name, UserDatabase database) throws Exception { // Create the MBean for the UserDatabase itself if (log.isDebugEnabled()) { log.debug("Creating UserDatabase MBeans for resource " + name); log.debug("Database=" + database); } if (MBeanUtils.createMBean(database) == null) { throw new IllegalArgumentException ("Cannot create UserDatabase MBean for resource " + name); } // Create the MBeans for each defined Role Iterator roles = database.getRoles(); while (roles.hasNext()) { Role role = (Role) roles.next(); if (log.isDebugEnabled()) { log.debug(" Creating Role MBean for role " + role); } if (MBeanUtils.createMBean(role) == null) { throw new IllegalArgumentException ("Cannot create Role MBean for role " + role); } } // Create the MBeans for each defined Group Iterator groups = database.getGroups(); while (groups.hasNext()) { Group group = (Group) groups.next(); if (log.isDebugEnabled()) { log.debug(" Creating Group MBean for group " + group); } if (MBeanUtils.createMBean(group) == null) { throw new IllegalArgumentException ("Cannot create Group MBean for group " + group); } } // Create the MBeans for each defined User Iterator users = database.getUsers(); while (users.hasNext()) { User user = (User) users.next(); if (log.isDebugEnabled()) { log.debug(" Creating User MBean for user " + user); } if (MBeanUtils.createMBean(user) == null) { throw new IllegalArgumentException ("Cannot create User MBean for user " + user); } } }
void function(String name, UserDatabase database) throws Exception { if (log.isDebugEnabled()) { log.debug(STR + name); log.debug(STR + database); } if (MBeanUtils.createMBean(database) == null) { throw new IllegalArgumentException (STR + name); } Iterator roles = database.getRoles(); while (roles.hasNext()) { Role role = (Role) roles.next(); if (log.isDebugEnabled()) { log.debug(STR + role); } if (MBeanUtils.createMBean(role) == null) { throw new IllegalArgumentException (STR + role); } } Iterator groups = database.getGroups(); while (groups.hasNext()) { Group group = (Group) groups.next(); if (log.isDebugEnabled()) { log.debug(STR + group); } if (MBeanUtils.createMBean(group) == null) { throw new IllegalArgumentException (STR + group); } } Iterator users = database.getUsers(); while (users.hasNext()) { User user = (User) users.next(); if (log.isDebugEnabled()) { log.debug(STR + user); } if (MBeanUtils.createMBean(user) == null) { throw new IllegalArgumentException (STR + user); } } }
/** * Create the MBeans for the specified UserDatabase and its contents. * * @param name Complete resource name of this UserDatabase * @param database The UserDatabase to be processed * * @exception Exception if an exception occurs while creating MBeans */
Create the MBeans for the specified UserDatabase and its contents
createMBeans
{ "repo_name": "plumer/codana", "path": "tomcat_files/6.0.43/GlobalResourcesLifecycleListener.java", "license": "mit", "size": 7813 }
[ "java.util.Iterator", "org.apache.catalina.Group", "org.apache.catalina.Role", "org.apache.catalina.User", "org.apache.catalina.UserDatabase" ]
import java.util.Iterator; import org.apache.catalina.Group; import org.apache.catalina.Role; import org.apache.catalina.User; import org.apache.catalina.UserDatabase;
import java.util.*; import org.apache.catalina.*;
[ "java.util", "org.apache.catalina" ]
java.util; org.apache.catalina;
985,293
void setMediaItems(List<MovieMediaItem> mediaItems) { mMediaItems = mediaItems; mClean = false; }
void setMediaItems(List<MovieMediaItem> mediaItems) { mMediaItems = mediaItems; mClean = false; }
/** * Set the media items * * @param mediaItems The media items */
Set the media items
setMediaItems
{ "repo_name": "rex-xxx/mt6572_x201", "path": "packages/apps/VideoEditor/src/com/android/videoeditor/service/VideoEditorProject.java", "license": "gpl-2.0", "size": 42432 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
863,792
public void testCastNewSingleThreadExecutor() { ExecutorService e = Executors.newSingleThreadExecutor(); try { ThreadPoolExecutor tpe = (ThreadPoolExecutor)e; shouldThrow(); } catch (ClassCastException success) { } finally { joinPool(e); } }
void function() { ExecutorService e = Executors.newSingleThreadExecutor(); try { ThreadPoolExecutor tpe = (ThreadPoolExecutor)e; shouldThrow(); } catch (ClassCastException success) { } finally { joinPool(e); } }
/** * A new SingleThreadExecutor cannot be casted to concrete implementation */
A new SingleThreadExecutor cannot be casted to concrete implementation
testCastNewSingleThreadExecutor
{ "repo_name": "AdmireTheDistance/android_libcore", "path": "jsr166-tests/src/test/java/jsr166/ExecutorsTest.java", "license": "gpl-2.0", "size": 22307 }
[ "java.util.concurrent.ExecutorService", "java.util.concurrent.Executors", "java.util.concurrent.ThreadPoolExecutor" ]
import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,340,102
public List<PodcastEpisode> getNewestEpisodes(int count) { List<PodcastEpisode> episodes = addMediaFileIdToEpisodes(podcastDao.getNewestEpisodes(count));
List<PodcastEpisode> function(int count) { List<PodcastEpisode> episodes = addMediaFileIdToEpisodes(podcastDao.getNewestEpisodes(count));
/** * Returns the N newest episodes. * * @return Possibly empty list of the newest Podcast episodes, sorted in * reverse chronological order (newest episode first). */
Returns the N newest episodes
getNewestEpisodes
{ "repo_name": "langera/libresonic", "path": "libresonic-main/src/main/java/org/libresonic/player/service/PodcastService.java", "license": "gpl-3.0", "size": 29190 }
[ "java.util.List", "org.libresonic.player.domain.PodcastEpisode" ]
import java.util.List; import org.libresonic.player.domain.PodcastEpisode;
import java.util.*; import org.libresonic.player.domain.*;
[ "java.util", "org.libresonic.player" ]
java.util; org.libresonic.player;
2,385,823
public synchronized int getSlotsTaken(Job job) { int slot = 0; JobsConnection conn = getConnection(); if (conn == null) return slot; try { String sql = "SELECT COUNT(*) FROM `" + prefix + "jobs` WHERE `job` = ?;"; PreparedStatement prest = conn.prepareStatement(sql); prest.setString(1, job.getName()); ResultSet res = prest.executeQuery(); if (res.next()) { slot = res.getInt(1); } prest.close(); } catch(SQLException e) { e.printStackTrace(); } return slot; }
synchronized int function(Job job) { int slot = 0; JobsConnection conn = getConnection(); if (conn == null) return slot; try { String sql = STR + prefix + STR; PreparedStatement prest = conn.prepareStatement(sql); prest.setString(1, job.getName()); ResultSet res = prest.executeQuery(); if (res.next()) { slot = res.getInt(1); } prest.close(); } catch(SQLException e) { e.printStackTrace(); } return slot; }
/** * Get the number of players that have a particular job * @param job - the job * @return the number of players that have a particular job */
Get the number of players that have a particular job
getSlotsTaken
{ "repo_name": "parisfuja/CraftJobs", "path": "src/main/java/me/zford/jobs/dao/JobsDAO.java", "license": "apache-2.0", "size": 6690 }
[ "java.sql.PreparedStatement", "java.sql.ResultSet", "java.sql.SQLException", "me.zford.jobs.container.Job" ]
import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import me.zford.jobs.container.Job;
import java.sql.*; import me.zford.jobs.container.*;
[ "java.sql", "me.zford.jobs" ]
java.sql; me.zford.jobs;
2,769,494
private double computeLengthIncreaseFactor( int[] basesInHelixArray, // IN RNATemplateHelix helix // IN ) { double templateLength = computeHelixTemplateLength(helix); double realLength = computeHelixRealLength(basesInHelixArray); return realLength / templateLength; }
double function( int[] basesInHelixArray, RNATemplateHelix helix ) { double templateLength = computeHelixTemplateLength(helix); double realLength = computeHelixRealLength(basesInHelixArray); return realLength / templateLength; }
/** * Compute (actual helix length / helix length in template). */
Compute (actual helix length / helix length in template)
computeLengthIncreaseFactor
{ "repo_name": "statalign/statalign", "path": "src/fr/orsay/lri/varna/models/rna/RNA.java", "license": "gpl-3.0", "size": 146442 }
[ "fr.orsay.lri.varna.models.templates.RNATemplate" ]
import fr.orsay.lri.varna.models.templates.RNATemplate;
import fr.orsay.lri.varna.models.templates.*;
[ "fr.orsay.lri" ]
fr.orsay.lri;
2,149,691
public void raiseNote( int p ) { // if valid index and not last index if ( ( p >= 0 ) && ( p < notes.size() - 1 ) ) { NotePadMeta note = notes.remove( p ); notes.add( note ); changedNotes = true; } }
void function( int p ) { if ( ( p >= 0 ) && ( p < notes.size() - 1 ) ) { NotePadMeta note = notes.remove( p ); notes.add( note ); changedNotes = true; } }
/** * Raises a note to the "top" of the list by removing the note at the specified index and re-inserting it at the end. * Also marks that the notes have changed. * * @param p the index into the notes list. */
Raises a note to the "top" of the list by removing the note at the specified index and re-inserting it at the end. Also marks that the notes have changed
raiseNote
{ "repo_name": "tkafalas/pentaho-kettle", "path": "engine/src/main/java/org/pentaho/di/base/AbstractMeta.java", "license": "apache-2.0", "size": 57127 }
[ "org.pentaho.di.core.NotePadMeta" ]
import org.pentaho.di.core.NotePadMeta;
import org.pentaho.di.core.*;
[ "org.pentaho.di" ]
org.pentaho.di;
1,751,237
public void linkTools(String... tools) throws IOException { for (String tool : tools) { linkTool(tool); } }
void function(String... tools) throws IOException { for (String tool : tools) { linkTool(tool); } }
/** * Convenience method to link multiple tools. Same as calling {@link #linkTool(String)} for each * parameter. */
Convenience method to link multiple tools. Same as calling <code>#linkTool(String)</code> for each parameter
linkTools
{ "repo_name": "dropbox/bazel", "path": "src/test/java/com/google/devtools/build/lib/packages/util/MockToolsConfig.java", "license": "apache-2.0", "size": 5849 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
995,177
public VirtualMachineInner withPlan(Plan plan) { this.plan = plan; return this; }
VirtualMachineInner function(Plan plan) { this.plan = plan; return this; }
/** * Set the plan value. * * @param plan the plan value to set * @return the VirtualMachineInner object itself. */
Set the plan value
withPlan
{ "repo_name": "pomortaz/azure-sdk-for-java", "path": "azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineInner.java", "license": "mit", "size": 8006 }
[ "com.microsoft.azure.management.compute.Plan" ]
import com.microsoft.azure.management.compute.Plan;
import com.microsoft.azure.management.compute.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
2,261,101
WidgetRegistry.getInstance().registerWidgetFactory(WIDGET_NAME, new CmsPrincipalWidgetFactory()); }
WidgetRegistry.getInstance().registerWidgetFactory(WIDGET_NAME, new CmsPrincipalWidgetFactory()); }
/** * Initializes this class.<p> */
Initializes this class
initClass
{ "repo_name": "it-tavis/opencms-core", "path": "src-gwt/org/opencms/ade/contenteditor/client/widgets/CmsPrincipalWidgetFactory.java", "license": "lgpl-2.1", "size": 2818 }
[ "org.opencms.ade.contenteditor.widgetregistry.client.WidgetRegistry" ]
import org.opencms.ade.contenteditor.widgetregistry.client.WidgetRegistry;
import org.opencms.ade.contenteditor.widgetregistry.client.*;
[ "org.opencms.ade" ]
org.opencms.ade;
1,902,473
UserTable privilegedGetRowsWithId(String appName, DbHandle dbHandleName, String tableId, OrderedColumns orderedColumns, String rowId) throws ServicesAvailabilityException;
UserTable privilegedGetRowsWithId(String appName, DbHandle dbHandleName, String tableId, OrderedColumns orderedColumns, String rowId) throws ServicesAvailabilityException;
/** * Return the row with the most recent changes for the given tableId and rowId. * If the row has conflicts, it throws an exception. Otherwise, it returns the * most recent checkpoint or non-checkpoint value; it will contain a single row. * * @param appName * @param dbHandleName * @param tableId * @param orderedColumns * @param rowId * @return */
Return the row with the most recent changes for the given tableId and rowId. If the row has conflicts, it throws an exception. Otherwise, it returns the most recent checkpoint or non-checkpoint value; it will contain a single row
privilegedGetRowsWithId
{ "repo_name": "opendatakit/androidlibrary", "path": "androidlibrary_lib/src/main/java/org/opendatakit/database/service/UserDbInterface.java", "license": "apache-2.0", "size": 50250 }
[ "org.opendatakit.database.data.OrderedColumns", "org.opendatakit.database.data.UserTable", "org.opendatakit.exception.ServicesAvailabilityException" ]
import org.opendatakit.database.data.OrderedColumns; import org.opendatakit.database.data.UserTable; import org.opendatakit.exception.ServicesAvailabilityException;
import org.opendatakit.database.data.*; import org.opendatakit.exception.*;
[ "org.opendatakit.database", "org.opendatakit.exception" ]
org.opendatakit.database; org.opendatakit.exception;
2,673,355
public static PreConfiguredCharFilter singletonWithVersion( String name, boolean useFilterForMultitermQueries, BiFunction<Reader, org.elasticsearch.Version, Reader> create ) { return new PreConfiguredCharFilter( name, CachingStrategy.ONE, useFilterForMultitermQueries, (reader, version) -> create.apply(reader, version) ); }
static PreConfiguredCharFilter function( String name, boolean useFilterForMultitermQueries, BiFunction<Reader, org.elasticsearch.Version, Reader> create ) { return new PreConfiguredCharFilter( name, CachingStrategy.ONE, useFilterForMultitermQueries, (reader, version) -> create.apply(reader, version) ); }
/** * Create a pre-configured char filter that may not vary at all, provide access to the elasticsearch version */
Create a pre-configured char filter that may not vary at all, provide access to the elasticsearch version
singletonWithVersion
{ "repo_name": "GlenRSmith/elasticsearch", "path": "server/src/main/java/org/elasticsearch/index/analysis/PreConfiguredCharFilter.java", "license": "apache-2.0", "size": 4287 }
[ "java.io.Reader", "java.util.function.BiFunction", "org.elasticsearch.Version", "org.elasticsearch.indices.analysis.PreBuiltCacheFactory" ]
import java.io.Reader; import java.util.function.BiFunction; import org.elasticsearch.Version; import org.elasticsearch.indices.analysis.PreBuiltCacheFactory;
import java.io.*; import java.util.function.*; import org.elasticsearch.*; import org.elasticsearch.indices.analysis.*;
[ "java.io", "java.util", "org.elasticsearch", "org.elasticsearch.indices" ]
java.io; java.util; org.elasticsearch; org.elasticsearch.indices;
1,768,782
int i, j, k, end = 0; String tmp; for (i = 0; i < array.length - 1; i++) { for (j = i + 1; j < array.length - end; j++) { if (array[i].equals(array[j])) { tmp = array[j]; k = j; while (k < array.length - 1) { array[k] = array[k + 1]; k++; } array[k] = tmp; end++; j--; } } } return Arrays.copyOf(array, array.length - end); }
int i, j, k, end = 0; String tmp; for (i = 0; i < array.length - 1; i++) { for (j = i + 1; j < array.length - end; j++) { if (array[i].equals(array[j])) { tmp = array[j]; k = j; while (k < array.length - 1) { array[k] = array[k + 1]; k++; } array[k] = tmp; end++; j--; } } } return Arrays.copyOf(array, array.length - end); }
/** * The method removes any duplicate string-values from an array of strings. * @param array Array of string elements. * @return The reference to the same object w/out duplicate elements. */
The method removes any duplicate string-values from an array of strings
remove
{ "repo_name": "Ravmouse/vvasilyev", "path": "chapter_001/src/main/java/ru/job4j/array/ArrayDuplicate.java", "license": "apache-2.0", "size": 1047 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,482,229
protected void addForeignKeyTableNamePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ForeignKeyConstraintExistsType_foreignKeyTableName_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ForeignKeyConstraintExistsType_foreignKeyTableName_feature", "_UI_ForeignKeyConstraintExistsType_type"), DbchangelogPackage.eINSTANCE.getForeignKeyConstraintExistsType_ForeignKeyTableName(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), DbchangelogPackage.eINSTANCE.getForeignKeyConstraintExistsType_ForeignKeyTableName(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
/** * This adds a property descriptor for the Foreign Key Table Name feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Foreign Key Table Name feature.
addForeignKeyTableNamePropertyDescriptor
{ "repo_name": "dzonekl/LiquibaseEditor", "path": "plugins/org.liquidbase.model.edit/src/org/liquibase/xml/ns/dbchangelog/provider/ForeignKeyConstraintExistsTypeItemProvider.java", "license": "mit", "size": 7816 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor", "org.liquibase.xml.ns.dbchangelog.DbchangelogPackage" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.liquibase.xml.ns.dbchangelog.DbchangelogPackage;
import org.eclipse.emf.edit.provider.*; import org.liquibase.xml.ns.dbchangelog.*;
[ "org.eclipse.emf", "org.liquibase.xml" ]
org.eclipse.emf; org.liquibase.xml;
995,856
MetricMutableFactory factory = spy(new MetricMutableFactory()); final MetricsRegistry r = new MetricsRegistry("test", factory); r.newCounter("c1", "c1 desc", 1); r.newCounter("c2", "c2 desc", 2L); r.newGauge("g1", "g1 desc", 3); r.newGauge("g2", "g2 desc", 4L); r.newStat("s1", "s1 desc", "ops", "time"); r.newDelta("d1", "d1 desc", 5); r.newDelta("d2", "d2 desc", 6L); assertEquals("num metrics in registry", 7, r.metrics().size()); verify(factory).newCounter("c1", "c1 desc", 1); verify(factory).newCounter("c2", "c2 desc", 2L); verify(factory).newGauge("g1", "g1 desc", 3); verify(factory).newGauge("g2", "g2 desc", 4L); verify(factory).newStat("s1", "s1 desc", "ops", "time", false); verify(factory).newDelta("d1", "d1 desc", 5); verify(factory).newDelta("d2", "d2 desc", 6L); assertTrue("c1 found", r.get("c1") instanceof MetricMutableCounterInt); assertTrue("c2 found", r.get("c2") instanceof MetricMutableCounterLong); assertTrue("g1 found", r.get("g1") instanceof MetricMutableGaugeInt); assertTrue("g2 found", r.get("g2") instanceof MetricMutableGaugeLong); assertTrue("s1 found", r.get("s1") instanceof MetricMutableStat); assertTrue("s1 found", r.get("d1") instanceof MetricMutableDeltaInt); assertTrue("s1 found", r.get("d2") instanceof MetricMutableDeltaLong); expectMetricsException("Metric name c1 already exists", new Runnable() {
MetricMutableFactory factory = spy(new MetricMutableFactory()); final MetricsRegistry r = new MetricsRegistry("test", factory); r.newCounter("c1", STR, 1); r.newCounter("c2", STR, 2L); r.newGauge("g1", STR, 3); r.newGauge("g2", STR, 4L); r.newStat("s1", STR, "ops", "time"); r.newDelta("d1", STR, 5); r.newDelta("d2", STR, 6L); assertEquals(STR, 7, r.metrics().size()); verify(factory).newCounter("c1", STR, 1); verify(factory).newCounter("c2", STR, 2L); verify(factory).newGauge("g1", STR, 3); verify(factory).newGauge("g2", STR, 4L); verify(factory).newStat("s1", STR, "ops", "time", false); verify(factory).newDelta("d1", STR, 5); verify(factory).newDelta("d2", STR, 6L); assertTrue(STR, r.get("c1") instanceof MetricMutableCounterInt); assertTrue(STR, r.get("c2") instanceof MetricMutableCounterLong); assertTrue(STR, r.get("g1") instanceof MetricMutableGaugeInt); assertTrue(STR, r.get("g2") instanceof MetricMutableGaugeLong); assertTrue(STR, r.get("s1") instanceof MetricMutableStat); assertTrue(STR, r.get("d1") instanceof MetricMutableDeltaInt); assertTrue(STR, r.get("d2") instanceof MetricMutableDeltaLong); expectMetricsException(STR, new Runnable() {
/** * Test various factory methods */
Test various factory methods
testNewMetrics
{ "repo_name": "zavakid/mushroom", "path": "src/test/java/com/zavakid/mushroom/lib/TestMetricsRegistry.java", "license": "apache-2.0", "size": 7370 }
[ "org.junit.Assert", "org.mockito.Mockito" ]
import org.junit.Assert; import org.mockito.Mockito;
import org.junit.*; import org.mockito.*;
[ "org.junit", "org.mockito" ]
org.junit; org.mockito;
711,838
public MacroFunc getMacro(String name) { NodeKey key = new NodeKey(name); if (macros.containsKey(key)) { return macros.get(key); } return null; }
MacroFunc function(String name) { NodeKey key = new NodeKey(name); if (macros.containsKey(key)) { return macros.get(key); } return null; }
/** * Return macro object * * @param name macro name * @return macro object */
Return macro object
getMacro
{ "repo_name": "MegafonWebLab/histone-java", "path": "src/main/java/ru/histone/evaluator/nodes/NameSpaceNode.java", "license": "apache-2.0", "size": 1618 }
[ "ru.histone.evaluator.MacroFunc" ]
import ru.histone.evaluator.MacroFunc;
import ru.histone.evaluator.*;
[ "ru.histone.evaluator" ]
ru.histone.evaluator;
2,321,287
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<PagedResponse<NetworkVirtualApplianceInner>> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } return FluxUtil .withContext(context -> service.listByResourceGroupNext(nextLink, context)) .<PagedResponse<NetworkVirtualApplianceInner>>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<NetworkVirtualApplianceInner>> function(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException(STR)); } return FluxUtil .withContext(context -> service.listByResourceGroupNext(nextLink, context)) .<PagedResponse<NetworkVirtualApplianceInner>>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); }
/** * Get the next page of items. * * @param nextLink The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response for ListNetworkVirtualAppliances API service call. */
Get the next page of items
listByResourceGroupNextSinglePageAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkVirtualAppliancesClientImpl.java", "license": "mit", "size": 72536 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedResponse", "com.azure.core.http.rest.PagedResponseBase", "com.azure.core.util.FluxUtil", "com.azure.resourcemanager.network.fluent.models.NetworkVirtualApplianceInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.network.fluent.models.NetworkVirtualApplianceInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.network.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,100,806
public void setMap(Map<String, T> map) { JodaBeanUtils.notNull(map, "map"); this.map.clear(); this.map.putAll(map); }
void function(Map<String, T> map) { JodaBeanUtils.notNull(map, "map"); this.map.clear(); this.map.putAll(map); }
/** * Sets the number. * @param map the new value of the property, not null */
Sets the number
setMap
{ "repo_name": "JodaOrg/joda-beans", "path": "src/test/java/org/joda/beans/sample/MinimalMutableGeneric.java", "license": "apache-2.0", "size": 6229 }
[ "java.util.Map", "org.joda.beans.JodaBeanUtils" ]
import java.util.Map; import org.joda.beans.JodaBeanUtils;
import java.util.*; import org.joda.beans.*;
[ "java.util", "org.joda.beans" ]
java.util; org.joda.beans;
2,695,463
public boolean clearQuery() { if (TextUtils.isEmpty(mQueryText)) { return false; } setSearching(false); this.mPendingQueryClear = true; mEditText.setText(""); if (mQueryTextListener != null) { mQueryTextListener.onQueryTextCleared(this); } return true; }
boolean function() { if (TextUtils.isEmpty(mQueryText)) { return false; } setSearching(false); this.mPendingQueryClear = true; mEditText.setText(""); if (mQueryTextListener != null) { mQueryTextListener.onQueryTextCleared(this); } return true; }
/** * Clears the current search query text if it is presented. * <p> * This will also fire {@link OnQueryTextListener#onQueryTextCleared(SearchView)} callback for * the current listener if it is attached. * * @return {@code True} if the query text has been cleared, {@code false} if there were no query * text to be cleared. */
Clears the current search query text if it is presented. This will also fire <code>OnQueryTextListener#onQueryTextCleared(SearchView)</code> callback for the current listener if it is attached
clearQuery
{ "repo_name": "android-libraries/android_ui", "path": "library/src/widget/input/java/com/albedinsky/android/ui/widget/SearchView.java", "license": "apache-2.0", "size": 40901 }
[ "android.text.TextUtils" ]
import android.text.TextUtils;
import android.text.*;
[ "android.text" ]
android.text;
2,104,127
PartialHealthCheckStrategyBuilder maxEndpointCount(int maxEndpointCount) { if (maxEndpointRatio != null) { throw new IllegalArgumentException("Maximum endpoint ratio is already set."); } checkArgument(maxEndpointCount > 0, "maxEndpointCount: %s (expected: 0 < maxEndpointCount <= MAX_INT)", maxEndpointCount); this.maxEndpointCount = maxEndpointCount; return this; }
PartialHealthCheckStrategyBuilder maxEndpointCount(int maxEndpointCount) { if (maxEndpointRatio != null) { throw new IllegalArgumentException(STR); } checkArgument(maxEndpointCount > 0, STR, maxEndpointCount); this.maxEndpointCount = maxEndpointCount; return this; }
/** * Sets the maximum endpoint count of target selected candidates. * The maximum endpoint count must greater than 0. * You can use only one of the maximum endpoint count or maximum endpoint ratio. */
Sets the maximum endpoint count of target selected candidates. The maximum endpoint count must greater than 0. You can use only one of the maximum endpoint count or maximum endpoint ratio
maxEndpointCount
{ "repo_name": "anuraaga/armeria", "path": "core/src/main/java/com/linecorp/armeria/client/endpoint/healthcheck/PartialHealthCheckStrategyBuilder.java", "license": "apache-2.0", "size": 3229 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
1,666,874
public static float round(float x, int scale, int roundingMethod) throws MathArithmeticException, MathIllegalArgumentException { final float sign = FastMath.copySign(1f, x); final float factor = (float) FastMath.pow(10.0f, scale) * sign; return (float) roundUnscaled(x * factor, sign, roundingMethod) / factor; }
static float function(float x, int scale, int roundingMethod) throws MathArithmeticException, MathIllegalArgumentException { final float sign = FastMath.copySign(1f, x); final float factor = (float) FastMath.pow(10.0f, scale) * sign; return (float) roundUnscaled(x * factor, sign, roundingMethod) / factor; }
/** * Rounds the given value to the specified number of decimal places. * The value is rounded using the given method which is any method defined * in {@link BigDecimal}. * * @param x Value to round. * @param scale Number of digits to the right of the decimal point. * @param roundingMethod Rounding method as defined in {@link BigDecimal}. * @return the rounded value. * @since 1.1 (previously in {@code MathUtils}, moved as of version 3.0) * @throws MathArithmeticException if an exact operation is required but result is not exact * @throws MathIllegalArgumentException if {@code roundingMethod} is not a valid rounding method. */
Rounds the given value to the specified number of decimal places. The value is rounded using the given method which is any method defined in <code>BigDecimal</code>
round
{ "repo_name": "camachohoracio/Armadillo.Core", "path": "Analytics/src/main/java/Armadillo/Analytics/Base/Precision.java", "license": "apache-2.0", "size": 22670 }
[ "org.apache.commons.math3.exception.MathArithmeticException", "org.apache.commons.math3.exception.MathIllegalArgumentException" ]
import org.apache.commons.math3.exception.MathArithmeticException; import org.apache.commons.math3.exception.MathIllegalArgumentException;
import org.apache.commons.math3.exception.*;
[ "org.apache.commons" ]
org.apache.commons;
358,322
public Hashtable<String, String> findBusinessByName(String businessName) { logger.debug("BEGIN findBusinessByName"); Collection<?> orgList = null; Hashtable<String, String> orgListNames = new Hashtable<String, String>(); try { BusinessQueryManager bqm = registryConnection.getBqm(); ArrayList<String> names = new ArrayList<String>(); names.add(businessName); Collection<String> fQualifiers = new ArrayList<String>(); fQualifiers.add(FindQualifier.EXACT_NAME_MATCH); logger.debug("BEGIN call findOrganization '" + businessName + "'"); BulkResponse br = bqm.findOrganizations(fQualifiers, names, null, null, null, null); logger.debug("END call findOrganizations"); if (br.getStatus() == JAXRResponse.STATUS_SUCCESS) { orgList = br.getCollection(); Iterator<?> iter = orgList.iterator(); while (iter.hasNext()) { Organization org = (Organization) iter.next(); orgListNames.put(getKeyID(org), getName(org)); logger.debug("Name=" + getName(org)); } } else { logger.error("One or more JAXRExceptions " + "occurred during the query operation!!"); } } catch (JAXRException e) { logger.error("Exception retrieving business by name " + businessName, e); } finally { logger.debug("END findBusinessByName"); } return orgListNames; }
Hashtable<String, String> function(String businessName) { logger.debug(STR); Collection<?> orgList = null; Hashtable<String, String> orgListNames = new Hashtable<String, String>(); try { BusinessQueryManager bqm = registryConnection.getBqm(); ArrayList<String> names = new ArrayList<String>(); names.add(businessName); Collection<String> fQualifiers = new ArrayList<String>(); fQualifiers.add(FindQualifier.EXACT_NAME_MATCH); logger.debug(STR + businessName + "'"); BulkResponse br = bqm.findOrganizations(fQualifiers, names, null, null, null, null); logger.debug(STR); if (br.getStatus() == JAXRResponse.STATUS_SUCCESS) { orgList = br.getCollection(); Iterator<?> iter = orgList.iterator(); while (iter.hasNext()) { Organization org = (Organization) iter.next(); orgListNames.put(getKeyID(org), getName(org)); logger.debug("Name=" + getName(org)); } } else { logger.error(STR + STR); } } catch (JAXRException e) { logger.error(STR + businessName, e); } finally { logger.debug(STR); } return orgListNames; }
/** * This method find Organization, of the specific JAXR registry, that has * name as 'businessName' * * @see it.greenvulcano.gvesb.j2ee.xmlRegistry.Registry#findBusinessByName(java.lang.String) */
This method find Organization, of the specific JAXR registry, that has name as 'businessName'
findBusinessByName
{ "repo_name": "green-vulcano/gv-engine", "path": "gvengine/gvbase/src/main/java/it/greenvulcano/gvesb/j2ee/xmlRegistry/impl/RegistryImpl.java", "license": "lgpl-3.0", "size": 23946 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.Hashtable", "java.util.Iterator", "javax.xml.registry.BulkResponse", "javax.xml.registry.BusinessQueryManager", "javax.xml.registry.FindQualifier", "javax.xml.registry.JAXRException", "javax.xml.registry.JAXRResponse", "javax.xml.registry.infomodel.Organization" ]
import java.util.ArrayList; import java.util.Collection; import java.util.Hashtable; import java.util.Iterator; import javax.xml.registry.BulkResponse; import javax.xml.registry.BusinessQueryManager; import javax.xml.registry.FindQualifier; import javax.xml.registry.JAXRException; import javax.xml.registry.JAXRResponse; import javax.xml.registry.infomodel.Organization;
import java.util.*; import javax.xml.registry.*; import javax.xml.registry.infomodel.*;
[ "java.util", "javax.xml" ]
java.util; javax.xml;
1,119,453
private Request makeRequest(DataSpec dataSpec) { long position = dataSpec.position; long length = dataSpec.length; boolean allowGzip = dataSpec.isFlagSet(DataSpec.FLAG_ALLOW_GZIP); HttpUrl url = HttpUrl.parse(dataSpec.uri.toString()); Request.Builder builder = new Request.Builder().url(url); if (cacheControl != null) { builder.cacheControl(cacheControl); } if (defaultRequestProperties != null) { for (Map.Entry<String, String> property : defaultRequestProperties.getSnapshot().entrySet()) { builder.header(property.getKey(), property.getValue()); } } for (Map.Entry<String, String> property : requestProperties.getSnapshot().entrySet()) { builder.header(property.getKey(), property.getValue()); } if (!(position == 0 && length == C.LENGTH_UNSET)) { String rangeRequest = "bytes=" + position + "-"; if (length != C.LENGTH_UNSET) { rangeRequest += (position + length - 1); } builder.addHeader("Range", rangeRequest); } if (userAgent != null) { builder.addHeader("User-Agent", userAgent); } if (!allowGzip) { builder.addHeader("Accept-Encoding", "identity"); } if (dataSpec.postBody != null) { builder.post(RequestBody.create(null, dataSpec.postBody)); } return builder.build(); }
Request function(DataSpec dataSpec) { long position = dataSpec.position; long length = dataSpec.length; boolean allowGzip = dataSpec.isFlagSet(DataSpec.FLAG_ALLOW_GZIP); HttpUrl url = HttpUrl.parse(dataSpec.uri.toString()); Request.Builder builder = new Request.Builder().url(url); if (cacheControl != null) { builder.cacheControl(cacheControl); } if (defaultRequestProperties != null) { for (Map.Entry<String, String> property : defaultRequestProperties.getSnapshot().entrySet()) { builder.header(property.getKey(), property.getValue()); } } for (Map.Entry<String, String> property : requestProperties.getSnapshot().entrySet()) { builder.header(property.getKey(), property.getValue()); } if (!(position == 0 && length == C.LENGTH_UNSET)) { String rangeRequest = STR + position + "-"; if (length != C.LENGTH_UNSET) { rangeRequest += (position + length - 1); } builder.addHeader("Range", rangeRequest); } if (userAgent != null) { builder.addHeader(STR, userAgent); } if (!allowGzip) { builder.addHeader(STR, STR); } if (dataSpec.postBody != null) { builder.post(RequestBody.create(null, dataSpec.postBody)); } return builder.build(); }
/** * Establishes a connection. */
Establishes a connection
makeRequest
{ "repo_name": "MaTriXy/ExoPlayer", "path": "extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/OkHttpDataSource.java", "license": "apache-2.0", "size": 13989 }
[ "com.google.android.exoplayer2.upstream.DataSpec", "java.util.Map" ]
import com.google.android.exoplayer2.upstream.DataSpec; import java.util.Map;
import com.google.android.exoplayer2.upstream.*; import java.util.*;
[ "com.google.android", "java.util" ]
com.google.android; java.util;
2,530,570
public CurrencyAmount presentValue(final SwaptionPhysicalFixedCompoundedONCompounded swaption, final BlackSwaptionFlatProviderInterface marketData) { ArgumentChecker.notNull(swaption, "swaption"); ArgumentChecker.notNull(marketData, "marketData"); final Swap<CouponFixedAccruedCompounding, CouponONCompounded> swap = swaption.getUnderlyingSwap(); final CouponFixedAccruedCompounding cpnFixed = swap.getFirstLeg().getNthPayment(0); final double numeraire = marketData.getMulticurveProvider().getDiscountFactor(cpnFixed.getCurrency(), cpnFixed.getPaymentTime()) * Math.abs(cpnFixed.getNotional()); final double delta = swap.getFirstLeg().getNthPayment(0).getPaymentYearFraction(); final double forwardModified = METHOD_SWAP.forwardModified(swap, marketData.getMulticurveProvider()); final double strikeModified = Math.pow(1.0d + swaption.getStrike(), delta) - 1.0; // Implementation note: Modified strike: \bar K = (1+K)^\delta-1; the swaption payoff is pvbp*(\bar F - \bar K)^+ final double maturity = swaption.getMaturityTime(); final EuropeanVanillaOption option = new EuropeanVanillaOption(strikeModified, swaption.getTimeToExpiry(), swaption.isCall()); final BlackPriceFunction blackFunction = new BlackPriceFunction(); final double volatility = marketData.getBlackParameters().getVolatility(swaption.getTimeToExpiry(), maturity); final BlackFunctionData dataBlack = new BlackFunctionData(forwardModified, numeraire, volatility); final Function1D<BlackFunctionData, Double> func = blackFunction.getPriceFunction(option); final double pv = func.evaluate(dataBlack) * (swaption.isLong() ? 1.0 : -1.0); return CurrencyAmount.of(swaption.getCurrency(), pv); }
CurrencyAmount function(final SwaptionPhysicalFixedCompoundedONCompounded swaption, final BlackSwaptionFlatProviderInterface marketData) { ArgumentChecker.notNull(swaption, STR); ArgumentChecker.notNull(marketData, STR); final Swap<CouponFixedAccruedCompounding, CouponONCompounded> swap = swaption.getUnderlyingSwap(); final CouponFixedAccruedCompounding cpnFixed = swap.getFirstLeg().getNthPayment(0); final double numeraire = marketData.getMulticurveProvider().getDiscountFactor(cpnFixed.getCurrency(), cpnFixed.getPaymentTime()) * Math.abs(cpnFixed.getNotional()); final double delta = swap.getFirstLeg().getNthPayment(0).getPaymentYearFraction(); final double forwardModified = METHOD_SWAP.forwardModified(swap, marketData.getMulticurveProvider()); final double strikeModified = Math.pow(1.0d + swaption.getStrike(), delta) - 1.0; final double maturity = swaption.getMaturityTime(); final EuropeanVanillaOption option = new EuropeanVanillaOption(strikeModified, swaption.getTimeToExpiry(), swaption.isCall()); final BlackPriceFunction blackFunction = new BlackPriceFunction(); final double volatility = marketData.getBlackParameters().getVolatility(swaption.getTimeToExpiry(), maturity); final BlackFunctionData dataBlack = new BlackFunctionData(forwardModified, numeraire, volatility); final Function1D<BlackFunctionData, Double> func = blackFunction.getPriceFunction(option); final double pv = func.evaluate(dataBlack) * (swaption.isLong() ? 1.0 : -1.0); return CurrencyAmount.of(swaption.getCurrency(), pv); }
/** * Computes the present value of a physical delivery European swaption in the Black model. * * @param swaption * The swaption. * @param marketData * The curves with Black volatility data. * @return The present value. */
Computes the present value of a physical delivery European swaption in the Black model
presentValue
{ "repo_name": "McLeodMoores/starling", "path": "projects/analytics/src/main/java/com/opengamma/analytics/financial/interestrate/swaption/provider/SwaptionPhysicalFixedCompoundedONCompoundedBlackMethod.java", "license": "apache-2.0", "size": 22246 }
[ "com.opengamma.analytics.financial.interestrate.payments.derivative.CouponFixedAccruedCompounding", "com.opengamma.analytics.financial.interestrate.payments.derivative.CouponONCompounded", "com.opengamma.analytics.financial.interestrate.swap.derivative.Swap", "com.opengamma.analytics.financial.interestrate.swaption.derivative.SwaptionPhysicalFixedCompoundedONCompounded", "com.opengamma.analytics.financial.model.option.pricing.analytic.formula.BlackFunctionData", "com.opengamma.analytics.financial.model.option.pricing.analytic.formula.BlackPriceFunction", "com.opengamma.analytics.financial.model.option.pricing.analytic.formula.EuropeanVanillaOption", "com.opengamma.analytics.financial.provider.description.interestrate.BlackSwaptionFlatProviderInterface", "com.opengamma.analytics.math.function.Function1D", "com.opengamma.util.ArgumentChecker", "com.opengamma.util.money.CurrencyAmount" ]
import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponFixedAccruedCompounding; import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponONCompounded; import com.opengamma.analytics.financial.interestrate.swap.derivative.Swap; import com.opengamma.analytics.financial.interestrate.swaption.derivative.SwaptionPhysicalFixedCompoundedONCompounded; import com.opengamma.analytics.financial.model.option.pricing.analytic.formula.BlackFunctionData; import com.opengamma.analytics.financial.model.option.pricing.analytic.formula.BlackPriceFunction; import com.opengamma.analytics.financial.model.option.pricing.analytic.formula.EuropeanVanillaOption; import com.opengamma.analytics.financial.provider.description.interestrate.BlackSwaptionFlatProviderInterface; import com.opengamma.analytics.math.function.Function1D; import com.opengamma.util.ArgumentChecker; import com.opengamma.util.money.CurrencyAmount;
import com.opengamma.analytics.financial.interestrate.payments.derivative.*; import com.opengamma.analytics.financial.interestrate.swap.derivative.*; import com.opengamma.analytics.financial.interestrate.swaption.derivative.*; import com.opengamma.analytics.financial.model.option.pricing.analytic.formula.*; import com.opengamma.analytics.financial.provider.description.interestrate.*; import com.opengamma.analytics.math.function.*; import com.opengamma.util.*; import com.opengamma.util.money.*;
[ "com.opengamma.analytics", "com.opengamma.util" ]
com.opengamma.analytics; com.opengamma.util;
349,536
WebResponse getSubframeResponse( WebRequest request, RequestContext requestContext ) throws IOException, SAXException { WebResponse response = getResource( request ); return response == null ? null : updateWindow( request.getTarget(), response, requestContext ); }
WebResponse getSubframeResponse( WebRequest request, RequestContext requestContext ) throws IOException, SAXException { WebResponse response = getResource( request ); return response == null ? null : updateWindow( request.getTarget(), response, requestContext ); }
/** * get a Response from a SubFrame * @param request * @param requestContext * @return the WebResponse or null * @throws IOException * @throws SAXException */
get a Response from a SubFrame
getSubframeResponse
{ "repo_name": "lamsfoundation/lams", "path": "3rdParty_sources/httpunit/com/meterware/httpunit/WebWindow.java", "license": "gpl-2.0", "size": 13968 }
[ "java.io.IOException", "org.xml.sax.SAXException" ]
import java.io.IOException; import org.xml.sax.SAXException;
import java.io.*; import org.xml.sax.*;
[ "java.io", "org.xml.sax" ]
java.io; org.xml.sax;
1,427,346
public void listDataSources(com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest request, io.grpc.stub.StreamObserver<com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse> responseObserver) { asyncUnaryCall( getChannel().newCall(getListDataSourcesMethodHelper(), getCallOptions()), request, responseObserver); }
void function(com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest request, io.grpc.stub.StreamObserver<com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse> responseObserver) { asyncUnaryCall( getChannel().newCall(getListDataSourcesMethodHelper(), getCallOptions()), request, responseObserver); }
/** * <pre> * Lists supported data sources and returns their settings, * which can be used for UI rendering. * </pre> */
<code> Lists supported data sources and returns their settings, which can be used for UI rendering. </code>
listDataSources
{ "repo_name": "pongad/api-client-staging", "path": "generated/java/grpc-google-cloud-bigquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/DataTransferServiceGrpc.java", "license": "bsd-3-clause", "size": 79279 }
[ "io.grpc.stub.ClientCalls", "io.grpc.stub.ServerCalls" ]
import io.grpc.stub.ClientCalls; import io.grpc.stub.ServerCalls;
import io.grpc.stub.*;
[ "io.grpc.stub" ]
io.grpc.stub;
1,034,051
static void addSoyFilesToBuilder( Builder sfsBuilder, String inputPrefix, Collection<String> srcs, Collection<String> args, Collection<String> deps, Collection<String> indirectDeps, Function<String, Void> exitWithErrorFn) { if (srcs.isEmpty() && args.isEmpty()) { exitWithErrorFn.apply("Must provide list of source Soy files (--srcs)."); } if (!srcs.isEmpty() && !args.isEmpty()) { exitWithErrorFn.apply( "Found source Soy files from --srcs and from args (please use --srcs only)."); } // Create Set versions of each of the arguments, and de-dupe. If something is included as // multiple file kinds, we'll keep the strongest one; a file in both srcs and deps will be a // src, and one in both deps and indirect_deps will be a dep. // TODO(gboyer): Maybe stop supporting old style (srcs from command line args) at some point. Set<String> srcsSet = ImmutableSet.<String>builder().addAll(srcs).addAll(args).build(); Set<String> depsSet = Sets.difference(ImmutableSet.copyOf(deps), srcsSet); Set<String> indirectDepsSet = Sets.difference(ImmutableSet.copyOf(indirectDeps), Sets.union(srcsSet, depsSet)); for (String src : srcsSet) { sfsBuilder.addWithKind(new File(inputPrefix + src), SoyFileKind.SRC); } for (String dep : depsSet) { sfsBuilder.addWithKind(new File(inputPrefix + dep), SoyFileKind.DEP); } for (String dep : indirectDepsSet) { sfsBuilder.addWithKind(new File(inputPrefix + dep), SoyFileKind.INDIRECT_DEP); } }
static void addSoyFilesToBuilder( Builder sfsBuilder, String inputPrefix, Collection<String> srcs, Collection<String> args, Collection<String> deps, Collection<String> indirectDeps, Function<String, Void> exitWithErrorFn) { if (srcs.isEmpty() && args.isEmpty()) { exitWithErrorFn.apply(STR); } if (!srcs.isEmpty() && !args.isEmpty()) { exitWithErrorFn.apply( STR); } Set<String> srcsSet = ImmutableSet.<String>builder().addAll(srcs).addAll(args).build(); Set<String> depsSet = Sets.difference(ImmutableSet.copyOf(deps), srcsSet); Set<String> indirectDepsSet = Sets.difference(ImmutableSet.copyOf(indirectDeps), Sets.union(srcsSet, depsSet)); for (String src : srcsSet) { sfsBuilder.addWithKind(new File(inputPrefix + src), SoyFileKind.SRC); } for (String dep : depsSet) { sfsBuilder.addWithKind(new File(inputPrefix + dep), SoyFileKind.DEP); } for (String dep : indirectDepsSet) { sfsBuilder.addWithKind(new File(inputPrefix + dep), SoyFileKind.INDIRECT_DEP); } }
/** * Helper to add srcs and deps Soy files to a SoyFileSet builder. Also does sanity checks. * * @param sfsBuilder The SoyFileSet builder to add to. * @param inputPrefix The input path prefix to prepend to all the file paths. * @param srcs The srcs from the --srcs flag. Exactly one of 'srcs' and 'args' must be nonempty. * @param args The old-style srcs from the command line (that's how they were specified before we * added the --srcs flag). Exactly one of 'srcs' and 'args' must be nonempty. * @param deps The deps from the --deps flag, or empty list if not applicable. * @param exitWithErrorFn A function that exits with an error message followed by a usage message. */
Helper to add srcs and deps Soy files to a SoyFileSet builder. Also does sanity checks
addSoyFilesToBuilder
{ "repo_name": "rpatil26/closure-templates", "path": "java/src/com/google/template/soy/MainClassUtils.java", "license": "apache-2.0", "size": 12570 }
[ "com.google.common.base.Function", "com.google.common.collect.ImmutableSet", "com.google.common.collect.Sets", "com.google.template.soy.SoyFileSet", "com.google.template.soy.base.internal.SoyFileKind", "java.io.File", "java.util.Collection", "java.util.Set" ]
import com.google.common.base.Function; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; import com.google.template.soy.SoyFileSet; import com.google.template.soy.base.internal.SoyFileKind; import java.io.File; import java.util.Collection; import java.util.Set;
import com.google.common.base.*; import com.google.common.collect.*; import com.google.template.soy.*; import com.google.template.soy.base.internal.*; import java.io.*; import java.util.*;
[ "com.google.common", "com.google.template", "java.io", "java.util" ]
com.google.common; com.google.template; java.io; java.util;
1,237,013
public void setDefaultTemplate(SetDefaultTemplateRequest request) { call( new PostRequest(path("set_default_template")) .setParam("qualifier", request.getQualifier()) .setParam("templateId", request.getTemplateId()) .setParam("templateName", request.getTemplateName()) .setMediaType(MediaTypes.JSON) ).content(); }
void function(SetDefaultTemplateRequest request) { call( new PostRequest(path(STR)) .setParam(STR, request.getQualifier()) .setParam(STR, request.getTemplateId()) .setParam(STR, request.getTemplateName()) .setMediaType(MediaTypes.JSON) ).content(); }
/** * * This is part of the internal API. * This is a POST request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/permissions/set_default_template">Further information about this action online (including a response example)</a> * @since 5.2 */
This is part of the internal API. This is a POST request
setDefaultTemplate
{ "repo_name": "SonarSource/sonarqube", "path": "sonar-ws/src/main/java/org/sonarqube/ws/client/permissions/PermissionsService.java", "license": "lgpl-3.0", "size": 16761 }
[ "org.sonarqube.ws.MediaTypes", "org.sonarqube.ws.client.PostRequest" ]
import org.sonarqube.ws.MediaTypes; import org.sonarqube.ws.client.PostRequest;
import org.sonarqube.ws.*; import org.sonarqube.ws.client.*;
[ "org.sonarqube.ws" ]
org.sonarqube.ws;
2,388,586
private void displayFolderChoice(int requestCode, Folder folder, String accountUuid, String lastSelectedFolderName, List<LocalMessage> messages) { Intent intent = new Intent(getActivity(), ChooseFolder.class); intent.putExtra(ChooseFolder.EXTRA_ACCOUNT, accountUuid); intent.putExtra(ChooseFolder.EXTRA_SEL_FOLDER, lastSelectedFolderName); if (folder == null) { intent.putExtra(ChooseFolder.EXTRA_SHOW_CURRENT, "yes"); } else { intent.putExtra(ChooseFolder.EXTRA_CUR_FOLDER, folder.getName()); } // remember the selected messages for #onActivityResult mActiveMessages = messages; startActivityForResult(intent, requestCode); }
void function(int requestCode, Folder folder, String accountUuid, String lastSelectedFolderName, List<LocalMessage> messages) { Intent intent = new Intent(getActivity(), ChooseFolder.class); intent.putExtra(ChooseFolder.EXTRA_ACCOUNT, accountUuid); intent.putExtra(ChooseFolder.EXTRA_SEL_FOLDER, lastSelectedFolderName); if (folder == null) { intent.putExtra(ChooseFolder.EXTRA_SHOW_CURRENT, "yes"); } else { intent.putExtra(ChooseFolder.EXTRA_CUR_FOLDER, folder.getName()); } mActiveMessages = messages; startActivityForResult(intent, requestCode); }
/** * Helper method to manage the invocation of {@link #startActivityForResult(Intent, int)} for a * folder operation ({@link ChooseFolder} activity), while saving a list of associated messages. * * @param requestCode * If {@code >= 0}, this code will be returned in {@code onActivityResult()} when the * activity exits. * @param folder * The source folder. Never {@code null}. * @param messages * Messages to be affected by the folder operation. Never {@code null}. * * @see #startActivityForResult(Intent, int) */
Helper method to manage the invocation of <code>#startActivityForResult(Intent, int)</code> for a folder operation (<code>ChooseFolder</code> activity), while saving a list of associated messages
displayFolderChoice
{ "repo_name": "sanderbaas/k-9", "path": "k9mail/src/main/java/com/fsck/k9/fragment/MessageListFragment.java", "license": "bsd-3-clause", "size": 127078 }
[ "android.content.Intent", "com.fsck.k9.activity.ChooseFolder", "com.fsck.k9.mail.Folder", "com.fsck.k9.mailstore.LocalMessage", "java.util.List" ]
import android.content.Intent; import com.fsck.k9.activity.ChooseFolder; import com.fsck.k9.mail.Folder; import com.fsck.k9.mailstore.LocalMessage; import java.util.List;
import android.content.*; import com.fsck.k9.activity.*; import com.fsck.k9.mail.*; import com.fsck.k9.mailstore.*; import java.util.*;
[ "android.content", "com.fsck.k9", "java.util" ]
android.content; com.fsck.k9; java.util;
1,446,720
public Builder charset(Charset charset) { return new Builder(new CSV( csv.separator, csv.quotechar, csv.escapechar, csv.lineEnd, csv.skipLines, csv.strictQuotes, csv.ignoreLeadingWhiteSpace, charset)); }
Builder function(Charset charset) { return new Builder(new CSV( csv.separator, csv.quotechar, csv.escapechar, csv.lineEnd, csv.skipLines, csv.strictQuotes, csv.ignoreLeadingWhiteSpace, charset)); }
/** * Constructs <code>CSVBuilder</code> with specified charset */
Constructs <code>CSVBuilder</code> with specified charset
charset
{ "repo_name": "RickieES/localizethat", "path": "lib/OpenCSV/src/au/com/bytecode/opencsv/CSV.java", "license": "mpl-2.0", "size": 19211 }
[ "java.nio.charset.Charset" ]
import java.nio.charset.Charset;
import java.nio.charset.*;
[ "java.nio" ]
java.nio;
1,565,223
protected void computeAddressByteArray(OSCJavaToByteArrayConverter stream) { stream.write(address); }
void function(OSCJavaToByteArrayConverter stream) { stream.write(address); }
/** * Compute address byte array. * * @param stream * OscPacketByteArrayConverter */
Compute address byte array
computeAddressByteArray
{ "repo_name": "synergynet/synergynet2.5", "path": "synergynet2.5/src/main/java/com/illposed/osc/OSCMessage.java", "license": "bsd-3-clause", "size": 4802 }
[ "com.illposed.osc.utility.OSCJavaToByteArrayConverter" ]
import com.illposed.osc.utility.OSCJavaToByteArrayConverter;
import com.illposed.osc.utility.*;
[ "com.illposed.osc" ]
com.illposed.osc;
1,929,846
@Override CompletionStage<Result> apply(Http.RequestHeader requestHeader, DeadboltHandler handler, Function<Http.RequestHeader, CompletionStage<Result>> onSuccess);
CompletionStage<Result> apply(Http.RequestHeader requestHeader, DeadboltHandler handler, Function<Http.RequestHeader, CompletionStage<Result>> onSuccess);
/** * Test the constraint against the current request. * * @param requestHeader the request header * @param handler the deadbolt handler * @param onSuccess a function to process the request if the constraint test passes * @return a future for the result */
Test the constraint against the current request
apply
{ "repo_name": "mkurz/deadbolt-2-java", "path": "code/app/be/objectify/deadbolt/java/filters/FilterFunction.java", "license": "apache-2.0", "size": 1672 }
[ "be.objectify.deadbolt.java.DeadboltHandler", "java.util.concurrent.CompletionStage", "java.util.function.Function" ]
import be.objectify.deadbolt.java.DeadboltHandler; import java.util.concurrent.CompletionStage; import java.util.function.Function;
import be.objectify.deadbolt.java.*; import java.util.concurrent.*; import java.util.function.*;
[ "be.objectify.deadbolt", "java.util" ]
be.objectify.deadbolt; java.util;
2,532,755
public static void setPropertyValue(final Object bean, final String propertyName, final Object value) throws NullPointerException, IntrospectionException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, IllegalArgumentException { Method mutator = getPropertyWriteMethod(bean.getClass(), propertyName); // != null; throws loads of exceptions Object[] args = {value}; mutator.invoke(bean, args); }
static void function(final Object bean, final String propertyName, final Object value) throws NullPointerException, IntrospectionException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, IllegalArgumentException { Method mutator = getPropertyWriteMethod(bean.getClass(), propertyName); Object[] args = {value}; mutator.invoke(bean, args); }
/** * Set the value of the property with name <code>propertyName</code> * of the bean <code>bean</code> to <code>value</code>. * * @param bean * The bean to set the property value of * @param propertyName * The programmatic name of the property we want to write * @param value * The value to be stored in the property * @throws NullPointerException * bean == null; * @throws IntrospectionException * Cannot get the <code>BeanInfo</code> of <code>bean</code> class. * @throws NoSuchMethodException * There is no write method for this property in the bean. * @throws IllegalAccessException * This user is not allowed to access the write method of * the <code>propertyName()</code>-property of <code>bean</code>. * @throws InvocationTargetException * The write method of the property <code>propertyName</code>, * applied to <code>bean</code>, has thrown an exception. * @throws IllegalArgumentException * <code>value</code> cannot be coerced in an value of the type * expected by the property write method. * * @deprecated Use <a href="http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanutils/PropertyUtils.html" * target="extern">Apache Jakarta Commons beanutils PropertyUtil.setProperty()</a> instead. */
Set the value of the property with name <code>propertyName</code> of the bean <code>bean</code> to <code>value</code>
setPropertyValue
{ "repo_name": "jandppw/ppwcode-recovered-from-google-code", "path": "java/vernacular/semantics/V/1.n.n/1.0.n/V-1.0.0-1.1/src/java/be/peopleware/bean_V/Beans.java", "license": "apache-2.0", "size": 23107 }
[ "java.beans.IntrospectionException", "java.lang.reflect.InvocationTargetException", "java.lang.reflect.Method" ]
import java.beans.IntrospectionException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method;
import java.beans.*; import java.lang.reflect.*;
[ "java.beans", "java.lang" ]
java.beans; java.lang;
2,213,818
protected void callActivityEndListeners(ActivityExecution execution) { // TODO: This is currently done without a proper {@link AtomicOperation} causing problems, see http://jira.codehaus.org/browse/ACT-1339 List<ExecutionListener> listeners = activity.getExecutionListeners(org.camunda.bpm.engine.impl.pvm.PvmEvent.EVENTNAME_END); for (ExecutionListener executionListener : listeners) { try { Context.getProcessEngineConfiguration() .getDelegateInterceptor() .handleInvocation(new ExecutionListenerInvocation(executionListener, execution)); } catch (Exception e) { throw new ProcessEngineException("Couldn't execute end listener", e); } } }
void function(ActivityExecution execution) { List<ExecutionListener> listeners = activity.getExecutionListeners(org.camunda.bpm.engine.impl.pvm.PvmEvent.EVENTNAME_END); for (ExecutionListener executionListener : listeners) { try { Context.getProcessEngineConfiguration() .getDelegateInterceptor() .handleInvocation(new ExecutionListenerInvocation(executionListener, execution)); } catch (Exception e) { throw new ProcessEngineException(STR, e); } } }
/** * Since no transitions are followed when leaving the inner activity, * it is needed to call the end listeners yourself. */
Since no transitions are followed when leaving the inner activity, it is needed to call the end listeners yourself
callActivityEndListeners
{ "repo_name": "menski/camunda-bpm-platform", "path": "engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/behavior/MultiInstanceActivityBehavior.java", "license": "apache-2.0", "size": 14505 }
[ "java.util.List", "org.camunda.bpm.engine.ProcessEngineException", "org.camunda.bpm.engine.delegate.ExecutionListener", "org.camunda.bpm.engine.impl.bpmn.delegate.ExecutionListenerInvocation", "org.camunda.bpm.engine.impl.context.Context", "org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution" ]
import java.util.List; import org.camunda.bpm.engine.ProcessEngineException; import org.camunda.bpm.engine.delegate.ExecutionListener; import org.camunda.bpm.engine.impl.bpmn.delegate.ExecutionListenerInvocation; import org.camunda.bpm.engine.impl.context.Context; import org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution;
import java.util.*; import org.camunda.bpm.engine.*; import org.camunda.bpm.engine.delegate.*; import org.camunda.bpm.engine.impl.bpmn.delegate.*; import org.camunda.bpm.engine.impl.context.*; import org.camunda.bpm.engine.impl.pvm.delegate.*;
[ "java.util", "org.camunda.bpm" ]
java.util; org.camunda.bpm;
2,236,510
String getTileRelativeFilenameString(MapTile aTile);
String getTileRelativeFilenameString(MapTile aTile);
/** * Get a unique file path for the tile. This file path may be used to store the tile on a file * system and performance considerations should be taken into consideration. It can include * multiple paths. It should not begin with a leading path separator. * * @param aTile the tile * @return the unique file path */
Get a unique file path for the tile. This file path may be used to store the tile on a file system and performance considerations should be taken into consideration. It can include multiple paths. It should not begin with a leading path separator
getTileRelativeFilenameString
{ "repo_name": "petercpg/MozStumbler", "path": "android/src/main/java/org/mozilla/osmdroid/tileprovider/tilesource/ITileSource.java", "license": "mpl-2.0", "size": 1970 }
[ "org.mozilla.osmdroid.tileprovider.MapTile" ]
import org.mozilla.osmdroid.tileprovider.MapTile;
import org.mozilla.osmdroid.tileprovider.*;
[ "org.mozilla.osmdroid" ]
org.mozilla.osmdroid;
2,674,668
private void initializePlayer(Uri alert) { // stop() checks to see if we are already playing. stop();
void function(Uri alert) { stop();
/** * Inits player and sets volume to 0 * * @param alert */
Inits player and sets volume to 0
initializePlayer
{ "repo_name": "kazuooooo/NidoneAlarm2", "path": "AlarmClock/src/main/java/com/better/alarm/presenter/background/KlaxonService.java", "license": "apache-2.0", "size": 17097 }
[ "android.net.Uri" ]
import android.net.Uri;
import android.net.*;
[ "android.net" ]
android.net;
1,021,404
public SubResource basePolicy() { return this.basePolicy; }
SubResource function() { return this.basePolicy; }
/** * Get the basePolicy property: The parent firewall policy from which rules are inherited. * * @return the basePolicy value. */
Get the basePolicy property: The parent firewall policy from which rules are inherited
basePolicy
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/FirewallPolicyInner.java", "license": "mit", "size": 7495 }
[ "com.azure.core.management.SubResource" ]
import com.azure.core.management.SubResource;
import com.azure.core.management.*;
[ "com.azure.core" ]
com.azure.core;
2,904,483
public void setFailed(final Exception exception) { Preconditions.checkArgument(exception != null); Preconditions.checkState(!isClosed); Preconditions.checkState(resultState == null); resultState = QueryState.FAILED; resultException = exception; }
void function(final Exception exception) { Preconditions.checkArgument(exception != null); Preconditions.checkState(!isClosed); Preconditions.checkState(resultState == null); resultState = QueryState.FAILED; resultException = exception; }
/** * Set up the result for a FAILED state. * * <p>Failures that occur during cleanup processing will be added as suppressed * exceptions. * * @param exception the exception that led to the FAILED state */
Set up the result for a FAILED state. Failures that occur during cleanup processing will be added as suppressed exceptions
setFailed
{ "repo_name": "vkorukanti/drill", "path": "exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java", "license": "apache-2.0", "size": 49020 }
[ "com.google.common.base.Preconditions", "org.apache.drill.exec.proto.UserBitShared" ]
import com.google.common.base.Preconditions; import org.apache.drill.exec.proto.UserBitShared;
import com.google.common.base.*; import org.apache.drill.exec.proto.*;
[ "com.google.common", "org.apache.drill" ]
com.google.common; org.apache.drill;
1,897,005
public ExecRow setBeforeFirstRow() throws StandardException { if ( ! isOpen ) { throw StandardException.newException(SQLState.LANG_RESULT_SET_NOT_OPEN, FIRST); } if (SanityManager.DEBUG) { if (!isTopResultSet) { SanityManager.THROWASSERT( this + "expected to be the top ResultSet"); } SanityManager.THROWASSERT( "setBeforeFirstRow() not expected to be called for " + getClass().getName()); } return null; }
ExecRow function() throws StandardException { if ( ! isOpen ) { throw StandardException.newException(SQLState.LANG_RESULT_SET_NOT_OPEN, FIRST); } if (SanityManager.DEBUG) { if (!isTopResultSet) { SanityManager.THROWASSERT( this + STR); } SanityManager.THROWASSERT( STR + getClass().getName()); } return null; }
/** * Sets the current position to before the first row and returns NULL * because there is no current row. * * @return NULL. * * @exception StandardException Thrown on failure * @see Row */
Sets the current position to before the first row and returns NULL because there is no current row
setBeforeFirstRow
{ "repo_name": "viaper/DBPlus", "path": "DerbyHodgepodge/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java", "license": "apache-2.0", "size": 26138 }
[ "org.apache.derby.iapi.error.StandardException", "org.apache.derby.iapi.reference.SQLState", "org.apache.derby.iapi.services.sanity.SanityManager", "org.apache.derby.iapi.sql.execute.ExecRow" ]
import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.reference.SQLState; import org.apache.derby.iapi.services.sanity.SanityManager; import org.apache.derby.iapi.sql.execute.ExecRow;
import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.reference.*; import org.apache.derby.iapi.services.sanity.*; import org.apache.derby.iapi.sql.execute.*;
[ "org.apache.derby" ]
org.apache.derby;
197,776