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
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public HttpSessionContext getSessionContext() { throw new UnsupportedOperationException("This is not supported - Deprecated anyhow."); }
HttpSessionContext function() { throw new UnsupportedOperationException(STR); }
/** * Unsafe and deprecated .. not implemented * @see HttpSession * @deprecated * @return */
Unsafe and deprecated .. not implemented
getSessionContext
{ "repo_name": "tcolar/javaontracks", "path": "src/net/jot/web/server/JOTWebSession.java", "license": "artistic-2.0", "size": 6576 }
[ "javax.servlet.http.HttpSessionContext" ]
import javax.servlet.http.HttpSessionContext;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
1,815,962
public IGroupMember getGroupMember(EntityIdentifier underlyingEntityIdentifier) throws GroupsException { return getGroupMember( underlyingEntityIdentifier.getKey(), underlyingEntityIdentifier.getType()); }
IGroupMember function(EntityIdentifier underlyingEntityIdentifier) throws GroupsException { return getGroupMember( underlyingEntityIdentifier.getKey(), underlyingEntityIdentifier.getType()); }
/** * Returns an <code>IGroupMember</code> representing either a group or a portal entity, based on * the <code>EntityIdentifier</code>, which refers to the UNDERLYING entity for the <code> * IGroupMember</code>. */
Returns an <code>IGroupMember</code> representing either a group or a portal entity, based on the <code>EntityIdentifier</code>, which refers to the UNDERLYING entity for the <code> IGroupMember</code>
getGroupMember
{ "repo_name": "jl1955/uPortal5", "path": "uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceIndividualGroupService.java", "license": "apache-2.0", "size": 27402 }
[ "org.apereo.portal.EntityIdentifier" ]
import org.apereo.portal.EntityIdentifier;
import org.apereo.portal.*;
[ "org.apereo.portal" ]
org.apereo.portal;
1,267,091
public int copyTo(OutputStream out, int len) throws IOException { return copyTo(out, len, null); }
int function(OutputStream out, int len) throws IOException { return copyTo(out, len, null); }
/** * Copies bytes from this input stream to the specified output stream * until the specified number of bytes are copied or the end of the * input stream is reached. * * @param out * The output stream to copy the data to. * * @param len * The number of bytes to copy, or < 0 to copy until the end * of this stream. * * @return The number of bytes copied to the output stream. * * @throws IOException if the underlying input stream throws an * IOException while being read or if the output stream * throws an IOException while being written. It may not be * possible to distinguish amongst the two conditions. */
Copies bytes from this input stream to the specified output stream until the specified number of bytes are copied or the end of the input stream is reached
copyTo
{ "repo_name": "thinkingcow/brazil-on-appengine", "path": "src/sunlabs/brazil/util/http/HttpInputStream.java", "license": "apache-2.0", "size": 10844 }
[ "java.io.IOException", "java.io.OutputStream" ]
import java.io.IOException; import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
713,727
public void addNewNPC(PacketBuilder packet, NPC npc) { packet.putBits(15, npc.getIndex()); int yPos = npc.getLocation().getY() - player.getLocation().getY(); int xPos = npc.getLocation().getX() - player.getLocation().getX(); packet.putBits(5, xPos); packet.putBits(14, npc.getDefinition().getId()); packet.putBits(5, yPos); packet.putBits(1, npc.getUpdateFlags().isUpdateRequired() ? 1 : 0); packet.putBits(3, npc.getDirection()); packet.putBits(1, 0); }
void function(PacketBuilder packet, NPC npc) { packet.putBits(15, npc.getIndex()); int yPos = npc.getLocation().getY() - player.getLocation().getY(); int xPos = npc.getLocation().getX() - player.getLocation().getX(); packet.putBits(5, xPos); packet.putBits(14, npc.getDefinition().getId()); packet.putBits(5, yPos); packet.putBits(1, npc.getUpdateFlags().isUpdateRequired() ? 1 : 0); packet.putBits(3, npc.getDirection()); packet.putBits(1, 0); }
/** * Adds a new NPC. * * @param packet * The main packet. * @param npc * The npc to add. */
Adds a new NPC
addNewNPC
{ "repo_name": "kewle003/hyperion", "path": "src/org/rs2server/rs2/task/impl/NPCUpdateTask.java", "license": "mit", "size": 8594 }
[ "org.rs2server.rs2.net.PacketBuilder" ]
import org.rs2server.rs2.net.PacketBuilder;
import org.rs2server.rs2.net.*;
[ "org.rs2server.rs2" ]
org.rs2server.rs2;
118,265
public void testGetPathOrURL() throws MalformedURLException, IOException { File arc = ARCWriterTest.createARCFile(getTmpDir(), true); ARCReader reader = ARCReaderFactory.get(arc.getAbsoluteFile()); assertNotNull(reader); reader.close(); doGetFileUrl(arc); }
void function() throws MalformedURLException, IOException { File arc = ARCWriterTest.createARCFile(getTmpDir(), true); ARCReader reader = ARCReaderFactory.get(arc.getAbsoluteFile()); assertNotNull(reader); reader.close(); doGetFileUrl(arc); }
/** * Test path or url. * @throws MalformedURLException * @throws IOException */
Test path or url
testGetPathOrURL
{ "repo_name": "gaowangyizu/myHeritrix", "path": "myHeritrix/src/org/archive/io/arc/ARCReaderFactoryTest.java", "license": "apache-2.0", "size": 3539 }
[ "java.io.File", "java.io.IOException", "java.net.MalformedURLException" ]
import java.io.File; import java.io.IOException; import java.net.MalformedURLException;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
1,080,864
public List<V1BinaryAnnotation> binaryAnnotations() { return binaryAnnotations; }
List<V1BinaryAnnotation> function() { return binaryAnnotations; }
/** * {@link Span#tags()} are allocated to binary annotations with a {@link * V1BinaryAnnotation#stringValue()}. {@link Span#remoteEndpoint()} to those without. */
<code>Span#tags()</code> are allocated to binary annotations with a <code>V1BinaryAnnotation#stringValue()</code>. <code>Span#remoteEndpoint()</code> to those without
binaryAnnotations
{ "repo_name": "abesto/zipkin", "path": "zipkin/src/main/java/zipkin2/v1/V1Span.java", "license": "apache-2.0", "size": 10109 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,087,111
public String getELValue(String expression) { FacesContext context = FacesContext.getCurrentInstance(); return context.getApplication().evaluateExpressionGet(context, expression, String.class); }
String function(String expression) { FacesContext context = FacesContext.getCurrentInstance(); return context.getApplication().evaluateExpressionGet(context, expression, String.class); }
/** * Evaluate and EL expression and return its value * * @param expression * The EL expression * @return The result of evaluating the expression */
Evaluate and EL expression and return its value
getELValue
{ "repo_name": "BjerknesClimateDataCentre/QuinCe", "path": "WebApp/src/uk/ac/exeter/QuinCe/web/BaseManagedBean.java", "license": "gpl-3.0", "size": 15710 }
[ "javax.faces.context.FacesContext" ]
import javax.faces.context.FacesContext;
import javax.faces.context.*;
[ "javax.faces" ]
javax.faces;
2,047,939
private static <T> Expression constantArrayList(List<T> values, Class clazz) { return Expressions.call( BuiltInMethod.ARRAYS_AS_LIST.method, Expressions.newArrayInit(clazz, constantList(values))); }
static <T> Expression function(List<T> values, Class clazz) { return Expressions.call( BuiltInMethod.ARRAYS_AS_LIST.method, Expressions.newArrayInit(clazz, constantList(values))); }
/** * E.g. {@code constantArrayList("x", "y")} returns * "Arrays.asList('x', 'y')". */
E.g. constantArrayList("x", "y") returns "Arrays.asList('x', 'y')"
constantArrayList
{ "repo_name": "julianhyde/calcite", "path": "innodb/src/main/java/org/apache/calcite/adapter/innodb/InnodbToEnumerableConverter.java", "license": "apache-2.0", "size": 7355 }
[ "java.util.List", "org.apache.calcite.linq4j.tree.Expression", "org.apache.calcite.linq4j.tree.Expressions", "org.apache.calcite.util.BuiltInMethod" ]
import java.util.List; import org.apache.calcite.linq4j.tree.Expression; import org.apache.calcite.linq4j.tree.Expressions; import org.apache.calcite.util.BuiltInMethod;
import java.util.*; import org.apache.calcite.linq4j.tree.*; import org.apache.calcite.util.*;
[ "java.util", "org.apache.calcite" ]
java.util; org.apache.calcite;
908,451
public FileStatus[] list(String hostName, Path path, boolean fullListing) throws IOException;
FileStatus[] function(String hostName, Path path, boolean fullListing) throws IOException;
/** * List data root. * Responsible to clean / filter temporal results from the failed tasks. * * @param hostName URL to host * @param path path to the object * @return arrays of FileStatus * @throws IOException if connection error */
List data root. Responsible to clean / filter temporal results from the failed tasks
list
{ "repo_name": "ymoatti/pushdown-stocator", "path": "src/main/java/com/ibm/stocator/fs/common/IStoreClient.java", "license": "apache-2.0", "size": 3731 }
[ "java.io.IOException", "org.apache.hadoop.fs.FileStatus", "org.apache.hadoop.fs.Path" ]
import java.io.IOException; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path;
import java.io.*; import org.apache.hadoop.fs.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,547,868
protected I_CmsUploadServiceAsync getUploadService() { if (m_uploadService == null) { m_uploadService = GWT.create(I_CmsUploadService.class); String serviceUrl = CmsCoreProvider.get().link("org.opencms.ade.upload.CmsUploadService.gwt"); ((ServiceDefTarget)m_uploadService).setServiceEntryPoint(serviceUrl); } return m_uploadService; }
I_CmsUploadServiceAsync function() { if (m_uploadService == null) { m_uploadService = GWT.create(I_CmsUploadService.class); String serviceUrl = CmsCoreProvider.get().link(STR); ((ServiceDefTarget)m_uploadService).setServiceEntryPoint(serviceUrl); } return m_uploadService; }
/** * Returns the upload service instance.<p> * * @return the upload service instance */
Returns the upload service instance
getUploadService
{ "repo_name": "ggiudetti/opencms-core", "path": "src-gwt/org/opencms/gwt/client/ui/replace/CmsReplaceDialog.java", "license": "lgpl-2.1", "size": 22037 }
[ "com.google.gwt.core.client.GWT", "com.google.gwt.user.client.rpc.ServiceDefTarget", "org.opencms.gwt.client.CmsCoreProvider" ]
import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.ServiceDefTarget; import org.opencms.gwt.client.CmsCoreProvider;
import com.google.gwt.core.client.*; import com.google.gwt.user.client.rpc.*; import org.opencms.gwt.client.*;
[ "com.google.gwt", "org.opencms.gwt" ]
com.google.gwt; org.opencms.gwt;
2,665,101
private List<Way> cutOutInnerPolygons(Way outerPolygon, List<Way> innerPolygons) { if (innerPolygons.isEmpty()) { Way outerWay = new JoinedWay(outerPolygon); if (log.isDebugEnabled()) { log.debug("Way", outerPolygon.getId(), "splitted to way", outerWay.getId()); } return Collections.singletonList(outerWay); } // use the java.awt.geom.Area class because it's a quick // implementation of what's needed // this list contains all non overlapping and singular areas // of the outerPolygon Queue<AreaCutData> areasToCut = new LinkedList<AreaCutData>(); Collection<Area> finishedAreas = new ArrayList<Area>(innerPolygons.size()); // create a list of Area objects from the outerPolygon (clipped to the bounding box) List<Area> outerAreas = createAreas(outerPolygon, true); // create the inner areas List<Area> innerAreas = new ArrayList<Area>(innerPolygons.size()+2); for (Way innerPolygon : innerPolygons) { // don't need to clip to the bounding box because // these polygons are just used to cut out holes innerAreas.addAll(createAreas(innerPolygon, false)); } // initialize the cut data queue if (innerAreas.isEmpty()) { // this is a multipolygon without any inner areas // nothing to cut finishedAreas.addAll(outerAreas); } else if (outerAreas.size() == 1) { // there is one outer area only // it is checked before that all inner areas are inside this outer area AreaCutData initialCutData = new AreaCutData(); initialCutData.outerArea = outerAreas.get(0); initialCutData.innerAreas = innerAreas; areasToCut.add(initialCutData); } else { // multiple outer areas for (Area outerArea : outerAreas) { AreaCutData initialCutData = new AreaCutData(); initialCutData.outerArea = outerArea; initialCutData.innerAreas = new ArrayList<Area>(innerAreas .size()); for (Area innerArea : innerAreas) { if (outerArea.getBounds().intersects( innerArea.getBounds())) { initialCutData.innerAreas.add(innerArea); } } if (initialCutData.innerAreas.isEmpty()) { // this is either an error // or the outer area has been cut into pieces on the tile bounds finishedAreas.add(outerArea); } else { areasToCut.add(initialCutData); } } } while (!areasToCut.isEmpty()) { AreaCutData areaCutData = areasToCut.poll(); CutPoint cutPoint = calcNextCutPoint(areaCutData); if (cutPoint == null) { finishedAreas.add(areaCutData.outerArea); continue; } assert cutPoint.getNumberOfAreas() > 0 : "Number of cut areas == 0 in mp "+getId(); // cut out the holes for (Area cutArea : cutPoint.getAreas()) { areaCutData.outerArea.subtract(cutArea); } if (areaCutData.outerArea.isEmpty()) { // this outer area space can be abandoned continue; } // the inner areas of the cut point have been processed // they are no longer needed for (Area cutArea : cutPoint.getAreas()) { ListIterator<Area> areaIter = areaCutData.innerAreas.listIterator(); while (areaIter.hasNext()) { Area a = areaIter.next(); if (a == cutArea) { areaIter.remove(); break; } } } // remove all does not seem to work. It removes more than the identical areas. // areaCutData.innerAreas.removeAll(cutPoint.getAreas()); if (areaCutData.outerArea.isSingular()) { // the area is singular // => no further splits necessary if (areaCutData.innerAreas.isEmpty()) { // this area is finished and needs no further cutting finishedAreas.add(areaCutData.outerArea); } else { // read this area to further processing areasToCut.add(areaCutData); } } else { // we need to cut the area into two halves to get singular areas Rectangle r1 = cutPoint.getCutRectangleForArea(areaCutData.outerArea, true); Rectangle r2 = cutPoint.getCutRectangleForArea(areaCutData.outerArea, false); // Now find the intersection of these two boxes with the // original polygon. This will make two new areas, and each // area will be one (or more) polygons. Area a1 = areaCutData.outerArea; Area a2 = (Area) a1.clone(); a1.intersect(new Area(r1)); a2.intersect(new Area(r2)); if (areaCutData.innerAreas.isEmpty()) { finishedAreas.addAll(Java2DConverter.areaToSingularAreas(a1)); finishedAreas.addAll(Java2DConverter.areaToSingularAreas(a2)); } else { ArrayList<Area> cuttedAreas = new ArrayList<Area>(); cuttedAreas.addAll(Java2DConverter.areaToSingularAreas(a1)); cuttedAreas.addAll(Java2DConverter.areaToSingularAreas(a2)); for (Area nextOuterArea : cuttedAreas) { ArrayList<Area> nextInnerAreas = null; // go through all remaining inner areas and check if they // must be further processed with the nextOuterArea for (Area nonProcessedInner : areaCutData.innerAreas) { if (nextOuterArea.intersects(nonProcessedInner.getBounds2D())) { if (nextInnerAreas == null) { nextInnerAreas = new ArrayList<Area>(); } nextInnerAreas.add(nonProcessedInner); } } if (nextInnerAreas == null || nextInnerAreas.isEmpty()) { finishedAreas.add(nextOuterArea); } else { AreaCutData outCutData = new AreaCutData(); outCutData.outerArea = nextOuterArea; outCutData.innerAreas= nextInnerAreas; areasToCut.add(outCutData); } } } } } // convert the java.awt.geom.Area back to the mkgmap way List<Way> cuttedOuterPolygon = new ArrayList<Way>(finishedAreas.size()); for (Area area : finishedAreas) { Way w = singularAreaToWay(area, FakeIdGenerator.makeFakeId()); if (w != null) { w.copyTags(outerPolygon); cuttedOuterPolygon.add(w); if (log.isDebugEnabled()) { log.debug("Way", outerPolygon.getId(), "splitted to way", w.getId()); } } } return cuttedOuterPolygon; }
List<Way> function(Way outerPolygon, List<Way> innerPolygons) { if (innerPolygons.isEmpty()) { Way outerWay = new JoinedWay(outerPolygon); if (log.isDebugEnabled()) { log.debug("Way", outerPolygon.getId(), STR, outerWay.getId()); } return Collections.singletonList(outerWay); } Queue<AreaCutData> areasToCut = new LinkedList<AreaCutData>(); Collection<Area> finishedAreas = new ArrayList<Area>(innerPolygons.size()); List<Area> outerAreas = createAreas(outerPolygon, true); List<Area> innerAreas = new ArrayList<Area>(innerPolygons.size()+2); for (Way innerPolygon : innerPolygons) { innerAreas.addAll(createAreas(innerPolygon, false)); } if (innerAreas.isEmpty()) { finishedAreas.addAll(outerAreas); } else if (outerAreas.size() == 1) { AreaCutData initialCutData = new AreaCutData(); initialCutData.outerArea = outerAreas.get(0); initialCutData.innerAreas = innerAreas; areasToCut.add(initialCutData); } else { for (Area outerArea : outerAreas) { AreaCutData initialCutData = new AreaCutData(); initialCutData.outerArea = outerArea; initialCutData.innerAreas = new ArrayList<Area>(innerAreas .size()); for (Area innerArea : innerAreas) { if (outerArea.getBounds().intersects( innerArea.getBounds())) { initialCutData.innerAreas.add(innerArea); } } if (initialCutData.innerAreas.isEmpty()) { finishedAreas.add(outerArea); } else { areasToCut.add(initialCutData); } } } while (!areasToCut.isEmpty()) { AreaCutData areaCutData = areasToCut.poll(); CutPoint cutPoint = calcNextCutPoint(areaCutData); if (cutPoint == null) { finishedAreas.add(areaCutData.outerArea); continue; } assert cutPoint.getNumberOfAreas() > 0 : STR+getId(); for (Area cutArea : cutPoint.getAreas()) { areaCutData.outerArea.subtract(cutArea); } if (areaCutData.outerArea.isEmpty()) { continue; } for (Area cutArea : cutPoint.getAreas()) { ListIterator<Area> areaIter = areaCutData.innerAreas.listIterator(); while (areaIter.hasNext()) { Area a = areaIter.next(); if (a == cutArea) { areaIter.remove(); break; } } } if (areaCutData.outerArea.isSingular()) { if (areaCutData.innerAreas.isEmpty()) { finishedAreas.add(areaCutData.outerArea); } else { areasToCut.add(areaCutData); } } else { Rectangle r1 = cutPoint.getCutRectangleForArea(areaCutData.outerArea, true); Rectangle r2 = cutPoint.getCutRectangleForArea(areaCutData.outerArea, false); Area a1 = areaCutData.outerArea; Area a2 = (Area) a1.clone(); a1.intersect(new Area(r1)); a2.intersect(new Area(r2)); if (areaCutData.innerAreas.isEmpty()) { finishedAreas.addAll(Java2DConverter.areaToSingularAreas(a1)); finishedAreas.addAll(Java2DConverter.areaToSingularAreas(a2)); } else { ArrayList<Area> cuttedAreas = new ArrayList<Area>(); cuttedAreas.addAll(Java2DConverter.areaToSingularAreas(a1)); cuttedAreas.addAll(Java2DConverter.areaToSingularAreas(a2)); for (Area nextOuterArea : cuttedAreas) { ArrayList<Area> nextInnerAreas = null; for (Area nonProcessedInner : areaCutData.innerAreas) { if (nextOuterArea.intersects(nonProcessedInner.getBounds2D())) { if (nextInnerAreas == null) { nextInnerAreas = new ArrayList<Area>(); } nextInnerAreas.add(nonProcessedInner); } } if (nextInnerAreas == null nextInnerAreas.isEmpty()) { finishedAreas.add(nextOuterArea); } else { AreaCutData outCutData = new AreaCutData(); outCutData.outerArea = nextOuterArea; outCutData.innerAreas= nextInnerAreas; areasToCut.add(outCutData); } } } } } List<Way> cuttedOuterPolygon = new ArrayList<Way>(finishedAreas.size()); for (Area area : finishedAreas) { Way w = singularAreaToWay(area, FakeIdGenerator.makeFakeId()); if (w != null) { w.copyTags(outerPolygon); cuttedOuterPolygon.add(w); if (log.isDebugEnabled()) { log.debug("Way", outerPolygon.getId(), STR, w.getId()); } } } return cuttedOuterPolygon; }
/** * Cut out all inner polygons from the outer polygon. This will divide the outer * polygon in several polygons. * * @param outerPolygon * the outer polygon * @param innerPolygons * a list of inner polygons * @return a list of polygons that make the outer polygon cut by the inner * polygons */
Cut out all inner polygons from the outer polygon. This will divide the outer polygon in several polygons
cutOutInnerPolygons
{ "repo_name": "balp/mkgmap", "path": "src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java", "license": "gpl-2.0", "size": 83289 }
[ "java.awt.Rectangle", "java.awt.geom.Area", "java.util.ArrayList", "java.util.Collection", "java.util.Collections", "java.util.LinkedList", "java.util.List", "java.util.ListIterator", "java.util.Queue", "uk.me.parabola.util.Java2DConverter" ]
import java.awt.Rectangle; import java.awt.geom.Area; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; import java.util.Queue; import uk.me.parabola.util.Java2DConverter;
import java.awt.*; import java.awt.geom.*; import java.util.*; import uk.me.parabola.util.*;
[ "java.awt", "java.util", "uk.me.parabola" ]
java.awt; java.util; uk.me.parabola;
2,743,601
public void addAlias(String alias, ClassDescriptor descriptor) { project.addAlias(alias, descriptor); }
void function(String alias, ClassDescriptor descriptor) { project.addAlias(alias, descriptor); }
/** * PUBLIC: * Add an alias for the descriptor */
Add an alias for the descriptor
addAlias
{ "repo_name": "gameduell/eclipselink.runtime", "path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/sessions/AbstractSession.java", "license": "epl-1.0", "size": 198170 }
[ "org.eclipse.persistence.descriptors.ClassDescriptor" ]
import org.eclipse.persistence.descriptors.ClassDescriptor;
import org.eclipse.persistence.descriptors.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
1,015,630
public Map<String, TaskResult> getPreciousResults();
Map<String, TaskResult> function();
/** * Return only the precious results of this job as a mapping between * user task name (in XML job description) and its task result.<br> * User that wants to get a specific result may get this map and ask for a specific mapping. * * @return the precious results as a map. */
Return only the precious results of this job as a mapping between user task name (in XML job description) and its task result. User that wants to get a specific result may get this map and ask for a specific mapping
getPreciousResults
{ "repo_name": "acontes/scheduling", "path": "src/scheduler/src/org/ow2/proactive/scheduler/common/job/JobResult.java", "license": "agpl-3.0", "size": 5038 }
[ "java.util.Map", "org.ow2.proactive.scheduler.common.task.TaskResult" ]
import java.util.Map; import org.ow2.proactive.scheduler.common.task.TaskResult;
import java.util.*; import org.ow2.proactive.scheduler.common.task.*;
[ "java.util", "org.ow2.proactive" ]
java.util; org.ow2.proactive;
37,637
long getPreferredBlockSize(String filename) throws IOException, UnresolvedLinkException { synchronized (rootDir) { INode inode = rootDir.getNode(filename, false); if (inode == null) { throw new FileNotFoundException("File does not exist: " + filename); } if (inode.isDirectory() || inode.isLink()) { throw new IOException("Getting block size of non-file: "+ filename); } return ((INodeFile)inode).getPreferredBlockSize(); } }
long getPreferredBlockSize(String filename) throws IOException, UnresolvedLinkException { synchronized (rootDir) { INode inode = rootDir.getNode(filename, false); if (inode == null) { throw new FileNotFoundException(STR + filename); } if (inode.isDirectory() inode.isLink()) { throw new IOException(STR+ filename); } return ((INodeFile)inode).getPreferredBlockSize(); } }
/** * Get the blocksize of a file * @param filename the filename * @return the number of bytes * @throws IOException if it is a directory or does not exist. */
Get the blocksize of a file
getPreferredBlockSize
{ "repo_name": "sdecoder/CMDS-HDFS", "path": "hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java", "license": "apache-2.0", "size": 76258 }
[ "java.io.FileNotFoundException", "java.io.IOException", "org.apache.hadoop.fs.UnresolvedLinkException" ]
import java.io.FileNotFoundException; import java.io.IOException; import org.apache.hadoop.fs.UnresolvedLinkException;
import java.io.*; import org.apache.hadoop.fs.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,872,457
long addLocation(String locationSetting, String cityName, double lat, double lon) { long locationId; // First, check if the location with this city name exists in the db Cursor locationCursor = getContext().getContentResolver().query( WeatherContract.LocationEntry.CONTENT_URI, new String[]{WeatherContract.LocationEntry._ID}, WeatherContract.LocationEntry.COLUMN_LOCATION_SETTING + " = ?", new String[]{locationSetting}, null); if (locationCursor.moveToFirst()) { int locationIdIndex = locationCursor.getColumnIndex(WeatherContract.LocationEntry._ID); locationId = locationCursor.getLong(locationIdIndex); } else { // Now that the content provider is set up, inserting rows of data is pretty simple. // First create a ContentValues object to hold the data you want to insert. ContentValues locationValues = new ContentValues(); // Then add the data, along with the corresponding name of the data type, // so the content provider knows what kind of value is being inserted. locationValues.put(WeatherContract.LocationEntry.COLUMN_CITY_NAME, cityName); locationValues.put(WeatherContract.LocationEntry.COLUMN_LOCATION_SETTING, locationSetting); locationValues.put(WeatherContract.LocationEntry.COLUMN_COORD_LAT, lat); locationValues.put(WeatherContract.LocationEntry.COLUMN_COORD_LONG, lon); // Finally, insert location data into the database. Uri insertedUri = getContext().getContentResolver().insert( WeatherContract.LocationEntry.CONTENT_URI, locationValues ); // The resulting URI contains the ID for the row. Extract the locationId from the Uri. locationId = ContentUris.parseId(insertedUri); } locationCursor.close(); // Wait, that worked? Yes! return locationId; }
long addLocation(String locationSetting, String cityName, double lat, double lon) { long locationId; Cursor locationCursor = getContext().getContentResolver().query( WeatherContract.LocationEntry.CONTENT_URI, new String[]{WeatherContract.LocationEntry._ID}, WeatherContract.LocationEntry.COLUMN_LOCATION_SETTING + STR, new String[]{locationSetting}, null); if (locationCursor.moveToFirst()) { int locationIdIndex = locationCursor.getColumnIndex(WeatherContract.LocationEntry._ID); locationId = locationCursor.getLong(locationIdIndex); } else { ContentValues locationValues = new ContentValues(); locationValues.put(WeatherContract.LocationEntry.COLUMN_CITY_NAME, cityName); locationValues.put(WeatherContract.LocationEntry.COLUMN_LOCATION_SETTING, locationSetting); locationValues.put(WeatherContract.LocationEntry.COLUMN_COORD_LAT, lat); locationValues.put(WeatherContract.LocationEntry.COLUMN_COORD_LONG, lon); Uri insertedUri = getContext().getContentResolver().insert( WeatherContract.LocationEntry.CONTENT_URI, locationValues ); locationId = ContentUris.parseId(insertedUri); } locationCursor.close(); return locationId; }
/** * Helper method to handle insertion of a new location in the weather database. * * @param locationSetting The location string used to request updates from the server. * @param cityName A human-readable city name, e.g "Mountain View" * @param lat the latitude of the city * @param lon the longitude of the city * @return the row ID of the added location. */
Helper method to handle insertion of a new location in the weather database
addLocation
{ "repo_name": "pranavsingh/Advanced_Android_Development", "path": "app/src/main/java/com/example/android/sunshine/app/sync/SunshineSyncAdapter.java", "license": "apache-2.0", "size": 32157 }
[ "android.content.ContentUris", "android.content.ContentValues", "android.database.Cursor", "android.net.Uri", "com.example.android.sunshine.app.data.WeatherContract" ]
import android.content.ContentUris; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; import com.example.android.sunshine.app.data.WeatherContract;
import android.content.*; import android.database.*; import android.net.*; import com.example.android.sunshine.app.data.*;
[ "android.content", "android.database", "android.net", "com.example.android" ]
android.content; android.database; android.net; com.example.android;
388,632
public synchronized Properties getServerProps() { if (this.serverProps == null) { this.serverProps = new Properties(); } return this.serverProps; }
synchronized Properties function() { if (this.serverProps == null) { this.serverProps = new Properties(); } return this.serverProps; }
/** * Returns the list of properties that will be used to start/control the * server. * * @return Properties the list of properties. */
Returns the list of properties that will be used to start/control the server
getServerProps
{ "repo_name": "yyuu/libmysql-java", "path": "src/com/mysql/jdbc/util/ServerController.java", "license": "gpl-2.0", "size": 8973 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
2,909,133
final String[] fieldNames = new String[metaDataInfo.size() + 1]; final ColumnType[] columnTypes = new ColumnType[metaDataInfo.size() + 1]; // add the document ID field (fixed) fieldNames[0] = ElasticSearchUtils.FIELD_ID; columnTypes[0] = ColumnType.STRING; int i = 1; for (Entry<String, ?> metaDataField : metaDataInfo.entrySet()) { @SuppressWarnings("unchecked") final Map<String, ?> fieldMetadata = (Map<String, ?>) metaDataField.getValue(); fieldNames[i] = metaDataField.getKey(); columnTypes[i] = getColumnTypeFromMetadataField(fieldMetadata); i++; } return new ElasticSearchMetaData(fieldNames, columnTypes); }
final String[] fieldNames = new String[metaDataInfo.size() + 1]; final ColumnType[] columnTypes = new ColumnType[metaDataInfo.size() + 1]; fieldNames[0] = ElasticSearchUtils.FIELD_ID; columnTypes[0] = ColumnType.STRING; int i = 1; for (Entry<String, ?> metaDataField : metaDataInfo.entrySet()) { @SuppressWarnings(STR) final Map<String, ?> fieldMetadata = (Map<String, ?>) metaDataField.getValue(); fieldNames[i] = metaDataField.getKey(); columnTypes[i] = getColumnTypeFromMetadataField(fieldMetadata); i++; } return new ElasticSearchMetaData(fieldNames, columnTypes); }
/** * Parses the ElasticSearch meta data info into an ElasticSearchMetaData * object. This method makes much easier to create the ElasticSearch schema. * * @param metaDataInfo * ElasticSearch mapping metadata in Map format * @return An ElasticSearchMetaData object */
Parses the ElasticSearch meta data info into an ElasticSearchMetaData object. This method makes much easier to create the ElasticSearch schema
parse
{ "repo_name": "apache/metamodel", "path": "elasticsearch/common/src/main/java/org/apache/metamodel/elasticsearch/common/ElasticSearchMetaDataParser.java", "license": "apache-2.0", "size": 3251 }
[ "java.util.Map", "org.apache.metamodel.schema.ColumnType" ]
import java.util.Map; import org.apache.metamodel.schema.ColumnType;
import java.util.*; import org.apache.metamodel.schema.*;
[ "java.util", "org.apache.metamodel" ]
java.util; org.apache.metamodel;
224,130
public static String formatTime(Date date, String fallback) { return formatDateFormat(TIME_FORMAT, date, fallback); }
static String function(Date date, String fallback) { return formatDateFormat(TIME_FORMAT, date, fallback); }
/** * Formats UTC time into a date/time string */
Formats UTC time into a date/time string
formatTime
{ "repo_name": "f-droid/fdroid-client", "path": "app/src/main/java/org/fdroid/fdroid/Utils.java", "license": "gpl-3.0", "size": 36688 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,225,983
@Override public boolean accept(Path path) { return path.toString().matches(regex); }
boolean function(Path path) { return path.toString().matches(regex); }
/** * Override method that returns true if the input file path matches the regex. * * @param path The path of a file to be check by the filter. * @return boolean if file is fastq/fq file. */
Override method that returns true if the input file path matches the regex
accept
{ "repo_name": "penuts7644/HadoopPhredCalculator", "path": "src/main/java/nl/bioinf/wvanhelvoirt/HadoopPhredCalculator/FastqPathFilter.java", "license": "gpl-3.0", "size": 1624 }
[ "org.apache.hadoop.fs.Path" ]
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,306,278
public void setJoinCondition(Condition joinCondition) { this.joinCondition = joinCondition; }
void function(Condition joinCondition) { this.joinCondition = joinCondition; }
/** * Pick the supported condition. Currently only equal join is supported. * * @param joinCondition - join condition */
Pick the supported condition. Currently only equal join is supported
setJoinCondition
{ "repo_name": "ananthc/apex-malhar", "path": "library/src/main/java/org/apache/apex/malhar/lib/join/SemiJoinOperator.java", "license": "apache-2.0", "size": 5874 }
[ "org.apache.apex.malhar.lib.streamquery.condition.Condition" ]
import org.apache.apex.malhar.lib.streamquery.condition.Condition;
import org.apache.apex.malhar.lib.streamquery.condition.*;
[ "org.apache.apex" ]
org.apache.apex;
445,504
public FeatureCursor queryFeaturesForChunk(boolean distinct, BoundingBox boundingBox, String where, String[] whereArgs, int limit, long offset) { return queryFeaturesForChunk(distinct, boundingBox, where, whereArgs, getPkColumnName(), limit, offset); }
FeatureCursor function(boolean distinct, BoundingBox boundingBox, String where, String[] whereArgs, int limit, long offset) { return queryFeaturesForChunk(distinct, boundingBox, where, whereArgs, getPkColumnName(), limit, offset); }
/** * Query for features within the bounding box ordered by id, starting at the * offset and returning no more than the limit * * @param distinct distinct rows * @param boundingBox bounding box * @param where where clause * @param whereArgs where arguments * @param limit chunk limit * @param offset chunk query offset * @return feature cursor * @since 6.2.0 */
Query for features within the bounding box ordered by id, starting at the offset and returning no more than the limit
queryFeaturesForChunk
{ "repo_name": "ngageoint/geopackage-android", "path": "geopackage-sdk/src/main/java/mil/nga/geopackage/extension/nga/index/FeatureTableIndex.java", "license": "mit", "size": 276322 }
[ "mil.nga.geopackage.BoundingBox", "mil.nga.geopackage.features.user.FeatureCursor" ]
import mil.nga.geopackage.BoundingBox; import mil.nga.geopackage.features.user.FeatureCursor;
import mil.nga.geopackage.*; import mil.nga.geopackage.features.user.*;
[ "mil.nga.geopackage" ]
mil.nga.geopackage;
347,249
@Test public void testGetAllImplementedTypes01() { IModelInstance modelInstance; modelInstance = ModelBusTestUtility .createEmptyJavaModelInstance(this.model); Set<Type> types; types = modelInstance.getAllImplementedTypes(); assertNotNull(types); assertEquals(0, types.size()); }
void function() { IModelInstance modelInstance; modelInstance = ModelBusTestUtility .createEmptyJavaModelInstance(this.model); Set<Type> types; types = modelInstance.getAllImplementedTypes(); assertNotNull(types); assertEquals(0, types.size()); }
/** * <p> * Tests the method {@link IModelInstance#getAllImplementedTypes()}. * </p> * * @throws TypeNotFoundInModelException */
Tests the method <code>IModelInstance#getAllImplementedTypes()</code>.
testGetAllImplementedTypes01
{ "repo_name": "dresden-ocl/dresdenocl", "path": "tests/org.dresdenocl.modelbus.test/src/org/dresdenocl/modelbus/test/modelinstance/AbstractModelInstanceTest.java", "license": "lgpl-3.0", "size": 10112 }
[ "java.util.Set", "org.dresdenocl.modelbus.test.ModelBusTestUtility", "org.dresdenocl.modelinstance.IModelInstance", "org.dresdenocl.pivotmodel.Type", "org.junit.Assert" ]
import java.util.Set; import org.dresdenocl.modelbus.test.ModelBusTestUtility; import org.dresdenocl.modelinstance.IModelInstance; import org.dresdenocl.pivotmodel.Type; import org.junit.Assert;
import java.util.*; import org.dresdenocl.modelbus.test.*; import org.dresdenocl.modelinstance.*; import org.dresdenocl.pivotmodel.*; import org.junit.*;
[ "java.util", "org.dresdenocl.modelbus", "org.dresdenocl.modelinstance", "org.dresdenocl.pivotmodel", "org.junit" ]
java.util; org.dresdenocl.modelbus; org.dresdenocl.modelinstance; org.dresdenocl.pivotmodel; org.junit;
2,403,181
public void setOrientationLeft() throws RemoteException { Tracer.trace(); getAutomatorBridge().getInteractionController().setRotationLeft(); }
void function() throws RemoteException { Tracer.trace(); getAutomatorBridge().getInteractionController().setRotationLeft(); }
/** * Simulates orienting the device to the left and also freezes rotation * by disabling the sensors. * * If you want to un-freeze the rotation and re-enable the sensors * see {@link #unfreezeRotation()}. * @throws RemoteException * @since API Level 17 */
Simulates orienting the device to the left and also freezes rotation by disabling the sensors. If you want to un-freeze the rotation and re-enable the sensors see <code>#unfreezeRotation()</code>
setOrientationLeft
{ "repo_name": "rex-xxx/mt6572_x201", "path": "frameworks/testing/uiautomator/library/src/com/android/uiautomator/core/UiDevice.java", "license": "gpl-2.0", "size": 29468 }
[ "android.os.RemoteException" ]
import android.os.RemoteException;
import android.os.*;
[ "android.os" ]
android.os;
2,263,529
static ScriptFunction makeFunction(final String name, final MethodHandle methodHandle, final MethodHandle[] specs) { return makeFunction(name, methodHandle, specs, ScriptFunctionData.IS_BUILTIN); }
static ScriptFunction makeFunction(final String name, final MethodHandle methodHandle, final MethodHandle[] specs) { return makeFunction(name, methodHandle, specs, ScriptFunctionData.IS_BUILTIN); }
/** * Factory method for non-constructor built-in functions * * @param name function name * @param methodHandle handle for invocation * @param specs specialized versions of function if available, null otherwise * @return new ScriptFunction */
Factory method for non-constructor built-in functions
makeFunction
{ "repo_name": "koutheir/incinerator-hotspot", "path": "nashorn/src/jdk/nashorn/internal/objects/ScriptFunctionImpl.java", "license": "gpl-2.0", "size": 13031 }
[ "java.lang.invoke.MethodHandle" ]
import java.lang.invoke.MethodHandle;
import java.lang.invoke.*;
[ "java.lang" ]
java.lang;
331,384
Document getDocument() { Document rv = document; document = null; return rv; }
Document getDocument() { Document rv = document; document = null; return rv; }
/** * Returns the document. * * @return the document */
Returns the document
getDocument
{ "repo_name": "anarcheuz/Funny-school-projects", "path": "WebSemantic/src/htmlparser-1.4/src/nu/validator/htmlparser/dom/DOMTreeBuilder.java", "license": "mit", "size": 11347 }
[ "org.w3c.dom.Document" ]
import org.w3c.dom.Document;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,402,028
public void onModuleLoad() { TreePanel treeWidget = new AutoCollapseTreePanel(); final TextArea textArea = new TextArea(); textArea.setSize(800, 300); treeWidget.getView().setBroadcastCommand(new BroadcastCommand() {
void function() { TreePanel treeWidget = new AutoCollapseTreePanel(); final TextArea textArea = new TextArea(); textArea.setSize(800, 300); treeWidget.getView().setBroadcastCommand(new BroadcastCommand() {
/** * This is the entry point method. */
This is the entry point method
onModuleLoad
{ "repo_name": "akubach/phyloviewer-simple", "path": "src/main/java/org/iplantc/simple/client/SimpleTreeViewer.java", "license": "gpl-2.0", "size": 1136 }
[ "com.extjs.gxt.ui.client.widget.form.TextArea", "org.iplantc.core.broadcaster.shared.BroadcastCommand" ]
import com.extjs.gxt.ui.client.widget.form.TextArea; import org.iplantc.core.broadcaster.shared.BroadcastCommand;
import com.extjs.gxt.ui.client.widget.form.*; import org.iplantc.core.broadcaster.shared.*;
[ "com.extjs.gxt", "org.iplantc.core" ]
com.extjs.gxt; org.iplantc.core;
563,637
private String getPermissionSHORTAsString(SHORT permission){ if(permission == null){ return null; }else{ ByteBuffer bb = ByteBuffer.allocate(2); bb.put(permission.bytes()[0]); bb.put(permission.bytes()[1]); int permissionShort = bb.getShort(0); return Integer.toOctalString(permissionShort); } }
String function(SHORT permission){ if(permission == null){ return null; }else{ ByteBuffer bb = ByteBuffer.allocate(2); bb.put(permission.bytes()[0]); bb.put(permission.bytes()[1]); int permissionShort = bb.getShort(0); return Integer.toOctalString(permissionShort); } }
/** * Return null if null arguments * * @param permission * @return null/Octal representation of permissions */
Return null if null arguments
getPermissionSHORTAsString
{ "repo_name": "ashish-gehani/SPADE", "path": "src/spade/reporter/CDM.java", "license": "gpl-3.0", "size": 31275 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
1,670,578
public static UserModel findUserByNameOrEmail(KeycloakSession session, RealmModel realm, String username) { if (realm.isLoginWithEmailAllowed() && username.indexOf('@') != -1) { UserModel user = session.users().getUserByEmail(username, realm); if (user != null) { return user; } } return session.users().getUserByUsername(username, realm); }
static UserModel function(KeycloakSession session, RealmModel realm, String username) { if (realm.isLoginWithEmailAllowed() && username.indexOf('@') != -1) { UserModel user = session.users().getUserByEmail(username, realm); if (user != null) { return user; } } return session.users().getUserByUsername(username, realm); }
/** * Try to find user by username or email for authentication * * @param realm realm * @param username username or email of user * @return found user */
Try to find user by username or email for authentication
findUserByNameOrEmail
{ "repo_name": "mbaluch/keycloak", "path": "server-spi-private/src/main/java/org/keycloak/models/utils/KeycloakModelUtils.java", "license": "apache-2.0", "size": 20089 }
[ "org.keycloak.models.KeycloakSession", "org.keycloak.models.RealmModel", "org.keycloak.models.UserModel" ]
import org.keycloak.models.KeycloakSession; import org.keycloak.models.RealmModel; import org.keycloak.models.UserModel;
import org.keycloak.models.*;
[ "org.keycloak.models" ]
org.keycloak.models;
701,298
List<T> getXdbFederations();
List<T> getXdbFederations();
/** * Returns all the configured xDB federations. * @return All the configured xDB federations * @since 9.6.0 */
Returns all the configured xDB federations
getXdbFederations
{ "repo_name": "kovaloid/infoarchive-sip-sdk", "path": "configuration/src/main/java/com/opentext/ia/configuration/Configuration.java", "license": "mpl-2.0", "size": 12727 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
904,189
private List<Move> getPossibleMovesForAce(int[] pieces, int card, byte playerToMoveWith){ ArrayList<Move> legal_moves = new ArrayList<Move>(); assert !(card % 13 != Cards.HEARTS_ACE || card == 100); // Use Ace to get out // StartPos is -1 in case the player isn't on the board yet. // homefield of player 1 int home = 0; try { home = Rules.getInstance().getHomePositionForPlayer(playerToMoveWith); } catch(Exception e) { } //start with ace if(Rules.getInstance().isRulesConform(board, card, -1 , home , playerToMoveWith, false)) { byte[] positions = new byte[2]; positions[0] = -1; positions[1] = (byte)(home); Move move = new Move(card, positions); legal_moves.add(move); } //try with all pieces for(int p = 0; p<pieces.length; p++) { // Use Ace to move 11 if(Rules.getInstance().isRulesConform(board, card, pieces[p] , (pieces[p] + 11) % 64 , playerToMoveWith, false)) { byte[] positions = new byte[2]; positions[0] = (byte)pieces[p]; positions[1] = (byte)((pieces[p] + 11) % 64); // move 11 fields Move move = new Move(card, positions); legal_moves.add(move); } // Use Ace to move 1 if(Rules.getInstance().isRulesConform(board, card, pieces[p] , (pieces[p] + 1) % 64 , playerToMoveWith, false)) { byte[] positions = new byte[2]; positions[0] = (byte)pieces[p]; positions[1] = (byte)((pieces[p] + 1) % 64); // move 1 field Move move = new Move(card, positions); legal_moves.add(move); } //Try to get to heaven with ace as 11 int targetPosInHeaven11 = Rules.getInstance().getTargetPosInHeavenForAceAsEleven(board, pieces[p], playerToMoveWith); if(Rules.getInstance().isRulesConform(board, card, pieces[p] , targetPosInHeaven11 , playerToMoveWith, true)){ byte[] positions = new byte[2]; positions[0] = (byte)pieces[p]; positions[1] = (byte)targetPosInHeaven11; Move move = new Move(card, positions); legal_moves.add(move); } //Try to get to heaven with ace as 1 int targetPosInHeaven = Rules.getInstance().getTargetPosInHeaven(board, pieces[p], card, playerToMoveWith); if(Rules.getInstance().isRulesConform(board, card, pieces[p] , targetPosInHeaven , playerToMoveWith, true)){ byte[] positions = new byte[2]; positions[0] = (byte)pieces[p]; positions[1] = (byte)targetPosInHeaven; Move move = new Move(card, positions); legal_moves.add(move); } }// end for pieces return legal_moves; }
List<Move> function(int[] pieces, int card, byte playerToMoveWith){ ArrayList<Move> legal_moves = new ArrayList<Move>(); assert !(card % 13 != Cards.HEARTS_ACE card == 100); int home = 0; try { home = Rules.getInstance().getHomePositionForPlayer(playerToMoveWith); } catch(Exception e) { } if(Rules.getInstance().isRulesConform(board, card, -1 , home , playerToMoveWith, false)) { byte[] positions = new byte[2]; positions[0] = -1; positions[1] = (byte)(home); Move move = new Move(card, positions); legal_moves.add(move); } for(int p = 0; p<pieces.length; p++) { if(Rules.getInstance().isRulesConform(board, card, pieces[p] , (pieces[p] + 11) % 64 , playerToMoveWith, false)) { byte[] positions = new byte[2]; positions[0] = (byte)pieces[p]; positions[1] = (byte)((pieces[p] + 11) % 64); Move move = new Move(card, positions); legal_moves.add(move); } if(Rules.getInstance().isRulesConform(board, card, pieces[p] , (pieces[p] + 1) % 64 , playerToMoveWith, false)) { byte[] positions = new byte[2]; positions[0] = (byte)pieces[p]; positions[1] = (byte)((pieces[p] + 1) % 64); Move move = new Move(card, positions); legal_moves.add(move); } int targetPosInHeaven11 = Rules.getInstance().getTargetPosInHeavenForAceAsEleven(board, pieces[p], playerToMoveWith); if(Rules.getInstance().isRulesConform(board, card, pieces[p] , targetPosInHeaven11 , playerToMoveWith, true)){ byte[] positions = new byte[2]; positions[0] = (byte)pieces[p]; positions[1] = (byte)targetPosInHeaven11; Move move = new Move(card, positions); legal_moves.add(move); } int targetPosInHeaven = Rules.getInstance().getTargetPosInHeaven(board, pieces[p], card, playerToMoveWith); if(Rules.getInstance().isRulesConform(board, card, pieces[p] , targetPosInHeaven , playerToMoveWith, true)){ byte[] positions = new byte[2]; positions[0] = (byte)pieces[p]; positions[1] = (byte)targetPosInHeaven; Move move = new Move(card, positions); legal_moves.add(move); } } return legal_moves; }
/** * gets the possible moves for an ace * @param pieces the pieces of the player * @param card the card to use * @param playerToMoveWith the player to move with * @return a List of all possible <class>Move</class>s for this card/situation */
gets the possible moves for an ace
getPossibleMovesForAce
{ "repo_name": "retoo/bodesuri", "path": "src/intelliDOG/ai/framework/BotBoard.java", "license": "gpl-2.0", "size": 34101 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,556,911
public void connect(Handler<AsyncResult<Void>> handler) { next = resp(handler, when("220", c -> { handler.handle(Future.succeededFuture()); })); client = vertx.createNetClient(); client.connect(port, host, res -> { socket = res.result(); if (res.failed()) { handler.handle(Future.failedFuture(res.cause())); } else { RecordParser parser = RecordParser.newDelimited("\n", this::output); socket.handler(parser); } }); }
void function(Handler<AsyncResult<Void>> handler) { next = resp(handler, when("220", c -> { handler.handle(Future.succeededFuture()); })); client = vertx.createNetClient(); client.connect(port, host, res -> { socket = res.result(); if (res.failed()) { handler.handle(Future.failedFuture(res.cause())); } else { RecordParser parser = RecordParser.newDelimited("\n", this::output); socket.handler(parser); } }); }
/** * Connect to the server. * @param handler callback handler that is called when the connection is completed. */
Connect to the server
connect
{ "repo_name": "bckfnn/vertx-ftp-client", "path": "src/main/java/io/github/bckfnn/ftp/FtpClient.java", "license": "apache-2.0", "size": 13140 }
[ "io.vertx.core.AsyncResult", "io.vertx.core.Future", "io.vertx.core.Handler", "io.vertx.core.parsetools.RecordParser" ]
import io.vertx.core.AsyncResult; import io.vertx.core.Future; import io.vertx.core.Handler; import io.vertx.core.parsetools.RecordParser;
import io.vertx.core.*; import io.vertx.core.parsetools.*;
[ "io.vertx.core" ]
io.vertx.core;
2,071,785
@UiHandler("m_cropButton") protected void openCropping(ClickEvent event) { m_formatHandler.openCropping(); }
@UiHandler(STR) void function(ClickEvent event) { m_formatHandler.openCropping(); }
/** * Opens the cropping dialog on crop button click.<p> * * @param event the click event */
Opens the cropping dialog on crop button click
openCropping
{ "repo_name": "alkacon/opencms-core", "path": "src-gwt/org/opencms/ade/galleries/client/preview/ui/CmsImageFormatsForm.java", "license": "lgpl-2.1", "size": 13475 }
[ "com.google.gwt.event.dom.client.ClickEvent", "com.google.gwt.uibinder.client.UiHandler" ]
import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.event.dom.client.*; import com.google.gwt.uibinder.client.*;
[ "com.google.gwt" ]
com.google.gwt;
1,579,770
public void removeField( JavaClassSource javaClassSource, String fieldName, ClassTypeResolver classTypeResolver ) throws Exception { logger.debug( "Removing field: " + fieldName + ", from class: " + javaClassSource.getName() ); FieldSource<JavaClassSource> field; GenerationTools genTools = new GenerationTools(); String methodName; MethodSource<JavaClassSource> method; field = javaClassSource.getField( fieldName ); if ( field != null ) { //check if the class has a setter/getter for the given field. Class<?> fieldClass = classTypeResolver.resolveType( field.getType().getName() ); methodName = genTools.toJavaGetter( fieldName, fieldClass.getName() ); removeMethodByParamsClass( javaClassSource, methodName ); methodName = genTools.toJavaSetter( fieldName ); removeMethodByParamsClass( javaClassSource, methodName, fieldClass ); //finally remove the field. javaClassSource.removeField( field ); } else { logger.debug( "Field field: " + fieldName + " was not found in class: " + javaClassSource.getName() ); } }
void function( JavaClassSource javaClassSource, String fieldName, ClassTypeResolver classTypeResolver ) throws Exception { logger.debug( STR + fieldName + STR + javaClassSource.getName() ); FieldSource<JavaClassSource> field; GenerationTools genTools = new GenerationTools(); String methodName; MethodSource<JavaClassSource> method; field = javaClassSource.getField( fieldName ); if ( field != null ) { Class<?> fieldClass = classTypeResolver.resolveType( field.getType().getName() ); methodName = genTools.toJavaGetter( fieldName, fieldClass.getName() ); removeMethodByParamsClass( javaClassSource, methodName ); methodName = genTools.toJavaSetter( fieldName ); removeMethodByParamsClass( javaClassSource, methodName, fieldClass ); javaClassSource.removeField( field ); } else { logger.debug( STR + fieldName + STR + javaClassSource.getName() ); } }
/** * Takes care of field and the corresponding setter/getter removal. */
Takes care of field and the corresponding setter/getter removal
removeField
{ "repo_name": "scandihealth/kie-wb-common", "path": "kie-wb-common-services/kie-wb-common-data-modeller-core/src/main/java/org/kie/workbench/common/services/datamodeller/driver/impl/JavaRoasterModelDriver.java", "license": "apache-2.0", "size": 74861 }
[ "org.drools.core.base.ClassTypeResolver", "org.jboss.forge.roaster.model.source.FieldSource", "org.jboss.forge.roaster.model.source.JavaClassSource", "org.jboss.forge.roaster.model.source.MethodSource", "org.kie.workbench.common.services.datamodeller.codegen.GenerationTools" ]
import org.drools.core.base.ClassTypeResolver; import org.jboss.forge.roaster.model.source.FieldSource; import org.jboss.forge.roaster.model.source.JavaClassSource; import org.jboss.forge.roaster.model.source.MethodSource; import org.kie.workbench.common.services.datamodeller.codegen.GenerationTools;
import org.drools.core.base.*; import org.jboss.forge.roaster.model.source.*; import org.kie.workbench.common.services.datamodeller.codegen.*;
[ "org.drools.core", "org.jboss.forge", "org.kie.workbench" ]
org.drools.core; org.jboss.forge; org.kie.workbench;
936,124
public RootInfo getRootOneshot(String authority, String rootId) { synchronized (mLock) { RootInfo root = getRootLocked(authority, rootId); if (root == null) { mRoots.putAll( authority, loadRootsForAuthority(mContext.getContentResolver(), authority)); root = getRootLocked(authority, rootId); } return root; } }
RootInfo function(String authority, String rootId) { synchronized (mLock) { RootInfo root = getRootLocked(authority, rootId); if (root == null) { mRoots.putAll( authority, loadRootsForAuthority(mContext.getContentResolver(), authority)); root = getRootLocked(authority, rootId); } return root; } }
/** * Return the requested {@link RootInfo}, but only loading the roots for the * requested authority. This is useful when we want to load fast without * waiting for all the other roots to come back. */
Return the requested <code>RootInfo</code>, but only loading the roots for the requested authority. This is useful when we want to load fast without waiting for all the other roots to come back
getRootOneshot
{ "repo_name": "Ant-Droid/android_frameworks_base_OLD", "path": "packages/DocumentsUI/src/com/android/documentsui/RootsCache.java", "license": "apache-2.0", "size": 15094 }
[ "com.android.documentsui.model.RootInfo" ]
import com.android.documentsui.model.RootInfo;
import com.android.documentsui.model.*;
[ "com.android.documentsui" ]
com.android.documentsui;
975,820
@Override public Integer load(final Integer key) { missCount.increment(); Blackhole.consumeCPU(1000); return key * 2 + 11; } }
Integer function(final Integer key) { missCount.increment(); Blackhole.consumeCPU(1000); return key * 2 + 11; } }
/** * The loader increments the miss counter and burns CPU via JMH's blackhole * to have a relevant miss penalty. */
The loader increments the miss counter and burns CPU via JMH's blackhole to have a relevant miss penalty
load
{ "repo_name": "headissue/cache2k-benchmark", "path": "jmh-suite/src/main/java/org/cache2k/benchmark/jmh/suite/eviction/symmetrical/ZipfianSequenceLoadingBenchmark.java", "license": "gpl-3.0", "size": 5107 }
[ "org.openjdk.jmh.infra.Blackhole" ]
import org.openjdk.jmh.infra.Blackhole;
import org.openjdk.jmh.infra.*;
[ "org.openjdk.jmh" ]
org.openjdk.jmh;
2,785,373
@POST @Path("{id}") @Produces(MediaType.APPLICATION_JSON) @ApiOperation("Updates the specified feed.") @ApiResponses({ @ApiResponse(code = 200, message = "The feed was updated.", response = Feed.class), @ApiResponse(code = 404, message = "The feed was not found.", response = RestResponseStatus.class), @ApiResponse(code = 500, message = "The feed could not be updated.", response = RestResponseStatus.class) }) public Feed updateFeed(@PathParam("id") final String feedId, final Feed feed) { LOG.debug("Update feed: {}", feed); this.metadataTransform.validateCreate(feed); return this.metadata.commit(() -> { this.accessController.checkPermission(AccessController.SERVICES, FeedServicesAccessControl.EDIT_FEEDS); com.thinkbiganalytics.metadata.api.feed.Feed.ID domainId = feedProvider.resolveFeed(feedId); com.thinkbiganalytics.metadata.api.feed.Feed domain = feedProvider.getFeed(domainId); if (domain != null) { domain = this.metadataTransform.updateDomain(feed, domain); return this.metadataTransform.domainToFeed().apply(domain); } else { throw new WebApplicationException("No feed exist with the ID: " + feed.getId(), Status.NOT_FOUND); } }); }
@Path("{id}") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(STR) @ApiResponses({ @ApiResponse(code = 200, message = STR, response = Feed.class), @ApiResponse(code = 404, message = STR, response = RestResponseStatus.class), @ApiResponse(code = 500, message = STR, response = RestResponseStatus.class) }) Feed function(@PathParam("id") final String feedId, final Feed feed) { LOG.debug(STR, feed); this.metadataTransform.validateCreate(feed); return this.metadata.commit(() -> { this.accessController.checkPermission(AccessController.SERVICES, FeedServicesAccessControl.EDIT_FEEDS); com.thinkbiganalytics.metadata.api.feed.Feed.ID domainId = feedProvider.resolveFeed(feedId); com.thinkbiganalytics.metadata.api.feed.Feed domain = feedProvider.getFeed(domainId); if (domain != null) { domain = this.metadataTransform.updateDomain(feed, domain); return this.metadataTransform.domainToFeed().apply(domain); } else { throw new WebApplicationException(STR + feed.getId(), Status.NOT_FOUND); } }); }
/** * Updates an existing feed. Note that POST is used here rather than PUT since it behaves more like a PATCH; which isn't supported in Jersey. */
Updates an existing feed. Note that POST is used here rather than PUT since it behaves more like a PATCH; which isn't supported in Jersey
updateFeed
{ "repo_name": "rashidaligee/kylo", "path": "services/feed-manager-service/feed-manager-controller/src/main/java/com/thinkbiganalytics/feedmgr/rest/controller/FeedsController.java", "license": "apache-2.0", "size": 59384 }
[ "com.thinkbiganalytics.feedmgr.security.FeedServicesAccessControl", "com.thinkbiganalytics.metadata.rest.model.feed.Feed", "com.thinkbiganalytics.rest.model.RestResponseStatus", "com.thinkbiganalytics.security.AccessController", "io.swagger.annotations.ApiOperation", "io.swagger.annotations.ApiResponse", "io.swagger.annotations.ApiResponses", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.Produces", "javax.ws.rs.WebApplicationException", "javax.ws.rs.core.MediaType", "javax.ws.rs.core.Response" ]
import com.thinkbiganalytics.feedmgr.security.FeedServicesAccessControl; import com.thinkbiganalytics.metadata.rest.model.feed.Feed; import com.thinkbiganalytics.rest.model.RestResponseStatus; import com.thinkbiganalytics.security.AccessController; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response;
import com.thinkbiganalytics.feedmgr.security.*; import com.thinkbiganalytics.metadata.rest.model.feed.*; import com.thinkbiganalytics.rest.model.*; import com.thinkbiganalytics.security.*; import io.swagger.annotations.*; import javax.ws.rs.*; import javax.ws.rs.core.*;
[ "com.thinkbiganalytics.feedmgr", "com.thinkbiganalytics.metadata", "com.thinkbiganalytics.rest", "com.thinkbiganalytics.security", "io.swagger.annotations", "javax.ws" ]
com.thinkbiganalytics.feedmgr; com.thinkbiganalytics.metadata; com.thinkbiganalytics.rest; com.thinkbiganalytics.security; io.swagger.annotations; javax.ws;
2,217,676
EReference getAncestorVersionSpec_Target();
EReference getAncestorVersionSpec_Target();
/** * Returns the meta object for the containment reference ' * {@link org.eclipse.emf.emfstore.internal.server.model.versioning.AncestorVersionSpec#getTarget <em>Target</em>}'. * <!-- begin-user-doc --> <!-- end-user-doc --> * * @return the meta object for the containment reference '<em>Target</em>'. * @see org.eclipse.emf.emfstore.internal.server.model.versioning.AncestorVersionSpec#getTarget() * @see #getAncestorVersionSpec() * @generated */
Returns the meta object for the containment reference ' <code>org.eclipse.emf.emfstore.internal.server.model.versioning.AncestorVersionSpec#getTarget Target</code>'.
getAncestorVersionSpec_Target
{ "repo_name": "edgarmueller/emfstore-rest", "path": "bundles/org.eclipse.emf.emfstore.server.model/src/org/eclipse/emf/emfstore/internal/server/model/versioning/VersioningPackage.java", "license": "epl-1.0", "size": 84798 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,308,529
public void endElement(String name) throws IOException { xmlOut.endElement(name); }
void function(String name) throws IOException { xmlOut.endElement(name); }
/** * <p>Ends an element.</p> * * <p>This may output an end-tag or close the current start-tag as an * empty element.</p> */
Ends an element. This may output an end-tag or close the current start-tag as an empty element
endElement
{ "repo_name": "jonabbey/Ganymede", "path": "src/ganymede/arlut/csd/ganymede/server/XMLDumpContext.java", "license": "gpl-2.0", "size": 22698 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,149,522
private void putGraphic(AbstractGraphics abstractGraphic, Image image) throws IOException { byte[] rawData = null; final ImageInfo info = image.getInfo(); if (image instanceof ImageRawStream) { ImageRawStream rawImage = (ImageRawStream)image; InputStream in = rawImage.createInputStream(); try { rawData = IOUtils.toByteArray(in); } finally { IOUtils.closeQuietly(in); } } if (rawData == null) { ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get( getUserAgent().getEventBroadcaster()); eventProducer.imageWritingError(this, null); return; } //Set up percentage calculations this.percentManager.setDimension(abstractGraphic); PercentBaseContext pContext = new PercentBaseContext() {
void function(AbstractGraphics abstractGraphic, Image image) throws IOException { byte[] rawData = null; final ImageInfo info = image.getInfo(); if (image instanceof ImageRawStream) { ImageRawStream rawImage = (ImageRawStream)image; InputStream in = rawImage.createInputStream(); try { rawData = IOUtils.toByteArray(in); } finally { IOUtils.closeQuietly(in); } } if (rawData == null) { ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get( getUserAgent().getEventBroadcaster()); eventProducer.imageWritingError(this, null); return; } this.percentManager.setDimension(abstractGraphic); PercentBaseContext pContext = new PercentBaseContext() {
/** * Puts a graphic/image into the generated RTF file. * @param abstractGraphic the graphic (external-graphic or instream-foreign-object) * @param image the image * @throws IOException In case of an I/O error */
Puts a graphic/image into the generated RTF file
putGraphic
{ "repo_name": "spepping/fop-cs", "path": "src/java/org/apache/fop/render/rtf/RTFHandler.java", "license": "apache-2.0", "size": 63812 }
[ "java.io.IOException", "java.io.InputStream", "org.apache.commons.io.IOUtils", "org.apache.fop.ResourceEventProducer", "org.apache.fop.datatypes.PercentBaseContext", "org.apache.fop.fo.flow.AbstractGraphics", "org.apache.xmlgraphics.image.loader.Image", "org.apache.xmlgraphics.image.loader.ImageInfo", "org.apache.xmlgraphics.image.loader.impl.ImageRawStream" ]
import java.io.IOException; import java.io.InputStream; import org.apache.commons.io.IOUtils; import org.apache.fop.ResourceEventProducer; import org.apache.fop.datatypes.PercentBaseContext; import org.apache.fop.fo.flow.AbstractGraphics; import org.apache.xmlgraphics.image.loader.Image; import org.apache.xmlgraphics.image.loader.ImageInfo; import org.apache.xmlgraphics.image.loader.impl.ImageRawStream;
import java.io.*; import org.apache.commons.io.*; import org.apache.fop.*; import org.apache.fop.datatypes.*; import org.apache.fop.fo.flow.*; import org.apache.xmlgraphics.image.loader.*; import org.apache.xmlgraphics.image.loader.impl.*;
[ "java.io", "org.apache.commons", "org.apache.fop", "org.apache.xmlgraphics" ]
java.io; org.apache.commons; org.apache.fop; org.apache.xmlgraphics;
1,349,098
private static BookieServiceInfo buildBookieServiceInfo(ComponentInfoPublisher componentInfoPublisher) { List<Endpoint> endpoints = componentInfoPublisher.getEndpoints().values() .stream().map(e -> { return new Endpoint( e.getId(), e.getPort(), e.getHost(), e.getProtocol(), e.getAuth(), e.getExtensions() ); }).collect(Collectors.toList()); return new BookieServiceInfo(componentInfoPublisher.getProperties(), endpoints); }
static BookieServiceInfo function(ComponentInfoPublisher componentInfoPublisher) { List<Endpoint> endpoints = componentInfoPublisher.getEndpoints().values() .stream().map(e -> { return new Endpoint( e.getId(), e.getPort(), e.getHost(), e.getProtocol(), e.getAuth(), e.getExtensions() ); }).collect(Collectors.toList()); return new BookieServiceInfo(componentInfoPublisher.getProperties(), endpoints); }
/** * Create the {@link BookieServiceInfo} starting from the published endpoints. * * @see ComponentInfoPublisher * @param componentInfoPublisher the endpoint publisher * @return the created bookie service info */
Create the <code>BookieServiceInfo</code> starting from the published endpoints
buildBookieServiceInfo
{ "repo_name": "apache/bookkeeper", "path": "bookkeeper-server/src/main/java/org/apache/bookkeeper/server/Main.java", "license": "apache-2.0", "size": 26518 }
[ "java.util.List", "java.util.stream.Collectors", "org.apache.bookkeeper.common.component.ComponentInfoPublisher", "org.apache.bookkeeper.discover.BookieServiceInfo" ]
import java.util.List; import java.util.stream.Collectors; import org.apache.bookkeeper.common.component.ComponentInfoPublisher; import org.apache.bookkeeper.discover.BookieServiceInfo;
import java.util.*; import java.util.stream.*; import org.apache.bookkeeper.common.component.*; import org.apache.bookkeeper.discover.*;
[ "java.util", "org.apache.bookkeeper" ]
java.util; org.apache.bookkeeper;
926,796
public void setEntityManagerFactoryInterface(Class<? extends EntityManagerFactory> emfInterface) { Assert.isAssignable(EntityManagerFactory.class, emfInterface); this.entityManagerFactoryInterface = emfInterface; }
void function(Class<? extends EntityManagerFactory> emfInterface) { Assert.isAssignable(EntityManagerFactory.class, emfInterface); this.entityManagerFactoryInterface = emfInterface; }
/** * Specify the (potentially vendor-specific) EntityManagerFactory interface * that this EntityManagerFactory proxy is supposed to implement. * <p>The default will be taken from the specific JpaVendorAdapter, if any, * or set to the standard <code>javax.persistence.EntityManagerFactory</code> * interface else. * @see JpaVendorAdapter#getEntityManagerFactoryInterface() */
Specify the (potentially vendor-specific) EntityManagerFactory interface that this EntityManagerFactory proxy is supposed to implement. The default will be taken from the specific JpaVendorAdapter, if any, or set to the standard <code>javax.persistence.EntityManagerFactory</code> interface else
setEntityManagerFactoryInterface
{ "repo_name": "codeApeFromChina/resource", "path": "frame_packages/java_libs/spring-2.5.6-src/tiger/src/org/springframework/orm/jpa/AbstractEntityManagerFactoryBean.java", "license": "unlicense", "size": 17773 }
[ "javax.persistence.EntityManagerFactory", "org.springframework.util.Assert" ]
import javax.persistence.EntityManagerFactory; import org.springframework.util.Assert;
import javax.persistence.*; import org.springframework.util.*;
[ "javax.persistence", "org.springframework.util" ]
javax.persistence; org.springframework.util;
2,347,684
public JMenuItem add(Action a) { return popup.add(a); }
JMenuItem function(Action a) { return popup.add(a); }
/** * Appends a new menu item to the end of the menu which dispatches the * specified {@code Action} object. * * @param a * the {@code Action} to add to the menu. * @return the new menu item. * @see Action */
Appends a new menu item to the end of the menu which dispatches the specified Action object
add
{ "repo_name": "hlfernandez/GC4S", "path": "gc4s/src/main/java/org/sing_group/gc4s/ui/menu/HamburgerMenu.java", "license": "gpl-3.0", "size": 3742 }
[ "javax.swing.Action", "javax.swing.JMenuItem" ]
import javax.swing.Action; import javax.swing.JMenuItem;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
2,572,870
@Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (vm != null) if (vm instanceof IPermission) ((IPermission) vm).onRequestPermissionsResult(requestCode, permissions, grantResults); }
void function(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (vm != null) if (vm instanceof IPermission) ((IPermission) vm).onRequestPermissionsResult(requestCode, permissions, grantResults); }
/*** * Handle the permission and give it to the activity * * @param requestCode * @param permissions * @param grantResults */
Handle the permission and give it to the activity
onRequestPermissionsResult
{ "repo_name": "joxad/easydatabinding", "path": "lib/src/main/java/com/joxad/easydatabinding/activity/ActivityBase.java", "license": "apache-2.0", "size": 4069 }
[ "android.support.annotation.NonNull" ]
import android.support.annotation.NonNull;
import android.support.annotation.*;
[ "android.support" ]
android.support;
2,722,752
private List<FeatureCollection> parseFeatureCollectionData( Element featureCollectionData ) throws OGCWebServiceException { if ( featureCollectionData == null ) { return null; } List<FeatureCollection> transformableData = new ArrayList<FeatureCollection>(); try { List<Element> fcElements = getElements( featureCollectionData, GML_PREFIX + ":FeatureCollection", nsContext ); if ( fcElements == null || fcElements.size() == 0 ) { LOG.logError( "Could not find any feature collections, this is strange!" ); throw new OGCWebServiceException( Messages.getMessage( "WCTS_TRANSFORM_NO_DATA_FOUND", "gml:FeatureCollection" ), WCTSExceptionCode.NO_INPUT_DATA ); } GMLFeatureCollectionDocument fd = new GMLFeatureCollectionDocument( true, true ); for ( Element fc : fcElements ) { fd.setRootElement( fc ); FeatureCollection data = fd.parse(); if ( data != null ) { transformableData.add( data ); } } } catch ( XMLParsingException e ) { LOG.logError( e.getMessage(), e ); throw new OGCWebServiceException( e.getMessage(), ExceptionCode.NOAPPLICABLECODE ); } return transformableData; }
List<FeatureCollection> function( Element featureCollectionData ) throws OGCWebServiceException { if ( featureCollectionData == null ) { return null; } List<FeatureCollection> transformableData = new ArrayList<FeatureCollection>(); try { List<Element> fcElements = getElements( featureCollectionData, GML_PREFIX + STR, nsContext ); if ( fcElements == null fcElements.size() == 0 ) { LOG.logError( STR ); throw new OGCWebServiceException( Messages.getMessage( STR, STR ), WCTSExceptionCode.NO_INPUT_DATA ); } GMLFeatureCollectionDocument fd = new GMLFeatureCollectionDocument( true, true ); for ( Element fc : fcElements ) { fd.setRootElement( fc ); FeatureCollection data = fd.parse(); if ( data != null ) { transformableData.add( data ); } } } catch ( XMLParsingException e ) { LOG.logError( e.getMessage(), e ); throw new OGCWebServiceException( e.getMessage(), ExceptionCode.NOAPPLICABLECODE ); } return transformableData; }
/** * Parse the featurecollections from the given featureCollectionsData element. * * @param featureCollectionData * (a deegreewcts:inlineElement/deegreewcts:FeatureCollectionData or a deegreewcts:mulipart element). * @return the list of feature collections. * @throws OGCWebServiceException * if no feature collections were found or an xml parsing exception occurred. */
Parse the featurecollections from the given featureCollectionsData element
parseFeatureCollectionData
{ "repo_name": "lat-lon/deegree2-base", "path": "deegree2-core/src/main/java/org/deegree/ogcwebservices/wcts/operation/TransformDocument.java", "license": "lgpl-2.1", "size": 26509 }
[ "java.util.ArrayList", "java.util.List", "org.deegree.framework.xml.XMLParsingException", "org.deegree.framework.xml.XMLTools", "org.deegree.i18n.Messages", "org.deegree.model.feature.FeatureCollection", "org.deegree.model.feature.GMLFeatureCollectionDocument", "org.deegree.ogcbase.ExceptionCode", "org.deegree.ogcwebservices.OGCWebServiceException", "org.deegree.ogcwebservices.wcts.WCTSExceptionCode", "org.w3c.dom.Element" ]
import java.util.ArrayList; import java.util.List; import org.deegree.framework.xml.XMLParsingException; import org.deegree.framework.xml.XMLTools; import org.deegree.i18n.Messages; import org.deegree.model.feature.FeatureCollection; import org.deegree.model.feature.GMLFeatureCollectionDocument; import org.deegree.ogcbase.ExceptionCode; import org.deegree.ogcwebservices.OGCWebServiceException; import org.deegree.ogcwebservices.wcts.WCTSExceptionCode; import org.w3c.dom.Element;
import java.util.*; import org.deegree.framework.xml.*; import org.deegree.i18n.*; import org.deegree.model.feature.*; import org.deegree.ogcbase.*; import org.deegree.ogcwebservices.*; import org.deegree.ogcwebservices.wcts.*; import org.w3c.dom.*;
[ "java.util", "org.deegree.framework", "org.deegree.i18n", "org.deegree.model", "org.deegree.ogcbase", "org.deegree.ogcwebservices", "org.w3c.dom" ]
java.util; org.deegree.framework; org.deegree.i18n; org.deegree.model; org.deegree.ogcbase; org.deegree.ogcwebservices; org.w3c.dom;
1,837,082
@ManagedAttribute(description = "Whether to include a Prefer: return=representation; include=\"URI\" header") public String getPreferInclude() { return getConfiguration().getPreferInclude(); }
@ManagedAttribute(description = STRURI\STR) String function() { return getConfiguration().getPreferInclude(); }
/** * preferInclude getter * * @return the URI(s) that populate the include section in a Prefer header */
preferInclude getter
getPreferInclude
{ "repo_name": "daniel-dgi/fcrepo-camel", "path": "src/main/java/org/fcrepo/camel/FcrepoEndpoint.java", "license": "apache-2.0", "size": 13666 }
[ "org.apache.camel.api.management.ManagedAttribute" ]
import org.apache.camel.api.management.ManagedAttribute;
import org.apache.camel.api.management.*;
[ "org.apache.camel" ]
org.apache.camel;
1,772,363
public static <E extends SpecificRecord, S extends SpecificRecord> Dao<E> buildCompositeDaoWithInputStream( HTablePool tablePool, String tableName, List<InputStream> subEntitySchemaStreams, Class<E> entityClass) { List<String> subEntitySchemaStrings = new ArrayList<String>(); for (InputStream subEntitySchemaStream : subEntitySchemaStreams) { subEntitySchemaStrings.add(AvroUtils .inputStreamToString(subEntitySchemaStream)); } return buildCompositeDao(tablePool, tableName, subEntitySchemaStrings, entityClass); }
static <E extends SpecificRecord, S extends SpecificRecord> Dao<E> function( HTablePool tablePool, String tableName, List<InputStream> subEntitySchemaStreams, Class<E> entityClass) { List<String> subEntitySchemaStrings = new ArrayList<String>(); for (InputStream subEntitySchemaStream : subEntitySchemaStreams) { subEntitySchemaStrings.add(AvroUtils .inputStreamToString(subEntitySchemaStream)); } return buildCompositeDao(tablePool, tableName, subEntitySchemaStrings, entityClass); }
/** * Create a CompositeDao, which will return SpecificRecord instances * represented by the entitySchemaString avro schema. This avro schema must be * a composition of the schemas in the subEntitySchemaStrings list. * * @param tablePool * An HTablePool instance to use for connecting to HBase * @param tableName * The table name this dao will read from and write to * @param keySchemaStream * The Avro schema input stream that represents the StorageKey structure for * row keys in this table. * @param subEntitySchemaStreams * The list of entities that make up the composite. This list must be * in the same order as the fields defined in the entitySchemaString. * @param keyClass * The class of the SpecificRecord representing the StorageKey of rows this * dao will fetch. * @param entityClass * The class of the SpecificRecord this DAO will persist and fetch. * @return The CompositeDao instance. * @throws SchemaNotFoundException * @throws SchemaValidationException */
Create a CompositeDao, which will return SpecificRecord instances represented by the entitySchemaString avro schema. This avro schema must be a composition of the schemas in the subEntitySchemaStrings list
buildCompositeDaoWithInputStream
{ "repo_name": "stevek-ngdata/kite", "path": "kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/avro/SpecificAvroDao.java", "license": "apache-2.0", "size": 18865 }
[ "java.io.InputStream", "java.util.ArrayList", "java.util.List", "org.apache.avro.specific.SpecificRecord", "org.apache.hadoop.hbase.client.HTablePool", "org.kitesdk.data.hbase.impl.Dao" ]
import java.io.InputStream; import java.util.ArrayList; import java.util.List; import org.apache.avro.specific.SpecificRecord; import org.apache.hadoop.hbase.client.HTablePool; import org.kitesdk.data.hbase.impl.Dao;
import java.io.*; import java.util.*; import org.apache.avro.specific.*; import org.apache.hadoop.hbase.client.*; import org.kitesdk.data.hbase.impl.*;
[ "java.io", "java.util", "org.apache.avro", "org.apache.hadoop", "org.kitesdk.data" ]
java.io; java.util; org.apache.avro; org.apache.hadoop; org.kitesdk.data;
2,053,509
public File tempdir() { final File ffile = new File(tempfile().getAbsoluteFile() + ".dir/"); if (!ffile.mkdirs()) { this.commonCore.report(MessageType.EXCEPTION, "Unable to create directory " + ffile); } return ffile; }
File function() { final File ffile = new File(tempfile().getAbsoluteFile() + ".dir/"); if (!ffile.mkdirs()) { this.commonCore.report(MessageType.EXCEPTION, STR + ffile); } return ffile; }
/** * Returns a temporary directory. * * @return A File object for a temporary directory. */
Returns a temporary directory
tempdir
{ "repo_name": "ubicity-devs/jcores", "path": "src/main/java/net/jcores/jre/cores/commons/CommonSys.java", "license": "agpl-3.0", "size": 7828 }
[ "java.io.File", "net.jcores.jre.options.MessageType" ]
import java.io.File; import net.jcores.jre.options.MessageType;
import java.io.*; import net.jcores.jre.options.*;
[ "java.io", "net.jcores.jre" ]
java.io; net.jcores.jre;
1,806,230
int[][] list = new int[adjacencyMatrix.length][]; for (int i = 0; i < adjacencyMatrix.length; i++) { Vector v = new Vector(); for (int j = 0; j < adjacencyMatrix[i].length; j++) { if (adjacencyMatrix[i][j]) { v.add(new Integer(j)); } } list[i] = new int[v.size()]; for (int j = 0; j < v.size(); j++) { Integer in = (Integer) v.get(j); list[i][j] = in.intValue(); } } return list; }
int[][] list = new int[adjacencyMatrix.length][]; for (int i = 0; i < adjacencyMatrix.length; i++) { Vector v = new Vector(); for (int j = 0; j < adjacencyMatrix[i].length; j++) { if (adjacencyMatrix[i][j]) { v.add(new Integer(j)); } } list[i] = new int[v.size()]; for (int j = 0; j < v.size(); j++) { Integer in = (Integer) v.get(j); list[i][j] = in.intValue(); } } return list; }
/** * Calculates a adjacency-list for a given array of an adjacency-matrix. * * @param adjacencyMatrix array with the adjacency-matrix that represents * the graph * @return int[][]-array of the adjacency-list of given nodes. The first * dimension in the array represents the same node as in the given * adjacency, the second dimension represents the indicies of those nodes, * that are direct successornodes of the node. */
Calculates a adjacency-list for a given array of an adjacency-matrix
getAdjacencyList
{ "repo_name": "UniversityOfBrightonComputing/iCurves", "path": "src/main/java/icurves/graph/cycles/AdjacencyList.java", "license": "mit", "size": 1192 }
[ "java.util.Vector" ]
import java.util.Vector;
import java.util.*;
[ "java.util" ]
java.util;
2,870,346
public static NamedMediaType getFromExtension(String extension) { MediaType mt = MediaType.getMediaTypeForExtension(extension); if (mt == null) return null; String description = mt.getMimeType(); return getFromDescription(description); }
static NamedMediaType function(String extension) { MediaType mt = MediaType.getMediaTypeForExtension(extension); if (mt == null) return null; String description = mt.getMimeType(); return getFromDescription(description); }
/** * Retrieves the named media type from the specified extension. * * This should only be used if you are positive that the media type * is already cached for this extension. */
Retrieves the named media type from the specified extension. This should only be used if you are positive that the media type is already cached for this extension
getFromExtension
{ "repo_name": "alejandroarturom/frostwire-desktop", "path": "src/com/limegroup/gnutella/gui/search/NamedMediaType.java", "license": "gpl-3.0", "size": 7307 }
[ "com.limegroup.gnutella.MediaType" ]
import com.limegroup.gnutella.MediaType;
import com.limegroup.gnutella.*;
[ "com.limegroup.gnutella" ]
com.limegroup.gnutella;
2,310,075
@Test public void testMoverCli() throws Exception { final MiniDFSCluster cluster = new MiniDFSCluster .Builder(new HdfsConfiguration()).numDataNodes(0).build(); try { final Configuration conf = cluster.getConfiguration(0); try { Mover.Cli.getNameNodePathsToMove(conf, "-p", "/foo", "bar"); Assert.fail("Expected exception for illegal path bar"); } catch (IllegalArgumentException e) { GenericTestUtils.assertExceptionContains("bar is not absolute", e); } Map<URI, List<Path>> movePaths = Mover.Cli.getNameNodePathsToMove(conf); Collection<URI> namenodes = DFSUtil.getInternalNsRpcUris(conf); Assert.assertEquals(1, namenodes.size()); Assert.assertEquals(1, movePaths.size()); URI nn = namenodes.iterator().next(); Assert.assertTrue(movePaths.containsKey(nn)); Assert.assertNull(movePaths.get(nn)); movePaths = Mover.Cli.getNameNodePathsToMove(conf, "-p", "/foo", "/bar"); namenodes = DFSUtil.getInternalNsRpcUris(conf); Assert.assertEquals(1, movePaths.size()); nn = namenodes.iterator().next(); Assert.assertTrue(movePaths.containsKey(nn)); checkMovePaths(movePaths.get(nn), new Path("/foo"), new Path("/bar")); } finally { cluster.shutdown(); } }
void function() throws Exception { final MiniDFSCluster cluster = new MiniDFSCluster .Builder(new HdfsConfiguration()).numDataNodes(0).build(); try { final Configuration conf = cluster.getConfiguration(0); try { Mover.Cli.getNameNodePathsToMove(conf, "-p", "/foo", "bar"); Assert.fail(STR); } catch (IllegalArgumentException e) { GenericTestUtils.assertExceptionContains(STR, e); } Map<URI, List<Path>> movePaths = Mover.Cli.getNameNodePathsToMove(conf); Collection<URI> namenodes = DFSUtil.getInternalNsRpcUris(conf); Assert.assertEquals(1, namenodes.size()); Assert.assertEquals(1, movePaths.size()); URI nn = namenodes.iterator().next(); Assert.assertTrue(movePaths.containsKey(nn)); Assert.assertNull(movePaths.get(nn)); movePaths = Mover.Cli.getNameNodePathsToMove(conf, "-p", "/foo", "/bar"); namenodes = DFSUtil.getInternalNsRpcUris(conf); Assert.assertEquals(1, movePaths.size()); nn = namenodes.iterator().next(); Assert.assertTrue(movePaths.containsKey(nn)); checkMovePaths(movePaths.get(nn), new Path("/foo"), new Path("/bar")); } finally { cluster.shutdown(); } }
/** * Test Mover Cli by specifying a list of files/directories using option "-p". * There is only one namenode (and hence name service) specified in the conf. */
Test Mover Cli by specifying a list of files/directories using option "-p". There is only one namenode (and hence name service) specified in the conf
testMoverCli
{ "repo_name": "szegedim/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/mover/TestMover.java", "license": "apache-2.0", "size": 46209 }
[ "java.util.Collection", "java.util.List", "java.util.Map", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.fs.Path", "org.apache.hadoop.hdfs.DFSUtil", "org.apache.hadoop.hdfs.HdfsConfiguration", "org.apache.hadoop.hdfs.MiniDFSCluster", "org.apache.hadoop.test.GenericTestUtils", "org.junit.Assert" ]
import java.util.Collection; import java.util.List; import java.util.Map; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.DFSUtil; import org.apache.hadoop.hdfs.HdfsConfiguration; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.apache.hadoop.test.GenericTestUtils; import org.junit.Assert;
import java.util.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.*; import org.apache.hadoop.test.*; import org.junit.*;
[ "java.util", "org.apache.hadoop", "org.junit" ]
java.util; org.apache.hadoop; org.junit;
295,215
XNameReplace xNR = oObj.getEvents(); xNR.getElementNames(); tRes.tested("getEvents()",xNR != null); }
XNameReplace xNR = oObj.getEvents(); xNR.getElementNames(); tRes.tested(STR,xNR != null); }
/** * Just calls the method. <p> * Has <b> OK </b> status if not <code>null</code> value returned. */
Just calls the method. Has OK status if not <code>null</code> value returned
_getEvents
{ "repo_name": "qt-haiku/LibreOffice", "path": "qadevOOo/tests/java/ifc/document/_XEventsSupplier.java", "license": "gpl-3.0", "size": 1605 }
[ "com.sun.star.container.XNameReplace" ]
import com.sun.star.container.XNameReplace;
import com.sun.star.container.*;
[ "com.sun.star" ]
com.sun.star;
1,822,446
protected void adds(int size, Register dst, Register src, int aimm) { assert !dst.equals(sp); assert !src.equals(zr); addSubImmInstruction(ADDS, dst, src, aimm, generalFromSize(size)); }
void function(int size, Register dst, Register src, int aimm) { assert !dst.equals(sp); assert !src.equals(zr); addSubImmInstruction(ADDS, dst, src, aimm, generalFromSize(size)); }
/** * dst = src + aimm and sets condition flags. * * @param size register size. Has to be 32 or 64. * @param dst general purpose register. May not be null or stackpointer. * @param src general purpose register. May not be null or zero-register. * @param aimm arithmetic immediate. Either unsigned 12-bit value or unsigned 24-bit value with * the lower 12-bit cleared. */
dst = src + aimm and sets condition flags
adds
{ "repo_name": "md-5/jdk10", "path": "src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java", "license": "gpl-2.0", "size": 131187 }
[ "org.graalvm.compiler.asm.aarch64.AArch64Assembler" ]
import org.graalvm.compiler.asm.aarch64.AArch64Assembler;
import org.graalvm.compiler.asm.aarch64.*;
[ "org.graalvm.compiler" ]
org.graalvm.compiler;
344,076
public synchronized void setGroupLdap(String groupName) throws AmbariException { GroupEntity groupEntity = groupDAO.findGroupByName(groupName); if (groupEntity != null) { groupEntity.setGroupType(GroupType.LDAP); groupDAO.merge(groupEntity); } else { throw new AmbariException("Group " + groupName + " doesn't exist"); } }
synchronized void function(String groupName) throws AmbariException { GroupEntity groupEntity = groupDAO.findGroupByName(groupName); if (groupEntity != null) { groupEntity.setGroupType(GroupType.LDAP); groupDAO.merge(groupEntity); } else { throw new AmbariException(STR + groupName + STR); } }
/** * Converts group to LDAP group. * * @param groupName group name * @throws AmbariException if group does not exist */
Converts group to LDAP group
setGroupLdap
{ "repo_name": "sekikn/ambari", "path": "ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java", "license": "apache-2.0", "size": 69453 }
[ "org.apache.ambari.server.AmbariException", "org.apache.ambari.server.orm.entities.GroupEntity" ]
import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.orm.entities.GroupEntity;
import org.apache.ambari.server.*; import org.apache.ambari.server.orm.entities.*;
[ "org.apache.ambari" ]
org.apache.ambari;
2,578,212
public Player getPlayer() { Player p = Bukkit.getPlayer(playerName); if (p == null) { throw new IllegalStateException("Player " + playerName + " is not online"); } return p; }
Player function() { Player p = Bukkit.getPlayer(playerName); if (p == null) { throw new IllegalStateException(STR + playerName + STR); } return p; }
/** * Get the Player associated with this ExperienceManager. * * @return the Player object * @throws IllegalStateException * if the player is no longer online */
Get the Player associated with this ExperienceManager
getPlayer
{ "repo_name": "Jameskmonger/XPStrength", "path": "src/com/jamesmonger/XPStrength/util/ExperienceManager.java", "license": "mit", "size": 6178 }
[ "org.bukkit.Bukkit", "org.bukkit.entity.Player" ]
import org.bukkit.Bukkit; import org.bukkit.entity.Player;
import org.bukkit.*; import org.bukkit.entity.*;
[ "org.bukkit", "org.bukkit.entity" ]
org.bukkit; org.bukkit.entity;
311,022
private void initTeamCalPicker(final FieldsetPanel fieldSet) { if (access == false) { final TeamCalDO calendar = data.getCalendar(); final Label teamCalTitle = new Label(fieldSet.newChildId(), calendar != null ? new PropertyModel<String>(data.getCalendar(), "title") : ""); fieldSet.add(teamCalTitle); } else { final List<TeamCalDO> list = teamCalDao.getAllCalendarsWithFullAccess(); calendarsWithFullAccess = list.toArray(new TeamCalDO[0]); final LabelValueChoiceRenderer<TeamCalDO> calChoiceRenderer = new LabelValueChoiceRenderer<TeamCalDO>(); for (final TeamCalDO cal : list) { calChoiceRenderer.addValue(cal, cal.getTitle()); } final DropDownChoice<TeamCalDO> calDropDownChoice = new DropDownChoice<TeamCalDO>(fieldSet.getDropDownChoiceId(), new PropertyModel<TeamCalDO>(data, "calendar"), calChoiceRenderer.getValues(), calChoiceRenderer); calDropDownChoice.setNullValid(false); calDropDownChoice.setRequired(true); fieldSet.add(calDropDownChoice); } }
void function(final FieldsetPanel fieldSet) { if (access == false) { final TeamCalDO calendar = data.getCalendar(); final Label teamCalTitle = new Label(fieldSet.newChildId(), calendar != null ? new PropertyModel<String>(data.getCalendar(), "title") : STRcalendar"), calChoiceRenderer.getValues(), calChoiceRenderer); calDropDownChoice.setNullValid(false); calDropDownChoice.setRequired(true); fieldSet.add(calDropDownChoice); } }
/** * if has access: create drop down with teamCals else create label * * @param fieldSet */
if has access: create drop down with teamCals else create label
initTeamCalPicker
{ "repo_name": "linqingyicen/projectforge-webapp", "path": "src/main/java/org/projectforge/plugins/teamcal/event/TeamEventEditForm.java", "license": "gpl-3.0", "size": 22997 }
[ "org.apache.wicket.markup.html.basic.Label", "org.apache.wicket.model.PropertyModel", "org.projectforge.plugins.teamcal.admin.TeamCalDO", "org.projectforge.web.wicket.flowlayout.FieldsetPanel" ]
import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.model.PropertyModel; import org.projectforge.plugins.teamcal.admin.TeamCalDO; import org.projectforge.web.wicket.flowlayout.FieldsetPanel;
import org.apache.wicket.markup.html.basic.*; import org.apache.wicket.model.*; import org.projectforge.plugins.teamcal.admin.*; import org.projectforge.web.wicket.flowlayout.*;
[ "org.apache.wicket", "org.projectforge.plugins", "org.projectforge.web" ]
org.apache.wicket; org.projectforge.plugins; org.projectforge.web;
6,626
public void setNumericValue(long newValue) throws ActionFailedException;
void function(long newValue) throws ActionFailedException;
/** * Sets the current value. * * @return The current value */
Sets the current value
setNumericValue
{ "repo_name": "fraunhoferfokus/fokus-upnp", "path": "upnp-core/src/main/java/de/fraunhofer/fokus/lsf/core/IGenericBinaryUPnPActor.java", "license": "gpl-3.0", "size": 1522 }
[ "de.fraunhofer.fokus.upnp.util.exceptions.ActionFailedException" ]
import de.fraunhofer.fokus.upnp.util.exceptions.ActionFailedException;
import de.fraunhofer.fokus.upnp.util.exceptions.*;
[ "de.fraunhofer.fokus" ]
de.fraunhofer.fokus;
1,297,237
if (isInitialized()) { if (get() instanceof Destroyable) { try { ((Destroyable) get()).destroy(); } catch (final Exception e) { LOG.error("destroy operation failed", e); } } } object = null; }
if (isInitialized()) { if (get() instanceof Destroyable) { try { ((Destroyable) get()).destroy(); } catch (final Exception e) { LOG.error(STR, e); } } } object = null; }
/** * Destroy the initialized object. This will trigger the re-initialization when * {@link DestroyableLazyInitializer#get()} method is invoked. */
Destroy the initialized object. This will trigger the re-initialization when <code>DestroyableLazyInitializer#get()</code> method is invoked
destroy
{ "repo_name": "UAK-35/wro4j", "path": "wro4j-core/src/main/java/ro/isdc/wro/util/DestroyableLazyInitializer.java", "license": "apache-2.0", "size": 997 }
[ "ro.isdc.wro.model.resource.processor.Destroyable" ]
import ro.isdc.wro.model.resource.processor.Destroyable;
import ro.isdc.wro.model.resource.processor.*;
[ "ro.isdc.wro" ]
ro.isdc.wro;
2,765,993
public void onRollbackLastReInitializationError(ContainerId containerId, Throwable t) {}
void function(ContainerId containerId, Throwable t) {}
/** * Error Callback for rollback of last re-initialization. * * @param containerId the Id of the container to restart. * @param t a Throwable. */
Error Callback for rollback of last re-initialization
onRollbackLastReInitializationError
{ "repo_name": "bitmybytes/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/NMClientAsync.java", "license": "apache-2.0", "size": 16023 }
[ "org.apache.hadoop.yarn.api.records.ContainerId" ]
import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.api.records.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,923,571
@Nullable GridCacheMvccCandidate addEntry(GridLocalCacheEntry entry) throws GridCacheEntryRemovedException { // Add local lock first, as it may throw GridCacheEntryRemovedException. GridCacheMvccCandidate c = entry.addLocal( threadId, lockVer, null, null, timeout, !inTx(), inTx(), implicitSingle() ); entries.add(entry); if (c == null && timeout < 0) { if (log.isDebugEnabled()) log.debug("Failed to acquire lock with negative timeout: " + entry); onFailed(); return null; } if (c != null) { // Immediately set lock to ready. entry.readyLocal(c); } return c; }
@Nullable GridCacheMvccCandidate addEntry(GridLocalCacheEntry entry) throws GridCacheEntryRemovedException { GridCacheMvccCandidate c = entry.addLocal( threadId, lockVer, null, null, timeout, !inTx(), inTx(), implicitSingle() ); entries.add(entry); if (c == null && timeout < 0) { if (log.isDebugEnabled()) log.debug(STR + entry); onFailed(); return null; } if (c != null) { entry.readyLocal(c); } return c; }
/** * Adds entry to future. * * @param entry Entry to add. * @return Lock candidate. * @throws GridCacheEntryRemovedException If entry was removed. */
Adds entry to future
addEntry
{ "repo_name": "vsisko/incubator-ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/GridLocalLockFuture.java", "license": "apache-2.0", "size": 13027 }
[ "org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException", "org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate", "org.jetbrains.annotations.Nullable" ]
import org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException; import org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate; import org.jetbrains.annotations.Nullable;
import org.apache.ignite.internal.processors.cache.*; import org.jetbrains.annotations.*;
[ "org.apache.ignite", "org.jetbrains.annotations" ]
org.apache.ignite; org.jetbrains.annotations;
1,988,123
private boolean isMoreSpecificThan(ApplicableFunction left, ApplicableFunction right) { List<TypeSignatureProvider> resolvedTypes = fromTypeSignatures(left.getBoundSignature().getArgumentTypes()); Optional<BoundVariables> boundVariables = new SignatureBinder(typeManager, right.getDeclaredSignature(), true) .bindVariables(resolvedTypes); return boundVariables.isPresent(); } private static class FunctionMap { private final Multimap<QualifiedName, SqlFunction> functions; public FunctionMap() { functions = ImmutableListMultimap.of(); } public FunctionMap(FunctionMap map, Iterable<? extends SqlFunction> functions) { this.functions = ImmutableListMultimap.<QualifiedName, SqlFunction>builder() .putAll(map.functions) .putAll(Multimaps.index(functions, function -> QualifiedName.of(function.getSignature().getName()))) .build(); // Make sure all functions with the same name are aggregations or none of them are for (Map.Entry<QualifiedName, Collection<SqlFunction>> entry : this.functions.asMap().entrySet()) { Collection<SqlFunction> values = entry.getValue(); long aggregations = values.stream() .map(function -> function.getSignature().getKind()) .filter(kind -> kind == AGGREGATE) .count(); checkState(aggregations == 0 || aggregations == values.size(), "'%s' is both an aggregation and a scalar function", entry.getKey()); } }
boolean function(ApplicableFunction left, ApplicableFunction right) { List<TypeSignatureProvider> resolvedTypes = fromTypeSignatures(left.getBoundSignature().getArgumentTypes()); Optional<BoundVariables> boundVariables = new SignatureBinder(typeManager, right.getDeclaredSignature(), true) .bindVariables(resolvedTypes); return boundVariables.isPresent(); } private static class FunctionMap { private final Multimap<QualifiedName, SqlFunction> functions; public FunctionMap() { functions = ImmutableListMultimap.of(); } public FunctionMap(FunctionMap map, Iterable<? extends SqlFunction> functions) { this.functions = ImmutableListMultimap.<QualifiedName, SqlFunction>builder() .putAll(map.functions) .putAll(Multimaps.index(functions, function -> QualifiedName.of(function.getSignature().getName()))) .build(); for (Map.Entry<QualifiedName, Collection<SqlFunction>> entry : this.functions.asMap().entrySet()) { Collection<SqlFunction> values = entry.getValue(); long aggregations = values.stream() .map(function -> function.getSignature().getKind()) .filter(kind -> kind == AGGREGATE) .count(); checkState(aggregations == 0 aggregations == values.size(), STR, entry.getKey()); } }
/** * One method is more specific than another if invocation handled by the first method could be passed on to the other one */
One method is more specific than another if invocation handled by the first method could be passed on to the other one
isMoreSpecificThan
{ "repo_name": "Teradata/presto", "path": "presto-main/src/main/java/com/facebook/presto/metadata/FunctionRegistry.java", "license": "apache-2.0", "size": 66050 }
[ "com.facebook.presto.sql.analyzer.TypeSignatureProvider", "com.facebook.presto.sql.tree.QualifiedName", "com.google.common.base.Preconditions", "com.google.common.collect.ImmutableListMultimap", "com.google.common.collect.Multimap", "com.google.common.collect.Multimaps", "java.util.Collection", "java.util.List", "java.util.Map", "java.util.Optional" ]
import com.facebook.presto.sql.analyzer.TypeSignatureProvider; import com.facebook.presto.sql.tree.QualifiedName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.Multimap; import com.google.common.collect.Multimaps; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Optional;
import com.facebook.presto.sql.analyzer.*; import com.facebook.presto.sql.tree.*; import com.google.common.base.*; import com.google.common.collect.*; import java.util.*;
[ "com.facebook.presto", "com.google.common", "java.util" ]
com.facebook.presto; com.google.common; java.util;
2,654,597
void enterCreator(@NotNull JavaParser.CreatorContext ctx); void exitCreator(@NotNull JavaParser.CreatorContext ctx);
void enterCreator(@NotNull JavaParser.CreatorContext ctx); void exitCreator(@NotNull JavaParser.CreatorContext ctx);
/** * Exit a parse tree produced by {@link JavaParser#creator}. * @param ctx the parse tree */
Exit a parse tree produced by <code>JavaParser#creator</code>
exitCreator
{ "repo_name": "hgkmail/HelloJava", "path": "src/cn/hgk/hellojava/JavaListener.java", "license": "gpl-2.0", "size": 38976 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
1,615,808
public Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) { Assertions.checkState(!isCreateCalled); this.loadErrorHandlingPolicy = loadErrorHandlingPolicy; return this; } /** * Sets the minimum number of times to retry if a loading error occurs. The default value is * {@link DefaultLoadErrorHandlingPolicy#DEFAULT_MIN_LOADABLE_RETRY_COUNT}. * * <p>Calling this method is equivalent to calling {@link #setLoadErrorHandlingPolicy} with * {@link DefaultLoadErrorHandlingPolicy#DefaultLoadErrorHandlingPolicy(int) * DefaultLoadErrorHandlingPolicy(minLoadableRetryCount)}
Factory function(LoadErrorHandlingPolicy loadErrorHandlingPolicy) { Assertions.checkState(!isCreateCalled); this.loadErrorHandlingPolicy = loadErrorHandlingPolicy; return this; } /** * Sets the minimum number of times to retry if a loading error occurs. The default value is * {@link DefaultLoadErrorHandlingPolicy#DEFAULT_MIN_LOADABLE_RETRY_COUNT}. * * <p>Calling this method is equivalent to calling {@link #setLoadErrorHandlingPolicy} with * {@link DefaultLoadErrorHandlingPolicy#DefaultLoadErrorHandlingPolicy(int) * DefaultLoadErrorHandlingPolicy(minLoadableRetryCount)}
/** * Sets the {@link LoadErrorHandlingPolicy}. The default value is created by calling {@link * DefaultLoadErrorHandlingPolicy#DefaultLoadErrorHandlingPolicy()}. * * <p>Calling this method overrides any calls to {@link #setMinLoadableRetryCount(int)}. * * @param loadErrorHandlingPolicy A {@link LoadErrorHandlingPolicy}. * @return This factory, for convenience. * @throws IllegalStateException If one of the {@code create} methods has already been called. */
Sets the <code>LoadErrorHandlingPolicy</code>. The default value is created by calling <code>DefaultLoadErrorHandlingPolicy#DefaultLoadErrorHandlingPolicy()</code>. Calling this method overrides any calls to <code>#setMinLoadableRetryCount(int)</code>
setLoadErrorHandlingPolicy
{ "repo_name": "slp/Telegram-FOSS", "path": "TMessagesProj/src/main/java/com/google/android/exoplayer2/source/hls/HlsMediaSource.java", "license": "gpl-2.0", "size": 21270 }
[ "com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy", "com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy", "com.google.android.exoplayer2.util.Assertions" ]
import com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy; import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy; import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.upstream.*; import com.google.android.exoplayer2.util.*;
[ "com.google.android" ]
com.google.android;
877,710
public CtxAttributeValueType getValueType() { return this.valueType; }
CtxAttributeValueType function() { return this.valueType; }
/** * Returns the value type of this context attribute * * @return the value type of this context attribute */
Returns the value type of this context attribute
getValueType
{ "repo_name": "EPapadopoulou/PersoNIS", "path": "api/android/archive/external/src/main/java/org/societies/android/api/context/model/ACtxAttribute.java", "license": "bsd-2-clause", "size": 15080 }
[ "org.societies.api.context.model.CtxAttributeValueType" ]
import org.societies.api.context.model.CtxAttributeValueType;
import org.societies.api.context.model.*;
[ "org.societies.api" ]
org.societies.api;
79,947
public char getFieldChar(String field) { throwInvalidField(field, Type.CHAR); return fieldsCharacter[fieldDescriptor.getTypeToFieldToIndex().get(Type.CHAR).get(field)]; }
char function(String field) { throwInvalidField(field, Type.CHAR); return fieldsCharacter[fieldDescriptor.getTypeToFieldToIndex().get(Type.CHAR).get(field)]; }
/** * Gets the char value of the given field. * @param field The field. * @return The value. */
Gets the char value of the given field
getFieldChar
{ "repo_name": "siyuanh/apex-malhar", "path": "library/src/main/java/com/datatorrent/lib/appdata/gpo/GPOMutable.java", "license": "apache-2.0", "size": 21060 }
[ "com.datatorrent.lib.appdata.schemas.Type" ]
import com.datatorrent.lib.appdata.schemas.Type;
import com.datatorrent.lib.appdata.schemas.*;
[ "com.datatorrent.lib" ]
com.datatorrent.lib;
2,085,536
public CompletableFuture<Node> start() { return CompletableFuture.completedFuture(null) .thenCompose((v) -> { return this.performUpgrade(); }).thenCompose((v) -> { return this.loadBibles(); }).thenCompose((v) -> { return this.loadSongs(); }).thenCompose((v) -> { return this.loadMedia(); }).thenCompose((v) -> { return this.loadSlides(); }).thenCompose((v) -> { return this.loadDisplayManager(); }).thenCompose((v) -> { return this.loadFonts(); }).thenCompose((v) -> { return this.initializeNewWorkspace(); }).thenCompose((v) -> { return this.loadMainUI(); }); }
CompletableFuture<Node> function() { return CompletableFuture.completedFuture(null) .thenCompose((v) -> { return this.performUpgrade(); }).thenCompose((v) -> { return this.loadBibles(); }).thenCompose((v) -> { return this.loadSongs(); }).thenCompose((v) -> { return this.loadMedia(); }).thenCompose((v) -> { return this.loadSlides(); }).thenCompose((v) -> { return this.loadDisplayManager(); }).thenCompose((v) -> { return this.loadFonts(); }).thenCompose((v) -> { return this.initializeNewWorkspace(); }).thenCompose((v) -> { return this.loadMainUI(); }); }
/** * Starts the loading process on another thread. */
Starts the loading process on another thread
start
{ "repo_name": "wnbittle/praisenter", "path": "src/main/java/org/praisenter/ui/LoadingPane.java", "license": "bsd-3-clause", "size": 13439 }
[ "java.util.concurrent.CompletableFuture" ]
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
949,748
public interface BannerDAO { public Banner selectById(int bannerId);
interface BannerDAO { public Banner function(int bannerId);
/** * Gets a specific <code>Banner</code>. * * @param bannerId The Banner ID to search * @return <code>Banner</code> object containing all the information * @see #selectAll */
Gets a specific <code>Banner</code>
selectById
{ "repo_name": "dalinhuang/suduforum", "path": "src/net/jforum/dao/BannerDAO.java", "license": "bsd-3-clause", "size": 3568 }
[ "net.jforum.entities.Banner" ]
import net.jforum.entities.Banner;
import net.jforum.entities.*;
[ "net.jforum.entities" ]
net.jforum.entities;
303,098
public List<ViewAction> getActions();
List<ViewAction> function();
/** * Returns the list of actions * * @return List of actions */
Returns the list of actions
getActions
{ "repo_name": "sarality/appblocks", "path": "src/main/java/com/sarality/app/view/action/ViewAction.java", "license": "apache-2.0", "size": 1936 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
597,266
public static PeerID newPeerID( PeerGroupID groupID, byte [] seed ) { String useFormat = groupID.getIDFormat(); // is the group netpg or worldpg? if( IDFormat.INSTANTIATOR.getSupportedIDFormat().equals( useFormat ) ) { useFormat = factory.idNewInstances; } Instantiator instantiator = (Instantiator) factory.getInstantiator( useFormat ); return instantiator.newPeerID( groupID, seed ); }
static PeerID function( PeerGroupID groupID, byte [] seed ) { String useFormat = groupID.getIDFormat(); if( IDFormat.INSTANTIATOR.getSupportedIDFormat().equals( useFormat ) ) { useFormat = factory.idNewInstances; } Instantiator instantiator = (Instantiator) factory.getInstantiator( useFormat ); return instantiator.newPeerID( groupID, seed ); }
/** * Creates a new PeerID instance. A new PeerID will be generated. * The PeerID will be a member of the provided group. * * @see net.jxta.peergroup.PeerGroup * * @param groupID the group to which this PeerID will belong. * @param seed The seed information which will be used in creating the * PeerID. The seed information should be at least four bytes in length, * though longer values are better. * @return The newly created PeerID. **/
Creates a new PeerID instance. A new PeerID will be generated. The PeerID will be a member of the provided group
newPeerID
{ "repo_name": "idega/net.jxta", "path": "src/java/net/jxta/id/IDFactory.java", "license": "gpl-3.0", "size": 52387 }
[ "net.jxta.id.jxta.IDFormat", "net.jxta.peer.PeerID", "net.jxta.peergroup.PeerGroupID" ]
import net.jxta.id.jxta.IDFormat; import net.jxta.peer.PeerID; import net.jxta.peergroup.PeerGroupID;
import net.jxta.id.jxta.*; import net.jxta.peer.*; import net.jxta.peergroup.*;
[ "net.jxta.id", "net.jxta.peer", "net.jxta.peergroup" ]
net.jxta.id; net.jxta.peer; net.jxta.peergroup;
1,820,081
public void ifZCmp(final int mode, final Label label) { mv.visitJumpInsn(mode, label); }
void function(final int mode, final Label label) { mv.visitJumpInsn(mode, label); }
/** * Generates the instructions to jump to a label based on the comparison of * the top integer stack value with zero. * * @param mode * how these values must be compared. One of EQ, NE, LT, GE, GT, * LE. * @param label * where to jump if the comparison result is <tt>true</tt>. */
Generates the instructions to jump to a label based on the comparison of the top integer stack value with zero
ifZCmp
{ "repo_name": "llbit/ow2-asm", "path": "src/org/objectweb/asm/commons/GeneratorAdapter.java", "license": "bsd-3-clause", "size": 50594 }
[ "org.objectweb.asm.Label" ]
import org.objectweb.asm.Label;
import org.objectweb.asm.*;
[ "org.objectweb.asm" ]
org.objectweb.asm;
929,289
protected Ethernet createArpReplyPacket(int srcIp, int dstIp, long srcMac, long dstMac, short vlanId, byte priorityCode) { byte[] dstMacByte = MACAddress.valueOf(dstMac).toBytes(); byte[] srcMacByte = MACAddress.valueOf(srcMac).toBytes(); IPacket arpReply = new Ethernet() .setSourceMACAddress(dstMacByte) .setDestinationMACAddress(srcMacByte) .setEtherType(Ethernet.TYPE_ARP) .setVlanID(vlanId) .setPriorityCode(priorityCode) .setPayload( new ARP() .setHardwareType(ARP.HW_TYPE_ETHERNET) .setProtocolType(ARP.PROTO_TYPE_IP) .setHardwareAddressLength((byte) 6) .setProtocolAddressLength((byte) 4) .setOpCode(ARP.OP_REPLY) .setTargetHardwareAddress(srcMacByte) .setTargetProtocolAddress(IPv4.toIPv4AddressBytes(srcIp)) .setSenderHardwareAddress(dstMacByte) .setSenderProtocolAddress(IPv4.toIPv4AddressBytes(dstIp))); return (Ethernet) arpReply; }
Ethernet function(int srcIp, int dstIp, long srcMac, long dstMac, short vlanId, byte priorityCode) { byte[] dstMacByte = MACAddress.valueOf(dstMac).toBytes(); byte[] srcMacByte = MACAddress.valueOf(srcMac).toBytes(); IPacket arpReply = new Ethernet() .setSourceMACAddress(dstMacByte) .setDestinationMACAddress(srcMacByte) .setEtherType(Ethernet.TYPE_ARP) .setVlanID(vlanId) .setPriorityCode(priorityCode) .setPayload( new ARP() .setHardwareType(ARP.HW_TYPE_ETHERNET) .setProtocolType(ARP.PROTO_TYPE_IP) .setHardwareAddressLength((byte) 6) .setProtocolAddressLength((byte) 4) .setOpCode(ARP.OP_REPLY) .setTargetHardwareAddress(srcMacByte) .setTargetProtocolAddress(IPv4.toIPv4AddressBytes(srcIp)) .setSenderHardwareAddress(dstMacByte) .setSenderProtocolAddress(IPv4.toIPv4AddressBytes(dstIp))); return (Ethernet) arpReply; }
/** * Creates an ARP reply encapsulated in an Ethernet frame. * @param srcIp The source IP (host that sent the ARP request). * @param dstIp The destination IP (The IP the host is querying for). * @param srcMac The MAC address of the host that sent the ARP request. * @param dstMac The MAC address the host with the corresponding IP. * @param vlanId The VLAN the host is on. * @param priorityCode The Ethernet priority code. * @return An Ethernet packet with an ARP reply encapsulated in it. */
Creates an ARP reply encapsulated in an Ethernet frame
createArpReplyPacket
{ "repo_name": "mandeepdhami/netvirt-ctrl", "path": "sdnplatform/src/main/java/org/sdnplatform/netvirt/virtualrouting/internal/VirtualRouting.java", "license": "epl-1.0", "size": 108026 }
[ "org.sdnplatform.packet.Ethernet", "org.sdnplatform.packet.IPacket", "org.sdnplatform.packet.IPv4", "org.sdnplatform.util.MACAddress" ]
import org.sdnplatform.packet.Ethernet; import org.sdnplatform.packet.IPacket; import org.sdnplatform.packet.IPv4; import org.sdnplatform.util.MACAddress;
import org.sdnplatform.packet.*; import org.sdnplatform.util.*;
[ "org.sdnplatform.packet", "org.sdnplatform.util" ]
org.sdnplatform.packet; org.sdnplatform.util;
2,067,754
private CompletableFuture<List<MesosWorkerStore.Worker>> getWorkersAsync() { // if this resource manager is recovering from failure, // then some worker tasks are most likely still alive and we can re-obtain them return CompletableFuture.supplyAsync(() -> { try { final List<MesosWorkerStore.Worker> tasksFromPreviousAttempts = workerStore.recoverWorkers(); for (final MesosWorkerStore.Worker worker : tasksFromPreviousAttempts) { if (worker.state() == MesosWorkerStore.WorkerState.New) { // remove new workers because allocation requests are transient workerStore.removeWorker(worker.taskID()); } } return tasksFromPreviousAttempts; } catch (final Exception e) { throw new CompletionException(new ResourceManagerException(e)); } }, getRpcService().getExecutor()); }
CompletableFuture<List<MesosWorkerStore.Worker>> function() { return CompletableFuture.supplyAsync(() -> { try { final List<MesosWorkerStore.Worker> tasksFromPreviousAttempts = workerStore.recoverWorkers(); for (final MesosWorkerStore.Worker worker : tasksFromPreviousAttempts) { if (worker.state() == MesosWorkerStore.WorkerState.New) { workerStore.removeWorker(worker.taskID()); } } return tasksFromPreviousAttempts; } catch (final Exception e) { throw new CompletionException(new ResourceManagerException(e)); } }, getRpcService().getExecutor()); }
/** * Fetches framework/worker information persisted by a prior incarnation of the RM. */
Fetches framework/worker information persisted by a prior incarnation of the RM
getWorkersAsync
{ "repo_name": "mbode/flink", "path": "flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/MesosResourceManager.java", "license": "apache-2.0", "size": 31162 }
[ "java.util.List", "java.util.concurrent.CompletableFuture", "java.util.concurrent.CompletionException", "org.apache.flink.mesos.runtime.clusterframework.store.MesosWorkerStore", "org.apache.flink.runtime.resourcemanager.exceptions.ResourceManagerException" ]
import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import org.apache.flink.mesos.runtime.clusterframework.store.MesosWorkerStore; import org.apache.flink.runtime.resourcemanager.exceptions.ResourceManagerException;
import java.util.*; import java.util.concurrent.*; import org.apache.flink.mesos.runtime.clusterframework.store.*; import org.apache.flink.runtime.resourcemanager.exceptions.*;
[ "java.util", "org.apache.flink" ]
java.util; org.apache.flink;
2,570,766
public Iterator<Property> getChildren();
Iterator<Property> function();
/** * Get an iterator over the children of this Parent; all elements * are instances of Property. * * @return Iterator of children; may refer to an empty collection */
Get an iterator over the children of this Parent; all elements are instances of Property
getChildren
{ "repo_name": "neolord0/hwplib", "path": "src/main/java/kr/dogfoot/hwplib/org/apache/poi/poifs/property/Parent.java", "license": "apache-2.0", "size": 2222 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,097,753
public static boolean getCompressOutput(JobContext job) { return job.getConfiguration().getBoolean("mapred.output.compress", false); }
static boolean function(JobContext job) { return job.getConfiguration().getBoolean(STR, false); }
/** * Is the job output compressed? * @param job the Job to look in * @return <code>true</code> if the job output should be compressed, * <code>false</code> otherwise */
Is the job output compressed
getCompressOutput
{ "repo_name": "zyguan/HDFS-503-on-0.20.2", "path": "src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.java", "license": "apache-2.0", "size": 11081 }
[ "org.apache.hadoop.mapreduce.JobContext" ]
import org.apache.hadoop.mapreduce.JobContext;
import org.apache.hadoop.mapreduce.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
333,562
@Test(expected = GeniePreconditionException.class) public void testAddTagsToApplicationNoTags() throws GenieException { this.service.addTagsForApplication(APP_1_ID, null); }
@Test(expected = GeniePreconditionException.class) void function() throws GenieException { this.service.addTagsForApplication(APP_1_ID, null); }
/** * Test add tags to application. * * @throws GenieException */
Test add tags to application
testAddTagsToApplicationNoTags
{ "repo_name": "gorcz/genie", "path": "genie-server/src/test/java/com/netflix/genie/server/services/impl/jpa/TestApplicationConfigServiceJPAImpl.java", "license": "apache-2.0", "size": 43910 }
[ "com.netflix.genie.common.exceptions.GenieException", "com.netflix.genie.common.exceptions.GeniePreconditionException", "org.junit.Test" ]
import com.netflix.genie.common.exceptions.GenieException; import com.netflix.genie.common.exceptions.GeniePreconditionException; import org.junit.Test;
import com.netflix.genie.common.exceptions.*; import org.junit.*;
[ "com.netflix.genie", "org.junit" ]
com.netflix.genie; org.junit;
2,040,382
protected static String unescape(String value) { value = CmsStringUtil.substitute(value, "\\,", ","); value = CmsStringUtil.substitute(value, "\\=", "="); value = CmsStringUtil.substitute(value, "\\\\", "\\"); return value; }
static String function(String value) { value = CmsStringUtil.substitute(value, "\\,", ","); value = CmsStringUtil.substitute(value, "\\=", "="); value = CmsStringUtil.substitute(value, "\\\\", "\\"); return value; }
/** * Replaces escaped char sequences in the input value.<p> * * @param value the value to unescape * * @return the unescaped String */
Replaces escaped char sequences in the input value
unescape
{ "repo_name": "alkacon/opencms-core", "path": "src/org/opencms/configuration/CmsParameterConfiguration.java", "license": "lgpl-2.1", "size": 29371 }
[ "org.opencms.util.CmsStringUtil" ]
import org.opencms.util.CmsStringUtil;
import org.opencms.util.*;
[ "org.opencms.util" ]
org.opencms.util;
514,255
@Test public void onClickNavMyWorkflows_openMyWorkflowActivity() throws Exception { onView(withId(R.id.drawer_layout)) .check(matches(isClosed(Gravity.LEFT))) .perform(DrawerActions.open()); onView(withId(R.id.nav_view)) .perform(NavigationViewActions.navigateTo(R.id.nav_my_workflows)); onView(withId(R.id.frame_container)).check(matches((isDisplayed()))); }
void function() throws Exception { onView(withId(R.id.drawer_layout)) .check(matches(isClosed(Gravity.LEFT))) .perform(DrawerActions.open()); onView(withId(R.id.nav_view)) .perform(NavigationViewActions.navigateTo(R.id.nav_my_workflows)); onView(withId(R.id.frame_container)).check(matches((isDisplayed()))); }
/** * Checks if the myWorkflow fragment is launched when we click on myWorkflow in nav drawer. * Without login, The app does not have any user then it also does not have any myworkflow * Without login it will fail */
Checks if the myWorkflow fragment is launched when we click on myWorkflow in nav drawer. Without login, The app does not have any user then it also does not have any myworkflow Without login it will fail
onClickNavMyWorkflows_openMyWorkflowActivity
{ "repo_name": "apache/incubator-taverna-mobile", "path": "app/src/androidTest/java/org/apache/taverna/mobile/DashboardActivityTest.java", "license": "apache-2.0", "size": 10182 }
[ "android.support.test.espresso.Espresso", "android.support.test.espresso.contrib.DrawerActions", "android.support.test.espresso.contrib.NavigationViewActions", "android.view.Gravity" ]
import android.support.test.espresso.Espresso; import android.support.test.espresso.contrib.DrawerActions; import android.support.test.espresso.contrib.NavigationViewActions; import android.view.Gravity;
import android.support.test.espresso.*; import android.support.test.espresso.contrib.*; import android.view.*;
[ "android.support", "android.view" ]
android.support; android.view;
2,085,039
public String addNewModule(String pageKey, String parentObjectInstanceID, int newICObjectID, String label, IWSlideSession slideSession) { IBXMLPage page = null; try { page = getIBXMLPage(pageKey); } catch (Exception e) { e.printStackTrace(); return null; } if (slideSession != null) { // Will check if can use thread XMLElement region = null; try { region = getIBXMLWriter().findRegion(page, label, null); } catch(Exception e) { e.printStackTrace(); } boolean useThread = true; if (region == null) { useThread = false; } else { List children = region.getChildren(); if (children == null || children.size() == 0) { useThread = false; } } if (!useThread) { slideSession = null; } } String id = getIBXMLWriter().addNewModule(page, pageKey, parentObjectInstanceID, newICObjectID, label); if (id == null) { return null; } if (savePage(page, slideSession)) { return id; } return null; }
String function(String pageKey, String parentObjectInstanceID, int newICObjectID, String label, IWSlideSession slideSession) { IBXMLPage page = null; try { page = getIBXMLPage(pageKey); } catch (Exception e) { e.printStackTrace(); return null; } if (slideSession != null) { XMLElement region = null; try { region = getIBXMLWriter().findRegion(page, label, null); } catch(Exception e) { e.printStackTrace(); } boolean useThread = true; if (region == null) { useThread = false; } else { List children = region.getChildren(); if (children == null children.size() == 0) { useThread = false; } } if (!useThread) { slideSession = null; } } String id = getIBXMLWriter().addNewModule(page, pageKey, parentObjectInstanceID, newICObjectID, label); if (id == null) { return null; } if (savePage(page, slideSession)) { return id; } return null; }
/** * After inserting new module IBXMLPage is saved (if successfully inserted module) in other thread * @param pageKey * @param parentObjectInstanceID * @param newICObjectID * @param label * @param slideSession * @return */
After inserting new module IBXMLPage is saved (if successfully inserted module) in other thread
addNewModule
{ "repo_name": "idega/com.idega.builder", "path": "src/java/com/idega/builder/business/BuilderLogic.java", "license": "gpl-3.0", "size": 145872 }
[ "com.idega.slide.business.IWSlideSession", "com.idega.xml.XMLElement", "java.util.List" ]
import com.idega.slide.business.IWSlideSession; import com.idega.xml.XMLElement; import java.util.List;
import com.idega.slide.business.*; import com.idega.xml.*; import java.util.*;
[ "com.idega.slide", "com.idega.xml", "java.util" ]
com.idega.slide; com.idega.xml; java.util;
703,967
public AdvisorInner update(String resourceGroupName, String serverName, String advisorName, AutoExecuteStatus autoExecuteStatus) { return updateWithServiceResponseAsync(resourceGroupName, serverName, advisorName, autoExecuteStatus).toBlocking().single().body(); }
AdvisorInner function(String resourceGroupName, String serverName, String advisorName, AutoExecuteStatus autoExecuteStatus) { return updateWithServiceResponseAsync(resourceGroupName, serverName, advisorName, autoExecuteStatus).toBlocking().single().body(); }
/** * Updates a server advisor. * * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serverName The name of the server. * @param advisorName The name of the Server Advisor. * @param autoExecuteStatus Gets the auto-execute status (whether to let the system execute the recommendations) of this advisor. Possible values are 'Enabled' and 'Disabled'. Possible values include: 'Enabled', 'Disabled', 'Default' * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AdvisorInner object if successful. */
Updates a server advisor
update
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/sql/mgmt-v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ServerAdvisorsInner.java", "license": "mit", "size": 21053 }
[ "com.microsoft.azure.management.sql.v2015_05_01_preview.AutoExecuteStatus" ]
import com.microsoft.azure.management.sql.v2015_05_01_preview.AutoExecuteStatus;
import com.microsoft.azure.management.sql.v2015_05_01_preview.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
146,910
private void sendWeaponTab(Player player) { Item playerWeapon = player.getEquipment().get(Equipment.SLOT_WEAPON); if (playerWeapon != null && playerWeapon.getDefinition().getWeaponDefinition() != null) { int interfaceId = playerWeapon.getDefinition().getWeaponDefinition().getInterfaceId(); player.getActionSender().sendTab(135, interfaceId); player.getActionSender().sendString(interfaceId, 0, playerWeapon.getDefinition().getName()); player.getPlayerConfiguration().setWeaponTabInterface(interfaceId); } else { player.getActionSender().sendTab(135, 593); player.getActionSender().sendString(593, 1, "Unarmed"); player.getPlayerConfiguration().setWeaponTabInterface(593); } player.getActionSender().sendString(593, 2, "Combat lvl: " + player.getSkills().getCombatLevel()); }
void function(Player player) { Item playerWeapon = player.getEquipment().get(Equipment.SLOT_WEAPON); if (playerWeapon != null && playerWeapon.getDefinition().getWeaponDefinition() != null) { int interfaceId = playerWeapon.getDefinition().getWeaponDefinition().getInterfaceId(); player.getActionSender().sendTab(135, interfaceId); player.getActionSender().sendString(interfaceId, 0, playerWeapon.getDefinition().getName()); player.getPlayerConfiguration().setWeaponTabInterface(interfaceId); } else { player.getActionSender().sendTab(135, 593); player.getActionSender().sendString(593, 1, STR); player.getPlayerConfiguration().setWeaponTabInterface(593); } player.getActionSender().sendString(593, 2, STR + player.getSkills().getCombatLevel()); }
/** * Sends the correct weapon tab interface. * @param player The player to send the interface to. */
Sends the correct weapon tab interface
sendWeaponTab
{ "repo_name": "ubjelly/Derithium", "path": "src/main/java/org/hyperion/rs2/content/combat/util/CombatUtility.java", "license": "gpl-2.0", "size": 5765 }
[ "org.hyperion.rs2.model.Item", "org.hyperion.rs2.model.container.Equipment", "org.hyperion.rs2.model.player.Player" ]
import org.hyperion.rs2.model.Item; import org.hyperion.rs2.model.container.Equipment; import org.hyperion.rs2.model.player.Player;
import org.hyperion.rs2.model.*; import org.hyperion.rs2.model.container.*; import org.hyperion.rs2.model.player.*;
[ "org.hyperion.rs2" ]
org.hyperion.rs2;
1,548,917
@Metered(group = "core", name = "EntityManagerFactory_getApplication") public Application getApplication( String name ) throws Exception { name = name.toLowerCase(); HColumn<String, ByteBuffer> column = cass.getColumn( cass.getSystemKeyspace(), APPLICATIONS_CF, name, PROPERTY_UUID ); if ( column == null ) { return null; } UUID applicationId = uuid( column.getValue() ); EntityManager em = getEntityManager( applicationId ); return ( ( EntityManagerImpl ) em ).getEntity( applicationId, Application.class ); }
@Metered(group = "core", name = STR) Application function( String name ) throws Exception { name = name.toLowerCase(); HColumn<String, ByteBuffer> column = cass.getColumn( cass.getSystemKeyspace(), APPLICATIONS_CF, name, PROPERTY_UUID ); if ( column == null ) { return null; } UUID applicationId = uuid( column.getValue() ); EntityManager em = getEntityManager( applicationId ); return ( ( EntityManagerImpl ) em ).getEntity( applicationId, Application.class ); }
/** * Gets the application. * * @param name the name * * @return application for name * * @throws Exception the exception */
Gets the application
getApplication
{ "repo_name": "mesosphere/usergrid", "path": "stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerFactoryImpl.java", "license": "apache-2.0", "size": 14567 }
[ "com.yammer.metrics.annotation.Metered", "java.nio.ByteBuffer", "me.prettyprint.hector.api.beans.HColumn", "org.apache.usergrid.persistence.EntityManager", "org.apache.usergrid.persistence.entities.Application", "org.apache.usergrid.utils.ConversionUtils" ]
import com.yammer.metrics.annotation.Metered; import java.nio.ByteBuffer; import me.prettyprint.hector.api.beans.HColumn; import org.apache.usergrid.persistence.EntityManager; import org.apache.usergrid.persistence.entities.Application; import org.apache.usergrid.utils.ConversionUtils;
import com.yammer.metrics.annotation.*; import java.nio.*; import me.prettyprint.hector.api.beans.*; import org.apache.usergrid.persistence.*; import org.apache.usergrid.persistence.entities.*; import org.apache.usergrid.utils.*;
[ "com.yammer.metrics", "java.nio", "me.prettyprint.hector", "org.apache.usergrid" ]
com.yammer.metrics; java.nio; me.prettyprint.hector; org.apache.usergrid;
2,050,967
public synchronized void initTasks() throws IOException { if (tasksInited.get()) { return; } synchronized(jobInitKillStatus){ if(jobInitKillStatus.killed) { return; } jobInitKillStatus.initStarted = true; } // log job info JobHistory.JobInfo.logSubmitted(getJobID(), conf, jobFile.toString(), this.startTime); // log the job priority setPriority(this.priority); // // read input splits and create a map per a split // String jobFile = profile.getJobFile(); Path sysDir = new Path(this.jobtracker.getSystemDir()); FileSystem fs = sysDir.getFileSystem(conf); JobClient.RawSplit[] splits = null; if (this.pipeline != null || this.monitor) { numMapTasks = this.monitor ? jobtracker.getNumberOfUniqueHosts() : conf.getNumMapTasks(); splits = new JobClient.RawSplit[numMapTasks]; for (int i = 0; i < numMapTasks; i++) { splits[i] = new JobClient.RawSplit(); } } else { DataInputStream splitFile = fs.open(new Path(conf.get("mapred.job.split.file"))); try { splits = JobClient.readSplitFile(splitFile); } finally { splitFile.close(); } numMapTasks = splits.length; } // if the number of splits is larger than a configured value // then fail the job. int maxTasks = jobtracker.getMaxTasksPerJob(); if (maxTasks > 0 && numMapTasks + numReduceTasks > maxTasks) { throw new IOException( "The number of tasks for this job " + (numMapTasks + numReduceTasks) + " exceeds the configured limit " + maxTasks); } maps = new TaskInProgress[numMapTasks]; for(int i=0; i < numMapTasks; ++i) { inputLength += splits[i].getDataLength(); maps[i] = new TaskInProgress(jobId, jobFile, splits[i], jobtracker, conf, this, i); } LOG.info("Input size for job "+ jobId + " = " + inputLength); if (numMapTasks > 0) { LOG.info("Split info for job:" + jobId); nonRunningMapCache = createCache(splits, maxLevel); } // set the launch time this.launchTime = System.currentTimeMillis(); // if no split is returned, job is considered completed and successful if (numMapTasks == 0) { // Finished time need to be setted here to prevent this job to be retired // from the job tracker jobs at the next retire iteration. this.finishTime = this.launchTime; status.setSetupProgress(1.0f); status.setMapProgress(1.0f); status.setReduceProgress(1.0f); status.setCleanupProgress(1.0f); status.setRunState(JobStatus.SUCCEEDED); tasksInited.set(true); JobHistory.JobInfo.logInited(profile.getJobID(), this.launchTime, 0, 0); JobHistory.JobInfo.logFinished(profile.getJobID(), this.finishTime, 0, 0, 0, 0, getCounters()); // Special case because the Job is not queued JobEndNotifier.registerNotification(this.getJobConf(), this.getStatus()); return; } // // Create reduce tasks // this.reduces = new TaskInProgress[numReduceTasks]; for (int i = 0; i < numReduceTasks; i++) { reduces[i] = new TaskInProgress(jobId, jobFile, numMapTasks, i, jobtracker, conf, this); nonRunningReduces.add(reduces[i]); } // create cleanup two cleanup tips, one map and one reduce. cleanup = new TaskInProgress[2]; // cleanup map tip. This map is doesn't use split. // Just assign splits[0] cleanup[0] = new TaskInProgress(jobId, jobFile, splits[0], jobtracker, conf, this, numMapTasks); cleanup[0].setJobCleanupTask(); // cleanup reduce tip. cleanup[1] = new TaskInProgress(jobId, jobFile, numMapTasks, numReduceTasks, jobtracker, conf, this); cleanup[1].setJobCleanupTask(); // create two setup tips, one map and one reduce. setup = new TaskInProgress[2]; // setup map tip. This map is doesn't use split. // Just assign splits[0] setup[0] = new TaskInProgress(jobId, jobFile, splits[0], jobtracker, conf, this, numMapTasks + 1 ); setup[0].setJobSetupTask(); // setup reduce tip. setup[1] = new TaskInProgress(jobId, jobFile, numMapTasks, numReduceTasks + 1, jobtracker, conf, this); setup[1].setJobSetupTask(); synchronized(jobInitKillStatus){ jobInitKillStatus.initDone = true; if(jobInitKillStatus.killed) { //setup not launched so directly terminate terminateJob(JobStatus.KILLED); return; } } tasksInited.set(true); JobHistory.JobInfo.logInited(profile.getJobID(), this.launchTime, numMapTasks, numReduceTasks); }
synchronized void function() throws IOException { if (tasksInited.get()) { return; } synchronized(jobInitKillStatus){ if(jobInitKillStatus.killed) { return; } jobInitKillStatus.initStarted = true; } JobHistory.JobInfo.logSubmitted(getJobID(), conf, jobFile.toString(), this.startTime); setPriority(this.priority); Path sysDir = new Path(this.jobtracker.getSystemDir()); FileSystem fs = sysDir.getFileSystem(conf); JobClient.RawSplit[] splits = null; if (this.pipeline != null this.monitor) { numMapTasks = this.monitor ? jobtracker.getNumberOfUniqueHosts() : conf.getNumMapTasks(); splits = new JobClient.RawSplit[numMapTasks]; for (int i = 0; i < numMapTasks; i++) { splits[i] = new JobClient.RawSplit(); } } else { DataInputStream splitFile = fs.open(new Path(conf.get(STR))); try { splits = JobClient.readSplitFile(splitFile); } finally { splitFile.close(); } numMapTasks = splits.length; } int maxTasks = jobtracker.getMaxTasksPerJob(); if (maxTasks > 0 && numMapTasks + numReduceTasks > maxTasks) { throw new IOException( STR + (numMapTasks + numReduceTasks) + STR + maxTasks); } maps = new TaskInProgress[numMapTasks]; for(int i=0; i < numMapTasks; ++i) { inputLength += splits[i].getDataLength(); maps[i] = new TaskInProgress(jobId, jobFile, splits[i], jobtracker, conf, this, i); } LOG.info(STR+ jobId + STR + inputLength); if (numMapTasks > 0) { LOG.info(STR + jobId); nonRunningMapCache = createCache(splits, maxLevel); } this.launchTime = System.currentTimeMillis(); if (numMapTasks == 0) { this.finishTime = this.launchTime; status.setSetupProgress(1.0f); status.setMapProgress(1.0f); status.setReduceProgress(1.0f); status.setCleanupProgress(1.0f); status.setRunState(JobStatus.SUCCEEDED); tasksInited.set(true); JobHistory.JobInfo.logInited(profile.getJobID(), this.launchTime, 0, 0); JobHistory.JobInfo.logFinished(profile.getJobID(), this.finishTime, 0, 0, 0, 0, getCounters()); JobEndNotifier.registerNotification(this.getJobConf(), this.getStatus()); return; } for (int i = 0; i < numReduceTasks; i++) { reduces[i] = new TaskInProgress(jobId, jobFile, numMapTasks, i, jobtracker, conf, this); nonRunningReduces.add(reduces[i]); } cleanup = new TaskInProgress[2]; cleanup[0] = new TaskInProgress(jobId, jobFile, splits[0], jobtracker, conf, this, numMapTasks); cleanup[0].setJobCleanupTask(); cleanup[1] = new TaskInProgress(jobId, jobFile, numMapTasks, numReduceTasks, jobtracker, conf, this); cleanup[1].setJobCleanupTask(); setup = new TaskInProgress[2]; setup[0] = new TaskInProgress(jobId, jobFile, splits[0], jobtracker, conf, this, numMapTasks + 1 ); setup[0].setJobSetupTask(); setup[1] = new TaskInProgress(jobId, jobFile, numMapTasks, numReduceTasks + 1, jobtracker, conf, this); setup[1].setJobSetupTask(); synchronized(jobInitKillStatus){ jobInitKillStatus.initDone = true; if(jobInitKillStatus.killed) { terminateJob(JobStatus.KILLED); return; } } tasksInited.set(true); JobHistory.JobInfo.logInited(profile.getJobID(), this.launchTime, numMapTasks, numReduceTasks); }
/** * Construct the splits, etc. This is invoked from an async * thread so that split-computation doesn't block anyone. */
Construct the splits, etc. This is invoked from an async thread so that split-computation doesn't block anyone
initTasks
{ "repo_name": "sbyoun/i-mapreduce", "path": "src/mapred/org/apache/hadoop/mapred/JobInProgress.java", "license": "apache-2.0", "size": 94881 }
[ "java.io.DataInputStream", "java.io.IOException", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.fs.Path" ]
import java.io.DataInputStream; import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path;
import java.io.*; import org.apache.hadoop.fs.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,621,369
private void checkPausedOrCanceled() throws StopRequestException { synchronized (mInfo) { if (mInfo.mControl == Downloads.Impl.CONTROL_PAUSED) { throw new StopRequestException( Downloads.Impl.STATUS_PAUSED_BY_APP, "download paused by owner"); } if (mInfo.mStatus == Downloads.Impl.STATUS_CANCELED || mInfo.mDeleted) { throw new StopRequestException(Downloads.Impl.STATUS_CANCELED, "download canceled"); } } // if policy has been changed, trigger connectivity check if (mPolicyDirty) { checkConnectivity(); } }
void function() throws StopRequestException { synchronized (mInfo) { if (mInfo.mControl == Downloads.Impl.CONTROL_PAUSED) { throw new StopRequestException( Downloads.Impl.STATUS_PAUSED_BY_APP, STR); } if (mInfo.mStatus == Downloads.Impl.STATUS_CANCELED mInfo.mDeleted) { throw new StopRequestException(Downloads.Impl.STATUS_CANCELED, STR); } } if (mPolicyDirty) { checkConnectivity(); } }
/** * Check if the download has been paused or canceled, stopping the request * appropriately if it has been. */
Check if the download has been paused or canceled, stopping the request appropriately if it has been
checkPausedOrCanceled
{ "repo_name": "wangdan/DownloadManager", "path": "library/src/main/java/org/aisen/downloader/provider/DownloadThread.java", "license": "apache-2.0", "size": 31903 }
[ "org.aisen.downloader.downloads.Downloads" ]
import org.aisen.downloader.downloads.Downloads;
import org.aisen.downloader.downloads.*;
[ "org.aisen.downloader" ]
org.aisen.downloader;
2,827,721
@Override protected void siemLog(EntityEvent<IdmRoleDto> event, String status, String detail) { if (event == null) { return; } IdmRoleDto dto = event.getContent(); String operationType = event.getType().name(); String action = siemLoggerManager.buildAction(SiemLoggerManager.ROLE_LEVEL_KEY, operationType); if(siemLoggerManager.skipLogging(action)) { return; } String transactionUuid = Objects.toString(dto.getTransactionId(),""); siemLog(action, status, dto, null, transactionUuid, detail); }
void function(EntityEvent<IdmRoleDto> event, String status, String detail) { if (event == null) { return; } IdmRoleDto dto = event.getContent(); String operationType = event.getType().name(); String action = siemLoggerManager.buildAction(SiemLoggerManager.ROLE_LEVEL_KEY, operationType); if(siemLoggerManager.skipLogging(action)) { return; } String transactionUuid = Objects.toString(dto.getTransactionId(),""); siemLog(action, status, dto, null, transactionUuid, detail); }
/** * Method provides specific logic for role siem logging. * */
Method provides specific logic for role siem logging
siemLog
{ "repo_name": "bcvsolutions/CzechIdMng", "path": "Realization/backend/core/core-impl/src/main/java/eu/bcvsolutions/idm/core/model/service/impl/DefaultIdmRoleService.java", "license": "mit", "size": 17025 }
[ "eu.bcvsolutions.idm.core.api.audit.service.SiemLoggerManager", "eu.bcvsolutions.idm.core.api.dto.IdmRoleDto", "eu.bcvsolutions.idm.core.api.event.EntityEvent", "java.util.Objects" ]
import eu.bcvsolutions.idm.core.api.audit.service.SiemLoggerManager; import eu.bcvsolutions.idm.core.api.dto.IdmRoleDto; import eu.bcvsolutions.idm.core.api.event.EntityEvent; import java.util.Objects;
import eu.bcvsolutions.idm.core.api.audit.service.*; import eu.bcvsolutions.idm.core.api.dto.*; import eu.bcvsolutions.idm.core.api.event.*; import java.util.*;
[ "eu.bcvsolutions.idm", "java.util" ]
eu.bcvsolutions.idm; java.util;
648,910
public static ims.core.admin.pas.domain.objects.PASEvent extractPASEvent(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.CareContextPasEventDetailsVo valueObject) { return extractPASEvent(domainFactory, valueObject, new HashMap()); }
static ims.core.admin.pas.domain.objects.PASEvent function(ims.domain.ILightweightDomainFactory domainFactory, ims.core.vo.CareContextPasEventDetailsVo valueObject) { return extractPASEvent(domainFactory, valueObject, new HashMap()); }
/** * Create the domain object from the value object. * @param domainFactory - used to create existing (persistent) domain objects. * @param valueObject - extract the domain object fields from this. */
Create the domain object from the value object
extractPASEvent
{ "repo_name": "FreudianNM/openMAXIMS", "path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/core/vo/domain/CareContextPasEventDetailsVoAssembler.java", "license": "agpl-3.0", "size": 17862 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
312,135
Set<QueryableEntry> getRecords(Comparable value);
Set<QueryableEntry> getRecords(Comparable value);
/** * Produces a result set containing entries whose attribute values are equal * to the given value. * * @param value the value to compare against. * @return the produced result set. */
Produces a result set containing entries whose attribute values are equal to the given value
getRecords
{ "repo_name": "dsukhoroslov/hazelcast", "path": "hazelcast/src/main/java/com/hazelcast/query/impl/Index.java", "license": "apache-2.0", "size": 4397 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,267,209
private PointF getAndCacheSectionBounds(String sectionName) { PointF bounds = mCachedSectionBounds.get(sectionName); if (bounds == null) { mSectionTextPaint.getTextBounds(sectionName, 0, sectionName.length(), mTmpBounds); bounds = new PointF(mSectionTextPaint.measureText(sectionName), mTmpBounds.height()); mCachedSectionBounds.put(sectionName, bounds); } return bounds; }
PointF function(String sectionName) { PointF bounds = mCachedSectionBounds.get(sectionName); if (bounds == null) { mSectionTextPaint.getTextBounds(sectionName, 0, sectionName.length(), mTmpBounds); bounds = new PointF(mSectionTextPaint.measureText(sectionName), mTmpBounds.height()); mCachedSectionBounds.put(sectionName, bounds); } return bounds; }
/** * Given a section name, return the bounds of the given section name. */
Given a section name, return the bounds of the given section name
getAndCacheSectionBounds
{ "repo_name": "lcg833/Trebuchet", "path": "Trebuchet/src/main/java/com/android/launcher3/allapps/AllAppsGridAdapter.java", "license": "gpl-3.0", "size": 31103 }
[ "android.graphics.PointF" ]
import android.graphics.PointF;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
2,380,859
@Nullable PyFunction findMethodByName(@Nullable @NonNls final String name, boolean inherited, TypeEvalContext context);
PyFunction findMethodByName(@Nullable @NonNls final String name, boolean inherited, TypeEvalContext context);
/** * Finds a method with given name. * * @param name what to look for * @param inherited true: search in superclasses; false: only look for methods defined in this class. * @param context * @return */
Finds a method with given name
findMethodByName
{ "repo_name": "MichaelNedzelsky/intellij-community", "path": "python/psi-api/src/com/jetbrains/python/psi/PyClass.java", "license": "apache-2.0", "size": 10344 }
[ "com.jetbrains.python.psi.types.TypeEvalContext", "org.jetbrains.annotations.NonNls", "org.jetbrains.annotations.Nullable" ]
import com.jetbrains.python.psi.types.TypeEvalContext; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.Nullable;
import com.jetbrains.python.psi.types.*; import org.jetbrains.annotations.*;
[ "com.jetbrains.python", "org.jetbrains.annotations" ]
com.jetbrains.python; org.jetbrains.annotations;
1,154,735
@Message(id = 14007, value = "Failed to rollback transaction") TransactionFailureException failedToRollbackTransaction(@Cause Exception e);
@Message(id = 14007, value = STR) TransactionFailureException failedToRollbackTransaction(@Cause Exception e);
/** * failedToRollbackTransaction method definition. * @param e e * @return TransactionFailureException */
failedToRollbackTransaction method definition
failedToRollbackTransaction
{ "repo_name": "bfitzpat/switchyard", "path": "core/runtime/src/main/java/org/switchyard/runtime/RuntimeMessages.java", "license": "apache-2.0", "size": 14146 }
[ "org.jboss.logging.annotations.Cause", "org.jboss.logging.annotations.Message", "org.switchyard.TransactionFailureException" ]
import org.jboss.logging.annotations.Cause; import org.jboss.logging.annotations.Message; import org.switchyard.TransactionFailureException;
import org.jboss.logging.annotations.*; import org.switchyard.*;
[ "org.jboss.logging", "org.switchyard" ]
org.jboss.logging; org.switchyard;
209,879
void setPresent(boolean present) { // Show full, but gray bar if (!present) { setBarColor(Color.LIGHT_GRAY); getModel().setValue(1.0); } }
void setPresent(boolean present) { if (!present) { setBarColor(Color.LIGHT_GRAY); getModel().setValue(1.0); } }
/** * Set present or absent. * * @param present present status of the member */
Set present or absent
setPresent
{ "repo_name": "markuskeunecke/stendhal", "path": "src/games/stendhal/client/gui/group/MemberCellRenderer.java", "license": "gpl-2.0", "size": 4241 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,773,539
public void init() throws LifecycleException { if (initialized) { if (log.isInfoEnabled()) log.info(sm.getString("coyoteConnector.alreadyInitialized")); return; } this.initialized = true; if (org.apache.tomcat.util.Constants.ENABLE_MODELER) { if (oname == null) { try { // we are loaded directly, via API - and no name was given // to us oname = createObjectName(container.getName(), "Connector"); Registry.getRegistry(null, null).registerComponent(this, oname, null); controller = oname; } catch (Exception e) { log.error("Error registering connector ", e); } if (log.isDebugEnabled()) log.debug("Creating name for connector " + oname); } } // Initializa adapter adapter = new CoyoteAdapter(this); protocolHandler.setAdapter(adapter); IntrospectionUtils.setProperty(protocolHandler, "jkHome", System.getProperty("catalina.base")); try { log.info("Invoke Protocol Handler initialization"); protocolHandler.init(); } catch (Exception e) { log.fatal("ERROR ------> " + e.getMessage(), e); throw new LifecycleException(sm.getString( "coyoteConnector.protocolHandlerInitializationFailed", e)); } }
void function() throws LifecycleException { if (initialized) { if (log.isInfoEnabled()) log.info(sm.getString(STR)); return; } this.initialized = true; if (org.apache.tomcat.util.Constants.ENABLE_MODELER) { if (oname == null) { try { oname = createObjectName(container.getName(), STR); Registry.getRegistry(null, null).registerComponent(this, oname, null); controller = oname; } catch (Exception e) { log.error(STR, e); } if (log.isDebugEnabled()) log.debug(STR + oname); } } adapter = new CoyoteAdapter(this); protocolHandler.setAdapter(adapter); IntrospectionUtils.setProperty(protocolHandler, STR, System.getProperty(STR)); try { log.info(STR); protocolHandler.init(); } catch (Exception e) { log.fatal(STR + e.getMessage(), e); throw new LifecycleException(sm.getString( STR, e)); } }
/** * Initialize this connector (create ServerSocket here!) * @throws LifecycleException */
Initialize this connector (create ServerSocket here!)
init
{ "repo_name": "benothman/jboss-web-nio2", "path": "java/org/apache/catalina/connector/Connector.java", "license": "lgpl-3.0", "size": 26733 }
[ "org.apache.catalina.LifecycleException", "org.apache.tomcat.util.IntrospectionUtils", "org.apache.tomcat.util.modeler.Registry" ]
import org.apache.catalina.LifecycleException; import org.apache.tomcat.util.IntrospectionUtils; import org.apache.tomcat.util.modeler.Registry;
import org.apache.catalina.*; import org.apache.tomcat.util.*; import org.apache.tomcat.util.modeler.*;
[ "org.apache.catalina", "org.apache.tomcat" ]
org.apache.catalina; org.apache.tomcat;
2,270,880
protected Session readSession( byte[] data, String sessionId ) { try { ReplicationStream session_in = getReplicationStream(data); Session session = sessionId!=null?this.findSession(sessionId):null; boolean isNew = (session==null); //clear the old values from the existing session if ( session!=null ) { ReplicatedSession rs = (ReplicatedSession)session; rs.expire(false); //cleans up the previous values, since we are not doing removes session = null; }//end if if (session==null) { session = createSession(null,false, false); sessions.remove(session.getIdInternal()); } boolean hasPrincipal = session_in.readBoolean(); SerializablePrincipal p = null; if ( hasPrincipal ) p = (SerializablePrincipal)session_in.readObject(); ((ReplicatedSession)session).readObjectData(session_in); if ( hasPrincipal ) session.setPrincipal(p.getPrincipal(getContainer().getRealm())); ((ReplicatedSession)session).setId(sessionId,isNew); ReplicatedSession rsession = (ReplicatedSession)session; rsession.setAccessCount(1); session.setManager(this); session.setValid(true); rsession.setLastAccessedTime(System.currentTimeMillis()); rsession.setThisAccessedTime(System.currentTimeMillis()); ((ReplicatedSession)session).setAccessCount(0); session.setNew(false); if(log.isTraceEnabled()) log.trace("Session loaded id="+sessionId + " actualId="+session.getId()+ " exists="+this.sessions.containsKey(sessionId)+ " valid="+rsession.isValid()); return session; } catch ( Exception x ) { log.error("Failed to deserialize the session!",x); } return null; }
Session function( byte[] data, String sessionId ) { try { ReplicationStream session_in = getReplicationStream(data); Session session = sessionId!=null?this.findSession(sessionId):null; boolean isNew = (session==null); if ( session!=null ) { ReplicatedSession rs = (ReplicatedSession)session; rs.expire(false); session = null; } if (session==null) { session = createSession(null,false, false); sessions.remove(session.getIdInternal()); } boolean hasPrincipal = session_in.readBoolean(); SerializablePrincipal p = null; if ( hasPrincipal ) p = (SerializablePrincipal)session_in.readObject(); ((ReplicatedSession)session).readObjectData(session_in); if ( hasPrincipal ) session.setPrincipal(p.getPrincipal(getContainer().getRealm())); ((ReplicatedSession)session).setId(sessionId,isNew); ReplicatedSession rsession = (ReplicatedSession)session; rsession.setAccessCount(1); session.setManager(this); session.setValid(true); rsession.setLastAccessedTime(System.currentTimeMillis()); rsession.setThisAccessedTime(System.currentTimeMillis()); ((ReplicatedSession)session).setAccessCount(0); session.setNew(false); if(log.isTraceEnabled()) log.trace(STR+sessionId + STR+session.getId()+ STR+this.sessions.containsKey(sessionId)+ STR+rsession.isValid()); return session; } catch ( Exception x ) { log.error(STR,x); } return null; }
/** * Reinstantiates a serialized session from the data passed in. * This will first call createSession() so that we get a fresh instance with all * the managers set and all the transient fields validated. * Then it calls Session.readObjectData(byte[]) to deserialize the object * @param data - a byte array containing session data * @return a valid Session object, null if an error occurs * */
Reinstantiates a serialized session from the data passed in. This will first call createSession() so that we get a fresh instance with all the managers set and all the transient fields validated. Then it calls Session.readObjectData(byte[]) to deserialize the object
readSession
{ "repo_name": "yuyupapa/OpenSource", "path": "apache-tomcat-6.0.48/java/org/apache/catalina/ha/session/SimpleTcpReplicationManager.java", "license": "apache-2.0", "size": 27898 }
[ "org.apache.catalina.Session", "org.apache.catalina.tribes.io.ReplicationStream" ]
import org.apache.catalina.Session; import org.apache.catalina.tribes.io.ReplicationStream;
import org.apache.catalina.*; import org.apache.catalina.tribes.io.*;
[ "org.apache.catalina" ]
org.apache.catalina;
872,979
protected boolean sendMessageToEndpoint(final LogoutHttpMessage msg, final SingleLogoutRequestContext request, final SingleLogoutMessage logoutMessage) { return this.httpClient.sendMessageToEndPoint(msg); }
boolean function(final LogoutHttpMessage msg, final SingleLogoutRequestContext request, final SingleLogoutMessage logoutMessage) { return this.httpClient.sendMessageToEndPoint(msg); }
/** * Send message to endpoint. * * @param msg the msg * @param request the request * @param logoutMessage the logout message * @return true/false */
Send message to endpoint
sendMessageToEndpoint
{ "repo_name": "apereo/cas", "path": "core/cas-server-core-logout-api/src/main/java/org/apereo/cas/logout/slo/BaseSingleLogoutServiceMessageHandler.java", "license": "apache-2.0", "size": 10195 }
[ "org.apereo.cas.logout.LogoutHttpMessage" ]
import org.apereo.cas.logout.LogoutHttpMessage;
import org.apereo.cas.logout.*;
[ "org.apereo.cas" ]
org.apereo.cas;
2,757,994
return (int) (widthPercent*AGC.getW()); }
return (int) (widthPercent*AGC.getW()); }
/** * Transform a position in percent to pixels on the x axis */
Transform a position in percent to pixels on the x axis
percentToPixelW
{ "repo_name": "Khopa/OneStory_VN_Engine", "path": "src/OneStory/src/com/khopa/oneStory/core/views/Utils.java", "license": "mit", "size": 841 }
[ "com.khopa.oneStory.core.AGC" ]
import com.khopa.oneStory.core.AGC;
import com.khopa.*;
[ "com.khopa" ]
com.khopa;
596,376
public void cache(final String path, final int maxSize, final long expires, final TimeUnit units) { final CacheBuilder<Object, Object> cb = CacheBuilder.newBuilder(); if (maxSize > 0) { cb.maximumSize(maxSize); } if (expires > 0) { cb.expireAfterWrite(expires, units); } responses.put(new RestEndpoint(path), cb.build()); }
void function(final String path, final int maxSize, final long expires, final TimeUnit units) { final CacheBuilder<Object, Object> cb = CacheBuilder.newBuilder(); if (maxSize > 0) { cb.maximumSize(maxSize); } if (expires > 0) { cb.expireAfterWrite(expires, units); } responses.put(new RestEndpoint(path), cb.build()); }
/** * Add a caching rule to a path prefix. * * @param path The path prefix to cache * @param maxSize The maximum cache size for this path * @param expires The expiration time (after initial write) * @param units The expiration time units */
Add a caching rule to a path prefix
cache
{ "repo_name": "barchart/barchart-netty4", "path": "rest/client/src/main/java/com/barchart/netty/rest/client/cache/DefaultRestResponseCache.java", "license": "bsd-3-clause", "size": 4333 }
[ "com.barchart.netty.rest.client.RestEndpoint", "com.google.common.cache.CacheBuilder", "java.util.concurrent.TimeUnit" ]
import com.barchart.netty.rest.client.RestEndpoint; import com.google.common.cache.CacheBuilder; import java.util.concurrent.TimeUnit;
import com.barchart.netty.rest.client.*; import com.google.common.cache.*; import java.util.concurrent.*;
[ "com.barchart.netty", "com.google.common", "java.util" ]
com.barchart.netty; com.google.common; java.util;
1,274,434
public ContentDirectoryBrowseResult browseSync(Position pos) { if(getProviderDevice() == null){ return null; } if (pos == null || pos.getDeviceId() == null ) { if(getProviderDevice() != null){ return browseSync(getProviderDevice(),"0" , BrowseFlag.DIRECT_CHILDREN, "*", 0L, null, new SortCriterion[0]); }else{ return null; } } if (getProviderDevice() != null && !pos.getDeviceId().equals(getProviderDevice().getIdentity().getUdn().getIdentifierString())){ return browseSync(getProviderDevice(),"0" , BrowseFlag.DIRECT_CHILDREN, "*", 0L, null, new SortCriterion[0]); } return browseSync(getDevice(pos.getDeviceId()), pos.getObjectId(), BrowseFlag.DIRECT_CHILDREN, "*", 0L, null, new SortCriterion[0]); } /** * Browse ContenDirctory synchronous * * @param device the device to be browsed * @param objectID the browsing root * @param flag kind of browsing @see {@link BrowseFlag} * @param filter a filter * @param firstResult first result * @param maxResults max result count * @param orderBy sorting criteria @see {@link SortCriterion}
ContentDirectoryBrowseResult function(Position pos) { if(getProviderDevice() == null){ return null; } if (pos == null pos.getDeviceId() == null ) { if(getProviderDevice() != null){ return browseSync(getProviderDevice(),"0" , BrowseFlag.DIRECT_CHILDREN, "*", 0L, null, new SortCriterion[0]); }else{ return null; } } if (getProviderDevice() != null && !pos.getDeviceId().equals(getProviderDevice().getIdentity().getUdn().getIdentifierString())){ return browseSync(getProviderDevice(),"0" , BrowseFlag.DIRECT_CHILDREN, "*", 0L, null, new SortCriterion[0]); } return browseSync(getDevice(pos.getDeviceId()), pos.getObjectId(), BrowseFlag.DIRECT_CHILDREN, "*", 0L, null, new SortCriterion[0]); } /** * Browse ContenDirctory synchronous * * @param device the device to be browsed * @param objectID the browsing root * @param flag kind of browsing @see {@link BrowseFlag} * @param filter a filter * @param firstResult first result * @param maxResults max result count * @param orderBy sorting criteria @see {@link SortCriterion}
/** * Browse ContenDirctory synchronous * * @param pos Position * the device and object to be browsed * @return the browsing result */
Browse ContenDirctory synchronous
browseSync
{ "repo_name": "z7z8th/yaacc", "path": "yaacc/src/de/yaacc/upnp/UpnpClient.java", "license": "gpl-3.0", "size": 47772 }
[ "de.yaacc.browser.Position", "de.yaacc.upnp.callback.contentdirectory.ContentDirectoryBrowseResult", "org.fourthline.cling.support.model.BrowseFlag", "org.fourthline.cling.support.model.SortCriterion" ]
import de.yaacc.browser.Position; import de.yaacc.upnp.callback.contentdirectory.ContentDirectoryBrowseResult; import org.fourthline.cling.support.model.BrowseFlag; import org.fourthline.cling.support.model.SortCriterion;
import de.yaacc.browser.*; import de.yaacc.upnp.callback.contentdirectory.*; import org.fourthline.cling.support.model.*;
[ "de.yaacc.browser", "de.yaacc.upnp", "org.fourthline.cling" ]
de.yaacc.browser; de.yaacc.upnp; org.fourthline.cling;
198,356
protected final BigDecimal halfStepPrevInScale(BigDecimal decimal) { BigDecimal step = BigDecimal.ONE.scaleByPowerOfTen(-getRoundingScale()); BigDecimal halfStep = step.divide(BigDecimal.valueOf(2)); return decimal.subtract(halfStep); }
final BigDecimal function(BigDecimal decimal) { BigDecimal step = BigDecimal.ONE.scaleByPowerOfTen(-getRoundingScale()); BigDecimal halfStep = step.divide(BigDecimal.valueOf(2)); return decimal.subtract(halfStep); }
/** * Produces a value half of a "step" back in this expression's rounding scale. * For example with a scale of 2, "2.5" would be stepped back to "2.495". */
Produces a value half of a "step" back in this expression's rounding scale. For example with a scale of 2, "2.5" would be stepped back to "2.495"
halfStepPrevInScale
{ "repo_name": "ohadshacham/phoenix", "path": "phoenix-core/src/main/java/org/apache/phoenix/expression/function/RoundDecimalExpression.java", "license": "apache-2.0", "size": 17213 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
47,777
Future<T> resolve(String inetHost, int inetPort);
Future<T> resolve(String inetHost, int inetPort);
/** * Resolves the specified name into a {@link SocketAddress}. * * @param inetHost the name to resolve * @param inetPort the port number * * @return the {@link SocketAddress} as the result of the resolution */
Resolves the specified name into a <code>SocketAddress</code>
resolve
{ "repo_name": "firebase/netty", "path": "resolver/src/main/java/io/netty/resolver/NameResolver.java", "license": "apache-2.0", "size": 3141 }
[ "io.netty.util.concurrent.Future" ]
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.*;
[ "io.netty.util" ]
io.netty.util;
1,057,943
public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) { if (m_fldValue1 != null) if (m_fldValue1.getRecord() != this.getOwner().getRecord()) m_fldValue1.addListener(new FieldRemoveBOnCloseHandler(this)); // Not same file, if target file closes, remove this listener! if (m_fldValue2 != null) if (m_fldValue2.getRecord() != this.getOwner().getRecord()) if (m_fldValue2.getRecord() != m_fldValue1.getRecord()) m_fldValue2.addListener(new FieldRemoveBOnCloseHandler(this)); // Not same file, if target file closes, remove this listener! } }
void function(ListenerOwner owner) { super.setOwner(owner); if (owner != null) { if (m_fldValue1 != null) if (m_fldValue1.getRecord() != this.getOwner().getRecord()) m_fldValue1.addListener(new FieldRemoveBOnCloseHandler(this)); if (m_fldValue2 != null) if (m_fldValue2.getRecord() != this.getOwner().getRecord()) if (m_fldValue2.getRecord() != m_fldValue1.getRecord()) m_fldValue2.addListener(new FieldRemoveBOnCloseHandler(this)); } }
/** * Set the field that owns this listener. * @owner The field that this listener is being added to (if null, this listener is being removed). */
Set the field that owns this listener
setOwner
{ "repo_name": "jbundle/jbundle", "path": "base/base/src/main/java/org/jbundle/base/field/event/CalcBalanceHandler.java", "license": "gpl-3.0", "size": 6083 }
[ "org.jbundle.base.field.ListenerOwner" ]
import org.jbundle.base.field.ListenerOwner;
import org.jbundle.base.field.*;
[ "org.jbundle.base" ]
org.jbundle.base;
288,251
public boolean areAllResultsAvailable() { if (mode == Master.COMPLETION_ORDER) { return unorderedResults.size() == idsubmitted.size(); } else { return orderedResults.size() == idsubmitted.size(); } }
boolean function() { if (mode == Master.COMPLETION_ORDER) { return unorderedResults.size() == idsubmitted.size(); } else { return orderedResults.size() == idsubmitted.size(); } }
/** * Tells if all results are currently available in the queue * @return the answer */
Tells if all results are currently available in the queue
areAllResultsAvailable
{ "repo_name": "nmpgaspar/PainlessProActive", "path": "src/Extensions/org/objectweb/proactive/extensions/masterworker/core/ResultQueue.java", "license": "agpl-3.0", "size": 10372 }
[ "org.objectweb.proactive.extensions.masterworker.interfaces.Master" ]
import org.objectweb.proactive.extensions.masterworker.interfaces.Master;
import org.objectweb.proactive.extensions.masterworker.interfaces.*;
[ "org.objectweb.proactive" ]
org.objectweb.proactive;
1,834,759
public boolean hasPrologRules() { // We check if this project has a rules.pl file if (getConfig().getRulesId() != null) { return true; } // If not, we check the parents. return parents().stream() .map(ProjectState::getConfig) .map(ProjectConfig::getRulesId) .anyMatch(Objects::nonNull); }
boolean function() { if (getConfig().getRulesId() != null) { return true; } return parents().stream() .map(ProjectState::getConfig) .map(ProjectConfig::getRulesId) .anyMatch(Objects::nonNull); }
/** * Returns true if the Prolog engine is expected to run for this project, that is if this project * or a parent possesses a rules.pl file. */
Returns true if the Prolog engine is expected to run for this project, that is if this project or a parent possesses a rules.pl file
hasPrologRules
{ "repo_name": "qtproject/qtqa-gerrit", "path": "java/com/google/gerrit/server/project/ProjectState.java", "license": "apache-2.0", "size": 20060 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
467,398