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
protected void createInitialFlowActions(final Flow flow) { flow.getStartActionList().add(createEvaluateAction(CasWebflowConstants.ACTION_ID_INIT_FLOW_SETUP)); }
void function(final Flow flow) { flow.getStartActionList().add(createEvaluateAction(CasWebflowConstants.ACTION_ID_INIT_FLOW_SETUP)); }
/** * Create initial flow actions. * * @param flow the flow */
Create initial flow actions
createInitialFlowActions
{ "repo_name": "tduehr/cas", "path": "core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/DefaultLoginWebflowConfigurer.java", "license": "apache-2.0", "size": 22476 }
[ "org.apereo.cas.web.flow.CasWebflowConstants", "org.springframework.webflow.engine.Flow" ]
import org.apereo.cas.web.flow.CasWebflowConstants; import org.springframework.webflow.engine.Flow;
import org.apereo.cas.web.flow.*; import org.springframework.webflow.engine.*;
[ "org.apereo.cas", "org.springframework.webflow" ]
org.apereo.cas; org.springframework.webflow;
2,831,869
private Map readPaintMap(ObjectInputStream in) throws IOException, ClassNotFoundException { boolean isNull = in.readBoolean(); if (isNull) { return null; } Map result = new HashMap(); int count = in.readInt(); for (int i = 0; i < count; i++) { Comparable category = (Comparable) in.readObject(); Paint paint = SerialUtilities.readPaint(in); result.put(category, paint); } return result; }
Map function(ObjectInputStream in) throws IOException, ClassNotFoundException { boolean isNull = in.readBoolean(); if (isNull) { return null; } Map result = new HashMap(); int count = in.readInt(); for (int i = 0; i < count; i++) { Comparable category = (Comparable) in.readObject(); Paint paint = SerialUtilities.readPaint(in); result.put(category, paint); } return result; }
/** * Reads a <code>Map</code> of (<code>Comparable</code>, <code>Paint</code>) * elements from a stream. * * @param in the input stream. * * @return The map. * * @throws IOException * @throws ClassNotFoundException * * @see #writePaintMap(Map, ObjectOutputStream) */
Reads a <code>Map</code> of (<code>Comparable</code>, <code>Paint</code>) elements from a stream
readPaintMap
{ "repo_name": "opensim-org/opensim-gui", "path": "Gui/opensim/jfreechart/src/org/jfree/chart/axis/CategoryAxis.java", "license": "apache-2.0", "size": 45767 }
[ "java.awt.Paint", "java.io.IOException", "java.io.ObjectInputStream", "java.util.HashMap", "java.util.Map", "org.jfree.io.SerialUtilities" ]
import java.awt.Paint; import java.io.IOException; import java.io.ObjectInputStream; import java.util.HashMap; import java.util.Map; import org.jfree.io.SerialUtilities;
import java.awt.*; import java.io.*; import java.util.*; import org.jfree.io.*;
[ "java.awt", "java.io", "java.util", "org.jfree.io" ]
java.awt; java.io; java.util; org.jfree.io;
631,665
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<PipelineRunsQueryResponseInner> queryByFactoryAsync( String resourceGroupName, String factoryName, RunFilterParameters filterParameters) { return queryByFactoryWithResponseAsync(resourceGroupName, factoryName, filterParameters) .flatMap( (Response<PipelineRunsQueryResponseInner> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { return Mono.empty(); } }); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PipelineRunsQueryResponseInner> function( String resourceGroupName, String factoryName, RunFilterParameters filterParameters) { return queryByFactoryWithResponseAsync(resourceGroupName, factoryName, filterParameters) .flatMap( (Response<PipelineRunsQueryResponseInner> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { return Mono.empty(); } }); }
/** * Query pipeline runs in the factory based on input filter conditions. * * @param resourceGroupName The resource group name. * @param factoryName The factory name. * @param filterParameters Parameters to filter the pipeline run. * @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 a list pipeline runs on successful completion of {@link Mono}. */
Query pipeline runs in the factory based on input filter conditions
queryByFactoryAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/PipelineRunsClientImpl.java", "license": "mit", "size": 29901 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.resourcemanager.datafactory.fluent.models.PipelineRunsQueryResponseInner", "com.azure.resourcemanager.datafactory.models.RunFilterParameters" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.resourcemanager.datafactory.fluent.models.PipelineRunsQueryResponseInner; import com.azure.resourcemanager.datafactory.models.RunFilterParameters;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.datafactory.fluent.models.*; import com.azure.resourcemanager.datafactory.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,590,086
public static ServiceDescriptor getWebster(String policy, String[] roots) throws IOException { return (getWebster(policy, 0, roots)); }
static ServiceDescriptor function(String policy, String[] roots) throws IOException { return (getWebster(policy, 0, roots)); }
/** * Get the {@link com.sun.jini.start.ServiceDescriptor} instance for * {@link sorcer.tools.webster.Webster}. * * @param policy * The security policy file to use * @param roots * The roots webster should serve * @return The {@link com.sun.jini.start.ServiceDescriptor} instance for * webster using an anonymous port. The <tt>webster.jar</tt> file * will be loaded from <tt>sorcer.home/common/sorcer/webster.com</tt> * * @throws IOException * If there are problems getting the anonymous port * @throws RuntimeException * If the <tt>sorcer.home</tt> system property is not set */
Get the <code>com.sun.jini.start.ServiceDescriptor</code> instance for <code>sorcer.tools.webster.Webster</code>
getWebster
{ "repo_name": "dudzislaw/SORCER", "path": "tools/sorcer-boot/src/main/java/sorcer/provider/boot/SorcerDescriptorUtil.java", "license": "apache-2.0", "size": 51715 }
[ "com.sun.jini.start.ServiceDescriptor", "java.io.IOException" ]
import com.sun.jini.start.ServiceDescriptor; import java.io.IOException;
import com.sun.jini.start.*; import java.io.*;
[ "com.sun.jini", "java.io" ]
com.sun.jini; java.io;
1,603,211
this.bundleContext = bundleContext; // the configuration is guaranteed not to be null, because the component definition has the // configuration-policy set to require. If set to 'optional' then the configuration may be null // to override the default refresh interval one has to add a // parameter to openhab.cfg like <bindingName>:refresh=<intervalInMs> logger.warn("Konfiguration für Vbus :" + configuration); if (configuration != null) { String refreshIntervalString = (String) configuration.get("refresh"); logger.warn("Konfiguration für Vbus refreshIntervalString:" + refreshIntervalString); String serialString = (String) configuration.get("serialport"); logger.warn("Konfiguration für Vbus serialString:" + serialString); String hostString = (String) configuration.get("host"); logger.warn("Konfiguration für Vbus hostString:" + hostString); String portString = (String) configuration.get("port"); logger.warn("Konfiguration für Vbus portString:" + portString); String pwString = (String) configuration.get("password"); logger.warn("Konfiguration für Vbus pwString:" + pwString); String updIvalString = (String) configuration.get("updateinterval"); logger.warn("Konfiguration für Vbus updIvalString:" + updIvalString); if (StringUtils.isNotBlank(hostString) && (StringUtils.isNotBlank(serialString))) { logger.warn("You cannot define a LAN and a serial/USB interface"); return; } if (StringUtils.isNotBlank(refreshIntervalString)) { refreshInterval = Long.parseLong(refreshIntervalString); } if (StringUtils.isNotBlank(hostString)) { host = hostString; inputMode = INPUT_MODE_LAN; } if (StringUtils.isNotBlank(portString)) { port = Integer.parseInt(portString); } if (StringUtils.isNotBlank(pwString)) { password = pwString; } if (StringUtils.isNotBlank(updIvalString)) { updateInterval = Long.parseLong(updIvalString); } if (StringUtils.isNotBlank(serialString)) { serialPort = serialString; inputMode = INPUT_MODE_SERIAL; } logger.warn("Konfiguration für Vbus inputMode:" + inputMode); logger.debug("Lade XML"); loadXMLConfig(); logger.debug("XML geladen"); // Create LAN oder Serial Receiver the parsed information to the listener switch (inputMode) { case INPUT_MODE_LAN: { packetReceiver = new ResolVBUSLANReceiver(this); // make sure that there is no listener running packetReceiver.stopListener(); // if updateInterval is longer than 30 seconds, the execute() method is used if (updateInterval < 30) { logger.debug("Starting ResolVBUS LAN Receiver"); packetReceiver.initializeReceiver(host,port,password,updateInterval, true); useThread = true; } else { refreshInterval = updateInterval*1000; useThread = false; } break; } case INPUT_MODE_SERIAL: { packetReceiver = new ResolVBUSSerialReceiver(this); // make sure that there is no listener running packetReceiver.stopListener(); logger.debug("Starting ResolVBUS Serial Receiver"); packetReceiver.initializeReceiver(serialPort,password,updateInterval, true); useThread = true; break; } } // start the listener if (useThread) new Thread(packetReceiver).start(); setProperlyConfigured(true); } else { logger.warn("keine Konfiguration für Vbus"); } }
this.bundleContext = bundleContext; logger.warn(STR + configuration); if (configuration != null) { String refreshIntervalString = (String) configuration.get(STR); logger.warn(STR + refreshIntervalString); String serialString = (String) configuration.get(STR); logger.warn(STR + serialString); String hostString = (String) configuration.get("host"); logger.warn(STR + hostString); String portString = (String) configuration.get("port"); logger.warn(STR + portString); String pwString = (String) configuration.get(STR); logger.warn(STR + pwString); String updIvalString = (String) configuration.get(STR); logger.warn(STR + updIvalString); if (StringUtils.isNotBlank(hostString) && (StringUtils.isNotBlank(serialString))) { logger.warn(STR); return; } if (StringUtils.isNotBlank(refreshIntervalString)) { refreshInterval = Long.parseLong(refreshIntervalString); } if (StringUtils.isNotBlank(hostString)) { host = hostString; inputMode = INPUT_MODE_LAN; } if (StringUtils.isNotBlank(portString)) { port = Integer.parseInt(portString); } if (StringUtils.isNotBlank(pwString)) { password = pwString; } if (StringUtils.isNotBlank(updIvalString)) { updateInterval = Long.parseLong(updIvalString); } if (StringUtils.isNotBlank(serialString)) { serialPort = serialString; inputMode = INPUT_MODE_SERIAL; } logger.warn(STR + inputMode); logger.debug(STR); loadXMLConfig(); logger.debug(STR); switch (inputMode) { case INPUT_MODE_LAN: { packetReceiver = new ResolVBUSLANReceiver(this); packetReceiver.stopListener(); if (updateInterval < 30) { logger.debug(STR); packetReceiver.initializeReceiver(host,port,password,updateInterval, true); useThread = true; } else { refreshInterval = updateInterval*1000; useThread = false; } break; } case INPUT_MODE_SERIAL: { packetReceiver = new ResolVBUSSerialReceiver(this); packetReceiver.stopListener(); logger.debug(STR); packetReceiver.initializeReceiver(serialPort,password,updateInterval, true); useThread = true; break; } } if (useThread) new Thread(packetReceiver).start(); setProperlyConfigured(true); } else { logger.warn(STR); } }
/** * Called by the SCR to activate the component with its configuration read from CAS * * @param bundleContext BundleContext of the Bundle that defines this component * @param configuration Configuration properties for this component obtained from the ConfigAdmin service */
Called by the SCR to activate the component with its configuration read from CAS
activate
{ "repo_name": "wurtzel/openhab", "path": "bundles/binding/org.openhab.binding.resolvbus/src/main/java/org/openhab/binding/resolvbus/internal/ResolVBUSBinding.java", "license": "epl-1.0", "size": 12345 }
[ "org.apache.commons.lang.StringUtils" ]
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.*;
[ "org.apache.commons" ]
org.apache.commons;
326,367
public void setText(String newText) { boolean b = (newText != null && newText.trim().length() > 0); setAttribute(DrawingAttributes.SHOWTEXT, b); setAttribute(AttributeKeys.TEXT, newText); }
void function(String newText) { boolean b = (newText != null && newText.trim().length() > 0); setAttribute(DrawingAttributes.SHOWTEXT, b); setAttribute(AttributeKeys.TEXT, newText); }
/** * Implemented as specified by the {@link TextHolderFigure} I/F. * @see TextHolderFigure#setText(String) */
Implemented as specified by the <code>TextHolderFigure</code> I/F
setText
{ "repo_name": "joshmoore/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/util/ui/drawingtools/figures/LineConnectionTextFigure.java", "license": "gpl-2.0", "size": 8594 }
[ "org.jhotdraw.draw.AttributeKeys", "org.openmicroscopy.shoola.util.ui.drawingtools.attributes.DrawingAttributes" ]
import org.jhotdraw.draw.AttributeKeys; import org.openmicroscopy.shoola.util.ui.drawingtools.attributes.DrawingAttributes;
import org.jhotdraw.draw.*; import org.openmicroscopy.shoola.util.ui.drawingtools.attributes.*;
[ "org.jhotdraw.draw", "org.openmicroscopy.shoola" ]
org.jhotdraw.draw; org.openmicroscopy.shoola;
2,628,955
public List<String[]> readAll() throws IOException { List<String[]> allElements = new ArrayList<String[]>(); while (hasNext) { String[] nextLineAsTokens = readNext(); if (nextLineAsTokens != null) allElements.add(nextLineAsTokens); } return allElements; }
List<String[]> function() throws IOException { List<String[]> allElements = new ArrayList<String[]>(); while (hasNext) { String[] nextLineAsTokens = readNext(); if (nextLineAsTokens != null) allElements.add(nextLineAsTokens); } return allElements; }
/** * Reads the entire file into a List with each element being a String[] of tokens. * * @return a List of String[], with each String[] representing a line of the file. * * @throws IOException if bad things happen during the read */
Reads the entire file into a List with each element being a String[] of tokens
readAll
{ "repo_name": "mbshopM/openconcerto", "path": "OpenConcerto/src/org/openconcerto/utils/text/CSVReader.java", "license": "gpl-3.0", "size": 9700 }
[ "java.io.IOException", "java.util.ArrayList", "java.util.List" ]
import java.io.IOException; import java.util.ArrayList; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,278,808
public void setFocusAreas(List<Area> focusAreas) { set(KEY_FOCUS_AREAS, focusAreas); }
void function(List<Area> focusAreas) { set(KEY_FOCUS_AREAS, focusAreas); }
/** * Sets focus areas. See {@link #getFocusAreas()} for documentation. * * @param focusAreas the focus areas * @see #getFocusAreas() */
Sets focus areas. See <code>#getFocusAreas()</code> for documentation
setFocusAreas
{ "repo_name": "OmniEvo/android_frameworks_base", "path": "core/java/android/hardware/Camera.java", "license": "gpl-3.0", "size": 224245 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,223,259
@Override public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException { Arrays.checkOffsetAndCount(buffer.length, byteOffset, byteCount); if (byteCount == 0) { return 0; } checkReadPrimitiveTypes(); return primitiveData.read(buffer, byteOffset, byteCount); }
int function(byte[] buffer, int byteOffset, int byteCount) throws IOException { Arrays.checkOffsetAndCount(buffer.length, byteOffset, byteCount); if (byteCount == 0) { return 0; } checkReadPrimitiveTypes(); return primitiveData.read(buffer, byteOffset, byteCount); }
/** * Reads at most {@code length} bytes from the source stream and stores them * in byte array {@code buffer} starting at offset {@code count}. Blocks * until {@code count} bytes have been read, the end of the source stream is * detected or an exception is thrown. * * @param buffer * the array in which to store the bytes read. * @param byteOffset * the initial position in {@code buffer} to store the bytes * read from the source stream. * @param byteCount * the maximum number of bytes to store in {@code buffer}. * @return the number of bytes read or -1 if the end of the source input * stream has been reached. * @throws IndexOutOfBoundsException * if {@code offset < 0} or {@code length < 0}, or if * {@code offset + length} is greater than the length of * {@code buffer}. * @throws IOException * if an error occurs while reading from this stream. * @throws NullPointerException * if {@code buffer} is {@code null}. */
Reads at most length bytes from the source stream and stores them in byte array buffer starting at offset count. Blocks until count bytes have been read, the end of the source stream is detected or an exception is thrown
read
{ "repo_name": "haithemaraissia/j2objc", "path": "jre_emul/android/libcore/luni/src/main/java/java/io/ObjectInputStream.java", "license": "apache-2.0", "size": 95119 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
2,906,834
void setDefaultTracer(InterceptStrategy tracer);
void setDefaultTracer(InterceptStrategy tracer);
/** * Sets a custom tracer to be used as the default tracer. * <p/> * <b>Note:</b> This must be set before any routes are created, * changing the default tracer for existing routes is not supported. * * @param tracer the custom tracer to use as default tracer */
Sets a custom tracer to be used as the default tracer. Note: This must be set before any routes are created, changing the default tracer for existing routes is not supported
setDefaultTracer
{ "repo_name": "neoramon/camel", "path": "camel-core/src/main/java/org/apache/camel/CamelContext.java", "license": "apache-2.0", "size": 70125 }
[ "org.apache.camel.spi.InterceptStrategy" ]
import org.apache.camel.spi.InterceptStrategy;
import org.apache.camel.spi.*;
[ "org.apache.camel" ]
org.apache.camel;
1,942,776
@Override public void error(String message) { LoggingContext lc = getLoggingContext(); if (lc != null) { lc.error(message); } }
void function(String message) { LoggingContext lc = getLoggingContext(); if (lc != null) { lc.error(message); } }
/** * Logs an error message, independent of context such as action or timers, * for which context-sensitive methods can be provided via other methods. * Use this method to report serious problems where something is definitely * wrong. */
Logs an error message, independent of context such as action or timers, for which context-sensitive methods can be provided via other methods. Use this method to report serious problems where something is definitely wrong
error
{ "repo_name": "madmax983/aura", "path": "aura-impl/src/main/java/org/auraframework/impl/LoggingServiceImpl.java", "license": "apache-2.0", "size": 7711 }
[ "org.auraframework.system.LoggingContext" ]
import org.auraframework.system.LoggingContext;
import org.auraframework.system.*;
[ "org.auraframework.system" ]
org.auraframework.system;
1,456,840
public IConnection<T> getConnectionOnSide(Direction side);
IConnection<T> function(Direction side);
/** * Returns the connection on the specified side, or null if not connected. */
Returns the connection on the specified side, or null if not connected
getConnectionOnSide
{ "repo_name": "Qmunity/BluePower", "path": "src/main/java/com/bluepowermod/api/connect/IConnectionCache.java", "license": "gpl-3.0", "size": 1053 }
[ "net.minecraft.util.Direction" ]
import net.minecraft.util.Direction;
import net.minecraft.util.*;
[ "net.minecraft.util" ]
net.minecraft.util;
133,249
public static JobTracker startTracker(JobConf conf ) throws IOException, InterruptedException { return startTracker(conf, generateNewIdentifier()); }
static JobTracker function(JobConf conf ) throws IOException, InterruptedException { return startTracker(conf, generateNewIdentifier()); }
/** * Start the JobTracker with given configuration. * * The conf will be modified to reflect the actual ports on which * the JobTracker is up and running if the user passes the port as * <code>zero</code>. * * @param conf configuration for the JobTracker. * @throws IOException */
Start the JobTracker with given configuration. The conf will be modified to reflect the actual ports on which the JobTracker is up and running if the user passes the port as <code>zero</code>
startTracker
{ "repo_name": "zxqt223/hadoop-ha.1.0.3", "path": "src/mapred/org/apache/hadoop/mapred/JobTracker.java", "license": "apache-2.0", "size": 199505 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,906,856
private Element generateEmptyOutboundElem(XmlProcessor hqmfXmlProcessor) { Element outboundRelElem = hqmfXmlProcessor.getOriginalDoc().createElement(OUTBOUND_RELATIONSHIP); outboundRelElem.setAttribute(TYPE_CODE, "COMP"); return outboundRelElem; }
Element function(XmlProcessor hqmfXmlProcessor) { Element outboundRelElem = hqmfXmlProcessor.getOriginalDoc().createElement(OUTBOUND_RELATIONSHIP); outboundRelElem.setAttribute(TYPE_CODE, "COMP"); return outboundRelElem; }
/** * Generate empty outbound elem. * * @param hqmfXmlProcessor * the hqmf xml processor * @return the element */
Generate empty outbound elem
generateEmptyOutboundElem
{ "repo_name": "MeasureAuthoringTool/MeasureAuthoringTool_LatestSprint", "path": "mat/src/main/java/mat/server/hqmf/qdm_5_4/HQMFClauseLogicGenerator.java", "license": "cc0-1.0", "size": 134287 }
[ "org.w3c.dom.Element" ]
import org.w3c.dom.Element;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,109,492
String xgroupSetID( String key, String groupname, StreamEntryID id);
String xgroupSetID( String key, String groupname, StreamEntryID id);
/** * XGROUP SETID <key> <groupname> <id or $> * * @param key * @param groupname * @param id * @return */
XGROUP SETID
xgroupSetID
{ "repo_name": "sazzad16/jedis", "path": "src/main/java/redis/clients/jedis/commands/JedisCommands.java", "license": "mit", "size": 13576 }
[ "redis.clients.jedis.StreamEntryID" ]
import redis.clients.jedis.StreamEntryID;
import redis.clients.jedis.*;
[ "redis.clients.jedis" ]
redis.clients.jedis;
197,087
public static void show(Context context, FragmentManager manager, int titleId, int msgId) { AlertDialog.Builder builder = new AlertDialog.Builder(context) .setTitle(titleId) .setMessage(msgId) .setNegativeButton(android.R.string.ok, null); new AlertFragment().initWithBuilder(builder).show(manager, null); }
static void function(Context context, FragmentManager manager, int titleId, int msgId) { AlertDialog.Builder builder = new AlertDialog.Builder(context) .setTitle(titleId) .setMessage(msgId) .setNegativeButton(android.R.string.ok, null); new AlertFragment().initWithBuilder(builder).show(manager, null); }
/** * Shows an {@link AlertFragment} with the given parameters. Alerts shown using this method * survive device rotation. * * @param titleId The resource id for the dialog title. * @param msgId The resource id for the dialog message. */
Shows an <code>AlertFragment</code> with the given parameters. Alerts shown using this method survive device rotation
show
{ "repo_name": "cohenadair/anglers-log", "path": "android/app/src/main/java/com/cohenadair/anglerslog/utilities/AlertUtils.java", "license": "gpl-3.0", "size": 8069 }
[ "android.content.Context", "android.support.v4.app.FragmentManager", "android.support.v7.app.AlertDialog" ]
import android.content.Context; import android.support.v4.app.FragmentManager; import android.support.v7.app.AlertDialog;
import android.content.*; import android.support.v4.app.*; import android.support.v7.app.*;
[ "android.content", "android.support" ]
android.content; android.support;
2,579,945
public synchronized void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { if (children == null) { return; } WeakPropertyChangeSupport child = children.get(propertyName); if (child == null) { return; } child.removePropertyChangeListener(listener); }
synchronized void function(String propertyName, PropertyChangeListener listener) { if (children == null) { return; } WeakPropertyChangeSupport child = children.get(propertyName); if (child == null) { return; } child.removePropertyChangeListener(listener); }
/** * Remove a PropertyChangeListener for a specific property. * * @param propertyName * The name of the property that was listened on. * @param listener * The PropertyChangeListener to be removed */
Remove a PropertyChangeListener for a specific property
removePropertyChangeListener
{ "repo_name": "jspresso/jspresso-ce", "path": "util/src/main/java/org/jspresso/framework/util/bean/WeakPropertyChangeSupport.java", "license": "lgpl-3.0", "size": 14264 }
[ "java.beans.PropertyChangeListener" ]
import java.beans.PropertyChangeListener;
import java.beans.*;
[ "java.beans" ]
java.beans;
657,576
public static final SourceModel.Expr makeChooseOneOfGen(SourceModel.Expr listOfItems) { return SourceModel.Expr.Application.make( new SourceModel.Expr[] {SourceModel.Expr.Var.make(Functions.makeChooseOneOfGen), listOfItems}); } public static final QualifiedName makeChooseOneOfGen = QualifiedName.make(CAL_QuickCheck.MODULE_NAME, "makeChooseOneOfGen");
static final SourceModel.Expr function(SourceModel.Expr listOfItems) { return SourceModel.Expr.Application.make( new SourceModel.Expr[] {SourceModel.Expr.Var.make(Functions.makeChooseOneOfGen), listOfItems}); } static final QualifiedName function = QualifiedName.make(CAL_QuickCheck.MODULE_NAME, STR);
/** * Creates a generator that will return an item from the input list. * @param listOfItems (CAL type: <code>[a]</code>) * @return (CAL type: <code>Cal.Utilities.QuickCheck.Gen a</code>) * <code>Cal.Utilities.QuickCheck.Gen</code> a generator of items contained in the input list */
Creates a generator that will return an item from the input list
makeChooseOneOfGen
{ "repo_name": "levans/Open-Quark", "path": "src/CAL_Platform/src/org/openquark/cal/module/Cal/Utilities/CAL_QuickCheck.java", "license": "bsd-3-clause", "size": 46821 }
[ "org.openquark.cal.compiler.QualifiedName", "org.openquark.cal.compiler.SourceModel" ]
import org.openquark.cal.compiler.QualifiedName; import org.openquark.cal.compiler.SourceModel;
import org.openquark.cal.compiler.*;
[ "org.openquark.cal" ]
org.openquark.cal;
579,347
void add(Contact contact) throws ConnectionException;
void add(Contact contact) throws ConnectionException;
/** * Add a contact into this chat. This will occur in real time * * @param contact The contact to add * @throws ConnectionException If an error occurs while connecting to the endpoint * @throws NotLoadedException If the chat is not yet loaded */
Add a contact into this chat. This will occur in real time
add
{ "repo_name": "yar229/Skype4J", "path": "src/main/java/com/samczsun/skype4j/chat/GroupChat.java", "license": "gpl-3.0", "size": 3729 }
[ "com.samczsun.skype4j.exceptions.ConnectionException", "com.samczsun.skype4j.user.Contact" ]
import com.samczsun.skype4j.exceptions.ConnectionException; import com.samczsun.skype4j.user.Contact;
import com.samczsun.skype4j.exceptions.*; import com.samczsun.skype4j.user.*;
[ "com.samczsun.skype4j" ]
com.samczsun.skype4j;
985,717
public void addRecoveryListener(RecoveryListener listener) { this.recoveryListeners.add(listener); }
void function(RecoveryListener listener) { this.recoveryListeners.add(listener); }
/** * Adds the recovery listener * @param listener {@link com.rabbitmq.client.RecoveryListener} to execute after this connection recovers from network failure */
Adds the recovery listener
addRecoveryListener
{ "repo_name": "yanellyjm/rabbitmq-client-java", "path": "src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java", "license": "gpl-3.0", "size": 28844 }
[ "com.rabbitmq.client.RecoveryListener" ]
import com.rabbitmq.client.RecoveryListener;
import com.rabbitmq.client.*;
[ "com.rabbitmq.client" ]
com.rabbitmq.client;
2,180,312
@Test public void testDelete() { final VEGLJob fakeJob = new VEGLJob(); context.checking(new Expectations() {{ oneOf(mockTemplate).delete(fakeJob); }}); testDao.deleteJob(fakeJob); }
void function() { final VEGLJob fakeJob = new VEGLJob(); context.checking(new Expectations() {{ oneOf(mockTemplate).delete(fakeJob); }}); testDao.deleteJob(fakeJob); }
/** * Tests that deleting a VL job succeeds. */
Tests that deleting a VL job succeeds
testDelete
{ "repo_name": "AuScope/VHIRL-Portal", "path": "src/test/java/org/auscope/portal/server/vegl/TestVEGLJobDao.java", "license": "gpl-3.0", "size": 6226 }
[ "org.jmock.Expectations" ]
import org.jmock.Expectations;
import org.jmock.*;
[ "org.jmock" ]
org.jmock;
1,671,525
default EntityQuery select(String... fieldsToSelect) { return query().select(fieldsToSelect); }
default EntityQuery select(String... fieldsToSelect) { return query().select(fieldsToSelect); }
/** * SCIPIO: Returns a new {@link org.ofbiz.entity.util.EntityQuery}(Safe) for this delegator, set up to select the specified fields, * equivalent to: <code>EntityQuery(Safe).use(delegator).select(fieldsToSelect)</code>; this is an alias for {@link #selectUnsafe} for * most languages, <strong>except</strong> for FreeMarker templates* (*.ftl) for which {@link #selectSafe} is invoked instead. */
equivalent to: <code>EntityQuery(Safe).use(delegator).select(fieldsToSelect)</code>; this is an alias for <code>#selectUnsafe</code> for most languages, except for FreeMarker templates* (*.ftl) for which <code>#selectSafe</code> is invoked instead
select
{ "repo_name": "ilscipio/scipio-erp", "path": "framework/entity/src/org/ofbiz/entity/Delegator.java", "license": "apache-2.0", "size": 49437 }
[ "org.ofbiz.entity.util.EntityQuery" ]
import org.ofbiz.entity.util.EntityQuery;
import org.ofbiz.entity.util.*;
[ "org.ofbiz.entity" ]
org.ofbiz.entity;
1,750,824
public void setStatsContainer( StatsContainer statsContainer ) { this.statsContainer = statsContainer; }
void function( StatsContainer statsContainer ) { this.statsContainer = statsContainer; }
/** * Sets the statistics container for handling statistics for the extended * track. * <p> * @param statsContainer the stats container */
Sets the statistics container for handling statistics for the extended track.
setStatsContainer
{ "repo_name": "rhilker/ReadXplorer", "path": "readxplorer-parser/src/main/java/de/cebitec/readxplorer/parser/mappings/SamBamStatsParser.java", "license": "gpl-3.0", "size": 12495 }
[ "de.cebitec.readxplorer.utils.StatsContainer" ]
import de.cebitec.readxplorer.utils.StatsContainer;
import de.cebitec.readxplorer.utils.*;
[ "de.cebitec.readxplorer" ]
de.cebitec.readxplorer;
2,438,994
protected DataResult getDataResult(Long sid, PageControl pc) { return SolarisPatchSetManager.systemAvailablePatchSetList(sid, pc); }
DataResult function(Long sid, PageControl pc) { return SolarisPatchSetManager.systemAvailablePatchSetList(sid, pc); }
/** * Returns the unpublished errata for the given user bounded * by the values of the PageControl. * @param sid Server id. * @param pc boundary values * @return List of unpublished errata for the given user * bounded by the values of the PageControl. */
Returns the unpublished errata for the given user bounded by the values of the PageControl
getDataResult
{ "repo_name": "moio/spacewalk", "path": "java/code/src/com/redhat/rhn/frontend/action/rhnpackage/SolarisPatchSetListSetupAction.java", "license": "gpl-2.0", "size": 3210 }
[ "com.redhat.rhn.common.db.datasource.DataResult", "com.redhat.rhn.frontend.listview.PageControl", "com.redhat.rhn.manager.solarispatchset.SolarisPatchSetManager" ]
import com.redhat.rhn.common.db.datasource.DataResult; import com.redhat.rhn.frontend.listview.PageControl; import com.redhat.rhn.manager.solarispatchset.SolarisPatchSetManager;
import com.redhat.rhn.common.db.datasource.*; import com.redhat.rhn.frontend.listview.*; import com.redhat.rhn.manager.solarispatchset.*;
[ "com.redhat.rhn" ]
com.redhat.rhn;
2,182,580
interface ActionDelegate { void onConfirmClicked(@Nonnull String host, @Nonnegative int port); }
interface ActionDelegate { void onConfirmClicked(@Nonnull String host, @Nonnegative int port); }
/** * Performs some actions when user clicks on confirm button and input host and port. * * @param host * host via which we connect to remote server * @param port * port via which we connect to remote server */
Performs some actions when user clicks on confirm button and input host and port
onConfirmClicked
{ "repo_name": "sunix/che-plugins", "path": "plugin-java/che-plugin-java-ext-debugger-java/src/main/java/org/eclipse/che/ide/ext/java/jdi/client/debug/remotedebug/RemoteDebugView.java", "license": "epl-1.0", "size": 1467 }
[ "javax.annotation.Nonnegative", "javax.annotation.Nonnull" ]
import javax.annotation.Nonnegative; import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
2,652,140
public static OvernightOvernightSwapCurveNode of( OvernightOvernightSwapTemplate template, ObservableId rateId, double additionalSpread) { return builder() .template(template) .rateId(rateId) .additionalSpread(additionalSpread) .build(); }
static OvernightOvernightSwapCurveNode function( OvernightOvernightSwapTemplate template, ObservableId rateId, double additionalSpread) { return builder() .template(template) .rateId(rateId) .additionalSpread(additionalSpread) .build(); }
/** * Generate an instance of a overnight-overnight swap based node from a template, an ID and a spread. * * @param template the template defining the node instrument * @param rateId the identifier of the market data providing the rate for the node instrument * @param additionalSpread the additional spread amount added to the spread * @return a node whose instrument is built from the template using a market rate */
Generate an instance of a overnight-overnight swap based node from a template, an ID and a spread
of
{ "repo_name": "marc-henrard/RisQ-ir-models", "path": "src/main/java/marc/henrard/murisq/market/curve/node/OvernightOvernightSwapCurveNode.java", "license": "apache-2.0", "size": 25404 }
[ "com.opengamma.strata.data.ObservableId" ]
import com.opengamma.strata.data.ObservableId;
import com.opengamma.strata.data.*;
[ "com.opengamma.strata" ]
com.opengamma.strata;
2,397,765
public List<Place> getDestinations() { return Collections.unmodifiableList(myDestinations); }
List<Place> function() { return Collections.unmodifiableList(myDestinations); }
/** * Never null. Read only! * Contains only the unreached destinations! * @return the destinations */
Never null. Read only! Contains only the unreached destinations
getDestinations
{ "repo_name": "xafero/travelingsales", "path": "osmnavigation/src/main/java/org/openstreetmap/travelingsalesman/navigation/NavigationManager.java", "license": "gpl-3.0", "size": 26981 }
[ "java.util.Collections", "java.util.List", "org.openstreetmap.osm.data.searching.Place" ]
import java.util.Collections; import java.util.List; import org.openstreetmap.osm.data.searching.Place;
import java.util.*; import org.openstreetmap.osm.data.searching.*;
[ "java.util", "org.openstreetmap.osm" ]
java.util; org.openstreetmap.osm;
2,450,762
@OneToMany( fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE }, mappedBy = "enrollmentid" ) @org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE}) @Basic( optional = false ) @Column( nullable = false ) public Set<Incomeandsources> getIncomeandsourceses() { return this.incomeandsourceses; }
@OneToMany( fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE }, mappedBy = STR ) @org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE}) @Basic( optional = false ) @Column( nullable = false ) Set<Incomeandsources> function() { return this.incomeandsourceses; }
/** * Return the value associated with the column: incomeandsources. * @return A Set&lt;Incomeandsources&gt; object (this.incomeandsources) */
Return the value associated with the column: incomeandsources
getIncomeandsourceses
{ "repo_name": "servinglynk/servinglynk-hmis", "path": "hmis-model-v2016/src/main/java/com/servinglynk/hmis/warehouse/model/v2016/Enrollment.java", "license": "mpl-2.0", "size": 46569 }
[ "java.util.Set", "javax.persistence.Basic", "javax.persistence.CascadeType", "javax.persistence.Column", "javax.persistence.FetchType", "javax.persistence.OneToMany" ]
import java.util.Set; import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.FetchType; import javax.persistence.OneToMany;
import java.util.*; import javax.persistence.*;
[ "java.util", "javax.persistence" ]
java.util; javax.persistence;
962,568
QueryBuilder union( SetQuantifier setQuantifier, QueryExpressionBody another );
QueryBuilder union( SetQuantifier setQuantifier, QueryExpressionBody another );
/** * <p> * Adds {@code UNION <setQuantifier>} between current query and the given query. Then makes resulting query the * current query. * </p> * <p> * This is equivalent on calling {@link #union(SetQuantifier, CorrespondingSpec, QueryExpressionBody)} and giving * {@code null} as second parameter. * </p> * * @param setQuantifier The set quantifier for this union. * @param another The query to perform {@code UNION} with. * @return This builder. */
Adds UNION between current query and the given query. Then makes resulting query the current query. This is equivalent on calling <code>#union(SetQuantifier, CorrespondingSpec, QueryExpressionBody)</code> and giving null as second parameter.
union
{ "repo_name": "Qi4j/qi4j-sdk", "path": "libraries/sql-generator/src/main/java/org/apache/polygene/library/sql/generator/grammar/builders/query/QueryBuilder.java", "license": "apache-2.0", "size": 8643 }
[ "org.apache.polygene.library.sql.generator.grammar.common.SetQuantifier", "org.apache.polygene.library.sql.generator.grammar.query.QueryExpressionBody" ]
import org.apache.polygene.library.sql.generator.grammar.common.SetQuantifier; import org.apache.polygene.library.sql.generator.grammar.query.QueryExpressionBody;
import org.apache.polygene.library.sql.generator.grammar.common.*; import org.apache.polygene.library.sql.generator.grammar.query.*;
[ "org.apache.polygene" ]
org.apache.polygene;
1,375,077
void reportTraining(MLTrain train);
void reportTraining(MLTrain train);
/** * Report progress on training. * @param train The training object. */
Report progress on training
reportTraining
{ "repo_name": "larhoy/SentimentProjectV2", "path": "SentimentAnalysisV2/encog-core-3.1.0/src/main/java/org/encog/app/analyst/AnalystListener.java", "license": "mit", "size": 2393 }
[ "org.encog.ml.train.MLTrain" ]
import org.encog.ml.train.MLTrain;
import org.encog.ml.train.*;
[ "org.encog.ml" ]
org.encog.ml;
2,508,219
public void setMeasureActual (BigDecimal MeasureActual) { set_ValueNoCheck (COLUMNNAME_MeasureActual, MeasureActual); }
void function (BigDecimal MeasureActual) { set_ValueNoCheck (COLUMNNAME_MeasureActual, MeasureActual); }
/** Set Measure Actual. @param MeasureActual Actual value that has been measured. */
Set Measure Actual
setMeasureActual
{ "repo_name": "geneos/adempiere", "path": "base/src/org/compiere/model/X_PA_Goal.java", "license": "gpl-2.0", "size": 14825 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
1,831,019
public JavaPairRDD<Object, VertexWritable> readGraphRDD(final Configuration configuration, final JavaSparkContext sparkContext);
JavaPairRDD<Object, VertexWritable> function(final Configuration configuration, final JavaSparkContext sparkContext);
/** * Read the graphRDD from the underlying graph system. * @param configuration the configuration for the {@link org.apache.tinkerpop.gremlin.hadoop.process.computer.spark.SparkGraphComputer}. * @param sparkContext the Spark context with the requisite methods for generating a {@link JavaPairRDD}. * @return an adjacency list representation of the underlying graph system. */
Read the graphRDD from the underlying graph system
readGraphRDD
{ "repo_name": "RedSeal-co/incubator-tinkerpop", "path": "hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/process/computer/spark/io/InputRDD.java", "license": "apache-2.0", "size": 2081 }
[ "org.apache.commons.configuration.Configuration", "org.apache.spark.api.java.JavaPairRDD", "org.apache.spark.api.java.JavaSparkContext", "org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable" ]
import org.apache.commons.configuration.Configuration; import org.apache.spark.api.java.JavaPairRDD; import org.apache.spark.api.java.JavaSparkContext; import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
import org.apache.commons.configuration.*; import org.apache.spark.api.java.*; import org.apache.tinkerpop.gremlin.hadoop.structure.io.*;
[ "org.apache.commons", "org.apache.spark", "org.apache.tinkerpop" ]
org.apache.commons; org.apache.spark; org.apache.tinkerpop;
2,607,956
EClass getMBarometerTemperature();
EClass getMBarometerTemperature();
/** * Returns the meta object for class '{@link org.openhab.binding.tinkerforge.internal.model.MBarometerTemperature <em>MBarometer Temperature</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>MBarometer Temperature</em>'. * @see org.openhab.binding.tinkerforge.internal.model.MBarometerTemperature * @generated */
Returns the meta object for class '<code>org.openhab.binding.tinkerforge.internal.model.MBarometerTemperature MBarometer Temperature</code>'.
getMBarometerTemperature
{ "repo_name": "gregfinley/openhab", "path": "bundles/binding/org.openhab.binding.tinkerforge/src/main/java/org/openhab/binding/tinkerforge/internal/model/ModelPackage.java", "license": "epl-1.0", "size": 665067 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
64,129
public void testOne() { try { Map<Long, String> dataSources = this.utils.getDataSourceMap(); IntraCaseCommonAttributeSearcher allSourcesBuilder = new AllIntraCaseCommonAttributeSearcher(dataSources, true, false, 0); CommonAttributeCountSearchResults metadata = allSourcesBuilder.findMatchesByCount(); Map<Long, String> objectIdToDataSource = IntraCaseTestUtils.mapFileInstancesToDataSources(metadata); List<AbstractFile> files = IntraCaseTestUtils.getFiles(objectIdToDataSource.keySet()); assertTrue(files.isEmpty()); } catch (TskCoreException | NoCurrentCaseException | SQLException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex.getMessage()); } }
void function() { try { Map<Long, String> dataSources = this.utils.getDataSourceMap(); IntraCaseCommonAttributeSearcher allSourcesBuilder = new AllIntraCaseCommonAttributeSearcher(dataSources, true, false, 0); CommonAttributeCountSearchResults metadata = allSourcesBuilder.findMatchesByCount(); Map<Long, String> objectIdToDataSource = IntraCaseTestUtils.mapFileInstancesToDataSources(metadata); List<AbstractFile> files = IntraCaseTestUtils.getFiles(objectIdToDataSource.keySet()); assertTrue(files.isEmpty()); } catch (TskCoreException NoCurrentCaseException SQLException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex.getMessage()); } }
/** * Search using all data sources and filtering for media types. We should * find nothing and no errors should arise. */
Search using all data sources and filtering for media types. We should find nothing and no errors should arise
testOne
{ "repo_name": "esaunders/autopsy", "path": "Core/test/qa-functional/src/org/sleuthkit/autopsy/commonpropertiessearch/IngestedWithNoFileTypesIntraCaseTest.java", "license": "apache-2.0", "size": 5464 }
[ "java.sql.SQLException", "java.util.List", "java.util.Map", "junit.framework.Assert", "org.openide.util.Exceptions", "org.sleuthkit.autopsy.casemodule.NoCurrentCaseException", "org.sleuthkit.autopsy.commonpropertiessearch.AllIntraCaseCommonAttributeSearcher", "org.sleuthkit.autopsy.commonpropertiessearch.CommonAttributeCountSearchResults", "org.sleuthkit.autopsy.commonpropertiessearch.IntraCaseCommonAttributeSearcher", "org.sleuthkit.datamodel.AbstractFile", "org.sleuthkit.datamodel.TskCoreException" ]
import java.sql.SQLException; import java.util.List; import java.util.Map; import junit.framework.Assert; import org.openide.util.Exceptions; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.commonpropertiessearch.AllIntraCaseCommonAttributeSearcher; import org.sleuthkit.autopsy.commonpropertiessearch.CommonAttributeCountSearchResults; import org.sleuthkit.autopsy.commonpropertiessearch.IntraCaseCommonAttributeSearcher; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.TskCoreException;
import java.sql.*; import java.util.*; import junit.framework.*; import org.openide.util.*; import org.sleuthkit.autopsy.casemodule.*; import org.sleuthkit.autopsy.commonpropertiessearch.*; import org.sleuthkit.datamodel.*;
[ "java.sql", "java.util", "junit.framework", "org.openide.util", "org.sleuthkit.autopsy", "org.sleuthkit.datamodel" ]
java.sql; java.util; junit.framework; org.openide.util; org.sleuthkit.autopsy; org.sleuthkit.datamodel;
2,542,123
private void logRunningCommand() { // Set start of log for running command. StringBuilder logInfo = new StringBuilder("Running command: ") .append(getClass().getSimpleName()); if (log.isDebugEnabled()) { logInfo.append(getParameters() != null ? "(" + getCommandParamatersString(getParameters()) + ")" : StringUtils.EMPTY); } if (hasTaskHandlers()) { logInfo.append(" Task handler: ").append(getCurrentTaskHandler().getClass().getSimpleName()); } logInfo.append(" internal: ").append(isInternalExecution()).append("."); // Get permissions of object ,to get object id. List<PermissionSubject> permissionSubjectList = getPermissionCheckSubjects(); // Log if there is entry in the permission map. if (permissionSubjectList != null && !permissionSubjectList.isEmpty()) { // Build entities string for entities affected by this operation. StringBuilder logEntityIdsInfo = getPermissionSubjectsAsStringBuilder(permissionSubjectList); // If found any entities, add the log to the logInfo. if (logEntityIdsInfo.length() != 0) { // Print all the entities affected. logInfo.append(" Entities affected : ").append( logEntityIdsInfo); } } // Log the final appended message to the log. log.info("{}", logInfo); }
void function() { StringBuilder logInfo = new StringBuilder(STR) .append(getClass().getSimpleName()); if (log.isDebugEnabled()) { logInfo.append(getParameters() != null ? "(" + getCommandParamatersString(getParameters()) + ")" : StringUtils.EMPTY); } if (hasTaskHandlers()) { logInfo.append(STR).append(getCurrentTaskHandler().getClass().getSimpleName()); } logInfo.append(STR).append(isInternalExecution()).append("."); List<PermissionSubject> permissionSubjectList = getPermissionCheckSubjects(); if (permissionSubjectList != null && !permissionSubjectList.isEmpty()) { StringBuilder logEntityIdsInfo = getPermissionSubjectsAsStringBuilder(permissionSubjectList); if (logEntityIdsInfo.length() != 0) { logInfo.append(STR).append( logEntityIdsInfo); } } log.info("{}", logInfo); }
/** * Log the running command , and log the affected entity id and type (if * there are any). */
Log the running command , and log the affected entity id and type (if there are any)
logRunningCommand
{ "repo_name": "jtux270/translate", "path": "ovirt/3.6_source/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java", "license": "gpl-3.0", "size": 97139 }
[ "java.util.List", "org.apache.commons.lang.StringUtils", "org.ovirt.engine.core.bll.utils.PermissionSubject" ]
import java.util.List; import org.apache.commons.lang.StringUtils; import org.ovirt.engine.core.bll.utils.PermissionSubject;
import java.util.*; import org.apache.commons.lang.*; import org.ovirt.engine.core.bll.utils.*;
[ "java.util", "org.apache.commons", "org.ovirt.engine" ]
java.util; org.apache.commons; org.ovirt.engine;
1,277,752
public void testParallelDocMaker() throws Exception { // 1. alg definition (required in every "logic" test) String algLines[] = { "# ----- properties ", "content.source=org.apache.lucene.benchmark.byTask.feeds.LineDocSource", "docs.file=" + getReuters20LinesFile(), "content.source.log.step=3", "doc.term.vector=false", "content.source.forever=false", "directory=FSDirectory", "doc.stored=false", "doc.tokenized=false", "# ----- alg ", "CreateIndex", "[ { AddDoc } : * ] : 4 ", "CloseIndex", }; // 2. execute the algorithm (required in every "logic" test) Benchmark benchmark = execBenchmark(algLines); // 3. test number of docs in the index IndexReader ir = IndexReader.open(benchmark.getRunData().getDirectory(), true); int ndocsExpected = 20; // first 20 reuters docs. assertEquals("wrong number of docs in the index!", ndocsExpected, ir.numDocs()); ir.close(); }
void function() throws Exception { String algLines[] = { STR, STR, STR + getReuters20LinesFile(), STR, STR, STR, STR, STR, STR, STR, STR, STR, STR, }; Benchmark benchmark = execBenchmark(algLines); IndexReader ir = IndexReader.open(benchmark.getRunData().getDirectory(), true); int ndocsExpected = 20; assertEquals(STR, ndocsExpected, ir.numDocs()); ir.close(); }
/** * Test Parallel Doc Maker logic (for LUCENE-940) */
Test Parallel Doc Maker logic (for LUCENE-940)
testParallelDocMaker
{ "repo_name": "tokee/lucene", "path": "contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java", "license": "apache-2.0", "size": 40288 }
[ "org.apache.lucene.index.IndexReader" ]
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.*;
[ "org.apache.lucene" ]
org.apache.lucene;
2,592,178
public static void enableOrDisableAnalyticsAsNecessary() { try { setAnalyticsEnabled(shouldEnableAnalytics()); LOGD(TAG, "Analytics" + (isInitialized() ? "" : " not") + " initialized" + ", TOS" + (SettingsUtils.isTosAccepted(sAppContext) ? "" : " not") + " accepted" + ", Setting is" + (SettingsUtils.isAnalyticsEnabled(sAppContext) ? "" : " not") + " checked"); } catch (Exception e) { setAnalyticsEnabled(false); } }
static void function() { try { setAnalyticsEnabled(shouldEnableAnalytics()); LOGD(TAG, STR + (isInitialized() ? STR notSTR initializedSTR, TOS" + (SettingsUtils.isTosAccepted(sAppContext) ? STR notSTR acceptedSTR, Setting is" + (SettingsUtils.isAnalyticsEnabled(sAppContext) ? STR notSTR checked"); } catch (Exception e) { setAnalyticsEnabled(false); } }
/** * Checks application state and settings_prefs, then explicitly either enables or * disables the tracker. */
Checks application state and settings_prefs, then explicitly either enables or disables the tracker
enableOrDisableAnalyticsAsNecessary
{ "repo_name": "lokling/AndroiditoJZ", "path": "android/src/main/java/com/google/samples/apps/iosched/util/AnalyticsHelper.java", "license": "apache-2.0", "size": 14367 }
[ "com.google.samples.apps.iosched.settings.SettingsUtils" ]
import com.google.samples.apps.iosched.settings.SettingsUtils;
import com.google.samples.apps.iosched.settings.*;
[ "com.google.samples" ]
com.google.samples;
1,890,711
public static AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream ais) { HashSet result = new HashSet(); Iterator i = ServiceFactory.lookupProviders(AudioFileWriter.class); while (i.hasNext()) { AudioFileWriter writer = (AudioFileWriter) i.next(); AudioFileFormat.Type[] types = writer.getAudioFileTypes(ais); for (int j = 0; j < types.length; ++j) result.add(types[j]); } return (AudioFileFormat.Type[]) result.toArray(new AudioFileFormat.Type[result.size()]); }
static AudioFileFormat.Type[] function(AudioInputStream ais) { HashSet result = new HashSet(); Iterator i = ServiceFactory.lookupProviders(AudioFileWriter.class); while (i.hasNext()) { AudioFileWriter writer = (AudioFileWriter) i.next(); AudioFileFormat.Type[] types = writer.getAudioFileTypes(ais); for (int j = 0; j < types.length; ++j) result.add(types[j]); } return (AudioFileFormat.Type[]) result.toArray(new AudioFileFormat.Type[result.size()]); }
/** * Return an array of all the supported AudioFileFormat types which match the * given audio input stream * @param ais the audio input stream * @return an array of unique types */
Return an array of all the supported AudioFileFormat types which match the given audio input stream
getAudioFileTypes
{ "repo_name": "ivmai/JCGO", "path": "goclsp/clsp_fix/javax/sound/sampled/AudioSystem.java", "license": "gpl-2.0", "size": 26363 }
[ "gnu.classpath.ServiceFactory", "java.util.HashSet", "java.util.Iterator", "javax.sound.sampled.spi.AudioFileWriter" ]
import gnu.classpath.ServiceFactory; import java.util.HashSet; import java.util.Iterator; import javax.sound.sampled.spi.AudioFileWriter;
import gnu.classpath.*; import java.util.*; import javax.sound.sampled.spi.*;
[ "gnu.classpath", "java.util", "javax.sound" ]
gnu.classpath; java.util; javax.sound;
301,780
public void resizeText(int width, int height) { CharSequence text = getText(); // Do not resize if the view does not have dimensions or there is no text if(text == null || text.length() == 0 || height <= 0 || width <= 0 || mTextSize == 0) { return; } // Get the text view's paint object TextPaint textPaint = getPaint(); // Store the current text size float oldTextSize = textPaint.getTextSize(); // If there is a max text size set, use the lesser of that and the default text size float targetTextSize = mMaxTextSize > 0 ? Math.min(mTextSize, mMaxTextSize) : mTextSize; // Get the required text height int textHeight = getTextHeight(text, textPaint, width, targetTextSize); // Until we either fit within our text view or we had reached our min text size, incrementally try smaller sizes while(textHeight > height && targetTextSize > mMinTextSize) { targetTextSize = Math.max(targetTextSize - 2, mMinTextSize); textHeight = getTextHeight(text, textPaint, width, targetTextSize); } // If we had reached our minimum text size and still don't fit, append an ellipsis if(mAddEllipsis && targetTextSize == mMinTextSize && textHeight > height) { // Draw using a static layout StaticLayout layout = new StaticLayout(text, textPaint, width, Alignment.ALIGN_NORMAL, mSpacingMult, mSpacingAdd, false); // Check that we have a least one line of rendered text if(layout.getLineCount() > 0) { // Since the line at the specific vertical position would be cut off, // we must trim up to the previous line int lastLine = layout.getLineForVertical(height) - 1; // If the text would not even fit on a single line, clear it if(lastLine < 0) { setText(""); } // Otherwise, trim to the previous line and add an ellipsis else { int start = layout.getLineStart(lastLine); int end = layout.getLineEnd(lastLine); float lineWidth = layout.getLineWidth(lastLine); float ellipseWidth = textPaint.measureText(mEllipsis); // Trim characters off until we have enough room to draw the ellipsis while(width < lineWidth + ellipseWidth) { lineWidth = textPaint.measureText(text.subSequence(start, --end + 1).toString()); } setText(text.subSequence(0, end) + mEllipsis); } } } // Some devices try to auto adjust line spacing, so force default line spacing // and invalidate the layout as a side effect textPaint.setTextSize(targetTextSize); setLineSpacing(mSpacingAdd, mSpacingMult); // Notify the listener if registered if(mTextResizeListener != null) { mTextResizeListener.onTextResize(this, oldTextSize, targetTextSize); } // Reset force resize flag mNeedsResize = false; }
void function(int width, int height) { CharSequence text = getText(); if(text == null text.length() == 0 height <= 0 width <= 0 mTextSize == 0) { return; } TextPaint textPaint = getPaint(); float oldTextSize = textPaint.getTextSize(); float targetTextSize = mMaxTextSize > 0 ? Math.min(mTextSize, mMaxTextSize) : mTextSize; int textHeight = getTextHeight(text, textPaint, width, targetTextSize); while(textHeight > height && targetTextSize > mMinTextSize) { targetTextSize = Math.max(targetTextSize - 2, mMinTextSize); textHeight = getTextHeight(text, textPaint, width, targetTextSize); } if(mAddEllipsis && targetTextSize == mMinTextSize && textHeight > height) { StaticLayout layout = new StaticLayout(text, textPaint, width, Alignment.ALIGN_NORMAL, mSpacingMult, mSpacingAdd, false); if(layout.getLineCount() > 0) { int lastLine = layout.getLineForVertical(height) - 1; if(lastLine < 0) { setText(""); } else { int start = layout.getLineStart(lastLine); int end = layout.getLineEnd(lastLine); float lineWidth = layout.getLineWidth(lastLine); float ellipseWidth = textPaint.measureText(mEllipsis); while(width < lineWidth + ellipseWidth) { lineWidth = textPaint.measureText(text.subSequence(start, --end + 1).toString()); } setText(text.subSequence(0, end) + mEllipsis); } } } textPaint.setTextSize(targetTextSize); setLineSpacing(mSpacingAdd, mSpacingMult); if(mTextResizeListener != null) { mTextResizeListener.onTextResize(this, oldTextSize, targetTextSize); } mNeedsResize = false; }
/** * Resize the text size with specified width and height * @param width * @param height */
Resize the text size with specified width and height
resizeText
{ "repo_name": "dirtyspark23/nxtrc-android", "path": "src/com/techjoynt/android/nxt/widget/AutoResizeTextView.java", "license": "apache-2.0", "size": 10102 }
[ "android.text.Layout", "android.text.StaticLayout", "android.text.TextPaint" ]
import android.text.Layout; import android.text.StaticLayout; import android.text.TextPaint;
import android.text.*;
[ "android.text" ]
android.text;
1,064,167
public void setTimeBonusAssessed(Timestamp timeBonusAssessed) { this.timeBonusAssessed=timeBonusAssessed; }
void function(Timestamp timeBonusAssessed) { this.timeBonusAssessed=timeBonusAssessed; }
/** * Sets the value of timeBonusAssessed * @param timeBonusAssessed New value for timeBonusAssessed */
Sets the value of timeBonusAssessed
setTimeBonusAssessed
{ "repo_name": "joshforester/rdboard", "path": "src/java/com/myrunning/leaderboard/model/CpVisit.java", "license": "mit", "size": 19376 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
585,077
public ArrayList<GraphLink> getOutgoingLinks() { return outgoingLinks; }
ArrayList<GraphLink> function() { return outgoingLinks; }
/** * Gets the outgoing links. * * @return the outgoing links */
Gets the outgoing links
getOutgoingLinks
{ "repo_name": "synergynet/synergynet2.5", "path": "synergynet2.5/src/main/java/apps/projectmanagement/component/workflowchart/core/graphcomponents/nodes/GraphNode.java", "license": "bsd-3-clause", "size": 14130 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,984,260
public String toStringNoCache() { StringBuffer sb = new StringBuffer("identity(").append(getDSMembership()).append(",connection=") .append(uniqueId); if (identity != null) { DurableClientAttributes dca = getDurableAttributes(); if (dca.getId().length() > 0) { sb.append(",durableAttributes=").append(dca).append(')').toString(); } } return sb.toString(); }
String function() { StringBuffer sb = new StringBuffer(STR).append(getDSMembership()).append(STR) .append(uniqueId); if (identity != null) { DurableClientAttributes dca = getDurableAttributes(); if (dca.getId().length() > 0) { sb.append(STR).append(dca).append(')').toString(); } } return sb.toString(); }
/** * returns a string representation of this identifier, ignoring the toString cache */
returns a string representation of this identifier, ignoring the toString cache
toStringNoCache
{ "repo_name": "davebarnes97/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ClientProxyMembershipID.java", "license": "apache-2.0", "size": 20333 }
[ "org.apache.geode.distributed.DurableClientAttributes" ]
import org.apache.geode.distributed.DurableClientAttributes;
import org.apache.geode.distributed.*;
[ "org.apache.geode" ]
org.apache.geode;
2,731,825
public ValueBuilder jsonpath(String value) { JsonPathExpression exp = new JsonPathExpression(value); return new ValueBuilder(exp); }
ValueBuilder function(String value) { JsonPathExpression exp = new JsonPathExpression(value); return new ValueBuilder(exp); }
/** * Returns a JSonPath expression value builder */
Returns a JSonPath expression value builder
jsonpath
{ "repo_name": "adessaigne/camel", "path": "core/camel-core-engine/src/main/java/org/apache/camel/builder/BuilderSupport.java", "license": "apache-2.0", "size": 13944 }
[ "org.apache.camel.model.language.JsonPathExpression" ]
import org.apache.camel.model.language.JsonPathExpression;
import org.apache.camel.model.language.*;
[ "org.apache.camel" ]
org.apache.camel;
404,379
@XmlElement(name="createTime") @Temporal(TemporalType.TIMESTAMP) @Column(name="nodeCreateTime", nullable=false) public Date getCreateTime() { return m_createTime; }
@XmlElement(name=STR) @Temporal(TemporalType.TIMESTAMP) @Column(name=STR, nullable=false) Date function() { return m_createTime; }
/** * Time node was added to the database. * * @hibernate.property column="nodecreatetime" length="8" not-null="true" * @return a {@link java.util.Date} object. */
Time node was added to the database
getCreateTime
{ "repo_name": "qoswork/opennmszh", "path": "opennms-model/src/main/java/org/opennms/netmgt/model/OnmsNode.java", "license": "gpl-2.0", "size": 37463 }
[ "java.util.Date", "javax.persistence.Column", "javax.persistence.Temporal", "javax.persistence.TemporalType", "javax.xml.bind.annotation.XmlElement" ]
import java.util.Date; import javax.persistence.Column; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.xml.bind.annotation.XmlElement;
import java.util.*; import javax.persistence.*; import javax.xml.bind.annotation.*;
[ "java.util", "javax.persistence", "javax.xml" ]
java.util; javax.persistence; javax.xml;
2,869,184
public Writer getControlPipe() { if (this.stdioShell != null) return this.stdioShell.getWriter(); else return null; }
Writer function() { if (this.stdioShell != null) return this.stdioShell.getWriter(); else return null; }
/** * Implements {@link EmulatorControllable#getControlPipe() * EmulatorControllable#getControlPipe}. */
Implements <code>EmulatorControllable#getControlPipe() EmulatorControllable#getControlPipe</code>
getControlPipe
{ "repo_name": "shudo/overlayweaver", "path": "src/ow/tool/msgcounter/Main.java", "license": "apache-2.0", "size": 6030 }
[ "java.io.Writer" ]
import java.io.Writer;
import java.io.*;
[ "java.io" ]
java.io;
2,765,093
public void handleParticles(SPacketParticles packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); if (packetIn.getParticleCount() == 0) { double d0 = (double)(packetIn.getParticleSpeed() * packetIn.getXOffset()); double d2 = (double)(packetIn.getParticleSpeed() * packetIn.getYOffset()); double d4 = (double)(packetIn.getParticleSpeed() * packetIn.getZOffset()); try { this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(), packetIn.getXCoordinate(), packetIn.getYCoordinate(), packetIn.getZCoordinate(), d0, d2, d4, packetIn.getParticleArgs()); } catch (Throwable var17) { logger.warn("Could not spawn particle effect " + packetIn.getParticleType()); } } else { for (int i = 0; i < packetIn.getParticleCount(); ++i) { double d1 = this.avRandomizer.nextGaussian() * (double)packetIn.getXOffset(); double d3 = this.avRandomizer.nextGaussian() * (double)packetIn.getYOffset(); double d5 = this.avRandomizer.nextGaussian() * (double)packetIn.getZOffset(); double d6 = this.avRandomizer.nextGaussian() * (double)packetIn.getParticleSpeed(); double d7 = this.avRandomizer.nextGaussian() * (double)packetIn.getParticleSpeed(); double d8 = this.avRandomizer.nextGaussian() * (double)packetIn.getParticleSpeed(); try { this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(), packetIn.getXCoordinate() + d1, packetIn.getYCoordinate() + d3, packetIn.getZCoordinate() + d5, d6, d7, d8, packetIn.getParticleArgs()); } catch (Throwable var16) { logger.warn("Could not spawn particle effect " + packetIn.getParticleType()); return; } } } }
void function(SPacketParticles packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); if (packetIn.getParticleCount() == 0) { double d0 = (double)(packetIn.getParticleSpeed() * packetIn.getXOffset()); double d2 = (double)(packetIn.getParticleSpeed() * packetIn.getYOffset()); double d4 = (double)(packetIn.getParticleSpeed() * packetIn.getZOffset()); try { this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(), packetIn.getXCoordinate(), packetIn.getYCoordinate(), packetIn.getZCoordinate(), d0, d2, d4, packetIn.getParticleArgs()); } catch (Throwable var17) { logger.warn(STR + packetIn.getParticleType()); } } else { for (int i = 0; i < packetIn.getParticleCount(); ++i) { double d1 = this.avRandomizer.nextGaussian() * (double)packetIn.getXOffset(); double d3 = this.avRandomizer.nextGaussian() * (double)packetIn.getYOffset(); double d5 = this.avRandomizer.nextGaussian() * (double)packetIn.getZOffset(); double d6 = this.avRandomizer.nextGaussian() * (double)packetIn.getParticleSpeed(); double d7 = this.avRandomizer.nextGaussian() * (double)packetIn.getParticleSpeed(); double d8 = this.avRandomizer.nextGaussian() * (double)packetIn.getParticleSpeed(); try { this.clientWorldController.spawnParticle(packetIn.getParticleType(), packetIn.isLongDistance(), packetIn.getXCoordinate() + d1, packetIn.getYCoordinate() + d3, packetIn.getZCoordinate() + d5, d6, d7, d8, packetIn.getParticleArgs()); } catch (Throwable var16) { logger.warn(STR + packetIn.getParticleType()); return; } } } }
/** * Spawns a specified number of particles at the specified location with a randomized displacement according to * specified bounds */
Spawns a specified number of particles at the specified location with a randomized displacement according to specified bounds
handleParticles
{ "repo_name": "seblund/Dissolvable", "path": "build/tmp/recompileMc/sources/net/minecraft/client/network/NetHandlerPlayClient.java", "license": "gpl-3.0", "size": 97450 }
[ "net.minecraft.network.PacketThreadUtil", "net.minecraft.network.play.server.SPacketParticles" ]
import net.minecraft.network.PacketThreadUtil; import net.minecraft.network.play.server.SPacketParticles;
import net.minecraft.network.*; import net.minecraft.network.play.server.*;
[ "net.minecraft.network" ]
net.minecraft.network;
948,748
public static void read( String trace, List<String> vehicleId, Map<String, Double> vehicleFirstOcc, Map<String, Double> vehicleLastOcc) { try { InputStream in = new FileInputStream(trace); XMLInputFactory factory = XMLInputFactory.newInstance(); XMLStreamReader parser = factory.createXMLStreamReader(in); float time = -1; // parse trace file for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) { if (event == XMLStreamConstants.START_ELEMENT) { // get current time if (parser.getLocalName().equals("timestep")) { for (int attr = 0; attr < parser.getAttributeCount(); attr++) { String attrName = parser.getAttributeLocalName(attr); String value = parser.getAttributeValue(attr); if ("time".equals(attrName)) { time = Float.parseFloat(value); } } } // vehicle element found if (parser.getLocalName().equals("vehicle")) { String id = ""; for (int attr = 0; attr < parser.getAttributeCount(); attr++) { String attrName = parser.getAttributeLocalName(attr); String value = parser.getAttributeValue(attr); if ("id".equals(attrName)) { id = value; } } // add id if not already added if (!vehicleId.contains(id)) { vehicleId.add(id); // id is new -> first occurence of id vehicleFirstOcc.put(id, new Double(time)); } // maybe last occurence of id vehicleLastOcc.put(id, new Double(time)); } } } parser.close(); } catch (XMLStreamException ex) { System.err.println(ex); } catch (IOException ex) { System.err.println(ex); } }
static void function( String trace, List<String> vehicleId, Map<String, Double> vehicleFirstOcc, Map<String, Double> vehicleLastOcc) { try { InputStream in = new FileInputStream(trace); XMLInputFactory factory = XMLInputFactory.newInstance(); XMLStreamReader parser = factory.createXMLStreamReader(in); float time = -1; for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) { if (event == XMLStreamConstants.START_ELEMENT) { if (parser.getLocalName().equals(STR)) { for (int attr = 0; attr < parser.getAttributeCount(); attr++) { String attrName = parser.getAttributeLocalName(attr); String value = parser.getAttributeValue(attr); if ("time".equals(attrName)) { time = Float.parseFloat(value); } } } if (parser.getLocalName().equals(STR)) { String id = STRid".equals(attrName)) { id = value; } } if (!vehicleId.contains(id)) { vehicleId.add(id); vehicleFirstOcc.put(id, new Double(time)); } vehicleLastOcc.put(id, new Double(time)); } } } parser.close(); } catch (XMLStreamException ex) { System.err.println(ex); } catch (IOException ex) { System.err.println(ex); } }
/** * working method * @param trace name of sumo trace file * @param vehicleId list of unique ids of vehicles in sumo simulation * @param vehicleFirstOcc map: vehicle id -> first occurence of vehicle in sumo * @param vehicleLastOcc map: vehicle id -> last occurence of vehicle in sumo */
working method
read
{ "repo_name": "rudhir-upretee/Sumo_With_Netsim", "path": "tools/traceExporter/src/ns2/VehicleReader.java", "license": "gpl-3.0", "size": 2467 }
[ "java.io.FileInputStream", "java.io.IOException", "java.io.InputStream", "java.util.List", "java.util.Map", "javax.xml.stream.XMLInputFactory", "javax.xml.stream.XMLStreamConstants", "javax.xml.stream.XMLStreamException", "javax.xml.stream.XMLStreamReader" ]
import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.List; import java.util.Map; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader;
import java.io.*; import java.util.*; import javax.xml.stream.*;
[ "java.io", "java.util", "javax.xml" ]
java.io; java.util; javax.xml;
109,292
public GlyphSequence.CharAssociation[] getAssociations ( int offset, int count ) throws IndexOutOfBoundsException { return getAssociations ( offset, count, offset < 0, ignoreDefault, null, null ); }
GlyphSequence.CharAssociation[] function ( int offset, int count ) throws IndexOutOfBoundsException { return getAssociations ( offset, count, offset < 0, ignoreDefault, null, null ); }
/** * Obtain <code>count</code> character associations of glyphs starting at specified offset from current position. If * offset is negative, then search backwards in input glyph sequence. Uses the * default ignores tester. * @param offset from current position * @param count number of associations to obtain * @return array of associations * @throws IndexOutOfBoundsException if offset or count results in an * invalid index into input glyph sequence */
Obtain <code>count</code> character associations of glyphs starting at specified offset from current position. If offset is negative, then search backwards in input glyph sequence. Uses the default ignores tester
getAssociations
{ "repo_name": "pellcorp/fop", "path": "src/java/org/apache/fop/complexscripts/fonts/GlyphProcessingState.java", "license": "apache-2.0", "size": 45993 }
[ "org.apache.fop.complexscripts.util.GlyphSequence" ]
import org.apache.fop.complexscripts.util.GlyphSequence;
import org.apache.fop.complexscripts.util.*;
[ "org.apache.fop" ]
org.apache.fop;
2,479,174
@Generated @Selector("trackingAreaCode") public native String trackingAreaCode();
@Selector(STR) native String function();
/** * [@property] trackingAreaCode * <p> * Tracking Area Code of the private LTE network. This property is only applicable for band 48 private LTE networks. */
[@property] trackingAreaCode Tracking Area Code of the private LTE network. This property is only applicable for band 48 private LTE networks
trackingAreaCode
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/networkextension/NEPrivateLTENetwork.java", "license": "apache-2.0", "size": 6775 }
[ "org.moe.natj.objc.ann.Selector" ]
import org.moe.natj.objc.ann.Selector;
import org.moe.natj.objc.ann.*;
[ "org.moe.natj" ]
org.moe.natj;
1,000,685
private void writeBufferChain(BufferChainOutputStream bufferChain, boolean compressed) { ByteBuffer header = ByteBuffer.wrap(headerScratch); header.put(compressed ? COMPRESSED : UNCOMPRESSED); int messageLength = bufferChain.readableBytes(); header.putInt(messageLength); WritableBuffer writeableHeader = bufferAllocator.allocate(HEADER_LENGTH); writeableHeader.write(headerScratch, 0, header.position()); if (messageLength == 0) { // the payload had 0 length so make the header the current buffer. buffer = writeableHeader; return; } // Note that we are always delivering a small message to the transport here which // may incur transport framing overhead as it may be sent separately to the contents // of the GRPC frame. sink.deliverFrame(writeableHeader, false, false); // Commit all except the last buffer to the sink List<WritableBuffer> bufferList = bufferChain.bufferList; for (int i = 0; i < bufferList.size() - 1; i++) { sink.deliverFrame(bufferList.get(i), false, false); } // Assign the current buffer to the last in the chain so it can be used // for future writes or written with end-of-stream=true on close. buffer = bufferList.get(bufferList.size() - 1); statsTraceCtx.wireBytesSent(messageLength); }
void function(BufferChainOutputStream bufferChain, boolean compressed) { ByteBuffer header = ByteBuffer.wrap(headerScratch); header.put(compressed ? COMPRESSED : UNCOMPRESSED); int messageLength = bufferChain.readableBytes(); header.putInt(messageLength); WritableBuffer writeableHeader = bufferAllocator.allocate(HEADER_LENGTH); writeableHeader.write(headerScratch, 0, header.position()); if (messageLength == 0) { buffer = writeableHeader; return; } sink.deliverFrame(writeableHeader, false, false); List<WritableBuffer> bufferList = bufferChain.bufferList; for (int i = 0; i < bufferList.size() - 1; i++) { sink.deliverFrame(bufferList.get(i), false, false); } buffer = bufferList.get(bufferList.size() - 1); statsTraceCtx.wireBytesSent(messageLength); }
/** * Write a message that has been serialized to a sequence of buffers. */
Write a message that has been serialized to a sequence of buffers
writeBufferChain
{ "repo_name": "anuraaga/grpc-java", "path": "core/src/main/java/io/grpc/internal/MessageFramer.java", "license": "bsd-3-clause", "size": 13950 }
[ "java.nio.ByteBuffer", "java.util.List" ]
import java.nio.ByteBuffer; import java.util.List;
import java.nio.*; import java.util.*;
[ "java.nio", "java.util" ]
java.nio; java.util;
2,514,867
public int countByDateAndCine(Calendar fechaInicio, Calendar fechaFin, Long idCine);
int function(Calendar fechaInicio, Calendar fechaFin, Long idCine);
/** * Devuleve el numero de sesiones entre fechaInicio y fechaFin para el cine * cine. * * @param fechaInicio * the fecha inicio * @param fechaFin * the fecha fin * @param idCine * the id cine * @return the int */
Devuleve el numero de sesiones entre fechaInicio y fechaFin para el cine cine
countByDateAndCine
{ "repo_name": "iago-suarez/pojo-cinema-app", "path": "src/main/java/es/udc/pojo/model/sesion/SesionDao.java", "license": "gpl-2.0", "size": 1024 }
[ "java.util.Calendar" ]
import java.util.Calendar;
import java.util.*;
[ "java.util" ]
java.util;
1,378,892
@Override public boolean doPreUpdateCredentialByAdmin(String userName, Object newCredential, UserStoreManager userStoreManager) throws UserStoreException { if (!isEnable()) { return true; } if (log.isDebugEnabled()) { log.debug("Pre update credential by admin is called in IdentityMgtEventListener"); } // Top level try and finally blocks are used to unset thread local variables try { if (!IdentityUtil.threadLocalProperties.get().containsKey(DO_PRE_UPDATE_CREDENTIAL_BY_ADMIN)) { IdentityUtil.threadLocalProperties.get().put(DO_PRE_UPDATE_CREDENTIAL_BY_ADMIN, true); IdentityMgtConfig config = IdentityMgtConfig.getInstance(); UserIdentityDataStore identityDataStore = IdentityMgtConfig.getInstance().getIdentityDataStore(); UserIdentityClaimsDO identityDTO = identityDataStore.load(userName, userStoreManager); boolean isAccountDisabled = false; if (identityDTO != null) { isAccountDisabled = identityDTO.getIsAccountDisabled(); } else { throw new UserStoreException("Cannot get the user account active status."); } if (isAccountDisabled) { IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext( IdentityCoreConstants.USER_ACCOUNT_DISABLED_ERROR_CODE); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); //account is already disabled and trying to update the credential without enabling it log.warn("Trying to update credential of a disabled user account. This is not permitted."); throw new UserStoreException("User account is disabled, can't update credential without enabling."); } try { // Enforcing the password policies. if (newCredential != null && (newCredential instanceof StringBuffer && (newCredential.toString().trim() .length() > 0))) { policyRegistry.enforcePasswordPolicies(newCredential.toString(), userName); } } catch (PolicyViolationException pe) { throw new UserStoreException(pe.getMessage(), pe); } if (newCredential == null || (newCredential instanceof StringBuffer && ((StringBuffer) newCredential) .toString().trim().length() < 1)) { if (!config.isEnableTemporaryPassword()) { log.error("Empty passwords are not allowed"); return false; } if (log.isDebugEnabled()) { log.debug("Credentials are null. Using a temporary password as credentials"); } // temporary passwords will be used char[] temporaryPassword = UserIdentityManagementUtil.generateTemporaryPassword(); // setting the password value ((StringBuffer) newCredential).replace(0, temporaryPassword.length, new String( temporaryPassword)); UserIdentityMgtBean bean = new UserIdentityMgtBean(); bean.setUserId(userName); bean.setConfirmationCode(newCredential.toString()); bean.setRecoveryType(IdentityMgtConstants.Notification.TEMPORARY_PASSWORD); if (log.isDebugEnabled()) { log.debug("Sending the temporary password to the user " + userName); } UserIdentityManagementUtil.notifyViaEmail(bean); } else { if (log.isDebugEnabled()) { log.debug("Updating credentials of user " + userName + " by admin with a non-empty password"); } } } return true; } finally { // Remove thread local variable IdentityUtil.threadLocalProperties.get().remove(DO_PRE_UPDATE_CREDENTIAL_BY_ADMIN); } }
boolean function(String userName, Object newCredential, UserStoreManager userStoreManager) throws UserStoreException { if (!isEnable()) { return true; } if (log.isDebugEnabled()) { log.debug(STR); } try { if (!IdentityUtil.threadLocalProperties.get().containsKey(DO_PRE_UPDATE_CREDENTIAL_BY_ADMIN)) { IdentityUtil.threadLocalProperties.get().put(DO_PRE_UPDATE_CREDENTIAL_BY_ADMIN, true); IdentityMgtConfig config = IdentityMgtConfig.getInstance(); UserIdentityDataStore identityDataStore = IdentityMgtConfig.getInstance().getIdentityDataStore(); UserIdentityClaimsDO identityDTO = identityDataStore.load(userName, userStoreManager); boolean isAccountDisabled = false; if (identityDTO != null) { isAccountDisabled = identityDTO.getIsAccountDisabled(); } else { throw new UserStoreException(STR); } if (isAccountDisabled) { IdentityErrorMsgContext customErrorMessageContext = new IdentityErrorMsgContext( IdentityCoreConstants.USER_ACCOUNT_DISABLED_ERROR_CODE); IdentityUtil.setIdentityErrorMsg(customErrorMessageContext); log.warn(STR); throw new UserStoreException(STR); } try { if (newCredential != null && (newCredential instanceof StringBuffer && (newCredential.toString().trim() .length() > 0))) { policyRegistry.enforcePasswordPolicies(newCredential.toString(), userName); } } catch (PolicyViolationException pe) { throw new UserStoreException(pe.getMessage(), pe); } if (newCredential == null (newCredential instanceof StringBuffer && ((StringBuffer) newCredential) .toString().trim().length() < 1)) { if (!config.isEnableTemporaryPassword()) { log.error(STR); return false; } if (log.isDebugEnabled()) { log.debug(STR); } char[] temporaryPassword = UserIdentityManagementUtil.generateTemporaryPassword(); ((StringBuffer) newCredential).replace(0, temporaryPassword.length, new String( temporaryPassword)); UserIdentityMgtBean bean = new UserIdentityMgtBean(); bean.setUserId(userName); bean.setConfirmationCode(newCredential.toString()); bean.setRecoveryType(IdentityMgtConstants.Notification.TEMPORARY_PASSWORD); if (log.isDebugEnabled()) { log.debug(STR + userName); } UserIdentityManagementUtil.notifyViaEmail(bean); } else { if (log.isDebugEnabled()) { log.debug(STR + userName + STR); } } } return true; } finally { IdentityUtil.threadLocalProperties.get().remove(DO_PRE_UPDATE_CREDENTIAL_BY_ADMIN); } }
/** * This method is used when the admin is updating the credentials with an * empty credential. A random password will be generated and will be mailed * to the user. */
This method is used when the admin is updating the credentials with an empty credential. A random password will be generated and will be mailed to the user
doPreUpdateCredentialByAdmin
{ "repo_name": "omindu/carbon-identity-framework", "path": "components/identity-mgt/org.wso2.carbon.identity.mgt/src/main/java/org/wso2/carbon/identity/mgt/IdentityMgtEventListener.java", "license": "apache-2.0", "size": 58003 }
[ "org.wso2.carbon.identity.core.model.IdentityErrorMsgContext", "org.wso2.carbon.identity.core.util.IdentityCoreConstants", "org.wso2.carbon.identity.core.util.IdentityUtil", "org.wso2.carbon.identity.mgt.beans.UserIdentityMgtBean", "org.wso2.carbon.identity.mgt.constants.IdentityMgtConstants", "org.wso2.carbon.identity.mgt.dto.UserIdentityClaimsDO", "org.wso2.carbon.identity.mgt.mail.Notification", "org.wso2.carbon.identity.mgt.policy.PolicyViolationException", "org.wso2.carbon.identity.mgt.store.UserIdentityDataStore", "org.wso2.carbon.identity.mgt.util.UserIdentityManagementUtil", "org.wso2.carbon.user.core.UserStoreException", "org.wso2.carbon.user.core.UserStoreManager" ]
import org.wso2.carbon.identity.core.model.IdentityErrorMsgContext; import org.wso2.carbon.identity.core.util.IdentityCoreConstants; import org.wso2.carbon.identity.core.util.IdentityUtil; import org.wso2.carbon.identity.mgt.beans.UserIdentityMgtBean; import org.wso2.carbon.identity.mgt.constants.IdentityMgtConstants; import org.wso2.carbon.identity.mgt.dto.UserIdentityClaimsDO; import org.wso2.carbon.identity.mgt.mail.Notification; import org.wso2.carbon.identity.mgt.policy.PolicyViolationException; import org.wso2.carbon.identity.mgt.store.UserIdentityDataStore; import org.wso2.carbon.identity.mgt.util.UserIdentityManagementUtil; import org.wso2.carbon.user.core.UserStoreException; import org.wso2.carbon.user.core.UserStoreManager;
import org.wso2.carbon.identity.core.model.*; import org.wso2.carbon.identity.core.util.*; import org.wso2.carbon.identity.mgt.beans.*; import org.wso2.carbon.identity.mgt.constants.*; import org.wso2.carbon.identity.mgt.dto.*; import org.wso2.carbon.identity.mgt.mail.*; import org.wso2.carbon.identity.mgt.policy.*; import org.wso2.carbon.identity.mgt.store.*; import org.wso2.carbon.identity.mgt.util.*; import org.wso2.carbon.user.core.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
40,688
public void paintColorChooserBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { paintBorder(context, g, x, y, w, h, null); }
void function(SynthContext context, Graphics g, int x, int y, int w, int h) { paintBorder(context, g, x, y, w, h, null); }
/** * Paints the border of a color chooser. * * @param context SynthContext identifying the <code>JComponent</code> and * <code>Region</code> to paint to * @param g <code>Graphics</code> to paint to * @param x X coordinate of the area to paint to * @param y Y coordinate of the area to paint to * @param w Width of the area to paint to * @param h Height of the area to paint to */
Paints the border of a color chooser
paintColorChooserBorder
{ "repo_name": "anhtu1995ok/seaglass", "path": "src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java", "license": "apache-2.0", "size": 119406 }
[ "java.awt.Graphics", "javax.swing.plaf.synth.SynthContext" ]
import java.awt.Graphics; import javax.swing.plaf.synth.SynthContext;
import java.awt.*; import javax.swing.plaf.synth.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
1,401,344
public void writeEntityToNBT(NBTTagCompound p_70014_1_) { super.writeEntityToNBT(p_70014_1_); p_70014_1_.setBoolean("PlayerCreated", this.isPlayerCreated()); }
void function(NBTTagCompound p_70014_1_) { super.writeEntityToNBT(p_70014_1_); p_70014_1_.setBoolean(STR, this.isPlayerCreated()); }
/** * (abstract) Protected helper method to write subclass entity data to NBT. */
(abstract) Protected helper method to write subclass entity data to NBT
writeEntityToNBT
{ "repo_name": "Myrninvollo/Server", "path": "src/net/minecraft/entity/monster/EntityIronGolem.java", "license": "gpl-2.0", "size": 9331 }
[ "net.minecraft.nbt.NBTTagCompound" ]
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.*;
[ "net.minecraft.nbt" ]
net.minecraft.nbt;
2,428,666
public void setVersion(WmsService.WmsVersion version) { this.version = version; }
void function(WmsService.WmsVersion version) { this.version = version; }
/** * Set the WMS version. Default value is '1.3.0'. * * @param version The WMS version. */
Set the WMS version. Default value is '1.3.0'
setVersion
{ "repo_name": "geomajas/geomajas-project-client-gwt2", "path": "plugin/wms/wms/src/main/java/org/geomajas/gwt2/plugin/wms/client/layer/WmsLayerConfiguration.java", "license": "agpl-3.0", "size": 9314 }
[ "org.geomajas.gwt2.plugin.wms.client.service.WmsService" ]
import org.geomajas.gwt2.plugin.wms.client.service.WmsService;
import org.geomajas.gwt2.plugin.wms.client.service.*;
[ "org.geomajas.gwt2" ]
org.geomajas.gwt2;
680,118
@Override public final void pcdata(char[] ch, int start, int length) throws IllegalStateException, IllegalArgumentException, IndexOutOfBoundsException, InvalidXMLException, IOException { // Check state if (_state != XMLEventListenerStates.START_TAG_OPEN && _state != XMLEventListenerStates.WITHIN_ELEMENT) { throw new IllegalStateException("getState() == " + _state); // Check arguments } else if (ch == null) { throw new IllegalArgumentException("ch == null"); } else if (start < 0) { throw new IllegalArgumentException("start (" + start + ") < 0"); } else if (start >= ch.length) { throw new IllegalArgumentException("start (" + start + ") >= ch.length (" + ch.length + ')'); } else if (length < 0) { throw new IllegalArgumentException("length < 0"); } // Temporarily set the state to ERROR_STATE. Unless an exception is // thrown in the write methods, it will be reset to a valid state. XMLEventListenerState oldState = _state; _state = XMLEventListenerStates.ERROR_STATE; // Write output if (oldState == XMLEventListenerStates.START_TAG_OPEN) { closeStartTag(); } _encoder.text(_out, ch, start, length, _escapeAmpersands); // Change the state _state = XMLEventListenerStates.WITHIN_ELEMENT; // State has changed, check checkInvariants(); } /** * Writes the specified ignorable whitespace. Ignorable whitespace may be * written anywhere in XML output stream, except above the XML declaration. * <p /> * If the state equals {@link #BEFORE_XML_DECLARATION}, then it will be set to * {@link #BEFORE_DTD_DECLARATION}, otherwise if the state is {@link #START_TAG_OPEN} then it * will be set to {@link #WITHIN_ELEMENT}, otherwise the state will not be changed. * * @param whitespace the ignorable whitespace to be written, not <code>null</code>. * @throws IllegalStateException if <code>getState() != {@link #BEFORE_XML_DECLARATION} &amp;&amp; getState() != * {@link #BEFORE_DTD_DECLARATION} &amp;&amp; getState() != {@link #BEFORE_ROOT_ELEMENT}
final void function(char[] ch, int start, int length) throws IllegalStateException, IllegalArgumentException, IndexOutOfBoundsException, InvalidXMLException, IOException { if (_state != XMLEventListenerStates.START_TAG_OPEN && _state != XMLEventListenerStates.WITHIN_ELEMENT) { throw new IllegalStateException(STR + _state); } else if (ch == null) { throw new IllegalArgumentException(STR); } else if (start < 0) { throw new IllegalArgumentException(STR + start + STR); } else if (start >= ch.length) { throw new IllegalArgumentException(STR + start + STR + ch.length + ')'); } else if (length < 0) { throw new IllegalArgumentException(STR); } XMLEventListenerState oldState = _state; _state = XMLEventListenerStates.ERROR_STATE; if (oldState == XMLEventListenerStates.START_TAG_OPEN) { closeStartTag(); } _encoder.text(_out, ch, start, length, _escapeAmpersands); _state = XMLEventListenerStates.WITHIN_ELEMENT; checkInvariants(); } /** * Writes the specified ignorable whitespace. Ignorable whitespace may be * written anywhere in XML output stream, except above the XML declaration. * <p /> * If the state equals {@link #BEFORE_XML_DECLARATION}, then it will be set to * {@link #BEFORE_DTD_DECLARATION}, otherwise if the state is {@link #START_TAG_OPEN} then it * will be set to {@link #WITHIN_ELEMENT}, otherwise the state will not be changed. * * @param whitespace the ignorable whitespace to be written, not <code>null</code>. * @throws IllegalStateException if <code>getState() != {@link #BEFORE_XML_DECLARATION} &amp;&amp; getState() != * {@link #BEFORE_DTD_DECLARATION} &amp;&amp; getState() != {@link #BEFORE_ROOT_ELEMENT}
/** * Writes the specified character array as PCDATA. * * @param ch the character array containing the text to be written, not <code>null</code>. * @param start the start index in the array, must be &gt;= 0 and it must be &lt; * <code>ch.length</code>. * @param length the number of characters to read from the array, must be &gt; 0. * @throws IllegalStateException if <code>getState() != {@link #START_TAG_OPEN} &amp;&amp; * getState() != {@link #WITHIN_ELEMENT}</code> * @throws IllegalArgumentException if <code>ch == null * || start &lt; 0 * || start &gt;= ch.length * || length &lt; 0</code>. * @throws IndexOutOfBoundsException if <code>start + length &gt; ch.length</code>. * @throws InvalidXMLException if the specified text contains an invalid character. * @throws IOException if an I/O error occurs; this will set the state to {@link #ERROR_STATE}. */
Writes the specified character array as PCDATA
pcdata
{ "repo_name": "znerd/xmlenc", "path": "src/main/java/org/znerd/xmlenc/XMLOutputter.java", "license": "bsd-2-clause", "size": 70789 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
751,757
void createPage0() { try { _scriptEditor = new LogoScriptEditor(); int index = addPage(_scriptEditor, getEditorInput()); setPageText(index, _scriptEditor.getTitle()); } catch (PartInitException e) { ErrorDialog.openError(getSite().getShell(), "Error creating nested text _scriptEditor", null, e.getStatus()); } }
void createPage0() { try { _scriptEditor = new LogoScriptEditor(); int index = addPage(_scriptEditor, getEditorInput()); setPageText(index, _scriptEditor.getTitle()); } catch (PartInitException e) { ErrorDialog.openError(getSite().getShell(), STR, null, e.getStatus()); } }
/** * Creates page 0 of the multi-page LOGO Script _scriptEditor, which contains a text _scriptEditor. */
Creates page 0 of the multi-page LOGO Script _scriptEditor, which contains a text _scriptEditor
createPage0
{ "repo_name": "yinonavraham/myLOGO4Eclipse", "path": "ynn.eclipse.mylogo.ui/src/ynn/eclipse/mylogo/ui/editors/LogoEditor.java", "license": "mit", "size": 7291 }
[ "org.eclipse.jface.dialogs.ErrorDialog", "org.eclipse.ui.PartInitException" ]
import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.ui.PartInitException;
import org.eclipse.jface.dialogs.*; import org.eclipse.ui.*;
[ "org.eclipse.jface", "org.eclipse.ui" ]
org.eclipse.jface; org.eclipse.ui;
2,090,046
@Override public void refreshDefaultQueue(Configuration conf, String userName) throws IOException { if (StringUtils.isNotBlank(userName) && isFairScheduler(conf)) { // 调用FairSchedulerShim类的refreshDefaultQueue方法 ShimLoader.getSchedulerShims().refreshDefaultQueue(conf, userName); } }
void function(Configuration conf, String userName) throws IOException { if (StringUtils.isNotBlank(userName) && isFairScheduler(conf)) { ShimLoader.getSchedulerShims().refreshDefaultQueue(conf, userName); } }
/** * Load the fair scheduler queue for given user if available. */
Load the fair scheduler queue for given user if available
refreshDefaultQueue
{ "repo_name": "BUPTAnderson/apache-hive-2.1.1-src", "path": "shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java", "license": "apache-2.0", "size": 42330 }
[ "java.io.IOException", "org.apache.commons.lang.StringUtils", "org.apache.hadoop.conf.Configuration" ]
import java.io.IOException; import org.apache.commons.lang.StringUtils; import org.apache.hadoop.conf.Configuration;
import java.io.*; import org.apache.commons.lang.*; import org.apache.hadoop.conf.*;
[ "java.io", "org.apache.commons", "org.apache.hadoop" ]
java.io; org.apache.commons; org.apache.hadoop;
1,660,025
public String exportForContainerpage() throws Exception { return export(GalleryMode.ade); }
String function() throws Exception { return export(GalleryMode.ade); }
/** * Returns the serialized initial data for gallery dialog within the container-page editor.<p> * * @return the data * * @throws Exception if something goes wrong */
Returns the serialized initial data for gallery dialog within the container-page editor
exportForContainerpage
{ "repo_name": "sbonoc/opencms-core", "path": "src/org/opencms/ade/galleries/CmsGalleryActionElement.java", "license": "lgpl-2.1", "size": 11274 }
[ "org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants" ]
import org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants;
import org.opencms.ade.galleries.shared.*;
[ "org.opencms.ade" ]
org.opencms.ade;
2,088,208
@Override public Object decode(final Object obj) throws DecoderException { if (obj == null) { return null; } else if (obj instanceof byte[]) { return decode((byte[]) obj); } else if (obj instanceof String) { return decode((String) obj); } else { throw new DecoderException("Objects of type " + obj.getClass().getName() + " cannot be URL decoded"); } }
Object function(final Object obj) throws DecoderException { if (obj == null) { return null; } else if (obj instanceof byte[]) { return decode((byte[]) obj); } else if (obj instanceof String) { return decode((String) obj); } else { throw new DecoderException(STR + obj.getClass().getName() + STR); } }
/** * Decodes a URL safe object into its original form. Escaped characters are converted back to their original * representation. * * @param obj * URL safe object to convert into its original form * @return original object * @throws DecoderException * Thrown if the argument is not a <code>String</code> or <code>byte[]</code>. Thrown if a failure * condition is encountered during the decode process. */
Decodes a URL safe object into its original form. Escaped characters are converted back to their original representation
decode
{ "repo_name": "MaxCDN/java-maxcdn", "path": "src/org/apache/commons/codec/net/URLCodec.java", "license": "mit", "size": 12773 }
[ "org.apache.commons.codec.DecoderException" ]
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.*;
[ "org.apache.commons" ]
org.apache.commons;
1,804,975
@Override public RecordWriter<K,VariantContextWritable> getRecordWriter( TaskAttemptContext ctx) throws IOException { Configuration conf = ctx.getConfiguration(); boolean isCompressed = getCompressOutput(ctx); CompressionCodec codec = null; String extension = ""; if (isCompressed) { Class<? extends CompressionCodec> codecClass = getOutputCompressorClass(ctx, BGZFCodec.class); codec = ReflectionUtils.newInstance(codecClass, conf); extension = codec.getDefaultExtension(); } Path file = getDefaultWorkFile(ctx, extension); if (!isCompressed) { return getRecordWriter(ctx, file); } else { FileSystem fs = file.getFileSystem(conf); return getRecordWriter(ctx, codec.createOutputStream(fs.create(file))); } }
@Override RecordWriter<K,VariantContextWritable> function( TaskAttemptContext ctx) throws IOException { Configuration conf = ctx.getConfiguration(); boolean isCompressed = getCompressOutput(ctx); CompressionCodec codec = null; String extension = ""; if (isCompressed) { Class<? extends CompressionCodec> codecClass = getOutputCompressorClass(ctx, BGZFCodec.class); codec = ReflectionUtils.newInstance(codecClass, conf); extension = codec.getDefaultExtension(); } Path file = getDefaultWorkFile(ctx, extension); if (!isCompressed) { return getRecordWriter(ctx, file); } else { FileSystem fs = file.getFileSystem(conf); return getRecordWriter(ctx, codec.createOutputStream(fs.create(file))); } }
/** <code>setHeader</code> or <code>readHeaderFrom</code> must have been * called first. */
<code>setHeader</code> or <code>readHeaderFrom</code> must have been called first
getRecordWriter
{ "repo_name": "HadoopGenomics/Hadoop-BAM", "path": "src/main/java/org/seqdoop/hadoop_bam/KeyIgnoringVCFOutputFormat.java", "license": "mit", "size": 5560 }
[ "java.io.IOException", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.fs.Path", "org.apache.hadoop.io.compress.CompressionCodec", "org.apache.hadoop.mapreduce.RecordWriter", "org.apache.hadoop.mapreduce.TaskAttemptContext", "org.apache.hadoop.util.ReflectionUtils", "org.seqdoop.hadoop_bam.util.BGZFCodec" ]
import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.compress.CompressionCodec; import org.apache.hadoop.mapreduce.RecordWriter; import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.hadoop.util.ReflectionUtils; import org.seqdoop.hadoop_bam.util.BGZFCodec;
import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.io.compress.*; import org.apache.hadoop.mapreduce.*; import org.apache.hadoop.util.*; import org.seqdoop.hadoop_bam.util.*;
[ "java.io", "org.apache.hadoop", "org.seqdoop.hadoop_bam" ]
java.io; org.apache.hadoop; org.seqdoop.hadoop_bam;
2,556,890
public void deleteAllSpams(){ RichMessaging.getInstance().deleteAllSpams(); }
void function(){ RichMessaging.getInstance().deleteAllSpams(); }
/** * Delete all spams */
Delete all spams
deleteAllSpams
{ "repo_name": "rex-xxx/mt6572_x201", "path": "mediatek/packages/apps/RCSe/core/src/com/orangelabs/rcs/service/api/client/eventslog/EventsLogApi.java", "license": "gpl-2.0", "size": 17958 }
[ "com.orangelabs.rcs.provider.messaging.RichMessaging" ]
import com.orangelabs.rcs.provider.messaging.RichMessaging;
import com.orangelabs.rcs.provider.messaging.*;
[ "com.orangelabs.rcs" ]
com.orangelabs.rcs;
1,186,571
public T soapjaxb() { return dataFormat(new SoapJaxbDataFormat()); }
T function() { return dataFormat(new SoapJaxbDataFormat()); }
/** * Uses the Soap 1.1 JAXB data format */
Uses the Soap 1.1 JAXB data format
soapjaxb
{ "repo_name": "rmarting/camel", "path": "camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java", "license": "apache-2.0", "size": 42614 }
[ "org.apache.camel.model.dataformat.SoapJaxbDataFormat" ]
import org.apache.camel.model.dataformat.SoapJaxbDataFormat;
import org.apache.camel.model.dataformat.*;
[ "org.apache.camel" ]
org.apache.camel;
2,066,872
protected Map<Computer,T> monitor() throws InterruptedException { Map<Computer,T> data = new HashMap<Computer,T>(); for( Computer c : Jenkins.getInstance().getComputers() ) { try { Thread.currentThread().setName("Monitoring "+c.getDisplayName()+" for "+getDisplayName()); if(c.getChannel()==null) data.put(c,null); else data.put(c,monitor(c)); } catch (RuntimeException e) { LOGGER.log(Level.WARNING, "Failed to monitor "+c.getDisplayName()+" for "+getDisplayName(), e); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to monitor "+c.getDisplayName()+" for "+getDisplayName(), e); } catch (InterruptedException e) { throw (InterruptedException)new InterruptedException("Node monitoring "+c.getDisplayName()+" for "+getDisplayName()+" aborted.").initCause(e); } } return data; }
Map<Computer,T> function() throws InterruptedException { Map<Computer,T> data = new HashMap<Computer,T>(); for( Computer c : Jenkins.getInstance().getComputers() ) { try { Thread.currentThread().setName(STR+c.getDisplayName()+STR+getDisplayName()); if(c.getChannel()==null) data.put(c,null); else data.put(c,monitor(c)); } catch (RuntimeException e) { LOGGER.log(Level.WARNING, STR+c.getDisplayName()+STR+getDisplayName(), e); } catch (IOException e) { LOGGER.log(Level.WARNING, STR+c.getDisplayName()+STR+getDisplayName(), e); } catch (InterruptedException e) { throw (InterruptedException)new InterruptedException(STR+c.getDisplayName()+STR+getDisplayName()+STR).initCause(e); } } return data; }
/** * Performs monitoring across the board. * * @return * For all the computers, report the monitored values. */
Performs monitoring across the board
monitor
{ "repo_name": "brunocvcunha/jenkins", "path": "core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java", "license": "mit", "size": 11419 }
[ "hudson.model.Computer", "java.io.IOException", "java.util.HashMap", "java.util.Map", "java.util.logging.Level" ]
import hudson.model.Computer; import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.logging.Level;
import hudson.model.*; import java.io.*; import java.util.*; import java.util.logging.*;
[ "hudson.model", "java.io", "java.util" ]
hudson.model; java.io; java.util;
642,298
public static void deleteReference(final SQLProvider provider, final INaviOperandTreeNode node, final IAddress address, final ReferenceType type) throws CouldntDeleteException { Preconditions.checkNotNull(provider, "IE00476: Provider argument can not be null"); Preconditions.checkNotNull(node, "IE00477: Node argument can not be null"); Preconditions.checkNotNull(address, "IE01619: Address argument can not be null"); Preconditions.checkNotNull(type, "IE00478: Type argument can not be null"); final CConnection connection = provider.getConnection(); final BigInteger instructionAddress = node.getInstructionAddress().toBigInteger(); final int position = node.getOperandPosition(); final int expressionId = node.getId(); final BigInteger targetAddress = address.toBigInteger(); final String deleteQuery = "DELETE FROM " + CTableNames.ADDRESS_REFERENCES_TABLE + " WHERE address = ? AND position = ? AND expression_id = ? AND type = '" + type.toString().toLowerCase() + "' AND target = ?"; try { final PreparedStatement deleteStatement = connection.getConnection().prepareStatement(deleteQuery); try { deleteStatement.setObject(1, instructionAddress, java.sql.Types.BIGINT); deleteStatement.setInt(2, position); deleteStatement.setInt(3, expressionId); deleteStatement.setObject(4, targetAddress, java.sql.Types.BIGINT); deleteStatement.execute(); } catch (final SQLException exception) { throw new CouldntDeleteException(exception); } finally { deleteStatement.close(); } } catch (final SQLException exception) { throw new CouldntDeleteException(exception); } }
static void function(final SQLProvider provider, final INaviOperandTreeNode node, final IAddress address, final ReferenceType type) throws CouldntDeleteException { Preconditions.checkNotNull(provider, STR); Preconditions.checkNotNull(node, STR); Preconditions.checkNotNull(address, STR); Preconditions.checkNotNull(type, STR); final CConnection connection = provider.getConnection(); final BigInteger instructionAddress = node.getInstructionAddress().toBigInteger(); final int position = node.getOperandPosition(); final int expressionId = node.getId(); final BigInteger targetAddress = address.toBigInteger(); final String deleteQuery = STR + CTableNames.ADDRESS_REFERENCES_TABLE + STR + type.toString().toLowerCase() + STR; try { final PreparedStatement deleteStatement = connection.getConnection().prepareStatement(deleteQuery); try { deleteStatement.setObject(1, instructionAddress, java.sql.Types.BIGINT); deleteStatement.setInt(2, position); deleteStatement.setInt(3, expressionId); deleteStatement.setObject(4, targetAddress, java.sql.Types.BIGINT); deleteStatement.execute(); } catch (final SQLException exception) { throw new CouldntDeleteException(exception); } finally { deleteStatement.close(); } } catch (final SQLException exception) { throw new CouldntDeleteException(exception); } }
/** * Deletes a reference from an operand expression. * * The node from which the reference is removed must be stored in the * database connected to by the provider argument. * * @param provider The connection to the database. * @param node The operand expression from which the reference is deleted. * @param address The target address of the reference to delete. * @param type The type of the reference to delete. * * @throws CouldntDeleteException Thrown if the reference could not be * deleted. */
Deletes a reference from an operand expression. The node from which the reference is removed must be stored in the database connected to by the provider argument
deleteReference
{ "repo_name": "mayl8822/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/Database/PostgreSQL/Functions/PostgreSQLInstructionFunctions.java", "license": "apache-2.0", "size": 32657 }
[ "com.google.common.base.Preconditions", "com.google.security.zynamics.binnavi.Database", "com.google.security.zynamics.binnavi.disassembly.INaviOperandTreeNode", "com.google.security.zynamics.zylib.disassembly.IAddress", "com.google.security.zynamics.zylib.disassembly.ReferenceType", "java.math.BigInteger", "java.sql.PreparedStatement", "java.sql.SQLException", "java.sql.Types" ]
import com.google.common.base.Preconditions; import com.google.security.zynamics.binnavi.Database; import com.google.security.zynamics.binnavi.disassembly.INaviOperandTreeNode; import com.google.security.zynamics.zylib.disassembly.IAddress; import com.google.security.zynamics.zylib.disassembly.ReferenceType; import java.math.BigInteger; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Types;
import com.google.common.base.*; import com.google.security.zynamics.binnavi.*; import com.google.security.zynamics.binnavi.disassembly.*; import com.google.security.zynamics.zylib.disassembly.*; import java.math.*; import java.sql.*;
[ "com.google.common", "com.google.security", "java.math", "java.sql" ]
com.google.common; com.google.security; java.math; java.sql;
160,619
public void print(Object obj) throws IOException { write(String.valueOf(obj)); }
void function(Object obj) throws IOException { write(String.valueOf(obj)); }
/** * Print an object. The string produced by the <code>{@link * java.lang.String#valueOf(Object)}</code> method is translated into bytes * according to the platform's default character encoding, and these bytes * are written in exactly the manner of the <code>{@link #write(int)}</code> * method. * * @param obj The <code>Object</code> to be printed */
Print an object. The string produced by the <code><code>java.lang.String#valueOf(Object)</code></code> method is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the <code><code>#write(int)</code></code> method
print
{ "repo_name": "johnaoahra80/JBOSSWEB_7_5_0_FINAL", "path": "src/main/java/org/apache/jasper/runtime/JspWriterImpl.java", "license": "apache-2.0", "size": 17602 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,333,747
protected void start(UserTransaction userTransaction) { }
void function(UserTransaction userTransaction) { }
/** * <p> * Called when the associated <code>Scheduler</code> is started, in order * to let the plug-in know it can now make calls into the scheduler if it * needs to. * </p> * * <p> * If UserTransaction is not null, the plugin can call setRollbackOnly() * on it to signal that the wrapped transaction should rollback. * </p> * * @param userTransaction The UserTranaction object used to provide a * transaction around the start() operation. It will be null if * <em>wrapInUserTransaction</em> is false or if the transaction failed * to be started. */
Called when the associated <code>Scheduler</code> is started, in order to let the plug-in know it can now make calls into the scheduler if it needs to. If UserTransaction is not null, the plugin can call setRollbackOnly() on it to signal that the wrapped transaction should rollback.
start
{ "repo_name": "suthat/signal", "path": "vendor/quartz-2.2.0/src/org/quartz/plugins/SchedulerPluginWithUserTransactionSupport.java", "license": "apache-2.0", "size": 6783 }
[ "javax.transaction.UserTransaction" ]
import javax.transaction.UserTransaction;
import javax.transaction.*;
[ "javax.transaction" ]
javax.transaction;
292,254
void programLocalBcastRules(DeviceId deviceId, SegmentationId segmentationId, PortNumber inPort, Iterable<PortNumber> localVmPorts, Iterable<PortNumber> localTunnelPorts, Objective.Operation type);
void programLocalBcastRules(DeviceId deviceId, SegmentationId segmentationId, PortNumber inPort, Iterable<PortNumber> localVmPorts, Iterable<PortNumber> localTunnelPorts, Objective.Operation type);
/** * The local broadcast rule that message matches Table(50). * Match: broadcast mac and vnid. * Action: set output port. * * @param deviceId Device Id * @param segmentationId the vnid of the host belong to * @param inPort the ingress port of the host * @param localVmPorts the local ports of the network which connect host * @param localTunnelPorts the tunnel pors of the device * @param type the operation of the flow */
The local broadcast rule that message matches Table(50). Match: broadcast mac and vnid. Action: set output port
programLocalBcastRules
{ "repo_name": "sonu283304/onos", "path": "apps/vtn/vtnmgr/src/main/java/org/onosproject/vtn/table/L2ForwardService.java", "license": "apache-2.0", "size": 3836 }
[ "org.onosproject.net.DeviceId", "org.onosproject.net.PortNumber", "org.onosproject.net.flowobjective.Objective", "org.onosproject.vtnrsc.SegmentationId" ]
import org.onosproject.net.DeviceId; import org.onosproject.net.PortNumber; import org.onosproject.net.flowobjective.Objective; import org.onosproject.vtnrsc.SegmentationId;
import org.onosproject.net.*; import org.onosproject.net.flowobjective.*; import org.onosproject.vtnrsc.*;
[ "org.onosproject.net", "org.onosproject.vtnrsc" ]
org.onosproject.net; org.onosproject.vtnrsc;
1,721,070
public AssignmentSubmissionEdit mergeSubmission(Element el) throws IdInvalidException, IdUsedException, PermissionException;
AssignmentSubmissionEdit function(Element el) throws IdInvalidException, IdUsedException, PermissionException;
/** * Add a new AssignmentSubmission to the directory, from a definition in XML. Must commitEdit() to make official, or cancelEdit() when done! * * @param el * The XML DOM Element defining the submission. * @return A locked AssignmentSubmissionEdit object (reserving the id). * @exception IdInvalidException * if the submission id is invalid. * @exception IdUsedException * if the submission id is already used. * @exception PermissionException * if the current user does not have permission to add a submission. */
Add a new AssignmentSubmission to the directory, from a definition in XML. Must commitEdit() to make official, or cancelEdit() when done
mergeSubmission
{ "repo_name": "rodriguezdevera/sakai", "path": "assignment/assignment-api/api/src/java/org/sakaiproject/assignment/api/AssignmentService.java", "license": "apache-2.0", "size": 35815 }
[ "org.sakaiproject.exception.IdInvalidException", "org.sakaiproject.exception.IdUsedException", "org.sakaiproject.exception.PermissionException", "org.w3c.dom.Element" ]
import org.sakaiproject.exception.IdInvalidException; import org.sakaiproject.exception.IdUsedException; import org.sakaiproject.exception.PermissionException; import org.w3c.dom.Element;
import org.sakaiproject.exception.*; import org.w3c.dom.*;
[ "org.sakaiproject.exception", "org.w3c.dom" ]
org.sakaiproject.exception; org.w3c.dom;
1,296,796
protected ExecutionEnvironment getExecutionEnvironment() { return env; }
ExecutionEnvironment function() { return env; }
/** * Returns the execution environment for the tests * * @return Flink execution environment */
Returns the execution environment for the tests
getExecutionEnvironment
{ "repo_name": "smee/gradoop", "path": "gradoop-flink/src/test/java/org/gradoop/flink/model/GradoopFlinkTestBase.java", "license": "apache-2.0", "size": 8079 }
[ "org.apache.flink.api.java.ExecutionEnvironment" ]
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.*;
[ "org.apache.flink" ]
org.apache.flink;
114,838
@Override public void setData(final int index, final ComplexNumber d) { this.data[index] = d; } /** * {@inheritDoc}
void function(final int index, final ComplexNumber d) { this.data[index] = d; } /** * {@inheritDoc}
/** * Set a data element to a complex number. * @param index The index to set. * @param d The complex number. */
Set a data element to a complex number
setData
{ "repo_name": "Crespo911/encog-java-core", "path": "src/main/java/org/encog/ml/data/basic/BasicMLComplexData.java", "license": "apache-2.0", "size": 5638 }
[ "org.encog.mathutil.ComplexNumber" ]
import org.encog.mathutil.ComplexNumber;
import org.encog.mathutil.*;
[ "org.encog.mathutil" ]
org.encog.mathutil;
517,829
@POST @Produces({MediaType.APPLICATION_JSON}) @Consumes({MediaType.APPLICATION_JSON}) @StatusCodes({ @ResponseCode(code = 201, condition = "Created"), @ResponseCode(code = 400, condition = "Bad Request"), @ResponseCode(code = 401, condition = "Unauthorized"), @ResponseCode(code = 403, condition = "Forbidden"), @ResponseCode(code = 404, condition = "Not Found"), @ResponseCode(code = 409, condition = "Conflict"), @ResponseCode(code = 501, condition = "Not Implemented")}) public Response createFirewallRules(final NeutronFirewallRuleRequest input) { INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this); if (firewallRuleInterface == null) { throw new ServiceUnavailableException("Firewall Rule CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this); if (firewallPolicyInterface == null) { throw new ServiceUnavailableException("Firewall Policy CRUD Interface " + RestMessages.SERVICEUNAVAILABLE.toString()); } if (input.isSingleton()) { NeutronFirewallRule singleton = input.getSingleton(); if (firewallRuleInterface.neutronFirewallRuleExists(singleton.getFirewallRuleUUID())) { throw new BadRequestException("Firewall Rule UUID already exists"); } firewallRuleInterface.addNeutronFirewallRule(singleton); Object[] instances = ServiceHelper.getGlobalInstances(INeutronFirewallRuleAware.class, this, null); if (instances != null) { for (Object instance : instances) { INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance; int status = service.canCreateNeutronFirewallRule(singleton); if (status < 200 || status > 299) { return Response.status(status).build(); } } } // add rule to cache singleton.initDefaults(); firewallRuleInterface.addNeutronFirewallRule(singleton); if (instances != null) { for (Object instance : instances) { INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance; service.neutronFirewallRuleCreated(singleton); } } } else { List<NeutronFirewallRule> bulk = input.getBulk(); Iterator<NeutronFirewallRule> i = bulk.iterator(); HashMap<String, NeutronFirewallRule> testMap = new HashMap<String, NeutronFirewallRule>(); Object[] instances = ServiceHelper.getGlobalInstances(INeutronFirewallRuleAware.class, this, null); while (i.hasNext()) { NeutronFirewallRule test = i.next(); if (firewallRuleInterface.neutronFirewallRuleExists(test.getFirewallRuleUUID())) { throw new BadRequestException("Firewall Rule UUID already exists"); } if (testMap.containsKey(test.getFirewallRuleUUID())) { throw new BadRequestException("Firewall Rule UUID already exists"); } if (instances != null) { for (Object instance : instances) { INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance; int status = service.canCreateNeutronFirewallRule(test); if (status < 200 || status > 299) { return Response.status(status).build(); } } } } i = bulk.iterator(); while (i.hasNext()) { NeutronFirewallRule test = i.next(); firewallRuleInterface.addNeutronFirewallRule(test); if (instances != null) { for (Object instance : instances) { INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance; service.neutronFirewallRuleCreated(test); } } } } return Response.status(201).entity(input).build(); }
@Produces({MediaType.APPLICATION_JSON}) @Consumes({MediaType.APPLICATION_JSON}) @StatusCodes({ @ResponseCode(code = 201, condition = STR), @ResponseCode(code = 400, condition = STR), @ResponseCode(code = 401, condition = STR), @ResponseCode(code = 403, condition = STR), @ResponseCode(code = 404, condition = STR), @ResponseCode(code = 409, condition = STR), @ResponseCode(code = 501, condition = STR)}) Response function(final NeutronFirewallRuleRequest input) { INeutronFirewallRuleCRUD firewallRuleInterface = NeutronCRUDInterfaces.getINeutronFirewallRuleCRUD(this); if (firewallRuleInterface == null) { throw new ServiceUnavailableException(STR + RestMessages.SERVICEUNAVAILABLE.toString()); } INeutronFirewallPolicyCRUD firewallPolicyInterface = NeutronCRUDInterfaces.getINeutronFirewallPolicyCRUD(this); if (firewallPolicyInterface == null) { throw new ServiceUnavailableException(STR + RestMessages.SERVICEUNAVAILABLE.toString()); } if (input.isSingleton()) { NeutronFirewallRule singleton = input.getSingleton(); if (firewallRuleInterface.neutronFirewallRuleExists(singleton.getFirewallRuleUUID())) { throw new BadRequestException(STR); } firewallRuleInterface.addNeutronFirewallRule(singleton); Object[] instances = ServiceHelper.getGlobalInstances(INeutronFirewallRuleAware.class, this, null); if (instances != null) { for (Object instance : instances) { INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance; int status = service.canCreateNeutronFirewallRule(singleton); if (status < 200 status > 299) { return Response.status(status).build(); } } } singleton.initDefaults(); firewallRuleInterface.addNeutronFirewallRule(singleton); if (instances != null) { for (Object instance : instances) { INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance; service.neutronFirewallRuleCreated(singleton); } } } else { List<NeutronFirewallRule> bulk = input.getBulk(); Iterator<NeutronFirewallRule> i = bulk.iterator(); HashMap<String, NeutronFirewallRule> testMap = new HashMap<String, NeutronFirewallRule>(); Object[] instances = ServiceHelper.getGlobalInstances(INeutronFirewallRuleAware.class, this, null); while (i.hasNext()) { NeutronFirewallRule test = i.next(); if (firewallRuleInterface.neutronFirewallRuleExists(test.getFirewallRuleUUID())) { throw new BadRequestException(STR); } if (testMap.containsKey(test.getFirewallRuleUUID())) { throw new BadRequestException(STR); } if (instances != null) { for (Object instance : instances) { INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance; int status = service.canCreateNeutronFirewallRule(test); if (status < 200 status > 299) { return Response.status(status).build(); } } } } i = bulk.iterator(); while (i.hasNext()) { NeutronFirewallRule test = i.next(); firewallRuleInterface.addNeutronFirewallRule(test); if (instances != null) { for (Object instance : instances) { INeutronFirewallRuleAware service = (INeutronFirewallRuleAware) instance; service.neutronFirewallRuleCreated(test); } } } } return Response.status(201).entity(input).build(); }
/** * Creates new Firewall Rule */
Creates new Firewall Rule
createFirewallRules
{ "repo_name": "aryantaheri/controller", "path": "opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallRulesNorthbound.java", "license": "epl-1.0", "size": 20809 }
[ "java.util.HashMap", "java.util.Iterator", "java.util.List", "javax.ws.rs.Consumes", "javax.ws.rs.Produces", "javax.ws.rs.core.MediaType", "javax.ws.rs.core.Response", "org.codehaus.enunciate.jaxrs.ResponseCode", "org.codehaus.enunciate.jaxrs.StatusCodes", "org.opendaylight.controller.networkconfig.neutron.INeutronFirewallPolicyCRUD", "org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleAware", "org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleCRUD", "org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces", "org.opendaylight.controller.networkconfig.neutron.NeutronFirewallRule", "org.opendaylight.controller.northbound.commons.RestMessages", "org.opendaylight.controller.northbound.commons.exception.BadRequestException", "org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException", "org.opendaylight.controller.sal.utils.ServiceHelper" ]
import java.util.HashMap; import java.util.Iterator; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.codehaus.enunciate.jaxrs.ResponseCode; import org.codehaus.enunciate.jaxrs.StatusCodes; import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallPolicyCRUD; import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleAware; import org.opendaylight.controller.networkconfig.neutron.INeutronFirewallRuleCRUD; import org.opendaylight.controller.networkconfig.neutron.NeutronCRUDInterfaces; import org.opendaylight.controller.networkconfig.neutron.NeutronFirewallRule; import org.opendaylight.controller.northbound.commons.RestMessages; import org.opendaylight.controller.northbound.commons.exception.BadRequestException; import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException; import org.opendaylight.controller.sal.utils.ServiceHelper;
import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.codehaus.enunciate.jaxrs.*; import org.opendaylight.controller.networkconfig.neutron.*; import org.opendaylight.controller.northbound.commons.*; import org.opendaylight.controller.northbound.commons.exception.*; import org.opendaylight.controller.sal.utils.*;
[ "java.util", "javax.ws", "org.codehaus.enunciate", "org.opendaylight.controller" ]
java.util; javax.ws; org.codehaus.enunciate; org.opendaylight.controller;
1,394,646
public WorkflowElement getWorkflowElementAt(final int row) { if (row < 0 || row > getRowCount()) return null; return this.displayElements[row]; }
WorkflowElement function(final int row) { if (row < 0 row > getRowCount()) return null; return this.displayElements[row]; }
/** * Get the workflow element of a row * @param row the row being queried * @return The workflow element of the row */
Get the workflow element of a row
getWorkflowElementAt
{ "repo_name": "GenomicParisCentre/doelan", "path": "src/main/java/fr/ens/transcriptome/nividic/platform/workflow/gui/WorkflowTableAbstractModel.java", "license": "gpl-2.0", "size": 7359 }
[ "fr.ens.transcriptome.nividic.platform.workflow.WorkflowElement" ]
import fr.ens.transcriptome.nividic.platform.workflow.WorkflowElement;
import fr.ens.transcriptome.nividic.platform.workflow.*;
[ "fr.ens.transcriptome" ]
fr.ens.transcriptome;
104,729
@RequiredScope({modify}) @ResponseStatus(HttpStatus.OK) @RequestMapping(value = UrlHelpers.CHALLENGE_TEAM_CHAL_TEAM_ID, method = RequestMethod.DELETE) public void deleteChallengeTeam( @RequestParam(value = AuthorizationConstants.USER_ID_PARAM) Long userId, @PathVariable(value = UrlHelpers.CHALLENGE_TEAM_ID_PATH_VARIABLE) long challengeTeamId ) throws DatastoreException, NotFoundException { serviceProvider.getChallengeService().deleteChallengeTeam(userId, challengeTeamId); }
@RequiredScope({modify}) @ResponseStatus(HttpStatus.OK) @RequestMapping(value = UrlHelpers.CHALLENGE_TEAM_CHAL_TEAM_ID, method = RequestMethod.DELETE) void function( @RequestParam(value = AuthorizationConstants.USER_ID_PARAM) Long userId, @PathVariable(value = UrlHelpers.CHALLENGE_TEAM_ID_PATH_VARIABLE) long challengeTeamId ) throws DatastoreException, NotFoundException { serviceProvider.getChallengeService().deleteChallengeTeam(userId, challengeTeamId); }
/** * De-register a Team from a Challenge. You must be a member of the Challenge's * participant Team (i.e. you must be already registered for the Challenge) * and be an manager of the Team being de-registered. * * @param userId * @param challengeTeamId * @throws DatastoreException * @throws NotFoundException */
De-register a Team from a Challenge. You must be a member of the Challenge's participant Team (i.e. you must be already registered for the Challenge) and be an manager of the Team being de-registered
deleteChallengeTeam
{ "repo_name": "Sage-Bionetworks/Synapse-Repository-Services", "path": "services/repository/src/main/java/org/sagebionetworks/repo/web/controller/ChallengeController.java", "license": "apache-2.0", "size": 16074 }
[ "org.sagebionetworks.repo.model.AuthorizationConstants", "org.sagebionetworks.repo.model.DatastoreException", "org.sagebionetworks.repo.web.NotFoundException", "org.sagebionetworks.repo.web.RequiredScope", "org.sagebionetworks.repo.web.UrlHelpers", "org.springframework.http.HttpStatus", "org.springframework.web.bind.annotation.PathVariable", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod", "org.springframework.web.bind.annotation.RequestParam", "org.springframework.web.bind.annotation.ResponseStatus" ]
import org.sagebionetworks.repo.model.AuthorizationConstants; import org.sagebionetworks.repo.model.DatastoreException; import org.sagebionetworks.repo.web.NotFoundException; import org.sagebionetworks.repo.web.RequiredScope; import org.sagebionetworks.repo.web.UrlHelpers; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseStatus;
import org.sagebionetworks.repo.model.*; import org.sagebionetworks.repo.web.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*;
[ "org.sagebionetworks.repo", "org.springframework.http", "org.springframework.web" ]
org.sagebionetworks.repo; org.springframework.http; org.springframework.web;
2,264,532
@Override public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { return null; }
ChunkPosition function(World par1World, String par2Str, int par3, int par4, int par5) { return null; }
/** * Returns the location of the closest structure of the specified type. If not found returns null. */
Returns the location of the closest structure of the specified type. If not found returns null
findClosestStructure
{ "repo_name": "DirectCodeGraveyard/Minetweak", "path": "src/main/java/net/minecraft/world/chunk/ChunkProviderEnd.java", "license": "lgpl-3.0", "size": 13838 }
[ "net.minecraft.world.World" ]
import net.minecraft.world.World;
import net.minecraft.world.*;
[ "net.minecraft.world" ]
net.minecraft.world;
2,836,446
protected void setupService() throws Exception { // NOSONAR final DirectoryService service = this.getDirectoryService(); service.getChangeLog().setEnabled(false); this.workDir = getOuterRule().newFolder("dsworkdir"); service.setInstanceLayout(new InstanceLayout(this.workDir)); final CacheService cacheService = new CacheService(); cacheService.initialize(service.getInstanceLayout()); service.setCacheService(cacheService); service.setAccessControlEnabled(this.acEnabled); service.setAllowAnonymousAccess(this.anonymousAllowed); this.createPartitions(); this.importInitialLdif(); }
void function() throws Exception { final DirectoryService service = this.getDirectoryService(); service.getChangeLog().setEnabled(false); this.workDir = getOuterRule().newFolder(STR); service.setInstanceLayout(new InstanceLayout(this.workDir)); final CacheService cacheService = new CacheService(); cacheService.initialize(service.getInstanceLayout()); service.setCacheService(cacheService); service.setAccessControlEnabled(this.acEnabled); service.setAllowAnonymousAccess(this.anonymousAllowed); this.createPartitions(); this.importInitialLdif(); }
/** * Applies the configuration to the service such as AccessControl and AnonymousAccess. Both are enabled as * configured. Further, the method initializes the cache service. The method does not start the service. * * @throws Exception * if starting the directory service failed for any reason */
Applies the configuration to the service such as AccessControl and AnonymousAccess. Both are enabled as configured. Further, the method initializes the cache service. The method does not start the service
setupService
{ "repo_name": "rolandio/scribble", "path": "scribble-ldap/src/main/java/io/inkstand/scribble/rules/ldap/Directory.java", "license": "apache-2.0", "size": 12439 }
[ "org.apache.directory.server.core.api.CacheService", "org.apache.directory.server.core.api.DirectoryService", "org.apache.directory.server.core.api.InstanceLayout" ]
import org.apache.directory.server.core.api.CacheService; import org.apache.directory.server.core.api.DirectoryService; import org.apache.directory.server.core.api.InstanceLayout;
import org.apache.directory.server.core.api.*;
[ "org.apache.directory" ]
org.apache.directory;
1,828,001
public void pageUpPressed() { if (getModel().getRoot() == null || getSelectionModel().getSelectedNodes().isEmpty() || getModel().dataAdapter.getChildren(getModel().getRoot()).isEmpty()) { return; } D selected = getSelectionModel().getSelectedNodes().get(0); TreeNodeElement<D> selectedTreeNodeElement = getModel().dataAdapter.getRenderedTreeNode(selected); int rowHeight = selectedTreeNodeElement.getSelectionElement().getOffsetHeight(); int index = -1; List<TreeNodeElement<D>> visibleTreeNodes = getVisibleTreeNodes(); for (int i = 0; i < visibleTreeNodes.size(); i++) { TreeNodeElement<D> treeNode = visibleTreeNodes.get(i); if (treeNode == selectedTreeNodeElement) { index = i; break; } } if (index <= 0) { return; } int visibleAreaHeight = asWidget().getElement().getClientHeight(); int visibleRows = visibleAreaHeight / rowHeight; if (index > visibleRows) { selectSingleNode(visibleTreeNodes.get(index - visibleRows)); } else { selectSingleNode(visibleTreeNodes.get(0)); } }
void function() { if (getModel().getRoot() == null getSelectionModel().getSelectedNodes().isEmpty() getModel().dataAdapter.getChildren(getModel().getRoot()).isEmpty()) { return; } D selected = getSelectionModel().getSelectedNodes().get(0); TreeNodeElement<D> selectedTreeNodeElement = getModel().dataAdapter.getRenderedTreeNode(selected); int rowHeight = selectedTreeNodeElement.getSelectionElement().getOffsetHeight(); int index = -1; List<TreeNodeElement<D>> visibleTreeNodes = getVisibleTreeNodes(); for (int i = 0; i < visibleTreeNodes.size(); i++) { TreeNodeElement<D> treeNode = visibleTreeNodes.get(i); if (treeNode == selectedTreeNodeElement) { index = i; break; } } if (index <= 0) { return; } int visibleAreaHeight = asWidget().getElement().getClientHeight(); int visibleRows = visibleAreaHeight / rowHeight; if (index > visibleRows) { selectSingleNode(visibleTreeNodes.get(index - visibleRows)); } else { selectSingleNode(visibleTreeNodes.get(0)); } }
/** * Handles the pressing Page Up button. */
Handles the pressing Page Up button
pageUpPressed
{ "repo_name": "gazarenkov/che-sketch", "path": "ide/commons-gwt/src/main/java/org/eclipse/che/ide/ui/tree/Tree.java", "license": "epl-1.0", "size": 62875 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
71,284
protected static void lookupMethodResource(javax.naming.Context context, Object instance, Method method, String name) throws NamingException, IllegalAccessException, InvocationTargetException { if (!method.getName().startsWith("set") || method.getParameterTypes().length != 1 || !method.getReturnType().getName().equals("void")) { throw new IllegalArgumentException("Invalid method resource injection annotation"); } Object lookedupResource; if ((name != null) && (name.length() > 0)) { // TODO local or global JNDI lookedupResource = context.lookup(JAVA_COMP_ENV + name); } else { // TODO local or global JNDI lookedupResource = context.lookup(JAVA_COMP_ENV + instance.getClass().getName() + "/" + getFieldName(method)); } boolean accessibility = method.isAccessible(); method.setAccessible(true); method.invoke(instance, lookedupResource); method.setAccessible(accessibility); }
static void function(javax.naming.Context context, Object instance, Method method, String name) throws NamingException, IllegalAccessException, InvocationTargetException { if (!method.getName().startsWith("set") method.getParameterTypes().length != 1 !method.getReturnType().getName().equals("void")) { throw new IllegalArgumentException(STR); } Object lookedupResource; if ((name != null) && (name.length() > 0)) { lookedupResource = context.lookup(JAVA_COMP_ENV + name); } else { lookedupResource = context.lookup(JAVA_COMP_ENV + instance.getClass().getName() + "/" + getFieldName(method)); } boolean accessibility = method.isAccessible(); method.setAccessible(true); method.invoke(instance, lookedupResource); method.setAccessible(accessibility); }
/** * Inject resources in specified method. */
Inject resources in specified method
lookupMethodResource
{ "repo_name": "lu4242/ext-myfaces-2.0.2-patch", "path": "trunk/myfaces-impl-2021override/src/main/java/org/apache/myfaces/ov2021/config/annotation/ResourceAnnotationLifecycleProvider.java", "license": "apache-2.0", "size": 8601 }
[ "java.lang.reflect.InvocationTargetException", "java.lang.reflect.Method", "javax.naming.Context", "javax.naming.NamingException" ]
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import javax.naming.Context; import javax.naming.NamingException;
import java.lang.reflect.*; import javax.naming.*;
[ "java.lang", "javax.naming" ]
java.lang; javax.naming;
1,040,265
public static Document loadXMLString( String string, Boolean namespaceAware, Boolean deferNodeExpansion ) throws KettleXMLException { DocumentBuilder db = createDocumentBuilder( namespaceAware, deferNodeExpansion ); return loadXMLString( db, string ); }
static Document function( String string, Boolean namespaceAware, Boolean deferNodeExpansion ) throws KettleXMLException { DocumentBuilder db = createDocumentBuilder( namespaceAware, deferNodeExpansion ); return loadXMLString( db, string ); }
/** * Load a String into an XML document * * @param string * The XML text to load into a document * @param Boolean * true to defer node expansion, false to not defer. * @return the Document if all went well, null if an error occurred! */
Load a String into an XML document
loadXMLString
{ "repo_name": "IvanNikolaychuk/pentaho-kettle", "path": "core/src/org/pentaho/di/core/xml/XMLHandler.java", "license": "apache-2.0", "size": 37069 }
[ "javax.xml.parsers.DocumentBuilder", "org.pentaho.di.core.exception.KettleXMLException", "org.w3c.dom.Document" ]
import javax.xml.parsers.DocumentBuilder; import org.pentaho.di.core.exception.KettleXMLException; import org.w3c.dom.Document;
import javax.xml.parsers.*; import org.pentaho.di.core.exception.*; import org.w3c.dom.*;
[ "javax.xml", "org.pentaho.di", "org.w3c.dom" ]
javax.xml; org.pentaho.di; org.w3c.dom;
1,200,354
private void extractEPRInformation(SOAPHeaderBlock headerBlock, EndpointReference epr, String addressingNamespace, MessageContext messageContext) throws AxisFault { String namespace = null; try { namespace = EndpointReferenceHelper.fromOM(epr, headerBlock); } catch (AxisFault af) { if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { log.trace( "extractEPRInformation: Exception occurred deserialising an EndpointReference.", af); } AddressingFaultsHelper .triggerMissingAddressInEPRFault(messageContext, headerBlock.getLocalName()); } //Check that the EPR has the correct namespace. if (!namespace.equals(addressingNamespace)) { if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { log.trace( "extractEPRInformation: Addressing namespace = " + addressingNamespace + ", EPR namespace = " + namespace); } AddressingFaultsHelper .triggerInvalidEPRFault(messageContext, headerBlock.getLocalName()); } }
void function(SOAPHeaderBlock headerBlock, EndpointReference epr, String addressingNamespace, MessageContext messageContext) throws AxisFault { String namespace = null; try { namespace = EndpointReferenceHelper.fromOM(epr, headerBlock); } catch (AxisFault af) { if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { log.trace( STR, af); } AddressingFaultsHelper .triggerMissingAddressInEPRFault(messageContext, headerBlock.getLocalName()); } if (!namespace.equals(addressingNamespace)) { if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { log.trace( STR + addressingNamespace + STR + namespace); } AddressingFaultsHelper .triggerInvalidEPRFault(messageContext, headerBlock.getLocalName()); } }
/** * Given the soap header block, this should extract the information within EPR. * * @param headerBlock a SOAP header which is of type EndpointReference * @param epr the EndpointReference to fill in with the extracted data * @param addressingNamespace the WSA namespace URI * @param messageContext the active MessageContext * @throws AxisFault if there is a problem */
Given the soap header block, this should extract the information within EPR
extractEPRInformation
{ "repo_name": "intalio/axis2", "path": "modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java", "license": "apache-2.0", "size": 29244 }
[ "org.apache.axiom.soap.SOAPHeaderBlock", "org.apache.axis2.AxisFault", "org.apache.axis2.addressing.AddressingFaultsHelper", "org.apache.axis2.addressing.EndpointReference", "org.apache.axis2.addressing.EndpointReferenceHelper", "org.apache.axis2.context.MessageContext", "org.apache.axis2.util.LoggingControl" ]
import org.apache.axiom.soap.SOAPHeaderBlock; import org.apache.axis2.AxisFault; import org.apache.axis2.addressing.AddressingFaultsHelper; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.addressing.EndpointReferenceHelper; import org.apache.axis2.context.MessageContext; import org.apache.axis2.util.LoggingControl;
import org.apache.axiom.soap.*; import org.apache.axis2.*; import org.apache.axis2.addressing.*; import org.apache.axis2.context.*; import org.apache.axis2.util.*;
[ "org.apache.axiom", "org.apache.axis2" ]
org.apache.axiom; org.apache.axis2;
2,846,016
public void removeTask(EntityPlayer player, @Nullable Class <? extends IPlayerTask> clazz) { List<IPlayerTask> playerTasks = this.tasks.get(player.getUniqueID()); if (playerTasks == null) { return; } Iterator<IPlayerTask> taskIter = playerTasks.iterator(); Iterator<Timer> timerIter = this.timers.get(player.getUniqueID()).iterator(); while (taskIter.hasNext()) { IPlayerTask taskTmp = taskIter.next(); timerIter.next(); if (clazz == null || clazz.equals(taskTmp.getClass())) { taskTmp.stop(player); taskIter.remove(); timerIter.remove(); } } if (playerTasks.isEmpty()) { this.tasks.remove(player.getUniqueID()); this.timers.remove(player.getUniqueID()); } }
void function(EntityPlayer player, @Nullable Class <? extends IPlayerTask> clazz) { List<IPlayerTask> playerTasks = this.tasks.get(player.getUniqueID()); if (playerTasks == null) { return; } Iterator<IPlayerTask> taskIter = playerTasks.iterator(); Iterator<Timer> timerIter = this.timers.get(player.getUniqueID()).iterator(); while (taskIter.hasNext()) { IPlayerTask taskTmp = taskIter.next(); timerIter.next(); if (clazz == null clazz.equals(taskTmp.getClass())) { taskTmp.stop(player); taskIter.remove(); timerIter.remove(); } } if (playerTasks.isEmpty()) { this.tasks.remove(player.getUniqueID()); this.timers.remove(player.getUniqueID()); } }
/** * Remove all tasks matchin <b>clazz</b> from player <b>player</b>. * If <b>clazz</b> is null, then all tasks from <b>player</b> are removed. * @param player * @param clazz */
Remove all tasks matchin clazz from player player. If clazz is null, then all tasks from player are removed
removeTask
{ "repo_name": "maruohon/autoverse", "path": "src/main/java/fi/dy/masa/autoverse/event/tasks/scheduler/PlayerTaskScheduler.java", "license": "gpl-3.0", "size": 4774 }
[ "fi.dy.masa.autoverse.event.tasks.IPlayerTask", "java.util.Iterator", "java.util.List", "javax.annotation.Nullable", "net.minecraft.entity.player.EntityPlayer" ]
import fi.dy.masa.autoverse.event.tasks.IPlayerTask; import java.util.Iterator; import java.util.List; import javax.annotation.Nullable; import net.minecraft.entity.player.EntityPlayer;
import fi.dy.masa.autoverse.event.tasks.*; import java.util.*; import javax.annotation.*; import net.minecraft.entity.player.*;
[ "fi.dy.masa", "java.util", "javax.annotation", "net.minecraft.entity" ]
fi.dy.masa; java.util; javax.annotation; net.minecraft.entity;
1,840,001
private void writeIndent(Writer out, int depth) throws IOException { for (int i = 0; i < depth; i++) out.write("\t"); }
void function(Writer out, int depth) throws IOException { for (int i = 0; i < depth; i++) out.write("\t"); }
/** Convenience method: indent some number of spaces based on XML tag depth */
Convenience method: indent some number of spaces based on XML tag depth
writeIndent
{ "repo_name": "superzadeh/processdash", "path": "teamdash/src/teamdash/wbs/WBSDataWriter.java", "license": "gpl-3.0", "size": 33045 }
[ "java.io.IOException", "java.io.Writer" ]
import java.io.IOException; import java.io.Writer;
import java.io.*;
[ "java.io" ]
java.io;
2,060,468
public JspWriter popAndReleaseBody() throws IOException { BodyContentImpl body = (BodyContentImpl) getOut(); JspWriter out = popBody(); releaseBody(body); return out; }
JspWriter function() throws IOException { BodyContentImpl body = (BodyContentImpl) getOut(); JspWriter out = popBody(); releaseBody(body); return out; }
/** * Pops the BodyContent from the JspWriter stack. * * @return the enclosing writer */
Pops the BodyContent from the JspWriter stack
popAndReleaseBody
{ "repo_name": "mdaniel/svn-caucho-com-resin", "path": "modules/resin/src/com/caucho/jsp/PageContextImpl.java", "license": "gpl-2.0", "size": 53772 }
[ "java.io.IOException", "javax.servlet.jsp.JspWriter" ]
import java.io.IOException; import javax.servlet.jsp.JspWriter;
import java.io.*; import javax.servlet.jsp.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
2,164,236
public void setProjectionPreview(Object image) { if (image == null) { UserNotifier un = ImViewerAgent.getRegistry().getUserNotifier(); un.notifyInfo("Projection preview", "An error has occurred " + "while projecting the data."); return; } if (model.getTabbedIndex() != PROJECTION_INDEX) return; model.setRenderProjected(image); view.setLeftStatus(); view.setPlaneInfoStatus(); if (!model.isPlayingMovie() && !model.isPlayingChannelMovie()) { if (view.isLensVisible()) view.setLensPlaneImage(); view.createHistoryItem(model.getLastProjRef()); } fireStateChange(); }
void function(Object image) { if (image == null) { UserNotifier un = ImViewerAgent.getRegistry().getUserNotifier(); un.notifyInfo(STR, STR + STR); return; } if (model.getTabbedIndex() != PROJECTION_INDEX) return; model.setRenderProjected(image); view.setLeftStatus(); view.setPlaneInfoStatus(); if (!model.isPlayingMovie() && !model.isPlayingChannelMovie()) { if (view.isLensVisible()) view.setLensPlaneImage(); view.createHistoryItem(model.getLastProjRef()); } fireStateChange(); }
/** * Implemented as specified by the {@link ImViewer} interface. * @see ImViewer#setProjectionPreview(Object) */
Implemented as specified by the <code>ImViewer</code> interface
setProjectionPreview
{ "repo_name": "chris-allan/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java", "license": "gpl-2.0", "size": 95777 }
[ "org.openmicroscopy.shoola.agents.imviewer.ImViewerAgent", "org.openmicroscopy.shoola.env.ui.UserNotifier" ]
import org.openmicroscopy.shoola.agents.imviewer.ImViewerAgent; import org.openmicroscopy.shoola.env.ui.UserNotifier;
import org.openmicroscopy.shoola.agents.imviewer.*; import org.openmicroscopy.shoola.env.ui.*;
[ "org.openmicroscopy.shoola" ]
org.openmicroscopy.shoola;
2,259,163
public Count getOpenSubmissionsCountForTeamAdmin(UserInfo userInfo);
Count function(UserInfo userInfo);
/** * Retrieve all open request submissions for teams of which user is admin * * @param userInfo * @return */
Retrieve all open request submissions for teams of which user is admin
getOpenSubmissionsCountForTeamAdmin
{ "repo_name": "xschildw/Synapse-Repository-Services", "path": "services/repository-managers/src/main/java/org/sagebionetworks/repo/manager/team/MembershipRequestManager.java", "license": "apache-2.0", "size": 3661 }
[ "org.sagebionetworks.repo.model.Count", "org.sagebionetworks.repo.model.UserInfo" ]
import org.sagebionetworks.repo.model.Count; import org.sagebionetworks.repo.model.UserInfo;
import org.sagebionetworks.repo.model.*;
[ "org.sagebionetworks.repo" ]
org.sagebionetworks.repo;
522,011
public synchronized ArrayList<TradableDTO> getOrdersWithRemainingQty(String userName) throws Exception { ArrayList<TradableDTO> tradables = new ArrayList<>(); if (buyBook.getOrdersWithRemainingQty(userName) != null) { ArrayList<TradableDTO> tempBuy = buyBook.getOrdersWithRemainingQty(userName); tradables.addAll(tempBuy); } if (sellBook.getOrdersWithRemainingQty(userName) != null) { ArrayList<TradableDTO> tempSell = sellBook.getOrdersWithRemainingQty(userName); tradables.addAll(tempSell); } return tradables; }
synchronized ArrayList<TradableDTO> function(String userName) throws Exception { ArrayList<TradableDTO> tradables = new ArrayList<>(); if (buyBook.getOrdersWithRemainingQty(userName) != null) { ArrayList<TradableDTO> tempBuy = buyBook.getOrdersWithRemainingQty(userName); tradables.addAll(tempBuy); } if (sellBook.getOrdersWithRemainingQty(userName) != null) { ArrayList<TradableDTO> tempSell = sellBook.getOrdersWithRemainingQty(userName); tradables.addAll(tempSell); } return tradables; }
/** * This method will return an ArrayList containing any orders for the * specified user that have remaining quantity. * * @param userName of user * @return ArrayList of tradable DTO's * @throws Exception */
This method will return an ArrayList containing any orders for the specified user that have remaining quantity
getOrdersWithRemainingQty
{ "repo_name": "highlanderkev/StockExVirtuoso", "path": "src/book/ProductBook.java", "license": "mit", "size": 16804 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
538,910
@Override public RestartMode getRestartTaskOnError() { throw new RuntimeException("Not implemented: the restart task on error property is not available on client side."); }
RestartMode function() { throw new RuntimeException(STR); }
/** * This property is not available for this implementation. Calling this * method will throw a RuntimeException */
This property is not available for this implementation. Calling this method will throw a RuntimeException
getRestartTaskOnError
{ "repo_name": "laurianed/scheduling", "path": "scheduler/scheduler-client/src/main/java/org/ow2/proactive/scheduler/task/ClientTaskState.java", "license": "agpl-3.0", "size": 7509 }
[ "org.ow2.proactive.scheduler.common.task.RestartMode" ]
import org.ow2.proactive.scheduler.common.task.RestartMode;
import org.ow2.proactive.scheduler.common.task.*;
[ "org.ow2.proactive" ]
org.ow2.proactive;
129,959
public final Iterable<java.lang.Long> queryKeysByTitle(java.lang.String title) { final Filter filter = createEqualsFilter(COLUMN_NAME_TITLE, title); return queryIterableKeys(0, -1, null, null, null, false, null, false, filter); }
final Iterable<java.lang.Long> function(java.lang.String title) { final Filter filter = createEqualsFilter(COLUMN_NAME_TITLE, title); return queryIterableKeys(0, -1, null, null, null, false, null, false, filter); }
/** * query-key-by method for attribute field title * @param title the specified attribute * @return an Iterable of keys to the DmMeetings with the specified attribute */
query-key-by method for attribute field title
queryKeysByTitle
{ "repo_name": "goldengekko/Meetr-Backend", "path": "src/main/java/com/goldengekko/meetr/dao/GeneratedDmMeetingDaoImpl.java", "license": "gpl-3.0", "size": 68599 }
[ "net.sf.mardao.core.Filter" ]
import net.sf.mardao.core.Filter;
import net.sf.mardao.core.*;
[ "net.sf.mardao" ]
net.sf.mardao;
2,138,764
protected boolean isSpecialHandlingChanged(DisbursementVoucherDocument persistedDocument) { return persistedDocument.isDisbVchrSpecialHandlingCode() != getDisbursementVoucherDocumentForValidation().isDisbVchrSpecialHandlingCode(); }
boolean function(DisbursementVoucherDocument persistedDocument) { return persistedDocument.isDisbVchrSpecialHandlingCode() != getDisbursementVoucherDocumentForValidation().isDisbVchrSpecialHandlingCode(); }
/** * Determines if special handling was turned off from the DisbursementVoucherDocumentForValidation * @param persistedDocument the persisted version of the document * @return true if special handling was turned off, false otherwise */
Determines if special handling was turned off from the DisbursementVoucherDocumentForValidation
isSpecialHandlingChanged
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/fp/document/validation/impl/DisbursementVoucherCampusSpecialHandlingValidation.java", "license": "apache-2.0", "size": 7914 }
[ "org.kuali.kfs.fp.document.DisbursementVoucherDocument" ]
import org.kuali.kfs.fp.document.DisbursementVoucherDocument;
import org.kuali.kfs.fp.document.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
1,253,042
public final void setPlayerScores(final List<PlayerScoringDetails> playerScores) { this.playerScores = playerScores; }
final void function(final List<PlayerScoringDetails> playerScores) { this.playerScores = playerScores; }
/** * Sets the player scores. * * @param playerScores the new player scores */
Sets the player scores
setPlayerScores
{ "repo_name": "tiltedwindmills/mfl-api", "path": "src/main/java/org/tiltedwindmills/fantasy/mfl/model/livescoring/PlayerScoringWrapper.java", "license": "apache-2.0", "size": 1053 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,323,189
@Override public Application[] getApplications(Subscriber subscriber, String groupingId) throws APIManagementException { Application[] applications = apiMgtDAO.getApplications(subscriber, groupingId); for (Application application : applications) { Set<APIKey> keys = getApplicationKeys(application.getId()); for (APIKey key : keys) { application.addKey(key); } } return applications; }
Application[] function(Subscriber subscriber, String groupingId) throws APIManagementException { Application[] applications = apiMgtDAO.getApplications(subscriber, groupingId); for (Application application : applications) { Set<APIKey> keys = getApplicationKeys(application.getId()); for (APIKey key : keys) { application.addKey(key); } } return applications; }
/** * Returns all applications associated with given subscriber and groupingId. * * @param subscriber The subscriber. * @param groupingId The groupId to which the applications must belong. * @return Application[] Array of applications. * @throws APIManagementException */
Returns all applications associated with given subscriber and groupingId
getApplications
{ "repo_name": "pubudu538/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java", "license": "apache-2.0", "size": 278305 }
[ "java.util.Set", "org.wso2.carbon.apimgt.api.APIManagementException", "org.wso2.carbon.apimgt.api.model.APIKey", "org.wso2.carbon.apimgt.api.model.Application", "org.wso2.carbon.apimgt.api.model.Subscriber" ]
import java.util.Set; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.APIKey; import org.wso2.carbon.apimgt.api.model.Application; import org.wso2.carbon.apimgt.api.model.Subscriber;
import java.util.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
1,516,605
private void sendBinaryMessage(WebSocketMessage.BinaryMessage message) throws IOException, WebSocketException { if (message.mPayload.length > mWebSocketOptions.getMaxMessagePayloadSize()) { throw new WebSocketException("message payload exceeds payload limit"); } sendFrame(2, true, message.mPayload); }
void function(WebSocketMessage.BinaryMessage message) throws IOException, WebSocketException { if (message.mPayload.length > mWebSocketOptions.getMaxMessagePayloadSize()) { throw new WebSocketException(STR); } sendFrame(2, true, message.mPayload); }
/** * Send WebSockets binary message. */
Send WebSockets binary message
sendBinaryMessage
{ "repo_name": "lukasz-skalski/WebSocketsClient", "path": "app/src/main/java/com/skalski/websocketsclient/SecureWebSocktes/WebSocketWriter.java", "license": "gpl-3.0", "size": 13727 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,620,389
static private void setLocationStatus(Context c, @LocationStatus int locationStatus){ SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(c); SharedPreferences.Editor spe = sp.edit(); spe.putInt(c.getString(R.string.pref_location_status_key), locationStatus); spe.commit(); }
static void function(Context c, @LocationStatus int locationStatus){ SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(c); SharedPreferences.Editor spe = sp.edit(); spe.putInt(c.getString(R.string.pref_location_status_key), locationStatus); spe.commit(); }
/** * Sets the location status into shared preference. This function should not be called from * the UI thread because it uses commit to write to the shared preferences. * @param c Context to get the PreferenceManager from. * @param locationStatus The IntDef value to set */
Sets the location status into shared preference. This function should not be called from the UI thread because it uses commit to write to the shared preferences
setLocationStatus
{ "repo_name": "theeheng/GoUbiquitous", "path": "app/src/main/java/com/example/android/sunshine/app/sync/SunshineSyncAdapter.java", "license": "apache-2.0", "size": 31042 }
[ "android.content.Context", "android.content.SharedPreferences", "android.preference.PreferenceManager" ]
import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager;
import android.content.*; import android.preference.*;
[ "android.content", "android.preference" ]
android.content; android.preference;
2,898,342
@CloseDBIfOpened private BulkActionView buildBulkActionView (final SearchResponse response, final User user) throws DotDataException, DotSecurityException { final Set<String> archivedSchemes = workflowAPI.findArchivedSchemes().stream().map(WorkflowScheme::getId).collect(Collectors.toSet()); final Aggregations aggregations = response.getAggregations(); final Map<String, Long> stepCounts = new HashMap<>(); for (final Aggregation aggregation : aggregations.asList()) { if (aggregation instanceof ParsedStringTerms) { ((ParsedStringTerms) aggregation) .getBuckets().forEach( bucket -> stepCounts.put(bucket.getKeyAsString(), bucket.getDocCount()) ); } } final Map<CountWorkflowStep, List<WorkflowAction>> stepActionsMap = new HashMap<>(); for (final Map.Entry<String, Long> stepCount : stepCounts.entrySet()) { try { final WorkflowStep workflowStep = this.workflowAPI.findStep(stepCount.getKey()); if( archivedSchemes.contains(workflowStep.getSchemeId())){ Logger.info(getClass(),()-> "Step with id "+ stepCount.getKey() + " is linked with an Archived WF and will be skipped." ); continue; } final CountWorkflowStep step = new CountWorkflowStep(stepCount.getValue(), workflowStep); stepActionsMap.put(step, this.workflowAPI.findBulkActions(step.getWorkflowStep(), user) .stream().filter(WorkflowAction::shouldShowOnListing) .collect(CollectionsUtils.toImmutableList())); }catch (Exception e){ Logger.warn(getClass(),()-> "Unable to load step with id "+ stepCount.getKey() + " The index is slightly out of sync." ); } } return (stepCounts.size() > 0 ? this.buildBulkActionView(stepActionsMap) : new BulkActionView(Collections.emptyMap()) ); }
BulkActionView function (final SearchResponse response, final User user) throws DotDataException, DotSecurityException { final Set<String> archivedSchemes = workflowAPI.findArchivedSchemes().stream().map(WorkflowScheme::getId).collect(Collectors.toSet()); final Aggregations aggregations = response.getAggregations(); final Map<String, Long> stepCounts = new HashMap<>(); for (final Aggregation aggregation : aggregations.asList()) { if (aggregation instanceof ParsedStringTerms) { ((ParsedStringTerms) aggregation) .getBuckets().forEach( bucket -> stepCounts.put(bucket.getKeyAsString(), bucket.getDocCount()) ); } } final Map<CountWorkflowStep, List<WorkflowAction>> stepActionsMap = new HashMap<>(); for (final Map.Entry<String, Long> stepCount : stepCounts.entrySet()) { try { final WorkflowStep workflowStep = this.workflowAPI.findStep(stepCount.getKey()); if( archivedSchemes.contains(workflowStep.getSchemeId())){ Logger.info(getClass(),()-> STR+ stepCount.getKey() + STR ); continue; } final CountWorkflowStep step = new CountWorkflowStep(stepCount.getValue(), workflowStep); stepActionsMap.put(step, this.workflowAPI.findBulkActions(step.getWorkflowStep(), user) .stream().filter(WorkflowAction::shouldShowOnListing) .collect(CollectionsUtils.toImmutableList())); }catch (Exception e){ Logger.warn(getClass(),()-> STR+ stepCount.getKey() + STR ); } } return (stepCounts.size() > 0 ? this.buildBulkActionView(stepActionsMap) : new BulkActionView(Collections.emptyMap()) ); }
/** * Computes a view out of the results returned bylucene * @param response * @param user * @return * @throws DotDataException * @throws DotSecurityException */
Computes a view out of the results returned bylucene
buildBulkActionView
{ "repo_name": "dotCMS/core", "path": "dotCMS/src/main/java/com/dotcms/workflow/helper/WorkflowHelper.java", "license": "gpl-3.0", "size": 83329 }
[ "com.dotcms.rest.api.v1.workflow.BulkActionView", "com.dotcms.rest.api.v1.workflow.CountWorkflowStep", "com.dotcms.util.CollectionsUtils", "com.dotmarketing.exception.DotDataException", "com.dotmarketing.exception.DotSecurityException", "com.dotmarketing.portlets.workflows.model.WorkflowAction", "com.dotmarketing.portlets.workflows.model.WorkflowScheme", "com.dotmarketing.portlets.workflows.model.WorkflowStep", "com.dotmarketing.util.Logger", "com.liferay.portal.model.User", "java.util.Collections", "java.util.HashMap", "java.util.List", "java.util.Map", "java.util.Set", "java.util.stream.Collectors", "org.elasticsearch.action.search.SearchResponse", "org.elasticsearch.search.aggregations.Aggregation", "org.elasticsearch.search.aggregations.Aggregations", "org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms" ]
import com.dotcms.rest.api.v1.workflow.BulkActionView; import com.dotcms.rest.api.v1.workflow.CountWorkflowStep; import com.dotcms.util.CollectionsUtils; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotSecurityException; import com.dotmarketing.portlets.workflows.model.WorkflowAction; import com.dotmarketing.portlets.workflows.model.WorkflowScheme; import com.dotmarketing.portlets.workflows.model.WorkflowStep; import com.dotmarketing.util.Logger; import com.liferay.portal.model.User; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms;
import com.dotcms.rest.api.v1.workflow.*; import com.dotcms.util.*; import com.dotmarketing.exception.*; import com.dotmarketing.portlets.workflows.model.*; import com.dotmarketing.util.*; import com.liferay.portal.model.*; import java.util.*; import java.util.stream.*; import org.elasticsearch.action.search.*; import org.elasticsearch.search.aggregations.*; import org.elasticsearch.search.aggregations.bucket.terms.*;
[ "com.dotcms.rest", "com.dotcms.util", "com.dotmarketing.exception", "com.dotmarketing.portlets", "com.dotmarketing.util", "com.liferay.portal", "java.util", "org.elasticsearch.action", "org.elasticsearch.search" ]
com.dotcms.rest; com.dotcms.util; com.dotmarketing.exception; com.dotmarketing.portlets; com.dotmarketing.util; com.liferay.portal; java.util; org.elasticsearch.action; org.elasticsearch.search;
668,341
private static <K, V> boolean compareOrderedCollection(Collection<K> col1, Collection<V> col2, List<String> path, Deque<DualKey> toCompare, Set<DualKey> visited) { if (col1.size() != col2.size()) return false; Iterator<V> i2 = col2.iterator(); for (K k : col1) { DualKey dk = new DualKey(path, k, i2.next()); if (!visited.contains(dk)) toCompare.addFirst(dk); } return true; }
static <K, V> boolean function(Collection<K> col1, Collection<V> col2, List<String> path, Deque<DualKey> toCompare, Set<DualKey> visited) { if (col1.size() != col2.size()) return false; Iterator<V> i2 = col2.iterator(); for (K k : col1) { DualKey dk = new DualKey(path, k, i2.next()); if (!visited.contains(dk)) toCompare.addFirst(dk); } return true; }
/** * Deeply compare two Collections that must be same length and in same * order. * * @param <K> the key type * @param <V> the value type * @param col1 First collection of items to compare * @param col2 Second collection of items to compare * @param path The path to the collections * @param toCompare add items to compare to the Stack (Stack versus recursion) * @param visited * Set of objects already compared (prevents cycles) value of * 'true' indicates that the Collections may be equal, and the * sets items will be added to the Stack for further comparison. * * @return boolean false if the Collections are for certain not equals */
Deeply compare two Collections that must be same length and in same order
compareOrderedCollection
{ "repo_name": "hazendaz/assertj-core", "path": "src/main/java/org/assertj/core/internal/DeepDifference.java", "license": "apache-2.0", "size": 28976 }
[ "java.util.Collection", "java.util.Deque", "java.util.Iterator", "java.util.List", "java.util.Set" ]
import java.util.Collection; import java.util.Deque; import java.util.Iterator; import java.util.List; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,304,423
public static void setLongTimeouts(ReplicationConfig repConfig) { RepInternal.disableParameterValidation(repConfig); repConfig.setConfigParam(RepParams.ENV_SETUP_TIMEOUT.getName(), "1 h"); repConfig.setConfigParam(ReplicationConfig.ENV_CONSISTENCY_TIMEOUT, "1 h"); repConfig.setConfigParam(ReplicationConfig.REPLICA_ACK_TIMEOUT, "1 h"); repConfig.setConfigParam(RepParams.HEARTBEAT_INTERVAL.getName(), "5 min"); }
static void function(ReplicationConfig repConfig) { RepInternal.disableParameterValidation(repConfig); repConfig.setConfigParam(RepParams.ENV_SETUP_TIMEOUT.getName(), STR); repConfig.setConfigParam(ReplicationConfig.ENV_CONSISTENCY_TIMEOUT, STR); repConfig.setConfigParam(ReplicationConfig.REPLICA_ACK_TIMEOUT, STR); repConfig.setConfigParam(RepParams.HEARTBEAT_INTERVAL.getName(), STR); }
/** * Set timeouts to long intervals for debugging interactively */
Set timeouts to long intervals for debugging interactively
setLongTimeouts
{ "repo_name": "bjorndm/prebake", "path": "code/third_party/bdb/test/com/sleepycat/je/rep/utilint/RepTestUtils.java", "license": "apache-2.0", "size": 59150 }
[ "com.sleepycat.je.rep.RepInternal", "com.sleepycat.je.rep.ReplicationConfig", "com.sleepycat.je.rep.impl.RepParams" ]
import com.sleepycat.je.rep.RepInternal; import com.sleepycat.je.rep.ReplicationConfig; import com.sleepycat.je.rep.impl.RepParams;
import com.sleepycat.je.rep.*; import com.sleepycat.je.rep.impl.*;
[ "com.sleepycat.je" ]
com.sleepycat.je;
1,747,028
@Override public final void write(final double[] input, final double[] ideal, double significance) { if (this.expectSignificance) { final double[] record = new double[input.length + ideal.length + 1]; EngineArray.arrayCopy(input, record); EngineArray.arrayCopy(ideal, 0, record, input.length, ideal.length); record[record.length - 1] = significance; final StringBuilder result = new StringBuilder(); NumberList.toList(this.format, result, record); this.output.println(result.toString()); } else { final double[] record = new double[input.length + ideal.length]; EngineArray.arrayCopy(input, record); EngineArray.arrayCopy(ideal, 0, record, input.length, ideal.length); final StringBuilder result = new StringBuilder(); NumberList.toList(this.format, result, record); this.output.println(result.toString()); } }
final void function(final double[] input, final double[] ideal, double significance) { if (this.expectSignificance) { final double[] record = new double[input.length + ideal.length + 1]; EngineArray.arrayCopy(input, record); EngineArray.arrayCopy(ideal, 0, record, input.length, ideal.length); record[record.length - 1] = significance; final StringBuilder result = new StringBuilder(); NumberList.toList(this.format, result, record); this.output.println(result.toString()); } else { final double[] record = new double[input.length + ideal.length]; EngineArray.arrayCopy(input, record); EngineArray.arrayCopy(ideal, 0, record, input.length, ideal.length); final StringBuilder result = new StringBuilder(); NumberList.toList(this.format, result, record); this.output.println(result.toString()); } }
/** * Write one record of data to a CSV file. * * @param input * The input data array. * @param ideal * The ideal data array. */
Write one record of data to a CSV file
write
{ "repo_name": "larhoy/SentimentProjectV2", "path": "SentimentAnalysisV2/encog-core-3.1.0/src/main/java/org/encog/ml/data/buffer/codec/CSVDataCODEC.java", "license": "mit", "size": 6954 }
[ "org.encog.util.EngineArray", "org.encog.util.csv.NumberList" ]
import org.encog.util.EngineArray; import org.encog.util.csv.NumberList;
import org.encog.util.*; import org.encog.util.csv.*;
[ "org.encog.util" ]
org.encog.util;
13,628
void setRight(EObject value);
void setRight(EObject value);
/** * Sets the value of the '{@link xmodelica.modelica.Statement#getRight <em>Right</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Right</em>' containment reference. * @see #getRight() * @generated */
Sets the value of the '<code>xmodelica.modelica.Statement#getRight Right</code>' containment reference.
setRight
{ "repo_name": "jgoppert/xmodelica", "path": "xmodelica/src-gen/xmodelica/modelica/Statement.java", "license": "bsd-3-clause", "size": 5250 }
[ "org.eclipse.emf.ecore.EObject" ]
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,516,953
public Map<N, L> getChildrenWithLabels(N node) { return graph.getOutgoingEdges(node); }
Map<N, L> function(N node) { return graph.getOutgoingEdges(node); }
/** * Returns the children of the specified node along with the labels on the * children. * * @param node the node whose children are to be returned. * @return <tt>map</tt> with key as child node and value as the label on * the child node. * @throws IllegalArgumentException if the specified node is not present in * this tree. */
Returns the children of the specified node along with the labels on the children
getChildrenWithLabels
{ "repo_name": "NCIP/cab2b", "path": "software/dependencies/washucommons/cab2b_2009_mar_27_streamline/src/edu/wustl/common/util/Tree.java", "license": "bsd-3-clause", "size": 20607 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,543,611
private TargetNode<?, ?> processNode(TargetNode<?, ?> node) throws VersionException { // If we've already processed this node, exit now. TargetNode<?, ?> processed = index.get(node.getBuildTarget()); if (processed != null) { return processed; } // Add the node to the graph and recurse on its deps. TargetNode<?, ?> oldNode = indexPutIfAbsent(node); if (oldNode != null) { node = oldNode; } else { addNode(node); for (TargetNode<?, ?> dep : process(node.getDeps())) { addEdge(node, dep); } } return node; }
TargetNode<?, ?> function(TargetNode<?, ?> node) throws VersionException { TargetNode<?, ?> processed = index.get(node.getBuildTarget()); if (processed != null) { return processed; } TargetNode<?, ?> oldNode = indexPutIfAbsent(node); if (oldNode != null) { node = oldNode; } else { addNode(node); for (TargetNode<?, ?> dep : process(node.getDeps())) { addEdge(node, dep); } } return node; }
/** * Process a non-root node in the graph. */
Process a non-root node in the graph
processNode
{ "repo_name": "davido/buck", "path": "src/com/facebook/buck/versions/VersionedTargetGraphBuilder.java", "license": "apache-2.0", "size": 20293 }
[ "com.facebook.buck.rules.TargetNode" ]
import com.facebook.buck.rules.TargetNode;
import com.facebook.buck.rules.*;
[ "com.facebook.buck" ]
com.facebook.buck;
2,381,208