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 static void makeColumnFamilyDirs(FileSystem fs, Path tabledir,
final HRegionInfo hri, byte [] colFamily)
throws IOException {
Path dir = Store.getStoreHomedir(tabledir, hri.getEncodedName(), colFamily);
if (!fs.mkdirs(dir)) {
LOG.warn("Failed to create " + dir);
}
} | static void function(FileSystem fs, Path tabledir, final HRegionInfo hri, byte [] colFamily) throws IOException { Path dir = Store.getStoreHomedir(tabledir, hri.getEncodedName(), colFamily); if (!fs.mkdirs(dir)) { LOG.warn(STR + dir); } } | /**
* Make the directories for a specific column family
*
* @param fs the file system
* @param tabledir base directory where region will live (usually the table dir)
* @param hri
* @param colFamily the column family
* @throws IOException
*/ | Make the directories for a specific column family | makeColumnFamilyDirs | {
"repo_name": "indi60/hbase-pmc",
"path": "target/hbase-0.94.1/hbase-0.94.1/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java",
"license": "apache-2.0",
"size": 184604
} | [
"java.io.IOException",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.HRegionInfo"
] | import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HRegionInfo; | import java.io.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,166,377 |
public static boolean appleCrosstoolTransitionIsAppliedForAllObjc(BuildOptions options) {
return (options.get(AppleCommandLineOptions.class).enableAppleCrosstoolTransition
|| options.get(ObjcCommandLineOptions.class).experimentalObjcLibrary
|| options.get(ObjcCommandLineOptions.class).objcCrosstoolMode != ObjcCrosstoolMode.OFF);
} | static boolean function(BuildOptions options) { return (options.get(AppleCommandLineOptions.class).enableAppleCrosstoolTransition options.get(ObjcCommandLineOptions.class).experimentalObjcLibrary options.get(ObjcCommandLineOptions.class).objcCrosstoolMode != ObjcCrosstoolMode.OFF); } | /**
* Returns true if the given options imply use of AppleCrosstoolTransition for all apple targets.
*/ | Returns true if the given options imply use of AppleCrosstoolTransition for all apple targets | appleCrosstoolTransitionIsAppliedForAllObjc | {
"repo_name": "Asana/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/objc/AppleCrosstoolTransition.java",
"license": "apache-2.0",
"size": 4152
} | [
"com.google.devtools.build.lib.analysis.config.BuildOptions",
"com.google.devtools.build.lib.rules.apple.AppleCommandLineOptions",
"com.google.devtools.build.lib.rules.objc.ObjcCommandLineOptions"
] | import com.google.devtools.build.lib.analysis.config.BuildOptions; import com.google.devtools.build.lib.rules.apple.AppleCommandLineOptions; import com.google.devtools.build.lib.rules.objc.ObjcCommandLineOptions; | import com.google.devtools.build.lib.analysis.config.*; import com.google.devtools.build.lib.rules.apple.*; import com.google.devtools.build.lib.rules.objc.*; | [
"com.google.devtools"
] | com.google.devtools; | 2,439,272 |
@Override
public void update(float delta) {
for (Map.Entry<String, Entity> pair : this.cameras.entrySet()) {
Camera camera = (Camera) pair.getValue();
TargetComponent component = camera.getComponent(TargetComponent.class);
CameraComponent cam = camera.getComponent(CameraComponent.class);
if (component.target != null) {
Entity target = component.target;
PositionComponent position = target.getComponent(PositionComponent.class);
SizeComponent size = target.getComponent(SizeComponent.class);
float x = position.x + size.width / 2;
float y = position.y + size.height / 2;
float dx = x - cam.camera.position.x;
float dy = y - cam.camera.position.y;
if (Math.abs(dx) + Math.abs(dy) > 20) {
cam.camera.position.x += dx * 4f * delta;
cam.camera.position.y += dy * 4f * delta;
}
SizeComponent worldSize = World.instance.getComponent(SizeComponent.class);
float width = worldSize.width * Chunk.SIZE * Block.SIZE;
float height = worldSize.height * Chunk.SIZE * Block.SIZE;
float halfDisplayWidth = cam.camera.viewportWidth / 2;
float halfDisplayHeight = cam.camera.viewportHeight / 2;
// Auto floor it:
cam.camera.position.x = (int) Math.max(Math.min(cam.camera.position.x, width - halfDisplayWidth - Block.SIZE), halfDisplayWidth + Block.SIZE);
cam.camera.position.y = (int) Math.max(Math.min(cam.camera.position.y, height - halfDisplayHeight - Block.SIZE), halfDisplayHeight + Block.SIZE);
}
cam.camera.update();
}
} | void function(float delta) { for (Map.Entry<String, Entity> pair : this.cameras.entrySet()) { Camera camera = (Camera) pair.getValue(); TargetComponent component = camera.getComponent(TargetComponent.class); CameraComponent cam = camera.getComponent(CameraComponent.class); if (component.target != null) { Entity target = component.target; PositionComponent position = target.getComponent(PositionComponent.class); SizeComponent size = target.getComponent(SizeComponent.class); float x = position.x + size.width / 2; float y = position.y + size.height / 2; float dx = x - cam.camera.position.x; float dy = y - cam.camera.position.y; if (Math.abs(dx) + Math.abs(dy) > 20) { cam.camera.position.x += dx * 4f * delta; cam.camera.position.y += dy * 4f * delta; } SizeComponent worldSize = World.instance.getComponent(SizeComponent.class); float width = worldSize.width * Chunk.SIZE * Block.SIZE; float height = worldSize.height * Chunk.SIZE * Block.SIZE; float halfDisplayWidth = cam.camera.viewportWidth / 2; float halfDisplayHeight = cam.camera.viewportHeight / 2; cam.camera.position.x = (int) Math.max(Math.min(cam.camera.position.x, width - halfDisplayWidth - Block.SIZE), halfDisplayWidth + Block.SIZE); cam.camera.position.y = (int) Math.max(Math.min(cam.camera.position.y, height - halfDisplayHeight - Block.SIZE), halfDisplayHeight + Block.SIZE); } cam.camera.update(); } } | /**
* Updates the cameras position
*
* @param delta Time, since the last frame
*/ | Updates the cameras position | update | {
"repo_name": "Col-E/LastTry",
"path": "core/src/org/egordorichev/lasttry/entity/engine/system/systems/CameraSystem.java",
"license": "mit",
"size": 4501
} | [
"java.util.Map",
"org.egordorichev.lasttry.entity.Entity",
"org.egordorichev.lasttry.entity.component.PositionComponent",
"org.egordorichev.lasttry.entity.component.SizeComponent",
"org.egordorichev.lasttry.entity.component.TargetComponent",
"org.egordorichev.lasttry.entity.entities.camera.Camera",
"org.egordorichev.lasttry.entity.entities.camera.CameraComponent",
"org.egordorichev.lasttry.entity.entities.item.tile.Block",
"org.egordorichev.lasttry.entity.entities.world.World",
"org.egordorichev.lasttry.entity.entities.world.chunk.Chunk"
] | import java.util.Map; import org.egordorichev.lasttry.entity.Entity; import org.egordorichev.lasttry.entity.component.PositionComponent; import org.egordorichev.lasttry.entity.component.SizeComponent; import org.egordorichev.lasttry.entity.component.TargetComponent; import org.egordorichev.lasttry.entity.entities.camera.Camera; import org.egordorichev.lasttry.entity.entities.camera.CameraComponent; import org.egordorichev.lasttry.entity.entities.item.tile.Block; import org.egordorichev.lasttry.entity.entities.world.World; import org.egordorichev.lasttry.entity.entities.world.chunk.Chunk; | import java.util.*; import org.egordorichev.lasttry.entity.*; import org.egordorichev.lasttry.entity.component.*; import org.egordorichev.lasttry.entity.entities.camera.*; import org.egordorichev.lasttry.entity.entities.item.tile.*; import org.egordorichev.lasttry.entity.entities.world.*; import org.egordorichev.lasttry.entity.entities.world.chunk.*; | [
"java.util",
"org.egordorichev.lasttry"
] | java.util; org.egordorichev.lasttry; | 2,344,567 |
public static void startOpenmrs(ServletContext servletContext) throws ServletException {
//Ensure that we are being called from WebDaemon
//TODO this did not work because callerClass was org.openmrs.web.WebDaemon$1 instead of org.openmrs.web.WebDaemon
// start openmrs
try {
Context.openSession();
PersonName.setFormat(Context.getAdministrationService().getGlobalProperty(
OpenmrsConstants.GLOBAL_PROPERTY_LAYOUT_NAME_FORMAT));
// load bundled modules that are packaged into the webapp
Listener.loadBundledModules(servletContext);
Context.startup(getRuntimeProperties());
}
catch (DatabaseUpdateException updateEx) {
throw new ServletException("Should not be here because updates were run previously", updateEx);
}
catch (InputRequiredException inputRequiredEx) {
throw new ServletException("Should not be here because updates were run previously", inputRequiredEx);
}
catch (MandatoryModuleException mandatoryModEx) {
throw new ServletException(mandatoryModEx);
}
catch (OpenmrsCoreModuleException coreModEx) {
// don't wrap this error in a ServletException because we want to deal with it differently
// in the StartupErrorFilter class
throw coreModEx;
}
// TODO catch openmrs errors here and drop the user back out to the setup screen
try {
// web load modules
Listener.performWebStartOfModules(servletContext);
// start the scheduled tasks
SchedulerUtil.startup(getRuntimeProperties());
}
catch (Exception t) {
Context.shutdown();
WebModuleUtil.shutdownModules(servletContext);
throw new ServletException(t);
}
finally {
Context.closeSession();
}
}
| static void function(ServletContext servletContext) throws ServletException { try { Context.openSession(); PersonName.setFormat(Context.getAdministrationService().getGlobalProperty( OpenmrsConstants.GLOBAL_PROPERTY_LAYOUT_NAME_FORMAT)); Listener.loadBundledModules(servletContext); Context.startup(getRuntimeProperties()); } catch (DatabaseUpdateException updateEx) { throw new ServletException(STR, updateEx); } catch (InputRequiredException inputRequiredEx) { throw new ServletException(STR, inputRequiredEx); } catch (MandatoryModuleException mandatoryModEx) { throw new ServletException(mandatoryModEx); } catch (OpenmrsCoreModuleException coreModEx) { throw coreModEx; } try { Listener.performWebStartOfModules(servletContext); SchedulerUtil.startup(getRuntimeProperties()); } catch (Exception t) { Context.shutdown(); WebModuleUtil.shutdownModules(servletContext); throw new ServletException(t); } finally { Context.closeSession(); } } | /**
* Do the work of starting openmrs.
*
* @param servletContext
* @throws ServletException
*/ | Do the work of starting openmrs | startOpenmrs | {
"repo_name": "Winbobob/openmrs-core",
"path": "web/src/main/java/org/openmrs/web/Listener.java",
"license": "mpl-2.0",
"size": 24584
} | [
"javax.servlet.ServletContext",
"javax.servlet.ServletException",
"org.openmrs.PersonName",
"org.openmrs.api.context.Context",
"org.openmrs.module.MandatoryModuleException",
"org.openmrs.module.OpenmrsCoreModuleException",
"org.openmrs.module.web.WebModuleUtil",
"org.openmrs.scheduler.SchedulerUtil",
"org.openmrs.util.DatabaseUpdateException",
"org.openmrs.util.InputRequiredException",
"org.openmrs.util.OpenmrsConstants"
] | import javax.servlet.ServletContext; import javax.servlet.ServletException; import org.openmrs.PersonName; import org.openmrs.api.context.Context; import org.openmrs.module.MandatoryModuleException; import org.openmrs.module.OpenmrsCoreModuleException; import org.openmrs.module.web.WebModuleUtil; import org.openmrs.scheduler.SchedulerUtil; import org.openmrs.util.DatabaseUpdateException; import org.openmrs.util.InputRequiredException; import org.openmrs.util.OpenmrsConstants; | import javax.servlet.*; import org.openmrs.*; import org.openmrs.api.context.*; import org.openmrs.module.*; import org.openmrs.module.web.*; import org.openmrs.scheduler.*; import org.openmrs.util.*; | [
"javax.servlet",
"org.openmrs",
"org.openmrs.api",
"org.openmrs.module",
"org.openmrs.scheduler",
"org.openmrs.util"
] | javax.servlet; org.openmrs; org.openmrs.api; org.openmrs.module; org.openmrs.scheduler; org.openmrs.util; | 2,308,758 |
public void map(Text key, Text value,
OutputCollector<Text, Text> output,
Reporter reporter) throws IOException, MessageException, ServiceException {
int itemCount = 0;
while (numBytesToWrite > 0) {
// Generate the key/value
int noWordsKey = minWordsInKey +
(wordsInKeyRange != 0 ? random.nextInt(wordsInKeyRange) : 0);
int noWordsValue = minWordsInValue +
(wordsInValueRange != 0 ? random.nextInt(wordsInValueRange) : 0);
Text keyWords = generateSentence(noWordsKey);
Text valueWords = generateSentence(noWordsValue);
// Write the sentence
output.collect(keyWords, valueWords);
numBytesToWrite -= (keyWords.getLength() + valueWords.getLength());
// Update counters, progress etc.
reporter.incrCounter(Counters.BYTES_WRITTEN,
(keyWords.getLength()+valueWords.getLength()));
reporter.incrCounter(Counters.RECORDS_WRITTEN, 1);
if (++itemCount % 200 == 0) {
reporter.setStatus("wrote record " + itemCount + ". " +
numBytesToWrite + " bytes left.");
}
}
reporter.setStatus("done with " + itemCount + " records.");
} | void function(Text key, Text value, OutputCollector<Text, Text> output, Reporter reporter) throws IOException, MessageException, ServiceException { int itemCount = 0; while (numBytesToWrite > 0) { int noWordsKey = minWordsInKey + (wordsInKeyRange != 0 ? random.nextInt(wordsInKeyRange) : 0); int noWordsValue = minWordsInValue + (wordsInValueRange != 0 ? random.nextInt(wordsInValueRange) : 0); Text keyWords = generateSentence(noWordsKey); Text valueWords = generateSentence(noWordsValue); output.collect(keyWords, valueWords); numBytesToWrite -= (keyWords.getLength() + valueWords.getLength()); reporter.incrCounter(Counters.BYTES_WRITTEN, (keyWords.getLength()+valueWords.getLength())); reporter.incrCounter(Counters.RECORDS_WRITTEN, 1); if (++itemCount % 200 == 0) { reporter.setStatus(STR + itemCount + STR + numBytesToWrite + STR); } } reporter.setStatus(STR + itemCount + STR); } | /**
* Given an output filename, write a bunch of random records to it.
* @throws ServiceException
* @throws MessageException
*/ | Given an output filename, write a bunch of random records to it | map | {
"repo_name": "hanhlh/hadoop-0.20.2_FatBTree",
"path": "src/examples/org/apache/hadoop/examples/RandomTextWriter.java",
"license": "apache-2.0",
"size": 40467
} | [
"java.io.IOException",
"org.apache.hadoop.hdfs.server.namenodeFBT.msg.MessageException",
"org.apache.hadoop.hdfs.server.namenodeFBT.service.ServiceException",
"org.apache.hadoop.io.Text",
"org.apache.hadoop.mapred.OutputCollector",
"org.apache.hadoop.mapred.Reporter"
] | import java.io.IOException; import org.apache.hadoop.hdfs.server.namenodeFBT.msg.MessageException; import org.apache.hadoop.hdfs.server.namenodeFBT.service.ServiceException; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.OutputCollector; import org.apache.hadoop.mapred.Reporter; | import java.io.*; import org.apache.hadoop.hdfs.server.*; import org.apache.hadoop.io.*; import org.apache.hadoop.mapred.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 872,853 |
public void setParam(String param) {
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(param)) {
m_param = param.trim();
}
} | void function(String param) { if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(param)) { m_param = param.trim(); } } | /**
* Sets the optional parameter for the navigation.<p>
*
* @param param the optional parameter for the navigation to set
*/ | Sets the optional parameter for the navigation | setParam | {
"repo_name": "mediaworx/opencms-core",
"path": "src/org/opencms/jsp/CmsJspTagNavigation.java",
"license": "lgpl-2.1",
"size": 7444
} | [
"org.opencms.util.CmsStringUtil"
] | import org.opencms.util.CmsStringUtil; | import org.opencms.util.*; | [
"org.opencms.util"
] | org.opencms.util; | 2,355,632 |
private synchronized void writeObject(java.io.ObjectOutputStream s)
throws IOException
{
s.defaultWriteObject(); // write the fields
} | synchronized void function(java.io.ObjectOutputStream s) throws IOException { s.defaultWriteObject(); } | /**
* WriteObject is called to save the state of the URL to an
* ObjectOutputStream. The handler is not saved since it is
* specific to this system.
*
* @serialData the default write object value. When read back in,
* the reader must ensure that calling getURLStreamHandler with
* the protocol variable returns a valid URLStreamHandler and
* throw an IOException if it does not.
*/ | WriteObject is called to save the state of the URL to an ObjectOutputStream. The handler is not saved since it is specific to this system | writeObject | {
"repo_name": "lambdalab-mirror/jdk7u-jdk",
"path": "src/share/classes/java/net/URL.java",
"license": "gpl-2.0",
"size": 51524
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,910,289 |
public void setJobPriority(JobID jobId, JobPriority priority)
throws AccessControlException, IOException {
jobTracker.getJobTracker().setJobPriority(jobId, priority);
} | void function(JobID jobId, JobPriority priority) throws AccessControlException, IOException { jobTracker.getJobTracker().setJobPriority(jobId, priority); } | /**
* Change the job's priority
*
* @throws IOException
* @throws AccessControlException
*/ | Change the job's priority | setJobPriority | {
"repo_name": "jayantgolhar/Hadoop-0.21.0",
"path": "mapred/src/test/mapred/org/apache/hadoop/mapred/MiniMRCluster.java",
"license": "apache-2.0",
"size": 23511
} | [
"java.io.IOException",
"org.apache.hadoop.security.AccessControlException"
] | import java.io.IOException; import org.apache.hadoop.security.AccessControlException; | import java.io.*; import org.apache.hadoop.security.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,610,246 |
@SuppressWarnings("unchecked")
private static void setObject(Object object, Field field, Element element)
throws XmlParseException {
field.setAccessible(true);
Object fieldObject = null;
try {
field.setAccessible(true);
fieldObject = field.get(object);
Class<?> fieldType = field.getType();
if (fieldType.isArray()) {
Class<?> componentType = fieldType.getComponentType();
List<?> objects = elementToList(element, field, componentType,
object);
if (objects == null || objects.size() == 0) {
return;
}
int nbr = objects.size();
fieldObject = Array.newInstance(componentType, nbr);
for (int i = 0; i < nbr; i++) {
Array.set(fieldObject, i, objects.get(i));
}
field.setAccessible(true);
field.set(object, fieldObject);
return;
}
if (fieldObject != null) {
if (fieldObject instanceof Map) {
if (field.getName().equals(COMP_LIST)) {
fillMap(element, (Map<String, String>) fieldObject);
return;
}
if (fillAttsIntoMap(element,
(Map<String, String>) fieldObject)) {
return;
}
String mapKey = DEFAULT_MAP_KEY;
MapDetails ante = field.getAnnotation(MapDetails.class);
if (ante != null) {
String txt = ante.indexFieldName();
if (txt != null) {
mapKey = txt;
}
}
List<?> objects = elementToList(element, field,
object.getClass(), object);
fillMap((Map<String, Object>) fieldObject, objects, mapKey);
} else {
elementToObject(element, fieldObject);
}
return;
}
if (fieldType.isInterface()
|| Modifier.isAbstract(fieldType.getModifiers())) {
fieldObject = elementWrapperToSubclass(element, field, object);
if (fieldObject != null) {
field.setAccessible(true);
field.set(object, fieldObject);
} else {
Tracer.trace("No instance provided for field "
+ field.getName());
}
return;
}
fieldObject = fieldType.newInstance();
elementToObject(element, fieldObject);
field.setAccessible(true);
field.set(object, fieldObject);
} catch (Exception e) {
throw new XmlParseException("Error while binding xml to object : "
+ e.getMessage());
}
} | @SuppressWarnings(STR) static void function(Object object, Field field, Element element) throws XmlParseException { field.setAccessible(true); Object fieldObject = null; try { field.setAccessible(true); fieldObject = field.get(object); Class<?> fieldType = field.getType(); if (fieldType.isArray()) { Class<?> componentType = fieldType.getComponentType(); List<?> objects = elementToList(element, field, componentType, object); if (objects == null objects.size() == 0) { return; } int nbr = objects.size(); fieldObject = Array.newInstance(componentType, nbr); for (int i = 0; i < nbr; i++) { Array.set(fieldObject, i, objects.get(i)); } field.setAccessible(true); field.set(object, fieldObject); return; } if (fieldObject != null) { if (fieldObject instanceof Map) { if (field.getName().equals(COMP_LIST)) { fillMap(element, (Map<String, String>) fieldObject); return; } if (fillAttsIntoMap(element, (Map<String, String>) fieldObject)) { return; } String mapKey = DEFAULT_MAP_KEY; MapDetails ante = field.getAnnotation(MapDetails.class); if (ante != null) { String txt = ante.indexFieldName(); if (txt != null) { mapKey = txt; } } List<?> objects = elementToList(element, field, object.getClass(), object); fillMap((Map<String, Object>) fieldObject, objects, mapKey); } else { elementToObject(element, fieldObject); } return; } if (fieldType.isInterface() Modifier.isAbstract(fieldType.getModifiers())) { fieldObject = elementWrapperToSubclass(element, field, object); if (fieldObject != null) { field.setAccessible(true); field.set(object, fieldObject); } else { Tracer.trace(STR + field.getName()); } return; } fieldObject = fieldType.newInstance(); elementToObject(element, fieldObject); field.setAccessible(true); field.set(object, fieldObject); } catch (Exception e) { throw new XmlParseException(STR + e.getMessage()); } } | /**
* parse element into an object and set it as value of the field.
*
* @param object
* of which this is a field
* @param field
* to which object value is to be assigned to
* @param element
* from which object is to be parsed
* @throws XmlParseException
*/ | parse element into an object and set it as value of the field | setObject | {
"repo_name": "raghu-bhandi/simplity",
"path": "java/org/simplity/kernel/util/XmlUtil.java",
"license": "mit",
"size": 36387
} | [
"java.lang.reflect.Array",
"java.lang.reflect.Field",
"java.lang.reflect.Modifier",
"java.util.List",
"java.util.Map",
"org.simplity.kernel.MapDetails",
"org.simplity.kernel.Tracer",
"org.w3c.dom.Element"
] | import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.List; import java.util.Map; import org.simplity.kernel.MapDetails; import org.simplity.kernel.Tracer; import org.w3c.dom.Element; | import java.lang.reflect.*; import java.util.*; import org.simplity.kernel.*; import org.w3c.dom.*; | [
"java.lang",
"java.util",
"org.simplity.kernel",
"org.w3c.dom"
] | java.lang; java.util; org.simplity.kernel; org.w3c.dom; | 2,222,100 |
public List<HybridConnectionInner> hybridConnectionsV2() {
return this.innerProperties() == null ? null : this.innerProperties().hybridConnectionsV2();
} | List<HybridConnectionInner> function() { return this.innerProperties() == null ? null : this.innerProperties().hybridConnectionsV2(); } | /**
* Get the hybridConnectionsV2 property: The Hybrid Connection V2 (Service Bus) view.
*
* @return the hybridConnectionsV2 value.
*/ | Get the hybridConnectionsV2 property: The Hybrid Connection V2 (Service Bus) view | hybridConnectionsV2 | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/NetworkFeaturesInner.java",
"license": "mit",
"size": 2917
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,041,865 |
EAttribute getRoutingStyle_ClosestDistance(); | EAttribute getRoutingStyle_ClosestDistance(); | /**
* Returns the meta object for the attribute '{@link org.eclipse.gmf.runtime.notation.RoutingStyle#isClosestDistance <em>Closest Distance</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Closest Distance</em>'.
* @see org.eclipse.gmf.runtime.notation.RoutingStyle#isClosestDistance()
* @see #getRoutingStyle()
* @generated
*/ | Returns the meta object for the attribute '<code>org.eclipse.gmf.runtime.notation.RoutingStyle#isClosestDistance Closest Distance</code>'. | getRoutingStyle_ClosestDistance | {
"repo_name": "ghillairet/gmf-tooling-gwt-runtime",
"path": "org.eclipse.gmf.runtime.notation.gwt/src/org/eclipse/gmf/runtime/notation/NotationPackage.java",
"license": "epl-1.0",
"size": 270096
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 132,780 |
public ServiceResponse<Map<String, Map<String, String>>> getDictionaryItemEmpty() throws ErrorException, IOException {
Call<ResponseBody> call = service.getDictionaryItemEmpty();
return getDictionaryItemEmptyDelegate(call.execute());
} | ServiceResponse<Map<String, Map<String, String>>> function() throws ErrorException, IOException { Call<ResponseBody> call = service.getDictionaryItemEmpty(); return getDictionaryItemEmptyDelegate(call.execute()); } | /**
* Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {}, "2": {"7": "seven", "8": "eight", "9": "nine"}}.
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the Map<String, Map<String, String>> object wrapped in {@link ServiceResponse} if successful.
*/ | Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {}, "2": {"7": "seven", "8": "eight", "9": "nine"}} | getDictionaryItemEmpty | {
"repo_name": "stankovski/AutoRest",
"path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodydictionary/DictionaryOperationsImpl.java",
"license": "mit",
"size": 167988
} | [
"com.microsoft.rest.ServiceResponse",
"java.io.IOException",
"java.util.Map"
] | import com.microsoft.rest.ServiceResponse; import java.io.IOException; import java.util.Map; | import com.microsoft.rest.*; import java.io.*; import java.util.*; | [
"com.microsoft.rest",
"java.io",
"java.util"
] | com.microsoft.rest; java.io; java.util; | 2,032,406 |
@Override
public Repository getRepository() {
return repository;
} | Repository function() { return repository; } | /**
* Gets the repository.
*
* @return the repository
*/ | Gets the repository | getRepository | {
"repo_name": "tkafalas/pentaho-kettle",
"path": "engine/src/main/java/org/pentaho/di/base/AbstractMeta.java",
"license": "apache-2.0",
"size": 57127
} | [
"org.pentaho.di.repository.Repository"
] | import org.pentaho.di.repository.Repository; | import org.pentaho.di.repository.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 1,751,208 |
@Nullable
public OnenoteEntityBaseModel patch(@Nonnull final OnenoteEntityBaseModel sourceOnenoteEntityBaseModel) throws ClientException {
return send(HttpMethod.PATCH, sourceOnenoteEntityBaseModel);
} | OnenoteEntityBaseModel function(@Nonnull final OnenoteEntityBaseModel sourceOnenoteEntityBaseModel) throws ClientException { return send(HttpMethod.PATCH, sourceOnenoteEntityBaseModel); } | /**
* Patches this OnenoteEntityBaseModel with a source
*
* @param sourceOnenoteEntityBaseModel the source object with updates
* @return the updated OnenoteEntityBaseModel
* @throws ClientException this exception occurs if the request was unable to complete for any reason
*/ | Patches this OnenoteEntityBaseModel with a source | patch | {
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/OnenoteEntityBaseModelRequest.java",
"license": "mit",
"size": 6990
} | [
"com.microsoft.graph.core.ClientException",
"com.microsoft.graph.http.HttpMethod",
"com.microsoft.graph.models.OnenoteEntityBaseModel",
"javax.annotation.Nonnull"
] | import com.microsoft.graph.core.ClientException; import com.microsoft.graph.http.HttpMethod; import com.microsoft.graph.models.OnenoteEntityBaseModel; import javax.annotation.Nonnull; | import com.microsoft.graph.core.*; import com.microsoft.graph.http.*; import com.microsoft.graph.models.*; import javax.annotation.*; | [
"com.microsoft.graph",
"javax.annotation"
] | com.microsoft.graph; javax.annotation; | 724,051 |
protected static String getFirstName(String name) {
String first = new String(name);
StringTokenizer tokenizer = new StringTokenizer(first, "_");
if (tokenizer.hasMoreTokens()) {
first = tokenizer.nextToken();
}
return first;
} | static String function(String name) { String first = new String(name); StringTokenizer tokenizer = new StringTokenizer(first, "_"); if (tokenizer.hasMoreTokens()) { first = tokenizer.nextToken(); } return first; } | /**
* Gets the first name.
*
* @param name the name
* @return the first name
*/ | Gets the first name | getFirstName | {
"repo_name": "Adirockzz95/GenderDetect",
"path": "src/src/fr/lium/experimental/spkDiarization/programs/SpeakerIdenificationDecision5.java",
"license": "gpl-3.0",
"size": 40631
} | [
"java.util.StringTokenizer"
] | import java.util.StringTokenizer; | import java.util.*; | [
"java.util"
] | java.util; | 1,867,515 |
@Variability(id = AnnotationConstants.VAR_MEMORY_DATA)
private static native void recordUnallocation0(Object allocated, long size,
String recId);
| @Variability(id = AnnotationConstants.VAR_MEMORY_DATA) static native void function(Object allocated, long size, String recId); | /**
* Records the data about the unallocation of an object. [SPASS-meter]
*
* @param allocated the allocated object
* @param size the size of the allocation (if called again this is treated
* as an increment/decrement)
* @param recId an identifier to assign the <code>size</code> to upon
* unallocation
*
* @since 1.00
*/ | Records the data about the unallocation of an object. [SPASS-meter] | recordUnallocation0 | {
"repo_name": "SSEHUB/spassMeter",
"path": "gearsBridgeAndroid/src/de/uni_hildesheim/sse/system/android/MemoryDataGatherer.java",
"license": "apache-2.0",
"size": 8656
} | [
"de.uni_hildesheim.sse.codeEraser.annotations.Variability",
"de.uni_hildesheim.sse.system.AnnotationConstants"
] | import de.uni_hildesheim.sse.codeEraser.annotations.Variability; import de.uni_hildesheim.sse.system.AnnotationConstants; | import de.uni_hildesheim.sse.*; import de.uni_hildesheim.sse.system.*; | [
"de.uni_hildesheim.sse"
] | de.uni_hildesheim.sse; | 2,671,183 |
@Override
public void assertTitleEquals(String title) {
super.assertTitleEquals(title + " [custom]");
}
}
| void function(String title) { super.assertTitleEquals(title + STR); } } | /**
* We extend the normal method to not fail for our special case.
*
* @see net.sourceforge.jwebunit.junit.WebTester#assertTitleEquals(java.lang.String)
*/ | We extend the normal method to not fail for our special case | assertTitleEquals | {
"repo_name": "omarmohsen/JWebUnit",
"path": "jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/CustomTesterTest.java",
"license": "gpl-3.0",
"size": 2324
} | [
"net.sourceforge.jwebunit.junit.JWebUnit"
] | import net.sourceforge.jwebunit.junit.JWebUnit; | import net.sourceforge.jwebunit.junit.*; | [
"net.sourceforge.jwebunit"
] | net.sourceforge.jwebunit; | 1,084,615 |
public static boolean IsSuccessful(BasicResult result) {
if(result == null || result.result == 1)
return false;
return true;
} | static boolean function(BasicResult result) { if(result == null result.result == 1) return false; return true; } | /**
* Checks if a response from Cryptolens is successful.
* @param result The response from an API call. All responses inherit from BasicResult.
* @return True if the response is successful and false otherwise.
*/ | Checks if a response from Cryptolens is successful | IsSuccessful | {
"repo_name": "SerialKeyManager/SKGL-Extension-for-Java",
"path": "src/main/java/io/cryptolens/methods/Helpers.java",
"license": "bsd-3-clause",
"size": 17816
} | [
"io.cryptolens.internal.BasicResult"
] | import io.cryptolens.internal.BasicResult; | import io.cryptolens.internal.*; | [
"io.cryptolens.internal"
] | io.cryptolens.internal; | 2,532,503 |
private static boolean isCommentForMultiblock(DetailAST endBlockStmt) {
final DetailAST nextBlock = endBlockStmt.getParent().getNextSibling();
final int endBlockLineNo = endBlockStmt.getLineNo();
final DetailAST catchAst = endBlockStmt.getParent().getParent();
final DetailAST finallyAst = catchAst.getNextSibling();
return nextBlock != null && nextBlock.getLineNo() == endBlockLineNo
|| finallyAst != null
&& catchAst.getType() == TokenTypes.LITERAL_CATCH
&& finallyAst.getLineNo() == endBlockLineNo;
}
/**
* Handles a comment which is placed within the empty code block.
* Note, if comment is placed at the end of the empty code block, we have Checkstyle's
* limitations to clearly detect user intention of explanation target - above or below. The
* only case we can assume as a violation is when a single line comment within the empty
* code block has indentation level that is lower than the indentation level of the closing
* right curly brace. For example:
* <p>
* {@code
* if (a == true) {
* // violation
* }
* } | static boolean function(DetailAST endBlockStmt) { final DetailAST nextBlock = endBlockStmt.getParent().getNextSibling(); final int endBlockLineNo = endBlockStmt.getLineNo(); final DetailAST catchAst = endBlockStmt.getParent().getParent(); final DetailAST finallyAst = catchAst.getNextSibling(); return nextBlock != null && nextBlock.getLineNo() == endBlockLineNo finallyAst != null && catchAst.getType() == TokenTypes.LITERAL_CATCH && finallyAst.getLineNo() == endBlockLineNo; } /** * Handles a comment which is placed within the empty code block. * Note, if comment is placed at the end of the empty code block, we have Checkstyle's * limitations to clearly detect user intention of explanation target - above or below. The * only case we can assume as a violation is when a single line comment within the empty * code block has indentation level that is lower than the indentation level of the closing * right curly brace. For example: * <p> * { * if (a == true) { * * } * } | /**
* Whether the comment might have been used for the next block in a multi-block structure.
* @param endBlockStmt the end of the current block.
* @return true, if the comment might have been used for the next
* block in a multi-block structure.
*/ | Whether the comment might have been used for the next block in a multi-block structure | isCommentForMultiblock | {
"repo_name": "AkshitaKukreja30/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheck.java",
"license": "lgpl-2.1",
"size": 37409
} | [
"com.puppycrawl.tools.checkstyle.api.DetailAST",
"com.puppycrawl.tools.checkstyle.api.TokenTypes"
] | import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; | import com.puppycrawl.tools.checkstyle.api.*; | [
"com.puppycrawl.tools"
] | com.puppycrawl.tools; | 466,840 |
@Test
public void test41898() throws IOException {
HWPFDocument doc = HWPFTestDataSamples.openSampleFile("Bug41898.doc");
List<Picture> pics = doc.getPicturesTable().getAllPictures();
assertNotNull(pics);
assertEquals(1, pics.size());
Picture pic = pics.get(0);
assertNotNull(pic.suggestFileExtension());
assertNotNull(pic.suggestFullFileName());
assertNotNull(pic.getContent());
assertNotNull(pic.getRawContent());
final Collection<OfficeDrawing> officeDrawings = doc
.getOfficeDrawingsMain().getOfficeDrawings();
assertNotNull(officeDrawings);
assertEquals(1, officeDrawings.size());
OfficeDrawing officeDrawing = officeDrawings.iterator().next();
assertNotNull(officeDrawing);
assertEquals(1044, officeDrawing.getShapeId());
doc.close();
} | void function() throws IOException { HWPFDocument doc = HWPFTestDataSamples.openSampleFile(STR); List<Picture> pics = doc.getPicturesTable().getAllPictures(); assertNotNull(pics); assertEquals(1, pics.size()); Picture pic = pics.get(0); assertNotNull(pic.suggestFileExtension()); assertNotNull(pic.suggestFullFileName()); assertNotNull(pic.getContent()); assertNotNull(pic.getRawContent()); final Collection<OfficeDrawing> officeDrawings = doc .getOfficeDrawingsMain().getOfficeDrawings(); assertNotNull(officeDrawings); assertEquals(1, officeDrawings.size()); OfficeDrawing officeDrawing = officeDrawings.iterator().next(); assertNotNull(officeDrawing); assertEquals(1044, officeDrawing.getShapeId()); doc.close(); } | /**
* [RESOLVED INVALID] 41898 - Word 2003 pictures cannot be extracted
*/ | [RESOLVED INVALID] 41898 - Word 2003 pictures cannot be extracted | test41898 | {
"repo_name": "lvweiwolf/poi-3.16",
"path": "src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java",
"license": "apache-2.0",
"size": 32764
} | [
"java.io.IOException",
"java.util.Collection",
"java.util.List",
"org.apache.poi.hwpf.HWPFDocument",
"org.apache.poi.hwpf.HWPFTestDataSamples",
"org.junit.Assert"
] | import java.io.IOException; import java.util.Collection; import java.util.List; import org.apache.poi.hwpf.HWPFDocument; import org.apache.poi.hwpf.HWPFTestDataSamples; import org.junit.Assert; | import java.io.*; import java.util.*; import org.apache.poi.hwpf.*; import org.junit.*; | [
"java.io",
"java.util",
"org.apache.poi",
"org.junit"
] | java.io; java.util; org.apache.poi; org.junit; | 2,532,023 |
private void validateNewLinePosion(DetailAST brace, DetailAST startToken,
String braceLine) {
// not on the same line
if (startToken.getLineNo() + 1 == brace.getLineNo()) {
if (!Utils.whitespaceBefore(brace.getColumnNo(), braceLine)) {
log(brace, MSG_KEY_LINE_NEW, "{", brace.getColumnNo() + 1);
}
else {
log(brace, MSG_KEY_LINE_PREVIOUS, "{", brace.getColumnNo() + 1);
}
}
else if (!Utils.whitespaceBefore(brace.getColumnNo(), braceLine)) {
log(brace, MSG_KEY_LINE_NEW, "{", brace.getColumnNo() + 1);
}
} | void function(DetailAST brace, DetailAST startToken, String braceLine) { if (startToken.getLineNo() + 1 == brace.getLineNo()) { if (!Utils.whitespaceBefore(brace.getColumnNo(), braceLine)) { log(brace, MSG_KEY_LINE_NEW, "{", brace.getColumnNo() + 1); } else { log(brace, MSG_KEY_LINE_PREVIOUS, "{", brace.getColumnNo() + 1); } } else if (!Utils.whitespaceBefore(brace.getColumnNo(), braceLine)) { log(brace, MSG_KEY_LINE_NEW, "{", brace.getColumnNo() + 1); } } | /**
* Validate token on new Line position
* @param brace brace AST
* @param startToken start Token
* @param braceLine content of line with Brace
*/ | Validate token on new Line position | validateNewLinePosion | {
"repo_name": "universsky/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyCheck.java",
"license": "lgpl-2.1",
"size": 13186
} | [
"com.puppycrawl.tools.checkstyle.Utils",
"com.puppycrawl.tools.checkstyle.api.DetailAST"
] | import com.puppycrawl.tools.checkstyle.Utils; import com.puppycrawl.tools.checkstyle.api.DetailAST; | import com.puppycrawl.tools.checkstyle.*; import com.puppycrawl.tools.checkstyle.api.*; | [
"com.puppycrawl.tools"
] | com.puppycrawl.tools; | 1,242,840 |
private float getValue(Matrix matrix, int whichValue) {
matrix.getValues(mMatrixValues);
return mMatrixValues[whichValue];
} | float function(Matrix matrix, int whichValue) { matrix.getValues(mMatrixValues); return mMatrixValues[whichValue]; } | /**
* Helper method that 'unpacks' a Matrix and returns the required value
*
* @param matrix
* - Matrix to unpack
* @param whichValue
* - Which value from Matrix.M* to return
* @return float - returned value
*/ | Helper method that 'unpacks' a Matrix and returns the required value | getValue | {
"repo_name": "pranavlathigara/school_shop",
"path": "app/src/main/java/com/siso/app/chat/widget/photoview/PhotoViewAttacher.java",
"license": "mit",
"size": 27627
} | [
"android.graphics.Matrix"
] | import android.graphics.Matrix; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 2,116,330 |
private SharedPreferences getPreferences() {
return PreferenceManager
.getDefaultSharedPreferences(getApplicationContext());
} | SharedPreferences function() { return PreferenceManager .getDefaultSharedPreferences(getApplicationContext()); } | /**
* load app preferences
*
* @return app preferences
*/ | load app preferences | getPreferences | {
"repo_name": "z7z8th/yaacc",
"path": "yaacc/src/de/yaacc/browser/ServerListActivity.java",
"license": "gpl-3.0",
"size": 4430
} | [
"android.content.SharedPreferences",
"android.preference.PreferenceManager"
] | import android.content.SharedPreferences; import android.preference.PreferenceManager; | import android.content.*; import android.preference.*; | [
"android.content",
"android.preference"
] | android.content; android.preference; | 718,853 |
Set<RestRequest.Method> getValidMethods() {
return methodHandlers.keySet();
} | Set<RestRequest.Method> getValidMethods() { return methodHandlers.keySet(); } | /**
* Return a set of all valid HTTP methods for the particular path
*/ | Return a set of all valid HTTP methods for the particular path | getValidMethods | {
"repo_name": "GlenRSmith/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/rest/MethodHandlers.java",
"license": "apache-2.0",
"size": 3158
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,628,586 |
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(preferenceMenuItem)) {
SparkManager.getPreferenceManager().showPreferences();
}
}
| void function(ActionEvent e) { if (e.getSource().equals(preferenceMenuItem)) { SparkManager.getPreferenceManager().showPreferences(); } } | /**
* Invokes the Preferences Dialog.
*
* @param e the ActionEvent
*/ | Invokes the Preferences Dialog | actionPerformed | {
"repo_name": "joshuairl/toothchat-client",
"path": "src/java/org/jivesoftware/MainWindow.java",
"license": "apache-2.0",
"size": 28218
} | [
"java.awt.event.ActionEvent",
"org.jivesoftware.spark.SparkManager"
] | import java.awt.event.ActionEvent; import org.jivesoftware.spark.SparkManager; | import java.awt.event.*; import org.jivesoftware.spark.*; | [
"java.awt",
"org.jivesoftware.spark"
] | java.awt; org.jivesoftware.spark; | 2,655,755 |
protected void stopThread(final Thread thread, final long timeout) {
if (thread != null) {
try {
if (timeout == 0) {
thread.join();
} else {
final long timeToWait = timeout + STOP_TIMEOUT_ADDITION;
final long startTime = System.currentTimeMillis();
thread.join(timeToWait);
if (!(System.currentTimeMillis() < startTime + timeToWait)) {
final String msg = "The stop timeout of " + timeout + " ms was exceeded";
caught = new ExecuteException(msg, Executor.INVALID_EXITVALUE);
}
}
} catch (final InterruptedException e) {
thread.interrupt();
}
}
} | void function(final Thread thread, final long timeout) { if (thread != null) { try { if (timeout == 0) { thread.join(); } else { final long timeToWait = timeout + STOP_TIMEOUT_ADDITION; final long startTime = System.currentTimeMillis(); thread.join(timeToWait); if (!(System.currentTimeMillis() < startTime + timeToWait)) { final String msg = STR + timeout + STR; caught = new ExecuteException(msg, Executor.INVALID_EXITVALUE); } } } catch (final InterruptedException e) { thread.interrupt(); } } } | /**
* Stopping a pumper thread. The implementation actually waits
* longer than specified in 'timeout' to detect if the timeout
* was indeed exceeded. If the timeout was exceeded an IOException
* is created to be thrown to the caller.
*
* @param thread the thread to be stopped
* @param timeout the time in ms to wait to join
*/ | Stopping a pumper thread. The implementation actually waits longer than specified in 'timeout' to detect if the timeout was indeed exceeded. If the timeout was exceeded an IOException is created to be thrown to the caller | stopThread | {
"repo_name": "ykyang/allnix",
"path": "core/src/main/java/org/allnix/core/LineStreamHandler.java",
"license": "apache-2.0",
"size": 4693
} | [
"org.apache.commons.exec.ExecuteException",
"org.apache.commons.exec.Executor"
] | import org.apache.commons.exec.ExecuteException; import org.apache.commons.exec.Executor; | import org.apache.commons.exec.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,552,328 |
public void removeFromList(String field, String oID){
String mapped = map(field);
String[] m = mapped.split(":");
int numberOfAffectedRows = 0;
DBConnection dbConnection = getDBConnection();
if (mapped.startsWith("JOINT:")) {
//m: m[1] FremdID, m[2] eigene ID, m[3] table
if (m.length > 3) {
StringBuilder sql = new StringBuilder(200);
sql.append("DELETE FROM ").append(m[3]).append(" WHERE ").append(m[2]).append("=")
.append(getWrappedId()).append(" AND ").append(m[1]).append("=")
.append(JdbcLink.wrap(oID));
if (dbConnection.isTrace()) {
String sq = sql.toString();
dbConnection.doTrace(sq);
}
numberOfAffectedRows = dbConnection.exec(sql.toString());
}
} else if (mapped.startsWith("LIST:")) {
//m: m[1] FremdID, m[2] table
if (m.length > 2) {
PreparedStatement ps = null;
try {
String psString = "DELETE FROM " + m[2] + " WHERE " + m[1] + "= ? AND ID = ?;";
ps = dbConnection.getPreparedStatement(psString);
ps.setString(1, getId());
ps.setString(2, oID);
numberOfAffectedRows = ps.executeUpdate();
} catch (SQLException e) {
log.error("Error executing prepared statement.", e);
} finally {
dbConnection.releasePreparedStatement(ps);
}
}
} else {
log.error("Fehlerhaftes Mapping: " + mapped);
}
if (numberOfAffectedRows > 0) {
refreshLastUpdateAndSendUpdateEvent(field);
}
}
| void function(String field, String oID){ String mapped = map(field); String[] m = mapped.split(":"); int numberOfAffectedRows = 0; DBConnection dbConnection = getDBConnection(); if (mapped.startsWith(STR)) { if (m.length > 3) { StringBuilder sql = new StringBuilder(200); sql.append(STR).append(m[3]).append(STR).append(m[2]).append("=") .append(getWrappedId()).append(STR).append(m[1]).append("=") .append(JdbcLink.wrap(oID)); if (dbConnection.isTrace()) { String sq = sql.toString(); dbConnection.doTrace(sq); } numberOfAffectedRows = dbConnection.exec(sql.toString()); } } else if (mapped.startsWith("LIST:")) { if (m.length > 2) { PreparedStatement ps = null; try { String psString = STR + m[2] + STR + m[1] + STR; ps = dbConnection.getPreparedStatement(psString); ps.setString(1, getId()); ps.setString(2, oID); numberOfAffectedRows = ps.executeUpdate(); } catch (SQLException e) { log.error(STR, e); } finally { dbConnection.releasePreparedStatement(ps); } } } else { log.error(STR + mapped); } if (numberOfAffectedRows > 0) { refreshLastUpdateAndSendUpdateEvent(field); } } | /**
* Remove a relation to this object from link
*
* @param field
* @param oID
*/ | Remove a relation to this object from link | removeFromList | {
"repo_name": "sazgin/elexis-3-core",
"path": "ch.elexis.core.data/src/ch/elexis/data/PersistentObject.java",
"license": "epl-1.0",
"size": 101634
} | [
"ch.rgw.tools.JdbcLink",
"java.sql.PreparedStatement",
"java.sql.SQLException"
] | import ch.rgw.tools.JdbcLink; import java.sql.PreparedStatement; import java.sql.SQLException; | import ch.rgw.tools.*; import java.sql.*; | [
"ch.rgw.tools",
"java.sql"
] | ch.rgw.tools; java.sql; | 2,272,807 |
public void addListener(TriggerListener listener) {
if (this.listenerChain.indexOf(listener) == -1) {
this.listenerChain.add(listener);
}
} | void function(TriggerListener listener) { if (this.listenerChain.indexOf(listener) == -1) { this.listenerChain.add(listener); } } | /**
* Adds a new listener to the listener chain
* @param listener listener to be added
*/ | Adds a new listener to the listener chain | addListener | {
"repo_name": "ogajduse/spacewalk",
"path": "java/code/src/com/redhat/rhn/taskomatic/core/ChainedListener.java",
"license": "gpl-2.0",
"size": 3049
} | [
"org.quartz.TriggerListener"
] | import org.quartz.TriggerListener; | import org.quartz.*; | [
"org.quartz"
] | org.quartz; | 1,843,735 |
EList<Member> getMembers(); | EList<Member> getMembers(); | /**
* Returns the value of the '<em><b>Members</b></em>' containment reference list.
* The list contents are of type {@link nl.sison.dsl.mobgen.jsonGen.Member}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Members</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Members</em>' containment reference list.
* @see nl.sison.dsl.mobgen.jsonGen.JsonGenPackage#getJsonObject_Members()
* @model containment="true"
* @generated
*/ | Returns the value of the 'Members' containment reference list. The list contents are of type <code>nl.sison.dsl.mobgen.jsonGen.Member</code>. If the meaning of the 'Members' containment reference list isn't clear, there really should be more of a description here... | getMembers | {
"repo_name": "Buggaboo/xplatform",
"path": "nl.sison.dsl.mobgen.JsonGen/src-gen/nl/sison/dsl/mobgen/jsonGen/JsonObject.java",
"license": "gpl-2.0",
"size": 1206
} | [
"org.eclipse.emf.common.util.EList"
] | import org.eclipse.emf.common.util.EList; | import org.eclipse.emf.common.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,710,339 |
public static List<Scope> getAllowedScopesForUserApplication(String username, Set<Scope> reqScopeSet) {
String[] userRoles = null;
List<Scope> authorizedScopes = new ArrayList<Scope>();
List<String> userRoleList = null;
try {
userRoles = getListOfRoles(username);
} catch (APIManagementException e) {
log.error("Error while getting the roles for user", e);
}
if (userRoles != null && userRoles.length > 0) {
userRoleList = new ArrayList<String>(Arrays.asList(userRoles));
} else {
log.error("No user roles were defined for " + username + "!");
}
// Iterate the requested scopes list.
for (Scope scope : reqScopeSet) {
// Get the set of roles associated with the requested scope.
String roles = scope.getRoles();
// If the scope has been defined in the context of the App and if roles have been defined for the scope
if (roles != null && roles.length() != 0) {
List<String> roleList = new ArrayList<String>(Arrays.asList(roles.replaceAll(" ", "").split(",")));
//Check if user has at least one of the roles associated with the scope
roleList.retainAll(userRoleList);
if (!roleList.isEmpty()) {
authorizedScopes.add(scope);
}
}
}
return authorizedScopes;
} | static List<Scope> function(String username, Set<Scope> reqScopeSet) { String[] userRoles = null; List<Scope> authorizedScopes = new ArrayList<Scope>(); List<String> userRoleList = null; try { userRoles = getListOfRoles(username); } catch (APIManagementException e) { log.error(STR, e); } if (userRoles != null && userRoles.length > 0) { userRoleList = new ArrayList<String>(Arrays.asList(userRoles)); } else { log.error(STR + username + "!"); } for (Scope scope : reqScopeSet) { String roles = scope.getRoles(); if (roles != null && roles.length() != 0) { List<String> roleList = new ArrayList<String>(Arrays.asList(roles.replaceAll(" ", STR,"))); roleList.retainAll(userRoleList); if (!roleList.isEmpty()) { authorizedScopes.add(scope); } } } return authorizedScopes; } | /**
* This method returns the allowed scopes for user application.
*
* @param username
* @param reqScopeSet
* @return authorizedScopes
*/ | This method returns the allowed scopes for user application | getAllowedScopesForUserApplication | {
"repo_name": "susinda/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java",
"license": "apache-2.0",
"size": 251683
} | [
"java.util.ArrayList",
"java.util.Arrays",
"java.util.List",
"java.util.Set",
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.api.model.Scope"
] | import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Set; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.Scope; | import java.util.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; | [
"java.util",
"org.wso2.carbon"
] | java.util; org.wso2.carbon; | 1,327,107 |
public IBlockState getStateFromMeta(int meta) {
return this.getDefaultState().withProperty(AGE, Integer.valueOf(meta));
} | IBlockState function(int meta) { return this.getDefaultState().withProperty(AGE, Integer.valueOf(meta)); } | /**
* Convert the given metadata into a BlockState for this Block
*/ | Convert the given metadata into a BlockState for this Block | getStateFromMeta | {
"repo_name": "SkidJava/BaseClient",
"path": "lucid_1.8.8/net/minecraft/block/BlockReed.java",
"license": "gpl-2.0",
"size": 4160
} | [
"net.minecraft.block.state.IBlockState"
] | import net.minecraft.block.state.IBlockState; | import net.minecraft.block.state.*; | [
"net.minecraft.block"
] | net.minecraft.block; | 2,329,533 |
private void flushSingleValue() {
cacheOverflowCntr.incrementAndGet();
try {
Map<K, StatefulValue<K, V>> batch;
for (Map.Entry<K, StatefulValue<K, V>> e : writeCache.entrySet()) {
StatefulValue<K, V> val = e.getValue();
val.writeLock().lock();
try {
ValueStatus status = val.status();
if (acquired(status))
// Another thread is helping us, continue to the next entry.
continue;
if (val.status() == ValueStatus.RETRY)
retryEntriesCnt.decrementAndGet();
assert retryEntriesCnt.get() >= 0;
val.status(ValueStatus.PENDING);
batch = Collections.singletonMap(e.getKey(), val);
}
finally {
val.writeLock().unlock();
}
if (!batch.isEmpty()) {
applyBatch(batch, false, null);
cacheTotalOverflowCntr.incrementAndGet();
return;
}
}
}
finally {
cacheOverflowCntr.decrementAndGet();
}
} | void function() { cacheOverflowCntr.incrementAndGet(); try { Map<K, StatefulValue<K, V>> batch; for (Map.Entry<K, StatefulValue<K, V>> e : writeCache.entrySet()) { StatefulValue<K, V> val = e.getValue(); val.writeLock().lock(); try { ValueStatus status = val.status(); if (acquired(status)) continue; if (val.status() == ValueStatus.RETRY) retryEntriesCnt.decrementAndGet(); assert retryEntriesCnt.get() >= 0; val.status(ValueStatus.PENDING); batch = Collections.singletonMap(e.getKey(), val); } finally { val.writeLock().unlock(); } if (!batch.isEmpty()) { applyBatch(batch, false, null); cacheTotalOverflowCntr.incrementAndGet(); return; } } } finally { cacheOverflowCntr.decrementAndGet(); } } | /**
* Flushes one upcoming value to the underlying store. Called from
* {@link #updateCache(Object, Entry, StoreOperation)} method in case when current map size exceeds
* critical size.
*/ | Flushes one upcoming value to the underlying store. Called from <code>#updateCache(Object, Entry, StoreOperation)</code> method in case when current map size exceeds critical size | flushSingleValue | {
"repo_name": "ntikhonov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheWriteBehindStore.java",
"license": "apache-2.0",
"size": 48298
} | [
"java.util.Collections",
"java.util.Map",
"javax.cache.Cache"
] | import java.util.Collections; import java.util.Map; import javax.cache.Cache; | import java.util.*; import javax.cache.*; | [
"java.util",
"javax.cache"
] | java.util; javax.cache; | 1,008,089 |
private void readInputFiles(StringTokenizer line){
String new_line = line.nextToken(); //We read the input data line
StringTokenizer data = new StringTokenizer(new_line, " = \" ");
data.nextToken(); //inputFile
trainingFile = data.nextToken();
validationFile = data.nextToken();
testFile = data.nextToken();
while(data.hasMoreTokens()){
inputFiles.add(data.nextToken());
}
} | void function(StringTokenizer line){ String new_line = line.nextToken(); StringTokenizer data = new StringTokenizer(new_line, STR "); data.nextToken(); trainingFile = data.nextToken(); validationFile = data.nextToken(); testFile = data.nextToken(); while(data.hasMoreTokens()){ inputFiles.add(data.nextToken()); } } | /**
* <p>
* We read the input data-set files and all the possible input files
* @param line StringTokenizer It is the line containing the input files.
* </p>
*/ | We read the input data-set files and all the possible input files | readInputFiles | {
"repo_name": "adofsauron/KEEL",
"path": "src/keel/Algorithms/Fuzzy_Rule_Learning/Genetic/ClassifierSLAVE/parseParameters.java",
"license": "gpl-3.0",
"size": 9229
} | [
"java.util.StringTokenizer"
] | import java.util.StringTokenizer; | import java.util.*; | [
"java.util"
] | java.util; | 2,722,147 |
public static final PolynomialFunctionMatrix buildZeroMatrix4() {
final PolynomialFunctionMatrix matrix = new PolynomialFunctionMatrix(4);
matrix.setMatrix(new PolynomialFunction[][] {
{
ZERO, ZERO, ZERO, ZERO
},
{
ZERO, ZERO, ZERO, ZERO
},
{
ZERO, ZERO, ZERO, ZERO
},
{
ZERO, ZERO, ZERO, ZERO
}
} );
return matrix;
} | static final PolynomialFunctionMatrix function() { final PolynomialFunctionMatrix matrix = new PolynomialFunctionMatrix(4); matrix.setMatrix(new PolynomialFunction[][] { { ZERO, ZERO, ZERO, ZERO }, { ZERO, ZERO, ZERO, ZERO }, { ZERO, ZERO, ZERO, ZERO }, { ZERO, ZERO, ZERO, ZERO } } ); return matrix; } | /**
* Build the empty matrix of order 4.
* <p>
* <pre>
* / 0 0 0 0 \
* | |
* | 0 0 0 0 |
* E<sub>4</sub> = | |
* | 0 0 0 0 |
* | |
* \ 0 0 0 0 /
* </pre>
*
* @return the identity matrix of order 4
*/ | Build the empty matrix of order 4. <code> 0 0 0 0 \ | | | 0 0 0 0 | E4 = | | | 0 0 0 0 | | | \ 0 0 0 0 </code> | buildZeroMatrix4 | {
"repo_name": "treeform/orekit",
"path": "src/main/java/org/orekit/propagation/semianalytical/dsst/utilities/hansen/HansenUtilities.java",
"license": "apache-2.0",
"size": 4586
} | [
"org.apache.commons.math3.analysis.polynomials.PolynomialFunction"
] | import org.apache.commons.math3.analysis.polynomials.PolynomialFunction; | import org.apache.commons.math3.analysis.polynomials.*; | [
"org.apache.commons"
] | org.apache.commons; | 386,551 |
public Rectangle getDividerBounds() {
if (lastSelected != null) {
// System.err.println("Bounds" + lastSelected.childNodeA.location +
// lastSelected.childNodeB.location + lastSelected.location);
return lastSelected.location;
}
return null;
}
| Rectangle function() { if (lastSelected != null) { return lastSelected.location; } return null; } | /**
* (SplitPanel specific) returns the rectangle that the divider can be moved in
*/ | (SplitPanel specific) returns the rectangle that the divider can be moved in | getDividerBounds | {
"repo_name": "debrief/debrief",
"path": "org.mwc.cmap.legacy/src/MWC/GUI/SplitPanel/PaneLayout.java",
"license": "epl-1.0",
"size": 34854
} | [
"java.awt.Rectangle"
] | import java.awt.Rectangle; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,528,829 |
void init(Set<ValueSpecification> values, long timeout, TimeUnit unit); | void init(Set<ValueSpecification> values, long timeout, TimeUnit unit); | /**
* Performs the snapshot, and attempts to ensure that the required values are present. Waits no longer than the timeout which, if exceeded,
* will not cause the operation to fail but implies that one or more required values will be missing.
*
* @param values the values required in the snapshot, not null
* @param timeout the maximum time to wait for the required values. If less than or equal to zero, the effect is not to wait at all.
* @param unit the timeout unit, not null
*/ | Performs the snapshot, and attempts to ensure that the required values are present. Waits no longer than the timeout which, if exceeded, will not cause the operation to fail but implies that one or more required values will be missing | init | {
"repo_name": "McLeodMoores/starling",
"path": "projects/engine/src/main/java/com/opengamma/engine/marketdata/MarketDataSnapshot.java",
"license": "apache-2.0",
"size": 4010
} | [
"com.opengamma.engine.value.ValueSpecification",
"java.util.Set",
"java.util.concurrent.TimeUnit"
] | import com.opengamma.engine.value.ValueSpecification; import java.util.Set; import java.util.concurrent.TimeUnit; | import com.opengamma.engine.value.*; import java.util.*; import java.util.concurrent.*; | [
"com.opengamma.engine",
"java.util"
] | com.opengamma.engine; java.util; | 2,736,456 |
protected void runSQL(String sql) throws SystemException {
try {
DataSource dataSource = current_state_trendPersistence.getDataSource();
SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
sql, new int[0]);
sqlUpdate.update();
}
catch (Exception e) {
throw new SystemException(e);
}
}
@BeanReference(type = active_conservation_projectsLocalService.class)
protected active_conservation_projectsLocalService active_conservation_projectsLocalService;
@BeanReference(type = active_conservation_projectsPersistence.class)
protected active_conservation_projectsPersistence active_conservation_projectsPersistence;
@BeanReference(type = advance_query_assessmentLocalService.class)
protected advance_query_assessmentLocalService advance_query_assessmentLocalService;
@BeanReference(type = advance_query_assessmentPersistence.class)
protected advance_query_assessmentPersistence advance_query_assessmentPersistence;
@BeanReference(type = advance_query_siteLocalService.class)
protected advance_query_siteLocalService advance_query_siteLocalService;
@BeanReference(type = advance_query_sitePersistence.class)
protected advance_query_sitePersistence advance_query_sitePersistence;
@BeanReference(type = assessing_threats_currentLocalService.class)
protected assessing_threats_currentLocalService assessing_threats_currentLocalService;
@BeanReference(type = assessing_threats_currentPersistence.class)
protected assessing_threats_currentPersistence assessing_threats_currentPersistence;
@BeanReference(type = assessing_threats_potentialLocalService.class)
protected assessing_threats_potentialLocalService assessing_threats_potentialLocalService;
@BeanReference(type = assessing_threats_potentialPersistence.class)
protected assessing_threats_potentialPersistence assessing_threats_potentialPersistence;
@BeanReference(type = assessment_lang_lkpLocalService.class)
protected assessment_lang_lkpLocalService assessment_lang_lkpLocalService;
@BeanReference(type = assessment_lang_lkpPersistence.class)
protected assessment_lang_lkpPersistence assessment_lang_lkpPersistence;
@BeanReference(type = assessment_lang_versionLocalService.class)
protected assessment_lang_versionLocalService assessment_lang_versionLocalService;
@BeanReference(type = assessment_lang_versionPersistence.class)
protected assessment_lang_versionPersistence assessment_lang_versionPersistence;
@BeanReference(type = assessment_stagesLocalService.class)
protected assessment_stagesLocalService assessment_stagesLocalService;
@BeanReference(type = assessment_stagesPersistence.class)
protected assessment_stagesPersistence assessment_stagesPersistence;
@BeanReference(type = assessment_statusLocalService.class)
protected assessment_statusLocalService assessment_statusLocalService;
@BeanReference(type = assessment_statusPersistence.class)
protected assessment_statusPersistence assessment_statusPersistence;
@BeanReference(type = assessment_validationLocalService.class)
protected assessment_validationLocalService assessment_validationLocalService;
@BeanReference(type = assessment_validationPersistence.class)
protected assessment_validationPersistence assessment_validationPersistence;
@BeanReference(type = assessment_whvaluesLocalService.class)
protected assessment_whvaluesLocalService assessment_whvaluesLocalService;
@BeanReference(type = assessment_whvaluesPersistence.class)
protected assessment_whvaluesPersistence assessment_whvaluesPersistence;
@BeanReference(type = assessment_whvalues_whcriterionLocalService.class)
protected assessment_whvalues_whcriterionLocalService assessment_whvalues_whcriterionLocalService;
@BeanReference(type = assessment_whvalues_whcriterionPersistence.class)
protected assessment_whvalues_whcriterionPersistence assessment_whvalues_whcriterionPersistence;
@BeanReference(type = benefit_checksubtype_lkpLocalService.class)
protected benefit_checksubtype_lkpLocalService benefit_checksubtype_lkpLocalService;
@BeanReference(type = benefit_checksubtype_lkpPersistence.class)
protected benefit_checksubtype_lkpPersistence benefit_checksubtype_lkpPersistence;
@BeanReference(type = benefit_checktype_lkpLocalService.class)
protected benefit_checktype_lkpLocalService benefit_checktype_lkpLocalService;
@BeanReference(type = benefit_checktype_lkpPersistence.class)
protected benefit_checktype_lkpPersistence benefit_checktype_lkpPersistence;
@BeanReference(type = benefit_rating_lkpLocalService.class)
protected benefit_rating_lkpLocalService benefit_rating_lkpLocalService;
@BeanReference(type = benefit_rating_lkpPersistence.class)
protected benefit_rating_lkpPersistence benefit_rating_lkpPersistence;
@BeanReference(type = benefitsLocalService.class)
protected benefitsLocalService benefitsLocalService;
@BeanReference(type = benefitsPersistence.class)
protected benefitsPersistence benefitsPersistence;
@BeanReference(type = benefits_summaryLocalService.class)
protected benefits_summaryLocalService benefits_summaryLocalService;
@BeanReference(type = benefits_summaryPersistence.class)
protected benefits_summaryPersistence benefits_summaryPersistence;
@BeanReference(type = benefits_type_refLocalService.class)
protected benefits_type_refLocalService benefits_type_refLocalService;
@BeanReference(type = benefits_type_refPersistence.class)
protected benefits_type_refPersistence benefits_type_refPersistence;
@BeanReference(type = biodiversity_valuesLocalService.class)
protected biodiversity_valuesLocalService biodiversity_valuesLocalService;
@BeanReference(type = biodiversity_valuesPersistence.class)
protected biodiversity_valuesPersistence biodiversity_valuesPersistence;
@BeanReference(type = boundary_modification_type_lkpLocalService.class)
protected boundary_modification_type_lkpLocalService boundary_modification_type_lkpLocalService;
@BeanReference(type = boundary_modification_type_lkpPersistence.class)
protected boundary_modification_type_lkpPersistence boundary_modification_type_lkpPersistence;
@BeanReference(type = conservation_outlookLocalService.class)
protected conservation_outlookLocalService conservation_outlookLocalService;
@BeanReference(type = conservation_outlookPersistence.class)
protected conservation_outlookPersistence conservation_outlookPersistence;
@BeanReference(type = conservation_outlook_rating_lkpLocalService.class)
protected conservation_outlook_rating_lkpLocalService conservation_outlook_rating_lkpLocalService;
@BeanReference(type = conservation_outlook_rating_lkpPersistence.class)
protected conservation_outlook_rating_lkpPersistence conservation_outlook_rating_lkpPersistence;
@BeanReference(type = contact_categoryLocalService.class)
protected contact_categoryLocalService contact_categoryLocalService;
@BeanReference(type = contact_categoryPersistence.class)
protected contact_categoryPersistence contact_categoryPersistence;
@BeanReference(type = country_lkpLocalService.class)
protected country_lkpLocalService country_lkpLocalService;
@BeanReference(type = country_lkpPersistence.class)
protected country_lkpPersistence country_lkpPersistence;
@BeanReference(type = current_state_trendLocalService.class)
protected current_state_trendLocalService current_state_trendLocalService;
@BeanReference(type = current_state_trendPersistence.class)
protected current_state_trendPersistence current_state_trendPersistence;
@BeanReference(type = current_state_trend_valuesLocalService.class)
protected current_state_trend_valuesLocalService current_state_trend_valuesLocalService;
@BeanReference(type = current_state_trend_valuesPersistence.class)
protected current_state_trend_valuesPersistence current_state_trend_valuesPersistence;
@BeanReference(type = current_threat_assessment_catLocalService.class)
protected current_threat_assessment_catLocalService current_threat_assessment_catLocalService;
@BeanReference(type = current_threat_assessment_catPersistence.class)
protected current_threat_assessment_catPersistence current_threat_assessment_catPersistence;
@BeanReference(type = current_threat_valuesLocalService.class)
protected current_threat_valuesLocalService current_threat_valuesLocalService;
@BeanReference(type = current_threat_valuesPersistence.class)
protected current_threat_valuesPersistence current_threat_valuesPersistence;
@BeanReference(type = danger_list_status_lkpLocalService.class)
protected danger_list_status_lkpLocalService danger_list_status_lkpLocalService;
@BeanReference(type = danger_list_status_lkpPersistence.class)
protected danger_list_status_lkpPersistence danger_list_status_lkpPersistence;
@BeanReference(type = docs_customDataLocalService.class)
protected docs_customDataLocalService docs_customDataLocalService;
@BeanReference(type = docs_customDataPersistence.class)
protected docs_customDataPersistence docs_customDataPersistence;
@BeanReference(type = docs_customDataFinder.class)
protected docs_customDataFinder docs_customDataFinder;
@BeanReference(type = docs_sitedataLocalService.class)
protected docs_sitedataLocalService docs_sitedataLocalService;
@BeanReference(type = docs_sitedataPersistence.class)
protected docs_sitedataPersistence docs_sitedataPersistence;
@BeanReference(type = effective_prot_mgmt_iothreatsLocalService.class)
protected effective_prot_mgmt_iothreatsLocalService effective_prot_mgmt_iothreatsLocalService;
@BeanReference(type = effective_prot_mgmt_iothreatsPersistence.class)
protected effective_prot_mgmt_iothreatsPersistence effective_prot_mgmt_iothreatsPersistence;
@BeanReference(type = flagship_species_lkpLocalService.class)
protected flagship_species_lkpLocalService flagship_species_lkpLocalService;
@BeanReference(type = flagship_species_lkpPersistence.class)
protected flagship_species_lkpPersistence flagship_species_lkpPersistence;
@BeanReference(type = inscription_criteria_lkpLocalService.class)
protected inscription_criteria_lkpLocalService inscription_criteria_lkpLocalService;
@BeanReference(type = inscription_criteria_lkpPersistence.class)
protected inscription_criteria_lkpPersistence inscription_criteria_lkpPersistence;
@BeanReference(type = inscription_type_lkpLocalService.class)
protected inscription_type_lkpLocalService inscription_type_lkpLocalService;
@BeanReference(type = inscription_type_lkpPersistence.class)
protected inscription_type_lkpPersistence inscription_type_lkpPersistence;
@BeanReference(type = iucn_pa_lkp_categoryLocalService.class)
protected iucn_pa_lkp_categoryLocalService iucn_pa_lkp_categoryLocalService;
@BeanReference(type = iucn_pa_lkp_categoryPersistence.class)
protected iucn_pa_lkp_categoryPersistence iucn_pa_lkp_categoryPersistence;
@BeanReference(type = iucn_regionLocalService.class)
protected iucn_regionLocalService iucn_regionLocalService;
@BeanReference(type = iucn_regionPersistence.class)
protected iucn_regionPersistence iucn_regionPersistence;
@BeanReference(type = iucn_region_countryLocalService.class)
protected iucn_region_countryLocalService iucn_region_countryLocalService;
@BeanReference(type = iucn_region_countryPersistence.class)
protected iucn_region_countryPersistence iucn_region_countryPersistence;
@BeanReference(type = key_conservation_issuesLocalService.class)
protected key_conservation_issuesLocalService key_conservation_issuesLocalService;
@BeanReference(type = key_conservation_issuesPersistence.class)
protected key_conservation_issuesPersistence key_conservation_issuesPersistence;
@BeanReference(type = key_conservation_scale_lkpLocalService.class)
protected key_conservation_scale_lkpLocalService key_conservation_scale_lkpLocalService;
@BeanReference(type = key_conservation_scale_lkpPersistence.class)
protected key_conservation_scale_lkpPersistence key_conservation_scale_lkpPersistence;
@BeanReference(type = mission_lkpLocalService.class)
protected mission_lkpLocalService mission_lkpLocalService;
@BeanReference(type = mission_lkpPersistence.class)
protected mission_lkpPersistence mission_lkpPersistence;
@BeanReference(type = negative_factors_level_impactLocalService.class)
protected negative_factors_level_impactLocalService negative_factors_level_impactLocalService;
@BeanReference(type = negative_factors_level_impactPersistence.class)
protected negative_factors_level_impactPersistence negative_factors_level_impactPersistence;
@BeanReference(type = negative_factors_trendLocalService.class)
protected negative_factors_trendLocalService negative_factors_trendLocalService;
@BeanReference(type = negative_factors_trendPersistence.class)
protected negative_factors_trendPersistence negative_factors_trendPersistence;
@BeanReference(type = other_designation_lkpLocalService.class)
protected other_designation_lkpLocalService other_designation_lkpLocalService;
@BeanReference(type = other_designation_lkpPersistence.class)
protected other_designation_lkpPersistence other_designation_lkpPersistence;
@BeanReference(type = potential_project_needsLocalService.class)
protected potential_project_needsLocalService potential_project_needsLocalService;
@BeanReference(type = potential_project_needsPersistence.class)
protected potential_project_needsPersistence potential_project_needsPersistence;
@BeanReference(type = potential_threat_assessment_catLocalService.class)
protected potential_threat_assessment_catLocalService potential_threat_assessment_catLocalService;
@BeanReference(type = potential_threat_assessment_catPersistence.class)
protected potential_threat_assessment_catPersistence potential_threat_assessment_catPersistence;
@BeanReference(type = potential_threat_valuesLocalService.class)
protected potential_threat_valuesLocalService potential_threat_valuesLocalService;
@BeanReference(type = potential_threat_valuesPersistence.class)
protected potential_threat_valuesPersistence potential_threat_valuesPersistence;
@BeanReference(type = prot_mgmt_best_practicesLocalService.class)
protected prot_mgmt_best_practicesLocalService prot_mgmt_best_practicesLocalService;
@BeanReference(type = prot_mgmt_best_practicesPersistence.class)
protected prot_mgmt_best_practicesPersistence prot_mgmt_best_practicesPersistence;
@BeanReference(type = prot_mgmt_overallLocalService.class)
protected prot_mgmt_overallLocalService prot_mgmt_overallLocalService;
@BeanReference(type = prot_mgmt_overallPersistence.class)
protected prot_mgmt_overallPersistence prot_mgmt_overallPersistence;
@BeanReference(type = protection_managementLocalService.class)
protected protection_managementLocalService protection_managementLocalService;
@BeanReference(type = protection_managementPersistence.class)
protected protection_managementPersistence protection_managementPersistence;
@BeanReference(type = protection_management_ratings_lkpLocalService.class)
protected protection_management_ratings_lkpLocalService protection_management_ratings_lkpLocalService;
@BeanReference(type = protection_management_ratings_lkpPersistence.class)
protected protection_management_ratings_lkpPersistence protection_management_ratings_lkpPersistence;
@BeanReference(type = protection_mgmt_checklist_lkpLocalService.class)
protected protection_mgmt_checklist_lkpLocalService protection_mgmt_checklist_lkpLocalService;
@BeanReference(type = protection_mgmt_checklist_lkpPersistence.class)
protected protection_mgmt_checklist_lkpPersistence protection_mgmt_checklist_lkpPersistence;
@BeanReference(type = recommendation_type_lkpLocalService.class)
protected recommendation_type_lkpLocalService recommendation_type_lkpLocalService;
@BeanReference(type = recommendation_type_lkpPersistence.class)
protected recommendation_type_lkpPersistence recommendation_type_lkpPersistence;
@BeanReference(type = referencesLocalService.class)
protected referencesLocalService referencesLocalService;
@BeanReference(type = referencesPersistence.class)
protected referencesPersistence referencesPersistence;
@BeanReference(type = reinforced_monitoringLocalService.class)
protected reinforced_monitoringLocalService reinforced_monitoringLocalService;
@BeanReference(type = reinforced_monitoringPersistence.class)
protected reinforced_monitoringPersistence reinforced_monitoringPersistence;
@BeanReference(type = site_assessmentLocalService.class)
protected site_assessmentLocalService site_assessmentLocalService;
@BeanReference(type = site_assessmentPersistence.class)
protected site_assessmentPersistence site_assessmentPersistence;
@BeanReference(type = site_assessmentFinder.class)
protected site_assessmentFinder site_assessmentFinder;
@BeanReference(type = site_assessment_versionsLocalService.class)
protected site_assessment_versionsLocalService site_assessment_versionsLocalService;
@BeanReference(type = site_assessment_versionsPersistence.class)
protected site_assessment_versionsPersistence site_assessment_versionsPersistence;
@BeanReference(type = site_assessment_versionsFinder.class)
protected site_assessment_versionsFinder site_assessment_versionsFinder;
@BeanReference(type = sites_thematicLocalService.class)
protected sites_thematicLocalService sites_thematicLocalService;
@BeanReference(type = sites_thematicPersistence.class)
protected sites_thematicPersistence sites_thematicPersistence;
@BeanReference(type = state_lkpLocalService.class)
protected state_lkpLocalService state_lkpLocalService;
@BeanReference(type = state_lkpPersistence.class)
protected state_lkpPersistence state_lkpPersistence;
@BeanReference(type = state_trend_biodivvalsLocalService.class)
protected state_trend_biodivvalsLocalService state_trend_biodivvalsLocalService;
@BeanReference(type = state_trend_biodivvalsPersistence.class)
protected state_trend_biodivvalsPersistence state_trend_biodivvalsPersistence;
@BeanReference(type = state_trend_whvaluesLocalService.class)
protected state_trend_whvaluesLocalService state_trend_whvaluesLocalService;
@BeanReference(type = state_trend_whvaluesPersistence.class)
protected state_trend_whvaluesPersistence state_trend_whvaluesPersistence;
@BeanReference(type = thematic_lkpLocalService.class)
protected thematic_lkpLocalService thematic_lkpLocalService;
@BeanReference(type = thematic_lkpPersistence.class)
protected thematic_lkpPersistence thematic_lkpPersistence;
@BeanReference(type = threat_categories_lkpLocalService.class)
protected threat_categories_lkpLocalService threat_categories_lkpLocalService;
@BeanReference(type = threat_categories_lkpPersistence.class)
protected threat_categories_lkpPersistence threat_categories_lkpPersistence;
@BeanReference(type = threat_rating_lkpLocalService.class)
protected threat_rating_lkpLocalService threat_rating_lkpLocalService;
@BeanReference(type = threat_rating_lkpPersistence.class)
protected threat_rating_lkpPersistence threat_rating_lkpPersistence;
@BeanReference(type = threat_subcategories_lkpLocalService.class)
protected threat_subcategories_lkpLocalService threat_subcategories_lkpLocalService;
@BeanReference(type = threat_subcategories_lkpPersistence.class)
protected threat_subcategories_lkpPersistence threat_subcategories_lkpPersistence;
@BeanReference(type = threat_summary_currentLocalService.class)
protected threat_summary_currentLocalService threat_summary_currentLocalService;
@BeanReference(type = threat_summary_currentPersistence.class)
protected threat_summary_currentPersistence threat_summary_currentPersistence;
@BeanReference(type = threat_summary_overallLocalService.class)
protected threat_summary_overallLocalService threat_summary_overallLocalService;
@BeanReference(type = threat_summary_overallPersistence.class)
protected threat_summary_overallPersistence threat_summary_overallPersistence;
@BeanReference(type = threat_summary_potentialLocalService.class)
protected threat_summary_potentialLocalService threat_summary_potentialLocalService;
@BeanReference(type = threat_summary_potentialPersistence.class)
protected threat_summary_potentialPersistence threat_summary_potentialPersistence;
@BeanReference(type = trend_lkpLocalService.class)
protected trend_lkpLocalService trend_lkpLocalService;
@BeanReference(type = trend_lkpPersistence.class)
protected trend_lkpPersistence trend_lkpPersistence;
@BeanReference(type = unesco_regionLocalService.class)
protected unesco_regionLocalService unesco_regionLocalService;
@BeanReference(type = unesco_regionPersistence.class)
protected unesco_regionPersistence unesco_regionPersistence;
@BeanReference(type = unesco_region_countryLocalService.class)
protected unesco_region_countryLocalService unesco_region_countryLocalService;
@BeanReference(type = unesco_region_countryPersistence.class)
protected unesco_region_countryPersistence unesco_region_countryPersistence;
@BeanReference(type = whp_contactLocalService.class)
protected whp_contactLocalService whp_contactLocalService;
@BeanReference(type = whp_contactPersistence.class)
protected whp_contactPersistence whp_contactPersistence;
@BeanReference(type = whp_criteria_lkpLocalService.class)
protected whp_criteria_lkpLocalService whp_criteria_lkpLocalService;
@BeanReference(type = whp_criteria_lkpPersistence.class)
protected whp_criteria_lkpPersistence whp_criteria_lkpPersistence;
@BeanReference(type = whp_site_danger_listLocalService.class)
protected whp_site_danger_listLocalService whp_site_danger_listLocalService;
@BeanReference(type = whp_site_danger_listService.class)
protected whp_site_danger_listService whp_site_danger_listService;
@BeanReference(type = whp_site_danger_listPersistence.class)
protected whp_site_danger_listPersistence whp_site_danger_listPersistence;
@BeanReference(type = whp_sitesLocalService.class)
protected whp_sitesLocalService whp_sitesLocalService;
@BeanReference(type = whp_sitesService.class)
protected whp_sitesService whp_sitesService;
@BeanReference(type = whp_sitesPersistence.class)
protected whp_sitesPersistence whp_sitesPersistence;
@BeanReference(type = whp_sitesFinder.class)
protected whp_sitesFinder whp_sitesFinder;
@BeanReference(type = whp_sites_boundary_modificationLocalService.class)
protected whp_sites_boundary_modificationLocalService whp_sites_boundary_modificationLocalService;
@BeanReference(type = whp_sites_boundary_modificationPersistence.class)
protected whp_sites_boundary_modificationPersistence whp_sites_boundary_modificationPersistence;
@BeanReference(type = whp_sites_budgetLocalService.class)
protected whp_sites_budgetLocalService whp_sites_budgetLocalService;
@BeanReference(type = whp_sites_budgetPersistence.class)
protected whp_sites_budgetPersistence whp_sites_budgetPersistence;
@BeanReference(type = whp_sites_componentLocalService.class)
protected whp_sites_componentLocalService whp_sites_componentLocalService;
@BeanReference(type = whp_sites_componentPersistence.class)
protected whp_sites_componentPersistence whp_sites_componentPersistence;
@BeanReference(type = whp_sites_contactsLocalService.class)
protected whp_sites_contactsLocalService whp_sites_contactsLocalService;
@BeanReference(type = whp_sites_contactsPersistence.class)
protected whp_sites_contactsPersistence whp_sites_contactsPersistence;
@BeanReference(type = whp_sites_countryLocalService.class)
protected whp_sites_countryLocalService whp_sites_countryLocalService;
@BeanReference(type = whp_sites_countryPersistence.class)
protected whp_sites_countryPersistence whp_sites_countryPersistence;
@BeanReference(type = whp_sites_dsocrLocalService.class)
protected whp_sites_dsocrLocalService whp_sites_dsocrLocalService;
@BeanReference(type = whp_sites_dsocrPersistence.class)
protected whp_sites_dsocrPersistence whp_sites_dsocrPersistence;
@BeanReference(type = whp_sites_external_documentsLocalService.class)
protected whp_sites_external_documentsLocalService whp_sites_external_documentsLocalService;
@BeanReference(type = whp_sites_external_documentsPersistence.class)
protected whp_sites_external_documentsPersistence whp_sites_external_documentsPersistence;
@BeanReference(type = whp_sites_flagship_speciesLocalService.class)
protected whp_sites_flagship_speciesLocalService whp_sites_flagship_speciesLocalService;
@BeanReference(type = whp_sites_flagship_speciesPersistence.class)
protected whp_sites_flagship_speciesPersistence whp_sites_flagship_speciesPersistence;
@BeanReference(type = whp_sites_indigenous_communitiesLocalService.class)
protected whp_sites_indigenous_communitiesLocalService whp_sites_indigenous_communitiesLocalService;
@BeanReference(type = whp_sites_indigenous_communitiesPersistence.class)
protected whp_sites_indigenous_communitiesPersistence whp_sites_indigenous_communitiesPersistence;
@BeanReference(type = whp_sites_inscription_criteriaLocalService.class)
protected whp_sites_inscription_criteriaLocalService whp_sites_inscription_criteriaLocalService;
@BeanReference(type = whp_sites_inscription_criteriaPersistence.class)
protected whp_sites_inscription_criteriaPersistence whp_sites_inscription_criteriaPersistence;
@BeanReference(type = whp_sites_inscription_dateLocalService.class)
protected whp_sites_inscription_dateLocalService whp_sites_inscription_dateLocalService;
@BeanReference(type = whp_sites_inscription_datePersistence.class)
protected whp_sites_inscription_datePersistence whp_sites_inscription_datePersistence;
@BeanReference(type = whp_sites_iucn_pa_categoryLocalService.class)
protected whp_sites_iucn_pa_categoryLocalService whp_sites_iucn_pa_categoryLocalService;
@BeanReference(type = whp_sites_iucn_pa_categoryPersistence.class)
protected whp_sites_iucn_pa_categoryPersistence whp_sites_iucn_pa_categoryPersistence;
@BeanReference(type = whp_sites_iucn_recommendationLocalService.class)
protected whp_sites_iucn_recommendationLocalService whp_sites_iucn_recommendationLocalService;
@BeanReference(type = whp_sites_iucn_recommendationService.class)
protected whp_sites_iucn_recommendationService whp_sites_iucn_recommendationService;
@BeanReference(type = whp_sites_iucn_recommendationPersistence.class)
protected whp_sites_iucn_recommendationPersistence whp_sites_iucn_recommendationPersistence;
@BeanReference(type = whp_sites_meeLocalService.class)
protected whp_sites_meeLocalService whp_sites_meeLocalService;
@BeanReference(type = whp_sites_meePersistence.class)
protected whp_sites_meePersistence whp_sites_meePersistence;
@BeanReference(type = whp_sites_mgmt_plan_stateLocalService.class)
protected whp_sites_mgmt_plan_stateLocalService whp_sites_mgmt_plan_stateLocalService;
@BeanReference(type = whp_sites_mgmt_plan_statePersistence.class)
protected whp_sites_mgmt_plan_statePersistence whp_sites_mgmt_plan_statePersistence;
@BeanReference(type = whp_sites_missionLocalService.class)
protected whp_sites_missionLocalService whp_sites_missionLocalService;
@BeanReference(type = whp_sites_missionPersistence.class)
protected whp_sites_missionPersistence whp_sites_missionPersistence;
@BeanReference(type = whp_sites_other_designationsLocalService.class)
protected whp_sites_other_designationsLocalService whp_sites_other_designationsLocalService;
@BeanReference(type = whp_sites_other_designationsPersistence.class)
protected whp_sites_other_designationsPersistence whp_sites_other_designationsPersistence;
@BeanReference(type = whp_sites_soc_reportsLocalService.class)
protected whp_sites_soc_reportsLocalService whp_sites_soc_reportsLocalService;
@BeanReference(type = whp_sites_soc_reportsPersistence.class)
protected whp_sites_soc_reportsPersistence whp_sites_soc_reportsPersistence;
@BeanReference(type = whp_sites_soouvLocalService.class)
protected whp_sites_soouvLocalService whp_sites_soouvLocalService;
@BeanReference(type = whp_sites_soouvPersistence.class)
protected whp_sites_soouvPersistence whp_sites_soouvPersistence;
@BeanReference(type = whp_sites_visitorsLocalService.class)
protected whp_sites_visitorsLocalService whp_sites_visitorsLocalService;
@BeanReference(type = whp_sites_visitorsPersistence.class)
protected whp_sites_visitorsPersistence whp_sites_visitorsPersistence;
@BeanReference(type = CounterLocalService.class)
protected CounterLocalService counterLocalService;
@BeanReference(type = ResourceLocalService.class)
protected ResourceLocalService resourceLocalService;
@BeanReference(type = ResourceService.class)
protected ResourceService resourceService;
@BeanReference(type = ResourcePersistence.class)
protected ResourcePersistence resourcePersistence;
@BeanReference(type = UserLocalService.class)
protected UserLocalService userLocalService;
@BeanReference(type = UserService.class)
protected UserService userService;
@BeanReference(type = UserPersistence.class)
protected UserPersistence userPersistence;
private String _beanIdentifier;
private current_state_trendLocalServiceClpInvoker _clpInvoker = new current_state_trendLocalServiceClpInvoker(); | void function(String sql) throws SystemException { try { DataSource dataSource = current_state_trendPersistence.getDataSource(); SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource, sql, new int[0]); sqlUpdate.update(); } catch (Exception e) { throw new SystemException(e); } } @BeanReference(type = active_conservation_projectsLocalService.class) protected active_conservation_projectsLocalService active_conservation_projectsLocalService; @BeanReference(type = active_conservation_projectsPersistence.class) protected active_conservation_projectsPersistence active_conservation_projectsPersistence; @BeanReference(type = advance_query_assessmentLocalService.class) protected advance_query_assessmentLocalService advance_query_assessmentLocalService; @BeanReference(type = advance_query_assessmentPersistence.class) protected advance_query_assessmentPersistence advance_query_assessmentPersistence; @BeanReference(type = advance_query_siteLocalService.class) protected advance_query_siteLocalService advance_query_siteLocalService; @BeanReference(type = advance_query_sitePersistence.class) protected advance_query_sitePersistence advance_query_sitePersistence; @BeanReference(type = assessing_threats_currentLocalService.class) protected assessing_threats_currentLocalService assessing_threats_currentLocalService; @BeanReference(type = assessing_threats_currentPersistence.class) protected assessing_threats_currentPersistence assessing_threats_currentPersistence; @BeanReference(type = assessing_threats_potentialLocalService.class) protected assessing_threats_potentialLocalService assessing_threats_potentialLocalService; @BeanReference(type = assessing_threats_potentialPersistence.class) protected assessing_threats_potentialPersistence assessing_threats_potentialPersistence; @BeanReference(type = assessment_lang_lkpLocalService.class) protected assessment_lang_lkpLocalService assessment_lang_lkpLocalService; @BeanReference(type = assessment_lang_lkpPersistence.class) protected assessment_lang_lkpPersistence assessment_lang_lkpPersistence; @BeanReference(type = assessment_lang_versionLocalService.class) protected assessment_lang_versionLocalService assessment_lang_versionLocalService; @BeanReference(type = assessment_lang_versionPersistence.class) protected assessment_lang_versionPersistence assessment_lang_versionPersistence; @BeanReference(type = assessment_stagesLocalService.class) protected assessment_stagesLocalService assessment_stagesLocalService; @BeanReference(type = assessment_stagesPersistence.class) protected assessment_stagesPersistence assessment_stagesPersistence; @BeanReference(type = assessment_statusLocalService.class) protected assessment_statusLocalService assessment_statusLocalService; @BeanReference(type = assessment_statusPersistence.class) protected assessment_statusPersistence assessment_statusPersistence; @BeanReference(type = assessment_validationLocalService.class) protected assessment_validationLocalService assessment_validationLocalService; @BeanReference(type = assessment_validationPersistence.class) protected assessment_validationPersistence assessment_validationPersistence; @BeanReference(type = assessment_whvaluesLocalService.class) protected assessment_whvaluesLocalService assessment_whvaluesLocalService; @BeanReference(type = assessment_whvaluesPersistence.class) protected assessment_whvaluesPersistence assessment_whvaluesPersistence; @BeanReference(type = assessment_whvalues_whcriterionLocalService.class) protected assessment_whvalues_whcriterionLocalService assessment_whvalues_whcriterionLocalService; @BeanReference(type = assessment_whvalues_whcriterionPersistence.class) protected assessment_whvalues_whcriterionPersistence assessment_whvalues_whcriterionPersistence; @BeanReference(type = benefit_checksubtype_lkpLocalService.class) protected benefit_checksubtype_lkpLocalService benefit_checksubtype_lkpLocalService; @BeanReference(type = benefit_checksubtype_lkpPersistence.class) protected benefit_checksubtype_lkpPersistence benefit_checksubtype_lkpPersistence; @BeanReference(type = benefit_checktype_lkpLocalService.class) protected benefit_checktype_lkpLocalService benefit_checktype_lkpLocalService; @BeanReference(type = benefit_checktype_lkpPersistence.class) protected benefit_checktype_lkpPersistence benefit_checktype_lkpPersistence; @BeanReference(type = benefit_rating_lkpLocalService.class) protected benefit_rating_lkpLocalService benefit_rating_lkpLocalService; @BeanReference(type = benefit_rating_lkpPersistence.class) protected benefit_rating_lkpPersistence benefit_rating_lkpPersistence; @BeanReference(type = benefitsLocalService.class) protected benefitsLocalService benefitsLocalService; @BeanReference(type = benefitsPersistence.class) protected benefitsPersistence benefitsPersistence; @BeanReference(type = benefits_summaryLocalService.class) protected benefits_summaryLocalService benefits_summaryLocalService; @BeanReference(type = benefits_summaryPersistence.class) protected benefits_summaryPersistence benefits_summaryPersistence; @BeanReference(type = benefits_type_refLocalService.class) protected benefits_type_refLocalService benefits_type_refLocalService; @BeanReference(type = benefits_type_refPersistence.class) protected benefits_type_refPersistence benefits_type_refPersistence; @BeanReference(type = biodiversity_valuesLocalService.class) protected biodiversity_valuesLocalService biodiversity_valuesLocalService; @BeanReference(type = biodiversity_valuesPersistence.class) protected biodiversity_valuesPersistence biodiversity_valuesPersistence; @BeanReference(type = boundary_modification_type_lkpLocalService.class) protected boundary_modification_type_lkpLocalService boundary_modification_type_lkpLocalService; @BeanReference(type = boundary_modification_type_lkpPersistence.class) protected boundary_modification_type_lkpPersistence boundary_modification_type_lkpPersistence; @BeanReference(type = conservation_outlookLocalService.class) protected conservation_outlookLocalService conservation_outlookLocalService; @BeanReference(type = conservation_outlookPersistence.class) protected conservation_outlookPersistence conservation_outlookPersistence; @BeanReference(type = conservation_outlook_rating_lkpLocalService.class) protected conservation_outlook_rating_lkpLocalService conservation_outlook_rating_lkpLocalService; @BeanReference(type = conservation_outlook_rating_lkpPersistence.class) protected conservation_outlook_rating_lkpPersistence conservation_outlook_rating_lkpPersistence; @BeanReference(type = contact_categoryLocalService.class) protected contact_categoryLocalService contact_categoryLocalService; @BeanReference(type = contact_categoryPersistence.class) protected contact_categoryPersistence contact_categoryPersistence; @BeanReference(type = country_lkpLocalService.class) protected country_lkpLocalService country_lkpLocalService; @BeanReference(type = country_lkpPersistence.class) protected country_lkpPersistence country_lkpPersistence; @BeanReference(type = current_state_trendLocalService.class) protected current_state_trendLocalService current_state_trendLocalService; @BeanReference(type = current_state_trendPersistence.class) protected current_state_trendPersistence current_state_trendPersistence; @BeanReference(type = current_state_trend_valuesLocalService.class) protected current_state_trend_valuesLocalService current_state_trend_valuesLocalService; @BeanReference(type = current_state_trend_valuesPersistence.class) protected current_state_trend_valuesPersistence current_state_trend_valuesPersistence; @BeanReference(type = current_threat_assessment_catLocalService.class) protected current_threat_assessment_catLocalService current_threat_assessment_catLocalService; @BeanReference(type = current_threat_assessment_catPersistence.class) protected current_threat_assessment_catPersistence current_threat_assessment_catPersistence; @BeanReference(type = current_threat_valuesLocalService.class) protected current_threat_valuesLocalService current_threat_valuesLocalService; @BeanReference(type = current_threat_valuesPersistence.class) protected current_threat_valuesPersistence current_threat_valuesPersistence; @BeanReference(type = danger_list_status_lkpLocalService.class) protected danger_list_status_lkpLocalService danger_list_status_lkpLocalService; @BeanReference(type = danger_list_status_lkpPersistence.class) protected danger_list_status_lkpPersistence danger_list_status_lkpPersistence; @BeanReference(type = docs_customDataLocalService.class) protected docs_customDataLocalService docs_customDataLocalService; @BeanReference(type = docs_customDataPersistence.class) protected docs_customDataPersistence docs_customDataPersistence; @BeanReference(type = docs_customDataFinder.class) protected docs_customDataFinder docs_customDataFinder; @BeanReference(type = docs_sitedataLocalService.class) protected docs_sitedataLocalService docs_sitedataLocalService; @BeanReference(type = docs_sitedataPersistence.class) protected docs_sitedataPersistence docs_sitedataPersistence; @BeanReference(type = effective_prot_mgmt_iothreatsLocalService.class) protected effective_prot_mgmt_iothreatsLocalService effective_prot_mgmt_iothreatsLocalService; @BeanReference(type = effective_prot_mgmt_iothreatsPersistence.class) protected effective_prot_mgmt_iothreatsPersistence effective_prot_mgmt_iothreatsPersistence; @BeanReference(type = flagship_species_lkpLocalService.class) protected flagship_species_lkpLocalService flagship_species_lkpLocalService; @BeanReference(type = flagship_species_lkpPersistence.class) protected flagship_species_lkpPersistence flagship_species_lkpPersistence; @BeanReference(type = inscription_criteria_lkpLocalService.class) protected inscription_criteria_lkpLocalService inscription_criteria_lkpLocalService; @BeanReference(type = inscription_criteria_lkpPersistence.class) protected inscription_criteria_lkpPersistence inscription_criteria_lkpPersistence; @BeanReference(type = inscription_type_lkpLocalService.class) protected inscription_type_lkpLocalService inscription_type_lkpLocalService; @BeanReference(type = inscription_type_lkpPersistence.class) protected inscription_type_lkpPersistence inscription_type_lkpPersistence; @BeanReference(type = iucn_pa_lkp_categoryLocalService.class) protected iucn_pa_lkp_categoryLocalService iucn_pa_lkp_categoryLocalService; @BeanReference(type = iucn_pa_lkp_categoryPersistence.class) protected iucn_pa_lkp_categoryPersistence iucn_pa_lkp_categoryPersistence; @BeanReference(type = iucn_regionLocalService.class) protected iucn_regionLocalService iucn_regionLocalService; @BeanReference(type = iucn_regionPersistence.class) protected iucn_regionPersistence iucn_regionPersistence; @BeanReference(type = iucn_region_countryLocalService.class) protected iucn_region_countryLocalService iucn_region_countryLocalService; @BeanReference(type = iucn_region_countryPersistence.class) protected iucn_region_countryPersistence iucn_region_countryPersistence; @BeanReference(type = key_conservation_issuesLocalService.class) protected key_conservation_issuesLocalService key_conservation_issuesLocalService; @BeanReference(type = key_conservation_issuesPersistence.class) protected key_conservation_issuesPersistence key_conservation_issuesPersistence; @BeanReference(type = key_conservation_scale_lkpLocalService.class) protected key_conservation_scale_lkpLocalService key_conservation_scale_lkpLocalService; @BeanReference(type = key_conservation_scale_lkpPersistence.class) protected key_conservation_scale_lkpPersistence key_conservation_scale_lkpPersistence; @BeanReference(type = mission_lkpLocalService.class) protected mission_lkpLocalService mission_lkpLocalService; @BeanReference(type = mission_lkpPersistence.class) protected mission_lkpPersistence mission_lkpPersistence; @BeanReference(type = negative_factors_level_impactLocalService.class) protected negative_factors_level_impactLocalService negative_factors_level_impactLocalService; @BeanReference(type = negative_factors_level_impactPersistence.class) protected negative_factors_level_impactPersistence negative_factors_level_impactPersistence; @BeanReference(type = negative_factors_trendLocalService.class) protected negative_factors_trendLocalService negative_factors_trendLocalService; @BeanReference(type = negative_factors_trendPersistence.class) protected negative_factors_trendPersistence negative_factors_trendPersistence; @BeanReference(type = other_designation_lkpLocalService.class) protected other_designation_lkpLocalService other_designation_lkpLocalService; @BeanReference(type = other_designation_lkpPersistence.class) protected other_designation_lkpPersistence other_designation_lkpPersistence; @BeanReference(type = potential_project_needsLocalService.class) protected potential_project_needsLocalService potential_project_needsLocalService; @BeanReference(type = potential_project_needsPersistence.class) protected potential_project_needsPersistence potential_project_needsPersistence; @BeanReference(type = potential_threat_assessment_catLocalService.class) protected potential_threat_assessment_catLocalService potential_threat_assessment_catLocalService; @BeanReference(type = potential_threat_assessment_catPersistence.class) protected potential_threat_assessment_catPersistence potential_threat_assessment_catPersistence; @BeanReference(type = potential_threat_valuesLocalService.class) protected potential_threat_valuesLocalService potential_threat_valuesLocalService; @BeanReference(type = potential_threat_valuesPersistence.class) protected potential_threat_valuesPersistence potential_threat_valuesPersistence; @BeanReference(type = prot_mgmt_best_practicesLocalService.class) protected prot_mgmt_best_practicesLocalService prot_mgmt_best_practicesLocalService; @BeanReference(type = prot_mgmt_best_practicesPersistence.class) protected prot_mgmt_best_practicesPersistence prot_mgmt_best_practicesPersistence; @BeanReference(type = prot_mgmt_overallLocalService.class) protected prot_mgmt_overallLocalService prot_mgmt_overallLocalService; @BeanReference(type = prot_mgmt_overallPersistence.class) protected prot_mgmt_overallPersistence prot_mgmt_overallPersistence; @BeanReference(type = protection_managementLocalService.class) protected protection_managementLocalService protection_managementLocalService; @BeanReference(type = protection_managementPersistence.class) protected protection_managementPersistence protection_managementPersistence; @BeanReference(type = protection_management_ratings_lkpLocalService.class) protected protection_management_ratings_lkpLocalService protection_management_ratings_lkpLocalService; @BeanReference(type = protection_management_ratings_lkpPersistence.class) protected protection_management_ratings_lkpPersistence protection_management_ratings_lkpPersistence; @BeanReference(type = protection_mgmt_checklist_lkpLocalService.class) protected protection_mgmt_checklist_lkpLocalService protection_mgmt_checklist_lkpLocalService; @BeanReference(type = protection_mgmt_checklist_lkpPersistence.class) protected protection_mgmt_checklist_lkpPersistence protection_mgmt_checklist_lkpPersistence; @BeanReference(type = recommendation_type_lkpLocalService.class) protected recommendation_type_lkpLocalService recommendation_type_lkpLocalService; @BeanReference(type = recommendation_type_lkpPersistence.class) protected recommendation_type_lkpPersistence recommendation_type_lkpPersistence; @BeanReference(type = referencesLocalService.class) protected referencesLocalService referencesLocalService; @BeanReference(type = referencesPersistence.class) protected referencesPersistence referencesPersistence; @BeanReference(type = reinforced_monitoringLocalService.class) protected reinforced_monitoringLocalService reinforced_monitoringLocalService; @BeanReference(type = reinforced_monitoringPersistence.class) protected reinforced_monitoringPersistence reinforced_monitoringPersistence; @BeanReference(type = site_assessmentLocalService.class) protected site_assessmentLocalService site_assessmentLocalService; @BeanReference(type = site_assessmentPersistence.class) protected site_assessmentPersistence site_assessmentPersistence; @BeanReference(type = site_assessmentFinder.class) protected site_assessmentFinder site_assessmentFinder; @BeanReference(type = site_assessment_versionsLocalService.class) protected site_assessment_versionsLocalService site_assessment_versionsLocalService; @BeanReference(type = site_assessment_versionsPersistence.class) protected site_assessment_versionsPersistence site_assessment_versionsPersistence; @BeanReference(type = site_assessment_versionsFinder.class) protected site_assessment_versionsFinder site_assessment_versionsFinder; @BeanReference(type = sites_thematicLocalService.class) protected sites_thematicLocalService sites_thematicLocalService; @BeanReference(type = sites_thematicPersistence.class) protected sites_thematicPersistence sites_thematicPersistence; @BeanReference(type = state_lkpLocalService.class) protected state_lkpLocalService state_lkpLocalService; @BeanReference(type = state_lkpPersistence.class) protected state_lkpPersistence state_lkpPersistence; @BeanReference(type = state_trend_biodivvalsLocalService.class) protected state_trend_biodivvalsLocalService state_trend_biodivvalsLocalService; @BeanReference(type = state_trend_biodivvalsPersistence.class) protected state_trend_biodivvalsPersistence state_trend_biodivvalsPersistence; @BeanReference(type = state_trend_whvaluesLocalService.class) protected state_trend_whvaluesLocalService state_trend_whvaluesLocalService; @BeanReference(type = state_trend_whvaluesPersistence.class) protected state_trend_whvaluesPersistence state_trend_whvaluesPersistence; @BeanReference(type = thematic_lkpLocalService.class) protected thematic_lkpLocalService thematic_lkpLocalService; @BeanReference(type = thematic_lkpPersistence.class) protected thematic_lkpPersistence thematic_lkpPersistence; @BeanReference(type = threat_categories_lkpLocalService.class) protected threat_categories_lkpLocalService threat_categories_lkpLocalService; @BeanReference(type = threat_categories_lkpPersistence.class) protected threat_categories_lkpPersistence threat_categories_lkpPersistence; @BeanReference(type = threat_rating_lkpLocalService.class) protected threat_rating_lkpLocalService threat_rating_lkpLocalService; @BeanReference(type = threat_rating_lkpPersistence.class) protected threat_rating_lkpPersistence threat_rating_lkpPersistence; @BeanReference(type = threat_subcategories_lkpLocalService.class) protected threat_subcategories_lkpLocalService threat_subcategories_lkpLocalService; @BeanReference(type = threat_subcategories_lkpPersistence.class) protected threat_subcategories_lkpPersistence threat_subcategories_lkpPersistence; @BeanReference(type = threat_summary_currentLocalService.class) protected threat_summary_currentLocalService threat_summary_currentLocalService; @BeanReference(type = threat_summary_currentPersistence.class) protected threat_summary_currentPersistence threat_summary_currentPersistence; @BeanReference(type = threat_summary_overallLocalService.class) protected threat_summary_overallLocalService threat_summary_overallLocalService; @BeanReference(type = threat_summary_overallPersistence.class) protected threat_summary_overallPersistence threat_summary_overallPersistence; @BeanReference(type = threat_summary_potentialLocalService.class) protected threat_summary_potentialLocalService threat_summary_potentialLocalService; @BeanReference(type = threat_summary_potentialPersistence.class) protected threat_summary_potentialPersistence threat_summary_potentialPersistence; @BeanReference(type = trend_lkpLocalService.class) protected trend_lkpLocalService trend_lkpLocalService; @BeanReference(type = trend_lkpPersistence.class) protected trend_lkpPersistence trend_lkpPersistence; @BeanReference(type = unesco_regionLocalService.class) protected unesco_regionLocalService unesco_regionLocalService; @BeanReference(type = unesco_regionPersistence.class) protected unesco_regionPersistence unesco_regionPersistence; @BeanReference(type = unesco_region_countryLocalService.class) protected unesco_region_countryLocalService unesco_region_countryLocalService; @BeanReference(type = unesco_region_countryPersistence.class) protected unesco_region_countryPersistence unesco_region_countryPersistence; @BeanReference(type = whp_contactLocalService.class) protected whp_contactLocalService whp_contactLocalService; @BeanReference(type = whp_contactPersistence.class) protected whp_contactPersistence whp_contactPersistence; @BeanReference(type = whp_criteria_lkpLocalService.class) protected whp_criteria_lkpLocalService whp_criteria_lkpLocalService; @BeanReference(type = whp_criteria_lkpPersistence.class) protected whp_criteria_lkpPersistence whp_criteria_lkpPersistence; @BeanReference(type = whp_site_danger_listLocalService.class) protected whp_site_danger_listLocalService whp_site_danger_listLocalService; @BeanReference(type = whp_site_danger_listService.class) protected whp_site_danger_listService whp_site_danger_listService; @BeanReference(type = whp_site_danger_listPersistence.class) protected whp_site_danger_listPersistence whp_site_danger_listPersistence; @BeanReference(type = whp_sitesLocalService.class) protected whp_sitesLocalService whp_sitesLocalService; @BeanReference(type = whp_sitesService.class) protected whp_sitesService whp_sitesService; @BeanReference(type = whp_sitesPersistence.class) protected whp_sitesPersistence whp_sitesPersistence; @BeanReference(type = whp_sitesFinder.class) protected whp_sitesFinder whp_sitesFinder; @BeanReference(type = whp_sites_boundary_modificationLocalService.class) protected whp_sites_boundary_modificationLocalService whp_sites_boundary_modificationLocalService; @BeanReference(type = whp_sites_boundary_modificationPersistence.class) protected whp_sites_boundary_modificationPersistence whp_sites_boundary_modificationPersistence; @BeanReference(type = whp_sites_budgetLocalService.class) protected whp_sites_budgetLocalService whp_sites_budgetLocalService; @BeanReference(type = whp_sites_budgetPersistence.class) protected whp_sites_budgetPersistence whp_sites_budgetPersistence; @BeanReference(type = whp_sites_componentLocalService.class) protected whp_sites_componentLocalService whp_sites_componentLocalService; @BeanReference(type = whp_sites_componentPersistence.class) protected whp_sites_componentPersistence whp_sites_componentPersistence; @BeanReference(type = whp_sites_contactsLocalService.class) protected whp_sites_contactsLocalService whp_sites_contactsLocalService; @BeanReference(type = whp_sites_contactsPersistence.class) protected whp_sites_contactsPersistence whp_sites_contactsPersistence; @BeanReference(type = whp_sites_countryLocalService.class) protected whp_sites_countryLocalService whp_sites_countryLocalService; @BeanReference(type = whp_sites_countryPersistence.class) protected whp_sites_countryPersistence whp_sites_countryPersistence; @BeanReference(type = whp_sites_dsocrLocalService.class) protected whp_sites_dsocrLocalService whp_sites_dsocrLocalService; @BeanReference(type = whp_sites_dsocrPersistence.class) protected whp_sites_dsocrPersistence whp_sites_dsocrPersistence; @BeanReference(type = whp_sites_external_documentsLocalService.class) protected whp_sites_external_documentsLocalService whp_sites_external_documentsLocalService; @BeanReference(type = whp_sites_external_documentsPersistence.class) protected whp_sites_external_documentsPersistence whp_sites_external_documentsPersistence; @BeanReference(type = whp_sites_flagship_speciesLocalService.class) protected whp_sites_flagship_speciesLocalService whp_sites_flagship_speciesLocalService; @BeanReference(type = whp_sites_flagship_speciesPersistence.class) protected whp_sites_flagship_speciesPersistence whp_sites_flagship_speciesPersistence; @BeanReference(type = whp_sites_indigenous_communitiesLocalService.class) protected whp_sites_indigenous_communitiesLocalService whp_sites_indigenous_communitiesLocalService; @BeanReference(type = whp_sites_indigenous_communitiesPersistence.class) protected whp_sites_indigenous_communitiesPersistence whp_sites_indigenous_communitiesPersistence; @BeanReference(type = whp_sites_inscription_criteriaLocalService.class) protected whp_sites_inscription_criteriaLocalService whp_sites_inscription_criteriaLocalService; @BeanReference(type = whp_sites_inscription_criteriaPersistence.class) protected whp_sites_inscription_criteriaPersistence whp_sites_inscription_criteriaPersistence; @BeanReference(type = whp_sites_inscription_dateLocalService.class) protected whp_sites_inscription_dateLocalService whp_sites_inscription_dateLocalService; @BeanReference(type = whp_sites_inscription_datePersistence.class) protected whp_sites_inscription_datePersistence whp_sites_inscription_datePersistence; @BeanReference(type = whp_sites_iucn_pa_categoryLocalService.class) protected whp_sites_iucn_pa_categoryLocalService whp_sites_iucn_pa_categoryLocalService; @BeanReference(type = whp_sites_iucn_pa_categoryPersistence.class) protected whp_sites_iucn_pa_categoryPersistence whp_sites_iucn_pa_categoryPersistence; @BeanReference(type = whp_sites_iucn_recommendationLocalService.class) protected whp_sites_iucn_recommendationLocalService whp_sites_iucn_recommendationLocalService; @BeanReference(type = whp_sites_iucn_recommendationService.class) protected whp_sites_iucn_recommendationService whp_sites_iucn_recommendationService; @BeanReference(type = whp_sites_iucn_recommendationPersistence.class) protected whp_sites_iucn_recommendationPersistence whp_sites_iucn_recommendationPersistence; @BeanReference(type = whp_sites_meeLocalService.class) protected whp_sites_meeLocalService whp_sites_meeLocalService; @BeanReference(type = whp_sites_meePersistence.class) protected whp_sites_meePersistence whp_sites_meePersistence; @BeanReference(type = whp_sites_mgmt_plan_stateLocalService.class) protected whp_sites_mgmt_plan_stateLocalService whp_sites_mgmt_plan_stateLocalService; @BeanReference(type = whp_sites_mgmt_plan_statePersistence.class) protected whp_sites_mgmt_plan_statePersistence whp_sites_mgmt_plan_statePersistence; @BeanReference(type = whp_sites_missionLocalService.class) protected whp_sites_missionLocalService whp_sites_missionLocalService; @BeanReference(type = whp_sites_missionPersistence.class) protected whp_sites_missionPersistence whp_sites_missionPersistence; @BeanReference(type = whp_sites_other_designationsLocalService.class) protected whp_sites_other_designationsLocalService whp_sites_other_designationsLocalService; @BeanReference(type = whp_sites_other_designationsPersistence.class) protected whp_sites_other_designationsPersistence whp_sites_other_designationsPersistence; @BeanReference(type = whp_sites_soc_reportsLocalService.class) protected whp_sites_soc_reportsLocalService whp_sites_soc_reportsLocalService; @BeanReference(type = whp_sites_soc_reportsPersistence.class) protected whp_sites_soc_reportsPersistence whp_sites_soc_reportsPersistence; @BeanReference(type = whp_sites_soouvLocalService.class) protected whp_sites_soouvLocalService whp_sites_soouvLocalService; @BeanReference(type = whp_sites_soouvPersistence.class) protected whp_sites_soouvPersistence whp_sites_soouvPersistence; @BeanReference(type = whp_sites_visitorsLocalService.class) protected whp_sites_visitorsLocalService whp_sites_visitorsLocalService; @BeanReference(type = whp_sites_visitorsPersistence.class) protected whp_sites_visitorsPersistence whp_sites_visitorsPersistence; @BeanReference(type = CounterLocalService.class) protected CounterLocalService counterLocalService; @BeanReference(type = ResourceLocalService.class) protected ResourceLocalService resourceLocalService; @BeanReference(type = ResourceService.class) protected ResourceService resourceService; @BeanReference(type = ResourcePersistence.class) protected ResourcePersistence resourcePersistence; @BeanReference(type = UserLocalService.class) protected UserLocalService userLocalService; @BeanReference(type = UserService.class) protected UserService userService; @BeanReference(type = UserPersistence.class) protected UserPersistence userPersistence; private String _beanIdentifier; private current_state_trendLocalServiceClpInvoker _clpInvoker = new current_state_trendLocalServiceClpInvoker(); | /**
* Performs an SQL query.
*
* @param sql the sql query
*/ | Performs an SQL query | runSQL | {
"repo_name": "iucn-whp/world-heritage-outlook",
"path": "portlets/iucn-dbservice-portlet/docroot/WEB-INF/src/com/iucn/whp/dbservice/service/base/current_state_trendLocalServiceBaseImpl.java",
"license": "gpl-2.0",
"size": 175975
} | [
"com.liferay.counter.service.CounterLocalService",
"com.liferay.portal.kernel.bean.BeanReference",
"com.liferay.portal.kernel.dao.jdbc.SqlUpdate",
"com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil",
"com.liferay.portal.kernel.exception.SystemException",
"com.liferay.portal.service.ResourceLocalService",
"com.liferay.portal.service.ResourceService",
"com.liferay.portal.service.UserLocalService",
"com.liferay.portal.service.UserService",
"com.liferay.portal.service.persistence.ResourcePersistence",
"com.liferay.portal.service.persistence.UserPersistence",
"javax.sql.DataSource"
] | import com.liferay.counter.service.CounterLocalService; import com.liferay.portal.kernel.bean.BeanReference; import com.liferay.portal.kernel.dao.jdbc.SqlUpdate; import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.service.ResourceLocalService; import com.liferay.portal.service.ResourceService; import com.liferay.portal.service.UserLocalService; import com.liferay.portal.service.UserService; import com.liferay.portal.service.persistence.ResourcePersistence; import com.liferay.portal.service.persistence.UserPersistence; import javax.sql.DataSource; | import com.liferay.counter.service.*; import com.liferay.portal.kernel.bean.*; import com.liferay.portal.kernel.dao.jdbc.*; import com.liferay.portal.kernel.exception.*; import com.liferay.portal.service.*; import com.liferay.portal.service.persistence.*; import javax.sql.*; | [
"com.liferay.counter",
"com.liferay.portal",
"javax.sql"
] | com.liferay.counter; com.liferay.portal; javax.sql; | 824,198 |
@Test
public void whenRemoveAllIsUsed_thenNearCacheShouldBeInvalidated_onNearCacheAdapter() {
whenEntryIsRemoved_thenNearCacheShouldBeInvalidated(false, DataStructureMethods.REMOVE_ALL);
} | void function() { whenEntryIsRemoved_thenNearCacheShouldBeInvalidated(false, DataStructureMethods.REMOVE_ALL); } | /**
* Checks that the Near Cache is eventually invalidated when {@link DataStructureMethods#REMOVE_ALL)} is used.
*/ | Checks that the Near Cache is eventually invalidated when <code>DataStructureMethods#REMOVE_ALL)</code> is used | whenRemoveAllIsUsed_thenNearCacheShouldBeInvalidated_onNearCacheAdapter | {
"repo_name": "emrahkocaman/hazelcast",
"path": "hazelcast/src/test/java/com/hazelcast/internal/nearcache/AbstractNearCacheBasicTest.java",
"license": "apache-2.0",
"size": 46469
} | [
"com.hazelcast.internal.adapter.DataStructureAdapter"
] | import com.hazelcast.internal.adapter.DataStructureAdapter; | import com.hazelcast.internal.adapter.*; | [
"com.hazelcast.internal"
] | com.hazelcast.internal; | 657,308 |
private void writeRepositoryPolicy( RepositoryPolicy repositoryPolicy, String tagName, XmlSerializer serializer )
throws java.io.IOException
{
serializer.startTag( NAMESPACE, tagName );
if ( repositoryPolicy.isEnabled() != true )
{
serializer.startTag( NAMESPACE, "enabled" ).text( String.valueOf( repositoryPolicy.isEnabled() ) ).endTag( NAMESPACE, "enabled" );
}
if ( repositoryPolicy.getUpdatePolicy() != null )
{
serializer.startTag( NAMESPACE, "updatePolicy" ).text( repositoryPolicy.getUpdatePolicy() ).endTag( NAMESPACE, "updatePolicy" );
}
if ( repositoryPolicy.getChecksumPolicy() != null )
{
serializer.startTag( NAMESPACE, "checksumPolicy" ).text( repositoryPolicy.getChecksumPolicy() ).endTag( NAMESPACE, "checksumPolicy" );
}
serializer.endTag( NAMESPACE, tagName );
} //-- void writeRepositoryPolicy( RepositoryPolicy, String, XmlSerializer ) | void function( RepositoryPolicy repositoryPolicy, String tagName, XmlSerializer serializer ) throws java.io.IOException { serializer.startTag( NAMESPACE, tagName ); if ( repositoryPolicy.isEnabled() != true ) { serializer.startTag( NAMESPACE, STR ).text( String.valueOf( repositoryPolicy.isEnabled() ) ).endTag( NAMESPACE, STR ); } if ( repositoryPolicy.getUpdatePolicy() != null ) { serializer.startTag( NAMESPACE, STR ).text( repositoryPolicy.getUpdatePolicy() ).endTag( NAMESPACE, STR ); } if ( repositoryPolicy.getChecksumPolicy() != null ) { serializer.startTag( NAMESPACE, STR ).text( repositoryPolicy.getChecksumPolicy() ).endTag( NAMESPACE, STR ); } serializer.endTag( NAMESPACE, tagName ); } | /**
* Method writeRepositoryPolicy.
*
* @param repositoryPolicy
* @param serializer
* @param tagName
* @throws java.io.IOException
*/ | Method writeRepositoryPolicy | writeRepositoryPolicy | {
"repo_name": "emacslisp/Java",
"path": "MavenDebug/src/org/apache/maven/settings/io/xpp3/SettingsXpp3Writer.java",
"license": "mit",
"size": 25760
} | [
"org.apache.maven.settings.RepositoryPolicy",
"org.codehaus.plexus.util.xml.pull.XmlSerializer"
] | import org.apache.maven.settings.RepositoryPolicy; import org.codehaus.plexus.util.xml.pull.XmlSerializer; | import org.apache.maven.settings.*; import org.codehaus.plexus.util.xml.pull.*; | [
"org.apache.maven",
"org.codehaus.plexus"
] | org.apache.maven; org.codehaus.plexus; | 1,690,851 |
@SuppressLint("InlinedApi")
public static Bitmap blur(Context context, Bitmap sentBitmap, int radius) {
if (radius < 0) {
radius = 0;
if (DEBUG) {
}
} else if (radius > 25) {
radius = 25;
if (DEBUG) {
}
}
if (Build.VERSION.SDK_INT > 16) {
Bitmap bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);
final RenderScript rs = RenderScript.create(context);
final Allocation input = Allocation.createFromBitmap(rs,
sentBitmap, Allocation.MipmapControl.MIPMAP_NONE,
Allocation.USAGE_SCRIPT);
final Allocation output = Allocation.createTyped(rs,
input.getType());
final ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create(rs,
Element.U8_4(rs));
script.setRadius(radius );
script.setInput(input);
script.forEach(output);
output.copyTo(bitmap);
return bitmap;
}
// Stack Blur v1.0 from
// http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html
//
// Java Author: Mario Klingemann <mario at quasimondo.com>
// http://incubator.quasimondo.com
// created Feburary 29, 2004
// Android port : Yahel Bouaziz <yahel at kayenko.com>
// http://www.kayenko.com
// ported april 5th, 2012
// This is a compromise between Gaussian Blur and Box blur
// It creates much better looking blurs than Box Blur, but is
// 7x faster than my Gaussian Blur implementation.
//
// I called it Stack Blur because this describes best how this
// filter works internally: it creates a kind of moving stack
// of colors whilst scanning through the image. Thereby it
// just has to add one new block of color to the right side
// of the stack and remove the leftmost color. The remaining
// colors on the topmost layer of the stack are either added on
// or reduced by one, depending on if they are on the right or
// on the left side of the stack.
//
// If you are using this algorithm in your code please add
// the following line:
//
// Stack Blur Algorithm by Mario Klingemann <[email protected]>
Bitmap bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);
if (radius < 1) {
return (null);
}
int w = bitmap.getWidth();
int h = bitmap.getHeight();
int[] pix = new int[w * h];
Log.e("pix", w + " " + h + " " + pix.length);
bitmap.getPixels(pix, 0, w, 0, 0, w, h);
int wm = w - 1;
int hm = h - 1;
int wh = w * h;
int div = radius + radius + 1;
int r[] = new int[wh];
int g[] = new int[wh];
int b[] = new int[wh];
int rsum, gsum, bsum, x, y, i, p, yp, yi, yw;
int vmin[] = new int[Math.max(w, h)];
int divsum = (div + 1) >> 1;
divsum *= divsum;
int dv[] = new int[256 * divsum];
for (i = 0; i < 256 * divsum; i++) {
dv[i] = (i / divsum);
}
yw = yi = 0;
int[][] stack = new int[div][3];
int stackpointer;
int stackstart;
int[] sir;
int rbs;
int r1 = radius + 1;
int routsum, goutsum, boutsum;
int rinsum, ginsum, binsum;
for (y = 0; y < h; y++) {
rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0;
for (i = -radius; i <= radius; i++) {
p = pix[yi + Math.min(wm, Math.max(i, 0))];
sir = stack[i + radius];
sir[0] = (p & 0xff0000) >> 16;
sir[1] = (p & 0x00ff00) >> 8;
sir[2] = (p & 0x0000ff);
rbs = r1 - Math.abs(i);
rsum += sir[0] * rbs;
gsum += sir[1] * rbs;
bsum += sir[2] * rbs;
if (i > 0) {
rinsum += sir[0];
ginsum += sir[1];
binsum += sir[2];
} else {
routsum += sir[0];
goutsum += sir[1];
boutsum += sir[2];
}
}
stackpointer = radius;
for (x = 0; x < w; x++) {
r[yi] = dv[rsum];
g[yi] = dv[gsum];
b[yi] = dv[bsum];
rsum -= routsum;
gsum -= goutsum;
bsum -= boutsum;
stackstart = stackpointer - radius + div;
sir = stack[stackstart % div];
routsum -= sir[0];
goutsum -= sir[1];
boutsum -= sir[2];
if (y == 0) {
vmin[x] = Math.min(x + radius + 1, wm);
}
p = pix[yw + vmin[x]];
sir[0] = (p & 0xff0000) >> 16;
sir[1] = (p & 0x00ff00) >> 8;
sir[2] = (p & 0x0000ff);
rinsum += sir[0];
ginsum += sir[1];
binsum += sir[2];
rsum += rinsum;
gsum += ginsum;
bsum += binsum;
stackpointer = (stackpointer + 1) % div;
sir = stack[(stackpointer) % div];
routsum += sir[0];
goutsum += sir[1];
boutsum += sir[2];
rinsum -= sir[0];
ginsum -= sir[1];
binsum -= sir[2];
yi++;
}
yw += w;
}
for (x = 0; x < w; x++) {
rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0;
yp = -radius * w;
for (i = -radius; i <= radius; i++) {
yi = Math.max(0, yp) + x;
sir = stack[i + radius];
sir[0] = r[yi];
sir[1] = g[yi];
sir[2] = b[yi];
rbs = r1 - Math.abs(i);
rsum += r[yi] * rbs;
gsum += g[yi] * rbs;
bsum += b[yi] * rbs;
if (i > 0) {
rinsum += sir[0];
ginsum += sir[1];
binsum += sir[2];
} else {
routsum += sir[0];
goutsum += sir[1];
boutsum += sir[2];
}
if (i < hm) {
yp += w;
}
}
yi = x;
stackpointer = radius;
for (y = 0; y < h; y++) {
// Preserve alpha channel: ( 0xff000000 & pix[yi] )
pix[yi] = (0xff000000 & pix[yi]) | (dv[rsum] << 16)
| (dv[gsum] << 8) | dv[bsum];
rsum -= routsum;
gsum -= goutsum;
bsum -= boutsum;
stackstart = stackpointer - radius + div;
sir = stack[stackstart % div];
routsum -= sir[0];
goutsum -= sir[1];
boutsum -= sir[2];
if (x == 0) {
vmin[y] = Math.min(y + r1, hm) * w;
}
p = x + vmin[y];
sir[0] = r[p];
sir[1] = g[p];
sir[2] = b[p];
rinsum += sir[0];
ginsum += sir[1];
binsum += sir[2];
rsum += rinsum;
gsum += ginsum;
bsum += binsum;
stackpointer = (stackpointer + 1) % div;
sir = stack[stackpointer];
routsum += sir[0];
goutsum += sir[1];
boutsum += sir[2];
rinsum -= sir[0];
ginsum -= sir[1];
binsum -= sir[2];
yi += w;
}
}
Log.e("pix", w + " " + h + " " + pix.length);
bitmap.setPixels(pix, 0, w, 0, 0, w, h);
return (bitmap);
} | @SuppressLint(STR) static Bitmap function(Context context, Bitmap sentBitmap, int radius) { if (radius < 0) { radius = 0; if (DEBUG) { } } else if (radius > 25) { radius = 25; if (DEBUG) { } } if (Build.VERSION.SDK_INT > 16) { Bitmap bitmap = sentBitmap.copy(sentBitmap.getConfig(), true); final RenderScript rs = RenderScript.create(context); final Allocation input = Allocation.createFromBitmap(rs, sentBitmap, Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT); final Allocation output = Allocation.createTyped(rs, input.getType()); final ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); script.setRadius(radius ); script.setInput(input); script.forEach(output); output.copyTo(bitmap); return bitmap; } Bitmap bitmap = sentBitmap.copy(sentBitmap.getConfig(), true); if (radius < 1) { return (null); } int w = bitmap.getWidth(); int h = bitmap.getHeight(); int[] pix = new int[w * h]; Log.e("pix", w + " " + h + " " + pix.length); bitmap.getPixels(pix, 0, w, 0, 0, w, h); int wm = w - 1; int hm = h - 1; int wh = w * h; int div = radius + radius + 1; int r[] = new int[wh]; int g[] = new int[wh]; int b[] = new int[wh]; int rsum, gsum, bsum, x, y, i, p, yp, yi, yw; int vmin[] = new int[Math.max(w, h)]; int divsum = (div + 1) >> 1; divsum *= divsum; int dv[] = new int[256 * divsum]; for (i = 0; i < 256 * divsum; i++) { dv[i] = (i / divsum); } yw = yi = 0; int[][] stack = new int[div][3]; int stackpointer; int stackstart; int[] sir; int rbs; int r1 = radius + 1; int routsum, goutsum, boutsum; int rinsum, ginsum, binsum; for (y = 0; y < h; y++) { rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0; for (i = -radius; i <= radius; i++) { p = pix[yi + Math.min(wm, Math.max(i, 0))]; sir = stack[i + radius]; sir[0] = (p & 0xff0000) >> 16; sir[1] = (p & 0x00ff00) >> 8; sir[2] = (p & 0x0000ff); rbs = r1 - Math.abs(i); rsum += sir[0] * rbs; gsum += sir[1] * rbs; bsum += sir[2] * rbs; if (i > 0) { rinsum += sir[0]; ginsum += sir[1]; binsum += sir[2]; } else { routsum += sir[0]; goutsum += sir[1]; boutsum += sir[2]; } } stackpointer = radius; for (x = 0; x < w; x++) { r[yi] = dv[rsum]; g[yi] = dv[gsum]; b[yi] = dv[bsum]; rsum -= routsum; gsum -= goutsum; bsum -= boutsum; stackstart = stackpointer - radius + div; sir = stack[stackstart % div]; routsum -= sir[0]; goutsum -= sir[1]; boutsum -= sir[2]; if (y == 0) { vmin[x] = Math.min(x + radius + 1, wm); } p = pix[yw + vmin[x]]; sir[0] = (p & 0xff0000) >> 16; sir[1] = (p & 0x00ff00) >> 8; sir[2] = (p & 0x0000ff); rinsum += sir[0]; ginsum += sir[1]; binsum += sir[2]; rsum += rinsum; gsum += ginsum; bsum += binsum; stackpointer = (stackpointer + 1) % div; sir = stack[(stackpointer) % div]; routsum += sir[0]; goutsum += sir[1]; boutsum += sir[2]; rinsum -= sir[0]; ginsum -= sir[1]; binsum -= sir[2]; yi++; } yw += w; } for (x = 0; x < w; x++) { rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0; yp = -radius * w; for (i = -radius; i <= radius; i++) { yi = Math.max(0, yp) + x; sir = stack[i + radius]; sir[0] = r[yi]; sir[1] = g[yi]; sir[2] = b[yi]; rbs = r1 - Math.abs(i); rsum += r[yi] * rbs; gsum += g[yi] * rbs; bsum += b[yi] * rbs; if (i > 0) { rinsum += sir[0]; ginsum += sir[1]; binsum += sir[2]; } else { routsum += sir[0]; goutsum += sir[1]; boutsum += sir[2]; } if (i < hm) { yp += w; } } yi = x; stackpointer = radius; for (y = 0; y < h; y++) { pix[yi] = (0xff000000 & pix[yi]) (dv[rsum] << 16) (dv[gsum] << 8) dv[bsum]; rsum -= routsum; gsum -= goutsum; bsum -= boutsum; stackstart = stackpointer - radius + div; sir = stack[stackstart % div]; routsum -= sir[0]; goutsum -= sir[1]; boutsum -= sir[2]; if (x == 0) { vmin[y] = Math.min(y + r1, hm) * w; } p = x + vmin[y]; sir[0] = r[p]; sir[1] = g[p]; sir[2] = b[p]; rinsum += sir[0]; ginsum += sir[1]; binsum += sir[2]; rsum += rinsum; gsum += ginsum; bsum += binsum; stackpointer = (stackpointer + 1) % div; sir = stack[stackpointer]; routsum += sir[0]; goutsum += sir[1]; boutsum += sir[2]; rinsum -= sir[0]; ginsum -= sir[1]; binsum -= sir[2]; yi += w; } } Log.e("pix", w + " " + h + " " + pix.length); bitmap.setPixels(pix, 0, w, 0, 0, w, h); return (bitmap); } | /**
* Apply a blur to a Bitmap
*
* @param context Application context
* @param sentBitmap Bitmap to be converted
* @param radius Desired Radius, 0 < r < 25
* @return a copy of the image with a blur
*/ | Apply a blur to a Bitmap | blur | {
"repo_name": "KaiXuan666/Tool",
"path": "tool/src/main/java/com/cmcc/tool/utils/BitmapUtil.java",
"license": "apache-2.0",
"size": 59349
} | [
"android.annotation.SuppressLint",
"android.content.Context",
"android.graphics.Bitmap",
"android.os.Build",
"android.renderscript.Allocation",
"android.renderscript.Element",
"android.renderscript.RenderScript",
"android.renderscript.ScriptIntrinsicBlur",
"android.util.Log"
] | import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Bitmap; import android.os.Build; import android.renderscript.Allocation; import android.renderscript.Element; import android.renderscript.RenderScript; import android.renderscript.ScriptIntrinsicBlur; import android.util.Log; | import android.annotation.*; import android.content.*; import android.graphics.*; import android.os.*; import android.renderscript.*; import android.util.*; | [
"android.annotation",
"android.content",
"android.graphics",
"android.os",
"android.renderscript",
"android.util"
] | android.annotation; android.content; android.graphics; android.os; android.renderscript; android.util; | 336,770 |
final Transaction transaction = clientRepository.beginTransaction();
try {
final String oldClientId = requestJSONObject.optString(Keys.OBJECT_ID);
final JSONObject oldClient = clientRepository.get(oldClientId);
if (null != oldClient) {
throw new ServiceException(langPropsService.get("updateFailLabel"));
}
// Add
clientRepository.add(requestJSONObject);
transaction.commit();
} catch (final RepositoryException e) {
if (transaction.isActive()) {
transaction.rollback();
}
LOGGER.log(Level.ERROR, "Adds client failed", e);
throw new ServiceException(e);
}
}
/**
* Updates a client by the specified request json object.
*
* @param requestJSONObject the specified request json object (client), for example, <pre>
* {
* "oId": "",
* "clientName": "",
* "clientVersion": "",
* "clientHost": "",
* "clientAdminEmail": "",
* ....
* } | final Transaction transaction = clientRepository.beginTransaction(); try { final String oldClientId = requestJSONObject.optString(Keys.OBJECT_ID); final JSONObject oldClient = clientRepository.get(oldClientId); if (null != oldClient) { throw new ServiceException(langPropsService.get(STR)); } clientRepository.add(requestJSONObject); transaction.commit(); } catch (final RepositoryException e) { if (transaction.isActive()) { transaction.rollback(); } LOGGER.log(Level.ERROR, STR, e); throw new ServiceException(e); } } /** * Updates a client by the specified request json object. * * @param requestJSONObject the specified request json object (client), for example, <pre> * { * "oId": STRclientName": STRclientVersion": STRclientHost": STRclientAdminEmailSTR", * .... * } | /**
* Adds a client by the specified request json object.
*
* @param requestJSONObject the specified request json object (client), for example, <pre>
* {
* "oId": "",
* "clientName": "",
* "clientVersion": "",
* "clientHost": "",
* "clientAdminEmail": "",
* ....
* }
* </pre>
*
* @throws ServiceException service exception
*/ | Adds a client by the specified request json object | addClient | {
"repo_name": "BrickCat/symphony",
"path": "src/main/java/org/b3log/symphony/service/ClientMgmtService.java",
"license": "gpl-3.0",
"size": 4425
} | [
"org.b3log.latke.Keys",
"org.b3log.latke.logging.Level",
"org.b3log.latke.repository.RepositoryException",
"org.b3log.latke.repository.Transaction",
"org.b3log.latke.service.ServiceException",
"org.json.JSONObject"
] | import org.b3log.latke.Keys; import org.b3log.latke.logging.Level; import org.b3log.latke.repository.RepositoryException; import org.b3log.latke.repository.Transaction; import org.b3log.latke.service.ServiceException; import org.json.JSONObject; | import org.b3log.latke.*; import org.b3log.latke.logging.*; import org.b3log.latke.repository.*; import org.b3log.latke.service.*; import org.json.*; | [
"org.b3log.latke",
"org.json"
] | org.b3log.latke; org.json; | 773,684 |
return changeEvent;
}
/**
* Sets the value of the changeEvent property.
*
* @param value
* allowed object is
* {@link ConfChangeEvent } | return changeEvent; } /** * Sets the value of the changeEvent property. * * @param value * allowed object is * {@link ConfChangeEvent } | /**
* Gets the value of the changeEvent property.
*
* @return
* possible object is
* {@link ConfChangeEvent }
*
*/ | Gets the value of the changeEvent property | getChangeEvent | {
"repo_name": "eSDK/esdk_uc_native_java",
"path": "source/esdk_uc_native_professional_java/src/main/java/com/huawei/esdk/uc/professional/local/impl/autogen/callback/NotifyConfInfo.java",
"license": "apache-2.0",
"size": 2468
} | [
"com.huawei.esdk.uc.professional.local.bean.callback.ConfChangeEvent"
] | import com.huawei.esdk.uc.professional.local.bean.callback.ConfChangeEvent; | import com.huawei.esdk.uc.professional.local.bean.callback.*; | [
"com.huawei.esdk"
] | com.huawei.esdk; | 2,271,167 |
protected Node copyInto(Node n) {
super.copyInto(n);
AbstractNotation an = (AbstractNotation)n;
an.nodeName = nodeName;
an.publicId = publicId;
an.systemId = systemId;
return n;
} | Node function(Node n) { super.copyInto(n); AbstractNotation an = (AbstractNotation)n; an.nodeName = nodeName; an.publicId = publicId; an.systemId = systemId; return n; } | /**
* Copy the fields of the current node into the given node.
* @param n a node of the type of this.
*/ | Copy the fields of the current node into the given node | copyInto | {
"repo_name": "sflyphotobooks/crp-batik",
"path": "sources/org/apache/batik/dom/AbstractNotation.java",
"license": "apache-2.0",
"size": 4094
} | [
"org.w3c.dom.Node"
] | import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 109,259 |
public Processor createProcessor(URL configUrl) throws ConfigException {
Reader reader = null;
try {
reader = new InputStreamReader(configUrl.openStream());
return createProcessor(reader);
} catch (IOException e) {
throw new ConfigException("Can't open configuration: " + configUrl, e);
} finally {
try {
if (reader != null) {
reader.close();
}
} catch(IOException e) {
throw new ConfigException("Can't read configuration: " + configUrl, e);
}
}
}
| Processor function(URL configUrl) throws ConfigException { Reader reader = null; try { reader = new InputStreamReader(configUrl.openStream()); return createProcessor(reader); } catch (IOException e) { throw new ConfigException(STR + configUrl, e); } finally { try { if (reader != null) { reader.close(); } } catch(IOException e) { throw new ConfigException(STR + configUrl, e); } } } | /**
* <p>
* Read the configuration and return the Processor
* defined: this will include sub-Processors or following
* Processors if defined in the config.
* </p>
*
* @param configUrl URL of a config file.
* @return Processor the Processor defined by the
* config file at the passed URL.
* @throws ConfigException if any exception encountered.
*/ | Read the configuration and return the Processor defined: this will include sub-Processors or following Processors if defined in the config. | createProcessor | {
"repo_name": "JOverseer/joverseer",
"path": "txt2xmljar/src/org/txt2xml/config/ProcessorFactory.java",
"license": "bsd-3-clause",
"size": 10456
} | [
"java.io.IOException",
"java.io.InputStreamReader",
"java.io.Reader",
"org.txt2xml.core.Processor"
] | import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import org.txt2xml.core.Processor; | import java.io.*; import org.txt2xml.core.*; | [
"java.io",
"org.txt2xml.core"
] | java.io; org.txt2xml.core; | 1,527,686 |
public Uri getUri() {
return mUri;
} | Uri function() { return mUri; } | /**
* Get the URI of the media.
*
* @return The URI of the media.
*/ | Get the URI of the media | getUri | {
"repo_name": "uw-ictd/dfs-phishing-sms-client",
"path": "QKSMS/src/main/java/com/moez/QKSMS/model/MediaModel.java",
"license": "gpl-3.0",
"size": 8974
} | [
"android.net.Uri"
] | import android.net.Uri; | import android.net.*; | [
"android.net"
] | android.net; | 1,434,160 |
public final void setTimezone(int offset) {
if(offset<-14*60 || 14*60<offset)
if(offset!=DatatypeConstants.FIELD_UNDEFINED)
invalidFieldValue(TIMEZONE,offset);
this.timezone = offset;
} | final void function(int offset) { if(offset<-14*60 14*60<offset) if(offset!=DatatypeConstants.FIELD_UNDEFINED) invalidFieldValue(TIMEZONE,offset); this.timezone = offset; } | /**
* <p>Set the number of minutes in the timezone offset.</p>
*
* <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
*
* @param offset value constraints summarized in <a href="#datetimefield-timezone">
* timezone field of date/time field mapping table</a>.
*
* @throws IllegalArgumentException if <code>offset</code> parameter is
* outside value constraints for the field as specified in
* <a href="#datetimefieldmapping">date/time field mapping table</a>.
*/ | Set the number of minutes in the timezone offset. Unset this field by invoking the setter with a parameter value of <code>DatatypeConstants#FIELD_UNDEFINED</code> | setTimezone | {
"repo_name": "md-5/jdk10",
"path": "src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java",
"license": "gpl-2.0",
"size": 116736
} | [
"javax.xml.datatype.DatatypeConstants"
] | import javax.xml.datatype.DatatypeConstants; | import javax.xml.datatype.*; | [
"javax.xml"
] | javax.xml; | 2,060,978 |
public void sendData(JsonResult data); | void function(JsonResult data); | /**
* Send data to the client.
*
* @param data
* The data to be sent.
*/ | Send data to the client | sendData | {
"repo_name": "diqube/diqube",
"path": "diqube-ui/src/main/java/org/diqube/ui/websocket/request/CommandResultHandler.java",
"license": "agpl-3.0",
"size": 1494
} | [
"org.diqube.ui.websocket.result.JsonResult"
] | import org.diqube.ui.websocket.result.JsonResult; | import org.diqube.ui.websocket.result.*; | [
"org.diqube.ui"
] | org.diqube.ui; | 2,191,704 |
interface WithServiceResources {
WithCreate withServiceResources(List<String> serviceResources);
}
interface WithCreate extends Creatable<ServiceEndpointPolicyDefinition>, DefinitionStages.WithDescription, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithService, DefinitionStages.WithServiceResources {
}
}
interface Update extends Appliable<ServiceEndpointPolicyDefinition>, UpdateStages.WithDescription, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithService, UpdateStages.WithServiceResources {
} | interface WithServiceResources { WithCreate withServiceResources(List<String> serviceResources); } interface WithCreate extends Creatable<ServiceEndpointPolicyDefinition>, DefinitionStages.WithDescription, DefinitionStages.WithEtag, DefinitionStages.WithId, DefinitionStages.WithName, DefinitionStages.WithService, DefinitionStages.WithServiceResources { } } interface Update extends Appliable<ServiceEndpointPolicyDefinition>, UpdateStages.WithDescription, UpdateStages.WithEtag, UpdateStages.WithId, UpdateStages.WithName, UpdateStages.WithService, UpdateStages.WithServiceResources { } | /**
* Specifies serviceResources.
* @param serviceResources A list of service resources
* @return the next definition stage
*/ | Specifies serviceResources | withServiceResources | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/ServiceEndpointPolicyDefinition.java",
"license": "mit",
"size": 8813
} | [
"com.microsoft.azure.arm.model.Appliable",
"com.microsoft.azure.arm.model.Creatable",
"java.util.List"
] | import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.model.Creatable; import java.util.List; | import com.microsoft.azure.arm.model.*; import java.util.*; | [
"com.microsoft.azure",
"java.util"
] | com.microsoft.azure; java.util; | 2,674,081 |
protected String getMimeType(ServletContext c, String name) {
String type = c.getMimeType(name);
if (type == null) {
type = "application/octet-stream";
}
return type;
} | String function(ServletContext c, String name) { String type = c.getMimeType(name); if (type == null) { type = STR; } return type; } | /**
* A helper method for figuring out the MIME type for an enclosure.
*
* @param c A ServletContext
* @param name The filename
* @return Something sane for a MIME type.
*/ | A helper method for figuring out the MIME type for an enclosure | getMimeType | {
"repo_name": "tateshitah/jspwiki",
"path": "jspwiki-war/src/main/java/org/apache/wiki/rss/Feed.java",
"license": "apache-2.0",
"size": 5392
} | [
"javax.servlet.ServletContext"
] | import javax.servlet.ServletContext; | import javax.servlet.*; | [
"javax.servlet"
] | javax.servlet; | 924,301 |
public void testRemove() {
AuditServiceListener listener = EasyMock.createMock(AuditServiceListener.class);
AuditServiceThreadQueueImpl instance = new AuditServiceThreadQueueImpl(3,3,3,3);
instance.add(listener);
assertEquals(1, instance.getListeners().size());
instance.remove(listener);
assertEquals(0, instance.getListeners().size());
} | void function() { AuditServiceListener listener = EasyMock.createMock(AuditServiceListener.class); AuditServiceThreadQueueImpl instance = new AuditServiceThreadQueueImpl(3,3,3,3); instance.add(listener); assertEquals(1, instance.getListeners().size()); instance.remove(listener); assertEquals(0, instance.getListeners().size()); } | /**
* Test of remove method, of class AuditServiceThreadQueueImpl.
*/ | Test of remove method, of class AuditServiceThreadQueueImpl | testRemove | {
"repo_name": "Asqatasun/Asqatasun",
"path": "engine/asqatasun-engine/src/test/java/org/asqatasun/service/AuditServiceThreadQueueImplTest.java",
"license": "agpl-3.0",
"size": 14447
} | [
"org.easymock.EasyMock"
] | import org.easymock.EasyMock; | import org.easymock.*; | [
"org.easymock"
] | org.easymock; | 326,868 |
public static void println() throws NotInlinedPragma {
print("\r\n");
} | static void function() throws NotInlinedPragma { print("\r\n"); } | /**
* Prints a new line to the VM output stream.
*/ | Prints a new line to the VM output stream | println | {
"repo_name": "nejads/MqttMoped",
"path": "squawk/cldc/src/com/sun/squawk/VM.java",
"license": "gpl-2.0",
"size": 178144
} | [
"com.sun.squawk.pragma.NotInlinedPragma"
] | import com.sun.squawk.pragma.NotInlinedPragma; | import com.sun.squawk.pragma.*; | [
"com.sun.squawk"
] | com.sun.squawk; | 2,517,903 |
public BooleanGrid floodCopy(Point2D pp)
{
iPoint p = new iPoint(pp);
if(!this.inside(p) || !this.get(p))
return nothingThere;
BooleanGrid result = new BooleanGrid();
result.att = this.att;
result.visited = null;
result.rec= new iRectangle(this.rec);
result.bits = new BitSet(result.rec.size.x*result.rec.size.y);
// We implement our own floodfill stack, rather than using recursion to
// avoid having to specify a big Java stack just for this one function.
int top = 200000;
iPoint[] stack = new iPoint[top];
int sp = 0;
stack[sp] = p;
iPoint q;
while(sp > -1)
{
p = stack[sp];
sp--;
result.set(p, true);
for(int i = 1; i < 8; i = i+2)
{
q = p.add(neighbour[i]);
if(this.get(q) && !result.get(q))
{
sp++;
if(sp >= top)
{
Debug.e("BooleanGrid.floodCopy(): stack overflow!");
return result;
}
stack[sp] = q;
}
}
}
return result;
}
| BooleanGrid function(Point2D pp) { iPoint p = new iPoint(pp); if(!this.inside(p) !this.get(p)) return nothingThere; BooleanGrid result = new BooleanGrid(); result.att = this.att; result.visited = null; result.rec= new iRectangle(this.rec); result.bits = new BitSet(result.rec.size.x*result.rec.size.y); int top = 200000; iPoint[] stack = new iPoint[top]; int sp = 0; stack[sp] = p; iPoint q; while(sp > -1) { p = stack[sp]; sp--; result.set(p, true); for(int i = 1; i < 8; i = i+2) { q = p.add(neighbour[i]); if(this.get(q) && !result.get(q)) { sp++; if(sp >= top) { Debug.e(STR); return result; } stack[sp] = q; } } } return result; } | /**
* Recursive flood-fill of solid pixels from p to return a BooleanGrid of
* just the shape connected to that pixel.
* @param p
* @return
*/ | Recursive flood-fill of solid pixels from p to return a BooleanGrid of just the shape connected to that pixel | floodCopy | {
"repo_name": "alex1818/host",
"path": "src/org/reprap/geometry/polygons/BooleanGrid.java",
"license": "lgpl-2.1",
"size": 62066
} | [
"java.util.BitSet",
"org.reprap.utilities.Debug"
] | import java.util.BitSet; import org.reprap.utilities.Debug; | import java.util.*; import org.reprap.utilities.*; | [
"java.util",
"org.reprap.utilities"
] | java.util; org.reprap.utilities; | 20,137 |
assert job != null : "tried to add null job";
Queue<Schedulable> queue = priorities.get(priority.ordinal());
if (queue.remove(job)) {
// Do nothing else
queue.add(job);
return;
} else {
queue.add(job);
jobCount++;
jobCounter.jobAdded(priority, job);
}
} | assert job != null : STR; Queue<Schedulable> queue = priorities.get(priority.ordinal()); if (queue.remove(job)) { queue.add(job); return; } else { queue.add(job); jobCount++; jobCounter.jobAdded(priority, job); } } | /**
* Add a job at the given priority
*
* @param priority
* @param job
*/ | Add a job at the given priority | add | {
"repo_name": "nelsonsilva/wave-protocol",
"path": "src/org/waveprotocol/wave/client/scheduler/JobRegistry.java",
"license": "apache-2.0",
"size": 5757
} | [
"java.util.Queue",
"org.waveprotocol.wave.client.scheduler.Scheduler"
] | import java.util.Queue; import org.waveprotocol.wave.client.scheduler.Scheduler; | import java.util.*; import org.waveprotocol.wave.client.scheduler.*; | [
"java.util",
"org.waveprotocol.wave"
] | java.util; org.waveprotocol.wave; | 453,423 |
public void setInlineComponents(List<Component> inlineComponents) {
this.inlineComponents = inlineComponents;
}
/**
* {@inheritDoc}
| void function(List<Component> inlineComponents) { this.inlineComponents = inlineComponents; } /** * {@inheritDoc} | /**
* Sets the inlineComponents used by index in the checkboxLabel that has rich message component index tags
*
* @param inlineComponents
*/ | Sets the inlineComponents used by index in the checkboxLabel that has rich message component index tags | setInlineComponents | {
"repo_name": "geothomasp/kualico-rice-kc",
"path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/uif/control/CheckboxControl.java",
"license": "apache-2.0",
"size": 5711
} | [
"java.util.List",
"org.kuali.rice.krad.uif.component.Component"
] | import java.util.List; import org.kuali.rice.krad.uif.component.Component; | import java.util.*; import org.kuali.rice.krad.uif.component.*; | [
"java.util",
"org.kuali.rice"
] | java.util; org.kuali.rice; | 222,533 |
public static CAS getView(CAS cas, String viewName, CAS fallback) {
CAS view;
try {
view = cas.getView(viewName);
} catch (CASRuntimeException e) {
// use fall-back view instead
view = fallback;
}
return view;
}
| static CAS function(CAS cas, String viewName, CAS fallback) { CAS view; try { view = cas.getView(viewName); } catch (CASRuntimeException e) { view = fallback; } return view; } | /**
* Convenience method to get the specified view or a default view if the requested view does not
* exist. The default can also be {@code null}.
*
* @param cas
* a CAS
* @param viewName
* the requested view.
* @param fallback
* the default view if the requested view does not exist.
* @return the requested view or the default if the requested view does not exist.
*/ | Convenience method to get the specified view or a default view if the requested view does not exist. The default can also be null | getView | {
"repo_name": "agentlab/uimafit-v3-osgi",
"path": "bundles/org.apache.uima.fit/src/main/java/org/apache/uima/fit/util/CasUtil.java",
"license": "apache-2.0",
"size": 47670
} | [
"org.apache.uima.cas.CASRuntimeException"
] | import org.apache.uima.cas.CASRuntimeException; | import org.apache.uima.cas.*; | [
"org.apache.uima"
] | org.apache.uima; | 1,701,678 |
if (calendar.isEmpty()) {
throw new NoDataToExportException("To export to iCal, the calendar should have at least one"
+ " event");
}
Writer writer = descriptor.getWriter();
try {
String iCalCalendar = getICalCodec().encode(calendar.getEvents());
writer.write(iCalCalendar);
writer.close();
} catch (Exception e) {
try {
if (writer != null) {
writer.close();
}
} catch (Exception ex) {
SilverTrace.error("export.ical", getClass().getSimpleName() + ".exportInICal()",
"root.EX_NO_MESSAGES", ex);
}
SilverTrace.error("export.ical", getClass().getSimpleName() + ".exportInICal()",
"roor.EX_NO_MESSAGES", e);
throw new ExportException(e.getMessage(), e);
}
} | if (calendar.isEmpty()) { throw new NoDataToExportException(STR + STR); } Writer writer = descriptor.getWriter(); try { String iCalCalendar = getICalCodec().encode(calendar.getEvents()); writer.write(iCalCalendar); writer.close(); } catch (Exception e) { try { if (writer != null) { writer.close(); } } catch (Exception ex) { SilverTrace.error(STR, getClass().getSimpleName() + STR, STR, ex); } SilverTrace.error(STR, getClass().getSimpleName() + STR, STR, e); throw new ExportException(e.getMessage(), e); } } | /**
* Exports the specified events with a writer in the iCal format.
* If no events are specified, then a NoDataToExportException is thrown as no export can be done.
* The writer with which the events have to be exported is provided by the specified
* export descriptor.
* @param events the events of a calendar to export.
* @param descriptor the export descriptor in which is passed the writer with which
* the events should be exported.
* @throws ExportException if the export fails (an IO issue occurs with the writer,
* no events to export, ...).
*/ | Exports the specified events with a writer in the iCal format. If no events are specified, then a NoDataToExportException is thrown as no export can be done. The writer with which the events have to be exported is provided by the specified export descriptor | export | {
"repo_name": "stephaneperry/Silverpeas-Core",
"path": "lib-core/src/main/java/com/silverpeas/export/ical/ICalExporter.java",
"license": "agpl-3.0",
"size": 3409
} | [
"com.silverpeas.export.ExportException",
"com.silverpeas.export.NoDataToExportException",
"com.stratelia.silverpeas.silvertrace.SilverTrace",
"java.io.Writer"
] | import com.silverpeas.export.ExportException; import com.silverpeas.export.NoDataToExportException; import com.stratelia.silverpeas.silvertrace.SilverTrace; import java.io.Writer; | import com.silverpeas.export.*; import com.stratelia.silverpeas.silvertrace.*; import java.io.*; | [
"com.silverpeas.export",
"com.stratelia.silverpeas",
"java.io"
] | com.silverpeas.export; com.stratelia.silverpeas; java.io; | 2,538,835 |
private int isModified(PeptizerPeptideHit aPh, String aModificationName, String aModifiedResidue) {
boolean lModified = false;
for (PeptizerModification mod : aPh.getModifications()) {
if (mod.getModificationSite() > 0 && mod.getModificationSite() < aPh.getSequence().length()) {
if (aModifiedResidue.toUpperCase().equals(aPh.getSequence().charAt(mod.getModificationSite() - 1) + "")) {
if (mod.getName().toLowerCase().indexOf(aModificationName.toLowerCase()) > -1){
return mod.getModificationSite();
}
}
}
}
return -1;
} | int function(PeptizerPeptideHit aPh, String aModificationName, String aModifiedResidue) { boolean lModified = false; for (PeptizerModification mod : aPh.getModifications()) { if (mod.getModificationSite() > 0 && mod.getModificationSite() < aPh.getSequence().length()) { if (aModifiedResidue.toUpperCase().equals(aPh.getSequence().charAt(mod.getModificationSite() - 1) + "")) { if (mod.getName().toLowerCase().indexOf(aModificationName.toLowerCase()) > -1){ return mod.getModificationSite(); } } } } return -1; } | /**
* This Method Checks the modification status of a PeptideHit, the purpose
*
* @param aPh - PeptideHit upon inspection.
* @param aModificationName String for
* @return boolean - true if peptidehit contains the Modification as described by aModificationName.
*/ | This Method Checks the modification status of a PeptideHit, the purpose | isModified | {
"repo_name": "compomics/peptizer",
"path": "src/main/java/com/compomics/peptizer/util/agents/ModificationCoverageAgent.java",
"license": "apache-2.0",
"size": 17202
} | [
"com.compomics.peptizer.util.datatools.interfaces.PeptizerModification",
"com.compomics.peptizer.util.datatools.interfaces.PeptizerPeptideHit"
] | import com.compomics.peptizer.util.datatools.interfaces.PeptizerModification; import com.compomics.peptizer.util.datatools.interfaces.PeptizerPeptideHit; | import com.compomics.peptizer.util.datatools.interfaces.*; | [
"com.compomics.peptizer"
] | com.compomics.peptizer; | 2,074,414 |
URL createTargetUrl(Host host) {
Integer port = host.getPort();
String portPart = "";
String targetHost = "";
if (port!=null && port > 0) {
portPart = ":"+port;
}
targetHost = "http://"+ host.getIpAddress() + portPart;
String targetContext = host.getContext();
if(false == targetContext.startsWith("/")) {
targetContext = "/"+targetContext;
}
String url = targetHost + targetContext;
try {
return new URL(url);
} catch (MalformedURLException e) {
throw new ControlCommandException("Failed to execute body: "+url);
}
}
| URL createTargetUrl(Host host) { Integer port = host.getPort(); String portPart = STRSTR:STRhttp: String targetContext = host.getContext(); if(false == targetContext.startsWith("/")) { targetContext = "/"+targetContext; } String url = targetHost + targetContext; try { return new URL(url); } catch (MalformedURLException e) { throw new ControlCommandException(STR+url); } } | /**
* Creates the target body to execute by the http client
* @param host the host with all info about the target, ie ipaddress, port, context
* @param parameters the control parameters, added as body parameters
* @return the target body to execute by the http client
*/ | Creates the target body to execute by the http client | createTargetUrl | {
"repo_name": "rymdbullen/clustercontrol2",
"path": "core/src/main/java/net/local/clustercontrol/core/http/impl/HttpClient.java",
"license": "gpl-3.0",
"size": 6044
} | [
"java.net.MalformedURLException",
"net.local.clustercontrol.api.model.xml.Host",
"net.local.clustercontrol.core.logic.ControlCommandException"
] | import java.net.MalformedURLException; import net.local.clustercontrol.api.model.xml.Host; import net.local.clustercontrol.core.logic.ControlCommandException; | import java.net.*; import net.local.clustercontrol.api.model.xml.*; import net.local.clustercontrol.core.logic.*; | [
"java.net",
"net.local.clustercontrol"
] | java.net; net.local.clustercontrol; | 1,640,590 |
@Test
public void testCancelDistributeJoin() throws Exception {
IgniteInternalFuture cancelRes = cancel(1, asyncCancel);
final int ROWS_ALLOWED_TO_PROCESS_AFTER_CANCEL = MAX_ROWS - 1;
GridTestUtils.assertThrows(log, () -> {
ignite.cache(DEFAULT_CACHE_NAME).query(
new SqlFieldsQuery("SELECT p1.rec_id, p1.id, p2.rec_id " +
"FROM PERS1.Person p1 JOIN PERS2.Person p2 " +
"ON p1.id = p2.id " +
"AND shouldNotBeCalledMoreThan(" + ROWS_ALLOWED_TO_PROCESS_AFTER_CANCEL + ")" +
"AND awaitLatchCancelled() = 0")
.setDistributedJoins(true)
).getAll();
return null;
}, CacheException.class, "The query was cancelled while executing.");
// Ensures that there were no exceptions within async cancellation process.
cancelRes.get(CHECK_RESULT_TIMEOUT);
} | void function() throws Exception { IgniteInternalFuture cancelRes = cancel(1, asyncCancel); final int ROWS_ALLOWED_TO_PROCESS_AFTER_CANCEL = MAX_ROWS - 1; GridTestUtils.assertThrows(log, () -> { ignite.cache(DEFAULT_CACHE_NAME).query( new SqlFieldsQuery(STR + STR + STR + STR + ROWS_ALLOWED_TO_PROCESS_AFTER_CANCEL + ")" + STR) .setDistributedJoins(true) ).getAll(); return null; }, CacheException.class, STR); cancelRes.get(CHECK_RESULT_TIMEOUT); } | /**
* Check distributed query can be canceled.
*/ | Check distributed query can be canceled | testCancelDistributeJoin | {
"repo_name": "SomeFire/ignite",
"path": "modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryTest.java",
"license": "apache-2.0",
"size": 56085
} | [
"javax.cache.CacheException",
"org.apache.ignite.cache.query.SqlFieldsQuery",
"org.apache.ignite.internal.IgniteInternalFuture",
"org.apache.ignite.testframework.GridTestUtils"
] | import javax.cache.CacheException; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.testframework.GridTestUtils; | import javax.cache.*; import org.apache.ignite.cache.query.*; import org.apache.ignite.internal.*; import org.apache.ignite.testframework.*; | [
"javax.cache",
"org.apache.ignite"
] | javax.cache; org.apache.ignite; | 792,403 |
public void testPrimaryKeyCQL() throws ApplicationException
{
CQLQuery criteria = new CQLQuery();
CQLObject object = new CQLObject();
object.setName("gov.nih.nci.cacoresdk.domain.other.primarykey.StringKey");
object.setAttribute(new CQLAttribute("id",CQLPredicate.EQUAL_TO,"ID1"));
criteria.setTarget(object);
CQL2HQL converter = new CQL2HQL(getClassCache());
HQLCriteria hqlCriteria = converter.translate(criteria, false, false);
Collection results = getApplicationService().query(hqlCriteria);
assertNotNull(results);
assertEquals(1,results.size());
}
| void function() throws ApplicationException { CQLQuery criteria = new CQLQuery(); CQLObject object = new CQLObject(); object.setName(STR); object.setAttribute(new CQLAttribute("id",CQLPredicate.EQUAL_TO,"ID1")); criteria.setTarget(object); CQL2HQL converter = new CQL2HQL(getClassCache()); HQLCriteria hqlCriteria = converter.translate(criteria, false, false); Collection results = getApplicationService().query(hqlCriteria); assertNotNull(results); assertEquals(1,results.size()); } | /**
* Uses CQL for search
* Searches by the Double data type
* Verifies size of the result set
*
* @throws ApplicationException
*/ | Uses CQL for search Searches by the Double data type Verifies size of the result set | testPrimaryKeyCQL | {
"repo_name": "NCIP/cacore-sdk",
"path": "sdk-toolkit/example-project/junit/src/test/gov/nih/nci/cacoresdk/domain/other/primarykey/StringKeyTest.java",
"license": "bsd-3-clause",
"size": 2944
} | [
"gov.nih.nci.system.applicationservice.ApplicationException",
"gov.nih.nci.system.query.cql.CQLAttribute",
"gov.nih.nci.system.query.cql.CQLObject",
"gov.nih.nci.system.query.cql.CQLPredicate",
"gov.nih.nci.system.query.cql.CQLQuery",
"gov.nih.nci.system.query.hibernate.HQLCriteria",
"java.util.Collection"
] | import gov.nih.nci.system.applicationservice.ApplicationException; import gov.nih.nci.system.query.cql.CQLAttribute; import gov.nih.nci.system.query.cql.CQLObject; import gov.nih.nci.system.query.cql.CQLPredicate; import gov.nih.nci.system.query.cql.CQLQuery; import gov.nih.nci.system.query.hibernate.HQLCriteria; import java.util.Collection; | import gov.nih.nci.system.applicationservice.*; import gov.nih.nci.system.query.cql.*; import gov.nih.nci.system.query.hibernate.*; import java.util.*; | [
"gov.nih.nci",
"java.util"
] | gov.nih.nci; java.util; | 2,426,434 |
public static void setSubtitleOutputParameters(String fileName, DLNAMediaInfo media, OutputParams params) {
// Use device-specific DMS conf
PmsConfiguration configuration = PMS.getConfiguration(params);
String currentLang = null;
DLNAMediaSubtitle matchedSub = null;
if (params.aid != null) {
currentLang = params.aid.getLang();
}
if (params.sid != null && params.sid.getId() == -1) {
LOGGER.trace("Don't want subtitles!");
params.sid = null;
return;
}
if (params.sid != null && !StringUtils.isEmpty(params.sid.getLiveSubURL())) {
LOGGER.debug("Live subtitles " + params.sid.getLiveSubURL());
try {
matchedSub = params.sid;
String file = OpenSubtitle.fetchSubs(matchedSub.getLiveSubURL(), matchedSub.getLiveSubFile());
if (!StringUtils.isEmpty(file)) {
matchedSub.setExternalFile(new File(file), null);
params.sid = matchedSub;
return;
}
} catch (IOException e) {
}
}
StringTokenizer st = new StringTokenizer(configuration.getAudioSubLanguages(), ";");
boolean matchedInternalSubtitles = false;
boolean matchedExternalSubtitles = false;
while (st.hasMoreTokens()) {
String pair = st.nextToken();
if (pair.contains(",")) {
String audio = pair.substring(0, pair.indexOf(','));
String sub = pair.substring(pair.indexOf(',') + 1);
audio = audio.trim();
sub = sub.trim();
LOGGER.trace("Searching for a match for: " + currentLang + " with " + audio + " and " + sub);
if (Iso639.isCodesMatching(audio, currentLang) || (currentLang != null && audio.equals("*"))) {
if (sub.equals("off")) {
if (configuration.isForceExternalSubtitles()) {
for (DLNAMediaSubtitle subPresent : media.getSubtitleTracksList()) {
if (subPresent.getExternalFile() != null) {
matchedSub = subPresent;
matchedExternalSubtitles = true;
LOGGER.trace("Ignoring the \"off\" language because there are external subtitles");
break;
}
}
}
if (!matchedExternalSubtitles) {
matchedSub = new DLNAMediaSubtitle();
matchedSub.setLang("off");
}
} else {
for (DLNAMediaSubtitle subPresent : media.getSubtitleTracksList()) {
if (subPresent.matchCode(sub) || sub.equals("*")) {
if (subPresent.getExternalFile() != null) {
if (configuration.isAutoloadExternalSubtitles()) {
// Subtitle is external and we want external subtitles, look no further
matchedSub = subPresent;
LOGGER.trace("Matched external subtitles track: " + matchedSub);
break;
}
// Subtitle is external but we do not want external subtitles, keep searching
LOGGER.trace("External subtitles ignored because of user setting: " + subPresent);
} else if (!matchedInternalSubtitles) {
matchedSub = subPresent;
LOGGER.trace("Matched internal subtitles track: " + matchedSub);
if (configuration.isAutoloadExternalSubtitles()) {
// Subtitle is internal and we will wait to see if an external one is available instead
matchedInternalSubtitles = true;
} else {
// Subtitle is internal and we will use it
break;
}
}
}
}
}
if (matchedSub != null && !matchedInternalSubtitles) {
break;
}
}
}
}
if (matchedSub == null && configuration.isForceExternalSubtitles()) {
for (DLNAMediaSubtitle subPresent : media.getSubtitleTracksList()) {
if (subPresent.getExternalFile() != null) {
matchedSub = subPresent;
LOGGER.trace("Matched external subtitles track that did not match language preferences: " + matchedSub);
break;
}
}
}
if (matchedSub != null && params.sid == null) {
if (configuration.isDisableSubtitles() || (matchedSub.getLang() != null && matchedSub.getLang().equals("off"))) {
LOGGER.trace("Disabled the subtitles: " + matchedSub);
} else {
params.sid = matchedSub;
}
}
if (!configuration.isDisableSubtitles() && params.sid == null && media != null) {
// Check for subtitles again
File video = new File(fileName);
FileUtil.isSubtitlesExists(video, media, false);
if (configuration.isAutoloadExternalSubtitles()) {
boolean forcedSubsFound = false;
// Priority to external subtitles
for (DLNAMediaSubtitle sub : media.getSubtitleTracksList()) {
if (matchedSub != null && matchedSub.getLang() != null && matchedSub.getLang().equals("off")) {
st = new StringTokenizer(configuration.getForcedSubtitleTags(), ",");
while (sub.getSubtitlesTrackTitleFromMetadata() != null && st.hasMoreTokens()) {
String forcedTags = st.nextToken();
forcedTags = forcedTags.trim();
if (
sub.getSubtitlesTrackTitleFromMetadata().toLowerCase().contains(forcedTags) &&
Iso639.isCodesMatching(sub.getLang(), configuration.getForcedSubtitleLanguage())
) {
LOGGER.trace(
"Forcing preferred subtitles: {}/{}", sub.getLang(), sub.getSubtitlesTrackTitleFromMetadata()
);
LOGGER.trace("Forced subtitles track: " + sub);
if (sub.getExternalFile() != null) {
LOGGER.trace("Found external forced file: " + sub.getExternalFile().getAbsolutePath());
}
params.sid = sub;
forcedSubsFound = true;
break;
}
}
if (forcedSubsFound) {
break;
}
} else {
LOGGER.trace("Found subtitles track: " + sub);
if (sub.getExternalFile() != null) {
LOGGER.trace("Found external file: " + sub.getExternalFile().getAbsolutePath());
params.sid = sub;
break;
}
}
}
}
if (
matchedSub != null &&
matchedSub.getLang() != null &&
matchedSub.getLang().equals("off")
) {
return;
}
if (params.sid == null) {
st = new StringTokenizer(UMSUtils.getLangList(params.mediaRenderer), ",");
while (st.hasMoreTokens()) {
String lang = st.nextToken();
lang = lang.trim();
LOGGER.trace("Looking for a subtitle track with lang: " + lang);
for (DLNAMediaSubtitle sub : media.getSubtitleTracksList()) {
if (
sub.matchCode(lang) &&
!(
!configuration.isAutoloadExternalSubtitles() &&
sub.getExternalFile() != null
)
) {
params.sid = sub;
LOGGER.trace("Matched subtitles track: " + params.sid);
return;
}
}
}
}
}
} | static void function(String fileName, DLNAMediaInfo media, OutputParams params) { PmsConfiguration configuration = PMS.getConfiguration(params); String currentLang = null; DLNAMediaSubtitle matchedSub = null; if (params.aid != null) { currentLang = params.aid.getLang(); } if (params.sid != null && params.sid.getId() == -1) { LOGGER.trace(STR); params.sid = null; return; } if (params.sid != null && !StringUtils.isEmpty(params.sid.getLiveSubURL())) { LOGGER.debug(STR + params.sid.getLiveSubURL()); try { matchedSub = params.sid; String file = OpenSubtitle.fetchSubs(matchedSub.getLiveSubURL(), matchedSub.getLiveSubFile()); if (!StringUtils.isEmpty(file)) { matchedSub.setExternalFile(new File(file), null); params.sid = matchedSub; return; } } catch (IOException e) { } } StringTokenizer st = new StringTokenizer(configuration.getAudioSubLanguages(), ";"); boolean matchedInternalSubtitles = false; boolean matchedExternalSubtitles = false; while (st.hasMoreTokens()) { String pair = st.nextToken(); if (pair.contains(",")) { String audio = pair.substring(0, pair.indexOf(',')); String sub = pair.substring(pair.indexOf(',') + 1); audio = audio.trim(); sub = sub.trim(); LOGGER.trace(STR + currentLang + STR + audio + STR + sub); if (Iso639.isCodesMatching(audio, currentLang) (currentLang != null && audio.equals("*"))) { if (sub.equals("off")) { if (configuration.isForceExternalSubtitles()) { for (DLNAMediaSubtitle subPresent : media.getSubtitleTracksList()) { if (subPresent.getExternalFile() != null) { matchedSub = subPresent; matchedExternalSubtitles = true; LOGGER.trace(STRoff\STR); break; } } } if (!matchedExternalSubtitles) { matchedSub = new DLNAMediaSubtitle(); matchedSub.setLang("off"); } } else { for (DLNAMediaSubtitle subPresent : media.getSubtitleTracksList()) { if (subPresent.matchCode(sub) sub.equals("*")) { if (subPresent.getExternalFile() != null) { if (configuration.isAutoloadExternalSubtitles()) { matchedSub = subPresent; LOGGER.trace(STR + matchedSub); break; } LOGGER.trace(STR + subPresent); } else if (!matchedInternalSubtitles) { matchedSub = subPresent; LOGGER.trace(STR + matchedSub); if (configuration.isAutoloadExternalSubtitles()) { matchedInternalSubtitles = true; } else { break; } } } } } if (matchedSub != null && !matchedInternalSubtitles) { break; } } } } if (matchedSub == null && configuration.isForceExternalSubtitles()) { for (DLNAMediaSubtitle subPresent : media.getSubtitleTracksList()) { if (subPresent.getExternalFile() != null) { matchedSub = subPresent; LOGGER.trace(STR + matchedSub); break; } } } if (matchedSub != null && params.sid == null) { if (configuration.isDisableSubtitles() (matchedSub.getLang() != null && matchedSub.getLang().equals("off"))) { LOGGER.trace(STR + matchedSub); } else { params.sid = matchedSub; } } if (!configuration.isDisableSubtitles() && params.sid == null && media != null) { File video = new File(fileName); FileUtil.isSubtitlesExists(video, media, false); if (configuration.isAutoloadExternalSubtitles()) { boolean forcedSubsFound = false; for (DLNAMediaSubtitle sub : media.getSubtitleTracksList()) { if (matchedSub != null && matchedSub.getLang() != null && matchedSub.getLang().equals("off")) { st = new StringTokenizer(configuration.getForcedSubtitleTags(), ","); while (sub.getSubtitlesTrackTitleFromMetadata() != null && st.hasMoreTokens()) { String forcedTags = st.nextToken(); forcedTags = forcedTags.trim(); if ( sub.getSubtitlesTrackTitleFromMetadata().toLowerCase().contains(forcedTags) && Iso639.isCodesMatching(sub.getLang(), configuration.getForcedSubtitleLanguage()) ) { LOGGER.trace( STR, sub.getLang(), sub.getSubtitlesTrackTitleFromMetadata() ); LOGGER.trace(STR + sub); if (sub.getExternalFile() != null) { LOGGER.trace(STR + sub.getExternalFile().getAbsolutePath()); } params.sid = sub; forcedSubsFound = true; break; } } if (forcedSubsFound) { break; } } else { LOGGER.trace(STR + sub); if (sub.getExternalFile() != null) { LOGGER.trace(STR + sub.getExternalFile().getAbsolutePath()); params.sid = sub; break; } } } } if ( matchedSub != null && matchedSub.getLang() != null && matchedSub.getLang().equals("off") ) { return; } if (params.sid == null) { st = new StringTokenizer(UMSUtils.getLangList(params.mediaRenderer), ","); while (st.hasMoreTokens()) { String lang = st.nextToken(); lang = lang.trim(); LOGGER.trace(STR + lang); for (DLNAMediaSubtitle sub : media.getSubtitleTracksList()) { if ( sub.matchCode(lang) && !( !configuration.isAutoloadExternalSubtitles() && sub.getExternalFile() != null ) ) { params.sid = sub; LOGGER.trace(STR + params.sid); return; } } } } } } | /**
* This method populates the supplied {@link OutputParams} object with the
* correct subtitles (sid) based on the given filename, its MediaInfo
* metadata and DMS configuration settings.
*
* TODO: Rewrite this crazy method to be more concise and logical.
*
* @param fileName The file name used to determine the availability of
* subtitles.
* @param media The MediaInfo metadata for the file.
* @param params The parameters to populate.
*/ | This method populates the supplied <code>OutputParams</code> object with the correct subtitles (sid) based on the given filename, its MediaInfo metadata and DMS configuration settings | setSubtitleOutputParameters | {
"repo_name": "valib/UniversalMediaServer",
"path": "src/main/java/net/pms/encoders/Player.java",
"license": "gpl-2.0",
"size": 40768
} | [
"java.io.File",
"java.io.IOException",
"java.util.StringTokenizer",
"net.pms.PMS",
"net.pms.configuration.PmsConfiguration",
"net.pms.dlna.DLNAMediaInfo",
"net.pms.dlna.DLNAMediaSubtitle",
"net.pms.io.OutputParams",
"net.pms.util.FileUtil",
"net.pms.util.Iso639",
"net.pms.util.OpenSubtitle",
"net.pms.util.UMSUtils",
"org.apache.commons.lang3.StringUtils"
] | import java.io.File; import java.io.IOException; import java.util.StringTokenizer; import net.pms.PMS; import net.pms.configuration.PmsConfiguration; import net.pms.dlna.DLNAMediaInfo; import net.pms.dlna.DLNAMediaSubtitle; import net.pms.io.OutputParams; import net.pms.util.FileUtil; import net.pms.util.Iso639; import net.pms.util.OpenSubtitle; import net.pms.util.UMSUtils; import org.apache.commons.lang3.StringUtils; | import java.io.*; import java.util.*; import net.pms.*; import net.pms.configuration.*; import net.pms.dlna.*; import net.pms.io.*; import net.pms.util.*; import org.apache.commons.lang3.*; | [
"java.io",
"java.util",
"net.pms",
"net.pms.configuration",
"net.pms.dlna",
"net.pms.io",
"net.pms.util",
"org.apache.commons"
] | java.io; java.util; net.pms; net.pms.configuration; net.pms.dlna; net.pms.io; net.pms.util; org.apache.commons; | 2,131,839 |
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
{
worldIn.setBlockState(pos, state, 3);
this.notifyHook(worldIn, pos, state);
} | void function(World worldIn, BlockPos pos, IBlockState state) { worldIn.setBlockState(pos, state, 3); this.notifyHook(worldIn, pos, state); } | /**
* Called after the block is set in the Chunk data, but before the Tile Entity is set
*/ | Called after the block is set in the Chunk data, but before the Tile Entity is set | onBlockAdded | {
"repo_name": "TheGreatAndPowerfulWeegee/wipunknown",
"path": "build/tmp/recompileMc/sources/net/minecraft/block/BlockTripWire.java",
"license": "gpl-3.0",
"size": 11630
} | [
"net.minecraft.block.state.IBlockState",
"net.minecraft.util.math.BlockPos",
"net.minecraft.world.World"
] | import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; | import net.minecraft.block.state.*; import net.minecraft.util.math.*; import net.minecraft.world.*; | [
"net.minecraft.block",
"net.minecraft.util",
"net.minecraft.world"
] | net.minecraft.block; net.minecraft.util; net.minecraft.world; | 1,398,436 |
public java.util.List<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.CyclicEnumerationHLAPI> getInput_cyclicEnumerations_CyclicEnumerationHLAPI(){
java.util.List<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.CyclicEnumerationHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.CyclicEnumerationHLAPI>();
for (Sort elemnt : getInput()) {
if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.cyclicEnumerations.impl.CyclicEnumerationImpl.class)){
retour.add(new fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.CyclicEnumerationHLAPI(
(fr.lip6.move.pnml.hlpn.cyclicEnumerations.CyclicEnumeration)elemnt
));
}
}
return retour;
}
| java.util.List<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.CyclicEnumerationHLAPI> function(){ java.util.List<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.CyclicEnumerationHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.CyclicEnumerationHLAPI>(); for (Sort elemnt : getInput()) { if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.cyclicEnumerations.impl.CyclicEnumerationImpl.class)){ retour.add(new fr.lip6.move.pnml.hlpn.cyclicEnumerations.hlapi.CyclicEnumerationHLAPI( (fr.lip6.move.pnml.hlpn.cyclicEnumerations.CyclicEnumeration)elemnt )); } } return retour; } | /**
* This accessor return a list of encapsulated subelement, only of CyclicEnumerationHLAPI kind.
* WARNING : this method can creates a lot of new object in memory.
*/ | This accessor return a list of encapsulated subelement, only of CyclicEnumerationHLAPI kind. WARNING : this method can creates a lot of new object in memory | getInput_cyclicEnumerations_CyclicEnumerationHLAPI | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/lists/hlapi/LengthHLAPI.java",
"license": "epl-1.0",
"size": 108262
} | [
"fr.lip6.move.pnml.hlpn.terms.Sort",
"java.util.ArrayList",
"java.util.List"
] | import fr.lip6.move.pnml.hlpn.terms.Sort; import java.util.ArrayList; import java.util.List; | import fr.lip6.move.pnml.hlpn.terms.*; import java.util.*; | [
"fr.lip6.move",
"java.util"
] | fr.lip6.move; java.util; | 379,282 |
public Iterator<E> iterator() {
return m.navigableKeySet().iterator();
} | Iterator<E> function() { return m.navigableKeySet().iterator(); } | /**
* Returns an iterator over the elements in this set in ascending order.
*
* @return an iterator over the elements in this set in ascending order
*/ | Returns an iterator over the elements in this set in ascending order | iterator | {
"repo_name": "mirkosertic/Bytecoder",
"path": "classlib/java.base/src/main/resources/META-INF/modules/java.base/classes/java/util/concurrent/ConcurrentSkipListSet.java",
"license": "apache-2.0",
"size": 19583
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 2,581,570 |
//-------------------------------------------------------------------------
public TradeInfoBuilder parseTradeInfo(XmlElement tradeEl) {
XmlElement tradeHeaderEl = tradeEl.getChild("tradeHeader");
LocalDate tradeDate = parseDate(tradeHeaderEl.getChild("tradeDate"));
return tradeInfoParser.parseTrade(this, tradeDate, parseAllTradeIds(tradeHeaderEl));
} | TradeInfoBuilder function(XmlElement tradeEl) { XmlElement tradeHeaderEl = tradeEl.getChild(STR); LocalDate tradeDate = parseDate(tradeHeaderEl.getChild(STR)); return tradeInfoParser.parseTrade(this, tradeDate, parseAllTradeIds(tradeHeaderEl)); } | /**
* Parses the trade header element.
* <p>
* This parses the trade date and identifier.
*
* @param tradeEl the trade element
* @return the trade info builder
* @throws RuntimeException if unable to parse
*/ | Parses the trade header element. This parses the trade date and identifier | parseTradeInfo | {
"repo_name": "ChinaQuants/Strata",
"path": "modules/loader/src/main/java/com/opengamma/strata/loader/fpml/FpmlDocument.java",
"license": "apache-2.0",
"size": 35318
} | [
"com.opengamma.strata.collect.io.XmlElement",
"com.opengamma.strata.product.TradeInfoBuilder",
"java.time.LocalDate"
] | import com.opengamma.strata.collect.io.XmlElement; import com.opengamma.strata.product.TradeInfoBuilder; import java.time.LocalDate; | import com.opengamma.strata.collect.io.*; import com.opengamma.strata.product.*; import java.time.*; | [
"com.opengamma.strata",
"java.time"
] | com.opengamma.strata; java.time; | 1,501,352 |
public Money calculateSavingsForOrderItem(PromotableOrderItem orderItem, int qtyToReceiveSavings); | Money function(PromotableOrderItem orderItem, int qtyToReceiveSavings); | /**
* Public only for unit testing - not intended to be called
*/ | Public only for unit testing - not intended to be called | calculateSavingsForOrderItem | {
"repo_name": "akdasari/SparkCore",
"path": "spark-framework/src/main/java/org/sparkcommerce/core/offer/service/discount/domain/PromotableCandidateItemOffer.java",
"license": "apache-2.0",
"size": 3440
} | [
"org.sparkcommerce.common.money.Money"
] | import org.sparkcommerce.common.money.Money; | import org.sparkcommerce.common.money.*; | [
"org.sparkcommerce.common"
] | org.sparkcommerce.common; | 335,459 |
protected Object getConfiguration(String path) {
Object value = null;
int start = 0, pos = -1;
PropertyValue args[] = new PropertyValue[1];
if (this.configProvider == null) {
Object service = null;
try {
service = this.serviceManager.createInstanceWithContext(
"com.sun.star.configuration.ConfigurationProvider",
this.bootstrapContext);
} catch (com.sun.star.uno.Exception e) {
throw new java.lang.UnsupportedOperationException(e);
}
this.configProvider = (XMultiServiceFactory)
UnoRuntime.queryInterface(
XMultiServiceFactory.class, service);
}
args[0] = new PropertyValue();
args[0].Name = "nodepath";
pos = path.indexOf('/', 1);
if (pos == -1) {
args[0].Value = path;
} else {
args[0].Value = path.substring(0, pos);
}
try {
value = this.configProvider.createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationAccess", args);
} catch (com.sun.star.uno.Exception e) {
throw new java.lang.IllegalArgumentException(e);
}
while (pos != -1) {
XNameAccess xNameAccess = (XNameAccess)
UnoRuntime.queryInterface(
XNameAccess.class, value);
String name = null;
start = pos + 1;
pos = path.indexOf('/', start);
if (pos == -1) {
name = path.substring(start);
} else {
name = path.substring(start, pos);
}
try {
value = xNameAccess.getByName(name);
} catch (com.sun.star.container.NoSuchElementException e) {
throw new java.lang.IllegalArgumentException(e);
} catch (com.sun.star.lang.WrappedTargetException e) {
throw new java.lang.RuntimeException(e);
}
}
return value;
} | Object function(String path) { Object value = null; int start = 0, pos = -1; PropertyValue args[] = new PropertyValue[1]; if (this.configProvider == null) { Object service = null; try { service = this.serviceManager.createInstanceWithContext( STR, this.bootstrapContext); } catch (com.sun.star.uno.Exception e) { throw new java.lang.UnsupportedOperationException(e); } this.configProvider = (XMultiServiceFactory) UnoRuntime.queryInterface( XMultiServiceFactory.class, service); } args[0] = new PropertyValue(); args[0].Name = STR; pos = path.indexOf('/', 1); if (pos == -1) { args[0].Value = path; } else { args[0].Value = path.substring(0, pos); } try { value = this.configProvider.createInstanceWithArguments( STR, args); } catch (com.sun.star.uno.Exception e) { throw new java.lang.IllegalArgumentException(e); } while (pos != -1) { XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class, value); String name = null; start = pos + 1; pos = path.indexOf('/', start); if (pos == -1) { name = path.substring(start); } else { name = path.substring(start, pos); } try { value = xNameAccess.getByName(name); } catch (com.sun.star.container.NoSuchElementException e) { throw new java.lang.IllegalArgumentException(e); } catch (com.sun.star.lang.WrappedTargetException e) { throw new java.lang.RuntimeException(e); } } return value; } | /**
* Returns the value of a configuration.
*
* @param path the path of the confuration
* @returns the value of the configuration
*/ | Returns the value of a configuration | getConfiguration | {
"repo_name": "imacat/mpresent-android",
"path": "src/tw/idv/imacat/android/mpresent/uno/OfficeConnection.java",
"license": "gpl-3.0",
"size": 23578
} | [
"com.sun.star.beans.PropertyValue",
"com.sun.star.container.XNameAccess",
"com.sun.star.lang.XMultiServiceFactory",
"com.sun.star.uno.UnoRuntime"
] | import com.sun.star.beans.PropertyValue; import com.sun.star.container.XNameAccess; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; | import com.sun.star.beans.*; import com.sun.star.container.*; import com.sun.star.lang.*; import com.sun.star.uno.*; | [
"com.sun.star"
] | com.sun.star; | 1,042,213 |
@Override
public Font getPropertyFont(String key, Font defaultValue) {
String value = get(key);
if (value == null) {
return defaultValue;
}
try {
return FontConverter.INSTANCE.parse(value);
} catch (ConversionException e) {
return DEFAULT_FONT;
}
} | Font function(String key, Font defaultValue) { String value = get(key); if (value == null) { return defaultValue; } try { return FontConverter.INSTANCE.parse(value); } catch (ConversionException e) { return DEFAULT_FONT; } } | /**
* Gets a value of type <code>Font</code>.
*
* @param key the key
* @param defaultValue the default value that is returned if the key was not found in this property set.
* @return the value for the given key, or <code>defaultValue</code> if the key is not contained in this property
* set.
*/ | Gets a value of type <code>Font</code> | getPropertyFont | {
"repo_name": "arraydev/snap-engine",
"path": "snap-core/src/main/java/org/esa/snap/util/AbstractPropertyMap.java",
"license": "gpl-3.0",
"size": 9088
} | [
"com.bc.ceres.binding.ConversionException",
"com.bc.ceres.binding.converters.FontConverter",
"java.awt.Font"
] | import com.bc.ceres.binding.ConversionException; import com.bc.ceres.binding.converters.FontConverter; import java.awt.Font; | import com.bc.ceres.binding.*; import com.bc.ceres.binding.converters.*; import java.awt.*; | [
"com.bc.ceres",
"java.awt"
] | com.bc.ceres; java.awt; | 1,347,546 |
public COSStream getDifferences()
{
return fdf.getCOSStream(COSName.DIFFERENCES);
} | COSStream function() { return fdf.getCOSStream(COSName.DIFFERENCES); } | /**
* This will get the incremental updates since the PDF was last opened.
*
* @return The differences entry of the FDF dictionary.
*/ | This will get the incremental updates since the PDF was last opened | getDifferences | {
"repo_name": "kalaspuffar/pdfbox",
"path": "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFDictionary.java",
"license": "apache-2.0",
"size": 19401
} | [
"org.apache.pdfbox.cos.COSName",
"org.apache.pdfbox.cos.COSStream"
] | import org.apache.pdfbox.cos.COSName; import org.apache.pdfbox.cos.COSStream; | import org.apache.pdfbox.cos.*; | [
"org.apache.pdfbox"
] | org.apache.pdfbox; | 2,214,068 |
public Map<String,String> getCredentialStoreServiceProperties() {
Map<String,String> properties = new HashMap<>();
properties.put("storage.persistent", String.valueOf(credentialStoreService.isInitialized(CredentialStoreType.PERSISTED)));
properties.put("storage.temporary", String.valueOf(credentialStoreService.isInitialized(CredentialStoreType.TEMPORARY)));
return properties;
} | Map<String,String> function() { Map<String,String> properties = new HashMap<>(); properties.put(STR, String.valueOf(credentialStoreService.isInitialized(CredentialStoreType.PERSISTED))); properties.put(STR, String.valueOf(credentialStoreService.isInitialized(CredentialStoreType.TEMPORARY))); return properties; } | /**
* Queries the CredentialStoreService to gather properties about it.
* <p/>
* In particular, the details about which storage facilities are avaialble are returned via Boolean
* properties.
*
* @return a map of properties
*/ | Queries the CredentialStoreService to gather properties about it. In particular, the details about which storage facilities are avaialble are returned via Boolean properties | getCredentialStoreServiceProperties | {
"repo_name": "alexryndin/ambari",
"path": "ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java",
"license": "apache-2.0",
"size": 248199
} | [
"java.util.HashMap",
"java.util.Map",
"org.apache.ambari.server.security.encryption.CredentialStoreType"
] | import java.util.HashMap; import java.util.Map; import org.apache.ambari.server.security.encryption.CredentialStoreType; | import java.util.*; import org.apache.ambari.server.security.encryption.*; | [
"java.util",
"org.apache.ambari"
] | java.util; org.apache.ambari; | 2,345,434 |
public void setLoadType(int intLoadType)
{
ScriptBuffer script = new ScriptBuffer();
script.appendCall(getContextPath() + "setLoadType", intLoadType);
ScriptSessions.addScript(script);
} | void function(int intLoadType) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + STR, intLoadType); ScriptSessions.addScript(script); } | /**
* Sets the load type of this DOM node and the descending branch.
* @param intLoadType <code>LT_NORMAL</code>, <code>LT_SLEEP_PAINT</code>, <code>LT_SLEEP_DESER</code>,
<code>LT_SLEEP_PD</code>, <code>LT_SHOW_PAINT</code>, or <code>LT_SHOW_DESER</code>.
*/ | Sets the load type of this DOM node and the descending branch | setLoadType | {
"repo_name": "burris/dwr",
"path": "ui/gi/generated/java/jsx3/app/Model.java",
"license": "apache-2.0",
"size": 102680
} | [
"org.directwebremoting.ScriptBuffer",
"org.directwebremoting.ScriptSessions"
] | import org.directwebremoting.ScriptBuffer; import org.directwebremoting.ScriptSessions; | import org.directwebremoting.*; | [
"org.directwebremoting"
] | org.directwebremoting; | 567,979 |
public static Field getFirstTimestampField(Record header) throws IOException {
return ImmutableField.of(header.getField(TIMESTAMP_FIELD_INDEX));
} | static Field function(Record header) throws IOException { return ImmutableField.of(header.getField(TIMESTAMP_FIELD_INDEX)); } | /**
* Returns the field containing the first timestamp of the block.
*
* @param header the block header
* @throws IOException if an I/O problem occurs
*/ | Returns the field containing the first timestamp of the block | getFirstTimestampField | {
"repo_name": "blerer/horizondb-model",
"path": "src/main/java/io/horizondb/model/core/records/BlockHeaderUtils.java",
"license": "apache-2.0",
"size": 9243
} | [
"io.horizondb.model.core.Field",
"io.horizondb.model.core.Record",
"io.horizondb.model.core.fields.ImmutableField",
"java.io.IOException"
] | import io.horizondb.model.core.Field; import io.horizondb.model.core.Record; import io.horizondb.model.core.fields.ImmutableField; import java.io.IOException; | import io.horizondb.model.core.*; import io.horizondb.model.core.fields.*; import java.io.*; | [
"io.horizondb.model",
"java.io"
] | io.horizondb.model; java.io; | 2,055,015 |
void stopNow() {
this.stop = true;
try {
socket.close();
} catch (IOException e) {
// ignore
}
} | void stopNow() { this.stop = true; try { socket.close(); } catch (IOException e) { } } | /**
* Close the connection now.
*/ | Close the connection now | stopNow | {
"repo_name": "vdr007/ThriftyPaxos",
"path": "src/applications/h2/src/main/org/h2/server/web/WebThread.java",
"license": "apache-2.0",
"size": 14643
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,430,600 |
private void createSubsample() {
int classI = getInputFormat().classIndex();
// Sort according to class attribute.
getInputFormat().sort(classI);
// Determine where each class starts in the sorted dataset
int [] classIndices = getClassIndices();
// Get the existing class distribution
int [] counts = new int [getInputFormat().numClasses()];
double [] weights = new double [getInputFormat().numClasses()];
int min = -1;
for (int i = 0; i < getInputFormat().numInstances(); i++) {
Instance current = getInputFormat().instance(i);
if (current.classIsMissing() == false) {
counts[(int)current.classValue()]++;
weights[(int)current.classValue()]+= current.weight();
}
}
// Convert from total weight to average weight
for (int i = 0; i < counts.length; i++) {
if (counts[i] > 0) {
weights[i] = weights[i] / counts[i];
}
}
// find the class with the minimum number of instances
int minIndex = -1;
for (int i = 0; i < counts.length; i++) {
if ( (min < 0) && (counts[i] > 0) ) {
min = counts[i];
minIndex = i;
} else if ((counts[i] < min) && (counts[i] > 0)) {
min = counts[i];
minIndex = i;
}
}
if (min < 0) {
System.err.println("SpreadSubsample: *warning* none of the classes have any values in them.");
return;
}
// determine the new distribution
int [] new_counts = new int [getInputFormat().numClasses()];
for (int i = 0; i < counts.length; i++) {
new_counts[i] = (int)Math.abs(Math.min(counts[i],
min * m_DistributionSpread));
if (i == minIndex) {
if (m_DistributionSpread > 0 && m_DistributionSpread < 1.0) {
// don't undersample the minority class!
new_counts[i] = counts[i];
}
}
if (m_DistributionSpread == 0) {
new_counts[i] = counts[i];
}
if (m_MaxCount > 0) {
new_counts[i] = Math.min(new_counts[i], m_MaxCount);
}
}
// Sample without replacement
Random random = new Random(m_RandomSeed);
Hashtable t = new Hashtable();
for (int j = 0; j < new_counts.length; j++) {
double newWeight = 1.0;
if (m_AdjustWeights && (new_counts[j] > 0)) {
newWeight = weights[j] * counts[j] / new_counts[j];
}
for (int k = 0; k < new_counts[j]; k++) {
boolean ok = false;
do {
int index = classIndices[j] + (Math.abs(random.nextInt())
% (classIndices[j + 1] - classIndices[j])) ;
// Have we used this instance before?
if (t.get("" + index) == null) {
// if not, add it to the hashtable and use it
t.put("" + index, "");
ok = true;
if(index >= 0) {
Instance newInst = (Instance)getInputFormat().instance(index).copy();
if (m_AdjustWeights) {
newInst.setWeight(newWeight);
}
push(newInst);
}
}
} while (!ok);
}
}
} | void function() { int classI = getInputFormat().classIndex(); getInputFormat().sort(classI); int [] classIndices = getClassIndices(); int [] counts = new int [getInputFormat().numClasses()]; double [] weights = new double [getInputFormat().numClasses()]; int min = -1; for (int i = 0; i < getInputFormat().numInstances(); i++) { Instance current = getInputFormat().instance(i); if (current.classIsMissing() == false) { counts[(int)current.classValue()]++; weights[(int)current.classValue()]+= current.weight(); } } for (int i = 0; i < counts.length; i++) { if (counts[i] > 0) { weights[i] = weights[i] / counts[i]; } } int minIndex = -1; for (int i = 0; i < counts.length; i++) { if ( (min < 0) && (counts[i] > 0) ) { min = counts[i]; minIndex = i; } else if ((counts[i] < min) && (counts[i] > 0)) { min = counts[i]; minIndex = i; } } if (min < 0) { System.err.println(STR); return; } int [] new_counts = new int [getInputFormat().numClasses()]; for (int i = 0; i < counts.length; i++) { new_counts[i] = (int)Math.abs(Math.min(counts[i], min * m_DistributionSpread)); if (i == minIndex) { if (m_DistributionSpread > 0 && m_DistributionSpread < 1.0) { new_counts[i] = counts[i]; } } if (m_DistributionSpread == 0) { new_counts[i] = counts[i]; } if (m_MaxCount > 0) { new_counts[i] = Math.min(new_counts[i], m_MaxCount); } } Random random = new Random(m_RandomSeed); Hashtable t = new Hashtable(); for (int j = 0; j < new_counts.length; j++) { double newWeight = 1.0; if (m_AdjustWeights && (new_counts[j] > 0)) { newWeight = weights[j] * counts[j] / new_counts[j]; } for (int k = 0; k < new_counts[j]; k++) { boolean ok = false; do { int index = classIndices[j] + (Math.abs(random.nextInt()) % (classIndices[j + 1] - classIndices[j])) ; if (t.get(STRSTR"); ok = true; if(index >= 0) { Instance newInst = (Instance)getInputFormat().instance(index).copy(); if (m_AdjustWeights) { newInst.setWeight(newWeight); } push(newInst); } } } while (!ok); } } } | /**
* Creates a subsample of the current set of input instances. The output
* instances are pushed onto the output queue for collection.
*/ | Creates a subsample of the current set of input instances. The output instances are pushed onto the output queue for collection | createSubsample | {
"repo_name": "dsibournemouth/autoweka",
"path": "weka-3.7.7/src/main/java/weka/filters/supervised/instance/SpreadSubsample.java",
"license": "gpl-3.0",
"size": 17990
} | [
"java.util.Hashtable",
"java.util.Random"
] | import java.util.Hashtable; import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 815,406 |
public void testDelete() {
this.seriesA.delete(0, 0);
assertEquals(5, this.seriesA.getItemCount());
Number value = this.seriesA.getValue(new Year(2000));
assertNull(value);
} | void function() { this.seriesA.delete(0, 0); assertEquals(5, this.seriesA.getItemCount()); Number value = this.seriesA.getValue(new Year(2000)); assertNull(value); } | /**
* Tests the deletion of values.
*/ | Tests the deletion of values | testDelete | {
"repo_name": "apetresc/JFreeChart",
"path": "src/test/java/org/jfree/data/time/junit/TimeSeriesTests.java",
"license": "lgpl-2.1",
"size": 28536
} | [
"org.jfree.data.time.Year"
] | import org.jfree.data.time.Year; | import org.jfree.data.time.*; | [
"org.jfree.data"
] | org.jfree.data; | 1,899,147 |
public ItemStack generateSeeds(CropCard crop, byte growth, byte gain, byte resis, byte scan); | ItemStack function(CropCard crop, byte growth, byte gain, byte resis, byte scan); | /**
* Generate plant seeds with the given parameters.
*
* @param crop plant
* @param growth plant growth stat
* @param gain plant gain stat
* @param resis plant resistance stat
* @param scan plant scan level
* @return Plant seed item
*/ | Generate plant seeds with the given parameters | generateSeeds | {
"repo_name": "ZanyLeonic/Balloons",
"path": "src/main/java/ic2/api/crops/ICropTile.java",
"license": "mit",
"size": 5954
} | [
"net.minecraft.item.ItemStack"
] | import net.minecraft.item.ItemStack; | import net.minecraft.item.*; | [
"net.minecraft.item"
] | net.minecraft.item; | 1,107,725 |
private Classifier learn(Dataset trainingSet, float[] initialAlpha) {
float[] p = getCSvmP(trainingSet);
int[] y = new int[trainingSet.getNumberOfExamples()];
for (int i = 0; i < y.length; i++) {
if (trainingSet.getExamples().get(i).isExampleOf(this.label))
y[i] = +1;
else
y[i] = -1;
}
SvmSolution solution = solve(trainingSet.getNumberOfExamples(),
trainingSet, p, y, initialAlpha);
this.classifier.getModel().setBias(-solution.getRho());
float[] alphas = solution.getAlphas();
for (int i = 0; i < trainingSet.getNumberOfExamples(); i++) {
if (alphas[i] != 0) {
this.classifier.getModel().addExample(y[i] * alphas[i],
trainingSet.getExamples().get(i));
}
}
classifier.getModel().setKernel(kernel);
return this.classifier;
} | Classifier function(Dataset trainingSet, float[] initialAlpha) { float[] p = getCSvmP(trainingSet); int[] y = new int[trainingSet.getNumberOfExamples()]; for (int i = 0; i < y.length; i++) { if (trainingSet.getExamples().get(i).isExampleOf(this.label)) y[i] = +1; else y[i] = -1; } SvmSolution solution = solve(trainingSet.getNumberOfExamples(), trainingSet, p, y, initialAlpha); this.classifier.getModel().setBias(-solution.getRho()); float[] alphas = solution.getAlphas(); for (int i = 0; i < trainingSet.getNumberOfExamples(); i++) { if (alphas[i] != 0) { this.classifier.getModel().addExample(y[i] * alphas[i], trainingSet.getExamples().get(i)); } } classifier.getModel().setKernel(kernel); return this.classifier; } | /**
* It starts the training process exploiting the provided
* <code>dataset</code> and the initial Support Vectors weights
*
* @param trainingSet
* @param initialAlpha
* @return
*/ | It starts the training process exploiting the provided <code>dataset</code> and the initial Support Vectors weights | learn | {
"repo_name": "SAG-KeLP/batch-large-margin",
"path": "src/main/java/it/uniroma2/sag/kelp/learningalgorithm/classification/libsvm/BinaryCSvmClassification.java",
"license": "apache-2.0",
"size": 6633
} | [
"it.uniroma2.sag.kelp.data.dataset.Dataset",
"it.uniroma2.sag.kelp.learningalgorithm.classification.libsvm.solver.SvmSolution",
"it.uniroma2.sag.kelp.predictionfunction.classifier.Classifier"
] | import it.uniroma2.sag.kelp.data.dataset.Dataset; import it.uniroma2.sag.kelp.learningalgorithm.classification.libsvm.solver.SvmSolution; import it.uniroma2.sag.kelp.predictionfunction.classifier.Classifier; | import it.uniroma2.sag.kelp.data.dataset.*; import it.uniroma2.sag.kelp.learningalgorithm.classification.libsvm.solver.*; import it.uniroma2.sag.kelp.predictionfunction.classifier.*; | [
"it.uniroma2.sag"
] | it.uniroma2.sag; | 2,914,496 |
public void open(final String filename)
throws IOException
{
open(new File(filename));
}
| void function(final String filename) throws IOException { open(new File(filename)); } | /**
* Open the output file.
* @param filename filename to open.
* @exception IOException if there was an exception opening the Audio Writer.
*/ | Open the output file | open | {
"repo_name": "frsyuki/festivoice",
"path": "src/main/java/org/xiph/speex/PcmWaveWriter.java",
"license": "apache-2.0",
"size": 16630
} | [
"java.io.File",
"java.io.IOException"
] | import java.io.File; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,082,698 |
StringBuilder result = new StringBuilder();
String authority = nestedUri.getAuthority();
if (authority != null) {
String[] parts = nestedUri.getAuthority().split("@", 2);
result.append(parts[0])
.append("://");
if (parts.length == 2) {
result.append(parts[1]);
}
}
result.append(nestedUri.getPath());
if (nestedUri.getQuery() != null) {
result.append("?");
result.append(nestedUri.getQuery());
}
if (nestedUri.getFragment() != null) {
result.append("#");
result.append(nestedUri.getFragment());
}
return new Path(result.toString());
} | StringBuilder result = new StringBuilder(); String authority = nestedUri.getAuthority(); if (authority != null) { String[] parts = nestedUri.getAuthority().split("@", 2); result.append(parts[0]) .append(STR?STR#"); result.append(nestedUri.getFragment()); } return new Path(result.toString()); } | /**
* Convert a nested URI to decode the underlying path. The translation takes
* the authority and parses it into the underlying scheme and authority.
* For example, "myscheme://hdfs@nn/my/path" is converted to
* "hdfs://nn/my/path".
* @param nestedUri the URI from the nested URI
* @return the unnested path
*/ | Convert a nested URI to decode the underlying path. The translation takes the authority and parses it into the underlying scheme and authority. For example, "myscheme://hdfs@nn/my/path" is converted to "hdfs://nn/my/path" | unnestUri | {
"repo_name": "plusplusjiajia/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ProviderUtils.java",
"license": "apache-2.0",
"size": 9537
} | [
"org.apache.hadoop.fs.Path"
] | import org.apache.hadoop.fs.Path; | import org.apache.hadoop.fs.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,431,226 |
public Factory setDrmSessionManager(DrmSessionManager<?> drmSessionManager) {
Assertions.checkState(!isCreateCalled);
this.drmSessionManager = drmSessionManager;
return this;
}
/**
* Sets the minimum number of times to retry if a loading error occurs. See {@link
* #setLoadErrorHandlingPolicy} for the default value.
*
* <p>Calling this method is equivalent to calling {@link #setLoadErrorHandlingPolicy} with
* {@link DefaultLoadErrorHandlingPolicy#DefaultLoadErrorHandlingPolicy(int)
* DefaultLoadErrorHandlingPolicy(minLoadableRetryCount)} | Factory function(DrmSessionManager<?> drmSessionManager) { Assertions.checkState(!isCreateCalled); this.drmSessionManager = drmSessionManager; return this; } /** * Sets the minimum number of times to retry if a loading error occurs. See { * #setLoadErrorHandlingPolicy} for the default value. * * <p>Calling this method is equivalent to calling {@link #setLoadErrorHandlingPolicy} with * {@link DefaultLoadErrorHandlingPolicy#DefaultLoadErrorHandlingPolicy(int) * DefaultLoadErrorHandlingPolicy(minLoadableRetryCount)} | /**
* Sets the {@link DrmSessionManager} to use for acquiring {@link DrmSession DrmSessions}. The
* default value is {@link DrmSessionManager#DUMMY}.
*
* @param drmSessionManager The {@link DrmSessionManager}.
* @return This factory, for convenience.
* @throws IllegalStateException If one of the {@code create} methods has already been called.
*/ | Sets the <code>DrmSessionManager</code> to use for acquiring <code>DrmSession DrmSessions</code>. The default value is <code>DrmSessionManager#DUMMY</code> | setDrmSessionManager | {
"repo_name": "superbderrick/ExoPlayer",
"path": "library/dash/src/main/java/com/google/android/exoplayer2/source/dash/DashMediaSource.java",
"license": "apache-2.0",
"size": 58727
} | [
"com.google.android.exoplayer2.drm.DrmSessionManager",
"com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy",
"com.google.android.exoplayer2.util.Assertions"
] | import com.google.android.exoplayer2.drm.DrmSessionManager; import com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy; import com.google.android.exoplayer2.util.Assertions; | import com.google.android.exoplayer2.drm.*; import com.google.android.exoplayer2.upstream.*; import com.google.android.exoplayer2.util.*; | [
"com.google.android"
] | com.google.android; | 561,917 |
void setTypeCode(ParticipationType value);
| void setTypeCode(ParticipationType value); | /**
* Sets the value of the '{@link org.openhealthtools.mdht.uml.cda.Consumable#getTypeCode <em>Type Code</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Type Code</em>' attribute.
* @see org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType
* @see #isSetTypeCode()
* @see #unsetTypeCode()
* @see #getTypeCode()
* @generated
*/ | Sets the value of the '<code>org.openhealthtools.mdht.uml.cda.Consumable#getTypeCode Type Code</code>' attribute. | setTypeCode | {
"repo_name": "drbgfc/mdht",
"path": "cda/plugins/org.openhealthtools.mdht.uml.cda/src/org/openhealthtools/mdht/uml/cda/Consumable.java",
"license": "epl-1.0",
"size": 10331
} | [
"org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType"
] | import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; | import org.openhealthtools.mdht.uml.hl7.vocab.*; | [
"org.openhealthtools.mdht"
] | org.openhealthtools.mdht; | 2,524,692 |
public static java.util.List extractEmergencyAttendanceList(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.EmergencyAttendanceForPendingArrivalsVoCollection voCollection)
{
return extractEmergencyAttendanceList(domainFactory, voCollection, null, new HashMap());
}
| static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.EmergencyAttendanceForPendingArrivalsVoCollection voCollection) { return extractEmergencyAttendanceList(domainFactory, voCollection, null, new HashMap()); } | /**
* Create the ims.core.admin.domain.objects.EmergencyAttendance list from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/ | Create the ims.core.admin.domain.objects.EmergencyAttendance list from the value object collection | extractEmergencyAttendanceList | {
"repo_name": "FreudianNM/openMAXIMS",
"path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/emergency/vo/domain/EmergencyAttendanceForPendingArrivalsVoAssembler.java",
"license": "agpl-3.0",
"size": 24563
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,172,486 |
public void testWithNoClasspath() throws SQLException, MalformedURLException
{
installJar("dcl_emc1.jar", "EMC.MAIL_APP");
testWithNoInstalledJars();
} | void function() throws SQLException, MalformedURLException { installJar(STR, STR); testWithNoInstalledJars(); } | /**
* Install the jar, but don't set the classpath.
* @throws SQLException
* @throws MalformedURLException
*/ | Install the jar, but don't set the classpath | testWithNoClasspath | {
"repo_name": "viaper/DBPlus",
"path": "DerbyHodgepodge/java/testing/org/apache/derbyTesting/functionTests/tests/lang/DatabaseClassLoadingTest.java",
"license": "apache-2.0",
"size": 48889
} | [
"java.net.MalformedURLException",
"java.sql.SQLException"
] | import java.net.MalformedURLException; import java.sql.SQLException; | import java.net.*; import java.sql.*; | [
"java.net",
"java.sql"
] | java.net; java.sql; | 278,241 |
public static RegisteredService resolveRegisteredService(final RequestContext requestContext,
final ServicesManager servicesManager,
final AuthenticationServiceSelectionPlan serviceSelectionStrategy) {
val registeredService = getRegisteredService(requestContext);
if (registeredService != null) {
return registeredService;
}
val service = WebUtils.getService(requestContext);
val serviceToUse = serviceSelectionStrategy.resolveService(service);
if (serviceToUse != null) {
return servicesManager.findServiceBy(serviceToUse);
}
return null;
} | static RegisteredService function(final RequestContext requestContext, final ServicesManager servicesManager, final AuthenticationServiceSelectionPlan serviceSelectionStrategy) { val registeredService = getRegisteredService(requestContext); if (registeredService != null) { return registeredService; } val service = WebUtils.getService(requestContext); val serviceToUse = serviceSelectionStrategy.resolveService(service); if (serviceToUse != null) { return servicesManager.findServiceBy(serviceToUse); } return null; } | /**
* Resolve registered service.
*
* @param requestContext the request context
* @param servicesManager the services manager
* @param serviceSelectionStrategy the service selection strategy
* @return the service
*/ | Resolve registered service | resolveRegisteredService | {
"repo_name": "apereo/cas",
"path": "core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java",
"license": "apache-2.0",
"size": 71894
} | [
"org.apereo.cas.authentication.AuthenticationServiceSelectionPlan",
"org.apereo.cas.services.RegisteredService",
"org.apereo.cas.services.ServicesManager",
"org.springframework.webflow.execution.RequestContext"
] | import org.apereo.cas.authentication.AuthenticationServiceSelectionPlan; import org.apereo.cas.services.RegisteredService; import org.apereo.cas.services.ServicesManager; import org.springframework.webflow.execution.RequestContext; | import org.apereo.cas.authentication.*; import org.apereo.cas.services.*; import org.springframework.webflow.execution.*; | [
"org.apereo.cas",
"org.springframework.webflow"
] | org.apereo.cas; org.springframework.webflow; | 325,158 |
return this.outputStream;
}
/**
* Appends the {@code char} representation of {@code b} to the {@code JTextArea} and writes it to the decorated {@code OutputStream}.
* <p>
* If the decorated {@code OutputStream} throws an {@code IOException}, the same {@code IOException} will be thrown by this method.
*
* @param b the value to write
* @throws IOException thrown if, and only if, the decorated {@code OutputStream} throws an {@code IOException}
| return this.outputStream; } /** * Appends the {@code char} representation of {@code b} to the {@code JTextArea} and writes it to the decorated {@code OutputStream}. * <p> * If the decorated {@code OutputStream} throws an {@code IOException}, the same {@code IOException} will be thrown by this method. * * @param b the value to write * @throws IOException thrown if, and only if, the decorated {@code OutputStream} throws an {@code IOException} | /**
* Returns the decorated {@code OutputStream}.
*
* @return the decorated {@code OutputStream}
*/ | Returns the decorated OutputStream | getOutputStream | {
"repo_name": "macroing/CIT-Java",
"path": "src/main/java/org/macroing/cit/javax/swing/JTextAreaOutputStreamDecorator.java",
"license": "lgpl-3.0",
"size": 3309
} | [
"java.io.IOException",
"java.io.OutputStream",
"javax.swing.JTextArea"
] | import java.io.IOException; import java.io.OutputStream; import javax.swing.JTextArea; | import java.io.*; import javax.swing.*; | [
"java.io",
"javax.swing"
] | java.io; javax.swing; | 1,640,708 |
private void createSpareWebContents() {
ThreadUtils.assertOnUiThread();
if (mSpareWebContents != null) return;
mSpareWebContents = WebContentsFactory.createWebContents(false, false);
if (mSpareWebContents != null) {
mSpareWebContents.getNavigationController().loadUrl(new LoadUrlParams("about:blank"));
}
} | void function() { ThreadUtils.assertOnUiThread(); if (mSpareWebContents != null) return; mSpareWebContents = WebContentsFactory.createWebContents(false, false); if (mSpareWebContents != null) { mSpareWebContents.getNavigationController().loadUrl(new LoadUrlParams(STR)); } } | /**
* Creates a spare {@link WebContents}, if none exists.
*
* Navigating to "about:blank" forces a lot of initialization to take place
* here. This improves PLT. This navigation is never registered in the history, as
* "about:blank" is filtered by CanAddURLToHistory.
*
* TODO(lizeb): Replace this with a cleaner method. See crbug.com/521729.
*/ | Creates a spare <code>WebContents</code>, if none exists. Navigating to "about:blank" forces a lot of initialization to take place here. This improves PLT. This navigation is never registered in the history, as "about:blank" is filtered by CanAddURLToHistory. TODO(lizeb): Replace this with a cleaner method. See crbug.com/521729 | createSpareWebContents | {
"repo_name": "highweb-project/highweb-webcl-html5spec",
"path": "chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java",
"license": "bsd-3-clause",
"size": 31769
} | [
"org.chromium.base.ThreadUtils",
"org.chromium.chrome.browser.WebContentsFactory",
"org.chromium.content_public.browser.LoadUrlParams"
] | import org.chromium.base.ThreadUtils; import org.chromium.chrome.browser.WebContentsFactory; import org.chromium.content_public.browser.LoadUrlParams; | import org.chromium.base.*; import org.chromium.chrome.browser.*; import org.chromium.content_public.browser.*; | [
"org.chromium.base",
"org.chromium.chrome",
"org.chromium.content_public"
] | org.chromium.base; org.chromium.chrome; org.chromium.content_public; | 2,391,127 |
private EvoSVMModel getModel(double[] alphas) {
// calculate support vectors
Iterator<Example> reader = exampleSet.iterator();
List<SupportVector> supportVectors = new ArrayList<>();
int index = 0;
while (reader.hasNext()) {
double currentAlpha = alphas[index];
Example currentExample = reader.next();
if (currentAlpha != 0.0d) {
double[] x = new double[exampleSet.getAttributes().size()];
int a = 0;
for (Attribute attribute : exampleSet.getAttributes()) {
x[a++] = currentExample.getValue(attribute);
}
supportVectors.add(new SupportVector(x, ys[index], currentAlpha));
}
index++;
}
// calculate all sum values
double[] sum = new double[exampleSet.size()];
reader = exampleSet.iterator();
index = 0;
while (reader.hasNext()) {
Example current = reader.next();
double[] x = new double[exampleSet.getAttributes().size()];
int a = 0;
for (Attribute attribute : exampleSet.getAttributes()) {
x[a++] = current.getValue(attribute);
}
sum[index] = kernel.getSum(supportVectors, x);
index++;
}
// calculate b (from Stefan's mySVM code)
double bSum = 0.0d;
int bCounter = 0;
for (int i = 0; i < alphas.length; i++) {
if ((ys[i] * alphas[i] - c < -IS_ZERO) && (ys[i] * alphas[i] > IS_ZERO)) {
bSum += ys[i] - sum[i];
bCounter++;
} else if ((ys[i] * alphas[i] + c > IS_ZERO) && (ys[i] * alphas[i] < -IS_ZERO)) {
bSum += ys[i] - sum[i];
bCounter++;
}
}
if (bCounter == 0) {
// unlikely
bSum = 0.0d;
for (int i = 0; i < alphas.length; i++) {
if ((ys[i] * alphas[i] < IS_ZERO) && (ys[i] * alphas[i] > -IS_ZERO)) {
bSum += ys[i] - sum[i];
bCounter++;
}
}
if (bCounter == 0) {
// even unlikelier
bSum = 0.0d;
for (int i = 0; i < alphas.length; i++) {
bSum += ys[i] - sum[i];
bCounter++;
}
}
}
return new EvoSVMModel(exampleSet, supportVectors, kernel, bSum / bCounter);
}
| EvoSVMModel function(double[] alphas) { Iterator<Example> reader = exampleSet.iterator(); List<SupportVector> supportVectors = new ArrayList<>(); int index = 0; while (reader.hasNext()) { double currentAlpha = alphas[index]; Example currentExample = reader.next(); if (currentAlpha != 0.0d) { double[] x = new double[exampleSet.getAttributes().size()]; int a = 0; for (Attribute attribute : exampleSet.getAttributes()) { x[a++] = currentExample.getValue(attribute); } supportVectors.add(new SupportVector(x, ys[index], currentAlpha)); } index++; } double[] sum = new double[exampleSet.size()]; reader = exampleSet.iterator(); index = 0; while (reader.hasNext()) { Example current = reader.next(); double[] x = new double[exampleSet.getAttributes().size()]; int a = 0; for (Attribute attribute : exampleSet.getAttributes()) { x[a++] = current.getValue(attribute); } sum[index] = kernel.getSum(supportVectors, x); index++; } double bSum = 0.0d; int bCounter = 0; for (int i = 0; i < alphas.length; i++) { if ((ys[i] * alphas[i] - c < -IS_ZERO) && (ys[i] * alphas[i] > IS_ZERO)) { bSum += ys[i] - sum[i]; bCounter++; } else if ((ys[i] * alphas[i] + c > IS_ZERO) && (ys[i] * alphas[i] < -IS_ZERO)) { bSum += ys[i] - sum[i]; bCounter++; } } if (bCounter == 0) { bSum = 0.0d; for (int i = 0; i < alphas.length; i++) { if ((ys[i] * alphas[i] < IS_ZERO) && (ys[i] * alphas[i] > -IS_ZERO)) { bSum += ys[i] - sum[i]; bCounter++; } } if (bCounter == 0) { bSum = 0.0d; for (int i = 0; i < alphas.length; i++) { bSum += ys[i] - sum[i]; bCounter++; } } } return new EvoSVMModel(exampleSet, supportVectors, kernel, bSum / bCounter); } | /**
* Returns a model containing all support vectors, i.e. the examples with non-zero alphas.
*/ | Returns a model containing all support vectors, i.e. the examples with non-zero alphas | getModel | {
"repo_name": "transwarpio/rapidminer",
"path": "rapidMiner/rapidminer-studio-core/src/main/java/com/rapidminer/operator/learner/functions/kernel/evosvm/ClassificationEvoOptimization.java",
"license": "gpl-3.0",
"size": 13768
} | [
"com.rapidminer.example.Attribute",
"com.rapidminer.example.Example",
"com.rapidminer.operator.learner.functions.kernel.SupportVector",
"java.util.ArrayList",
"java.util.Iterator",
"java.util.List"
] | import com.rapidminer.example.Attribute; import com.rapidminer.example.Example; import com.rapidminer.operator.learner.functions.kernel.SupportVector; import java.util.ArrayList; import java.util.Iterator; import java.util.List; | import com.rapidminer.example.*; import com.rapidminer.operator.learner.functions.kernel.*; import java.util.*; | [
"com.rapidminer.example",
"com.rapidminer.operator",
"java.util"
] | com.rapidminer.example; com.rapidminer.operator; java.util; | 1,360,976 |
private void sendError( String status, String msg ) throws InterruptedException
{
sendResponse( status, MIME_PLAINTEXT, null, new ByteArrayInputStream( msg.getBytes()));
throw new InterruptedException();
} | void function( String status, String msg ) throws InterruptedException { sendResponse( status, MIME_PLAINTEXT, null, new ByteArrayInputStream( msg.getBytes())); throw new InterruptedException(); } | /**
* Returns an error message as a HTTP response and
* throws InterruptedException to stop further request processing.
*/ | Returns an error message as a HTTP response and throws InterruptedException to stop further request processing | sendError | {
"repo_name": "EHJ-52n/OX-Framework",
"path": "52n-oxf-third-party/oxf-third-party-nanohttpd/src/main/java/org/n52/oxf/ses/adapter/client/httplistener/NanoHTTPD.java",
"license": "gpl-2.0",
"size": 45727
} | [
"java.io.ByteArrayInputStream"
] | import java.io.ByteArrayInputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,217,105 |
@Pure
public CodeActionResolveSupportCapabilities getResolveSupport() {
return this.resolveSupport;
} | CodeActionResolveSupportCapabilities function() { return this.resolveSupport; } | /**
* Whether the client supports resolving additional code action
* properties via a separate `codeAction/resolve` request.
* <p>
* Since 3.16.0
*/ | Whether the client supports resolving additional code action properties via a separate `codeAction/resolve` request. Since 3.16.0 | getResolveSupport | {
"repo_name": "smarr/SOMns-vscode",
"path": "server/org.eclipse.lsp4j-gen/org/eclipse/lsp4j/CodeActionCapabilities.java",
"license": "mit",
"size": 9234
} | [
"org.eclipse.lsp4j.CodeActionResolveSupportCapabilities"
] | import org.eclipse.lsp4j.CodeActionResolveSupportCapabilities; | import org.eclipse.lsp4j.*; | [
"org.eclipse.lsp4j"
] | org.eclipse.lsp4j; | 1,067,510 |
public Expectations setEncryptPlainTextKeyExpectations(LibertyServer server, boolean extraMsgs) throws Exception {
Expectations expectations = setAllBadEncryptExpectations(server, extraMsgs);
expectations.addExpectation(new ServerMessageExpectation(server, MpJwtMessageConstants.CWWKS6062E_PLAINTEXT_KEY, "Messagelog did not contain an exception indicating that the mp.jwt.decrypt.key.location contained a plaintext key."));
return expectations;
} | Expectations function(LibertyServer server, boolean extraMsgs) throws Exception { Expectations expectations = setAllBadEncryptExpectations(server, extraMsgs); expectations.addExpectation(new ServerMessageExpectation(server, MpJwtMessageConstants.CWWKS6062E_PLAINTEXT_KEY, STR)); return expectations; } | /**
* Sets expectations to check when the keyManagementKeyAlias is not set
*
* @param server - server whose logs will be searched
* @param extraMsgs - the tai drives the code down different paths depending on if it finds config info in server.xml - if it finds config settings, we'll get 2 extra messages.
* @return Expectations - built expectations
* @throws Exception
*/ | Sets expectations to check when the keyManagementKeyAlias is not set | setEncryptPlainTextKeyExpectations | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.security.fat.common.mp.jwt/fat/src/com/ibm/ws/security/fat/common/mp/jwt/sharedTests/MPJwt12MPConfigTests.java",
"license": "epl-1.0",
"size": 61378
} | [
"com.ibm.ws.security.fat.common.expectations.Expectations",
"com.ibm.ws.security.fat.common.expectations.ServerMessageExpectation",
"com.ibm.ws.security.fat.common.mp.jwt.utils.MpJwtMessageConstants"
] | import com.ibm.ws.security.fat.common.expectations.Expectations; import com.ibm.ws.security.fat.common.expectations.ServerMessageExpectation; import com.ibm.ws.security.fat.common.mp.jwt.utils.MpJwtMessageConstants; | import com.ibm.ws.security.fat.common.expectations.*; import com.ibm.ws.security.fat.common.mp.jwt.utils.*; | [
"com.ibm.ws"
] | com.ibm.ws; | 308,974 |
@Generated
@Selector("setSize:")
public native void setSize(@ByValue CGSize value); | @Selector(STR) native void function(@ByValue CGSize value); | /**
* The display size of the video (in parent's coordinate space)
*/ | The display size of the video (in parent's coordinate space) | setSize | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/spritekit/SKVideoNode.java",
"license": "apache-2.0",
"size": 9570
} | [
"org.moe.natj.general.ann.ByValue",
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.general.ann.ByValue; import org.moe.natj.objc.ann.Selector; | import org.moe.natj.general.ann.*; import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 527,969 |
private void sendTouchExplorationGestureStartAndHoverEnterIfNeeded(int policyFlags) {
MotionEvent event = mInjectedPointerTracker.getLastInjectedHoverEvent();
if (event != null && event.getActionMasked() == MotionEvent.ACTION_HOVER_EXIT) {
final int pointerIdBits = event.getPointerIdBits();
sendAccessibilityEvent(AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_START);
sendMotionEvent(event, MotionEvent.ACTION_HOVER_ENTER, pointerIdBits, policyFlags);
}
} | void function(int policyFlags) { MotionEvent event = mInjectedPointerTracker.getLastInjectedHoverEvent(); if (event != null && event.getActionMasked() == MotionEvent.ACTION_HOVER_EXIT) { final int pointerIdBits = event.getPointerIdBits(); sendAccessibilityEvent(AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_START); sendMotionEvent(event, MotionEvent.ACTION_HOVER_ENTER, pointerIdBits, policyFlags); } } | /**
* Sends the enter events if needed. Such events are hover enter and touch explore
* gesture start.
*
* @param policyFlags The policy flags associated with the event.
*/ | Sends the enter events if needed. Such events are hover enter and touch explore gesture start | sendTouchExplorationGestureStartAndHoverEnterIfNeeded | {
"repo_name": "xorware/android_frameworks_base",
"path": "services/accessibility/java/com/android/server/accessibility/TouchExplorer.java",
"license": "apache-2.0",
"size": 69078
} | [
"android.view.MotionEvent",
"android.view.accessibility.AccessibilityEvent"
] | import android.view.MotionEvent; import android.view.accessibility.AccessibilityEvent; | import android.view.*; import android.view.accessibility.*; | [
"android.view"
] | android.view; | 2,018,396 |
public static String createSubscribe(Connection con, Subscribe subscribe) throws SQLException,
UtilException {
// Création d'un abonnement
String id = "";
PreparedStatement prepStmt = null;
try {
int newId = DBUtil.getNextId("SC_Classifieds_Subscribes", "subscribeId");
id = new Integer(newId).toString();
// création de la requete
String query =
"insert into SC_Classifieds_Subscribes (subscribeId, userId, instanceId, field1, field2) "
+ "values (?,?,?,?,?)";
// initialisation des paramètres
prepStmt = con.prepareStatement(query);
initParamSubscribe(prepStmt, newId, subscribe);
prepStmt.executeUpdate();
} finally {
// fermeture
DBUtil.close(prepStmt);
}
return id;
}
| static String function(Connection con, Subscribe subscribe) throws SQLException, UtilException { String id = STRSC_Classifieds_SubscribesSTRsubscribeIdSTRinsert into SC_Classifieds_Subscribes (subscribeId, userId, instanceId, field1, field2) STRvalues (?,?,?,?,?)"; prepStmt = con.prepareStatement(query); initParamSubscribe(prepStmt, newId, subscribe); prepStmt.executeUpdate(); } finally { DBUtil.close(prepStmt); } return id; } | /**
* create a subscription
* @param con : Connection
* @param subscribe : Subscribe
* @return subscribeId : String
* @throws SQLException
* @throws UtilException
*/ | create a subscription | createSubscribe | {
"repo_name": "stephaneperry/Silverpeas-Components",
"path": "classifieds/classifieds-jar/src/main/java/com/silverpeas/classifieds/dao/ClassifiedsDAO.java",
"license": "agpl-3.0",
"size": 22024
} | [
"com.silverpeas.classifieds.model.Subscribe",
"com.stratelia.webactiv.util.DBUtil",
"com.stratelia.webactiv.util.exception.UtilException",
"java.sql.Connection",
"java.sql.SQLException"
] | import com.silverpeas.classifieds.model.Subscribe; import com.stratelia.webactiv.util.DBUtil; import com.stratelia.webactiv.util.exception.UtilException; import java.sql.Connection; import java.sql.SQLException; | import com.silverpeas.classifieds.model.*; import com.stratelia.webactiv.util.*; import com.stratelia.webactiv.util.exception.*; import java.sql.*; | [
"com.silverpeas.classifieds",
"com.stratelia.webactiv",
"java.sql"
] | com.silverpeas.classifieds; com.stratelia.webactiv; java.sql; | 2,802,264 |
@Test
public void testSimpleConsumeFromTopicWithAckingOutOfOrderAllAtTheEnd() {
// Define how many records to produce
final int numberOfRecordsToProduce = 9;
// Define our namespace/partition.
final ConsumerPartition partition0 = new ConsumerPartition(topicName, 0);
// Produce 5 entries to the namespace.
final List<ProducedKafkaRecord<byte[], byte[]>> producedRecords = produceRecords(numberOfRecordsToProduce, 0);
// Create our consumer
final Consumer consumer = getDefaultConsumerInstanceAndOpen();
// Read from namespace, verify we get what we expect
final List<Record> foundRecords = new ArrayList<>();
for (int x = 0; x < numberOfRecordsToProduce; x++) {
// Get next record from consumer
final Record foundRecord = consumer.nextRecord();
// Get the next produced record that we expect
final ProducedKafkaRecord<byte[], byte[]> expectedRecord = producedRecords.get(x);
// Validate we got what we expected
validateRecordMatchesInput(expectedRecord, foundRecord);
// Add to our found records list
foundRecords.add(foundRecord);
}
logger.info("Consumer State {}", consumer.flushConsumerState());
// Verify state is still -1 (meaning it hasn't acked/completed ANY offsets yet)
validateConsumerState(consumer.flushConsumerState(), partition0, -1L);
// Now ack in the following order:
// commit offset 2 => offset should be 0 still
consumer.commitOffset(partition0.namespace(), partition0.partition(), 2L);
validateConsumerState(consumer.flushConsumerState(), partition0, -1L);
// commit offset 1 => offset should be 0 still
consumer.commitOffset(partition0.namespace(), partition0.partition(), 1L);
validateConsumerState(consumer.flushConsumerState(), partition0, -1L);
// commit offset 0 => offset should be 2 now
consumer.commitOffset(partition0.namespace(), partition0.partition(), 0L);
validateConsumerState(consumer.flushConsumerState(), partition0, 2L);
// commit offset 3 => offset should be 3 now
consumer.commitOffset(partition0.namespace(), partition0.partition(), 3L);
validateConsumerState(consumer.flushConsumerState(), partition0, 3L);
// commit offset 4 => offset should be 4 now
consumer.commitOffset(partition0.namespace(), partition0.partition(), 4L);
validateConsumerState(consumer.flushConsumerState(), partition0, 4L);
// commit offset 5 => offset should be 5 now
consumer.commitOffset(partition0.namespace(), partition0.partition(), 5L);
validateConsumerState(consumer.flushConsumerState(), partition0, 5L);
// commit offset 7 => offset should be 5 still
consumer.commitOffset(partition0.namespace(), partition0.partition(), 7L);
validateConsumerState(consumer.flushConsumerState(), partition0, 5L);
// commit offset 8 => offset should be 5 still
consumer.commitOffset(partition0.namespace(), partition0.partition(), 8L);
validateConsumerState(consumer.flushConsumerState(), partition0, 5L);
// commit offset 6 => offset should be 8 now
consumer.commitOffset(partition0.namespace(), partition0.partition(), 6L);
validateConsumerState(consumer.flushConsumerState(), partition0, 8L);
// Now validate state.
logger.info("Consumer State {}", consumer.flushConsumerState());
// Close out consumer
consumer.close();
} | void function() { final int numberOfRecordsToProduce = 9; final ConsumerPartition partition0 = new ConsumerPartition(topicName, 0); final List<ProducedKafkaRecord<byte[], byte[]>> producedRecords = produceRecords(numberOfRecordsToProduce, 0); final Consumer consumer = getDefaultConsumerInstanceAndOpen(); final List<Record> foundRecords = new ArrayList<>(); for (int x = 0; x < numberOfRecordsToProduce; x++) { final Record foundRecord = consumer.nextRecord(); final ProducedKafkaRecord<byte[], byte[]> expectedRecord = producedRecords.get(x); validateRecordMatchesInput(expectedRecord, foundRecord); foundRecords.add(foundRecord); } logger.info(STR, consumer.flushConsumerState()); validateConsumerState(consumer.flushConsumerState(), partition0, -1L); consumer.commitOffset(partition0.namespace(), partition0.partition(), 2L); validateConsumerState(consumer.flushConsumerState(), partition0, -1L); consumer.commitOffset(partition0.namespace(), partition0.partition(), 1L); validateConsumerState(consumer.flushConsumerState(), partition0, -1L); consumer.commitOffset(partition0.namespace(), partition0.partition(), 0L); validateConsumerState(consumer.flushConsumerState(), partition0, 2L); consumer.commitOffset(partition0.namespace(), partition0.partition(), 3L); validateConsumerState(consumer.flushConsumerState(), partition0, 3L); consumer.commitOffset(partition0.namespace(), partition0.partition(), 4L); validateConsumerState(consumer.flushConsumerState(), partition0, 4L); consumer.commitOffset(partition0.namespace(), partition0.partition(), 5L); validateConsumerState(consumer.flushConsumerState(), partition0, 5L); consumer.commitOffset(partition0.namespace(), partition0.partition(), 7L); validateConsumerState(consumer.flushConsumerState(), partition0, 5L); consumer.commitOffset(partition0.namespace(), partition0.partition(), 8L); validateConsumerState(consumer.flushConsumerState(), partition0, 5L); consumer.commitOffset(partition0.namespace(), partition0.partition(), 6L); validateConsumerState(consumer.flushConsumerState(), partition0, 8L); logger.info(STR, consumer.flushConsumerState()); consumer.close(); } | /**
* We attempt to consume from the namespace and get our expected messages.
* We ack the messages each as we get it, in order, one by one.
*/ | We attempt to consume from the namespace and get our expected messages. We ack the messages each as we get it, in order, one by one | testSimpleConsumeFromTopicWithAckingOutOfOrderAllAtTheEnd | {
"repo_name": "salesforce/storm-dynamic-spout",
"path": "src/test/java/com/salesforce/storm/spout/dynamic/kafka/ConsumerTest.java",
"license": "bsd-3-clause",
"size": 123608
} | [
"com.salesforce.kafka.test.ProducedKafkaRecord",
"com.salesforce.storm.spout.dynamic.ConsumerPartition",
"com.salesforce.storm.spout.dynamic.consumer.Record",
"java.util.ArrayList",
"java.util.List"
] | import com.salesforce.kafka.test.ProducedKafkaRecord; import com.salesforce.storm.spout.dynamic.ConsumerPartition; import com.salesforce.storm.spout.dynamic.consumer.Record; import java.util.ArrayList; import java.util.List; | import com.salesforce.kafka.test.*; import com.salesforce.storm.spout.dynamic.*; import com.salesforce.storm.spout.dynamic.consumer.*; import java.util.*; | [
"com.salesforce.kafka",
"com.salesforce.storm",
"java.util"
] | com.salesforce.kafka; com.salesforce.storm; java.util; | 1,745,097 |
@Override
public Collection<?> getItemIds() {
return items.getItemIds();
} | Collection<?> function() { return items.getItemIds(); } | /**
* Gets the item Id collection from the container.
*
* @return the Collection of item ids.
*/ | Gets the item Id collection from the container | getItemIds | {
"repo_name": "oalles/vaadin",
"path": "server/src/com/vaadin/ui/AbstractSelect.java",
"license": "apache-2.0",
"size": 76884
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,059,893 |
EReference getAsset_ErpItemMaster(); | EReference getAsset_ErpItemMaster(); | /**
* Returns the meta object for the reference '{@link CIM.IEC61968.Assets.Asset#getErpItemMaster <em>Erp Item Master</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Erp Item Master</em>'.
* @see CIM.IEC61968.Assets.Asset#getErpItemMaster()
* @see #getAsset()
* @generated
*/ | Returns the meta object for the reference '<code>CIM.IEC61968.Assets.Asset#getErpItemMaster Erp Item Master</code>'. | getAsset_ErpItemMaster | {
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/ModelJoin/src/main/java/CIM/IEC61968/Assets/AssetsPackage.java",
"license": "mit",
"size": 88490
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,317,968 |
protected Node unwrapSoapResponse(SOAPMessage soapResponse) throws ActivityException, AdapterException {
try {
// unwrap the soap content from the message
SOAPBody soapBody = soapResponse.getSOAPBody();
Node childElem = null;
Iterator<?> it = soapBody.getChildElements();
while (it.hasNext()) {
Node node = (Node) it.next();
if (node.getNodeType() == Node.ELEMENT_NODE && node.getLocalName().equals(getOutputMessageName())) {
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
if (getResponsePartName().equals(childNodes.item(i).getLocalName())) {
String content = childNodes.item(i).getTextContent();
childElem = DomHelper.toDomNode(content);
}
}
}
}
if (childElem == null)
throw new SOAPException("SOAP body child element not found");
// extract soap response headers
SOAPHeader header = soapResponse.getSOAPHeader();
if (header != null) {
extractSoapResponseHeaders(header);
}
return childElem;
}
catch (Exception ex) {
throw new ActivityException(ex.getMessage(), ex);
}
} | Node function(SOAPMessage soapResponse) throws ActivityException, AdapterException { try { SOAPBody soapBody = soapResponse.getSOAPBody(); Node childElem = null; Iterator<?> it = soapBody.getChildElements(); while (it.hasNext()) { Node node = (Node) it.next(); if (node.getNodeType() == Node.ELEMENT_NODE && node.getLocalName().equals(getOutputMessageName())) { NodeList childNodes = node.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { if (getResponsePartName().equals(childNodes.item(i).getLocalName())) { String content = childNodes.item(i).getTextContent(); childElem = DomHelper.toDomNode(content); } } } } if (childElem == null) throw new SOAPException(STR); SOAPHeader header = soapResponse.getSOAPHeader(); if (header != null) { extractSoapResponseHeaders(header); } return childElem; } catch (Exception ex) { throw new ActivityException(ex.getMessage(), ex); } } | /**
* Unwrap the SOAP response into a DOM Node.
*/ | Unwrap the SOAP response into a DOM Node | unwrapSoapResponse | {
"repo_name": "CenturyLinkCloud/mdw",
"path": "mdw-workflow/src/com/centurylink/mdw/workflow/adapter/soap/MdwRpcWebServiceAdapter.java",
"license": "apache-2.0",
"size": 6267
} | [
"com.centurylink.mdw.activity.ActivityException",
"com.centurylink.mdw.adapter.AdapterException",
"com.centurylink.mdw.xml.DomHelper",
"java.util.Iterator",
"javax.xml.soap.SOAPBody",
"javax.xml.soap.SOAPException",
"javax.xml.soap.SOAPHeader",
"javax.xml.soap.SOAPMessage",
"org.w3c.dom.Node",
"org.w3c.dom.NodeList"
] | import com.centurylink.mdw.activity.ActivityException; import com.centurylink.mdw.adapter.AdapterException; import com.centurylink.mdw.xml.DomHelper; import java.util.Iterator; import javax.xml.soap.SOAPBody; import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPHeader; import javax.xml.soap.SOAPMessage; import org.w3c.dom.Node; import org.w3c.dom.NodeList; | import com.centurylink.mdw.activity.*; import com.centurylink.mdw.adapter.*; import com.centurylink.mdw.xml.*; import java.util.*; import javax.xml.soap.*; import org.w3c.dom.*; | [
"com.centurylink.mdw",
"java.util",
"javax.xml",
"org.w3c.dom"
] | com.centurylink.mdw; java.util; javax.xml; org.w3c.dom; | 2,091,028 |
public static Set getMembershipSet(GemFireCacheImpl cache) {
return cache.getDistributedSystem().getDistributionManager()
.getDistributionManagerIds();
} | static Set function(GemFireCacheImpl cache) { return cache.getDistributedSystem().getDistributionManager() .getDistributionManagerIds(); } | /**
* Returns the current membership Set for this member.
* @param cache
* @return membership Set.
*/ | Returns the current membership Set for this member | getMembershipSet | {
"repo_name": "papicella/snappy-store",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHelper.java",
"license": "apache-2.0",
"size": 52063
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 643,569 |
public void setUserService(UserService userService) {
this.userService = userService;
} | void function(UserService userService) { this.userService = userService; } | /**
* userService Setter
*
* @param userService
*/ | userService Setter | setUserService | {
"repo_name": "raulsuarezdabo/flight",
"path": "src/main/java/com/raulsuarezdabo/flight/jsf/user/UserListBean.java",
"license": "mit",
"size": 4293
} | [
"com.raulsuarezdabo.flight.service.UserService"
] | import com.raulsuarezdabo.flight.service.UserService; | import com.raulsuarezdabo.flight.service.*; | [
"com.raulsuarezdabo.flight"
] | com.raulsuarezdabo.flight; | 2,545,201 |
public static int getButtonWidthHint(Button button) {
button.setFont(JFaceResources.getDialogFont());
PixelConverter converter= new PixelConverter(button);
int widthHint= converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
} | static int function(Button button) { button.setFont(JFaceResources.getDialogFont()); PixelConverter converter= new PixelConverter(button); int widthHint= converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); } | /**
* Returns a width hint for a button control.
* @param button the button
* @return the width hint
*/ | Returns a width hint for a button control | getButtonWidthHint | {
"repo_name": "brunyuriy/quick-fix-scout",
"path": "org.eclipse.jdt.ui_3.7.1.r371_v20110824-0800/src/org/eclipse/jdt/internal/ui/util/SWTUtil.java",
"license": "mit",
"size": 4985
} | [
"org.eclipse.jface.dialogs.IDialogConstants",
"org.eclipse.jface.layout.PixelConverter",
"org.eclipse.jface.resource.JFaceResources",
"org.eclipse.swt.widgets.Button"
] | import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.layout.PixelConverter; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.swt.widgets.Button; | import org.eclipse.jface.dialogs.*; import org.eclipse.jface.layout.*; import org.eclipse.jface.resource.*; import org.eclipse.swt.widgets.*; | [
"org.eclipse.jface",
"org.eclipse.swt"
] | org.eclipse.jface; org.eclipse.swt; | 1,248,395 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.