method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public List<String> convertToIpAddressList(String addressist) { List<String> listIpAddress = null; if (addressist != null && !addressist.isEmpty()) { StringTokenizer tkn = new StringTokenizer(addressist, ", \t\n\r\f"); listIpAddress = new ArrayList<String>(tkn.countTokens()); while (tkn.hasMoreTokens()) { String instance = tkn.nextToken(); listIpAddress.add(instance); } } return listIpAddress; }
List<String> function(String addressist) { List<String> listIpAddress = null; if (addressist != null && !addressist.isEmpty()) { StringTokenizer tkn = new StringTokenizer(addressist, STR); listIpAddress = new ArrayList<String>(tkn.countTokens()); while (tkn.hasMoreTokens()) { String instance = tkn.nextToken(); listIpAddress.add(instance); } } return listIpAddress; }
/** * Convert string of addresses to the address list. * * @param addressist */
Convert string of addresses to the address list
convertToIpAddressList
{ "repo_name": "nguyentienlong/community-edition", "path": "projects/repository/source/java/org/alfresco/filesys/config/CIFSConfigBean.java", "license": "lgpl-3.0", "size": 14434 }
[ "java.util.ArrayList", "java.util.List", "java.util.StringTokenizer" ]
import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer;
import java.util.*;
[ "java.util" ]
java.util;
2,135,362
public static List<GuardingDynamicLinker> loadLinkers(final ClassLoader cl) { return getLinkers(ServiceLoader.load(GuardingDynamicLinker.class, cl)); }
static List<GuardingDynamicLinker> function(final ClassLoader cl) { return getLinkers(ServiceLoader.load(GuardingDynamicLinker.class, cl)); }
/** * Discovers all guarding dynamic linkers listed in JAR files of the specified class loader. * * @param cl the class loader to use * @return a list of guarding dynamic linkers available through the specified class loader. Can be zero-length list * but not null. */
Discovers all guarding dynamic linkers listed in JAR files of the specified class loader
loadLinkers
{ "repo_name": "malaporte/kaziranga", "path": "src/jdk/internal/dynalink/support/AutoDiscovery.java", "license": "gpl-2.0", "size": 5945 }
[ "java.util.List", "java.util.ServiceLoader" ]
import java.util.List; import java.util.ServiceLoader;
import java.util.*;
[ "java.util" ]
java.util;
2,039,494
RestClient restClient();
RestClient restClient();
/** * Gets the REST client. * * @return the {@link RestClient} object. */
Gets the REST client
restClient
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/applicationinsights/microsoft-azure-applicationinsights-query/src/main/java/com/microsoft/azure/applicationinsights/query/ApplicationInsightsDataClient.java", "license": "mit", "size": 2990 }
[ "com.microsoft.rest.RestClient" ]
import com.microsoft.rest.RestClient;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
708,590
@Override public FieldSchema clone() throws CloneNotSupportedException { // Strings are immutable, so we don't need to copy alias. Schemas // are mutable so we need to make a copy. try { FieldSchema fs = new FieldSchema(alias, (schema == null ? null : schema.clone()), type); fs.canonicalName = CanonicalNamer.getNewName(); return fs; } catch (FrontendException fe) { throw new RuntimeException( "Should never fail to clone a FieldSchema", fe); } }
FieldSchema function() throws CloneNotSupportedException { try { FieldSchema fs = new FieldSchema(alias, (schema == null ? null : schema.clone()), type); fs.canonicalName = CanonicalNamer.getNewName(); return fs; } catch (FrontendException fe) { throw new RuntimeException( STR, fe); } }
/** * Make a deep copy of this FieldSchema and return it. * @return clone of the this FieldSchema. * @throws CloneNotSupportedException */
Make a deep copy of this FieldSchema and return it
clone
{ "repo_name": "kaituo/sedge", "path": "trunk/src/org/apache/pig/impl/logicalLayer/schema/Schema.java", "license": "mit", "size": 72734 }
[ "org.apache.pig.impl.logicalLayer.CanonicalNamer", "org.apache.pig.impl.logicalLayer.FrontendException" ]
import org.apache.pig.impl.logicalLayer.CanonicalNamer; import org.apache.pig.impl.logicalLayer.FrontendException;
import org.apache.pig.impl.*;
[ "org.apache.pig" ]
org.apache.pig;
1,125,478
@MXBeanDescription("Total processed messages count.") public int getTotalProcessedMessages();
@MXBeanDescription(STR) int function();
/** * Gets total processed messages count. * * @return Total processed messages count. */
Gets total processed messages count
getTotalProcessedMessages
{ "repo_name": "ilantukh/ignite", "path": "modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiMBean.java", "license": "apache-2.0", "size": 8612 }
[ "org.apache.ignite.mxbean.MXBeanDescription" ]
import org.apache.ignite.mxbean.MXBeanDescription;
import org.apache.ignite.mxbean.*;
[ "org.apache.ignite" ]
org.apache.ignite;
443,073
JobEntity createExecutableJobFromOtherJob(AbstractRuntimeJobEntity job);
JobEntity createExecutableJobFromOtherJob(AbstractRuntimeJobEntity job);
/** * Create an executable job from another job */
Create an executable job from another job
createExecutableJobFromOtherJob
{ "repo_name": "paulstapleton/flowable-engine", "path": "modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/asyncexecutor/JobManager.java", "license": "apache-2.0", "size": 7343 }
[ "org.flowable.job.service.impl.persistence.entity.AbstractRuntimeJobEntity", "org.flowable.job.service.impl.persistence.entity.JobEntity" ]
import org.flowable.job.service.impl.persistence.entity.AbstractRuntimeJobEntity; import org.flowable.job.service.impl.persistence.entity.JobEntity;
import org.flowable.job.service.impl.persistence.entity.*;
[ "org.flowable.job" ]
org.flowable.job;
590,608
public LegendItemCollection getLegendItems() { if (this.plot == null) { return new LegendItemCollection(); } LegendItemCollection result = new LegendItemCollection(); int index = this.plot.getIndexOf(this); XYDataset dataset = this.plot.getDataset(index); if (dataset != null) { int seriesCount = dataset.getSeriesCount(); for (int i = 0; i < seriesCount; i++) { if (isSeriesVisibleInLegend(i)) { LegendItem item = getLegendItem(index, i); if (item != null) { result.add(item); } } } } return result; }
LegendItemCollection function() { if (this.plot == null) { return new LegendItemCollection(); } LegendItemCollection result = new LegendItemCollection(); int index = this.plot.getIndexOf(this); XYDataset dataset = this.plot.getDataset(index); if (dataset != null) { int seriesCount = dataset.getSeriesCount(); for (int i = 0; i < seriesCount; i++) { if (isSeriesVisibleInLegend(i)) { LegendItem item = getLegendItem(index, i); if (item != null) { result.add(item); } } } } return result; }
/** * Returns a (possibly empty) collection of legend items for the series * that this renderer is responsible for drawing. * * @return The legend item collection (never <code>null</code>). */
Returns a (possibly empty) collection of legend items for the series that this renderer is responsible for drawing
getLegendItems
{ "repo_name": "apetresc/JFreeChart", "path": "src/main/java/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java", "license": "lgpl-2.1", "size": 74987 }
[ "org.jfree.chart.LegendItem", "org.jfree.chart.LegendItemCollection", "org.jfree.data.xy.XYDataset" ]
import org.jfree.chart.LegendItem; import org.jfree.chart.LegendItemCollection; import org.jfree.data.xy.XYDataset;
import org.jfree.chart.*; import org.jfree.data.xy.*;
[ "org.jfree.chart", "org.jfree.data" ]
org.jfree.chart; org.jfree.data;
717,964
ViewLifecyclePhase buildPhase(String viewPhase, LifecycleElement element, Component parent, String parentPath, List<String> refreshPaths);
ViewLifecyclePhase buildPhase(String viewPhase, LifecycleElement element, Component parent, String parentPath, List<String> refreshPaths);
/** * Creates a lifecycle phase instance for a specific component in the current lifecycle. * * @param viewPhase view phase to build an instance for * @param element lifecycle element to build an instance for * @param parent parent component * @param parentPath path relative to the parent component referring to the lifecycle element * @return phase instance */
Creates a lifecycle phase instance for a specific component in the current lifecycle
buildPhase
{ "repo_name": "jruchcolo/rice-cd", "path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/uif/lifecycle/ViewLifecyclePhaseBuilder.java", "license": "apache-2.0", "size": 2150 }
[ "java.util.List", "org.kuali.rice.krad.uif.component.Component", "org.kuali.rice.krad.uif.util.LifecycleElement" ]
import java.util.List; import org.kuali.rice.krad.uif.component.Component; import org.kuali.rice.krad.uif.util.LifecycleElement;
import java.util.*; import org.kuali.rice.krad.uif.component.*; import org.kuali.rice.krad.uif.util.*;
[ "java.util", "org.kuali.rice" ]
java.util; org.kuali.rice;
2,604,184
public static void rename(IBinding oldName, String newName) { oldName = getBindingDeclaration(oldName); String previousName = instance.renamings.get(oldName); if (previousName != null && !previousName.equals(newName)) { logger.fine(String.format("Changing previous rename: %s => %s, now: %s => %s", oldName.toString(), previousName, oldName, newName)); } instance.renamings.put(oldName, newName); }
static void function(IBinding oldName, String newName) { oldName = getBindingDeclaration(oldName); String previousName = instance.renamings.get(oldName); if (previousName != null && !previousName.equals(newName)) { logger.fine(String.format(STR, oldName.toString(), previousName, oldName, newName)); } instance.renamings.put(oldName, newName); }
/** * Adds a name to the renamings map, used by getName(). */
Adds a name to the renamings map, used by getName()
rename
{ "repo_name": "jiachenning/j2objc", "path": "translator/src/main/java/com/google/devtools/j2objc/util/NameTable.java", "license": "apache-2.0", "size": 27742 }
[ "org.eclipse.jdt.core.dom.IBinding" ]
import org.eclipse.jdt.core.dom.IBinding;
import org.eclipse.jdt.core.dom.*;
[ "org.eclipse.jdt" ]
org.eclipse.jdt;
1,874,591
public HashMap<String, Section> getSections() { return mSections; }
HashMap<String, Section> function() { return mSections; }
/** * Returns an iterator over the section names available in the INI file. * * @return an iterator over the section names */
Returns an iterator over the section names available in the INI file
getSections
{ "repo_name": "Caleydo/caleydo", "path": "org.caleydo.core/src/org/caleydo/core/serialize/INIParser.java", "license": "bsd-3-clause", "size": 9389 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,451,673
private List<Dependency> getDependents (Provider p) throws StandardException { List<Dependency> deps = new ArrayList<Dependency>(); synchronized (this) { List<Dependency> memDeps = providers.get(p.getObjectID()); if (memDeps != null) { deps.addAll(memDeps); } } // If the provider is persistent, then we have to add providers for // stored dependencies as well. if (p.isPersistent()) { List<Dependency> storedList = getDependencyDescriptorList ( dd.getProvidersDescriptorList( p.getObjectID().toString() ), p ); deps.addAll(storedList); } return deps; }
List<Dependency> function (Provider p) throws StandardException { List<Dependency> deps = new ArrayList<Dependency>(); synchronized (this) { List<Dependency> memDeps = providers.get(p.getObjectID()); if (memDeps != null) { deps.addAll(memDeps); } } if (p.isPersistent()) { List<Dependency> storedList = getDependencyDescriptorList ( dd.getProvidersDescriptorList( p.getObjectID().toString() ), p ); deps.addAll(storedList); } return deps; }
/** * Returns an enumeration of all dependencies that this * provider is supporting for any dependent at all (even * invalid ones). Includes all dependency types. * * @param p the provider * @return A list of dependents (possibly empty). * @throws StandardException if something goes wrong */
Returns an enumeration of all dependencies that this provider is supporting for any dependent at all (even invalid ones). Includes all dependency types
getDependents
{ "repo_name": "apache/derby", "path": "java/org.apache.derby.engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java", "license": "apache-2.0", "size": 35824 }
[ "java.util.ArrayList", "java.util.List", "org.apache.derby.iapi.sql.depend.Dependency", "org.apache.derby.iapi.sql.depend.Provider", "org.apache.derby.shared.common.error.StandardException" ]
import java.util.ArrayList; import java.util.List; import org.apache.derby.iapi.sql.depend.Dependency; import org.apache.derby.iapi.sql.depend.Provider; import org.apache.derby.shared.common.error.StandardException;
import java.util.*; import org.apache.derby.iapi.sql.depend.*; import org.apache.derby.shared.common.error.*;
[ "java.util", "org.apache.derby" ]
java.util; org.apache.derby;
47,535
private void removeBorderColors(CellRangeAddress range) { Set<String> properties = new HashSet<String>(); properties.add(CellUtil.TOP_BORDER_COLOR); properties.add(CellUtil.BOTTOM_BORDER_COLOR); properties.add(CellUtil.LEFT_BORDER_COLOR); properties.add(CellUtil.RIGHT_BORDER_COLOR); for (int row = range.getFirstRow(); row <= range.getLastRow(); row++) { for (int col = range.getFirstColumn(); col <= range .getLastColumn(); col++) { removeProperties(row, col, properties); } } }
void function(CellRangeAddress range) { Set<String> properties = new HashSet<String>(); properties.add(CellUtil.TOP_BORDER_COLOR); properties.add(CellUtil.BOTTOM_BORDER_COLOR); properties.add(CellUtil.LEFT_BORDER_COLOR); properties.add(CellUtil.RIGHT_BORDER_COLOR); for (int row = range.getFirstRow(); row <= range.getLastRow(); row++) { for (int col = range.getFirstColumn(); col <= range .getLastColumn(); col++) { removeProperties(row, col, properties); } } }
/** * Removes all border properties from this {@link PropertyTemplate} for the * specified range. * * @parm range - {@link CellRangeAddress} range of cells to remove borders. */
Removes all border properties from this <code>PropertyTemplate</code> for the specified range
removeBorderColors
{ "repo_name": "lvweiwolf/poi-3.16", "path": "src/java/org/apache/poi/ss/util/PropertyTemplate.java", "license": "apache-2.0", "size": 34382 }
[ "java.util.HashSet", "java.util.Set" ]
import java.util.HashSet; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,604,498
private void calculateParentGoal(String strategyId) { List<String> parentList = linkManager.getSource(strategyId); if (parentList != null) { for (String parentId : parentList) { NodeInfo parentNode = linkManager.getNodeInfo(parentId); NodeType type = parentNode.getNodeType(); if (type == NodeType.GOAL || type == NodeType.SYSTEM) { calculate(parentId); } } } }
void function(String strategyId) { List<String> parentList = linkManager.getSource(strategyId); if (parentList != null) { for (String parentId : parentList) { NodeInfo parentNode = linkManager.getNodeInfo(parentId); NodeType type = parentNode.getNodeType(); if (type == NodeType.GOAL type == NodeType.SYSTEM) { calculate(parentId); } } } }
/** * Calculates the score of a parents. * * @param strategyId the ID of the Strategy node. */
Calculates the score of a parents
calculateParentGoal
{ "repo_name": "kuriking/testdc2", "path": "net.dependableos.dcase.diagram.editor/src/net/dependableos/dcase/diagram/editor/logic/assessment/Assessment.java", "license": "epl-1.0", "size": 8624 }
[ "java.util.List", "net.dependableos.dcase.diagram.common.model.NodeInfo", "net.dependableos.dcase.diagram.common.model.NodeType" ]
import java.util.List; import net.dependableos.dcase.diagram.common.model.NodeInfo; import net.dependableos.dcase.diagram.common.model.NodeType;
import java.util.*; import net.dependableos.dcase.diagram.common.model.*;
[ "java.util", "net.dependableos.dcase" ]
java.util; net.dependableos.dcase;
2,053,283
public static final void render(Graphics2D g, Slice slice, double scale, Color color) { double radius = slice.getSliceRadius(); double theta2 = slice.getTheta() * 0.5; // get the local rotation and translation double rotation = slice.getRotation(); Vector2 circleCenter = slice.getCircleCenter(); // save the old transform AffineTransform oTransform = g.getTransform(); // translate and rotate g.translate(circleCenter.x * scale, circleCenter.y * scale); g.rotate(rotation); // to draw the arc, java2d wants the top left x,y // as if you were drawing a circle Arc2D a = new Arc2D.Double(-radius * scale, -radius * scale, 2.0 * radius * scale, 2.0 * radius * scale, -Math.toDegrees(theta2), Math.toDegrees(2.0 * theta2), Arc2D.PIE); // fill the shape g.setColor(color); g.fill(a); // draw the outline g.setColor(getOutlineColor(color)); g.draw(a); // re-instate the old transform g.setTransform(oTransform); }
static final void function(Graphics2D g, Slice slice, double scale, Color color) { double radius = slice.getSliceRadius(); double theta2 = slice.getTheta() * 0.5; double rotation = slice.getRotation(); Vector2 circleCenter = slice.getCircleCenter(); AffineTransform oTransform = g.getTransform(); g.translate(circleCenter.x * scale, circleCenter.y * scale); g.rotate(rotation); Arc2D a = new Arc2D.Double(-radius * scale, -radius * scale, 2.0 * radius * scale, 2.0 * radius * scale, -Math.toDegrees(theta2), Math.toDegrees(2.0 * theta2), Arc2D.PIE); g.setColor(color); g.fill(a); g.setColor(getOutlineColor(color)); g.draw(a); g.setTransform(oTransform); }
/** * Renders the given {@link Slice} to the given graphics context using the given scale and color. * @param g the graphics context * @param slice the slice to render * @param scale the scale to render the shape (pixels per dyn4j unit (typically meter)) * @param color the color */
Renders the given <code>Slice</code> to the given graphics context using the given scale and color
render
{ "repo_name": "yenbekbay/wordie", "path": "src/kz/yenbekbay/Wordie/Box/Graphics2DRenderer.java", "license": "mit", "size": 11774 }
[ "java.awt.Color", "java.awt.Graphics2D", "java.awt.geom.AffineTransform", "java.awt.geom.Arc2D", "org.dyn4j.geometry.Slice", "org.dyn4j.geometry.Vector2" ]
import java.awt.Color; import java.awt.Graphics2D; import java.awt.geom.AffineTransform; import java.awt.geom.Arc2D; import org.dyn4j.geometry.Slice; import org.dyn4j.geometry.Vector2;
import java.awt.*; import java.awt.geom.*; import org.dyn4j.geometry.*;
[ "java.awt", "org.dyn4j.geometry" ]
java.awt; org.dyn4j.geometry;
1,338,616
void checkout(CheckoutRequest request) throws GitException;
void checkout(CheckoutRequest request) throws GitException;
/** * Checkout a branch / file to the working tree. * * @param request * checkout request * @throws GitException * if any error occurs when checkout * @see CheckoutRequest */
Checkout a branch / file to the working tree
checkout
{ "repo_name": "dhuebner/che", "path": "wsagent/che-core-api-git/src/main/java/org/eclipse/che/api/git/GitConnection.java", "license": "epl-1.0", "size": 15360 }
[ "org.eclipse.che.api.git.shared.CheckoutRequest" ]
import org.eclipse.che.api.git.shared.CheckoutRequest;
import org.eclipse.che.api.git.shared.*;
[ "org.eclipse.che" ]
org.eclipse.che;
134,596
public Dimension maximumLayoutSize(Container target) { return preferredLayoutSize(target); }
Dimension function(Container target) { return preferredLayoutSize(target); }
/** * DOCUMENT ME! * * @param target DOCUMENT ME! * * @return DOCUMENT ME! */
DOCUMENT ME
maximumLayoutSize
{ "repo_name": "aosm/gcc_40", "path": "libjava/javax/swing/JRootPane.java", "license": "gpl-2.0", "size": 12772 }
[ "java.awt.Container", "java.awt.Dimension" ]
import java.awt.Container; import java.awt.Dimension;
import java.awt.*;
[ "java.awt" ]
java.awt;
449,118
public boolean supportsUnionAll() throws SQLException { if (JdbcDebugCfg.entryActive) debug[methodId_supportsUnionAll].methodEntry(); try { return true; } finally { if (JdbcDebugCfg.entryActive) debug[methodId_supportsUnionAll].methodExit(); } }
boolean function() throws SQLException { if (JdbcDebugCfg.entryActive) debug[methodId_supportsUnionAll].methodEntry(); try { return true; } finally { if (JdbcDebugCfg.entryActive) debug[methodId_supportsUnionAll].methodExit(); } }
/** * Retrieves whether this database supports SQL UNION ALL. * * @return true * @throws SQLException * - if a database access error occurs **/
Retrieves whether this database supports SQL UNION ALL
supportsUnionAll
{ "repo_name": "mashengchen/incubator-trafodion", "path": "core/conn/jdbc_type2/src/main/java/org/apache/trafodion/jdbc/t2/SQLMXDatabaseMetaData.java", "license": "apache-2.0", "size": 191582 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,236,261
private void sendFinishMessage() { //sends notification - node has finished sendMessage(Message.createNodeFinishedMessage(this)); }
void function() { sendMessage(Message.createNodeFinishedMessage(this)); }
/** * This method should be called every time when node finishes its work. */
This method should be called every time when node finishes its work
sendFinishMessage
{ "repo_name": "CloverETL/CloverETL-Engine", "path": "cloveretl.engine/src/org/jetel/graph/Node.java", "license": "lgpl-2.1", "size": 57962 }
[ "org.jetel.graph.runtime.Message" ]
import org.jetel.graph.runtime.Message;
import org.jetel.graph.runtime.*;
[ "org.jetel.graph" ]
org.jetel.graph;
1,339,214
@GET @Produces({"text/html"}) public Response getUsage(@Context HttpHeaders headers, @Context UriInfo ui) throws IOException{ String entity = "<h2>Usage of calculator</h2><br>" + "<ul>" + "<li><b>calculator/add/{a}/{b}</b> - add {a} to {b}</li>" + "<li><b>calculator/subtract/{a}/{b}</b> - subtract {a} from {b}</li>" + "<li><b>calculator/multiply/{a}/{b}</b> - multiply {a} with {b}</li>" + "<li><b>calculator/divide/{a}/{b}</b> - divide {a} by {b}</li>" + "</ul>" ; return Response.ok(entity).type("text/html").build(); }
@Produces({STR}) Response function(@Context HttpHeaders headers, @Context UriInfo ui) throws IOException{ String entity = STR + "<ul>" + STR + STR + STR + STR + "</ul>" ; return Response.ok(entity).type(STR).build(); }
/** * Handles: GET /calculator Get the calculator usage. * * @param headers http headers * @param ui uri info * * @return the response including the usage of the calculator resource */
Handles: GET /calculator Get the calculator usage
getUsage
{ "repo_name": "arenadata/ambari", "path": "ambari-views/examples/calculator-view/src/main/java/org/apache/ambari/view/proxy/CalculatorResource.java", "license": "apache-2.0", "size": 4141 }
[ "java.io.IOException", "javax.ws.rs.Produces", "javax.ws.rs.core.Context", "javax.ws.rs.core.HttpHeaders", "javax.ws.rs.core.Response", "javax.ws.rs.core.UriInfo" ]
import java.io.IOException; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo;
import java.io.*; import javax.ws.rs.*; import javax.ws.rs.core.*;
[ "java.io", "javax.ws" ]
java.io; javax.ws;
374,153
public Map<String, JRVariable> getVariablesMap() { return variablesMap; }
Map<String, JRVariable> function() { return variablesMap; }
/** * Returns the map of variable, including build-in ones, indexed by name. * * @return {@link JRVariable JRVariable} objects indexed by name */
Returns the map of variable, including build-in ones, indexed by name
getVariablesMap
{ "repo_name": "sikachu/jasperreports", "path": "src/net/sf/jasperreports/engine/design/JRDesignDataset.java", "license": "lgpl-3.0", "size": 37999 }
[ "java.util.Map", "net.sf.jasperreports.engine.JRVariable" ]
import java.util.Map; import net.sf.jasperreports.engine.JRVariable;
import java.util.*; import net.sf.jasperreports.engine.*;
[ "java.util", "net.sf.jasperreports" ]
java.util; net.sf.jasperreports;
1,280,429
public static IInternalInterface getSystemInterface() { try { return IInternalInterface.Stub.asInterface( (IBinder) Class.forName("android.os.ServiceManager") .getMethod("getService", String.class) .invoke(null, ModuleInit.SYSTEM_SERVICE_NAME) ); } catch (Exception e) { throw new RuntimeException(e); } }
static IInternalInterface function() { try { return IInternalInterface.Stub.asInterface( (IBinder) Class.forName(STR) .getMethod(STR, String.class) .invoke(null, ModuleInit.SYSTEM_SERVICE_NAME) ); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Get SystemService interface * * This doesn't rely on XposedBridge library */
Get SystemService interface This doesn't rely on XposedBridge library
getSystemInterface
{ "repo_name": "michalbednarski/IntentsLab", "path": "XposedHooks/src/main/java/com/github/michalbednarski/intentslab/xposedhooks/internal/XHUtils.java", "license": "gpl-3.0", "size": 9103 }
[ "android.os.IBinder" ]
import android.os.IBinder;
import android.os.*;
[ "android.os" ]
android.os;
1,585,451
default AdvancedStubEndpointBuilder queue(BlockingQueue queue) { doSetProperty("queue", queue); return this; }
default AdvancedStubEndpointBuilder queue(BlockingQueue queue) { doSetProperty("queue", queue); return this; }
/** * Define the queue instance which will be used by the endpoint. * * The option is a: <code>java.util.concurrent.BlockingQueue</code> * type. * * Group: advanced */
Define the queue instance which will be used by the endpoint. The option is a: <code>java.util.concurrent.BlockingQueue</code> type. Group: advanced
queue
{ "repo_name": "ullgren/camel", "path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/StubEndpointBuilderFactory.java", "license": "apache-2.0", "size": 37671 }
[ "java.util.concurrent.BlockingQueue" ]
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,737,434
public static String getNodeOrNodeSourceDescriptor(String nodeId, String foreignSource, String foreignId) { if (!Strings.isNullOrEmpty(foreignSource) && !Strings.isNullOrEmpty(foreignId)) { return String.format("nodeSource[%s:%s]", foreignSource, foreignId); } return String.format("node[%s]", nodeId); }
static String function(String nodeId, String foreignSource, String foreignId) { if (!Strings.isNullOrEmpty(foreignSource) && !Strings.isNullOrEmpty(foreignId)) { return String.format(STR, foreignSource, foreignId); } return String.format(STR, nodeId); }
/** * Returns the descriptor of the node or node source, depending on the input parameters (e.g. node[&lt;nodeId&gt;] or nodeSource[&lt;foreignSource&gt;:&lt;foreignId&gt;]. * * @param nodeId * @param foreignSource * @param foreignId * @return the descriptor of the node or node source, depending on the input parameters (e.g. node[&lt;nodeId&gt;] or nodeSource[&lt;foreignSource&gt;:&lt;foreignId&gt;]. */
Returns the descriptor of the node or node source, depending on the input parameters (e.g. node[&lt;nodeId&gt;] or nodeSource[&lt;foreignSource&gt;:&lt;foreignId&gt;]
getNodeOrNodeSourceDescriptor
{ "repo_name": "aihua/opennms", "path": "integrations/opennms-jasper-extensions/src/main/java/org/opennms/netmgt/jasper/helper/MeasurementsHelper.java", "license": "agpl-3.0", "size": 3807 }
[ "com.google.common.base.Strings" ]
import com.google.common.base.Strings;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
717,006
public DTDHandler getDTDHandler() { return null; }
DTDHandler function() { return null; }
/** * Not supported. * * @see org.xml.sax.XMLReader#getDTDHandler() */
Not supported
getDTDHandler
{ "repo_name": "NCIP/cadsr-cgmdr-nci-uk", "path": "src/org/exist/cocoon/XMLReaderWrapper.java", "license": "bsd-3-clause", "size": 4868 }
[ "org.xml.sax.DTDHandler" ]
import org.xml.sax.DTDHandler;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
798,985
@Override public Adapter createAdapter(Notifier target) { return modelSwitch.doSwitch((EObject)target); }
Adapter function(Notifier target) { return modelSwitch.doSwitch((EObject)target); }
/** * Creates an adapter for the <code>target</code>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param target the object to adapt. * @return the adapter for the <code>target</code>. * @generated */
Creates an adapter for the <code>target</code>.
createAdapter
{ "repo_name": "lunifera/lunifera-ecview", "path": "org.lunifera.ecview.core.extension.model/src/org/lunifera/ecview/core/extension/model/datatypes/util/ExtDatatypesAdapterFactory.java", "license": "epl-1.0", "size": 20233 }
[ "org.eclipse.emf.common.notify.Adapter", "org.eclipse.emf.common.notify.Notifier", "org.eclipse.emf.ecore.EObject" ]
import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notifier; import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.common.notify.*; import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,878,596
protected Users search(String userStatus) throws SQLException { users = new Users(); try { searchUser = connect.prepareStatement("SELECT user_id, user_inscription_date, " + "user_status, user_alias, user_mail, user_afpa " + "FROM cdi_user " + "WHERE user_status = ?"); searchUser.setString(1, userStatus); requestRes = searchUser.executeQuery(); while(requestRes.next()){ userId = requestRes.getInt(1); userInscriptionDate = requestRes.getString(2); userStatus = requestRes.getString(3); userAlias = requestRes.getString(4); userMail = requestRes.getString(5); userAfpa = requestRes.getString(6); switch (userStatus) { case "Stagiaire" : user = new Trainee(userId, userInscriptionDate, userStatus, userAlias, userMail, userAfpa); users.add(user); break; case "Ancien" : user = new FormerTrainee(userId, userInscriptionDate, userStatus, userAlias, userMail, userAfpa); users.add(user); break; case "Formateur" : user = new Trainer(userId, userInscriptionDate, userStatus, userAlias, userMail, userAfpa); users.add(user); break; default: System.out.println("Aucun utilisateur à afficher."); break; } } } catch (SQLException e) { e.printStackTrace(); System.err.println("Requête incorrecte : aucun auteur n'a pu être affiché."); } finally { closeRequest(searchUser); } return users; }
Users function(String userStatus) throws SQLException { users = new Users(); try { searchUser = connect.prepareStatement(STR + STR + STR + STR); searchUser.setString(1, userStatus); requestRes = searchUser.executeQuery(); while(requestRes.next()){ userId = requestRes.getInt(1); userInscriptionDate = requestRes.getString(2); userStatus = requestRes.getString(3); userAlias = requestRes.getString(4); userMail = requestRes.getString(5); userAfpa = requestRes.getString(6); switch (userStatus) { case STR : user = new Trainee(userId, userInscriptionDate, userStatus, userAlias, userMail, userAfpa); users.add(user); break; case STR : user = new FormerTrainee(userId, userInscriptionDate, userStatus, userAlias, userMail, userAfpa); users.add(user); break; case STR : user = new Trainer(userId, userInscriptionDate, userStatus, userAlias, userMail, userAfpa); users.add(user); break; default: System.out.println(STR); break; } } } catch (SQLException e) { e.printStackTrace(); System.err.println(STR); } finally { closeRequest(searchUser); } return users; }
/** * Search an user by status from database and displays it. * * @author Claire * @param userStatus * @return user * @version 22-10-2016 */
Search an user by status from database and displays it
search
{ "repo_name": "CDI-Enterprise/ecf-16035-b", "path": "src/fr/cdiEnterprise/dao/UserDAO.java", "license": "gpl-3.0", "size": 15263 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
414,939
@ReportableProperty(order = 2, value = "Offset value.") public long getOffset() { return entry.offset; }
@ReportableProperty(order = 2, value = STR) long function() { return entry.offset; }
/** * Returns the offset of the beginning of this entry in the GZip * file. * @return the offset of this entry, as a number of bytes from the * start of the GZip file. */
Returns the offset of the beginning of this entry in the GZip file
getOffset
{ "repo_name": "opf-labs/jhove2", "path": "src/main/java/org/jhove2/module/format/gzip/properties/GzipEntryProperties.java", "license": "bsd-2-clause", "size": 11500 }
[ "org.jhove2.annotation.ReportableProperty" ]
import org.jhove2.annotation.ReportableProperty;
import org.jhove2.annotation.*;
[ "org.jhove2.annotation" ]
org.jhove2.annotation;
583,851
EClass getUiHorizontalButtonGroupAssigment();
EClass getUiHorizontalButtonGroupAssigment();
/** * Returns the meta object for class '{@link org.lunifera.ecview.semantic.uimodel.UiHorizontalButtonGroupAssigment <em>Ui Horizontal Button Group Assigment</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Ui Horizontal Button Group Assigment</em>'. * @see org.lunifera.ecview.semantic.uimodel.UiHorizontalButtonGroupAssigment * @generated */
Returns the meta object for class '<code>org.lunifera.ecview.semantic.uimodel.UiHorizontalButtonGroupAssigment Ui Horizontal Button Group Assigment</code>'.
getUiHorizontalButtonGroupAssigment
{ "repo_name": "lunifera/lunifera-ecview-addons", "path": "org.lunifera.ecview.semantic.uimodel/src/org/lunifera/ecview/semantic/uimodel/UiModelPackage.java", "license": "epl-1.0", "size": 498897 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,419,566
@Test public void testRubyStyleReturnValues() throws Exception { Node node = j.parse("5;4"); Object result = j.evaluate(node); assertEquals(BigDecimal.valueOf(4), result); }
void function() throws Exception { Node node = j.parse("5;4"); Object result = j.evaluate(node); assertEquals(BigDecimal.valueOf(4), result); }
/** * Test that last evaluated expression is returned * @throws Exception */
Test that last evaluated expression is returned
testRubyStyleReturnValues
{ "repo_name": "xicmiah/jep-decimal", "path": "src/test/org/nfunk/jep/MultiExpressionTest.java", "license": "gpl-3.0", "size": 2227 }
[ "java.math.BigDecimal", "org.junit.Assert" ]
import java.math.BigDecimal; import org.junit.Assert;
import java.math.*; import org.junit.*;
[ "java.math", "org.junit" ]
java.math; org.junit;
816,428
@Override public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) return false; int pointerIndex; final int action = event.getAction(); switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: // Remember where the motion event started mActivePointerId = event.getPointerId(event.getPointerCount() - 1); pointerIndex = event.findPointerIndex(mActivePointerId); mDownMotionX = event.getX(pointerIndex); pressedThumb = evalPressedThumb(mDownMotionX); // Only handle thumb presses. if (pressedThumb == null) return super.onTouchEvent(event); setPressed(true); invalidate(); onStartTrackingTouch(); trackTouchEvent(event); attemptClaimDrag(); break; case MotionEvent.ACTION_MOVE: if (pressedThumb != null) { if (mIsDragging) { trackTouchEvent(event); } else { // Scroll to follow the motion event pointerIndex = event.findPointerIndex(mActivePointerId); final float x = event.getX(pointerIndex); if (Math.abs(x - mDownMotionX) > mScaledTouchSlop) { setPressed(true); invalidate(); onStartTrackingTouch(); trackTouchEvent(event); attemptClaimDrag(); } } if (notifyWhileDragging && listener != null) { listener.onRangeSeekBarValuesChanged(this, getSelectedMinValue(), getSelectedMaxValue()); } } break; case MotionEvent.ACTION_UP: if (mIsDragging) { trackTouchEvent(event); onStopTrackingTouch(); setPressed(false); } else { // Touch up when we never crossed the touch slop threshold // should be interpreted as a tap-seek to that location. onStartTrackingTouch(); trackTouchEvent(event); onStopTrackingTouch(); } pressedThumb = null; invalidate(); if (listener != null) { listener.onRangeSeekBarValuesChanged(this, getSelectedMinValue(), getSelectedMaxValue()); } break; case MotionEvent.ACTION_POINTER_DOWN: { final int index = event.getPointerCount() - 1; // final int index = ev.getActionIndex(); mDownMotionX = event.getX(index); mActivePointerId = event.getPointerId(index); invalidate(); break; } case MotionEvent.ACTION_POINTER_UP: onSecondaryPointerUp(event); invalidate(); break; case MotionEvent.ACTION_CANCEL: if (mIsDragging) { onStopTrackingTouch(); setPressed(false); } invalidate(); // see above explanation break; } return true; }
boolean function(MotionEvent event) { if (!isEnabled()) return false; int pointerIndex; final int action = event.getAction(); switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: mActivePointerId = event.getPointerId(event.getPointerCount() - 1); pointerIndex = event.findPointerIndex(mActivePointerId); mDownMotionX = event.getX(pointerIndex); pressedThumb = evalPressedThumb(mDownMotionX); if (pressedThumb == null) return super.onTouchEvent(event); setPressed(true); invalidate(); onStartTrackingTouch(); trackTouchEvent(event); attemptClaimDrag(); break; case MotionEvent.ACTION_MOVE: if (pressedThumb != null) { if (mIsDragging) { trackTouchEvent(event); } else { pointerIndex = event.findPointerIndex(mActivePointerId); final float x = event.getX(pointerIndex); if (Math.abs(x - mDownMotionX) > mScaledTouchSlop) { setPressed(true); invalidate(); onStartTrackingTouch(); trackTouchEvent(event); attemptClaimDrag(); } } if (notifyWhileDragging && listener != null) { listener.onRangeSeekBarValuesChanged(this, getSelectedMinValue(), getSelectedMaxValue()); } } break; case MotionEvent.ACTION_UP: if (mIsDragging) { trackTouchEvent(event); onStopTrackingTouch(); setPressed(false); } else { onStartTrackingTouch(); trackTouchEvent(event); onStopTrackingTouch(); } pressedThumb = null; invalidate(); if (listener != null) { listener.onRangeSeekBarValuesChanged(this, getSelectedMinValue(), getSelectedMaxValue()); } break; case MotionEvent.ACTION_POINTER_DOWN: { final int index = event.getPointerCount() - 1; mDownMotionX = event.getX(index); mActivePointerId = event.getPointerId(index); invalidate(); break; } case MotionEvent.ACTION_POINTER_UP: onSecondaryPointerUp(event); invalidate(); break; case MotionEvent.ACTION_CANCEL: if (mIsDragging) { onStopTrackingTouch(); setPressed(false); } invalidate(); break; } return true; }
/** * Handles thumb selection and movement. Notifies listener callback on certain events. */
Handles thumb selection and movement. Notifies listener callback on certain events
onTouchEvent
{ "repo_name": "simon0191/MinerPCAdviser", "path": "MpcaAndroidApp/src/com/mpca/ui/RangeSeekBar.java", "license": "mit", "size": 26758 }
[ "android.view.MotionEvent" ]
import android.view.MotionEvent;
import android.view.*;
[ "android.view" ]
android.view;
2,604,292
protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); }
void function(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); }
/** * This adds to the collection of * {@link org.eclipse.emf.edit.command.CommandParameter}s describing all of * the children that can be created under this object. <!-- begin-user-doc * --> <!-- end-user-doc --> * * @generated */
This adds to the collection of <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing all of the children that can be created under this object.
collectNewChildDescriptors
{ "repo_name": "apache/geronimo-devtools", "path": "plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ResourceRefTypeItemProvider.java", "license": "apache-2.0", "size": 13484 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
490,004
public static boolean isValidSegment(CarbonLoadModel loadModel, int currentLoad) { CarbonTable carbonTable = loadModel.getCarbonDataLoadSchema() .getCarbonTable(); CarbonTablePath carbonTablePath = CarbonStorePath.getCarbonTablePath( loadModel.getStorePath(), carbonTable.getCarbonTableIdentifier()); int fileCount = 0; int partitionCount = carbonTable.getPartitionCount(); for (int i = 0; i < partitionCount; i++) { String segmentPath = carbonTablePath.getCarbonDataDirectoryPath(i + "", currentLoad + ""); CarbonFile carbonFile = FileFactory.getCarbonFile(segmentPath, FileFactory.getFileType(segmentPath)); CarbonFile[] files = carbonFile.listFiles(new CarbonFileFilter() {
static boolean function(CarbonLoadModel loadModel, int currentLoad) { CarbonTable carbonTable = loadModel.getCarbonDataLoadSchema() .getCarbonTable(); CarbonTablePath carbonTablePath = CarbonStorePath.getCarbonTablePath( loadModel.getStorePath(), carbonTable.getCarbonTableIdentifier()); int fileCount = 0; int partitionCount = carbonTable.getPartitionCount(); for (int i = 0; i < partitionCount; i++) { String segmentPath = carbonTablePath.getCarbonDataDirectoryPath(i + STR"); CarbonFile carbonFile = FileFactory.getCarbonFile(segmentPath, FileFactory.getFileType(segmentPath)); CarbonFile[] files = carbonFile.listFiles(new CarbonFileFilter() {
/** * the method returns true if the segment has carbondata file else returns false. * * @param loadModel * @param currentLoad * @return */
the method returns true if the segment has carbondata file else returns false
isValidSegment
{ "repo_name": "shivangi1015/incubator-carbondata", "path": "integration/spark-common/src/main/java/org/apache/carbondata/spark/load/CarbonLoaderUtil.java", "license": "apache-2.0", "size": 33765 }
[ "org.apache.carbondata.core.datastore.filesystem.CarbonFile", "org.apache.carbondata.core.datastore.filesystem.CarbonFileFilter", "org.apache.carbondata.core.datastore.impl.FileFactory", "org.apache.carbondata.core.metadata.schema.table.CarbonTable", "org.apache.carbondata.core.util.path.CarbonStorePath", "org.apache.carbondata.core.util.path.CarbonTablePath", "org.apache.carbondata.processing.model.CarbonLoadModel" ]
import org.apache.carbondata.core.datastore.filesystem.CarbonFile; import org.apache.carbondata.core.datastore.filesystem.CarbonFileFilter; import org.apache.carbondata.core.datastore.impl.FileFactory; import org.apache.carbondata.core.metadata.schema.table.CarbonTable; import org.apache.carbondata.core.util.path.CarbonStorePath; import org.apache.carbondata.core.util.path.CarbonTablePath; import org.apache.carbondata.processing.model.CarbonLoadModel;
import org.apache.carbondata.core.datastore.filesystem.*; import org.apache.carbondata.core.datastore.impl.*; import org.apache.carbondata.core.metadata.schema.table.*; import org.apache.carbondata.core.util.path.*; import org.apache.carbondata.processing.model.*;
[ "org.apache.carbondata" ]
org.apache.carbondata;
396,345
public void setDefaultTabTextColor(int color) { tabViewTextColors = ColorStateList.valueOf(color); }
void function(int color) { tabViewTextColors = ColorStateList.valueOf(color); }
/** * Set the color used for styling the tab text. This will need to be called prior to calling * {@link #setViewPager(android.support.v4.view.ViewPager)} otherwise it will not get set * * @param color to use for tab text */
Set the color used for styling the tab text. This will need to be called prior to calling <code>#setViewPager(android.support.v4.view.ViewPager)</code> otherwise it will not get set
setDefaultTabTextColor
{ "repo_name": "weisterjie/AppCtr", "path": "ycjlibrary/src/main/java/com/ycj/ycjlibrary/smartTab/SmartTabLayout.java", "license": "apache-2.0", "size": 25929 }
[ "android.content.res.ColorStateList" ]
import android.content.res.ColorStateList;
import android.content.res.*;
[ "android.content" ]
android.content;
466,095
protected static DeclarationContextIF optimisticParse(TopicMapIF tm, String query) { try { return QueryUtils.parseDeclarations(tm, query); } catch (InvalidQueryException e) { throw new OntopiaRuntimeException("There was a problem parsing the " + "query \"" + query + "\" probably due to an error in the menu ontology.", e); } }
static DeclarationContextIF function(TopicMapIF tm, String query) { try { return QueryUtils.parseDeclarations(tm, query); } catch (InvalidQueryException e) { throw new OntopiaRuntimeException(STR + STRSTR\STR, e); } }
/** * Parse the given declaration-context-query for the given topic map. * InvalidQueryExceptions thrown during the parse process are caught and * re-thrown with an additional message as OntopiaRuntimeExceptions. This * avoids external try {} catch() {} blocks around this method. * @param tm The topicmap used by the query. * @param query The query to parse. * @return A DeclarationContextIF representing the parsed query. */
Parse the given declaration-context-query for the given topic map. InvalidQueryExceptions thrown during the parse process are caught and re-thrown with an additional message as OntopiaRuntimeExceptions. This avoids external try {} catch() {} blocks around this method
optimisticParse
{ "repo_name": "ontopia/ontopia", "path": "ontopia-navigator/src/main/java/net/ontopia/topicmaps/nav2/portlets/pojos/MenuUtils.java", "license": "apache-2.0", "size": 20375 }
[ "net.ontopia.topicmaps.core.TopicMapIF", "net.ontopia.topicmaps.query.core.DeclarationContextIF", "net.ontopia.topicmaps.query.core.InvalidQueryException", "net.ontopia.topicmaps.query.utils.QueryUtils", "net.ontopia.utils.OntopiaRuntimeException" ]
import net.ontopia.topicmaps.core.TopicMapIF; import net.ontopia.topicmaps.query.core.DeclarationContextIF; import net.ontopia.topicmaps.query.core.InvalidQueryException; import net.ontopia.topicmaps.query.utils.QueryUtils; import net.ontopia.utils.OntopiaRuntimeException;
import net.ontopia.topicmaps.core.*; import net.ontopia.topicmaps.query.core.*; import net.ontopia.topicmaps.query.utils.*; import net.ontopia.utils.*;
[ "net.ontopia.topicmaps", "net.ontopia.utils" ]
net.ontopia.topicmaps; net.ontopia.utils;
810,036
set3Bytes(D10Constants.OFS_ADDRESS, address); }
set3Bytes(D10Constants.OFS_ADDRESS, address); }
/** * Sets the address. * @param address The address to set */
Sets the address
setAddress
{ "repo_name": "jpcaruana/jsynthlib", "path": "src/main/java/org/jsynthlib/drivers/roland/d10/message/D10TransferMessage.java", "license": "gpl-2.0", "size": 1929 }
[ "org.jsynthlib.drivers.roland.d10.D10Constants" ]
import org.jsynthlib.drivers.roland.d10.D10Constants;
import org.jsynthlib.drivers.roland.d10.*;
[ "org.jsynthlib.drivers" ]
org.jsynthlib.drivers;
990,124
public void setDrawArea(Rectangle drawArea) { this.drawArea = drawArea; }
void function(Rectangle drawArea) { this.drawArea = drawArea; }
/** * Sets the area where the graph will be drawn. This is not * including the heading, key etc. but is essentially the * rectangle around which the border of the graph is drawn. * @param drawArea the area where the graph will be drawn */
Sets the area where the graph will be drawn. This is not including the heading, key etc. but is essentially the rectangle around which the border of the graph is drawn
setDrawArea
{ "repo_name": "shaze/genesis", "path": "src/pca/drawInfo/DrawInfo3D.java", "license": "agpl-3.0", "size": 10752 }
[ "org.eclipse.swt.graphics.Rectangle" ]
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.graphics.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
2,226,134
public void testLongArrayAccumulateAndGet() { AtomicLongArray a = new AtomicLongArray(1); a.set(0, 1); assertEquals(7L, a.accumulateAndGet(0, 6L, Long::sum)); assertEquals(10L, a.accumulateAndGet(0, 3L, Long::sum)); assertEquals(10L, a.get(0)); }
void function() { AtomicLongArray a = new AtomicLongArray(1); a.set(0, 1); assertEquals(7L, a.accumulateAndGet(0, 6L, Long::sum)); assertEquals(10L, a.accumulateAndGet(0, 3L, Long::sum)); assertEquals(10L, a.get(0)); }
/** * AtomicLongArray accumulateAndGet updates with supplied function and * returns result. */
AtomicLongArray accumulateAndGet updates with supplied function and returns result
testLongArrayAccumulateAndGet
{ "repo_name": "YouDiSN/OpenJDK-Research", "path": "jdk9/jdk/test/java/util/concurrent/tck/Atomic8Test.java", "license": "gpl-2.0", "size": 24432 }
[ "java.util.concurrent.atomic.AtomicLongArray" ]
import java.util.concurrent.atomic.AtomicLongArray;
import java.util.concurrent.atomic.*;
[ "java.util" ]
java.util;
2,721,481
Assert.notNull(builder, "Builder must not be null"); return new BuildRequest(this.name, this.applicationContent, builder.inTaggedForm(), this.creator, this.env, this.cleanCache, this.verboseLogging); }
Assert.notNull(builder, STR); return new BuildRequest(this.name, this.applicationContent, builder.inTaggedForm(), this.creator, this.env, this.cleanCache, this.verboseLogging); }
/** * Return a new {@link BuildRequest} with an updated builder. * @param builder the new builder to use * @return an updated build request */
Return a new <code>BuildRequest</code> with an updated builder
withBuilder
{ "repo_name": "joshiste/spring-boot", "path": "spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildRequest.java", "license": "apache-2.0", "size": 8108 }
[ "org.springframework.util.Assert" ]
import org.springframework.util.Assert;
import org.springframework.util.*;
[ "org.springframework.util" ]
org.springframework.util;
540,726
void onThreadPoolAdd(CamelContext camelContext, ThreadPoolExecutor threadPool, String id, String sourceId, String routeId, String threadPoolProfileId);
void onThreadPoolAdd(CamelContext camelContext, ThreadPoolExecutor threadPool, String id, String sourceId, String routeId, String threadPoolProfileId);
/** * Notification on adding a thread pool. * * @param camelContext the camel context * @param threadPool the thread pool * @param id id of the thread pool (can be null in special cases) * @param sourceId id of the source creating the thread pool (can be null in special cases) * @param routeId id of the route for the source (is null if no source) * @param threadPoolProfileId id of the thread pool profile, if used for creating this thread pool (can be null) */
Notification on adding a thread pool
onThreadPoolAdd
{ "repo_name": "everttigchelaar/camel-svn", "path": "camel-core/src/main/java/org/apache/camel/spi/LifecycleStrategy.java", "license": "apache-2.0", "size": 5178 }
[ "java.util.concurrent.ThreadPoolExecutor", "org.apache.camel.CamelContext" ]
import java.util.concurrent.ThreadPoolExecutor; import org.apache.camel.CamelContext;
import java.util.concurrent.*; import org.apache.camel.*;
[ "java.util", "org.apache.camel" ]
java.util; org.apache.camel;
1,027,964
LearnerProgress learnerProgress = LearningWebUtil.getLearnerProgress(request, learnerService); Lesson lesson = learnerProgress.getLesson(); Set<Lesson> releasedLessons = lessonService.getReleasedSucceedingLessons(lesson.getLessonId(), learnerProgress.getUser().getUserId()); if (!releasedLessons.isEmpty()) { StringBuilder releasedLessonNames = new StringBuilder(); for (Lesson releasedLesson : releasedLessons) { releasedLessonNames.append(releasedLesson.getLessonName()).append(", "); } releasedLessonNames.delete(releasedLessonNames.length() - 2, releasedLessonNames.length()); request.setAttribute(RELEASED_LESSONS_REQUEST_ATTRIBUTE, releasedLessonNames.toString()); } // so LTI 1.3 can update last finished activity Long finishedActivityId = WebUtil.readLongParam(request, "finishedActivityId", true); //let non-LTI integrations server know to come and pick up updated marks (it will happen at lessoncomplete.jsp page) String lessonFinishCallbackUrl = integrationService.getLessonFinishCallbackUrl(learnerProgress.getUser(), lesson, finishedActivityId); if (lessonFinishCallbackUrl != null) { request.setAttribute("lessonFinishUrl", lessonFinishCallbackUrl); } request.setAttribute("lessonID", lesson.getLessonId()); request.setAttribute("gradebookOnComplete", lesson.getGradebookOnComplete()); return "lessonComplete"; }
LearnerProgress learnerProgress = LearningWebUtil.getLearnerProgress(request, learnerService); Lesson lesson = learnerProgress.getLesson(); Set<Lesson> releasedLessons = lessonService.getReleasedSucceedingLessons(lesson.getLessonId(), learnerProgress.getUser().getUserId()); if (!releasedLessons.isEmpty()) { StringBuilder releasedLessonNames = new StringBuilder(); for (Lesson releasedLesson : releasedLessons) { releasedLessonNames.append(releasedLesson.getLessonName()).append(STR); } releasedLessonNames.delete(releasedLessonNames.length() - 2, releasedLessonNames.length()); request.setAttribute(RELEASED_LESSONS_REQUEST_ATTRIBUTE, releasedLessonNames.toString()); } Long finishedActivityId = WebUtil.readLongParam(request, STR, true); String lessonFinishCallbackUrl = integrationService.getLessonFinishCallbackUrl(learnerProgress.getUser(), lesson, finishedActivityId); if (lessonFinishCallbackUrl != null) { request.setAttribute(STR, lessonFinishCallbackUrl); } request.setAttribute(STR, lesson.getLessonId()); request.setAttribute(STR, lesson.getGradebookOnComplete()); return STR; }
/** * Gets an activity from the request (attribute) and forwards onto a display action using the ActionMappings class. * If no activity is in request then use the current activity in learnerProgress. */
Gets an activity from the request (attribute) and forwards onto a display action using the ActionMappings class. If no activity is in request then use the current activity in learnerProgress
execute
{ "repo_name": "lamsfoundation/lams", "path": "lams_learning/src/java/org/lamsfoundation/lams/learning/web/controller/LessonCompleteActivityController.java", "license": "gpl-2.0", "size": 3947 }
[ "java.util.Set", "org.lamsfoundation.lams.learning.web.util.LearningWebUtil", "org.lamsfoundation.lams.lesson.LearnerProgress", "org.lamsfoundation.lams.lesson.Lesson", "org.lamsfoundation.lams.util.WebUtil" ]
import java.util.Set; import org.lamsfoundation.lams.learning.web.util.LearningWebUtil; import org.lamsfoundation.lams.lesson.LearnerProgress; import org.lamsfoundation.lams.lesson.Lesson; import org.lamsfoundation.lams.util.WebUtil;
import java.util.*; import org.lamsfoundation.lams.learning.web.util.*; import org.lamsfoundation.lams.lesson.*; import org.lamsfoundation.lams.util.*;
[ "java.util", "org.lamsfoundation.lams" ]
java.util; org.lamsfoundation.lams;
2,160,022
private boolean isLineBreak( char c) throws IOException { if (c == '\n') { return true; } else if (c == '\r') { // if the \r is immediately followed by a \n, this counts as one line break char int next = in.read(); if (next!=-1 && next!='\n') { // non-line break; handle this char later ((PushbackReader) in).unread( (char) next); } return true; } else { return false; } }
boolean function( char c) throws IOException { if (c == '\n') { return true; } else if (c == '\r') { int next = in.read(); if (next!=-1 && next!='\n') { ((PushbackReader) in).unread( (char) next); } return true; } else { return false; } }
/** * Test if the character read from the underlying stream signals a line break. * If the character is a '\r', the method will test if the following character is a '\n' and * will consume that char. * * @param c The character last read from the underlying reader. */
Test if the character read from the underlying stream signals a line break. If the character is a '\r', the method will test if the following character is a '\n' and will consume that char
isLineBreak
{ "repo_name": "tensberg/jgloss-mirror", "path": "jgloss/src/main/java/jgloss/ui/xml/JGlossifyReader.java", "license": "gpl-2.0", "size": 14236 }
[ "java.io.IOException", "java.io.PushbackReader" ]
import java.io.IOException; import java.io.PushbackReader;
import java.io.*;
[ "java.io" ]
java.io;
933,339
if (key == null) { return null; } final String[] keys = key.trim().split("\\|"); final int keyLen = keys.length; final String subKey = keys[0].trim(); final String subValue = keyLen < 2 ? key : keys[1].trim(); try { final InetAddress inetAddress = InetAddress.getByName(subValue); switch (subKey) { case InetAddressKeys.KEY_NAME: return inetAddress.getHostName(); case InetAddressKeys.KEY_CANONICAL_NAME: return inetAddress.getCanonicalHostName(); case InetAddressKeys.KEY_ADDRESS: return inetAddress.getHostAddress(); default: return inetAddress.getHostAddress(); } } catch (final UnknownHostException e) { return null; } }
if (key == null) { return null; } final String[] keys = key.trim().split(STR); final int keyLen = keys.length; final String subKey = keys[0].trim(); final String subValue = keyLen < 2 ? key : keys[1].trim(); try { final InetAddress inetAddress = InetAddress.getByName(subValue); switch (subKey) { case InetAddressKeys.KEY_NAME: return inetAddress.getHostName(); case InetAddressKeys.KEY_CANONICAL_NAME: return inetAddress.getCanonicalHostName(); case InetAddressKeys.KEY_ADDRESS: return inetAddress.getHostAddress(); default: return inetAddress.getHostAddress(); } } catch (final UnknownHostException e) { return null; } }
/** * Looks up the DNS value of the key. * * @param key the key to be looked up, may be null * @return The DNS value. */
Looks up the DNS value of the key
lookup
{ "repo_name": "apache/commons-text", "path": "src/main/java/org/apache/commons/text/lookup/DnsStringLookup.java", "license": "apache-2.0", "size": 3496 }
[ "java.net.InetAddress", "java.net.UnknownHostException" ]
import java.net.InetAddress; import java.net.UnknownHostException;
import java.net.*;
[ "java.net" ]
java.net;
1,568,080
public void loadUrl(LoadUrlParams params) { if (params.getLoadUrlType() == LoadUrlParams.LOAD_TYPE_DATA && !params.isBaseUrlDataScheme()) { // This allows data URLs with a non-data base URL access to file:///android_asset/ and // file:///android_res/ URLs. If AwSettings.getAllowFileAccess permits, it will also // allow access to file:// URLs (subject to OS level permission checks). params.setCanLoadLocalResources(true); } // If we are reloading the same url, then set transition type as reload. if (params.getUrl() != null && params.getUrl().equals(mContentViewCore.getUrl()) && params.getTransitionType() == PageTransitionTypes.PAGE_TRANSITION_LINK) { params.setTransitionType(PageTransitionTypes.PAGE_TRANSITION_RELOAD); } // For WebView, always use the user agent override, which is set // every time the user agent in AwSettings is modified. params.setOverrideUserAgent(LoadUrlParams.UA_OVERRIDE_TRUE); mContentViewCore.loadUrl(params); suppressInterceptionForThisNavigation(); // The behavior of WebViewClassic uses the populateVisitedLinks callback in WebKit. // Chromium does not use this use code path and the best emulation of this behavior to call // request visited links once on the first URL load of the WebView. if (!mHasRequestedVisitedHistoryFromClient) { mHasRequestedVisitedHistoryFromClient = true; requestVisitedHistoryFromClient(); } }
void function(LoadUrlParams params) { if (params.getLoadUrlType() == LoadUrlParams.LOAD_TYPE_DATA && !params.isBaseUrlDataScheme()) { params.setCanLoadLocalResources(true); } if (params.getUrl() != null && params.getUrl().equals(mContentViewCore.getUrl()) && params.getTransitionType() == PageTransitionTypes.PAGE_TRANSITION_LINK) { params.setTransitionType(PageTransitionTypes.PAGE_TRANSITION_RELOAD); } params.setOverrideUserAgent(LoadUrlParams.UA_OVERRIDE_TRUE); mContentViewCore.loadUrl(params); suppressInterceptionForThisNavigation(); if (!mHasRequestedVisitedHistoryFromClient) { mHasRequestedVisitedHistoryFromClient = true; requestVisitedHistoryFromClient(); } }
/** * Load url without fixing up the url string. Consumers of ContentView are responsible for * ensuring the URL passed in is properly formatted (i.e. the scheme has been added if left * off during user input). * * @param pararms Parameters for this load. */
Load url without fixing up the url string. Consumers of ContentView are responsible for ensuring the URL passed in is properly formatted (i.e. the scheme has been added if left off during user input)
loadUrl
{ "repo_name": "espadrine/opera", "path": "chromium/src/android_webview/java/src/org/chromium/android_webview/AwContents.java", "license": "bsd-3-clause", "size": 59889 }
[ "org.chromium.content.browser.LoadUrlParams", "org.chromium.content.browser.PageTransitionTypes" ]
import org.chromium.content.browser.LoadUrlParams; import org.chromium.content.browser.PageTransitionTypes;
import org.chromium.content.browser.*;
[ "org.chromium.content" ]
org.chromium.content;
2,799,424
public static void parseReactionsDetailed(String filename, MongoDB db) throws IOException { Map<String, Long> keggID_ActID = db.getKeggID_ActID(false); BufferedReader br = new BufferedReader( new InputStreamReader( new DataInputStream(new FileInputStream(filename)))); int numEntriesAdded = 0; int failed = 0; // set of variables to keep track of when parsing one entry String currKeggID = null; String currName = null; Map<Long, Integer> currProducts = null, currReactants = null; //maps chemicals to coefficients Map<Long, Integer> currCofactorProducts = null, currCofactorReactants = null; //maps chemicals to coefficients Map<Long, Integer> currCoenzymes = null; String currECNum = null; String strLine; while ((strLine = br.readLine()) != null) { if (strLine.startsWith(" ")) continue; //in middle of a field we don't need now String[] field_val = strLine.split(" +", 2); String key = field_val[0]; if (key.equals("ENTRY")) { currName = null; currProducts = null; currReactants = null; currCofactorProducts = null; currCofactorReactants = null; currCoenzymes = null; currECNum = null; currKeggID = field_val[1].split(" +")[0]; } else if (key.equals("ENZYME")) { currECNum = field_val[1]; } else if (key.equals("///")) { if (currKeggID == null) { failed++; continue; } if (currProducts == null || currReactants == null) continue; Long[] productArr = (Long[]) currProducts.keySet().toArray(new Long[1]); Long[] reactantArr = (Long[]) currReactants.keySet().toArray(new Long[1]); Long[] productCofactorArr = (Long[]) currCofactorProducts.keySet().toArray(new Long[1]); Long[] reactantCofactorArr = (Long[]) currCofactorReactants.keySet().toArray(new Long[1]); Long[] coenzymeArr = (Long[]) currCoenzymes.keySet().toArray(new Long[1]); Reaction toAdd = new Reaction(-1L, reactantArr, productArr, reactantCofactorArr, productCofactorArr, coenzymeArr, currECNum, ConversionDirectionType.LEFT_TO_RIGHT, StepDirection.LEFT_TO_RIGHT, currName, Reaction.RxnDetailType.CONCRETE ); toAdd.addReference(Reaction.RefDataSource.KEGG, currKeggID); toAdd.addReference(Reaction.RefDataSource.KEGG, keggXrefUrlPrefix + currKeggID); for (Long p : productArr) toAdd.setProductCoefficient(p, currProducts.get(p)); for (Long r : reactantArr) toAdd.setSubstrateCoefficient(r, currReactants.get(r)); numEntriesAdded++; toAdd.setDataSource(Reaction.RxnDataSource.KEGG); db.submitToActReactionDB(toAdd); currKeggID = null; } else if (key.equals("DEFINITION")) { currName = field_val[1]; if (currName == null) currName = ""; currName = "{} " + currName.replace("<=>", "->") + " <KEGG:" + currKeggID + ">"; } else if (key.equals("EQUATION")) { String[] tokens = field_val[1].split(" +"); currProducts = new HashMap<Long, Integer>(); currReactants = new HashMap<Long, Integer>(); // does KEGG provide consumed/modified cofactor information? // currently unpopulated currCofactorProducts = new HashMap<Long, Integer>(); currCofactorReactants = new HashMap<Long, Integer>(); // does KEGG provide auxiliary coenzyme information? // currently unpopulated currCoenzymes = new HashMap<Long, Integer>(); boolean isProducts = false; for (int t = 0; t < tokens.length; t++) { String token = tokens[t]; if (token.equals("+")) continue; if (token.equals("<=>")) { isProducts = true; continue; } Integer coeff = 1; if (token.matches("\\d+")) { //is numeric coeff = Integer.parseInt(token); t++; token = tokens[t]; } if (token.startsWith("C") || token.startsWith("G")) { token = token.substring(0, 6); //remove the possible parameters Long actID = keggID_ActID.get(token); if (actID == null) { //allow use of chemicals with parameter actID = keggID_ActID.get(token + "n"); } if (actID != null) { if (isProducts) { currProducts.put(actID, coeff); } else { currReactants.put(actID, coeff); } } else { currKeggID = null; } } } if (currKeggID == null) { System.out.println("KeggParser.parseReactionsDetailed failed" + currName); } } } br.close(); System.out.format("KeggParser.parseReactionsDetailed: Num entries added %d, Failed %d\n", numEntriesAdded, failed); }
static void function(String filename, MongoDB db) throws IOException { Map<String, Long> keggID_ActID = db.getKeggID_ActID(false); BufferedReader br = new BufferedReader( new InputStreamReader( new DataInputStream(new FileInputStream(filename)))); int numEntriesAdded = 0; int failed = 0; String currKeggID = null; String currName = null; Map<Long, Integer> currProducts = null, currReactants = null; Map<Long, Integer> currCofactorProducts = null, currCofactorReactants = null; Map<Long, Integer> currCoenzymes = null; String currECNum = null; String strLine; while ((strLine = br.readLine()) != null) { if (strLine.startsWith(" ")) continue; String[] field_val = strLine.split(STR, 2); String key = field_val[0]; if (key.equals("ENTRY")) { currName = null; currProducts = null; currReactants = null; currCofactorProducts = null; currCofactorReactants = null; currCoenzymes = null; currECNum = null; currKeggID = field_val[1].split(STR)[0]; } else if (key.equals(STR)) { currECNum = field_val[1]; } else if (key.equals(STRDEFINITIONSTRSTR{} STR<=>STR->STR <KEGG:STR>STREQUATION")) { String[] tokens = field_val[1].split(STR); currProducts = new HashMap<Long, Integer>(); currReactants = new HashMap<Long, Integer>(); currCofactorProducts = new HashMap<Long, Integer>(); currCofactorReactants = new HashMap<Long, Integer>(); currCoenzymes = new HashMap<Long, Integer>(); boolean isProducts = false; for (int t = 0; t < tokens.length; t++) { String token = tokens[t]; if (token.equals("+STR<=>STR\\d+STRCSTRGSTRnSTRKeggParser.parseReactionsDetailed failedSTRKeggParser.parseReactionsDetailed: Num entries added %d, Failed %d\n", numEntriesAdded, failed); }
/** * Parses KEGG file with reaction details. * Add all reactions that involve only chemicals in our database. * @param filename * @param db * @throws IOException */
Parses KEGG file with reaction details. Add all reactions that involve only chemicals in our database
parseReactionsDetailed
{ "repo_name": "20n/act", "path": "reachables/src/main/java/act/installer/kegg/KeggParser.java", "license": "gpl-3.0", "size": 24841 }
[ "java.io.BufferedReader", "java.io.DataInputStream", "java.io.FileInputStream", "java.io.IOException", "java.io.InputStreamReader", "java.util.HashMap", "java.util.Map" ]
import java.io.BufferedReader; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,347,459
public Concourse connect() { return connect("admin", "admin"); }
Concourse function() { return connect("admin", "admin"); }
/** * Return a connection handler to the server using the default "admin" * credentials. * * @return the connection handler */
Return a connection handler to the server using the default "admin" credentials
connect
{ "repo_name": "dubex/concourse", "path": "concourse-ete-test-core/src/main/java/com/cinchapi/concourse/server/ManagedConcourseServer.java", "license": "apache-2.0", "size": 75641 }
[ "com.cinchapi.concourse.Concourse" ]
import com.cinchapi.concourse.Concourse;
import com.cinchapi.concourse.*;
[ "com.cinchapi.concourse" ]
com.cinchapi.concourse;
2,287,525
public void setUserStyleList(List<UserStyleInfo> list) { userStyleList = list; } public static class ChoiceInfo implements Serializable { private static final long serialVersionUID = 100; private int choiceSelect = -1; private static final int INLINE_FEATURE_CHOICE = 0; private static final int REMOTE_OWS_CHOICE = 1; private InlineFeatureInfo inlineFeature; private RemoteOWSInfo remoteOWS;
void function(List<UserStyleInfo> list) { userStyleList = list; } public static class ChoiceInfo implements Serializable { private static final long serialVersionUID = 100; private int choiceSelect = -1; private static final int INLINE_FEATURE_CHOICE = 0; private static final int REMOTE_OWS_CHOICE = 1; private InlineFeatureInfo inlineFeature; private RemoteOWSInfo remoteOWS;
/** * Set the list of 'UserStyle' element items. * * @param list */
Set the list of 'UserStyle' element items
setUserStyleList
{ "repo_name": "geomajas/geomajas-project-sld", "path": "api/src/main/java/org/geomajas/sld/UserLayerInfo.java", "license": "apache-2.0", "size": 9045 }
[ "java.io.Serializable", "java.util.List" ]
import java.io.Serializable; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
46,691
@Override public void invalidateTextureContent(Bitmap bitmap) { BasicTexture resultTexture = getTextureFromMap(bitmap); if (resultTexture instanceof UploadedTexture) { ((UploadedTexture) resultTexture).invalidateContent(); } }
void function(Bitmap bitmap) { BasicTexture resultTexture = getTextureFromMap(bitmap); if (resultTexture instanceof UploadedTexture) { ((UploadedTexture) resultTexture).invalidateContent(); } }
/*** * Use this to the bitmap to texture. Called when your bitmap content pixels changed * @param bitmap the bitmap whose content pixels changed */
Use this to the bitmap to texture. Called when your bitmap content pixels changed
invalidateTextureContent
{ "repo_name": "ChillingVan/android-openGL-canvas", "path": "canvasgl/src/main/java/com/chillingvan/canvasgl/CanvasGL.java", "license": "apache-2.0", "size": 16273 }
[ "android.graphics.Bitmap", "com.chillingvan.canvasgl.glcanvas.BasicTexture", "com.chillingvan.canvasgl.glcanvas.UploadedTexture" ]
import android.graphics.Bitmap; import com.chillingvan.canvasgl.glcanvas.BasicTexture; import com.chillingvan.canvasgl.glcanvas.UploadedTexture;
import android.graphics.*; import com.chillingvan.canvasgl.glcanvas.*;
[ "android.graphics", "com.chillingvan.canvasgl" ]
android.graphics; com.chillingvan.canvasgl;
1,746,961
private void handleSearchContext(SearchContext ctx) { String query = ctx.getQuery(); UserNotifier un = FinderFactory.getRegistry().getUserNotifier(); Timestamp start = ctx.getStartTime(); Timestamp end = ctx.getEndTime(); if (start != null && end != null && start.after(end)) { un.notifyInfo(TITLE, "The selected time interval is not valid."); return; } if (CommonsLangUtils.isEmpty(query) && start == null && end == null) { un.notifyInfo(TITLE, "Please enter a term to search for " + "or a valid time interval."); return; } List<Integer> context = ctx.getContext(); if (context == null || context.size() == 0) { context = new ArrayList<Integer>(); context.add(SearchContext.CUSTOMIZED); } Set<SearchScope> scope = new HashSet<SearchScope>(); Iterator i = context.iterator(); SearchScope v; while (i.hasNext()) { v = convertScope((Integer) i.next()); if (v != null) scope.add(v); } List<Class<? extends DataObject>> types = new ArrayList<Class<? extends DataObject>>(); i = ctx.getType().iterator(); Class<? extends DataObject> k; while (i.hasNext()) { k = convertType((Integer) i.next()); if (k != null) types.add(k); } SearchParameters searchContext = new SearchParameters(scope, types, query); searchContext.setTimeInterval(start, end, ctx.getTimeType()); searchContext.setUserId(ctx.getSelectedOwner()); SecurityContext secCtx; if (ctx.getSelectedGroup() == GroupContext.ALL_GROUPS_ID) { secCtx = new SecurityContext( FinderFactory.getUserDetails().getGroupId()); searchContext.setGroupId(SearchParameters.ALL_GROUPS_ID); } else { secCtx = new SecurityContext(ctx.getSelectedGroup()); searchContext.setGroupId(ctx.getSelectedGroup()); } loader = new AdvancedFinderLoader(this, secCtx, searchContext); loader.load(); state = Finder.SEARCH; setSearchEnabled(-1); }
void function(SearchContext ctx) { String query = ctx.getQuery(); UserNotifier un = FinderFactory.getRegistry().getUserNotifier(); Timestamp start = ctx.getStartTime(); Timestamp end = ctx.getEndTime(); if (start != null && end != null && start.after(end)) { un.notifyInfo(TITLE, STR); return; } if (CommonsLangUtils.isEmpty(query) && start == null && end == null) { un.notifyInfo(TITLE, STR + STR); return; } List<Integer> context = ctx.getContext(); if (context == null context.size() == 0) { context = new ArrayList<Integer>(); context.add(SearchContext.CUSTOMIZED); } Set<SearchScope> scope = new HashSet<SearchScope>(); Iterator i = context.iterator(); SearchScope v; while (i.hasNext()) { v = convertScope((Integer) i.next()); if (v != null) scope.add(v); } List<Class<? extends DataObject>> types = new ArrayList<Class<? extends DataObject>>(); i = ctx.getType().iterator(); Class<? extends DataObject> k; while (i.hasNext()) { k = convertType((Integer) i.next()); if (k != null) types.add(k); } SearchParameters searchContext = new SearchParameters(scope, types, query); searchContext.setTimeInterval(start, end, ctx.getTimeType()); searchContext.setUserId(ctx.getSelectedOwner()); SecurityContext secCtx; if (ctx.getSelectedGroup() == GroupContext.ALL_GROUPS_ID) { secCtx = new SecurityContext( FinderFactory.getUserDetails().getGroupId()); searchContext.setGroupId(SearchParameters.ALL_GROUPS_ID); } else { secCtx = new SecurityContext(ctx.getSelectedGroup()); searchContext.setGroupId(ctx.getSelectedGroup()); } loader = new AdvancedFinderLoader(this, secCtx, searchContext); loader.load(); state = Finder.SEARCH; setSearchEnabled(-1); }
/** * Converts the UI context into a context to search for. * * @param ctx The value to convert. */
Converts the UI context into a context to search for
handleSearchContext
{ "repo_name": "knabar/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/util/finder/AdvancedFinder.java", "license": "gpl-2.0", "size": 14535 }
[ "java.sql.Timestamp", "java.util.ArrayList", "java.util.HashSet", "java.util.Iterator", "java.util.List", "java.util.Set", "org.openmicroscopy.shoola.env.ui.UserNotifier", "org.openmicroscopy.shoola.util.CommonsLangUtils", "org.openmicroscopy.shoola.util.ui.search.GroupContext", "org.openmicroscopy.shoola.util.ui.search.SearchContext" ]
import java.sql.Timestamp; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import org.openmicroscopy.shoola.env.ui.UserNotifier; import org.openmicroscopy.shoola.util.CommonsLangUtils; import org.openmicroscopy.shoola.util.ui.search.GroupContext; import org.openmicroscopy.shoola.util.ui.search.SearchContext;
import java.sql.*; import java.util.*; import org.openmicroscopy.shoola.env.ui.*; import org.openmicroscopy.shoola.util.*; import org.openmicroscopy.shoola.util.ui.search.*;
[ "java.sql", "java.util", "org.openmicroscopy.shoola" ]
java.sql; java.util; org.openmicroscopy.shoola;
2,801,913
protected Set<Vector<T>> getCombinations() { return getCombinations(new Vector<T>(), m_alphabet, m_strength); }
Set<Vector<T>> function() { return getCombinations(new Vector<T>(), m_alphabet, m_strength); }
/** * Gets the set of all combinations of t events * @return The set of combinations */
Gets the set of all combinations of t events
getCombinations
{ "repo_name": "liflab/sealtest", "path": "Source/Core/src/ca/uqac/lif/ecp/TWayScoringTraceGenerator.java", "license": "lgpl-3.0", "size": 5741 }
[ "java.util.Set", "java.util.Vector" ]
import java.util.Set; import java.util.Vector;
import java.util.*;
[ "java.util" ]
java.util;
2,443,959
public List<Variable> getUpperVariables() { List<Variable> uVarList = new ArrayList<>(); for (Variable aVar : VARDEF.getVars()) { if (aVar.getLevelNum() > 1) { uVarList.add(aVar); } } return uVarList; }
List<Variable> function() { List<Variable> uVarList = new ArrayList<>(); for (Variable aVar : VARDEF.getVars()) { if (aVar.getLevelNum() > 1) { uVarList.add(aVar); } } return uVarList; }
/** * Get variable list they have upper levels * * @return Upper variables */
Get variable list they have upper levels
getUpperVariables
{ "repo_name": "meteoinfo/meteoinfolib", "path": "src/org/meteoinfo/data/meteodata/grads/GrADSDataInfo.java", "license": "lgpl-3.0", "size": 115651 }
[ "java.util.ArrayList", "java.util.List", "org.meteoinfo.data.meteodata.Variable" ]
import java.util.ArrayList; import java.util.List; import org.meteoinfo.data.meteodata.Variable;
import java.util.*; import org.meteoinfo.data.meteodata.*;
[ "java.util", "org.meteoinfo.data" ]
java.util; org.meteoinfo.data;
561,794
@RequestMapping({ "/company" }) public String goCompanyManagementPage(Model model, HttpSession session) { return "/admin/company-management"; }
@RequestMapping({ STR }) String function(Model model, HttpSession session) { return STR; }
/** * Go company management page. * * @param model the model * @param session the session * @return the string */
Go company management page
goCompanyManagementPage
{ "repo_name": "aholake/hiringviet", "path": "src/main/java/vn/com/hiringviet/controller/AdminController.java", "license": "apache-2.0", "size": 3766 }
[ "javax.servlet.http.HttpSession", "org.springframework.ui.Model", "org.springframework.web.bind.annotation.RequestMapping" ]
import javax.servlet.http.HttpSession; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.*; import org.springframework.ui.*; import org.springframework.web.bind.annotation.*;
[ "javax.servlet", "org.springframework.ui", "org.springframework.web" ]
javax.servlet; org.springframework.ui; org.springframework.web;
213,700
public boolean deleteQueryById(String userId, String queryId) { boolean operationStatus = false; if (StringUtils.isNotBlank(queryId) && StringUtils.isNotBlank(userId)) { // Fetch all queries from query log file ObjectNode queries = fetchAllQueriesFromFile(); // Get user's query history list ObjectNode userQueries = (ObjectNode) queries.get(userId); if (userQueries != null) { // Remove user's query userQueries.remove(queryId); queries.set(userId, userQueries); // Store queries in file back operationStatus = storeQueriesInFile(queries); } } return operationStatus; }
boolean function(String userId, String queryId) { boolean operationStatus = false; if (StringUtils.isNotBlank(queryId) && StringUtils.isNotBlank(userId)) { ObjectNode queries = fetchAllQueriesFromFile(); ObjectNode userQueries = (ObjectNode) queries.get(userId); if (userQueries != null) { userQueries.remove(queryId); queries.set(userId, userQueries); operationStatus = storeQueriesInFile(queries); } } return operationStatus; }
/** * deleteQueryById method deletes query from query history file * * @param userId Logged in user's Unique Id * @param queryId Unique Id of Query to be deleted */
deleteQueryById method deletes query from query history file
deleteQueryById
{ "repo_name": "jdeppe-pivotal/geode", "path": "geode-pulse/src/main/java/org/apache/geode/tools/pulse/internal/data/DataBrowser.java", "license": "apache-2.0", "size": 7160 }
[ "com.fasterxml.jackson.databind.node.ObjectNode", "org.apache.commons.lang3.StringUtils" ]
import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.commons.lang3.StringUtils;
import com.fasterxml.jackson.databind.node.*; import org.apache.commons.lang3.*;
[ "com.fasterxml.jackson", "org.apache.commons" ]
com.fasterxml.jackson; org.apache.commons;
1,957,156
public boolean isOfType(String type) { return types.contains(type.trim().toUpperCase(Locale.ENGLISH), false); }
boolean function(String type) { return types.contains(type.trim().toUpperCase(Locale.ENGLISH), false); }
/** * Returns true if this effect is * of the supplied type. * * @param types * @return */
Returns true if this effect is of the supplied type
isOfType
{ "repo_name": "mganzarcik/fabulae", "path": "core/src/mg/fishchicken/gamelogic/effects/Effect.java", "license": "mit", "size": 19964 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
962,147
protected void publishReadEvent(final NodeRef nodeRef, final String name, final String mimeType, final long contentSize, final String encoding, final String range) { final QName nodeType = nodeRef==null?null:nodeService.getType(nodeRef);
void function(final NodeRef nodeRef, final String name, final String mimeType, final long contentSize, final String encoding, final String range) { final QName nodeType = nodeRef==null?null:nodeService.getType(nodeRef);
/** * Notifies listeners that a read has taken place. * * @param nodeRef NodeRef * @param name String * @param mimeType String * @param contentSize long * @param encoding String * @param range String */
Notifies listeners that a read has taken place
publishReadEvent
{ "repo_name": "Alfresco/community-edition", "path": "projects/repository/source/java/org/alfresco/opencmis/CMISConnector.java", "license": "lgpl-3.0", "size": 150987 }
[ "org.alfresco.service.cmr.repository.NodeRef", "org.alfresco.service.namespace.QName" ]
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName;
import org.alfresco.service.cmr.repository.*; import org.alfresco.service.namespace.*;
[ "org.alfresco.service" ]
org.alfresco.service;
2,661,044
// @GuardedBy annotation is doing lexical analysis that doesn't understand the closures below // will be running under the synchronized block. @SuppressWarnings("GuardedBy") private void post(BuildEvent event) { List<BuildEvent> linkEvents = null; BuildEventId id = event.getEventId(); List<BuildEvent> flushEvents = null; boolean lastEvent = false; synchronized (this) { if (announcedEvents == null) { announcedEvents = new HashSet<>(); // The very first event of a stream is implicitly announced by the convention that // a complete stream has to have at least one entry. In this way we keep the invariant // that the set of posted events is always a subset of the set of announced events. announcedEvents.add(id); if (!event.getChildrenEvents().contains(ProgressEvent.INITIAL_PROGRESS_UPDATE)) { BuildEvent progress = ProgressEvent.progressChainIn(progressCount, event.getEventId()); linkEvents = ImmutableList.of(progress); progressCount++; announcedEvents.addAll(progress.getChildrenEvents()); // the new first event in the stream, implicitly announced by the fact that complete // stream may not be empty. announcedEvents.add(progress.getEventId()); postedEvents.add(progress.getEventId()); } if (!bufferedStdoutStderrPairs.isEmpty()) { flushEvents = new ArrayList<>(bufferedStdoutStderrPairs.size()); for (Pair<String, String> outErrPair : bufferedStdoutStderrPairs) { flushEvents.add(flushStdoutStderrEvent(outErrPair.getFirst(), outErrPair.getSecond())); } } bufferedStdoutStderrPairs = null; } else { if (!announcedEvents.contains(id)) { Iterable<String> allOut = ImmutableList.of(); Iterable<String> allErr = ImmutableList.of(); if (outErrProvider != null) { allOut = orEmpty(outErrProvider.getOut()); allErr = orEmpty(outErrProvider.getErr()); } linkEvents = new ArrayList<>(); List<BuildEvent> finalLinkEvents = linkEvents; consumeAsPairsofStrings( allOut, allErr, (out, err) -> { BuildEvent progressEvent = ProgressEvent.progressChainIn(progressCount, id, out, err); finalLinkEvents.add(progressEvent); progressCount++; announcedEvents.addAll(progressEvent.getChildrenEvents()); postedEvents.add(progressEvent.getEventId()); }); } } if (event instanceof BuildInfoEvent) { // The specification for BuildInfoEvent says that there may be many such events, // but all except the first one should be ignored. if (postedEvents.contains(id)) { return; } } postedEvents.add(id); announcedEvents.addAll(event.getChildrenEvents()); // We keep as an invariant that postedEvents is a subset of announced events, so this is a // cheaper test for equality if (announcedEvents.size() == postedEvents.size()) { lastEvent = true; } } BuildEvent mainEvent = event; if (lastEvent) { mainEvent = new LastBuildEvent(event); } for (BuildEventTransport transport : transports) { if (linkEvents != null) { for (BuildEvent linkEvent : linkEvents) { transport.sendBuildEvent(linkEvent); } } transport.sendBuildEvent(mainEvent); } if (flushEvents != null) { for (BuildEvent flushEvent : flushEvents) { for (BuildEventTransport transport : transports) { transport.sendBuildEvent(flushEvent); } } } }
@SuppressWarnings(STR) void function(BuildEvent event) { List<BuildEvent> linkEvents = null; BuildEventId id = event.getEventId(); List<BuildEvent> flushEvents = null; boolean lastEvent = false; synchronized (this) { if (announcedEvents == null) { announcedEvents = new HashSet<>(); announcedEvents.add(id); if (!event.getChildrenEvents().contains(ProgressEvent.INITIAL_PROGRESS_UPDATE)) { BuildEvent progress = ProgressEvent.progressChainIn(progressCount, event.getEventId()); linkEvents = ImmutableList.of(progress); progressCount++; announcedEvents.addAll(progress.getChildrenEvents()); announcedEvents.add(progress.getEventId()); postedEvents.add(progress.getEventId()); } if (!bufferedStdoutStderrPairs.isEmpty()) { flushEvents = new ArrayList<>(bufferedStdoutStderrPairs.size()); for (Pair<String, String> outErrPair : bufferedStdoutStderrPairs) { flushEvents.add(flushStdoutStderrEvent(outErrPair.getFirst(), outErrPair.getSecond())); } } bufferedStdoutStderrPairs = null; } else { if (!announcedEvents.contains(id)) { Iterable<String> allOut = ImmutableList.of(); Iterable<String> allErr = ImmutableList.of(); if (outErrProvider != null) { allOut = orEmpty(outErrProvider.getOut()); allErr = orEmpty(outErrProvider.getErr()); } linkEvents = new ArrayList<>(); List<BuildEvent> finalLinkEvents = linkEvents; consumeAsPairsofStrings( allOut, allErr, (out, err) -> { BuildEvent progressEvent = ProgressEvent.progressChainIn(progressCount, id, out, err); finalLinkEvents.add(progressEvent); progressCount++; announcedEvents.addAll(progressEvent.getChildrenEvents()); postedEvents.add(progressEvent.getEventId()); }); } } if (event instanceof BuildInfoEvent) { if (postedEvents.contains(id)) { return; } } postedEvents.add(id); announcedEvents.addAll(event.getChildrenEvents()); if (announcedEvents.size() == postedEvents.size()) { lastEvent = true; } } BuildEvent mainEvent = event; if (lastEvent) { mainEvent = new LastBuildEvent(event); } for (BuildEventTransport transport : transports) { if (linkEvents != null) { for (BuildEvent linkEvent : linkEvents) { transport.sendBuildEvent(linkEvent); } } transport.sendBuildEvent(mainEvent); } if (flushEvents != null) { for (BuildEvent flushEvent : flushEvents) { for (BuildEventTransport transport : transports) { transport.sendBuildEvent(flushEvent); } } } }
/** * Post a new event to all transports; simultaneously keep track of the events we announce to * still come. * * <p>Moreover, link unannounced events to the progress stream; we only expect failure events to * come before their parents. */
Post a new event to all transports; simultaneously keep track of the events we announce to still come. Moreover, link unannounced events to the progress stream; we only expect failure events to come before their parents
post
{ "repo_name": "ulfjack/bazel", "path": "src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java", "license": "apache-2.0", "size": 30431 }
[ "com.google.common.collect.ImmutableList", "com.google.devtools.build.lib.analysis.BuildInfoEvent", "com.google.devtools.build.lib.buildeventstream.BuildEvent", "com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos", "com.google.devtools.build.lib.buildeventstream.BuildEventTransport", "com.google.devtools.build.lib.buildeventstream.LastBuildEvent", "com.google.devtools.build.lib.buildeventstream.ProgressEvent", "com.google.devtools.build.lib.util.Pair", "java.util.ArrayList", "java.util.HashSet", "java.util.List" ]
import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.analysis.BuildInfoEvent; import com.google.devtools.build.lib.buildeventstream.BuildEvent; import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos; import com.google.devtools.build.lib.buildeventstream.BuildEventTransport; import com.google.devtools.build.lib.buildeventstream.LastBuildEvent; import com.google.devtools.build.lib.buildeventstream.ProgressEvent; import com.google.devtools.build.lib.util.Pair; import java.util.ArrayList; import java.util.HashSet; import java.util.List;
import com.google.common.collect.*; import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.buildeventstream.*; import com.google.devtools.build.lib.util.*; import java.util.*;
[ "com.google.common", "com.google.devtools", "java.util" ]
com.google.common; com.google.devtools; java.util;
1,685,810
public static Media createMedia(InputStream stream, String mimeType) throws IOException { return createMedia(stream, mimeType, null); }
static Media function(InputStream stream, String mimeType) throws IOException { return createMedia(stream, mimeType, null); }
/** * Creates the Media in the given stream * Notice that a Media is "auto destroyed" on completion and cannot be played * twice! * * @param stream the stream containing the media data * @param mimeType the type of the data in the stream * @return Media a Media Object that can be used to control the playback * of the media * @throws java.io.IOException if the creation of the Media has failed */
Creates the Media in the given stream Notice that a Media is "auto destroyed" on completion and cannot be played twice
createMedia
{ "repo_name": "skyHALud/codenameone", "path": "CodenameOne/src/com/codename1/media/MediaManager.java", "license": "gpl-2.0", "size": 6714 }
[ "java.io.IOException", "java.io.InputStream" ]
import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
2,484,107
public void setPath(Path path) { _database.setPath(path); }
void function(Path path) { _database.setPath(path); }
/** * Sets the path to the database. */
Sets the path to the database
setPath
{ "repo_name": "WelcomeHUME/svn-caucho-com-resin", "path": "modules/resin/src/com/caucho/db/jdbc/DataSourceImpl.java", "license": "gpl-2.0", "size": 3908 }
[ "com.caucho.vfs.Path" ]
import com.caucho.vfs.Path;
import com.caucho.vfs.*;
[ "com.caucho.vfs" ]
com.caucho.vfs;
808,926
public static void main(String args[]) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException ex) { Logger.getLogger(MainApplication.class.getName()).log(Level.SEVERE, null, ex); } catch (InstantiationException ex) { Logger.getLogger(MainApplication.class.getName()).log(Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { Logger.getLogger(MainApplication.class.getName()).log(Level.SEVERE, null, ex); } catch (UnsupportedLookAndFeelException ex) { Logger.getLogger(MainApplication.class.getName()).log(Level.SEVERE, null, ex); } Thread.setDefaultUncaughtExceptionHandler(new DefaultExceptionHandler()); StartupOptions startupOptions = StartupOptions.parse(args); if (startupOptions.single_design_option) { java.util.ResourceBundle resources = java.util.ResourceBundle.getBundle("eu.mihosoft.freerouting.gui.MainApplication", startupOptions.current_locale); BoardFrame.Option board_option; if (startupOptions.session_file_option) { board_option = BoardFrame.Option.SESSION_FILE; } else { board_option = BoardFrame.Option.SINGLE_FRAME; } DesignFile design_file = DesignFile.get_instance(startupOptions.design_file_name, false); if (design_file == null) { System.out.print(resources.getString("message_6") + " "); System.out.print(startupOptions.design_file_name); System.out.println(" " + resources.getString("message_7")); return; } String message = resources.getString("loading_design") + " " + startupOptions.design_file_name; WindowMessage welcome_window = WindowMessage.show(message); final BoardFrame new_frame = create_board_frame(design_file, null, board_option, startupOptions.test_version_option, startupOptions.current_locale); welcome_window.dispose(); if (new_frame == null) { System.exit(1); return; } new_frame.addWindowListener(new java.awt.event.WindowAdapter() {
static void function(String args[]) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException ex) { Logger.getLogger(MainApplication.class.getName()).log(Level.SEVERE, null, ex); } catch (InstantiationException ex) { Logger.getLogger(MainApplication.class.getName()).log(Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { Logger.getLogger(MainApplication.class.getName()).log(Level.SEVERE, null, ex); } catch (UnsupportedLookAndFeelException ex) { Logger.getLogger(MainApplication.class.getName()).log(Level.SEVERE, null, ex); } Thread.setDefaultUncaughtExceptionHandler(new DefaultExceptionHandler()); StartupOptions startupOptions = StartupOptions.parse(args); if (startupOptions.single_design_option) { java.util.ResourceBundle resources = java.util.ResourceBundle.getBundle(STR, startupOptions.current_locale); BoardFrame.Option board_option; if (startupOptions.session_file_option) { board_option = BoardFrame.Option.SESSION_FILE; } else { board_option = BoardFrame.Option.SINGLE_FRAME; } DesignFile design_file = DesignFile.get_instance(startupOptions.design_file_name, false); if (design_file == null) { System.out.print(resources.getString(STR) + " "); System.out.print(startupOptions.design_file_name); System.out.println(" " + resources.getString(STR)); return; } String message = resources.getString(STR) + " " + startupOptions.design_file_name; WindowMessage welcome_window = WindowMessage.show(message); final BoardFrame new_frame = create_board_frame(design_file, null, board_option, startupOptions.test_version_option, startupOptions.current_locale); welcome_window.dispose(); if (new_frame == null) { System.exit(1); return; } new_frame.addWindowListener(new java.awt.event.WindowAdapter() {
/** * Main function of the Application * @param args */
Main function of the Application
main
{ "repo_name": "andrasfuchs/BioBalanceDetector", "path": "Tools/KiCad_FreeRouting/FreeRouting-miho-master/freerouting-master/src/main/java/eu/mihosoft/freerouting/gui/MainApplication.java", "license": "gpl-3.0", "size": 15842 }
[ "java.util.logging.Level", "java.util.logging.Logger", "javax.swing.UIManager", "javax.swing.UnsupportedLookAndFeelException" ]
import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException;
import java.util.logging.*; import javax.swing.*;
[ "java.util", "javax.swing" ]
java.util; javax.swing;
2,156,567
private static Connection connect(Ignite node) throws Exception { IgniteKernal node0 = (IgniteKernal)node; int port = node0.context().sqlListener().port(); return DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1:" + port); }
static Connection function(Ignite node) throws Exception { IgniteKernal node0 = (IgniteKernal)node; int port = node0.context().sqlListener().port(); return DriverManager.getConnection("jdbc:ignite:thin: }
/** * Get connection for node. * * @param node Node. * @return Connection. */
Get connection for node
connect
{ "repo_name": "samaitra/ignite", "path": "modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinWalModeChangeSelfTest.java", "license": "apache-2.0", "size": 4692 }
[ "java.sql.Connection", "java.sql.DriverManager", "org.apache.ignite.Ignite", "org.apache.ignite.internal.IgniteKernal" ]
import java.sql.Connection; import java.sql.DriverManager; import org.apache.ignite.Ignite; import org.apache.ignite.internal.IgniteKernal;
import java.sql.*; import org.apache.ignite.*; import org.apache.ignite.internal.*;
[ "java.sql", "org.apache.ignite" ]
java.sql; org.apache.ignite;
1,553,785
public Builder withNimbusWrapper(UnaryOperator<Nimbus> nimbusWrapper) { this.nimbusWrapper = nimbusWrapper; return this; }
Builder function(UnaryOperator<Nimbus> nimbusWrapper) { this.nimbusWrapper = nimbusWrapper; return this; }
/** * Before nimbus is created/used call nimbusWrapper on it first and use the * result instead. This is intended for internal testing only, and it here to * allow a mocking framework to spy on the nimbus class. */
Before nimbus is created/used call nimbusWrapper on it first and use the result instead. This is intended for internal testing only, and it here to allow a mocking framework to spy on the nimbus class
withNimbusWrapper
{ "repo_name": "carl34/storm", "path": "storm-server/src/main/java/org/apache/storm/LocalCluster.java", "license": "apache-2.0", "size": 43008 }
[ "java.util.function.UnaryOperator", "org.apache.storm.daemon.nimbus.Nimbus" ]
import java.util.function.UnaryOperator; import org.apache.storm.daemon.nimbus.Nimbus;
import java.util.function.*; import org.apache.storm.daemon.nimbus.*;
[ "java.util", "org.apache.storm" ]
java.util; org.apache.storm;
635,947
private static boolean isTooAggressive(Block currentBlock, Block newBlock) { Material currentType = currentBlock.getType(); Material newType = newBlock.getType(); if ((currentType.equals(Material.LEAVES) || currentType.equals(Material.AIR) || (Config.getInstance().getBlockModsEnabled() && ModChecks.isCustomLeafBlock(currentBlock))) && (newType.equals(Material.LEAVES) || newType.equals(Material.AIR) || (Config.getInstance().getBlockModsEnabled() && ModChecks.isCustomLeafBlock(currentBlock)))) { return true; } return false; }
static boolean function(Block currentBlock, Block newBlock) { Material currentType = currentBlock.getType(); Material newType = newBlock.getType(); if ((currentType.equals(Material.LEAVES) currentType.equals(Material.AIR) (Config.getInstance().getBlockModsEnabled() && ModChecks.isCustomLeafBlock(currentBlock))) && (newType.equals(Material.LEAVES) newType.equals(Material.AIR) (Config.getInstance().getBlockModsEnabled() && ModChecks.isCustomLeafBlock(currentBlock)))) { return true; } return false; }
/** * Check if Tree Feller is being too aggressive. * * @param currentBlock The current block being felled * @param newBlock The next block to be felled * @return true if Tree Feller is too aggressive, false otherwise */
Check if Tree Feller is being too aggressive
isTooAggressive
{ "repo_name": "javalangSystemwin/mcMMOPlus", "path": "src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java", "license": "agpl-3.0", "size": 20284 }
[ "com.gmail.nossr50.config.Config", "com.gmail.nossr50.util.ModChecks", "org.bukkit.Material", "org.bukkit.block.Block" ]
import com.gmail.nossr50.config.Config; import com.gmail.nossr50.util.ModChecks; import org.bukkit.Material; import org.bukkit.block.Block;
import com.gmail.nossr50.config.*; import com.gmail.nossr50.util.*; import org.bukkit.*; import org.bukkit.block.*;
[ "com.gmail.nossr50", "org.bukkit", "org.bukkit.block" ]
com.gmail.nossr50; org.bukkit; org.bukkit.block;
1,434,199
@Test (timeout=300000) public void testCreateTableRPCTimeOut() throws Exception { String name = "testCreateTableRPCTimeOut"; int oldTimeout = TEST_UTIL.getConfiguration(). getInt(HConstants.HBASE_RPC_TIMEOUT_KEY, HConstants.DEFAULT_HBASE_RPC_TIMEOUT); TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_RPC_TIMEOUT_KEY, 1500); try { int expectedRegions = 100; // Use 80 bit numbers to make sure we aren't limited byte [] startKey = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; byte [] endKey = { 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 }; HBaseAdmin hbaseadmin = new HBaseAdmin(TEST_UTIL.getConfiguration()); hbaseadmin.createTable(new HTableDescriptor(TableName.valueOf(name)), startKey, endKey, expectedRegions); hbaseadmin.close(); } finally { TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_RPC_TIMEOUT_KEY, oldTimeout); } }
@Test (timeout=300000) void function() throws Exception { String name = STR; int oldTimeout = TEST_UTIL.getConfiguration(). getInt(HConstants.HBASE_RPC_TIMEOUT_KEY, HConstants.DEFAULT_HBASE_RPC_TIMEOUT); TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_RPC_TIMEOUT_KEY, 1500); try { int expectedRegions = 100; byte [] startKey = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; byte [] endKey = { 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 }; HBaseAdmin hbaseadmin = new HBaseAdmin(TEST_UTIL.getConfiguration()); hbaseadmin.createTable(new HTableDescriptor(TableName.valueOf(name)), startKey, endKey, expectedRegions); hbaseadmin.close(); } finally { TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_RPC_TIMEOUT_KEY, oldTimeout); } }
/*** * HMaster.createTable used to be kind of synchronous call * Thus creating of table with lots of regions can cause RPC timeout * After the fix to make createTable truly async, RPC timeout shouldn't be an * issue anymore * @throws Exception */
HMaster.createTable used to be kind of synchronous call Thus creating of table with lots of regions can cause RPC timeout After the fix to make createTable truly async, RPC timeout shouldn't be an issue anymore
testCreateTableRPCTimeOut
{ "repo_name": "Jackygq1982/hbase_src", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin2.java", "license": "apache-2.0", "size": 27669 }
[ "org.apache.hadoop.hbase.HConstants", "org.apache.hadoop.hbase.HTableDescriptor", "org.apache.hadoop.hbase.TableName", "org.junit.Test" ]
import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; import org.junit.Test;
import org.apache.hadoop.hbase.*; import org.junit.*;
[ "org.apache.hadoop", "org.junit" ]
org.apache.hadoop; org.junit;
2,336,300
public static String changeDateFormate(String actual_frmt, String return_frmt, String current_date) { // TODO Auto-generated method stub SimpleDateFormat date_frmt_actual = new SimpleDateFormat(actual_frmt); SimpleDateFormat date_frmt_retrn = new SimpleDateFormat(return_frmt); Date temp_date = null; try { temp_date = date_frmt_actual.parse(current_date); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } String task_start_date = date_frmt_retrn.format(temp_date); return task_start_date; }
static String function(String actual_frmt, String return_frmt, String current_date) { SimpleDateFormat date_frmt_actual = new SimpleDateFormat(actual_frmt); SimpleDateFormat date_frmt_retrn = new SimpleDateFormat(return_frmt); Date temp_date = null; try { temp_date = date_frmt_actual.parse(current_date); } catch (ParseException e) { e.printStackTrace(); } String task_start_date = date_frmt_retrn.format(temp_date); return task_start_date; }
/*** * Change Date Format * ***/
Change Date Format
changeDateFormate
{ "repo_name": "jalotsav/Aalayam", "path": "app/src/main/java/com/jalotsav/aalayam/common/General_Fnctns.java", "license": "apache-2.0", "size": 25150 }
[ "java.text.ParseException", "java.text.SimpleDateFormat", "java.util.Date" ]
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date;
import java.text.*; import java.util.*;
[ "java.text", "java.util" ]
java.text; java.util;
2,017,707
int ordinal = getTableID().ordinal(); List<GlobalObject<?, ?>> objs; synchronized(locks[ordinal]) { synchronized(tableObjs) { objs=tableObjs.get(ordinal); } } if(objs!=null) return objs.size(); return -1; }
int ordinal = getTableID().ordinal(); List<GlobalObject<?, ?>> objs; synchronized(locks[ordinal]) { synchronized(tableObjs) { objs=tableObjs.get(ordinal); } } if(objs!=null) return objs.size(); return -1; }
/** * Gets the number of accessible rows in the table or <code>-1</code> if the * table is not yet loaded. */
Gets the number of accessible rows in the table or <code>-1</code> if the table is not yet loaded
getGlobalRowCount
{ "repo_name": "aoindustries/aoserv-client", "path": "src/main/java/com/aoindustries/aoserv/client/GlobalTable.java", "license": "lgpl-3.0", "size": 9939 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
367,240
private double getLengthMw(final int gewId) { double length = 0; for (final SbPartObjOffen tmp : objList) { if (((gewId == -1) || (tmp.getId() == gewId)) && (tmp.getMw() != null) && (tmp.getMw() != 0)) { length += tmp.getLength(); } } return length; }
double function(final int gewId) { double length = 0; for (final SbPartObjOffen tmp : objList) { if (((gewId == -1) (tmp.getId() == gewId)) && (tmp.getMw() != null) && (tmp.getMw() != 0)) { length += tmp.getLength(); } } return length; }
/** * DOCUMENT ME! * * @param gewId DOCUMENT ME! * * @return DOCUMENT ME! */
DOCUMENT ME
getLengthMw
{ "repo_name": "cismet/watergis-client", "path": "src/main/java/de/cismet/watergis/reports/GerinneOSbReport.java", "license": "lgpl-3.0", "size": 56987 }
[ "de.cismet.watergis.reports.types.SbPartObjOffen" ]
import de.cismet.watergis.reports.types.SbPartObjOffen;
import de.cismet.watergis.reports.types.*;
[ "de.cismet.watergis" ]
de.cismet.watergis;
2,912,207
private Game createGame() { ManagedChannel channel = createManagedChannel(); SimonSaysGrpc.SimonSaysStub asyncStub = createAsyncStub(channel);; return new Game(window, asyncStub); }
Game function() { ManagedChannel channel = createManagedChannel(); SimonSaysGrpc.SimonSaysStub asyncStub = createAsyncStub(channel);; return new Game(window, asyncStub); }
/** * Create a game. In order to create a game, you need: * * Read server ip and server port (using reader) and create a ManagedChannel. * Create an async stub using the created ManagedChannel. */
Create a game. In order to create a game, you need: Read server ip and server port (using reader) and create a ManagedChannel. Create an async stub using the created ManagedChannel
createGame
{ "repo_name": "grpc-ecosystem/grpc-simon-says", "path": "client/java-cli/src/main/java/io/grpc/examples/simonsays/Main.java", "license": "apache-2.0", "size": 3764 }
[ "io.grpc.ManagedChannel" ]
import io.grpc.ManagedChannel;
import io.grpc.*;
[ "io.grpc" ]
io.grpc;
462,319
private String getAudioFilePath() { Logger.v(TAG, "getFilePath()"); Context context = getInstrumentation().getTargetContext(); Cursor cursor = null; String filePath = null; try { cursor = context.getContentResolver().query( MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null, null, null, null); if (null != cursor && cursor.getCount() > 0) { cursor.moveToFirst(); filePath = cursor.getString(cursor .getColumnIndex(MediaStore.Images.ImageColumns.DATA)); } else { fail("testCase1_setChatGalleryWallPaper() Cannot find image in sdcard"); } } finally { if (cursor != null) { cursor.close(); cursor = null; } } Logger.v(TAG, "getFilePath() out, filePath is " + filePath); return filePath; }
String function() { Logger.v(TAG, STR); Context context = getInstrumentation().getTargetContext(); Cursor cursor = null; String filePath = null; try { cursor = context.getContentResolver().query( MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null, null, null, null); if (null != cursor && cursor.getCount() > 0) { cursor.moveToFirst(); filePath = cursor.getString(cursor .getColumnIndex(MediaStore.Images.ImageColumns.DATA)); } else { fail(STR); } } finally { if (cursor != null) { cursor.close(); cursor = null; } } Logger.v(TAG, STR + filePath); return filePath; }
/** * Get a audio file path from database */
Get a audio file path from database
getAudioFilePath
{ "repo_name": "rex-xxx/mt6572_x201", "path": "mediatek/packages/apps/RCSe/core/tests/src/com/mediatek/rcse/test/activity/PluginProxyActivityTest.java", "license": "gpl-2.0", "size": 56842 }
[ "android.content.Context", "android.database.Cursor", "android.provider.MediaStore", "com.mediatek.rcse.api.Logger" ]
import android.content.Context; import android.database.Cursor; import android.provider.MediaStore; import com.mediatek.rcse.api.Logger;
import android.content.*; import android.database.*; import android.provider.*; import com.mediatek.rcse.api.*;
[ "android.content", "android.database", "android.provider", "com.mediatek.rcse" ]
android.content; android.database; android.provider; com.mediatek.rcse;
2,609,819
public void testToVtnBuilder(XmlVTenant xvtn) throws Exception { XmlLogger xlogger = mock(XmlLogger.class); String tname = getName(); VtnBuilder builder = xvtn.toVtnBuilder(xlogger, tname); assertEquals(tname, builder.getName().getValue()); VtenantConfig vtnc = builder.getVtenantConfig(); assertEquals(getDescription(), vtnc.getDescription()); assertEquals(idleTimeout, vtnc.getIdleTimeout()); assertEquals(hardTimeout, vtnc.getHardTimeout()); VtnInputFilter in = builder.getVtnInputFilter(); if (inputFilters == null || inputFilters.isEmpty()) { assertEquals(null, in); } else { inputFilters.verify(in); VTenantIdentifier vtnId = VTenantIdentifier.create(tname, false); String fmt = "{}: {} flow filters have been loaded."; Mockito.verify(xlogger).log(VTNLogLevel.DEBUG, fmt, vtnId, "IN"); } verifyNoMoreInteractions(xlogger); // Other fields should be always null. assertEquals(null, builder.getVbridge()); assertEquals(null, builder.getVterminal()); assertEquals(null, builder.getVtnPathMaps()); }
void function(XmlVTenant xvtn) throws Exception { XmlLogger xlogger = mock(XmlLogger.class); String tname = getName(); VtnBuilder builder = xvtn.toVtnBuilder(xlogger, tname); assertEquals(tname, builder.getName().getValue()); VtenantConfig vtnc = builder.getVtenantConfig(); assertEquals(getDescription(), vtnc.getDescription()); assertEquals(idleTimeout, vtnc.getIdleTimeout()); assertEquals(hardTimeout, vtnc.getHardTimeout()); VtnInputFilter in = builder.getVtnInputFilter(); if (inputFilters == null inputFilters.isEmpty()) { assertEquals(null, in); } else { inputFilters.verify(in); VTenantIdentifier vtnId = VTenantIdentifier.create(tname, false); String fmt = STR; Mockito.verify(xlogger).log(VTNLogLevel.DEBUG, fmt, vtnId, "IN"); } verifyNoMoreInteractions(xlogger); assertEquals(null, builder.getVbridge()); assertEquals(null, builder.getVterminal()); assertEquals(null, builder.getVtnPathMaps()); }
/** * Test case for {@link XmlVTenant#toVtnBuilder(XmlLogger, String)}. * * @param xvtn A {@link XmlVTenant} instance that contains the same * configuration as this instance. * @throws Exception An error occurred. */
Test case for <code>XmlVTenant#toVtnBuilder(XmlLogger, String)</code>
testToVtnBuilder
{ "repo_name": "opendaylight/vtn", "path": "manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/vnode/xml/VTenantConfig.java", "license": "epl-1.0", "size": 10961 }
[ "org.junit.Assert", "org.mockito.Mockito", "org.opendaylight.vtn.manager.internal.util.log.VTNLogLevel", "org.opendaylight.vtn.manager.internal.util.vnode.VTenantIdentifier", "org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.rev150328.vtn.info.VtenantConfig", "org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.rev150328.vtn.info.VtnInputFilter", "org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.rev150328.vtns.VtnBuilder" ]
import org.junit.Assert; import org.mockito.Mockito; import org.opendaylight.vtn.manager.internal.util.log.VTNLogLevel; import org.opendaylight.vtn.manager.internal.util.vnode.VTenantIdentifier; import org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.rev150328.vtn.info.VtenantConfig; import org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.rev150328.vtn.info.VtnInputFilter; import org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.rev150328.vtns.VtnBuilder;
import org.junit.*; import org.mockito.*; import org.opendaylight.vtn.manager.internal.util.log.*; import org.opendaylight.vtn.manager.internal.util.vnode.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.rev150328.vtn.info.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.rev150328.vtns.*;
[ "org.junit", "org.mockito", "org.opendaylight.vtn", "org.opendaylight.yang" ]
org.junit; org.mockito; org.opendaylight.vtn; org.opendaylight.yang;
1,653,995
public static String resourceQualifierString(Configuration config) { ArrayList<String> parts = new ArrayList<String>(); if (config.mcc != 0) { parts.add("mcc" + config.mcc); if (config.mnc != 0) { parts.add("mnc" + config.mnc); } } if (!config.mLocaleList.isEmpty()) { final String resourceQualifier = localesToResourceQualifier(config.mLocaleList); if (!resourceQualifier.isEmpty()) { parts.add(resourceQualifier); } } switch (config.screenLayout & Configuration.SCREENLAYOUT_LAYOUTDIR_MASK) { case Configuration.SCREENLAYOUT_LAYOUTDIR_LTR: parts.add("ldltr"); break; case Configuration.SCREENLAYOUT_LAYOUTDIR_RTL: parts.add("ldrtl"); break; default: break; } if (config.smallestScreenWidthDp != 0) { parts.add("sw" + config.smallestScreenWidthDp + "dp"); } if (config.screenWidthDp != 0) { parts.add("w" + config.screenWidthDp + "dp"); } if (config.screenHeightDp != 0) { parts.add("h" + config.screenHeightDp + "dp"); } switch (config.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) { case Configuration.SCREENLAYOUT_SIZE_SMALL: parts.add("small"); break; case Configuration.SCREENLAYOUT_SIZE_NORMAL: parts.add("normal"); break; case Configuration.SCREENLAYOUT_SIZE_LARGE: parts.add("large"); break; case Configuration.SCREENLAYOUT_SIZE_XLARGE: parts.add("xlarge"); break; default: break; } switch (config.screenLayout & Configuration.SCREENLAYOUT_LONG_MASK) { case Configuration.SCREENLAYOUT_LONG_YES: parts.add("long"); break; case Configuration.SCREENLAYOUT_LONG_NO: parts.add("notlong"); break; default: break; } switch (config.screenLayout & Configuration.SCREENLAYOUT_ROUND_MASK) { case Configuration.SCREENLAYOUT_ROUND_YES: parts.add("round"); break; case Configuration.SCREENLAYOUT_ROUND_NO: parts.add("notround"); break; default: break; } switch (config.orientation) { case Configuration.ORIENTATION_LANDSCAPE: parts.add("land"); break; case Configuration.ORIENTATION_PORTRAIT: parts.add("port"); break; default: break; } switch (config.uiMode & Configuration.UI_MODE_TYPE_MASK) { case Configuration.UI_MODE_TYPE_APPLIANCE: parts.add("appliance"); break; case Configuration.UI_MODE_TYPE_DESK: parts.add("desk"); break; case Configuration.UI_MODE_TYPE_TELEVISION: parts.add("television"); break; case Configuration.UI_MODE_TYPE_CAR: parts.add("car"); break; case Configuration.UI_MODE_TYPE_WATCH: parts.add("watch"); break; default: break; } switch (config.uiMode & Configuration.UI_MODE_NIGHT_MASK) { case Configuration.UI_MODE_NIGHT_YES: parts.add("night"); break; case Configuration.UI_MODE_NIGHT_NO: parts.add("notnight"); break; default: break; } switch (config.densityDpi) { case DENSITY_DPI_UNDEFINED: break; case 120: parts.add("ldpi"); break; case 160: parts.add("mdpi"); break; case 213: parts.add("tvdpi"); break; case 240: parts.add("hdpi"); break; case 320: parts.add("xhdpi"); break; case 480: parts.add("xxhdpi"); break; case 640: parts.add("xxxhdpi"); break; case DENSITY_DPI_ANY: parts.add("anydpi"); break; case DENSITY_DPI_NONE: parts.add("nodpi"); default: parts.add(config.densityDpi + "dpi"); break; } switch (config.touchscreen) { case Configuration.TOUCHSCREEN_NOTOUCH: parts.add("notouch"); break; case Configuration.TOUCHSCREEN_FINGER: parts.add("finger"); break; default: break; } switch (config.keyboardHidden) { case Configuration.KEYBOARDHIDDEN_NO: parts.add("keysexposed"); break; case Configuration.KEYBOARDHIDDEN_YES: parts.add("keyshidden"); break; case Configuration.KEYBOARDHIDDEN_SOFT: parts.add("keyssoft"); break; default: break; } switch (config.keyboard) { case Configuration.KEYBOARD_NOKEYS: parts.add("nokeys"); break; case Configuration.KEYBOARD_QWERTY: parts.add("qwerty"); break; case Configuration.KEYBOARD_12KEY: parts.add("12key"); break; default: break; } switch (config.navigationHidden) { case Configuration.NAVIGATIONHIDDEN_NO: parts.add("navexposed"); break; case Configuration.NAVIGATIONHIDDEN_YES: parts.add("navhidden"); break; default: break; } switch (config.navigation) { case Configuration.NAVIGATION_NONAV: parts.add("nonav"); break; case Configuration.NAVIGATION_DPAD: parts.add("dpad"); break; case Configuration.NAVIGATION_TRACKBALL: parts.add("trackball"); break; case Configuration.NAVIGATION_WHEEL: parts.add("wheel"); break; default: break; } parts.add("v" + Build.VERSION.RESOURCES_SDK_INT); return TextUtils.join("-", parts); } /** * Generate a delta Configuration between <code>base</code> and <code>change</code>. The * resulting delta can be used with {@link #updateFrom(Configuration)}. * <p /> * Caveat: If the any of the Configuration's members becomes undefined, then * {@link #updateFrom(Configuration)} will treat it as a no-op and not update that member. * * This is fine for device configurations as no member is ever undefined. * {@hide}
static String function(Configuration config) { ArrayList<String> parts = new ArrayList<String>(); if (config.mcc != 0) { parts.add("mcc" + config.mcc); if (config.mnc != 0) { parts.add("mnc" + config.mnc); } } if (!config.mLocaleList.isEmpty()) { final String resourceQualifier = localesToResourceQualifier(config.mLocaleList); if (!resourceQualifier.isEmpty()) { parts.add(resourceQualifier); } } switch (config.screenLayout & Configuration.SCREENLAYOUT_LAYOUTDIR_MASK) { case Configuration.SCREENLAYOUT_LAYOUTDIR_LTR: parts.add("ldltr"); break; case Configuration.SCREENLAYOUT_LAYOUTDIR_RTL: parts.add("ldrtl"); break; default: break; } if (config.smallestScreenWidthDp != 0) { parts.add("sw" + config.smallestScreenWidthDp + "dp"); } if (config.screenWidthDp != 0) { parts.add("w" + config.screenWidthDp + "dp"); } if (config.screenHeightDp != 0) { parts.add("h" + config.screenHeightDp + "dp"); } switch (config.screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) { case Configuration.SCREENLAYOUT_SIZE_SMALL: parts.add("small"); break; case Configuration.SCREENLAYOUT_SIZE_NORMAL: parts.add(STR); break; case Configuration.SCREENLAYOUT_SIZE_LARGE: parts.add("large"); break; case Configuration.SCREENLAYOUT_SIZE_XLARGE: parts.add(STR); break; default: break; } switch (config.screenLayout & Configuration.SCREENLAYOUT_LONG_MASK) { case Configuration.SCREENLAYOUT_LONG_YES: parts.add("long"); break; case Configuration.SCREENLAYOUT_LONG_NO: parts.add(STR); break; default: break; } switch (config.screenLayout & Configuration.SCREENLAYOUT_ROUND_MASK) { case Configuration.SCREENLAYOUT_ROUND_YES: parts.add("round"); break; case Configuration.SCREENLAYOUT_ROUND_NO: parts.add(STR); break; default: break; } switch (config.orientation) { case Configuration.ORIENTATION_LANDSCAPE: parts.add("land"); break; case Configuration.ORIENTATION_PORTRAIT: parts.add("port"); break; default: break; } switch (config.uiMode & Configuration.UI_MODE_TYPE_MASK) { case Configuration.UI_MODE_TYPE_APPLIANCE: parts.add(STR); break; case Configuration.UI_MODE_TYPE_DESK: parts.add("desk"); break; case Configuration.UI_MODE_TYPE_TELEVISION: parts.add(STR); break; case Configuration.UI_MODE_TYPE_CAR: parts.add("car"); break; case Configuration.UI_MODE_TYPE_WATCH: parts.add("watch"); break; default: break; } switch (config.uiMode & Configuration.UI_MODE_NIGHT_MASK) { case Configuration.UI_MODE_NIGHT_YES: parts.add("night"); break; case Configuration.UI_MODE_NIGHT_NO: parts.add(STR); break; default: break; } switch (config.densityDpi) { case DENSITY_DPI_UNDEFINED: break; case 120: parts.add("ldpi"); break; case 160: parts.add("mdpi"); break; case 213: parts.add("tvdpi"); break; case 240: parts.add("hdpi"); break; case 320: parts.add("xhdpi"); break; case 480: parts.add(STR); break; case 640: parts.add(STR); break; case DENSITY_DPI_ANY: parts.add(STR); break; case DENSITY_DPI_NONE: parts.add("nodpi"); default: parts.add(config.densityDpi + "dpi"); break; } switch (config.touchscreen) { case Configuration.TOUCHSCREEN_NOTOUCH: parts.add(STR); break; case Configuration.TOUCHSCREEN_FINGER: parts.add(STR); break; default: break; } switch (config.keyboardHidden) { case Configuration.KEYBOARDHIDDEN_NO: parts.add(STR); break; case Configuration.KEYBOARDHIDDEN_YES: parts.add(STR); break; case Configuration.KEYBOARDHIDDEN_SOFT: parts.add(STR); break; default: break; } switch (config.keyboard) { case Configuration.KEYBOARD_NOKEYS: parts.add(STR); break; case Configuration.KEYBOARD_QWERTY: parts.add(STR); break; case Configuration.KEYBOARD_12KEY: parts.add("12key"); break; default: break; } switch (config.navigationHidden) { case Configuration.NAVIGATIONHIDDEN_NO: parts.add(STR); break; case Configuration.NAVIGATIONHIDDEN_YES: parts.add(STR); break; default: break; } switch (config.navigation) { case Configuration.NAVIGATION_NONAV: parts.add("nonav"); break; case Configuration.NAVIGATION_DPAD: parts.add("dpad"); break; case Configuration.NAVIGATION_TRACKBALL: parts.add(STR); break; case Configuration.NAVIGATION_WHEEL: parts.add("wheel"); break; default: break; } parts.add("v" + Build.VERSION.RESOURCES_SDK_INT); return TextUtils.join("-", parts); } /** * Generate a delta Configuration between <code>base</code> and <code>change</code>. The * resulting delta can be used with {@link #updateFrom(Configuration)}. * <p /> * Caveat: If the any of the Configuration's members becomes undefined, then * {@link #updateFrom(Configuration)} will treat it as a no-op and not update that member. * * This is fine for device configurations as no member is ever undefined. * {@hide}
/** * Returns a string representation of the configuration that can be parsed * by build tools (like AAPT). * * @hide */
Returns a string representation of the configuration that can be parsed by build tools (like AAPT)
resourceQualifierString
{ "repo_name": "xorware/android_frameworks_base", "path": "core/java/android/content/res/Configuration.java", "license": "apache-2.0", "size": 87508 }
[ "android.os.Build", "android.text.TextUtils", "java.util.ArrayList" ]
import android.os.Build; import android.text.TextUtils; import java.util.ArrayList;
import android.os.*; import android.text.*; import java.util.*;
[ "android.os", "android.text", "java.util" ]
android.os; android.text; java.util;
936,601
public boolean contains(Point p) { return false; }
boolean function(Point p) { return false; }
/** * Determines whether the specified {@link Point} is inside this <code>Polyline2D</code>. This method is required to * implement the Shape interface, but in the case of Line2D objects it always returns false since a line contains no * area. */
Determines whether the specified <code>Point</code> is inside this <code>Polyline2D</code>. This method is required to implement the Shape interface, but in the case of Line2D objects it always returns false since a line contains no area
contains
{ "repo_name": "Estada1401/anuwhscript", "path": "GameServer/src/com/aionemu/gameserver/model/geometry/Polyline2D.java", "license": "gpl-3.0", "size": 15266 }
[ "java.awt.Point" ]
import java.awt.Point;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,710,417
private void fitImageToView() { Drawable drawable = getDrawable(); if (drawable == null || drawable.getIntrinsicWidth() == 0 || drawable.getIntrinsicHeight() == 0) { return; } if (matrix == null || prevMatrix == null) { return; } int drawableWidth = drawable.getIntrinsicWidth(); int drawableHeight = drawable.getIntrinsicHeight(); // // Scale image for view // float scaleX = (float) viewWidth / drawableWidth; float scaleY = (float) viewHeight / drawableHeight; float scale = Math.min(scaleX, scaleY); // // Center the image // float redundantYSpace = viewHeight - (scale * drawableHeight); float redundantXSpace = viewWidth - (scale * drawableWidth); matchViewWidth = viewWidth - redundantXSpace; matchViewHeight = viewHeight - redundantYSpace; if (normalizedScale == 1 || setImageCalledRecenterImage) { // // Stretch and center image to fit view // matrix.setScale(scale, scale); matrix.postTranslate(redundantXSpace / 2, redundantYSpace / 2); normalizedScale = 1; setImageCalledRecenterImage = false; } else { prevMatrix.getValues(m); // // Rescale Matrix after rotation // m[Matrix.MSCALE_X] = matchViewWidth / drawableWidth * normalizedScale; m[Matrix.MSCALE_Y] = matchViewHeight / drawableHeight * normalizedScale; // // TransX and TransY from previous matrix // float transX = m[Matrix.MTRANS_X]; float transY = m[Matrix.MTRANS_Y]; // // Width // float prevActualWidth = prevMatchViewWidth * normalizedScale; float actualWidth = getImageWidth(); translateMatrixAfterRotate(Matrix.MTRANS_X, transX, prevActualWidth, actualWidth, prevViewWidth, viewWidth, drawableWidth); // // Height // float prevActualHeight = prevMatchViewHeight * normalizedScale; float actualHeight = getImageHeight(); translateMatrixAfterRotate(Matrix.MTRANS_Y, transY, prevActualHeight, actualHeight, prevViewHeight, viewHeight, drawableHeight); // // Set the matrix to the adjusted scale and translate values. // matrix.setValues(m); } setImageMatrix(matrix); }
void function() { Drawable drawable = getDrawable(); if (drawable == null drawable.getIntrinsicWidth() == 0 drawable.getIntrinsicHeight() == 0) { return; } if (matrix == null prevMatrix == null) { return; } int drawableWidth = drawable.getIntrinsicWidth(); int drawableHeight = drawable.getIntrinsicHeight(); float scaleY = (float) viewHeight / drawableHeight; float scale = Math.min(scaleX, scaleY); float redundantXSpace = viewWidth - (scale * drawableWidth); matchViewWidth = viewWidth - redundantXSpace; matchViewHeight = viewHeight - redundantYSpace; if (normalizedScale == 1 setImageCalledRecenterImage) { matrix.postTranslate(redundantXSpace / 2, redundantYSpace / 2); normalizedScale = 1; setImageCalledRecenterImage = false; } else { prevMatrix.getValues(m); m[Matrix.MSCALE_Y] = matchViewHeight / drawableHeight * normalizedScale; float transY = m[Matrix.MTRANS_Y]; float actualWidth = getImageWidth(); translateMatrixAfterRotate(Matrix.MTRANS_X, transX, prevActualWidth, actualWidth, prevViewWidth, viewWidth, drawableWidth); float actualHeight = getImageHeight(); translateMatrixAfterRotate(Matrix.MTRANS_Y, transY, prevActualHeight, actualHeight, prevViewHeight, viewHeight, drawableHeight); } setImageMatrix(matrix); }
/** * If the normalizedScale is equal to 1, then the image is made to fit the screen. Otherwise, * it is made to fit the screen according to the dimensions of the previous image matrix. This * allows the image to maintain its zoom after rotation. */
If the normalizedScale is equal to 1, then the image is made to fit the screen. Otherwise, it is made to fit the screen according to the dimensions of the previous image matrix. This allows the image to maintain its zoom after rotation
fitImageToView
{ "repo_name": "tcking/ImageCroppingView", "path": "app/src/main/java/com/github/tcking/imagecroppingview/ImageCroppingView.java", "license": "mit", "size": 33430 }
[ "android.graphics.Matrix", "android.graphics.drawable.Drawable" ]
import android.graphics.Matrix; import android.graphics.drawable.Drawable;
import android.graphics.*; import android.graphics.drawable.*;
[ "android.graphics" ]
android.graphics;
819,387
public void onLivingUpdate() { if (this.world.isRemote) { this.setHealth(this.getHealth()); if (!this.isSilent()) { float f = MathHelper.cos(this.animTime * ((float)Math.PI * 2F)); float f1 = MathHelper.cos(this.prevAnimTime * ((float)Math.PI * 2F)); if (f1 <= -0.3F && f >= -0.3F) { this.world.playSound(this.posX, this.posY, this.posZ, SoundEvents.ENTITY_ENDERDRAGON_FLAP, this.getSoundCategory(), 5.0F, 0.8F + this.rand.nextFloat() * 0.3F, false); } if (!this.phaseManager.getCurrentPhase().getIsStationary() && --this.growlTime < 0) { this.world.playSound(this.posX, this.posY, this.posZ, SoundEvents.ENTITY_ENDERDRAGON_GROWL, this.getSoundCategory(), 2.5F, 0.8F + this.rand.nextFloat() * 0.3F, false); this.growlTime = 200 + this.rand.nextInt(200); } } } this.prevAnimTime = this.animTime; if (this.getHealth() <= 0.0F) { float f12 = (this.rand.nextFloat() - 0.5F) * 8.0F; float f13 = (this.rand.nextFloat() - 0.5F) * 4.0F; float f15 = (this.rand.nextFloat() - 0.5F) * 8.0F; this.world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX + (double)f12, this.posY + 2.0D + (double)f13, this.posZ + (double)f15, 0.0D, 0.0D, 0.0D, new int[0]); } else { this.updateDragonEnderCrystal(); float f11 = 0.2F / (MathHelper.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ) * 10.0F + 1.0F); f11 = f11 * (float)Math.pow(2.0D, this.motionY); if (this.phaseManager.getCurrentPhase().getIsStationary()) { this.animTime += 0.1F; } else if (this.slowed) { this.animTime += f11 * 0.5F; } else { this.animTime += f11; } this.rotationYaw = MathHelper.wrapDegrees(this.rotationYaw); if (this.isAIDisabled()) { this.animTime = 0.5F; } else { if (this.ringBufferIndex < 0) { for (int i = 0; i < this.ringBuffer.length; ++i) { this.ringBuffer[i][0] = (double)this.rotationYaw; this.ringBuffer[i][1] = this.posY; } } if (++this.ringBufferIndex == this.ringBuffer.length) { this.ringBufferIndex = 0; } this.ringBuffer[this.ringBufferIndex][0] = (double)this.rotationYaw; this.ringBuffer[this.ringBufferIndex][1] = this.posY; if (this.world.isRemote) { if (this.newPosRotationIncrements > 0) { double d5 = this.posX + (this.interpTargetX - this.posX) / (double)this.newPosRotationIncrements; double d0 = this.posY + (this.interpTargetY - this.posY) / (double)this.newPosRotationIncrements; double d1 = this.posZ + (this.interpTargetZ - this.posZ) / (double)this.newPosRotationIncrements; double d2 = MathHelper.wrapDegrees(this.interpTargetYaw - (double)this.rotationYaw); this.rotationYaw = (float)((double)this.rotationYaw + d2 / (double)this.newPosRotationIncrements); this.rotationPitch = (float)((double)this.rotationPitch + (this.interpTargetPitch - (double)this.rotationPitch) / (double)this.newPosRotationIncrements); --this.newPosRotationIncrements; this.setPosition(d5, d0, d1); this.setRotation(this.rotationYaw, this.rotationPitch); } this.phaseManager.getCurrentPhase().doClientRenderEffects(); } else { IPhase iphase = this.phaseManager.getCurrentPhase(); iphase.doLocalUpdate(); if (this.phaseManager.getCurrentPhase() != iphase) { iphase = this.phaseManager.getCurrentPhase(); iphase.doLocalUpdate(); } Vec3d vec3d = iphase.getTargetLocation(); if (vec3d != null) { double d6 = vec3d.xCoord - this.posX; double d7 = vec3d.yCoord - this.posY; double d8 = vec3d.zCoord - this.posZ; double d3 = d6 * d6 + d7 * d7 + d8 * d8; float f5 = iphase.getMaxRiseOrFall(); d7 = MathHelper.clamp(d7 / (double)MathHelper.sqrt(d6 * d6 + d8 * d8), (double)(-f5), (double)f5); this.motionY += d7 * 0.10000000149011612D; this.rotationYaw = MathHelper.wrapDegrees(this.rotationYaw); double d4 = MathHelper.clamp(MathHelper.wrapDegrees(180.0D - MathHelper.atan2(d6, d8) * (180D / Math.PI) - (double)this.rotationYaw), -50.0D, 50.0D); Vec3d vec3d1 = (new Vec3d(vec3d.xCoord - this.posX, vec3d.yCoord - this.posY, vec3d.zCoord - this.posZ)).normalize(); Vec3d vec3d2 = (new Vec3d((double)MathHelper.sin(this.rotationYaw * 0.017453292F), this.motionY, (double)(-MathHelper.cos(this.rotationYaw * 0.017453292F)))).normalize(); float f7 = Math.max(((float)vec3d2.dotProduct(vec3d1) + 0.5F) / 1.5F, 0.0F); this.randomYawVelocity *= 0.8F; this.randomYawVelocity = (float)((double)this.randomYawVelocity + d4 * (double)iphase.getYawFactor()); this.rotationYaw += this.randomYawVelocity * 0.1F; float f8 = (float)(2.0D / (d3 + 1.0D)); float f9 = 0.06F; this.moveRelative(0.0F, -1.0F, 0.06F * (f7 * f8 + (1.0F - f8))); if (this.slowed) { this.move(MoverType.SELF, this.motionX * 0.800000011920929D, this.motionY * 0.800000011920929D, this.motionZ * 0.800000011920929D); } else { this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ); } Vec3d vec3d3 = (new Vec3d(this.motionX, this.motionY, this.motionZ)).normalize(); float f10 = ((float)vec3d3.dotProduct(vec3d2) + 1.0F) / 2.0F; f10 = 0.8F + 0.15F * f10; this.motionX *= (double)f10; this.motionZ *= (double)f10; this.motionY *= 0.9100000262260437D; } } this.renderYawOffset = this.rotationYaw; this.dragonPartHead.width = 1.0F; this.dragonPartHead.height = 1.0F; this.dragonPartNeck.width = 3.0F; this.dragonPartNeck.height = 3.0F; this.dragonPartTail1.width = 2.0F; this.dragonPartTail1.height = 2.0F; this.dragonPartTail2.width = 2.0F; this.dragonPartTail2.height = 2.0F; this.dragonPartTail3.width = 2.0F; this.dragonPartTail3.height = 2.0F; this.dragonPartBody.height = 3.0F; this.dragonPartBody.width = 5.0F; this.dragonPartWing1.height = 2.0F; this.dragonPartWing1.width = 4.0F; this.dragonPartWing2.height = 3.0F; this.dragonPartWing2.width = 4.0F; Vec3d[] avec3d = new Vec3d[this.dragonPartArray.length]; for (int j = 0; j < this.dragonPartArray.length; ++j) { avec3d[j] = new Vec3d(this.dragonPartArray[j].posX, this.dragonPartArray[j].posY, this.dragonPartArray[j].posZ); } float f14 = (float)(this.getMovementOffsets(5, 1.0F)[1] - this.getMovementOffsets(10, 1.0F)[1]) * 10.0F * 0.017453292F; float f16 = MathHelper.cos(f14); float f2 = MathHelper.sin(f14); float f17 = this.rotationYaw * 0.017453292F; float f3 = MathHelper.sin(f17); float f18 = MathHelper.cos(f17); this.dragonPartBody.onUpdate(); this.dragonPartBody.setLocationAndAngles(this.posX + (double)(f3 * 0.5F), this.posY, this.posZ - (double)(f18 * 0.5F), 0.0F, 0.0F); this.dragonPartWing1.onUpdate(); this.dragonPartWing1.setLocationAndAngles(this.posX + (double)(f18 * 4.5F), this.posY + 2.0D, this.posZ + (double)(f3 * 4.5F), 0.0F, 0.0F); this.dragonPartWing2.onUpdate(); this.dragonPartWing2.setLocationAndAngles(this.posX - (double)(f18 * 4.5F), this.posY + 2.0D, this.posZ - (double)(f3 * 4.5F), 0.0F, 0.0F); if (!this.world.isRemote && this.hurtTime == 0) { this.collideWithEntities(this.world.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing1.getEntityBoundingBox().expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); this.collideWithEntities(this.world.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing2.getEntityBoundingBox().expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); this.attackEntitiesInList(this.world.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartHead.getEntityBoundingBox().expandXyz(1.0D))); this.attackEntitiesInList(this.world.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartNeck.getEntityBoundingBox().expandXyz(1.0D))); } double[] adouble = this.getMovementOffsets(5, 1.0F); float f19 = MathHelper.sin(this.rotationYaw * 0.017453292F - this.randomYawVelocity * 0.01F); float f4 = MathHelper.cos(this.rotationYaw * 0.017453292F - this.randomYawVelocity * 0.01F); this.dragonPartHead.onUpdate(); this.dragonPartNeck.onUpdate(); float f20 = this.getHeadYOffset(1.0F); this.dragonPartHead.setLocationAndAngles(this.posX + (double)(f19 * 6.5F * f16), this.posY + (double)f20 + (double)(f2 * 6.5F), this.posZ - (double)(f4 * 6.5F * f16), 0.0F, 0.0F); this.dragonPartNeck.setLocationAndAngles(this.posX + (double)(f19 * 5.5F * f16), this.posY + (double)f20 + (double)(f2 * 5.5F), this.posZ - (double)(f4 * 5.5F * f16), 0.0F, 0.0F); for (int k = 0; k < 3; ++k) { EntityDragonPart entitydragonpart = null; if (k == 0) { entitydragonpart = this.dragonPartTail1; } if (k == 1) { entitydragonpart = this.dragonPartTail2; } if (k == 2) { entitydragonpart = this.dragonPartTail3; } double[] adouble1 = this.getMovementOffsets(12 + k * 2, 1.0F); float f21 = this.rotationYaw * 0.017453292F + this.simplifyAngle(adouble1[0] - adouble[0]) * 0.017453292F; float f6 = MathHelper.sin(f21); float f22 = MathHelper.cos(f21); float f23 = 1.5F; float f24 = (float)(k + 1) * 2.0F; entitydragonpart.onUpdate(); entitydragonpart.setLocationAndAngles(this.posX - (double)((f3 * 1.5F + f6 * f24) * f16), this.posY + (adouble1[1] - adouble[1]) - (double)((f24 + 1.5F) * f2) + 1.5D, this.posZ + (double)((f18 * 1.5F + f22 * f24) * f16), 0.0F, 0.0F); } if (!this.world.isRemote) { this.slowed = this.destroyBlocksInAABB(this.dragonPartHead.getEntityBoundingBox()) | this.destroyBlocksInAABB(this.dragonPartNeck.getEntityBoundingBox()) | this.destroyBlocksInAABB(this.dragonPartBody.getEntityBoundingBox()); if (this.fightManager != null) { this.fightManager.dragonUpdate(this); } } for (int l = 0; l < this.dragonPartArray.length; ++l) { this.dragonPartArray[l].prevPosX = avec3d[l].xCoord; this.dragonPartArray[l].prevPosY = avec3d[l].yCoord; this.dragonPartArray[l].prevPosZ = avec3d[l].zCoord; } } } }
void function() { if (this.world.isRemote) { this.setHealth(this.getHealth()); if (!this.isSilent()) { float f = MathHelper.cos(this.animTime * ((float)Math.PI * 2F)); float f1 = MathHelper.cos(this.prevAnimTime * ((float)Math.PI * 2F)); if (f1 <= -0.3F && f >= -0.3F) { this.world.playSound(this.posX, this.posY, this.posZ, SoundEvents.ENTITY_ENDERDRAGON_FLAP, this.getSoundCategory(), 5.0F, 0.8F + this.rand.nextFloat() * 0.3F, false); } if (!this.phaseManager.getCurrentPhase().getIsStationary() && --this.growlTime < 0) { this.world.playSound(this.posX, this.posY, this.posZ, SoundEvents.ENTITY_ENDERDRAGON_GROWL, this.getSoundCategory(), 2.5F, 0.8F + this.rand.nextFloat() * 0.3F, false); this.growlTime = 200 + this.rand.nextInt(200); } } } this.prevAnimTime = this.animTime; if (this.getHealth() <= 0.0F) { float f12 = (this.rand.nextFloat() - 0.5F) * 8.0F; float f13 = (this.rand.nextFloat() - 0.5F) * 4.0F; float f15 = (this.rand.nextFloat() - 0.5F) * 8.0F; this.world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX + (double)f12, this.posY + 2.0D + (double)f13, this.posZ + (double)f15, 0.0D, 0.0D, 0.0D, new int[0]); } else { this.updateDragonEnderCrystal(); float f11 = 0.2F / (MathHelper.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ) * 10.0F + 1.0F); f11 = f11 * (float)Math.pow(2.0D, this.motionY); if (this.phaseManager.getCurrentPhase().getIsStationary()) { this.animTime += 0.1F; } else if (this.slowed) { this.animTime += f11 * 0.5F; } else { this.animTime += f11; } this.rotationYaw = MathHelper.wrapDegrees(this.rotationYaw); if (this.isAIDisabled()) { this.animTime = 0.5F; } else { if (this.ringBufferIndex < 0) { for (int i = 0; i < this.ringBuffer.length; ++i) { this.ringBuffer[i][0] = (double)this.rotationYaw; this.ringBuffer[i][1] = this.posY; } } if (++this.ringBufferIndex == this.ringBuffer.length) { this.ringBufferIndex = 0; } this.ringBuffer[this.ringBufferIndex][0] = (double)this.rotationYaw; this.ringBuffer[this.ringBufferIndex][1] = this.posY; if (this.world.isRemote) { if (this.newPosRotationIncrements > 0) { double d5 = this.posX + (this.interpTargetX - this.posX) / (double)this.newPosRotationIncrements; double d0 = this.posY + (this.interpTargetY - this.posY) / (double)this.newPosRotationIncrements; double d1 = this.posZ + (this.interpTargetZ - this.posZ) / (double)this.newPosRotationIncrements; double d2 = MathHelper.wrapDegrees(this.interpTargetYaw - (double)this.rotationYaw); this.rotationYaw = (float)((double)this.rotationYaw + d2 / (double)this.newPosRotationIncrements); this.rotationPitch = (float)((double)this.rotationPitch + (this.interpTargetPitch - (double)this.rotationPitch) / (double)this.newPosRotationIncrements); --this.newPosRotationIncrements; this.setPosition(d5, d0, d1); this.setRotation(this.rotationYaw, this.rotationPitch); } this.phaseManager.getCurrentPhase().doClientRenderEffects(); } else { IPhase iphase = this.phaseManager.getCurrentPhase(); iphase.doLocalUpdate(); if (this.phaseManager.getCurrentPhase() != iphase) { iphase = this.phaseManager.getCurrentPhase(); iphase.doLocalUpdate(); } Vec3d vec3d = iphase.getTargetLocation(); if (vec3d != null) { double d6 = vec3d.xCoord - this.posX; double d7 = vec3d.yCoord - this.posY; double d8 = vec3d.zCoord - this.posZ; double d3 = d6 * d6 + d7 * d7 + d8 * d8; float f5 = iphase.getMaxRiseOrFall(); d7 = MathHelper.clamp(d7 / (double)MathHelper.sqrt(d6 * d6 + d8 * d8), (double)(-f5), (double)f5); this.motionY += d7 * 0.10000000149011612D; this.rotationYaw = MathHelper.wrapDegrees(this.rotationYaw); double d4 = MathHelper.clamp(MathHelper.wrapDegrees(180.0D - MathHelper.atan2(d6, d8) * (180D / Math.PI) - (double)this.rotationYaw), -50.0D, 50.0D); Vec3d vec3d1 = (new Vec3d(vec3d.xCoord - this.posX, vec3d.yCoord - this.posY, vec3d.zCoord - this.posZ)).normalize(); Vec3d vec3d2 = (new Vec3d((double)MathHelper.sin(this.rotationYaw * 0.017453292F), this.motionY, (double)(-MathHelper.cos(this.rotationYaw * 0.017453292F)))).normalize(); float f7 = Math.max(((float)vec3d2.dotProduct(vec3d1) + 0.5F) / 1.5F, 0.0F); this.randomYawVelocity *= 0.8F; this.randomYawVelocity = (float)((double)this.randomYawVelocity + d4 * (double)iphase.getYawFactor()); this.rotationYaw += this.randomYawVelocity * 0.1F; float f8 = (float)(2.0D / (d3 + 1.0D)); float f9 = 0.06F; this.moveRelative(0.0F, -1.0F, 0.06F * (f7 * f8 + (1.0F - f8))); if (this.slowed) { this.move(MoverType.SELF, this.motionX * 0.800000011920929D, this.motionY * 0.800000011920929D, this.motionZ * 0.800000011920929D); } else { this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ); } Vec3d vec3d3 = (new Vec3d(this.motionX, this.motionY, this.motionZ)).normalize(); float f10 = ((float)vec3d3.dotProduct(vec3d2) + 1.0F) / 2.0F; f10 = 0.8F + 0.15F * f10; this.motionX *= (double)f10; this.motionZ *= (double)f10; this.motionY *= 0.9100000262260437D; } } this.renderYawOffset = this.rotationYaw; this.dragonPartHead.width = 1.0F; this.dragonPartHead.height = 1.0F; this.dragonPartNeck.width = 3.0F; this.dragonPartNeck.height = 3.0F; this.dragonPartTail1.width = 2.0F; this.dragonPartTail1.height = 2.0F; this.dragonPartTail2.width = 2.0F; this.dragonPartTail2.height = 2.0F; this.dragonPartTail3.width = 2.0F; this.dragonPartTail3.height = 2.0F; this.dragonPartBody.height = 3.0F; this.dragonPartBody.width = 5.0F; this.dragonPartWing1.height = 2.0F; this.dragonPartWing1.width = 4.0F; this.dragonPartWing2.height = 3.0F; this.dragonPartWing2.width = 4.0F; Vec3d[] avec3d = new Vec3d[this.dragonPartArray.length]; for (int j = 0; j < this.dragonPartArray.length; ++j) { avec3d[j] = new Vec3d(this.dragonPartArray[j].posX, this.dragonPartArray[j].posY, this.dragonPartArray[j].posZ); } float f14 = (float)(this.getMovementOffsets(5, 1.0F)[1] - this.getMovementOffsets(10, 1.0F)[1]) * 10.0F * 0.017453292F; float f16 = MathHelper.cos(f14); float f2 = MathHelper.sin(f14); float f17 = this.rotationYaw * 0.017453292F; float f3 = MathHelper.sin(f17); float f18 = MathHelper.cos(f17); this.dragonPartBody.onUpdate(); this.dragonPartBody.setLocationAndAngles(this.posX + (double)(f3 * 0.5F), this.posY, this.posZ - (double)(f18 * 0.5F), 0.0F, 0.0F); this.dragonPartWing1.onUpdate(); this.dragonPartWing1.setLocationAndAngles(this.posX + (double)(f18 * 4.5F), this.posY + 2.0D, this.posZ + (double)(f3 * 4.5F), 0.0F, 0.0F); this.dragonPartWing2.onUpdate(); this.dragonPartWing2.setLocationAndAngles(this.posX - (double)(f18 * 4.5F), this.posY + 2.0D, this.posZ - (double)(f3 * 4.5F), 0.0F, 0.0F); if (!this.world.isRemote && this.hurtTime == 0) { this.collideWithEntities(this.world.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing1.getEntityBoundingBox().expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); this.collideWithEntities(this.world.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing2.getEntityBoundingBox().expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); this.attackEntitiesInList(this.world.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartHead.getEntityBoundingBox().expandXyz(1.0D))); this.attackEntitiesInList(this.world.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartNeck.getEntityBoundingBox().expandXyz(1.0D))); } double[] adouble = this.getMovementOffsets(5, 1.0F); float f19 = MathHelper.sin(this.rotationYaw * 0.017453292F - this.randomYawVelocity * 0.01F); float f4 = MathHelper.cos(this.rotationYaw * 0.017453292F - this.randomYawVelocity * 0.01F); this.dragonPartHead.onUpdate(); this.dragonPartNeck.onUpdate(); float f20 = this.getHeadYOffset(1.0F); this.dragonPartHead.setLocationAndAngles(this.posX + (double)(f19 * 6.5F * f16), this.posY + (double)f20 + (double)(f2 * 6.5F), this.posZ - (double)(f4 * 6.5F * f16), 0.0F, 0.0F); this.dragonPartNeck.setLocationAndAngles(this.posX + (double)(f19 * 5.5F * f16), this.posY + (double)f20 + (double)(f2 * 5.5F), this.posZ - (double)(f4 * 5.5F * f16), 0.0F, 0.0F); for (int k = 0; k < 3; ++k) { EntityDragonPart entitydragonpart = null; if (k == 0) { entitydragonpart = this.dragonPartTail1; } if (k == 1) { entitydragonpart = this.dragonPartTail2; } if (k == 2) { entitydragonpart = this.dragonPartTail3; } double[] adouble1 = this.getMovementOffsets(12 + k * 2, 1.0F); float f21 = this.rotationYaw * 0.017453292F + this.simplifyAngle(adouble1[0] - adouble[0]) * 0.017453292F; float f6 = MathHelper.sin(f21); float f22 = MathHelper.cos(f21); float f23 = 1.5F; float f24 = (float)(k + 1) * 2.0F; entitydragonpart.onUpdate(); entitydragonpart.setLocationAndAngles(this.posX - (double)((f3 * 1.5F + f6 * f24) * f16), this.posY + (adouble1[1] - adouble[1]) - (double)((f24 + 1.5F) * f2) + 1.5D, this.posZ + (double)((f18 * 1.5F + f22 * f24) * f16), 0.0F, 0.0F); } if (!this.world.isRemote) { this.slowed = this.destroyBlocksInAABB(this.dragonPartHead.getEntityBoundingBox()) this.destroyBlocksInAABB(this.dragonPartNeck.getEntityBoundingBox()) this.destroyBlocksInAABB(this.dragonPartBody.getEntityBoundingBox()); if (this.fightManager != null) { this.fightManager.dragonUpdate(this); } } for (int l = 0; l < this.dragonPartArray.length; ++l) { this.dragonPartArray[l].prevPosX = avec3d[l].xCoord; this.dragonPartArray[l].prevPosY = avec3d[l].yCoord; this.dragonPartArray[l].prevPosZ = avec3d[l].zCoord; } } } }
/** * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons * use this to react to sunlight and start to burn. */
Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use this to react to sunlight and start to burn
onLivingUpdate
{ "repo_name": "SuperUnitato/UnLonely", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/boss/EntityDragon.java", "license": "lgpl-2.1", "size": 45484 }
[ "net.minecraft.entity.MoverType", "net.minecraft.entity.boss.dragon.phase.IPhase", "net.minecraft.init.SoundEvents", "net.minecraft.util.EnumParticleTypes", "net.minecraft.util.math.MathHelper", "net.minecraft.util.math.Vec3d" ]
import net.minecraft.entity.MoverType; import net.minecraft.entity.boss.dragon.phase.IPhase; import net.minecraft.init.SoundEvents; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d;
import net.minecraft.entity.*; import net.minecraft.entity.boss.dragon.phase.*; import net.minecraft.init.*; import net.minecraft.util.*; import net.minecraft.util.math.*;
[ "net.minecraft.entity", "net.minecraft.init", "net.minecraft.util" ]
net.minecraft.entity; net.minecraft.init; net.minecraft.util;
1,842,107
@Nullable public ClientConnectorConfiguration getClientConnectorConfiguration() { return cliConnCfg; }
@Nullable ClientConnectorConfiguration function() { return cliConnCfg; }
/** * Gets client connector configuration. * * @return Client connector configuration. */
Gets client connector configuration
getClientConnectorConfiguration
{ "repo_name": "nizhikov/ignite", "path": "modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java", "license": "apache-2.0", "size": 125128 }
[ "org.jetbrains.annotations.Nullable" ]
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.*;
[ "org.jetbrains.annotations" ]
org.jetbrains.annotations;
1,224,781
private IScript getParsedScript() { IAsset scriptAsset = getScriptAsset(); String scriptPath = getScriptPath(); //only one of the two is allowed if (scriptAsset != null && scriptPath != null) throw new ApplicationRuntimeException(HTMLMessages.multiAssetParameterError(getBinding("scriptAsset"), getBinding("scriptPath"))); if (scriptPath == null && scriptAsset == null) throw new ApplicationRuntimeException(HTMLMessages.noScriptPathError()); IScriptSource source = getScriptSource(); Resource scriptLocation = null; if (scriptPath != null) { // If the script path is relative, it should be relative to the Script component's // container (i.e., relative to a page in the application). Resource rootLocation = getContainer().getSpecification().getSpecificationLocation(); scriptLocation = rootLocation.getRelativeResource(scriptPath); } else scriptLocation = scriptAsset.getResourceLocation(); try { return source.getScript(scriptLocation); } catch (RuntimeException ex) { throw new ApplicationRuntimeException(ex.getMessage(), this, getBinding("script") .getLocation(), ex); } }
IScript function() { IAsset scriptAsset = getScriptAsset(); String scriptPath = getScriptPath(); if (scriptAsset != null && scriptPath != null) throw new ApplicationRuntimeException(HTMLMessages.multiAssetParameterError(getBinding(STR), getBinding(STR))); if (scriptPath == null && scriptAsset == null) throw new ApplicationRuntimeException(HTMLMessages.noScriptPathError()); IScriptSource source = getScriptSource(); Resource scriptLocation = null; if (scriptPath != null) { Resource rootLocation = getContainer().getSpecification().getSpecificationLocation(); scriptLocation = rootLocation.getRelativeResource(scriptPath); } else scriptLocation = scriptAsset.getResourceLocation(); try { return source.getScript(scriptLocation); } catch (RuntimeException ex) { throw new ApplicationRuntimeException(ex.getMessage(), this, getBinding(STR) .getLocation(), ex); } }
/** * Gets the {@link IScript}for the correct script. */
Gets the <code>IScript</code>for the correct script
getParsedScript
{ "repo_name": "apache/tapestry4", "path": "framework/src/java/org/apache/tapestry/html/Script.java", "license": "apache-2.0", "size": 5504 }
[ "org.apache.hivemind.ApplicationRuntimeException", "org.apache.hivemind.Resource", "org.apache.tapestry.IAsset", "org.apache.tapestry.IScript", "org.apache.tapestry.engine.IScriptSource" ]
import org.apache.hivemind.ApplicationRuntimeException; import org.apache.hivemind.Resource; import org.apache.tapestry.IAsset; import org.apache.tapestry.IScript; import org.apache.tapestry.engine.IScriptSource;
import org.apache.hivemind.*; import org.apache.tapestry.*; import org.apache.tapestry.engine.*;
[ "org.apache.hivemind", "org.apache.tapestry" ]
org.apache.hivemind; org.apache.tapestry;
2,580,631
public Comparator<T> getComparator();
Comparator<T> function();
/** * Retrieve the natural comparator for this type. * * @return The natural comparator. */
Retrieve the natural comparator for this type
getComparator
{ "repo_name": "codeApeFromChina/resource", "path": "frame_packages/java_libs/hibernate-distribution-3.6.10.Final/project/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JavaTypeDescriptor.java", "license": "unlicense", "size": 3495 }
[ "java.util.Comparator" ]
import java.util.Comparator;
import java.util.*;
[ "java.util" ]
java.util;
1,728,347
default Set<String> getProperties(String component) { return ImmutableSet.of(); }
default Set<String> getProperties(String component) { return ImmutableSet.of(); }
/** * Returns set of component configuration property names. This includes * only the names of properties whose values depart from their default. * * @param component component name * @return set of property names whose values are set to non-default values */
Returns set of component configuration property names. This includes only the names of properties whose values depart from their default
getProperties
{ "repo_name": "opennetworkinglab/onos", "path": "core/api/src/main/java/org/onosproject/cfg/ComponentConfigStore.java", "license": "apache-2.0", "size": 2824 }
[ "com.google.common.collect.ImmutableSet", "java.util.Set" ]
import com.google.common.collect.ImmutableSet; import java.util.Set;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
1,773,222
@Nullable public OrganizationalBranding post(@Nonnull final OrganizationalBranding newOrganizationalBranding) throws ClientException { return send(HttpMethod.POST, newOrganizationalBranding); }
OrganizationalBranding function(@Nonnull final OrganizationalBranding newOrganizationalBranding) throws ClientException { return send(HttpMethod.POST, newOrganizationalBranding); }
/** * Creates a OrganizationalBranding with a new object * * @param newOrganizationalBranding the new object to create * @return the created OrganizationalBranding * @throws ClientException this exception occurs if the request was unable to complete for any reason */
Creates a OrganizationalBranding with a new object
post
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/requests/OrganizationalBrandingRequest.java", "license": "mit", "size": 6504 }
[ "com.microsoft.graph.core.ClientException", "com.microsoft.graph.http.HttpMethod", "com.microsoft.graph.models.OrganizationalBranding", "javax.annotation.Nonnull" ]
import com.microsoft.graph.core.ClientException; import com.microsoft.graph.http.HttpMethod; import com.microsoft.graph.models.OrganizationalBranding; import javax.annotation.Nonnull;
import com.microsoft.graph.core.*; import com.microsoft.graph.http.*; import com.microsoft.graph.models.*; import javax.annotation.*;
[ "com.microsoft.graph", "javax.annotation" ]
com.microsoft.graph; javax.annotation;
568,670
registry = Registry.newInstance(); registry.setPrioritizer(fifo); ff.put(APP, "FF"); RemoteProxy p1 = RemoteProxyFactory.getNewBasicRemoteProxy(ff, "http://machine1:4444", registry); registry.add(p1); for (int i = 1; i <= MAX; i++) { Map<String, Object> cap = new HashMap<>(); cap.put(APP, "FF"); cap.put("_priority", i); MockedRequestHandler req = GridHelper.createNewSessionHandler(registry, cap); requests.add(req); } // use all the spots ( so 1 ) of the grid so that a queue builds up MockedRequestHandler newSessionRequest =GridHelper.createNewSessionHandler(registry, ff); newSessionRequest.process(); TestSession session = newSessionRequest.getSession();
registry = Registry.newInstance(); registry.setPrioritizer(fifo); ff.put(APP, "FF"); RemoteProxy p1 = RemoteProxyFactory.getNewBasicRemoteProxy(ff, STRFFSTR_priority", i); MockedRequestHandler req = GridHelper.createNewSessionHandler(registry, cap); requests.add(req); } MockedRequestHandler newSessionRequest =GridHelper.createNewSessionHandler(registry, ff); newSessionRequest.process(); TestSession session = newSessionRequest.getSession();
/** * create a hub with 1 FF * * @throws InterruptedException */
create a hub with 1 FF
setup
{ "repo_name": "doungni/selenium", "path": "java/server/test/org/openqa/grid/internal/DefaultToFIFOPriorityTest.java", "license": "apache-2.0", "size": 3774 }
[ "org.openqa.grid.internal.mock.GridHelper", "org.openqa.grid.internal.mock.MockedRequestHandler" ]
import org.openqa.grid.internal.mock.GridHelper; import org.openqa.grid.internal.mock.MockedRequestHandler;
import org.openqa.grid.internal.mock.*;
[ "org.openqa.grid" ]
org.openqa.grid;
2,777,651
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
/** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */
Handles the HTTP <code>GET</code> method
doGet
{ "repo_name": "YojhanLR/ProyectoSTPI-JavaEE", "path": "src/java/com/stpi/controller/ConductorStore.java", "license": "apache-2.0", "size": 3856 }
[ "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
124,300
public Date getDate() { return this.date; }
Date function() { return this.date; }
/** * An intrinsic property of a version control repository is that it has a well defined * state at any historic timestamp. * For a decentralized VCS one also has to know which copy of the repository it refers to. * @return The technology-agnostic way of representing the baseline, UTC timestamp. */
An intrinsic property of a version control repository is that it has a well defined state at any historic timestamp. For a decentralized VCS one also has to know which copy of the repository it refers to
getDate
{ "repo_name": "simonsoft/cms-item", "path": "src/main/java/se/simonsoft/cms/item/RepoRevision.java", "license": "apache-2.0", "size": 9321 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
877,486
@Deprecated public static byte[] toByteArray(final String input) throws IOException { // make explicit the use of the default charset return input.getBytes(Charset.defaultCharset()); }
static byte[] function(final String input) throws IOException { return input.getBytes(Charset.defaultCharset()); }
/** * Gets the contents of a <code>String</code> as a <code>byte[]</code> * using the default character encoding of the platform. * <p> * This is the same as {@link String#getBytes()}. * * @param input the <code>String</code> to convert * @return the requested byte array * @throws NullPointerException if the input is null * @throws IOException if an I/O error occurs (never occurs) * @deprecated 2.5 Use {@link String#getBytes()} instead */
Gets the contents of a <code>String</code> as a <code>byte[]</code> using the default character encoding of the platform. This is the same as <code>String#getBytes()</code>
toByteArray
{ "repo_name": "krosenvold/commons-io", "path": "src/main/java/org/apache/commons/io/IOUtils.java", "license": "apache-2.0", "size": 125142 }
[ "java.io.IOException", "java.nio.charset.Charset" ]
import java.io.IOException; import java.nio.charset.Charset;
import java.io.*; import java.nio.charset.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
2,548,548
public void testJobSubmissionLimits() throws Exception { System.err.println("testJobSubmissionLimits"); // set up the scheduler String[] qs = {"default", "q2"}; taskTrackerManager = new FakeTaskTrackerManager(2, 1, 1); scheduler.setTaskTrackerManager(taskTrackerManager); taskTrackerManager.addQueues(qs); ArrayList<FakeQueueInfo> queues = new ArrayList<FakeQueueInfo>(); queues.add(new FakeQueueInfo("default", 50.0f, true, 50)); queues.add(new FakeQueueInfo("q2", 50.0f, true, 25)); resConf.setFakeQueues(queues); resConf.setMaxInitializedActiveTasksPerUser("default", 4); // 4 tasks max resConf.setMaxInitializedActiveTasksPerUser("q2", 4); // 4 tasks max resConf.setInitToAcceptJobsFactor("default", 1); resConf.setMaxSystemJobs(12); // max 12 running jobs in the system, hence // In queue 'default' // max (pending+running) jobs -> 12 * 1 * .5 = 6 // max jobs per user to init -> 12 * .5 * .5 = 2 scheduler.setResourceManagerConf(resConf); scheduler.start(); JobQueuesManager mgr = scheduler.jobQueuesManager; JobInitializationPoller initPoller = scheduler.getInitializationPoller(); // submit 2 jobs each for 3 users, the maximum possible to default HashMap<String, ArrayList<FakeJobInProgress>> userJobs = submitJobs(3, 2, "default"); // get the jobs submitted. ArrayList<FakeJobInProgress> u1Jobs = userJobs.get("u1"); ArrayList<FakeJobInProgress> u2Jobs = userJobs.get("u2"); ArrayList<FakeJobInProgress> u3Jobs = userJobs.get("u3"); // reference to the initializedJobs data structure // changes are reflected in the set as they are made by the poller Set<JobID> initializedJobs = initPoller.getInitializedJobList(); // we should have 6 jobs in the job queue assertEquals(6, mgr.getQueue("default").getWaitingJobs().size()); // run one poller iteration. controlledInitializationPoller.selectJobsToInitialize(); // the poller should initialize 6 jobs // 3 users and 2 jobs (with 2 tasks) from each assertEquals(initializedJobs.size(), 6); // now submit one more job from another user, should fail since default's // job submission capacity is full boolean jobSubmissionFailed = false; try { FakeJobInProgress u4j1 = submitJob(JobStatus.PREP, 1, 1, "default", "u4"); } catch (IOException ioe) { jobSubmissionFailed = true; } assertTrue("Job submission of 7th job to 'default' queue didn't fail!", jobSubmissionFailed); // fail some jobs to clear up quota taskTrackerManager.finalizeJob(u2Jobs.get(0), JobStatus.FAILED); taskTrackerManager.finalizeJob(u3Jobs.get(0), JobStatus.FAILED); FakeJobInProgress u1j3 = submitJob(JobStatus.PREP, 1, 1, "default", "u1"); // run the poller again. controlledInitializationPoller.selectJobsToInitialize(); // the poller should initialize 4 jobs // 2 from u1 and one each from u2 and u3 assertEquals(initializedJobs.size(), 4); // Should fail since u1 is already at limit of 3 jobs jobSubmissionFailed = false; try { FakeJobInProgress u1j4 = submitJob(JobStatus.PREP, 1, 1, "default", "u1"); } catch (IOException ioe) { jobSubmissionFailed = true; } assertTrue("Job submission of 4th job of user 'u1' to queue 'default' " + "didn't fail!", jobSubmissionFailed); }
void function() throws Exception { System.err.println(STR); String[] qs = {STR, "q2"}; taskTrackerManager = new FakeTaskTrackerManager(2, 1, 1); scheduler.setTaskTrackerManager(taskTrackerManager); taskTrackerManager.addQueues(qs); ArrayList<FakeQueueInfo> queues = new ArrayList<FakeQueueInfo>(); queues.add(new FakeQueueInfo(STR, 50.0f, true, 50)); queues.add(new FakeQueueInfo("q2", 50.0f, true, 25)); resConf.setFakeQueues(queues); resConf.setMaxInitializedActiveTasksPerUser(STR, 4); resConf.setMaxInitializedActiveTasksPerUser("q2", 4); resConf.setInitToAcceptJobsFactor(STR, 1); resConf.setMaxSystemJobs(12); scheduler.setResourceManagerConf(resConf); scheduler.start(); JobQueuesManager mgr = scheduler.jobQueuesManager; JobInitializationPoller initPoller = scheduler.getInitializationPoller(); HashMap<String, ArrayList<FakeJobInProgress>> userJobs = submitJobs(3, 2, STR); ArrayList<FakeJobInProgress> u1Jobs = userJobs.get("u1"); ArrayList<FakeJobInProgress> u2Jobs = userJobs.get("u2"); ArrayList<FakeJobInProgress> u3Jobs = userJobs.get("u3"); Set<JobID> initializedJobs = initPoller.getInitializedJobList(); assertEquals(6, mgr.getQueue(STR).getWaitingJobs().size()); controlledInitializationPoller.selectJobsToInitialize(); assertEquals(initializedJobs.size(), 6); boolean jobSubmissionFailed = false; try { FakeJobInProgress u4j1 = submitJob(JobStatus.PREP, 1, 1, STR, "u4"); } catch (IOException ioe) { jobSubmissionFailed = true; } assertTrue(STR, jobSubmissionFailed); taskTrackerManager.finalizeJob(u2Jobs.get(0), JobStatus.FAILED); taskTrackerManager.finalizeJob(u3Jobs.get(0), JobStatus.FAILED); FakeJobInProgress u1j3 = submitJob(JobStatus.PREP, 1, 1, STR, "u1"); controlledInitializationPoller.selectJobsToInitialize(); assertEquals(initializedJobs.size(), 4); jobSubmissionFailed = false; try { FakeJobInProgress u1j4 = submitJob(JobStatus.PREP, 1, 1, STR, "u1"); } catch (IOException ioe) { jobSubmissionFailed = true; } assertTrue(STR + STR, jobSubmissionFailed); }
/** * This testcase test limits on job-submission per-user and per-queue. */
This testcase test limits on job-submission per-user and per-queue
testJobSubmissionLimits
{ "repo_name": "gndpig/hadoop-1.2", "path": "src/contrib/capacity-scheduler/src/test/org/apache/hadoop/mapred/TestCapacityScheduler.java", "license": "apache-2.0", "size": 148941 }
[ "java.io.IOException", "java.util.ArrayList", "java.util.HashMap", "java.util.Set" ]
import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.Set;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
577,887
public String getLastAccessedTime() { return session != null ? DateFormat.getDateTimeInstance().format(new Date(session.getLastAccessedTime())): ""; }
String function() { return session != null ? DateFormat.getDateTimeInstance().format(new Date(session.getLastAccessedTime())): ""; }
/** * get last access time for session * @return */
get last access time for session
getLastAccessedTime
{ "repo_name": "sdtabilit/Scada-LTS", "path": "src/org/scada_lts/session/SessionInfo.java", "license": "gpl-2.0", "size": 3575 }
[ "java.text.DateFormat", "java.util.Date" ]
import java.text.DateFormat; import java.util.Date;
import java.text.*; import java.util.*;
[ "java.text", "java.util" ]
java.text; java.util;
1,535,082
public void addAddon(Class<? extends Skin> addonClass, AddonMetadata metadata) { supportedAddons.add(new SupportedAddon(addonClass, metadata)); }
void function(Class<? extends Skin> addonClass, AddonMetadata metadata) { supportedAddons.add(new SupportedAddon(addonClass, metadata)); }
/** * Adds an addon. When invoked, the factory exposes the given look-and-feel addon. * @param addonClass The class of the look-and-feel exposed to the user. * @param metadata Metadata about this look-and-feel. */
Adds an addon. When invoked, the factory exposes the given look-and-feel addon
addAddon
{ "repo_name": "langmo/youscope", "path": "core/api/src/main/java/org/youscope/addon/skin/SkinFactoryAdapter.java", "license": "gpl-2.0", "size": 4410 }
[ "org.youscope.addon.AddonMetadata" ]
import org.youscope.addon.AddonMetadata;
import org.youscope.addon.*;
[ "org.youscope.addon" ]
org.youscope.addon;
1,960,509
GuardedInvocation createGuardedInvocation(final SwitchPoint builtinSwitchPoint) { return createSetMethod(builtinSwitchPoint).createGuardedInvocation(); } private class SetMethod { private final MethodHandle methodHandle; private final Property property; SetMethod(final MethodHandle methodHandle, final Property property) { assert methodHandle != null; this.methodHandle = methodHandle; this.property = property; }
GuardedInvocation createGuardedInvocation(final SwitchPoint builtinSwitchPoint) { return createSetMethod(builtinSwitchPoint).createGuardedInvocation(); } private class SetMethod { private final MethodHandle methodHandle; private final Property property; SetMethod(final MethodHandle methodHandle, final Property property) { assert methodHandle != null; this.methodHandle = methodHandle; this.property = property; }
/** * Creates the actual guarded invocation that represents the dynamic setter method for the property. * @return the actual guarded invocation that represents the dynamic setter method for the property. */
Creates the actual guarded invocation that represents the dynamic setter method for the property
createGuardedInvocation
{ "repo_name": "FauxFaux/jdk9-nashorn", "path": "src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/SetMethodCreator.java", "license": "gpl-2.0", "size": 12063 }
[ "java.lang.invoke.MethodHandle", "java.lang.invoke.SwitchPoint" ]
import java.lang.invoke.MethodHandle; import java.lang.invoke.SwitchPoint;
import java.lang.invoke.*;
[ "java.lang" ]
java.lang;
2,065,770
@Test(groups = "wso2.mb", description = "single publisher single subscriber stream messages", enabled = true) @Parameters({"messageCount"}) public void testStreamMessageSingleSubSinglePub(long messageCount) throws IOException, JMSException, AndesClientConfigurationException, XPathExpressionException, NamingException, AndesClientException, DataAccessUtilException { this.runMessageTypeTestCase(JMSMessageType.STREAM, 1, "streamMessageQueue1", messageCount); }
@Test(groups = STR, description = STR, enabled = true) @Parameters({STR}) void function(long messageCount) throws IOException, JMSException, AndesClientConfigurationException, XPathExpressionException, NamingException, AndesClientException, DataAccessUtilException { this.runMessageTypeTestCase(JMSMessageType.STREAM, 1, STR, messageCount); }
/** * Publish stream messages to a queue in a single node and receive from the same node with one * subscriber * * @param messageCount number of message to send and receive * @throws IOException * @throws JMSException * @throws AndesClientConfigurationException * @throws XPathExpressionException * @throws NamingException * @throws AndesClientException */
Publish stream messages to a queue in a single node and receive from the same node with one subscriber
testStreamMessageSingleSubSinglePub
{ "repo_name": "wso2/product-ei", "path": "integration/broker-tests/tests-platform/tests-clustering/src/test/java/org/wso2/mb/platform/tests/clustering/DifferentMessageTypesQueueTestCase.java", "license": "apache-2.0", "size": 16272 }
[ "java.io.IOException", "javax.jms.JMSException", "javax.naming.NamingException", "javax.xml.xpath.XPathExpressionException", "org.testng.annotations.Parameters", "org.testng.annotations.Test", "org.wso2.mb.integration.common.clients.exceptions.AndesClientConfigurationException", "org.wso2.mb.integration.common.clients.exceptions.AndesClientException", "org.wso2.mb.integration.common.clients.operations.utils.JMSMessageType", "org.wso2.mb.platform.common.utils.exceptions.DataAccessUtilException" ]
import java.io.IOException; import javax.jms.JMSException; import javax.naming.NamingException; import javax.xml.xpath.XPathExpressionException; import org.testng.annotations.Parameters; import org.testng.annotations.Test; import org.wso2.mb.integration.common.clients.exceptions.AndesClientConfigurationException; import org.wso2.mb.integration.common.clients.exceptions.AndesClientException; import org.wso2.mb.integration.common.clients.operations.utils.JMSMessageType; import org.wso2.mb.platform.common.utils.exceptions.DataAccessUtilException;
import java.io.*; import javax.jms.*; import javax.naming.*; import javax.xml.xpath.*; import org.testng.annotations.*; import org.wso2.mb.integration.common.clients.exceptions.*; import org.wso2.mb.integration.common.clients.operations.utils.*; import org.wso2.mb.platform.common.utils.exceptions.*;
[ "java.io", "javax.jms", "javax.naming", "javax.xml", "org.testng.annotations", "org.wso2.mb" ]
java.io; javax.jms; javax.naming; javax.xml; org.testng.annotations; org.wso2.mb;
2,133,035
public void testGetRendererDescriptorExplicit() throws QuickFixException { DefDescriptor<? extends BaseComponentDef> ddParent = define( baseTag, "extensible='true' renderer='java://org.auraframework.impl.renderer.sampleJavaRenderers.TestOverridingRenderer'", "").getDescriptor(); DefDescriptor<RendererDef> dd = define( baseTag, String.format( "renderer='java://org.auraframework.impl.renderer.sampleJavaRenderers.TestSimpleRenderer' extends='%s'", ddParent.getDescriptorName()), "").getRendererDescriptor(); assertNotNull(dd); assertEquals("java://org.auraframework.impl.renderer.sampleJavaRenderers.TestSimpleRenderer", dd.getQualifiedName()); }
void function() throws QuickFixException { DefDescriptor<? extends BaseComponentDef> ddParent = define( baseTag, STRSTRrenderer='java: ddParent.getDescriptorName()), STRjava: dd.getQualifiedName()); }
/** * Test method for {@link BaseComponentDef#getRendererDescriptor()}. */
Test method for <code>BaseComponentDef#getRendererDescriptor()</code>
testGetRendererDescriptorExplicit
{ "repo_name": "igor-sfdc/aura", "path": "aura-impl/src/test/java/org/auraframework/def/BaseComponentDefTest.java", "license": "apache-2.0", "size": 93773 }
[ "org.auraframework.throwable.quickfix.QuickFixException" ]
import org.auraframework.throwable.quickfix.QuickFixException;
import org.auraframework.throwable.quickfix.*;
[ "org.auraframework.throwable" ]
org.auraframework.throwable;
2,024,201
private void setCookieParams(HttpFormAuthConfigurer formConfigurer, HttpMethodParams params) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { // NUTCH-2280 - set the HttpClient cookie policy if (formConfigurer.getCookiePolicy() != null) { String policy = formConfigurer.getCookiePolicy(); Object p = FieldUtils.readDeclaredStaticField(CookiePolicy.class, policy); if (null != p) { LOG.debug("reflection of cookie value: " + p.toString()); params.setParameter(HttpMethodParams.COOKIE_POLICY, p); } } }
void function(HttpFormAuthConfigurer formConfigurer, HttpMethodParams params) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { if (formConfigurer.getCookiePolicy() != null) { String policy = formConfigurer.getCookiePolicy(); Object p = FieldUtils.readDeclaredStaticField(CookiePolicy.class, policy); if (null != p) { LOG.debug(STR + p.toString()); params.setParameter(HttpMethodParams.COOKIE_POLICY, p); } } }
/** * NUTCH-2280 Set the cookie policy value from httpclient-auth.xml for the * Post httpClient action. * * @param fromConfigurer * - the httpclient-auth.xml values * * @param params * - the HttpMethodParams from the current httpclient instance * * @throws NoSuchFieldException * @throws SecurityException * @throws IllegalArgumentException * @throws IllegalAccessException */
NUTCH-2280 Set the cookie policy value from httpclient-auth.xml for the Post httpClient action
setCookieParams
{ "repo_name": "code4wt/nutch-learning", "path": "src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpFormAuthentication.java", "license": "apache-2.0", "size": 9541 }
[ "org.apache.commons.httpclient.cookie.CookiePolicy", "org.apache.commons.httpclient.params.HttpMethodParams", "org.apache.commons.lang3.reflect.FieldUtils" ]
import org.apache.commons.httpclient.cookie.CookiePolicy; import org.apache.commons.httpclient.params.HttpMethodParams; import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.commons.httpclient.cookie.*; import org.apache.commons.httpclient.params.*; import org.apache.commons.lang3.reflect.*;
[ "org.apache.commons" ]
org.apache.commons;
72,566
private static void zipDir(File dir, String relativePath, ZipOutputStream zos, boolean start) throws IOException { String[] dirList = dir.list(); for (String aDirList : dirList) { File f = new File(dir, aDirList); if (!f.isHidden()) { if (f.isDirectory()) { if (!start) { ZipEntry dirEntry = new ZipEntry(relativePath + f.getName() + "/"); zos.putNextEntry(dirEntry); zos.closeEntry(); } String filePath = f.getPath(); File file = new File(filePath); zipDir(file, relativePath + f.getName() + "/", zos, false); } else { ZipEntry anEntry = new ZipEntry(relativePath + f.getName()); zos.putNextEntry(anEntry); InputStream is = new FileInputStream(f); byte[] arr = new byte[4096]; int read = is.read(arr); while (read > -1) { zos.write(arr, 0, read); read = is.read(arr); } is.close(); zos.closeEntry(); } } } }
static void function(File dir, String relativePath, ZipOutputStream zos, boolean start) throws IOException { String[] dirList = dir.list(); for (String aDirList : dirList) { File f = new File(dir, aDirList); if (!f.isHidden()) { if (f.isDirectory()) { if (!start) { ZipEntry dirEntry = new ZipEntry(relativePath + f.getName() + "/"); zos.putNextEntry(dirEntry); zos.closeEntry(); } String filePath = f.getPath(); File file = new File(filePath); zipDir(file, relativePath + f.getName() + "/", zos, false); } else { ZipEntry anEntry = new ZipEntry(relativePath + f.getName()); zos.putNextEntry(anEntry); InputStream is = new FileInputStream(f); byte[] arr = new byte[4096]; int read = is.read(arr); while (read > -1) { zos.write(arr, 0, read); read = is.read(arr); } is.close(); zos.closeEntry(); } } } }
/** * This recursive method is used by the {@link #zipDir(File, String, ZipOutputStream)} method. * <p/> * A special handling is required for the start of the zip (via the start parameter). * * @param dir directory contents to zip. * @param relativePath relative path top prepend to all files in the zip. * @param zos zip output stream * @param start indicates if this invocation is the start of the zip. * @throws IOException thrown if an IO error occurred. */
This recursive method is used by the <code>#zipDir(File, String, ZipOutputStream)</code> method. A special handling is required for the start of the zip (via the start parameter)
zipDir
{ "repo_name": "showyou/hoop-webhdfs-hue", "path": "hoop-server/src/main/java/com/cloudera/lib/io/IOUtils.java", "license": "apache-2.0", "size": 8444 }
[ "java.io.File", "java.io.FileInputStream", "java.io.IOException", "java.io.InputStream", "java.util.zip.ZipEntry", "java.util.zip.ZipOutputStream" ]
import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream;
import java.io.*; import java.util.zip.*;
[ "java.io", "java.util" ]
java.io; java.util;
501,014
public void selectAllGlyphs() { for (Iterator<Glyph> e = visualEnts.iterator(); e.hasNext();) { e.next().select(true); } }
void function() { for (Iterator<Glyph> e = visualEnts.iterator(); e.hasNext();) { e.next().select(true); } }
/** * Select all glyphs */
Select all glyphs
selectAllGlyphs
{ "repo_name": "sharwell/zgrnbviewer", "path": "org-tvl-netbeans-zgrviewer/src/fr/inria/zvtm/engine/VirtualSpace.java", "license": "lgpl-3.0", "size": 25742 }
[ "fr.inria.zvtm.glyphs.Glyph", "java.util.Iterator" ]
import fr.inria.zvtm.glyphs.Glyph; import java.util.Iterator;
import fr.inria.zvtm.glyphs.*; import java.util.*;
[ "fr.inria.zvtm", "java.util" ]
fr.inria.zvtm; java.util;
459,005
void addKey(@NotNull CharCodeWithModifiers key, @NotNull String actionId);
void addKey(@NotNull CharCodeWithModifiers key, @NotNull String actionId);
/** * Add key binding for action. * * @param key * the hot key which bind * @param actionId * the action id which keys bind */
Add key binding for action
addKey
{ "repo_name": "Ori-Libhaber/che-core", "path": "ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/keybinding/Scheme.java", "license": "epl-1.0", "size": 2113 }
[ "javax.validation.constraints.NotNull", "org.eclipse.che.ide.util.input.CharCodeWithModifiers" ]
import javax.validation.constraints.NotNull; import org.eclipse.che.ide.util.input.CharCodeWithModifiers;
import javax.validation.constraints.*; import org.eclipse.che.ide.util.input.*;
[ "javax.validation", "org.eclipse.che" ]
javax.validation; org.eclipse.che;
558,248
Optional<PackingPlan.InstancePlan> removeAnyInstanceOfComponent(String component) { Optional<PackingPlan.InstancePlan> instancePlan = getAnyInstanceOfComponent(component); if (instancePlan.isPresent()) { PackingPlan.InstancePlan plan = instancePlan.get(); this.instances.remove(plan); return instancePlan; } return Optional.absent(); }
Optional<PackingPlan.InstancePlan> removeAnyInstanceOfComponent(String component) { Optional<PackingPlan.InstancePlan> instancePlan = getAnyInstanceOfComponent(component); if (instancePlan.isPresent()) { PackingPlan.InstancePlan plan = instancePlan.get(); this.instances.remove(plan); return instancePlan; } return Optional.absent(); }
/** * Remove an instance of a particular component from a container and update its * corresponding resources. * * @return the corresponding instance plan if the instance is removed the container. * Return void if an instance is not found */
Remove an instance of a particular component from a container and update its corresponding resources
removeAnyInstanceOfComponent
{ "repo_name": "mycFelix/heron", "path": "heron/packing/src/java/org/apache/heron/packing/builder/Container.java", "license": "apache-2.0", "size": 7500 }
[ "com.google.common.base.Optional", "org.apache.heron.spi.packing.PackingPlan" ]
import com.google.common.base.Optional; import org.apache.heron.spi.packing.PackingPlan;
import com.google.common.base.*; import org.apache.heron.spi.packing.*;
[ "com.google.common", "org.apache.heron" ]
com.google.common; org.apache.heron;
1,934,446
protected Path normalizePath(final String path) { return environment.resolvePath(path).toAbsolutePath().normalize(); }
Path function(final String path) { return environment.resolvePath(path).toAbsolutePath().normalize(); }
/** * Resolves the path to the path relative to the WildFly home directory. * * @param path the name of the relative path * * @return the normalized path */
Resolves the path to the path relative to the WildFly home directory
normalizePath
{ "repo_name": "aloubyansky/wildfly-core", "path": "launcher/src/main/java/org/wildfly/core/launcher/AbstractCommandBuilder.java", "license": "lgpl-2.1", "size": 21903 }
[ "java.nio.file.Path" ]
import java.nio.file.Path;
import java.nio.file.*;
[ "java.nio" ]
java.nio;
2,578,593
public static Collection<SkillDefinition> getSkillDefinitions() { return getInstance().skillDefinitions.values(); }
static Collection<SkillDefinition> function() { return getInstance().skillDefinitions.values(); }
/** * Gets a list of all currently registered skill classes. * @return the list of registered skill classes */
Gets a list of all currently registered skill classes
getSkillDefinitions
{ "repo_name": "timothyb89/skillful", "path": "src/main/java/net/asrex/skillful/skill/SkillRegistry.java", "license": "mit", "size": 8179 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,004,102
public ServiceFuture<TopicInner> createOrUpdateAsync(String resourceGroupName, String topicName, TopicInner topicInfo, final ServiceCallback<TopicInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo), serviceCallback); }
ServiceFuture<TopicInner> function(String resourceGroupName, String topicName, TopicInner topicInfo, final ServiceCallback<TopicInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, topicName, topicInfo), serviceCallback); }
/** * Create a topic. * Asynchronously creates a new topic with the specified parameters. * * @param resourceGroupName The name of the resource group within the user's subscription. * @param topicName Name of the topic. * @param topicInfo Topic information. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
Create a topic. Asynchronously creates a new topic with the specified parameters
createOrUpdateAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/eventgrid/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_06_01/implementation/TopicsInner.java", "license": "mit", "size": 112449 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,732,516
Set<String> findLanguageLabels();
Set<String> findLanguageLabels();
/** * Find all the unique label names all the languages are using. * * @return a set of all the labels. */
Find all the unique label names all the languages are using
findLanguageLabels
{ "repo_name": "kevinearls/camel", "path": "platforms/camel-catalog/src/main/java/org/apache/camel/catalog/CamelCatalog.java", "license": "apache-2.0", "size": 18710 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,215,771
public SIMPLocalSubscriptionControllable getLocalSubscriptionControlByName(String subscriptionName) throws SIMPException, SIMPControllableNotFoundException;
SIMPLocalSubscriptionControllable function(String subscriptionName) throws SIMPException, SIMPControllableNotFoundException;
/** * Returns a SIMPLocalSubscriptionControllable with the specified name. * NOTE: this is not to be confused with a subscription ID. * The subscription name only applies to Durable subscriptions. * Therefore this method will always return either a SIMPLocalSubscriptionControllable * for a durable subscription or will throw a SIMPControllableNotFoundException. * @param subscriptionName * @return a SIMPLocalSubscriptionControllable for the subcription. */
Returns a SIMPLocalSubscriptionControllable with the specified name. The subscription name only applies to Durable subscriptions. Therefore this method will always return either a SIMPLocalSubscriptionControllable for a durable subscription or will throw a SIMPControllableNotFoundException
getLocalSubscriptionControlByName
{ "repo_name": "kgibm/open-liberty", "path": "dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/processor/runtime/SIMPTopicSpaceControllable.java", "license": "epl-1.0", "size": 4141 }
[ "com.ibm.ws.sib.processor.exceptions.SIMPControllableNotFoundException", "com.ibm.ws.sib.processor.exceptions.SIMPException" ]
import com.ibm.ws.sib.processor.exceptions.SIMPControllableNotFoundException; import com.ibm.ws.sib.processor.exceptions.SIMPException;
import com.ibm.ws.sib.processor.exceptions.*;
[ "com.ibm.ws" ]
com.ibm.ws;
241,984
public String getColumnTypeName(int column) throws SQLException { checkColumn(column); return columnMetaData[--column].columnTypeName; }
String function(int column) throws SQLException { checkColumn(column); return columnMetaData[--column].columnTypeName; }
/** * <!-- start generic documentation --> * Retrieves the designated column's database-specific type name. <p> * <!-- end generic documentation --> * * @param column the first column is 1, the second is 2, ... * @return type name used by the database. If the column type is * a user-defined type, then a fully-qualified type name is returned. * @exception SQLException if a database access error occurs */
Retrieves the designated column's database-specific type name.
getColumnTypeName
{ "repo_name": "simeshev/parabuild-ci", "path": "3rdparty/hsqldb1733/src/org/hsqldb/jdbc/jdbcResultSetMetaData.java", "license": "lgpl-3.0", "size": 46192 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
627,426
List<RefactoringRule> refactorings= getAllCleanUpRules(); for (final Iterator<RefactoringRule> iter= refactorings.iterator(); iter.hasNext();) { RefactoringRule refactoring= iter.next(); if (!refactoring.isEnabled(preferences)) { iter.remove(); } } return refactorings; }
List<RefactoringRule> refactorings= getAllCleanUpRules(); for (final Iterator<RefactoringRule> iter= refactorings.iterator(); iter.hasNext();) { RefactoringRule refactoring= iter.next(); if (!refactoring.isEnabled(preferences)) { iter.remove(); } } return refactorings; }
/** * Returns the cleanup rules which have been enabled from the Eclipse * preferences. * * @param preferences the preferences * @return the cleanup rules which have been enabled from the Eclipse * preferences */
Returns the cleanup rules which have been enabled from the Eclipse preferences
getConfiguredRefactoringRules
{ "repo_name": "rpau/AutoRefactor", "path": "plugin/src/main/java/org/autorefactor/jdt/internal/ui/fix/AllCleanUpRules.java", "license": "epl-1.0", "size": 9065 }
[ "java.util.Iterator", "java.util.List", "org.autorefactor.jdt.internal.corext.dom.RefactoringRule" ]
import java.util.Iterator; import java.util.List; import org.autorefactor.jdt.internal.corext.dom.RefactoringRule;
import java.util.*; import org.autorefactor.jdt.internal.corext.dom.*;
[ "java.util", "org.autorefactor.jdt" ]
java.util; org.autorefactor.jdt;
2,731,261
@Override public void setQty (java.math.BigDecimal Qty) { set_Value (COLUMNNAME_Qty, Qty); }
void function (java.math.BigDecimal Qty) { set_Value (COLUMNNAME_Qty, Qty); }
/** Set Menge. @param Qty Menge */
Set Menge
setQty
{ "repo_name": "klst-com/metasfresh", "path": "de.metas.adempiere.adempiere/base/src/main/java-gen/org/eevolution/model/X_PP_MRP.java", "license": "gpl-2.0", "size": 30002 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
1,170,752