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
@Test public void testDispatchEvent() throws InterruptedException, NativeHookException { System.out.println("dispatchEvent"); // Setup and event listener. NativeKeyListenerImpl keyListener = new NativeKeyListenerImpl(); GlobalScreen.addNativeKeyListener(keyListener); NativeMouseInputListenerImpl mouseListener = new NativeMouseInputListenerImpl(); GlobalScreen.addNativeMouseListener(mouseListener); NativeMouseWheelListenerImpl wheelListener = new NativeMouseWheelListenerImpl(); GlobalScreen.addNativeMouseWheelListener(wheelListener); // Make sure the native thread is running! GlobalScreen.registerNativeHook(); // Dispatch a key event and check to see if it was sent. NativeKeyEvent keyEvent = new NativeKeyEvent( NativeKeyEvent.NATIVE_KEY_PRESSED, System.currentTimeMillis(), 0x00, // Modifiers 0x41, // Raw Code NativeKeyEvent.VC_A, NativeKeyEvent.CHAR_UNDEFINED, NativeKeyEvent.KEY_LOCATION_STANDARD); synchronized (keyListener) { GlobalScreen.dispatchEvent(keyEvent); keyListener.wait(3000); assertEquals(keyEvent, keyListener.getLastEvent()); } // Dispatch a mouse event and check to see if it was sent. NativeMouseEvent mouseEvent = new NativeMouseEvent( NativeMouseEvent.NATIVE_MOUSE_CLICKED, System.currentTimeMillis(), 0x00, // Modifiers 50, // X 75, // Y 1, // Click Count NativeMouseEvent.BUTTON1); synchronized (mouseListener) { GlobalScreen.dispatchEvent(mouseEvent); mouseListener.wait(3000); assertEquals(mouseEvent, mouseListener.getLastEvent()); } // Dispatch a mouse event and check to see if it was sent. NativeMouseWheelEvent wheelEvent = new NativeMouseWheelEvent( NativeMouseEvent.NATIVE_MOUSE_WHEEL, System.currentTimeMillis(), 0x00, // Modifiers 50, // X 75, // Y 1, // Click Count NativeMouseWheelEvent.WHEEL_UNIT_SCROLL, 3, // Scroll Amount -1); // Wheel Rotation synchronized (wheelListener) { GlobalScreen.dispatchEvent(wheelEvent); wheelListener.wait(3000); assertEquals(wheelEvent, wheelListener.getLastEvent()); } // Stop the native thread. GlobalScreen.unregisterNativeHook(); // Remove all added listeners. GlobalScreen.removeNativeKeyListener(keyListener); GlobalScreen.removeNativeMouseListener(mouseListener); GlobalScreen.removeNativeMouseWheelListener(wheelListener); }
void function() throws InterruptedException, NativeHookException { System.out.println(STR); NativeKeyListenerImpl keyListener = new NativeKeyListenerImpl(); GlobalScreen.addNativeKeyListener(keyListener); NativeMouseInputListenerImpl mouseListener = new NativeMouseInputListenerImpl(); GlobalScreen.addNativeMouseListener(mouseListener); NativeMouseWheelListenerImpl wheelListener = new NativeMouseWheelListenerImpl(); GlobalScreen.addNativeMouseWheelListener(wheelListener); GlobalScreen.registerNativeHook(); NativeKeyEvent keyEvent = new NativeKeyEvent( NativeKeyEvent.NATIVE_KEY_PRESSED, System.currentTimeMillis(), 0x00, 0x41, NativeKeyEvent.VC_A, NativeKeyEvent.CHAR_UNDEFINED, NativeKeyEvent.KEY_LOCATION_STANDARD); synchronized (keyListener) { GlobalScreen.dispatchEvent(keyEvent); keyListener.wait(3000); assertEquals(keyEvent, keyListener.getLastEvent()); } NativeMouseEvent mouseEvent = new NativeMouseEvent( NativeMouseEvent.NATIVE_MOUSE_CLICKED, System.currentTimeMillis(), 0x00, 50, 75, 1, NativeMouseEvent.BUTTON1); synchronized (mouseListener) { GlobalScreen.dispatchEvent(mouseEvent); mouseListener.wait(3000); assertEquals(mouseEvent, mouseListener.getLastEvent()); } NativeMouseWheelEvent wheelEvent = new NativeMouseWheelEvent( NativeMouseEvent.NATIVE_MOUSE_WHEEL, System.currentTimeMillis(), 0x00, 50, 75, 1, NativeMouseWheelEvent.WHEEL_UNIT_SCROLL, 3, -1); synchronized (wheelListener) { GlobalScreen.dispatchEvent(wheelEvent); wheelListener.wait(3000); assertEquals(wheelEvent, wheelListener.getLastEvent()); } GlobalScreen.unregisterNativeHook(); GlobalScreen.removeNativeKeyListener(keyListener); GlobalScreen.removeNativeMouseListener(mouseListener); GlobalScreen.removeNativeMouseWheelListener(wheelListener); }
/** * Test of dispatchEvent method, of class GlobalScreen. */
Test of dispatchEvent method, of class GlobalScreen
testDispatchEvent
{ "repo_name": "saifrahmed/Whereabouts", "path": "src/test/org/jnativehook/GlobalScreenTest.java", "license": "gpl-3.0", "size": 20305 }
[ "org.jnativehook.keyboard.NativeKeyEvent", "org.jnativehook.keyboard.listeners.NativeKeyListenerImpl", "org.jnativehook.mouse.NativeMouseEvent", "org.jnativehook.mouse.NativeMouseWheelEvent", "org.jnativehook.mouse.listeners.NativeMouseInputListenerImpl", "org.jnativehook.mouse.listeners.NativeMouseWheelListenerImpl", "org.junit.Assert" ]
import org.jnativehook.keyboard.NativeKeyEvent; import org.jnativehook.keyboard.listeners.NativeKeyListenerImpl; import org.jnativehook.mouse.NativeMouseEvent; import org.jnativehook.mouse.NativeMouseWheelEvent; import org.jnativehook.mouse.listeners.NativeMouseInputListenerImpl; import org.jnativehook.mouse.listeners.NativeMouseWheelListenerImpl; import org.junit.Assert;
import org.jnativehook.keyboard.*; import org.jnativehook.keyboard.listeners.*; import org.jnativehook.mouse.*; import org.jnativehook.mouse.listeners.*; import org.junit.*;
[ "org.jnativehook.keyboard", "org.jnativehook.mouse", "org.junit" ]
org.jnativehook.keyboard; org.jnativehook.mouse; org.junit;
1,681,387
public static final Option<String> TYPE_NAMESPACE = ToolOptions.createOption( String.class, "type_namespace", "(For OpenAPI Input Only) A namespace to use in generated " + "service config for all types. If provided, all type names will be prefixed by this" + " value and a dot ('.') separator.", ""); public static final Option<String> METHOD_NAMESPACE = ToolOptions.createOption( String.class, "method_namespace", "(For OpenAPI Input Only) A namespace to use in generated service config " + "for all methods. If provided, all method names will be prefixed by this value " + "and a dot ('.') separator.", ""); public static final Option<String> SERVICE_NAME = ToolOptions.createOption( String.class, "service_name", "(For OpenAPI Input Only) Service name to be used in the converted service " + "config.", ""); public static final Option<String> OPEN_API = ToolOptions.createOption( String.class, "openapi", "Path to the OpenAPI spec to be converted into service config", ""); private Service serviceConfig = null; private OpenApiToService tool; protected Model model; protected SwaggerToolDriverBase(ToolOptions options) { super(options); }
public static final Option<String> TYPE_NAMESPACE = ToolOptions.createOption( String.class, STR, STR + STR + STR, STRmethod_namespaceSTR(For OpenAPI Input Only) A namespace to use in generated service config STRfor all methods. If provided, all method names will be prefixed by this value STRand a dot ('.') separator.STRSTRservice_nameSTR(For OpenAPI Input Only) Service name to be used in the converted service STRconfig.STRSTRopenapiSTRPath to the OpenAPI spec to be converted into service configSTR"); private Service serviceConfig = null; private OpenApiToService tool; protected Model model; protected SwaggerToolDriverBase(ToolOptions options) { super(options); }
/** * An empty method to ensure statics in this class are initialized if it hasn't been accessed * otherwise. */
An empty method to ensure statics in this class are initialized if it hasn't been accessed otherwise
ensureStaticsInitialized
{ "repo_name": "googleapis/api-compiler", "path": "src/main/java/com/google/api/tools/framework/tools/SwaggerToolDriverBase.java", "license": "apache-2.0", "size": 6015 }
[ "com.google.api.Service", "com.google.api.tools.framework.importers.swagger.OpenApiToService", "com.google.api.tools.framework.model.Model", "com.google.api.tools.framework.tools.ToolOptions" ]
import com.google.api.Service; import com.google.api.tools.framework.importers.swagger.OpenApiToService; import com.google.api.tools.framework.model.Model; import com.google.api.tools.framework.tools.ToolOptions;
import com.google.api.*; import com.google.api.tools.framework.importers.swagger.*; import com.google.api.tools.framework.model.*; import com.google.api.tools.framework.tools.*;
[ "com.google.api" ]
com.google.api;
552,236
public List<Tuple3<FieldsGenome, FieldsIsConfiguredBy, FieldsAtomicRegulon>> getRelationshipIsConfiguredBy(List<String> ids, List<String> fromFields, List<String> relFields, List<String> toFields) throws IOException, JsonClientException { List<Object> args = new ArrayList<Object>(); args.add(ids); args.add(fromFields); args.add(relFields); args.add(toFields); TypeReference<List<List<Tuple3<FieldsGenome, FieldsIsConfiguredBy, FieldsAtomicRegulon>>>> retType = new TypeReference<List<List<Tuple3<FieldsGenome, FieldsIsConfiguredBy, FieldsAtomicRegulon>>>>() {}; List<List<Tuple3<FieldsGenome, FieldsIsConfiguredBy, FieldsAtomicRegulon>>> res = caller.jsonrpcCall("CDMI_EntityAPI.get_relationship_IsConfiguredBy", args, retType, true, false); return res.get(0); }
List<Tuple3<FieldsGenome, FieldsIsConfiguredBy, FieldsAtomicRegulon>> function(List<String> ids, List<String> fromFields, List<String> relFields, List<String> toFields) throws IOException, JsonClientException { List<Object> args = new ArrayList<Object>(); args.add(ids); args.add(fromFields); args.add(relFields); args.add(toFields); TypeReference<List<List<Tuple3<FieldsGenome, FieldsIsConfiguredBy, FieldsAtomicRegulon>>>> retType = new TypeReference<List<List<Tuple3<FieldsGenome, FieldsIsConfiguredBy, FieldsAtomicRegulon>>>>() {}; List<List<Tuple3<FieldsGenome, FieldsIsConfiguredBy, FieldsAtomicRegulon>>> res = caller.jsonrpcCall(STR, args, retType, true, false); return res.get(0); }
/** * <p>Original spec-file function name: get_relationship_IsConfiguredBy</p> * <pre> * This relationship connects a genome to the atomic regulons that * describe its state. * It has the following fields: * =over 4 * =back * </pre> * @param ids instance of list of String * @param fromFields instance of list of String * @param relFields instance of list of String * @param toFields instance of list of String * @return instance of list of tuple of size 3: type {@link us.kbase.cdmientityapi.FieldsGenome FieldsGenome} (original type "fields_Genome"), type {@link us.kbase.cdmientityapi.FieldsIsConfiguredBy FieldsIsConfiguredBy} (original type "fields_IsConfiguredBy"), type {@link us.kbase.cdmientityapi.FieldsAtomicRegulon FieldsAtomicRegulon} (original type "fields_AtomicRegulon") * @throws IOException if an IO exception occurs * @throws JsonClientException if a JSON RPC exception occurs */
Original spec-file function name: get_relationship_IsConfiguredBy <code> This relationship connects a genome to the atomic regulons that describe its state. It has the following fields: =over 4 =back </code>
getRelationshipIsConfiguredBy
{ "repo_name": "kbase/trees", "path": "src/us/kbase/cdmientityapi/CDMIEntityAPIClient.java", "license": "mit", "size": 869221 }
[ "com.fasterxml.jackson.core.type.TypeReference", "java.io.IOException", "java.util.ArrayList", "java.util.List", "us.kbase.common.service.JsonClientException", "us.kbase.common.service.Tuple3" ]
import com.fasterxml.jackson.core.type.TypeReference; import java.io.IOException; import java.util.ArrayList; import java.util.List; import us.kbase.common.service.JsonClientException; import us.kbase.common.service.Tuple3;
import com.fasterxml.jackson.core.type.*; import java.io.*; import java.util.*; import us.kbase.common.service.*;
[ "com.fasterxml.jackson", "java.io", "java.util", "us.kbase.common" ]
com.fasterxml.jackson; java.io; java.util; us.kbase.common;
1,967,637
public static BundleContext getContext() { return context; }
static BundleContext function() { return context; }
/** * Returns the bundle context of this bundle * * @return the bundle context */
Returns the bundle context of this bundle
getContext
{ "repo_name": "idserda/openhab", "path": "bundles/binding/org.openhab.binding.intertechno/src/main/java/org/openhab/binding/intertechno/internal/CULIntertechnoActivator.java", "license": "epl-1.0", "size": 1497 }
[ "org.osgi.framework.BundleContext" ]
import org.osgi.framework.BundleContext;
import org.osgi.framework.*;
[ "org.osgi.framework" ]
org.osgi.framework;
116,065
ItemStack apply(boolean value, ItemStack stack);
ItemStack apply(boolean value, ItemStack stack);
/** * <p>Apply the given value to the ItemStack.</p> * * @param value the value to store * @param stack the ItemStack * @return the same ItemStack, for convenience */
Apply the given value to the ItemStack
apply
{ "repo_name": "diesieben07/SevenCommons", "path": "src/main/java/de/take_weiland/mods/commons/meta/BooleanProperty.java", "license": "lgpl-3.0", "size": 3893 }
[ "net.minecraft.item.ItemStack" ]
import net.minecraft.item.ItemStack;
import net.minecraft.item.*;
[ "net.minecraft.item" ]
net.minecraft.item;
2,414,399
@SimpleProperty( category = PropertyCategory.BEHAVIOR) public String DataUri() { return dataUri; }
@SimpleProperty( category = PropertyCategory.BEHAVIOR) String function() { return dataUri; }
/** * Returns the data URI that will be used to start the activity. */
Returns the data URI that will be used to start the activity
DataUri
{ "repo_name": "josmas/app-inventor", "path": "appinventor/components/src/com/google/appinventor/components/runtime/ActivityStarter.java", "license": "apache-2.0", "size": 22558 }
[ "com.google.appinventor.components.annotations.PropertyCategory", "com.google.appinventor.components.annotations.SimpleProperty" ]
import com.google.appinventor.components.annotations.PropertyCategory; import com.google.appinventor.components.annotations.SimpleProperty;
import com.google.appinventor.components.annotations.*;
[ "com.google.appinventor" ]
com.google.appinventor;
2,802,676
public synchronized void start() throws TezException, IOException { amConfig.setYarnConfiguration(new YarnConfiguration(amConfig.getTezConfiguration())); frameworkClient = createFrameworkClient(); frameworkClient.init(amConfig.getTezConfiguration(), amConfig.getYarnConfiguration()); frameworkClient.start(); if (this.amConfig.getTezConfiguration().get( TezConfiguration.TEZ_HISTORY_LOGGING_SERVICE_CLASS, "") .equals(atsHistoryLoggingServiceClassName)) { LOG.info("Using " + atsHistoryACLManagerClassName + " to manage Timeline ACLs"); try { historyACLPolicyManager = ReflectionUtils.createClazzInstance( atsHistoryACLManagerClassName); historyACLPolicyManager.setConf(this.amConfig.getYarnConfiguration()); } catch (TezUncheckedException e) { LOG.warn("Could not instantiate object for " + atsHistoryACLManagerClassName + ". ACLs cannot be enforced correctly for history data in Timeline", e); if (!amConfig.getTezConfiguration().getBoolean( TezConfiguration.TEZ_AM_ALLOW_DISABLED_TIMELINE_DOMAINS, TezConfiguration.TEZ_AM_ALLOW_DISABLED_TIMELINE_DOMAINS_DEFAULT)) { throw e; } historyACLPolicyManager = null; } } if (isSession) { LOG.info("Session mode. Starting session."); TezClientUtils.processTezLocalCredentialsFile(sessionCredentials, amConfig.getTezConfiguration()); Map<String, LocalResource> tezJarResources = getTezJarResources(sessionCredentials); clientTimeout = amConfig.getTezConfiguration().getInt( TezConfiguration.TEZ_SESSION_CLIENT_TIMEOUT_SECS, TezConfiguration.TEZ_SESSION_CLIENT_TIMEOUT_SECS_DEFAULT); try { if (sessionAppId == null) { sessionAppId = createApplication(); } // Add session token for shuffle TezClientUtils.createSessionToken(sessionAppId.toString(), jobTokenSecretManager, sessionCredentials); ApplicationSubmissionContext appContext = TezClientUtils.createApplicationSubmissionContext( sessionAppId, null, clientName, amConfig, tezJarResources, sessionCredentials, usingTezArchiveDeploy, apiVersionInfo, historyACLPolicyManager); // Set Tez Sessions to not retry on AM crashes if recovery is disabled if (!amConfig.getTezConfiguration().getBoolean( TezConfiguration.DAG_RECOVERY_ENABLED, TezConfiguration.DAG_RECOVERY_ENABLED_DEFAULT)) { appContext.setMaxAppAttempts(1); } frameworkClient.submitApplication(appContext); ApplicationReport appReport = frameworkClient.getApplicationReport(sessionAppId); LOG.info("The url to track the Tez Session: " + appReport.getTrackingUrl()); sessionStarted = true; } catch (YarnException e) { throw new TezException(e); } } }
synchronized void function() throws TezException, IOException { amConfig.setYarnConfiguration(new YarnConfiguration(amConfig.getTezConfiguration())); frameworkClient = createFrameworkClient(); frameworkClient.init(amConfig.getTezConfiguration(), amConfig.getYarnConfiguration()); frameworkClient.start(); if (this.amConfig.getTezConfiguration().get( TezConfiguration.TEZ_HISTORY_LOGGING_SERVICE_CLASS, STRUsing STR to manage Timeline ACLsSTRCould not instantiate object for STR. ACLs cannot be enforced correctly for history data in TimelineSTRSession mode. Starting session.STRThe url to track the Tez Session: " + appReport.getTrackingUrl()); sessionStarted = true; } catch (YarnException e) { throw new TezException(e); } } }
/** * Start the client. This establishes a connection to the YARN cluster. * In session mode, this start the App Master thats runs all the DAGs in the * session. * @throws TezException * @throws IOException */
Start the client. This establishes a connection to the YARN cluster. In session mode, this start the App Master thats runs all the DAGs in the session
start
{ "repo_name": "Altiscale/tez", "path": "tez-api/src/main/java/org/apache/tez/client/TezClient.java", "license": "apache-2.0", "size": 32591 }
[ "java.io.IOException", "org.apache.hadoop.yarn.conf.YarnConfiguration", "org.apache.hadoop.yarn.exceptions.YarnException", "org.apache.tez.dag.api.TezConfiguration", "org.apache.tez.dag.api.TezException" ]
import java.io.IOException; import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.tez.dag.api.TezConfiguration; import org.apache.tez.dag.api.TezException;
import java.io.*; import org.apache.hadoop.yarn.conf.*; import org.apache.hadoop.yarn.exceptions.*; import org.apache.tez.dag.api.*;
[ "java.io", "org.apache.hadoop", "org.apache.tez" ]
java.io; org.apache.hadoop; org.apache.tez;
629,274
public NavigableMap<byte[], NavigableMap<byte[], byte[]>> getNoVersionMap() { if(this.familyMap == null) { getMap(); } if(isEmpty()) { return null; } NavigableMap<byte[], NavigableMap<byte[], byte[]>> returnMap = new TreeMap<>(Bytes.BYTES_COMPARATOR); for(Map.Entry<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> familyEntry : familyMap.entrySet()) { NavigableMap<byte[], byte[]> qualifierMap = new TreeMap<>(Bytes.BYTES_COMPARATOR); for(Map.Entry<byte[], NavigableMap<Long, byte[]>> qualifierEntry : familyEntry.getValue().entrySet()) { byte [] value = qualifierEntry.getValue().get(qualifierEntry.getValue().firstKey()); qualifierMap.put(qualifierEntry.getKey(), value); } returnMap.put(familyEntry.getKey(), qualifierMap); } return returnMap; }
NavigableMap<byte[], NavigableMap<byte[], byte[]>> function() { if(this.familyMap == null) { getMap(); } if(isEmpty()) { return null; } NavigableMap<byte[], NavigableMap<byte[], byte[]>> returnMap = new TreeMap<>(Bytes.BYTES_COMPARATOR); for(Map.Entry<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> familyEntry : familyMap.entrySet()) { NavigableMap<byte[], byte[]> qualifierMap = new TreeMap<>(Bytes.BYTES_COMPARATOR); for(Map.Entry<byte[], NavigableMap<Long, byte[]>> qualifierEntry : familyEntry.getValue().entrySet()) { byte [] value = qualifierEntry.getValue().get(qualifierEntry.getValue().firstKey()); qualifierMap.put(qualifierEntry.getKey(), value); } returnMap.put(familyEntry.getKey(), qualifierMap); } return returnMap; }
/** * Map of families to their most recent qualifiers and values. * <p> * Returns a two level Map of the form: <code>Map&amp;family,Map&lt;qualifier,value&gt;&gt;</code> * <p> * The most recent version of each qualifier will be used. * @return map from families to qualifiers and value */
Map of families to their most recent qualifiers and values. Returns a two level Map of the form: <code>Map&amp;family,Map&lt;qualifier,value&gt;&gt;</code> The most recent version of each qualifier will be used
getNoVersionMap
{ "repo_name": "vincentpoon/hbase", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java", "license": "apache-2.0", "size": 33617 }
[ "java.util.Map", "java.util.NavigableMap", "java.util.TreeMap", "org.apache.hadoop.hbase.util.Bytes" ]
import java.util.Map; import java.util.NavigableMap; import java.util.TreeMap; import org.apache.hadoop.hbase.util.Bytes;
import java.util.*; import org.apache.hadoop.hbase.util.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
1,618,500
public static void setNumberOfThreads(Job job, int threads) { job.getConfiguration().setInt(NUMBER_OF_THREADS, threads); }
static void function(Job job, int threads) { job.getConfiguration().setInt(NUMBER_OF_THREADS, threads); }
/** * Set the number of threads in the pool for running maps. * @param job the job to modify * @param threads the new number of threads */
Set the number of threads in the pool for running maps
setNumberOfThreads
{ "repo_name": "alipayhuber/hack-hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/MultithreadedTableMapper.java", "license": "apache-2.0", "size": 9726 }
[ "org.apache.hadoop.mapreduce.Job" ]
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
828,615
public final class StreamAnalyticsManager extends ManagerCore<StreamAnalyticsManager, StreamAnalyticsManagementClientImpl> { private Operations operations; private StreamingJobs streamingJobs; private Inputs inputs; private Outputs outputs; private Transformations transformations; private Functions functions; private Subscriptions subscriptions; public static Configurable configure() { return new StreamAnalyticsManager.ConfigurableImpl(); }
final class StreamAnalyticsManager extends ManagerCore<StreamAnalyticsManager, StreamAnalyticsManagementClientImpl> { private Operations operations; private StreamingJobs streamingJobs; private Inputs inputs; private Outputs outputs; private Transformations transformations; private Functions functions; private Subscriptions subscriptions; public static Configurable function() { return new StreamAnalyticsManager.ConfigurableImpl(); }
/** * Get a Configurable instance that can be used to create StreamAnalyticsManager with optional configuration. * * @return the instance allowing configurations */
Get a Configurable instance that can be used to create StreamAnalyticsManager with optional configuration
configure
{ "repo_name": "hovsepm/azure-sdk-for-java", "path": "streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/StreamAnalyticsManager.java", "license": "mit", "size": 6505 }
[ "com.microsoft.azure.arm.resources.implementation.ManagerCore", "com.microsoft.azure.management.streamanalytics.v2016_03_01.Functions", "com.microsoft.azure.management.streamanalytics.v2016_03_01.Inputs", "com.microsoft.azure.management.streamanalytics.v2016_03_01.Operations", "com.microsoft.azure.management.streamanalytics.v2016_03_01.Outputs", "com.microsoft.azure.management.streamanalytics.v2016_03_01.StreamingJobs", "com.microsoft.azure.management.streamanalytics.v2016_03_01.Subscriptions", "com.microsoft.azure.management.streamanalytics.v2016_03_01.Transformations" ]
import com.microsoft.azure.arm.resources.implementation.ManagerCore; import com.microsoft.azure.management.streamanalytics.v2016_03_01.Functions; import com.microsoft.azure.management.streamanalytics.v2016_03_01.Inputs; import com.microsoft.azure.management.streamanalytics.v2016_03_01.Operations; import com.microsoft.azure.management.streamanalytics.v2016_03_01.Outputs; import com.microsoft.azure.management.streamanalytics.v2016_03_01.StreamingJobs; import com.microsoft.azure.management.streamanalytics.v2016_03_01.Subscriptions; import com.microsoft.azure.management.streamanalytics.v2016_03_01.Transformations;
import com.microsoft.azure.arm.resources.implementation.*; import com.microsoft.azure.management.streamanalytics.v2016_03_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
2,621,638
public byte[] acceptDelegation(int lifetime, byte[] but, int off, int len) throws GSSException;
byte[] function(int lifetime, byte[] but, int off, int len) throws GSSException;
/** * Accept a delegated credential. * * This functions drives the accepting side of the credential * delegation process. It is expected to be called in tandem with the * <code>initDelegation</code> function. * * @param lifetime * The requested period of validity (seconds) of the delegated * credential. * @return A token that should be passed to <code>initDelegation</code> if * <code>isDelegationFinished</code> returns false. May be null. * @exception GSSException containing the following major error codes: * <code>GSSException.FAILURE</code> */
Accept a delegated credential. This functions drives the accepting side of the credential delegation process. It is expected to be called in tandem with the <code>initDelegation</code> function
acceptDelegation
{ "repo_name": "jglobus/JGlobus", "path": "ssl-proxies/src/main/java/org/gridforum/jgss/ExtendedGSSContext.java", "license": "apache-2.0", "size": 6041 }
[ "org.ietf.jgss.GSSException" ]
import org.ietf.jgss.GSSException;
import org.ietf.jgss.*;
[ "org.ietf.jgss" ]
org.ietf.jgss;
242,711
public static <T extends Annotation> void addRule(Binder binder, Class<T> annotationClass, Function<T, Collection<Right>> extractor) { get(binder).addRule(annotationClass, extractor); }
static <T extends Annotation> void function(Binder binder, Class<T> annotationClass, Function<T, Collection<Right>> extractor) { get(binder).addRule(annotationClass, extractor); }
/** * Add a rule to extract rights from a certain annotation * * @param extractor * extractor of rights from a single occurrence of the * annotation. If the annotation is repeated, the extractor is * invoked multiple times. The return value may be null */
Add a rule to extract rights from a certain annotation
addRule
{ "repo_name": "ruediste/rise", "path": "framework/src/main/java/com/github/ruediste/rise/core/security/authorization/MethodAuthorizationManager.java", "license": "apache-2.0", "size": 8287 }
[ "com.github.ruediste.salta.jsr330.binder.Binder", "java.lang.annotation.Annotation", "java.util.Collection", "java.util.function.Function" ]
import com.github.ruediste.salta.jsr330.binder.Binder; import java.lang.annotation.Annotation; import java.util.Collection; import java.util.function.Function;
import com.github.ruediste.salta.jsr330.binder.*; import java.lang.annotation.*; import java.util.*; import java.util.function.*;
[ "com.github.ruediste", "java.lang", "java.util" ]
com.github.ruediste; java.lang; java.util;
2,071,983
@Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() { LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); em.setDataSource(dataSource()); em.setPackagesToScan(new String[]{"com.example.tutorial"}); JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); em.setJpaVendorAdapter(vendorAdapter); em.setJpaProperties(additionalProperties()); return em; }
LocalContainerEntityManagerFactoryBean function() { LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); em.setDataSource(dataSource()); em.setPackagesToScan(new String[]{STR}); JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); em.setJpaVendorAdapter(vendorAdapter); em.setJpaProperties(additionalProperties()); return em; }
/** * Create entity manager. * * @return entity manager */
Create entity manager
entityManagerFactory
{ "repo_name": "lromal/elib-project", "path": "src/main/java/com/example/tutorial/config/PersistenceJPAConfig.java", "license": "mit", "size": 3592 }
[ "org.springframework.orm.jpa.JpaVendorAdapter", "org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean", "org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" ]
import org.springframework.orm.jpa.JpaVendorAdapter; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.orm.jpa.*; import org.springframework.orm.jpa.vendor.*;
[ "org.springframework.orm" ]
org.springframework.orm;
2,604,270
@Override public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion, int newVersion) { try { if(BuildConfig.DEBUG) Log.i(DatabaseHelper.class.getName(), "onUpgrade"); TableUtils.dropTable(connectionSource, SearchRecordRecentInfo.class, true); // after we drop the old databases, we create the new ones onCreate(db, connectionSource); } catch (SQLException e) { if(BuildConfig.DEBUG) Log.e(DatabaseHelper.class.getName(), "Can't drop databases", e); throw new RuntimeException(e); } }
void function(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion, int newVersion) { try { if(BuildConfig.DEBUG) Log.i(DatabaseHelper.class.getName(), STR); TableUtils.dropTable(connectionSource, SearchRecordRecentInfo.class, true); onCreate(db, connectionSource); } catch (SQLException e) { if(BuildConfig.DEBUG) Log.e(DatabaseHelper.class.getName(), STR, e); throw new RuntimeException(e); } }
/** * This is called when your application is upgraded and it has a higher * version number. This allows you to adjust the various data to match the * new version number. */
This is called when your application is upgraded and it has a higher version number. This allows you to adjust the various data to match the new version number
onUpgrade
{ "repo_name": "simplelifetian/GomeOnline", "path": "jrj-TouGu/src/com/gome/haoyuangong/db/DatabaseHelper.java", "license": "apache-2.0", "size": 3481 }
[ "android.database.sqlite.SQLiteDatabase", "android.util.Log", "com.gome.haoyuangong.BuildConfig", "com.gome.haoyuangong.bean.SearchRecordRecentInfo", "com.j256.ormlite.support.ConnectionSource", "com.j256.ormlite.table.TableUtils", "java.sql.SQLException" ]
import android.database.sqlite.SQLiteDatabase; import android.util.Log; import com.gome.haoyuangong.BuildConfig; import com.gome.haoyuangong.bean.SearchRecordRecentInfo; import com.j256.ormlite.support.ConnectionSource; import com.j256.ormlite.table.TableUtils; import java.sql.SQLException;
import android.database.sqlite.*; import android.util.*; import com.gome.haoyuangong.*; import com.gome.haoyuangong.bean.*; import com.j256.ormlite.support.*; import com.j256.ormlite.table.*; import java.sql.*;
[ "android.database", "android.util", "com.gome.haoyuangong", "com.j256.ormlite", "java.sql" ]
android.database; android.util; com.gome.haoyuangong; com.j256.ormlite; java.sql;
346,026
public Point2D getCenter() { return center; }
Point2D function() { return center; }
/** * Gets the current pixel center of the map. This point is in the global * bitmap coordinate system, not as lat/longs. * * @return the current center of the map as a pixel value */
Gets the current pixel center of the map. This point is in the global bitmap coordinate system, not as lat/longs
getCenter
{ "repo_name": "meteoinfo/meteoinfolib", "path": "src/org/meteoinfo/layer/WebMapLayer.java", "license": "lgpl-3.0", "size": 30473 }
[ "java.awt.geom.Point2D" ]
import java.awt.geom.Point2D;
import java.awt.geom.*;
[ "java.awt" ]
java.awt;
827,230
public DeleteByQueryRequest routing(String... routings) { this.routing = Strings.arrayToCommaDelimitedString(routings); return this; }
DeleteByQueryRequest function(String... routings) { this.routing = Strings.arrayToCommaDelimitedString(routings); return this; }
/** * The routing values to control the shards that the search will be executed on. */
The routing values to control the shards that the search will be executed on
routing
{ "repo_name": "alexksikes/elasticsearch", "path": "src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java", "license": "apache-2.0", "size": 7168 }
[ "org.elasticsearch.common.Strings" ]
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
294,462
protected Object readLocation() throws IOException, ClassNotFoundException { return (locIn == null ? null : locIn.readObject()); } }
Object function() throws IOException, ClassNotFoundException { return (locIn == null ? null : locIn.readObject()); } }
/** * Overrides MarshalInputStream.readLocation to return locations from * the stream we were given, or <code>null</code> if we were given a * <code>null</code> location stream. */
Overrides MarshalInputStream.readLocation to return locations from the stream we were given, or <code>null</code> if we were given a <code>null</code> location stream
readLocation
{ "repo_name": "flyzsd/java-code-snippets", "path": "ibm.jdk8/src/java/rmi/MarshalledObject.java", "license": "mit", "size": 11165 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
111,823
public static PTransform<PBegin, PCollection<String>> readStandardStream( List<TwitterConfig> twitterConfigs) { return new TwitterIO.Read.Builder().setTwitterConfig(twitterConfigs).build(); } private static class Read extends PTransform<PBegin, PCollection<String>> { private final List<TwitterConfig> twitterConfigs; private Read(Builder builder) { this.twitterConfigs = builder.twitterConfigs; }
static PTransform<PBegin, PCollection<String>> function( List<TwitterConfig> twitterConfigs) { return new TwitterIO.Read.Builder().setTwitterConfig(twitterConfigs).build(); } private static class Read extends PTransform<PBegin, PCollection<String>> { private final List<TwitterConfig> twitterConfigs; private Read(Builder builder) { this.twitterConfigs = builder.twitterConfigs; }
/** * Initializes the stream by converting input to a Twitter connection configuration. * * @param twitterConfigs list of twitter config * @return PTransform of statuses */
Initializes the stream by converting input to a Twitter connection configuration
readStandardStream
{ "repo_name": "axbaretto/beam", "path": "examples/java/src/main/java/org/apache/beam/examples/complete/twitterstreamgenerator/TwitterIO.java", "license": "apache-2.0", "size": 3535 }
[ "java.util.List", "org.apache.beam.sdk.transforms.PTransform", "org.apache.beam.sdk.values.PBegin", "org.apache.beam.sdk.values.PCollection" ]
import java.util.List; import org.apache.beam.sdk.transforms.PTransform; import org.apache.beam.sdk.values.PBegin; import org.apache.beam.sdk.values.PCollection;
import java.util.*; import org.apache.beam.sdk.transforms.*; import org.apache.beam.sdk.values.*;
[ "java.util", "org.apache.beam" ]
java.util; org.apache.beam;
2,602,827
@Override protected Application findApplication(final URI uri) throws InvalidApplicationException, RedirectException { if (uri instanceof SipURI) { try { String name = ((SipURI) uri).getUser(); return createApplication(name, 0, name, null); } catch(Exception e) { LOG.warn("Unable to find the application for " + uri + ", but for test purpose, just use mock.js as test file name"); ; } } try { return createApplication(getURL("mock.js"), getCanonicalType("js"), 0, "mock.js", null); } catch(Exception ex) { throw new InvalidApplicationException(ex); } }
Application function(final URI uri) throws InvalidApplicationException, RedirectException { if (uri instanceof SipURI) { try { String name = ((SipURI) uri).getUser(); return createApplication(name, 0, name, null); } catch(Exception e) { LOG.warn(STR + uri + STR); ; } } try { return createApplication(getURL(STR), getCanonicalType("js"), 0, STR, null); } catch(Exception ex) { throw new InvalidApplicationException(ex); } }
/** * The current logic looks for a script using SIP URI's user name as the * script file name. E.g., SIP URL user name is abc.js (or abc_js), it looks * for <sipmethod>/apps/tropo/script/abc.js as the application URL. */
The current logic looks for a script using SIP URI's user name as the script file name. E.g., SIP URL user name is abc.js (or abc_js), it looks for /apps/tropo/script/abc.js as the application URL
findApplication
{ "repo_name": "tropo/tropo-servlet", "path": "app/MockAppMgr.java", "license": "lgpl-2.1", "size": 2262 }
[ "javax.servlet.sip.SipURI" ]
import javax.servlet.sip.SipURI;
import javax.servlet.sip.*;
[ "javax.servlet" ]
javax.servlet;
1,849,048
public CompletableFuture<Void> stateChanged(GdbStateChangeRecord sco) { return requestElements(true).thenCompose(__ -> { GdbModelTargetStackFrame innermost = framesByLevel.get(0); if (innermost != null) { return innermost.stateChanged(sco); } return AsyncUtils.NIL; }).exceptionally(e -> { impl.reportError(this, "Could not update stack " + this + " on STOPPED", e); return null; }); }
CompletableFuture<Void> function(GdbStateChangeRecord sco) { return requestElements(true).thenCompose(__ -> { GdbModelTargetStackFrame innermost = framesByLevel.get(0); if (innermost != null) { return innermost.stateChanged(sco); } return AsyncUtils.NIL; }).exceptionally(e -> { impl.reportError(this, STR + this + STR, e); return null; }); }
/** * Re-fetch the stack frames, generating events for updates * * <p> * GDB doesn't produce stack change events, but they should only ever happen by running a * target. Thus, every time we're STOPPED, this method should be called. */
Re-fetch the stack frames, generating events for updates GDB doesn't produce stack change events, but they should only ever happen by running a target. Thus, every time we're STOPPED, this method should be called
stateChanged
{ "repo_name": "NationalSecurityAgency/ghidra", "path": "Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStack.java", "license": "apache-2.0", "size": 3523 }
[ "java.util.concurrent.CompletableFuture" ]
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,748,737
private void resizeStore(final long _prevStoreSize, final boolean sleep) { Logger.normal(this, "Starting datastore resize"); System.out.println("Resizing datastore "+name); BatchProcessor<T> resizeProcesser = new BatchProcessor<T>() { List<Entry> oldEntryList = new LinkedList<Entry>(); int optimialK;
void function(final long _prevStoreSize, final boolean sleep) { Logger.normal(this, STR); System.out.println(STR+name); BatchProcessor<T> resizeProcesser = new BatchProcessor<T>() { List<Entry> oldEntryList = new LinkedList<Entry>(); int optimialK;
/** * Move old entries to new location and resize store */
Move old entries to new location and resize store
resizeStore
{ "repo_name": "tbaumeist/FreeNet-Source", "path": "src/freenet/store/saltedhash/SaltedHashFreenetStore.java", "license": "gpl-2.0", "size": 61243 }
[ "java.util.LinkedList", "java.util.List" ]
import java.util.LinkedList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,585,369
public Object read(Readable r) { try{ return this.read(new Scanner(r)); } catch (Exception ignore){} return null; }
Object function(Readable r) { try{ return this.read(new Scanner(r)); } catch (Exception ignore){} return null; }
/** * Reads the JSON from the given readable and logs errors. * @param r JSON readable * @return a tree with information from the JSON file or null in case of errors */
Reads the JSON from the given readable and logs errors
read
{ "repo_name": "vdmeer/skb-java-commons", "path": "src/main/java/de/vandermeer/skb/commons/utils/Json2Collections.java", "license": "apache-2.0", "size": 6962 }
[ "java.util.Scanner" ]
import java.util.Scanner;
import java.util.*;
[ "java.util" ]
java.util;
1,576,197
@Test public void testMultipleBookieFailures() throws Exception { LedgerHandle lh1 = createAndAddEntriesToLedger(); // failing first bookie shutdownBookie(bs.size() - 1); // simulate re-replication doLedgerRereplication(lh1.getId()); // failing another bookie String shutdownBookie = shutdownBookie(bs.size() - 1); // grace period for publishing the bk-ledger LOG.debug("Waiting for ledgers to be marked as under replicated"); assertTrue("Ledger should be missing second replica", waitForLedgerMissingReplicas(lh1.getId(), 10, shutdownBookie)); }
void function() throws Exception { LedgerHandle lh1 = createAndAddEntriesToLedger(); shutdownBookie(bs.size() - 1); doLedgerRereplication(lh1.getId()); String shutdownBookie = shutdownBookie(bs.size() - 1); LOG.debug(STR); assertTrue(STR, waitForLedgerMissingReplicas(lh1.getId(), 10, shutdownBookie)); }
/** * Test publishing of under replicated ledgers when multiple bookie failures * one after another. */
Test publishing of under replicated ledgers when multiple bookie failures one after another
testMultipleBookieFailures
{ "repo_name": "ivankelly/bookkeeper", "path": "bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/AuditorLedgerCheckerTest.java", "license": "apache-2.0", "size": 43928 }
[ "org.apache.bookkeeper.client.LedgerHandle", "org.junit.Assert" ]
import org.apache.bookkeeper.client.LedgerHandle; import org.junit.Assert;
import org.apache.bookkeeper.client.*; import org.junit.*;
[ "org.apache.bookkeeper", "org.junit" ]
org.apache.bookkeeper; org.junit;
956,627
@Test public void lowerEqualsTest(){ boundObj = BoundsObject.newLowerBound(xpy, num10pt5, true); boundObj2 = BoundsObject.newLowerBound(xpy, num0, false); boundObj.equals(boundObj2); assertNotEquals(boundObj.lower(), boundObj2.lower()); }
void function(){ boundObj = BoundsObject.newLowerBound(xpy, num10pt5, true); boundObj2 = BoundsObject.newLowerBound(xpy, num0, false); boundObj.equals(boundObj2); assertNotEquals(boundObj.lower(), boundObj2.lower()); }
/** * Testing of BoundsObject.equals method: * Provides coverage of False branch for * "lower.equals(that.lower))" * and False branch of "strictLower == that.strictLower" */
Testing of BoundsObject.equals method: Provides coverage of False branch for "lower.equals(that.lower))" and False branch of "strictLower == that.strictLower"
lowerEqualsTest
{ "repo_name": "byu-vv-lab/sarl", "path": "test/edu/udel/cis/vsl/sarl/ideal/simplify/BoundsObjectEqualsTest.java", "license": "gpl-3.0", "size": 6833 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
885,613
@Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(Structure.class)) { case StructureRepositoryPackage.STRUCTURE__MODULES: case StructureRepositoryPackage.STRUCTURE__COMPONENTS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(Structure.class)) { case StructureRepositoryPackage.STRUCTURE__MODULES: case StructureRepositoryPackage.STRUCTURE__COMPONENTS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
/** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>.
notifyChanged
{ "repo_name": "KAMP-Research/KAMP4APS", "path": "edu.kit.ipd.sdq.kamp4aps.aps.edit/src/edu/kit/ipd/sdq/kamp4aps/model/aPS/StructureRepository/provider/StructureItemProvider.java", "license": "apache-2.0", "size": 18606 }
[ "edu.kit.ipd.sdq.kamp4aps.model.aPS.StructureRepository", "org.eclipse.emf.common.notify.Notification", "org.eclipse.emf.edit.provider.ViewerNotification" ]
import edu.kit.ipd.sdq.kamp4aps.model.aPS.StructureRepository; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification;
import edu.kit.ipd.sdq.kamp4aps.model.*; import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*;
[ "edu.kit.ipd", "org.eclipse.emf" ]
edu.kit.ipd; org.eclipse.emf;
2,901,119
public Map<String, AutoscalersScopedList> getItemsMap() { return items; }
Map<String, AutoscalersScopedList> function() { return items; }
/** * A list of AutoscalersScopedList resources. The key for the map is: [Output Only] Name of the * scope containing this set of autoscalers. */
A list of AutoscalersScopedList resources. The key for the map is: [Output Only] Name of the scope containing this set of autoscalers
getItemsMap
{ "repo_name": "vam-google/google-cloud-java", "path": "google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/AutoscalerAggregatedList.java", "license": "apache-2.0", "size": 10179 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
893,463
public String deleteWorkFlowMatrix() { LOGGER.info("deleteWorkFlowMatrix Method is called"); final HashMap workflowsearchparams = getSearchParams(); deleteWorkFlowMatrixObject(workflowsearchparams); final HashMap workflowheaderparams = getHeaderParams(); getWorkFlowMatrixObject(workflowheaderparams); setMode(RESULTS); addActionMessage("The Matrix was successfully deleted"); LOGGER.info("deleteWorkFlowMatrix Method is ended"); return "search"; }
String function() { LOGGER.info(STR); final HashMap workflowsearchparams = getSearchParams(); deleteWorkFlowMatrixObject(workflowsearchparams); final HashMap workflowheaderparams = getHeaderParams(); getWorkFlowMatrixObject(workflowheaderparams); setMode(RESULTS); addActionMessage(STR); LOGGER.info(STR); return STR; }
/** * This method is called to delete the workflow matrix the selected objecttype,department,date,from and to amount * @return */
This method is called to delete the workflow matrix the selected objecttype,department,date,from and to amount
deleteWorkFlowMatrix
{ "repo_name": "egovernments/egov-playground", "path": "eGov/egov/egov-egi/src/main/java/org/egov/infra/web/struts/actions/workflow/WorkFlowMatrixAction.java", "license": "gpl-3.0", "size": 27894 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
55,613
private void applyScale(Vector3f[] points, Vector3f centerPoint, float scale) { Vector3f taperScaleVector = new Vector3f(); for (Vector3f p : points) { taperScaleVector.set(centerPoint).subtractLocal(p).multLocal(1 - scale); p.addLocal(taperScaleVector); } } public static class BezierLine { private Vector3f[] vertices; private int materialNumber; private boolean smooth; private float length; private boolean cyclic; public BezierLine(Vector3f[] vertices, int materialNumber, boolean smooth, boolean cyclik) { this.vertices = vertices; this.materialNumber = materialNumber; this.smooth = smooth; cyclic = cyclik; this.recomputeLength(); }
void function(Vector3f[] points, Vector3f centerPoint, float scale) { Vector3f taperScaleVector = new Vector3f(); for (Vector3f p : points) { taperScaleVector.set(centerPoint).subtractLocal(p).multLocal(1 - scale); p.addLocal(taperScaleVector); } } public static class BezierLine { private Vector3f[] vertices; private int materialNumber; private boolean smooth; private float length; private boolean cyclic; public BezierLine(Vector3f[] vertices, int materialNumber, boolean smooth, boolean cyclik) { this.vertices = vertices; this.materialNumber = materialNumber; this.smooth = smooth; cyclic = cyclik; this.recomputeLength(); }
/** * the method applies scale for the given bevel points. The points table is * being modified so expect ypur result there. * * @param points * the bevel points * @param centerPoint * the center point of the bevel * @param scale * the scale to be applied */
the method applies scale for the given bevel points. The points table is being modified so expect ypur result there
applyScale
{ "repo_name": "GreenCubes/jmonkeyengine", "path": "jme3-blender/src/main/java/com/jme3/scene/plugins/blender/curves/CurvesTemporalMesh.java", "license": "bsd-3-clause", "size": 45739 }
[ "com.jme3.math.Vector3f" ]
import com.jme3.math.Vector3f;
import com.jme3.math.*;
[ "com.jme3.math" ]
com.jme3.math;
1,060,152
public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { return true; } return super.onKeyDown(keyCode, event); }
boolean function(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { return true; } return super.onKeyDown(keyCode, event); }
/** * Deactivates close by back button */
Deactivates close by back button
onKeyDown
{ "repo_name": "syrel/hut.by-Organizer", "path": "app/OrganizerHut/app/src/main/java/by/hut/flat/calendar/dialog/Dialog.java", "license": "mit", "size": 11358 }
[ "android.view.KeyEvent" ]
import android.view.KeyEvent;
import android.view.*;
[ "android.view" ]
android.view;
665,411
private void create(final Composite parent) { this.table = SWTUtil.createPageableTableViewer(parent, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.FULL_SELECTION, true, true); this.table.setLayoutData(SWTUtil.createFillGridData()); this.table.getViewer().setContentProvider(new ArrayContentProvider()); this.table.setPageLoader(new AttributesPageLoader()); // Table Table tTable = this.table.getViewer().getTable(); tTable.setHeaderVisible(true); tTable.setLinesVisible(true); GridData gd = SWTUtil.createFillGridData(); gd.heightHint = 100; tTable.setLayoutData(gd); SWTUtil.createGenericTooltip(tTable);
void function(final Composite parent) { this.table = SWTUtil.createPageableTableViewer(parent, SWT.BORDER SWT.SINGLE SWT.V_SCROLL SWT.FULL_SELECTION, true, true); this.table.setLayoutData(SWTUtil.createFillGridData()); this.table.getViewer().setContentProvider(new ArrayContentProvider()); this.table.setPageLoader(new AttributesPageLoader()); Table tTable = this.table.getViewer().getTable(); tTable.setHeaderVisible(true); tTable.setLinesVisible(true); GridData gd = SWTUtil.createFillGridData(); gd.heightHint = 100; tTable.setLayoutData(gd); SWTUtil.createGenericTooltip(tTable);
/** * Creates the required controls. * * @param parent */
Creates the required controls
create
{ "repo_name": "arx-deidentifier/arx", "path": "src/gui/org/deidentifier/arx/gui/view/impl/define/ViewAttributeList.java", "license": "apache-2.0", "size": 23487 }
[ "org.deidentifier.arx.gui.view.SWTUtil", "org.eclipse.jface.viewers.ArrayContentProvider", "org.eclipse.swt.layout.GridData", "org.eclipse.swt.widgets.Composite", "org.eclipse.swt.widgets.Table" ]
import org.deidentifier.arx.gui.view.SWTUtil; import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Table;
import org.deidentifier.arx.gui.view.*; import org.eclipse.jface.viewers.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*;
[ "org.deidentifier.arx", "org.eclipse.jface", "org.eclipse.swt" ]
org.deidentifier.arx; org.eclipse.jface; org.eclipse.swt;
246,168
@Test public void testSetName_1() throws Exception { HDScript fixture = new HDScript(); fixture.setName(""); fixture.setParent(new HDScriptGroup()); fixture.setLoop(1); String name = ""; fixture.setName(name); }
void function() throws Exception { HDScript fixture = new HDScript(); fixture.setName(STR"; fixture.setName(name); }
/** * Run the void setName(String) method test. * * @throws Exception * * @generatedBy CodePro at 9/10/14 9:36 AM */
Run the void setName(String) method test
testSetName_1
{ "repo_name": "intuit/Tank", "path": "harness_data/src/test/java/com/intuit/tank/harness/data/HDScriptTest.java", "license": "epl-1.0", "size": 4666 }
[ "com.intuit.tank.harness.data.HDScript" ]
import com.intuit.tank.harness.data.HDScript;
import com.intuit.tank.harness.data.*;
[ "com.intuit.tank" ]
com.intuit.tank;
2,911,756
Iterator<V> iterator();
Iterator<V> iterator();
/** * Returns an iterator over the key range, starting with the value * following the current position or at the first value if the cursor is * uninitialized. * * <p>{@link LockMode#DEFAULT} is used implicitly.</p> * * @return the iterator. */
Returns an iterator over the key range, starting with the value following the current position or at the first value if the cursor is uninitialized. <code>LockMode#DEFAULT</code> is used implicitly
iterator
{ "repo_name": "bjorndm/prebake", "path": "code/third_party/bdb/src/com/sleepycat/persist/ForwardCursor.java", "license": "apache-2.0", "size": 3915 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
1,434,928
public Map<String, CorsConfiguration> getCorsConfigurations() { return Collections.unmodifiableMap(this.corsConfigurations); }
Map<String, CorsConfiguration> function() { return Collections.unmodifiableMap(this.corsConfigurations); }
/** * Get the CORS configuration. */
Get the CORS configuration
getCorsConfigurations
{ "repo_name": "shivpun/spring-framework", "path": "spring-web/src/main/java/org/springframework/web/cors/UrlBasedCorsConfigurationSource.java", "license": "apache-2.0", "size": 4621 }
[ "java.util.Collections", "java.util.Map" ]
import java.util.Collections; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,135,119
public static void addUserAction(Class<? extends UserAction<?>> userActionClass) { component.core().addUserAction(userActionClass); }
static void function(Class<? extends UserAction<?>> userActionClass) { component.core().addUserAction(userActionClass); }
/** * Add the action specified by the given action name to action registry. This enables calling * <code>Core.execute(actionName)</code> for this action. * @param actionName the fully qualified class name of the action (e.g. com.mendix.action.MyAction). */
Add the action specified by the given action name to action registry. This enables calling <code>Core.execute(actionName)</code> for this action
addUserAction
{ "repo_name": "mrgroen/qzIndustryPrinting", "path": "test/javasource/com/mendix/core/Core.java", "license": "apache-2.0", "size": 71337 }
[ "com.mendix.systemwideinterfaces.core.UserAction" ]
import com.mendix.systemwideinterfaces.core.UserAction;
import com.mendix.systemwideinterfaces.core.*;
[ "com.mendix.systemwideinterfaces" ]
com.mendix.systemwideinterfaces;
1,871,686
@ServiceMethod(returns = ReturnType.SINGLE) public void remove(UUID scopeTenantId, ScopeType scopeType) { final String scope = null; removeAsync(scopeTenantId, scopeType, scope).block(); }
@ServiceMethod(returns = ReturnType.SINGLE) void function(UUID scopeTenantId, ScopeType scopeType) { final String scope = null; removeAsync(scopeTenantId, scopeType, scope).block(); }
/** * Removes the default account from the scope. * * @param scopeTenantId The tenant ID. * @param scopeType The scope for the default account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */
Removes the default account from the scope
remove
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/purview/azure-resourcemanager-purview/src/main/java/com/azure/resourcemanager/purview/implementation/DefaultAccountsClientImpl.java", "license": "mit", "size": 25154 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.purview.models.ScopeType" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.purview.models.ScopeType;
import com.azure.core.annotation.*; import com.azure.resourcemanager.purview.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,235,391
void gtk_app_chooser_widget_set_default_text(GtkAppChooserWidget self, String text);
void gtk_app_chooser_widget_set_default_text(GtkAppChooserWidget self, String text);
/** * Sets the text that is shown if there are not applications that can handle the content type. * * @param self a GtkAppChooserWidget * @param text the new value for “default-text” */
Sets the text that is shown if there are not applications that can handle the content type
gtk_app_chooser_widget_set_default_text
{ "repo_name": "Ccook/gtk-java-bindings", "path": "src/main/java/com/github/ccook/gtk/library/object/widget/container/box/GtkAppChooserWidgetLibrary.java", "license": "apache-2.0", "size": 4339 }
[ "com.github.ccook.gtk.model.object.widget.container.box.GtkAppChooserWidget" ]
import com.github.ccook.gtk.model.object.widget.container.box.GtkAppChooserWidget;
import com.github.ccook.gtk.model.object.widget.container.box.*;
[ "com.github.ccook" ]
com.github.ccook;
14,597
public void onWindowFocusChanged(Activity activity, boolean hasFocus); } private ObserverList<WindowFocusChangedListener> sWindowFocusListeners = new ObserverList<WindowFocusChangedListener>();
void function(Activity activity, boolean hasFocus); } private ObserverList<WindowFocusChangedListener> sWindowFocusListeners = new ObserverList<WindowFocusChangedListener>();
/** * Called when the window focus changes for {@code activity}. * @param activity The {@link Activity} that has a window focus changed event. * @param hasFocus Whether or not {@code activity} gained or lost focus. */
Called when the window focus changes for activity
onWindowFocusChanged
{ "repo_name": "anirudhSK/chromium", "path": "base/android/java/src/org/chromium/base/BaseChromiumApplication.java", "license": "bsd-3-clause", "size": 3865 }
[ "android.app.Activity" ]
import android.app.Activity;
import android.app.*;
[ "android.app" ]
android.app;
1,800,110
@Override public Bitmap screenshotApplications(IBinder appToken, int displayId, int width, int height) { if (!checkCallingPermission(android.Manifest.permission.READ_FRAME_BUFFER, "screenshotApplications()")) { throw new SecurityException("Requires READ_FRAME_BUFFER permission"); } Bitmap rawss; int maxLayer = 0; final Rect frame = new Rect(); float scale; int dw, dh; int rot; synchronized(mWindowMap) { long ident = Binder.clearCallingIdentity(); final DisplayContent displayContent = getDisplayContentLocked(displayId); if (displayContent == null) { return null; } final DisplayInfo displayInfo = displayContent.getDisplayInfo(); dw = displayInfo.logicalWidth; dh = displayInfo.logicalHeight; int aboveAppLayer = mPolicy.windowTypeToLayerLw(TYPE_APPLICATION) * TYPE_LAYER_MULTIPLIER + TYPE_LAYER_OFFSET; aboveAppLayer += TYPE_LAYER_MULTIPLIER; boolean isImeTarget = mInputMethodTarget != null && mInputMethodTarget.mAppToken != null && mInputMethodTarget.mAppToken.appToken != null && mInputMethodTarget.mAppToken.appToken.asBinder() == appToken; // Figure out the part of the screen that is actually the app. boolean including = false; final WindowList windows = displayContent.getWindowList(); for (int i = windows.size() - 1; i >= 0; i--) { WindowState ws = windows.get(i); if (!ws.mHasSurface) { continue; } if (ws.mLayer >= aboveAppLayer) { continue; } // When we will skip windows: when we are not including // ones behind a window we didn't skip, and we are actually // taking a screenshot of a specific app. if (!including && appToken != null) { // Also, we can possibly skip this window if it is not // an IME target or the application for the screenshot // is not the current IME target. if (!ws.mIsImWindow || !isImeTarget) { // And finally, this window is of no interest if it // is not associated with the screenshot app. if (ws.mAppToken == null || ws.mAppToken.token != appToken) { continue; } } } // We keep on including windows until we go past a full-screen // window. including = !ws.mIsImWindow && !ws.isFullscreen(dw, dh); if (maxLayer < ws.mWinAnimator.mSurfaceLayer) { maxLayer = ws.mWinAnimator.mSurfaceLayer; } // Don't include wallpaper in bounds calculation if (!ws.mIsWallpaper) { final Rect wf = ws.mFrame; final Rect cr = ws.mContentInsets; int left = wf.left + cr.left; int top = wf.top + cr.top; int right = wf.right - cr.right; int bottom = wf.bottom - cr.bottom; frame.union(left, top, right, bottom); } } Binder.restoreCallingIdentity(ident); // Constrain frame to the screen size. frame.intersect(0, 0, dw, dh); if (frame.isEmpty() || maxLayer == 0) { return null; } // The screenshot API does not apply the current screen rotation. rot = getDefaultDisplayContentLocked().getDisplay().getRotation(); int fw = frame.width(); int fh = frame.height(); // Constrain thumbnail to smaller of screen width or height. Assumes aspect // of thumbnail is the same as the screen (in landscape) or square. float targetWidthScale = width / (float) fw; float targetHeightScale = height / (float) fh; if (dw <= dh) { scale = targetWidthScale; // If aspect of thumbnail is the same as the screen (in landscape), // select the slightly larger value so we fill the entire bitmap if (targetHeightScale > scale && (int) (targetHeightScale * fw) == width) { scale = targetHeightScale; } } else { scale = targetHeightScale; // If aspect of thumbnail is the same as the screen (in landscape), // select the slightly larger value so we fill the entire bitmap if (targetWidthScale > scale && (int) (targetWidthScale * fh) == height) { scale = targetWidthScale; } } // The screen shot will contain the entire screen. dw = (int)(dw*scale); dh = (int)(dh*scale); if (rot == Surface.ROTATION_90 || rot == Surface.ROTATION_270) { int tmp = dw; dw = dh; dh = tmp; rot = (rot == Surface.ROTATION_90) ? Surface.ROTATION_270 : Surface.ROTATION_90; } if (DEBUG_SCREENSHOT) { Slog.i(TAG, "Screenshot: " + dw + "x" + dh + " from 0 to " + maxLayer); for (int i = 0; i < windows.size(); i++) { WindowState win = windows.get(i); Slog.i(TAG, win + ": " + win.mLayer + " animLayer=" + win.mWinAnimator.mAnimLayer + " surfaceLayer=" + win.mWinAnimator.mSurfaceLayer); } } rawss = Surface.screenshot(dw, dh, 0, maxLayer); } if (rawss == null) { Slog.w(TAG, "Failure taking screenshot for (" + dw + "x" + dh + ") to layer " + maxLayer); return null; } Bitmap bm = Bitmap.createBitmap(width, height, rawss.getConfig()); Matrix matrix = new Matrix(); ScreenRotationAnimation.createRotationMatrix(rot, dw, dh, matrix); matrix.postTranslate(-FloatMath.ceil(frame.left*scale), -FloatMath.ceil(frame.top*scale)); Canvas canvas = new Canvas(bm); canvas.drawBitmap(rawss, matrix, null); canvas.setBitmap(null); rawss.recycle(); return bm; }
Bitmap function(IBinder appToken, int displayId, int width, int height) { if (!checkCallingPermission(android.Manifest.permission.READ_FRAME_BUFFER, STR)) { throw new SecurityException(STR); } Bitmap rawss; int maxLayer = 0; final Rect frame = new Rect(); float scale; int dw, dh; int rot; synchronized(mWindowMap) { long ident = Binder.clearCallingIdentity(); final DisplayContent displayContent = getDisplayContentLocked(displayId); if (displayContent == null) { return null; } final DisplayInfo displayInfo = displayContent.getDisplayInfo(); dw = displayInfo.logicalWidth; dh = displayInfo.logicalHeight; int aboveAppLayer = mPolicy.windowTypeToLayerLw(TYPE_APPLICATION) * TYPE_LAYER_MULTIPLIER + TYPE_LAYER_OFFSET; aboveAppLayer += TYPE_LAYER_MULTIPLIER; boolean isImeTarget = mInputMethodTarget != null && mInputMethodTarget.mAppToken != null && mInputMethodTarget.mAppToken.appToken != null && mInputMethodTarget.mAppToken.appToken.asBinder() == appToken; boolean including = false; final WindowList windows = displayContent.getWindowList(); for (int i = windows.size() - 1; i >= 0; i--) { WindowState ws = windows.get(i); if (!ws.mHasSurface) { continue; } if (ws.mLayer >= aboveAppLayer) { continue; } if (!including && appToken != null) { if (!ws.mIsImWindow !isImeTarget) { if (ws.mAppToken == null ws.mAppToken.token != appToken) { continue; } } } including = !ws.mIsImWindow && !ws.isFullscreen(dw, dh); if (maxLayer < ws.mWinAnimator.mSurfaceLayer) { maxLayer = ws.mWinAnimator.mSurfaceLayer; } if (!ws.mIsWallpaper) { final Rect wf = ws.mFrame; final Rect cr = ws.mContentInsets; int left = wf.left + cr.left; int top = wf.top + cr.top; int right = wf.right - cr.right; int bottom = wf.bottom - cr.bottom; frame.union(left, top, right, bottom); } } Binder.restoreCallingIdentity(ident); frame.intersect(0, 0, dw, dh); if (frame.isEmpty() maxLayer == 0) { return null; } rot = getDefaultDisplayContentLocked().getDisplay().getRotation(); int fw = frame.width(); int fh = frame.height(); float targetWidthScale = width / (float) fw; float targetHeightScale = height / (float) fh; if (dw <= dh) { scale = targetWidthScale; if (targetHeightScale > scale && (int) (targetHeightScale * fw) == width) { scale = targetHeightScale; } } else { scale = targetHeightScale; if (targetWidthScale > scale && (int) (targetWidthScale * fh) == height) { scale = targetWidthScale; } } dw = (int)(dw*scale); dh = (int)(dh*scale); if (rot == Surface.ROTATION_90 rot == Surface.ROTATION_270) { int tmp = dw; dw = dh; dh = tmp; rot = (rot == Surface.ROTATION_90) ? Surface.ROTATION_270 : Surface.ROTATION_90; } if (DEBUG_SCREENSHOT) { Slog.i(TAG, STR + dw + "x" + dh + STR + maxLayer); for (int i = 0; i < windows.size(); i++) { WindowState win = windows.get(i); Slog.i(TAG, win + STR + win.mLayer + STR + win.mWinAnimator.mAnimLayer + STR + win.mWinAnimator.mSurfaceLayer); } } rawss = Surface.screenshot(dw, dh, 0, maxLayer); } if (rawss == null) { Slog.w(TAG, STR + dw + "x" + dh + STR + maxLayer); return null; } Bitmap bm = Bitmap.createBitmap(width, height, rawss.getConfig()); Matrix matrix = new Matrix(); ScreenRotationAnimation.createRotationMatrix(rot, dw, dh, matrix); matrix.postTranslate(-FloatMath.ceil(frame.left*scale), -FloatMath.ceil(frame.top*scale)); Canvas canvas = new Canvas(bm); canvas.drawBitmap(rawss, matrix, null); canvas.setBitmap(null); rawss.recycle(); return bm; }
/** * Takes a snapshot of the screen. In landscape mode this grabs the whole screen. * In portrait mode, it grabs the upper region of the screen based on the vertical dimension * of the target image. * * @param displayId the Display to take a screenshot of. * @param width the width of the target bitmap * @param height the height of the target bitmap */
Takes a snapshot of the screen. In landscape mode this grabs the whole screen. In portrait mode, it grabs the upper region of the screen based on the vertical dimension of the target image
screenshotApplications
{ "repo_name": "haikuowuya/android_system_code", "path": "src/com/android/server/wm/WindowManagerService.java", "license": "apache-2.0", "size": 483318 }
[ "android.graphics.Bitmap", "android.graphics.Canvas", "android.graphics.Matrix", "android.graphics.Rect", "android.os.Binder", "android.os.IBinder", "android.util.FloatMath", "android.util.Slog", "android.view.DisplayInfo", "android.view.Surface" ]
import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Rect; import android.os.Binder; import android.os.IBinder; import android.util.FloatMath; import android.util.Slog; import android.view.DisplayInfo; import android.view.Surface;
import android.graphics.*; import android.os.*; import android.util.*; import android.view.*;
[ "android.graphics", "android.os", "android.util", "android.view" ]
android.graphics; android.os; android.util; android.view;
1,595,558
public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { switch (lu.getLexicalUnitType()) { case LexicalUnit.SAC_INHERIT: return SVGValueConstants.INHERIT_VALUE; case LexicalUnit.SAC_INTEGER: return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getIntegerValue()); case LexicalUnit.SAC_REAL: return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getFloatValue()); } throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType()); }
Value function(LexicalUnit lu, CSSEngine engine) throws DOMException { switch (lu.getLexicalUnitType()) { case LexicalUnit.SAC_INHERIT: return SVGValueConstants.INHERIT_VALUE; case LexicalUnit.SAC_INTEGER: return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getIntegerValue()); case LexicalUnit.SAC_REAL: return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getFloatValue()); } throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType()); }
/** * Implements {@link ValueManager#createValue(LexicalUnit,CSSEngine)}. */
Implements <code>ValueManager#createValue(LexicalUnit,CSSEngine)</code>
createValue
{ "repo_name": "Uni-Sol/batik", "path": "sources/org/apache/batik/css/engine/value/svg/OpacityManager.java", "license": "apache-2.0", "size": 3622 }
[ "org.apache.batik.css.engine.CSSEngine", "org.apache.batik.css.engine.value.FloatValue", "org.apache.batik.css.engine.value.Value", "org.w3c.css.sac.LexicalUnit", "org.w3c.dom.DOMException", "org.w3c.dom.css.CSSPrimitiveValue" ]
import org.apache.batik.css.engine.CSSEngine; import org.apache.batik.css.engine.value.FloatValue; import org.apache.batik.css.engine.value.Value; import org.w3c.css.sac.LexicalUnit; import org.w3c.dom.DOMException; import org.w3c.dom.css.CSSPrimitiveValue;
import org.apache.batik.css.engine.*; import org.apache.batik.css.engine.value.*; import org.w3c.css.sac.*; import org.w3c.dom.*; import org.w3c.dom.css.*;
[ "org.apache.batik", "org.w3c.css", "org.w3c.dom" ]
org.apache.batik; org.w3c.css; org.w3c.dom;
755,994
public okhttp3.Call readIngressClassAsync( String name, String pretty, final ApiCallback<V1IngressClass> _callback) throws ApiException { okhttp3.Call localVarCall = readIngressClassValidateBeforeCall(name, pretty, _callback); Type localVarReturnType = new TypeToken<V1IngressClass>() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; }
okhttp3.Call function( String name, String pretty, final ApiCallback<V1IngressClass> _callback) throws ApiException { okhttp3.Call localVarCall = readIngressClassValidateBeforeCall(name, pretty, _callback); Type localVarReturnType = new TypeToken<V1IngressClass>() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; }
/** * (asynchronously) read the specified IngressClass * * @param name name of the IngressClass (required) * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details * <table summary="Response Details" border="1"> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> * <tr><td> 200 </td><td> OK </td><td> - </td></tr> * <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr> * </table> */
(asynchronously) read the specified IngressClass
readIngressClassAsync
{ "repo_name": "kubernetes-client/java", "path": "kubernetes/src/main/java/io/kubernetes/client/openapi/apis/NetworkingV1Api.java", "license": "apache-2.0", "size": 477939 }
[ "com.google.gson.reflect.TypeToken", "io.kubernetes.client.openapi.ApiCallback", "io.kubernetes.client.openapi.ApiException", "io.kubernetes.client.openapi.models.V1IngressClass", "java.lang.reflect.Type" ]
import com.google.gson.reflect.TypeToken; import io.kubernetes.client.openapi.ApiCallback; import io.kubernetes.client.openapi.ApiException; import io.kubernetes.client.openapi.models.V1IngressClass; import java.lang.reflect.Type;
import com.google.gson.reflect.*; import io.kubernetes.client.openapi.*; import io.kubernetes.client.openapi.models.*; import java.lang.reflect.*;
[ "com.google.gson", "io.kubernetes.client", "java.lang" ]
com.google.gson; io.kubernetes.client; java.lang;
852,474
@Path("{id}/role-mappings/realm") @DELETE @Consumes(MediaType.APPLICATION_JSON) public void deleteRealmRoleMappings(@PathParam("id") String id, List<RoleRepresentation> roles) { auth.requireManage(); logger.debug("deleteRealmRoleMappings"); UserModel user = session.users().getUserById(id, realm); if (user == null) { throw new NotFoundException("User not found"); } if (roles == null) { Set<RoleModel> roleModels = user.getRealmRoleMappings(); for (RoleModel roleModel : roleModels) { user.deleteRoleMapping(roleModel); } adminEvent.operation(OperationType.CREATE).resourcePath(uriInfo).representation(roles).success(); } else { for (RoleRepresentation role : roles) { RoleModel roleModel = realm.getRole(role.getName()); if (roleModel == null || !roleModel.getId().equals(role.getId())) { throw new NotFoundException("Role not found"); } user.deleteRoleMapping(roleModel); adminEvent.operation(OperationType.DELETE).resourcePath(uriInfo, role.getId()).representation(roles).success(); } } }
@Path(STR) @Consumes(MediaType.APPLICATION_JSON) void function(@PathParam("id") String id, List<RoleRepresentation> roles) { auth.requireManage(); logger.debug(STR); UserModel user = session.users().getUserById(id, realm); if (user == null) { throw new NotFoundException(STR); } if (roles == null) { Set<RoleModel> roleModels = user.getRealmRoleMappings(); for (RoleModel roleModel : roleModels) { user.deleteRoleMapping(roleModel); } adminEvent.operation(OperationType.CREATE).resourcePath(uriInfo).representation(roles).success(); } else { for (RoleRepresentation role : roles) { RoleModel roleModel = realm.getRole(role.getName()); if (roleModel == null !roleModel.getId().equals(role.getId())) { throw new NotFoundException(STR); } user.deleteRoleMapping(roleModel); adminEvent.operation(OperationType.DELETE).resourcePath(uriInfo, role.getId()).representation(roles).success(); } } }
/** * Delete realm-level role mappings * * @param id user id * @param roles */
Delete realm-level role mappings
deleteRealmRoleMappings
{ "repo_name": "cmoulliard/keycloak", "path": "services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java", "license": "apache-2.0", "size": 38079 }
[ "java.util.List", "java.util.Set", "javax.ws.rs.Consumes", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.core.MediaType", "org.jboss.resteasy.spi.NotFoundException", "org.keycloak.events.admin.OperationType", "org.keycloak.models.RoleModel", "org.keycloak.models.UserModel", "org.keycloak.representations.idm.RoleRepresentation" ]
import java.util.List; import java.util.Set; import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.MediaType; import org.jboss.resteasy.spi.NotFoundException; import org.keycloak.events.admin.OperationType; import org.keycloak.models.RoleModel; import org.keycloak.models.UserModel; import org.keycloak.representations.idm.RoleRepresentation;
import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.jboss.resteasy.spi.*; import org.keycloak.events.admin.*; import org.keycloak.models.*; import org.keycloak.representations.idm.*;
[ "java.util", "javax.ws", "org.jboss.resteasy", "org.keycloak.events", "org.keycloak.models", "org.keycloak.representations" ]
java.util; javax.ws; org.jboss.resteasy; org.keycloak.events; org.keycloak.models; org.keycloak.representations;
2,307,708
public Animation lastAnimation(Fighter fighter) { switch (fighter.getLastAction()) { // case "idle": // animationToReturn = idleAnimation; // break; // will eventually uncomment that code when are gotten default: // so, everything defaults to the idle animation animationToReturn = idleAnimation; break; } return animationToReturn; }
Animation function(Fighter fighter) { switch (fighter.getLastAction()) { default: animationToReturn = idleAnimation; break; } return animationToReturn; }
/** * Method to get what animation should be reset * * @param fighter Fighter to get the last animation of * @return Animation the fighter last performed ************************************************/
Method to get what animation should be reset
lastAnimation
{ "repo_name": "JesseDeppisch/fighting-game", "path": "src/game/ActualPlay.java", "license": "mit", "size": 19723 }
[ "org.newdawn.slick.Animation" ]
import org.newdawn.slick.Animation;
import org.newdawn.slick.*;
[ "org.newdawn.slick" ]
org.newdawn.slick;
326,158
HttpHeaders responseTrailers();
HttpHeaders responseTrailers();
/** * Returns the HTTP trailers of the {@link Response}. * * @throws RequestLogAvailabilityException if the property is not available yet. * @see RequestLogProperty#RESPONSE_TRAILERS */
Returns the HTTP trailers of the <code>Response</code>
responseTrailers
{ "repo_name": "minwoox/armeria", "path": "core/src/main/java/com/linecorp/armeria/common/logging/RequestLog.java", "license": "apache-2.0", "size": 10100 }
[ "com.linecorp.armeria.common.HttpHeaders" ]
import com.linecorp.armeria.common.HttpHeaders;
import com.linecorp.armeria.common.*;
[ "com.linecorp.armeria" ]
com.linecorp.armeria;
2,215,458
public InputStream post(Map cookies, Map parameters) throws IOException { setCookies(cookies); setParameters(parameters); return post(); }
InputStream function(Map cookies, Map parameters) throws IOException { setCookies(cookies); setParameters(parameters); return post(); }
/** * posts the requests to the server, with all the cookies and parameters that were added before (if any), and with cookies and parameters that are passed in the arguments * @param cookies request cookies * @param parameters request parameters * @return input stream with the server response * @throws IOException * @see setParameters * @see setCookies */
posts the requests to the server, with all the cookies and parameters that were added before (if any), and with cookies and parameters that are passed in the arguments
post
{ "repo_name": "URMC/i2b2_redi", "path": "java/src/main/java/edu/rochester/urmc/util/ClientHTTPRequest.java", "license": "mit", "size": 18238 }
[ "java.io.IOException", "java.io.InputStream", "java.util.Map" ]
import java.io.IOException; import java.io.InputStream; import java.util.Map;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,062,802
public Query setAttributesToRetrieve(List<String> attributes) { this.attributes = attributes; return this; }
Query function(List<String> attributes) { this.attributes = attributes; return this; }
/** * Specify the list of attribute names to retrieve. By default all * attributes are retrieved. */
Specify the list of attribute names to retrieve. By default all attributes are retrieved
setAttributesToRetrieve
{ "repo_name": "algoliareadmebot/algoliasearch-client-java", "path": "src/main/java/com/algolia/search/saas/Query.java", "license": "mit", "size": 42269 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
390,158
public void downloadFile(URI destURI, GSSCredential gsCredential, File localFile) throws Exception { GridFTPClient ftpClient = null; GridFTPContactInfo contactInfo = new GridFTPContactInfo(destURI.getHost(), destURI.getPort()); try { String remoteFile = destURI.getPath(); log.info("The local temp file is " + localFile); log.info("the remote file is " + remoteFile); log.info("Setup GridFTP Client"); ftpClient = new GridFTPClient(contactInfo.hostName, contactInfo.port); ftpClient.setAuthorization(new HostAuthorization("host")); ftpClient.authenticate(gsCredential); ftpClient.setDataChannelAuthentication(DataChannelAuthentication.SELF); log.info("Downloading file"); ftpClient.get(remoteFile, localFile); log.info("Download file to:" + remoteFile + " is done"); } catch (ServerException e) { throw new Exception("Cannot download file from GridFTP:" + contactInfo.toString(), e); } catch (IOException e) { throw new Exception("Cannot download file from GridFTP:" + contactInfo.toString(), e); } catch (ClientException e) { throw new Exception("Cannot download file from GridFTP:" + contactInfo.toString(), e); } finally { if (ftpClient != null) { try { ftpClient.close(); } catch (Exception e) { log.info("Cannot close GridFTP client connection"); } } } }
void function(URI destURI, GSSCredential gsCredential, File localFile) throws Exception { GridFTPClient ftpClient = null; GridFTPContactInfo contactInfo = new GridFTPContactInfo(destURI.getHost(), destURI.getPort()); try { String remoteFile = destURI.getPath(); log.info(STR + localFile); log.info(STR + remoteFile); log.info(STR); ftpClient = new GridFTPClient(contactInfo.hostName, contactInfo.port); ftpClient.setAuthorization(new HostAuthorization("host")); ftpClient.authenticate(gsCredential); ftpClient.setDataChannelAuthentication(DataChannelAuthentication.SELF); log.info(STR); ftpClient.get(remoteFile, localFile); log.info(STR + remoteFile + STR); } catch (ServerException e) { throw new Exception(STR + contactInfo.toString(), e); } catch (IOException e) { throw new Exception(STR + contactInfo.toString(), e); } catch (ClientException e) { throw new Exception(STR + contactInfo.toString(), e); } finally { if (ftpClient != null) { try { ftpClient.close(); } catch (Exception e) { log.info(STR); } } } }
/** * Download File from remote location * * @param destURI * @param gsCredential * @param localFile * @throws GfacException */
Download File from remote location
downloadFile
{ "repo_name": "rsandhu1/grid-services-test", "path": "src/main/java/org/ogce/grid/utils/GridFtp.java", "license": "apache-2.0", "size": 15623 }
[ "java.io.File", "java.io.IOException", "org.globus.ftp.DataChannelAuthentication", "org.globus.ftp.GridFTPClient", "org.globus.ftp.exception.ClientException", "org.globus.ftp.exception.ServerException", "org.globus.gsi.gssapi.auth.HostAuthorization", "org.ietf.jgss.GSSCredential" ]
import java.io.File; import java.io.IOException; import org.globus.ftp.DataChannelAuthentication; import org.globus.ftp.GridFTPClient; import org.globus.ftp.exception.ClientException; import org.globus.ftp.exception.ServerException; import org.globus.gsi.gssapi.auth.HostAuthorization; import org.ietf.jgss.GSSCredential;
import java.io.*; import org.globus.ftp.*; import org.globus.ftp.exception.*; import org.globus.gsi.gssapi.auth.*; import org.ietf.jgss.*;
[ "java.io", "org.globus.ftp", "org.globus.gsi", "org.ietf.jgss" ]
java.io; org.globus.ftp; org.globus.gsi; org.ietf.jgss;
1,072,598
public void setIds(Collection<Serializable> ids) { this.ids = ids; }
void function(Collection<Serializable> ids) { this.ids = ids; }
/** * JAVADOC Method Level Comments * * @param ids JAVADOC. */
JAVADOC Method Level Comments
setIds
{ "repo_name": "cucina/opencucina", "path": "engine-server-api/src/main/java/org/cucina/engine/server/event/ListTransitionsEvent.java", "license": "apache-2.0", "size": 1278 }
[ "java.io.Serializable", "java.util.Collection" ]
import java.io.Serializable; import java.util.Collection;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,720,300
public Icon getIcon() { return null; }
Icon function() { return null; }
/** * Returns the icon. Subclasses should override to return a reasonable * cell-related state. * <p> * * Here: <code>null</code>. * * @return the cell's icon. */
Returns the icon. Subclasses should override to return a reasonable cell-related state. Here: <code>null</code>
getIcon
{ "repo_name": "trejkaz/swingx", "path": "swingx-core/src/main/java/org/jdesktop/swingx/renderer/CellContext.java", "license": "lgpl-2.1", "size": 13130 }
[ "javax.swing.Icon" ]
import javax.swing.Icon;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,354,871
@see org.hl7.rim.Observation#setMethodCode */ public void setMethodCode(SET<CE> methodCode) { if(methodCode instanceof org.hl7.hibernate.ClonableCollection) methodCode = ((org.hl7.hibernate.ClonableCollection<SET<CE>>) methodCode).cloneHibernateCollectionIfNecessary(); _methodCode = methodCode; }
@see org.hl7.rim.Observation#setMethodCode */ void function(SET<CE> methodCode) { if(methodCode instanceof org.hl7.hibernate.ClonableCollection) methodCode = ((org.hl7.hibernate.ClonableCollection<SET<CE>>) methodCode).cloneHibernateCollectionIfNecessary(); _methodCode = methodCode; }
/** Sets the property methodCode. @see org.hl7.rim.Observation#setMethodCode */
Sets the property methodCode
setMethodCode
{ "repo_name": "markusgumbel/dshl7", "path": "hl7-javasig/gencode/org/hl7/rim/impl/ObservationImpl.java", "license": "apache-2.0", "size": 5117 }
[ "org.hl7.rim.Observation" ]
import org.hl7.rim.Observation;
import org.hl7.rim.*;
[ "org.hl7.rim" ]
org.hl7.rim;
2,523,631
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jpItem = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); jlItem = new javax.swing.JLabel(); jtfItemKey = new javax.swing.JTextField(); jtfItem = new javax.swing.JTextField(); jPanel5 = new javax.swing.JPanel(); jlWarehouse = new javax.swing.JLabel(); jtfCompanyBranch = new javax.swing.JTextField(); jtfCompanyBranchCode = new javax.swing.JTextField(); jtfWarehouse = new javax.swing.JTextField(); jtfWarehouseCode = new javax.swing.JTextField(); jpLots = new javax.swing.JPanel(); jpControls = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); jbOk = new javax.swing.JButton(); jbCancel = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jlStock = new javax.swing.JLabel(); jtfStock = new javax.swing.JTextField(); jtfStockUnitSymbol = new javax.swing.JTextField(); jlYear = new javax.swing.JLabel(); jtfYear = new javax.swing.JTextField();
@SuppressWarnings(STR) void function() { jpItem = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); jlItem = new javax.swing.JLabel(); jtfItemKey = new javax.swing.JTextField(); jtfItem = new javax.swing.JTextField(); jPanel5 = new javax.swing.JPanel(); jlWarehouse = new javax.swing.JLabel(); jtfCompanyBranch = new javax.swing.JTextField(); jtfCompanyBranchCode = new javax.swing.JTextField(); jtfWarehouse = new javax.swing.JTextField(); jtfWarehouseCode = new javax.swing.JTextField(); jpLots = new javax.swing.JPanel(); jpControls = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); jbOk = new javax.swing.JButton(); jbCancel = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jlStock = new javax.swing.JLabel(); jtfStock = new javax.swing.JTextField(); jtfStockUnitSymbol = new javax.swing.JTextField(); jlYear = new javax.swing.JLabel(); jtfYear = new javax.swing.JTextField();
/** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */
This method is called from within the constructor to initialize the form. always regenerated by the Form Editor
initComponents
{ "repo_name": "swaplicado/siie32", "path": "src/erp/mtrn/form/SDialogPickerStockLots.java", "license": "mit", "size": 17461 }
[ "javax.swing.JButton" ]
import javax.swing.JButton;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
493,599
@Deprecated public void testTimestampNPE() throws Exception { try { Timestamp ts = new Timestamp(System.currentTimeMillis()); this.stmt.executeUpdate("DROP TABLE IF EXISTS testTimestampNPE"); this.stmt.executeUpdate("CREATE TABLE testTimestampNPE (field1 TIMESTAMP)"); this.pstmt = this.conn.prepareStatement("INSERT INTO testTimestampNPE VALUES (?)"); this.pstmt.setTimestamp(1, ts); this.pstmt.executeUpdate(); this.pstmt = this.conn.prepareStatement("SELECT field1 FROM testTimestampNPE"); this.rs = this.pstmt.executeQuery(); this.rs.next(); System.out.println(this.rs.getString(1)); this.rs.getDate(1); Timestamp rTs = this.rs.getTimestamp(1); assertTrue("Retrieved year of " + rTs.getYear() + " does not match " + ts.getYear(), rTs.getYear() == ts.getYear()); assertTrue("Retrieved month of " + rTs.getMonth() + " does not match " + ts.getMonth(), rTs.getMonth() == ts.getMonth()); assertTrue("Retrieved date of " + rTs.getDate() + " does not match " + ts.getDate(), rTs.getDate() == ts.getDate()); this.stmt.executeUpdate("DROP TABLE IF EXISTS testTimestampNPE"); } finally { } }
void function() throws Exception { try { Timestamp ts = new Timestamp(System.currentTimeMillis()); this.stmt.executeUpdate(STR); this.stmt.executeUpdate(STR); this.pstmt = this.conn.prepareStatement(STR); this.pstmt.setTimestamp(1, ts); this.pstmt.executeUpdate(); this.pstmt = this.conn.prepareStatement(STR); this.rs = this.pstmt.executeQuery(); this.rs.next(); System.out.println(this.rs.getString(1)); this.rs.getDate(1); Timestamp rTs = this.rs.getTimestamp(1); assertTrue(STR + rTs.getYear() + STR + ts.getYear(), rTs.getYear() == ts.getYear()); assertTrue(STR + rTs.getMonth() + STR + ts.getMonth(), rTs.getMonth() == ts.getMonth()); assertTrue(STR + rTs.getDate() + STR + ts.getDate(), rTs.getDate() == ts.getDate()); this.stmt.executeUpdate(STR); } finally { } }
/** * Tests for timestamp NPEs occuring in binary-format timestamps. * * @throws Exception * * @deprecated yes, we know we are using deprecated methods here :) */
Tests for timestamp NPEs occuring in binary-format timestamps
testTimestampNPE
{ "repo_name": "slockhart/sql-app", "path": "mysql-connector-java-5.1.34/src/testsuite/regression/StatementRegressionTest.java", "license": "gpl-2.0", "size": 284151 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,185,783
//------------------------------------------------------------------------- public static boolean allSuccessful(Result<?>... results) { return Stream.of(results).allMatch(Result::isSuccess); }
static boolean function(Result<?>... results) { return Stream.of(results).allMatch(Result::isSuccess); }
/** * Checks if all the results are successful. * * @param results the results to check * @return true if all of the results are successes */
Checks if all the results are successful
allSuccessful
{ "repo_name": "OpenGamma/Strata", "path": "modules/collect/src/main/java/com/opengamma/strata/collect/result/Result.java", "license": "apache-2.0", "size": 43278 }
[ "java.util.stream.Stream" ]
import java.util.stream.Stream;
import java.util.stream.*;
[ "java.util" ]
java.util;
716,484
@Override public Piece initialPlayer(Board board, List<Piece> pieces) { return nextPlayer(board, pieces, null); }
Piece function(Board board, List<Piece> pieces) { return nextPlayer(board, pieces, null); }
/** * Returns the first player who can move. */
Returns the first player who can move
initialPlayer
{ "repo_name": "ggrupo/ataxx", "path": "src/es/ucm/fdi/tp/ataxx/AtaxxRules.java", "license": "apache-2.0", "size": 7128 }
[ "es.ucm.fdi.tp.basecode.bgame.model.Board", "es.ucm.fdi.tp.basecode.bgame.model.Piece", "java.util.List" ]
import es.ucm.fdi.tp.basecode.bgame.model.Board; import es.ucm.fdi.tp.basecode.bgame.model.Piece; import java.util.List;
import es.ucm.fdi.tp.basecode.bgame.model.*; import java.util.*;
[ "es.ucm.fdi", "java.util" ]
es.ucm.fdi; java.util;
1,175,047
private static RemoteCounter lookupRemoteStatefulCounter() throws NamingException { Context context = getContext(); return (RemoteCounter) context .lookup("ejb:/ejb_remote_server/CounterBean!" + RemoteCounter.class.getName() + "?stateful"); }
static RemoteCounter function() throws NamingException { Context context = getContext(); return (RemoteCounter) context .lookup(STR + RemoteCounter.class.getName() + STR); }
/** * Looks up and returns the proxy to remote stateful counter bean * * @return * @throws NamingException */
Looks up and returns the proxy to remote stateful counter bean
lookupRemoteStatefulCounter
{ "repo_name": "manuelgentile/MAP", "path": "ejb/ejb_client_server/ejb_remote_client/src/main/java/org/jboss/as/quickstarts/ejb/remote/client/RemoteEJBClient.java", "license": "gpl-2.0", "size": 4230 }
[ "javax.naming.Context", "javax.naming.NamingException", "org.jboss.as.quickstarts.ejb.remote.stateful.RemoteCounter" ]
import javax.naming.Context; import javax.naming.NamingException; import org.jboss.as.quickstarts.ejb.remote.stateful.RemoteCounter;
import javax.naming.*; import org.jboss.as.quickstarts.ejb.remote.stateful.*;
[ "javax.naming", "org.jboss.as" ]
javax.naming; org.jboss.as;
1,928,897
public void revoke(Long milliseconds) { this.revoked = Instant.now().plusMillis(milliseconds); }
void function(Long milliseconds) { this.revoked = Instant.now().plusMillis(milliseconds); }
/** * Flags this client to be revoked, removing it from selection until the timeout expires. * * Note: this instance can still be selected if _all_ available instances are revoked. * * @param milliseconds the revoke period in milliseconds */
Flags this client to be revoked, removing it from selection until the timeout expires. Note: this instance can still be selected if _all_ available instances are revoked
revoke
{ "repo_name": "ozwolf-software/consul-jaxrs", "path": "src/main/java/net/ozwolf/consul/client/ConsulJaxRsClient.java", "license": "apache-2.0", "size": 8516 }
[ "java.time.Instant" ]
import java.time.Instant;
import java.time.*;
[ "java.time" ]
java.time;
1,943,130
public Rect getFramingRectInPreview() { if (framingRectInPreview == null) { Rect rect = new Rect(getFramingRect()); Point cameraResolution = configManager.getCameraResolution(); Point screenResolution = configManager.getScreenResolution(); //modify here // rect.left = rect.left * cameraResolution.x / screenResolution.x; // rect.right = rect.right * cameraResolution.x / screenResolution.x; // rect.top = rect.top * cameraResolution.y / screenResolution.y; // rect.bottom = rect.bottom * cameraResolution.y / screenResolution.y; rect.left = rect.left * cameraResolution.y / screenResolution.x; rect.right = rect.right * cameraResolution.y / screenResolution.x; rect.top = rect.top * cameraResolution.x / screenResolution.y; rect.bottom = rect.bottom * cameraResolution.x / screenResolution.y; framingRectInPreview = rect; } return framingRectInPreview; } /* public Point[] convertResultPoints(ResultPoint[] points) { Rect frame = getFramingRectInPreview(); int count = points.length; Point[] output = new Point[count]; for (int x = 0; x < count; x++) { output[x] = new Point(); output[x].x = frame.left + (int) (points[x].getX() + 0.5f); output[x].y = frame.top + (int) (points[x].getY() + 0.5f); } return output; }
Rect function() { if (framingRectInPreview == null) { Rect rect = new Rect(getFramingRect()); Point cameraResolution = configManager.getCameraResolution(); Point screenResolution = configManager.getScreenResolution(); rect.left = rect.left * cameraResolution.y / screenResolution.x; rect.right = rect.right * cameraResolution.y / screenResolution.x; rect.top = rect.top * cameraResolution.x / screenResolution.y; rect.bottom = rect.bottom * cameraResolution.x / screenResolution.y; framingRectInPreview = rect; } return framingRectInPreview; } /* Point[] convertResultPoints(ResultPoint[] points) { Rect frame = function(); int count = points.length; Point[] output = new Point[count]; for (int x = 0; x < count; x++) { output[x] = new Point(); output[x].x = frame.left + (int) (points[x].getX() + 0.5f); output[x].y = frame.top + (int) (points[x].getY() + 0.5f); } return output; }
/** * Like {@link #getFramingRect} but coordinates are in terms of the preview frame, * not UI / screen. */
Like <code>#getFramingRect</code> but coordinates are in terms of the preview frame, not UI / screen
getFramingRectInPreview
{ "repo_name": "githubdelegate/remoteControl", "path": "SmartRemote/src/com/zxing/camera/CameraManager.java", "license": "gpl-2.0", "size": 11508 }
[ "android.graphics.Point", "android.graphics.Rect" ]
import android.graphics.Point; import android.graphics.Rect;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
2,692,302
public static void format(Configuration conf) throws IOException { format(conf, false); } static NameNodeMetrics myMetrics;
static void function(Configuration conf) throws IOException { format(conf, false); } static NameNodeMetrics myMetrics;
/** Format a new filesystem. Destroys any filesystem that may already * exist at this location. **/
Format a new filesystem. Destroys any filesystem that may already
format
{ "repo_name": "gabrielborgesmagalhaes/hadoop-hdfs", "path": "src/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java", "license": "apache-2.0", "size": 42484 }
[ "java.io.IOException", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.hdfs.server.namenode.metrics.NameNodeMetrics" ]
import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.server.namenode.metrics.NameNodeMetrics;
import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hdfs.server.namenode.metrics.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,279,420
static File getStorageFile(StorageDirectory sd, NameNodeFile type) { return new File(sd.getCurrentDir(), type.getName()); }
static File getStorageFile(StorageDirectory sd, NameNodeFile type) { return new File(sd.getCurrentDir(), type.getName()); }
/** * Get a storage file for one of the files that doesn't need a txid associated * (e.g version, seen_txid). */
Get a storage file for one of the files that doesn't need a txid associated (e.g version, seen_txid)
getStorageFile
{ "repo_name": "nandakumar131/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NNStorage.java", "license": "apache-2.0", "size": 39931 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
274,319
@Test public void testRevertToDefaultValue() { boolean valueOnly = true; FieldConfigTTF field = new FieldConfigTTF( new FieldConfigCommonData( String.class, FieldIdEnum.NAME, "test label", valueOnly, false), null, null, null); field.revertToDefaultValue(); field.createUI(); field.revertToDefaultValue(); }
void function() { boolean valueOnly = true; FieldConfigTTF field = new FieldConfigTTF( new FieldConfigCommonData( String.class, FieldIdEnum.NAME, STR, valueOnly, false), null, null, null); field.revertToDefaultValue(); field.createUI(); field.revertToDefaultValue(); }
/** * Test method for {@link * com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#revertToDefaultValue()}. */
Test method for <code>com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#revertToDefaultValue()</code>
testRevertToDefaultValue
{ "repo_name": "robward-scisys/sldeditor", "path": "modules/application/src/test/java/com/sldeditor/test/unit/ui/detail/config/symboltype/ttf/FieldConfigTTFTest.java", "license": "gpl-3.0", "size": 23976 }
[ "com.sldeditor.common.xml.ui.FieldIdEnum", "com.sldeditor.ui.detail.config.FieldConfigCommonData", "com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF" ]
import com.sldeditor.common.xml.ui.FieldIdEnum; import com.sldeditor.ui.detail.config.FieldConfigCommonData; import com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF;
import com.sldeditor.common.xml.ui.*; import com.sldeditor.ui.detail.config.*; import com.sldeditor.ui.detail.config.symboltype.ttf.*;
[ "com.sldeditor.common", "com.sldeditor.ui" ]
com.sldeditor.common; com.sldeditor.ui;
99,116
MD5Hash getSavedDigest() { checkSaved(); return savedDigest; }
MD5Hash getSavedDigest() { checkSaved(); return savedDigest; }
/** * Return the MD5 checksum of the image file that was saved. */
Return the MD5 checksum of the image file that was saved
getSavedDigest
{ "repo_name": "vlajos/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormat.java", "license": "apache-2.0", "size": 56850 }
[ "org.apache.hadoop.io.MD5Hash" ]
import org.apache.hadoop.io.MD5Hash;
import org.apache.hadoop.io.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,422,795
@Override public Properties trackHideTranscript(String videoId, Double currentTime ,String courseId, String unitUrl){ SegmentAnalyticsEvent aEvent = getCommonPropertiesWithCurrentTime(currentTime, videoId, Values.TRANSCRIPT_HIDDEN); aEvent.setCourseContext(courseId, unitUrl, Values.VIDEOPLAYER); tracker.track(Events.HIDE_TRANSCRIPT, aEvent.properties); return aEvent.properties; }
Properties function(String videoId, Double currentTime ,String courseId, String unitUrl){ SegmentAnalyticsEvent aEvent = getCommonPropertiesWithCurrentTime(currentTime, videoId, Values.TRANSCRIPT_HIDDEN); aEvent.setCourseContext(courseId, unitUrl, Values.VIDEOPLAYER); tracker.track(Events.HIDE_TRANSCRIPT, aEvent.properties); return aEvent.properties; }
/** * This function is used to Hide Transcript * @param videoId * @param currentTime * @param courseId * @param unitUrl * @return A {@link Properties} object populated with analytics-event info */
This function is used to Hide Transcript
trackHideTranscript
{ "repo_name": "KirillMakarov/edx-app-android", "path": "VideoLocker/src/main/java/org/edx/mobile/module/analytics/ISegmentImpl.java", "license": "apache-2.0", "size": 32837 }
[ "com.segment.analytics.Properties" ]
import com.segment.analytics.Properties;
import com.segment.analytics.*;
[ "com.segment.analytics" ]
com.segment.analytics;
471,793
private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtilities.writePaint(this.paint, stream); }
void function(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtilities.writePaint(this.paint, stream); }
/** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */
Provides serialization support
writeObject
{ "repo_name": "fluidware/Eastwood-Charts", "path": "source/org/jfree/chart/block/ColorBlock.java", "license": "lgpl-2.1", "size": 5800 }
[ "java.io.IOException", "java.io.ObjectOutputStream", "org.jfree.io.SerialUtilities" ]
import java.io.IOException; import java.io.ObjectOutputStream; import org.jfree.io.SerialUtilities;
import java.io.*; import org.jfree.io.*;
[ "java.io", "org.jfree.io" ]
java.io; org.jfree.io;
1,898,176
EOperation getWorkLocation__CheckAttributes_FWD__TripleMatch();
EOperation getWorkLocation__CheckAttributes_FWD__TripleMatch();
/** * Returns the meta object for the '{@link rgse.ttc17.emoflon.tgg.task2.Rules.WorkLocation#checkAttributes_FWD(org.moflon.tgg.runtime.TripleMatch) <em>Check Attributes FWD</em>}' operation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the '<em>Check Attributes FWD</em>' operation. * @see rgse.ttc17.emoflon.tgg.task2.Rules.WorkLocation#checkAttributes_FWD(org.moflon.tgg.runtime.TripleMatch) * @generated */
Returns the meta object for the '<code>rgse.ttc17.emoflon.tgg.task2.Rules.WorkLocation#checkAttributes_FWD(org.moflon.tgg.runtime.TripleMatch) Check Attributes FWD</code>' operation.
getWorkLocation__CheckAttributes_FWD__TripleMatch
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/eMoflon/rgse.ttc17.emoflon.tgg.task2/gen/rgse/ttc17/emoflon/tgg/task2/Rules/RulesPackage.java", "license": "mit", "size": 437406 }
[ "org.eclipse.emf.ecore.EOperation" ]
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,727,865
public static CoderProvider forCoder(TypeDescriptor<?> type, Coder<?> coder) { return new CoderProviderForCoder(type, coder); } private static class CoderProviderFromStaticMethods extends CoderProvider {
static CoderProvider function(TypeDescriptor<?> type, Coder<?> coder) { return new CoderProviderForCoder(type, coder); } private static class CoderProviderFromStaticMethods extends CoderProvider {
/** * Creates a {@link CoderProvider} that always returns the * given coder for the specified type. */
Creates a <code>CoderProvider</code> that always returns the given coder for the specified type
forCoder
{ "repo_name": "tgroh/incubator-beam", "path": "sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderProviders.java", "license": "apache-2.0", "size": 7255 }
[ "org.apache.beam.sdk.values.TypeDescriptor" ]
import org.apache.beam.sdk.values.TypeDescriptor;
import org.apache.beam.sdk.values.*;
[ "org.apache.beam" ]
org.apache.beam;
1,307,314
public void testMergedOutputSizeIsBounded() throws Exception { int steps = 100; int compactWasteThreshold = 1024; Dex dexA = resourceToDexBuffer("/testdata/Basic.dex"); Dex dexB = resourceToDexBuffer("/testdata/TryCatchFinally.dex"); Dex merged = new DexMerger(dexA, dexB, CollisionPolicy.KEEP_FIRST).merge(); int maxLength = 0; for (int i = 0; i < steps; i++) { DexMerger dexMerger = new DexMerger(dexA, merged, CollisionPolicy.KEEP_FIRST); dexMerger.setCompactWasteThreshold(compactWasteThreshold); merged = dexMerger.merge(); maxLength = Math.max(maxLength, merged.getLength()); } int maxExpectedLength = dexA.getLength() + dexB.getLength() + compactWasteThreshold; assertTrue(maxLength + " < " + maxExpectedLength, maxLength < maxExpectedLength); }
void function() throws Exception { int steps = 100; int compactWasteThreshold = 1024; Dex dexA = resourceToDexBuffer(STR); Dex dexB = resourceToDexBuffer(STR); Dex merged = new DexMerger(dexA, dexB, CollisionPolicy.KEEP_FIRST).merge(); int maxLength = 0; for (int i = 0; i < steps; i++) { DexMerger dexMerger = new DexMerger(dexA, merged, CollisionPolicy.KEEP_FIRST); dexMerger.setCompactWasteThreshold(compactWasteThreshold); merged = dexMerger.merge(); maxLength = Math.max(maxLength, merged.getLength()); } int maxExpectedLength = dexA.getLength() + dexB.getLength() + compactWasteThreshold; assertTrue(maxLength + STR + maxExpectedLength, maxLength < maxExpectedLength); }
/** * Merging dex files uses pessimistic sizes that naturally leave gaps in the * output files. If those gaps grow too large, the merger is supposed to * compact the result. This exercises that by repeatedly merging a dex with * itself. */
Merging dex files uses pessimistic sizes that naturally leave gaps in the output files. If those gaps grow too large, the merger is supposed to compact the result. This exercises that by repeatedly merging a dex with itself
testMergedOutputSizeIsBounded
{ "repo_name": "raviagarwal7/buck", "path": "third-party/java/dx/tests/115-merge/com/android/dx/merge/DexMergeTest.java", "license": "apache-2.0", "size": 8660 }
[ "com.android.dex.Dex" ]
import com.android.dex.Dex;
import com.android.dex.*;
[ "com.android.dex" ]
com.android.dex;
1,159,350
private void addToDefIfLocal( String name, @Nullable Node node, @Nullable Node rValue, MustDef def) { Var var = jsScope.getVar(name); // var might be null because the variable might be defined in the extern // that we might not traverse. if (var == null || var.scope != jsScope) { return; } for (Var other : def.reachingDef.keySet()) { Definition otherDef = def.reachingDef.get(other); if (otherDef == null) { continue; } if (otherDef.depends.contains(var)) { def.reachingDef.put(other, null); } } if (!escaped.contains(var)) { if (node == null) { def.reachingDef.put(var, null); } else { Definition definition = new Definition(node); if (rValue != null) { computeDependence(definition, rValue); } def.reachingDef.put(var, definition); } } }
void function( String name, @Nullable Node node, @Nullable Node rValue, MustDef def) { Var var = jsScope.getVar(name); if (var == null var.scope != jsScope) { return; } for (Var other : def.reachingDef.keySet()) { Definition otherDef = def.reachingDef.get(other); if (otherDef == null) { continue; } if (otherDef.depends.contains(var)) { def.reachingDef.put(other, null); } } if (!escaped.contains(var)) { if (node == null) { def.reachingDef.put(var, null); } else { Definition definition = new Definition(node); if (rValue != null) { computeDependence(definition, rValue); } def.reachingDef.put(var, definition); } } }
/** * Set the variable lattice for the given name to the node value in the def * lattice. Do nothing if the variable name is one of the escaped variable. * * @param node The CFG node where the definition should be record to. * {@code null} if this is a conditional define. */
Set the variable lattice for the given name to the node value in the def lattice. Do nothing if the variable name is one of the escaped variable
addToDefIfLocal
{ "repo_name": "weitzj/closure-compiler", "path": "src/com/google/javascript/jscomp/MustBeReachingVariableDef.java", "license": "apache-2.0", "size": 14001 }
[ "com.google.javascript.jscomp.Scope", "com.google.javascript.rhino.Node", "javax.annotation.Nullable" ]
import com.google.javascript.jscomp.Scope; import com.google.javascript.rhino.Node; import javax.annotation.Nullable;
import com.google.javascript.jscomp.*; import com.google.javascript.rhino.*; import javax.annotation.*;
[ "com.google.javascript", "javax.annotation" ]
com.google.javascript; javax.annotation;
2,510,074
public static Set<SessionProtocol> httpValues() { return HTTP_VALUES; }
static Set<SessionProtocol> function() { return HTTP_VALUES; }
/** * Returns an immutable {@link Set} that contains {@link #HTTP}, {@link #H1C} and {@link #H2C}. * Note that it does not contain HTTPS protocols such as {@link #HTTPS}, {@link #H1} and {@link #H2}. * * @see #httpsValues() */
Returns an immutable <code>Set</code> that contains <code>#HTTP</code>, <code>#H1C</code> and <code>#H2C</code>. Note that it does not contain HTTPS protocols such as <code>#HTTPS</code>, <code>#H1</code> and <code>#H2</code>
httpValues
{ "repo_name": "line/armeria", "path": "core/src/main/java/com/linecorp/armeria/common/SessionProtocol.java", "license": "apache-2.0", "size": 5481 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,786,749
public Builder addSubActionView(int resId, Context context) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(resId, null, false); view.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); return this.addSubActionView(view, view.getMeasuredWidth(), view.getMeasuredHeight()); }
Builder function(int resId, Context context) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(resId, null, false); view.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); return this.addSubActionView(view, view.getMeasuredWidth(), view.getMeasuredHeight()); }
/** * Inflates a new view from the specified resource id and adds it as a sub action view. * * @param resId the resource id reference for the view * @param context a valid context * @return the builder object itself */
Inflates a new view from the specified resource id and adds it as a sub action view
addSubActionView
{ "repo_name": "HitRoxxx/FloatingNew", "path": "app/src/main/java/com/theLoneWarrior/floating/circular_menu/FloatingActionMenu.java", "license": "gpl-3.0", "size": 29405 }
[ "android.content.Context", "android.view.LayoutInflater", "android.view.View" ]
import android.content.Context; import android.view.LayoutInflater; import android.view.View;
import android.content.*; import android.view.*;
[ "android.content", "android.view" ]
android.content; android.view;
377,158
@Test public void testLoadContainerHierarchyNoScreenSpecified() throws Exception { // first create a screen long self = factory.getAdminService().getEventContext().userId; Screen p = (Screen) iUpdate.saveAndReturnObject(mmFactory .simpleScreenData().asIObject()); Screen p2 = (Screen) iUpdate.saveAndReturnObject(mmFactory .simpleScreenData().asIObject()); ParametersI param = new ParametersI(); param.exp(rlong(self)); List results = iContainer.loadContainerHierarchy( Screen.class.getName(), new ArrayList(), param); assertTrue(results.size() > 0); Iterator i = results.iterator(); int count = 0; IObject object; while (i.hasNext()) { object = (IObject) i.next(); if (!(object instanceof Screen)) { count++; } } assertEquals(count, 0); }
void function() throws Exception { long self = factory.getAdminService().getEventContext().userId; Screen p = (Screen) iUpdate.saveAndReturnObject(mmFactory .simpleScreenData().asIObject()); Screen p2 = (Screen) iUpdate.saveAndReturnObject(mmFactory .simpleScreenData().asIObject()); ParametersI param = new ParametersI(); param.exp(rlong(self)); List results = iContainer.loadContainerHierarchy( Screen.class.getName(), new ArrayList(), param); assertTrue(results.size() > 0); Iterator i = results.iterator(); int count = 0; IObject object; while (i.hasNext()) { object = (IObject) i.next(); if (!(object instanceof Screen)) { count++; } } assertEquals(count, 0); }
/** * Test to load container hierarchy with no screen specified, no orphan * loaded * * @throws Exception * Thrown if an error occurred. */
Test to load container hierarchy with no screen specified, no orphan loaded
testLoadContainerHierarchyNoScreenSpecified
{ "repo_name": "stelfrich/openmicroscopy", "path": "components/tools/OmeroJava/test/integration/PojosServiceTest.java", "license": "gpl-2.0", "size": 79848 }
[ "java.util.ArrayList", "java.util.Iterator", "java.util.List", "org.testng.AssertJUnit" ]
import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.testng.AssertJUnit;
import java.util.*; import org.testng.*;
[ "java.util", "org.testng" ]
java.util; org.testng;
1,796,332
public boolean load(InputStream in) throws IOException, ConfigurationException { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); // disable DTD loading (bug #36897) builder.setEntityResolver(new RejectingEntityResolver()); Document document = builder.parse(in); Element doc = document.getDocumentElement(); load(doc); return true; } catch (ParserConfigurationException e) { throw new ConfigurationException(e); } catch (SAXException e) { throw new ConfigurationException(e); } }
boolean function(InputStream in) throws IOException, ConfigurationException { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); builder.setEntityResolver(new RejectingEntityResolver()); Document document = builder.parse(in); Element doc = document.getDocumentElement(); load(doc); return true; } catch (ParserConfigurationException e) { throw new ConfigurationException(e); } catch (SAXException e) { throw new ConfigurationException(e); } }
/** * <p>The specified stream remains open after this method returns. * @param in * @return * @throws IOException * @throws ConfigurationException */
The specified stream remains open after this method returns
load
{ "repo_name": "tripodsan/jackrabbit-filevault", "path": "vault-core/src/main/java/org/apache/jackrabbit/vault/fs/config/AbstractConfig.java", "license": "apache-2.0", "size": 5989 }
[ "java.io.IOException", "java.io.InputStream", "javax.xml.parsers.DocumentBuilder", "javax.xml.parsers.DocumentBuilderFactory", "javax.xml.parsers.ParserConfigurationException", "org.apache.jackrabbit.vault.util.RejectingEntityResolver", "org.w3c.dom.Document", "org.w3c.dom.Element", "org.xml.sax.SAXException" ]
import java.io.IOException; import java.io.InputStream; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.apache.jackrabbit.vault.util.RejectingEntityResolver; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException;
import java.io.*; import javax.xml.parsers.*; import org.apache.jackrabbit.vault.util.*; import org.w3c.dom.*; import org.xml.sax.*;
[ "java.io", "javax.xml", "org.apache.jackrabbit", "org.w3c.dom", "org.xml.sax" ]
java.io; javax.xml; org.apache.jackrabbit; org.w3c.dom; org.xml.sax;
2,232,211
@Test public void testLongExpGetValuesIntBytes() { String[] keysToBeChecked = {"totalMaps", "totalReduces", "finishedMaps", "finishedReduces", "failedMaps", "failedReduces"}; byte[] byteValue = null; int intValue10 = 10; long longValue10 = 10L; JobHistoryFileParserHadoop2 jh = new JobHistoryFileParserHadoop2(null); for(String key: keysToBeChecked) { byteValue = jh.getValue(JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING.get(key), intValue10); assertEquals(Bytes.toLong(byteValue), longValue10); } }
void function() { String[] keysToBeChecked = {STR, STR, STR, STR, STR, STR}; byte[] byteValue = null; int intValue10 = 10; long longValue10 = 10L; JobHistoryFileParserHadoop2 jh = new JobHistoryFileParserHadoop2(null); for(String key: keysToBeChecked) { byteValue = jh.getValue(JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING.get(key), intValue10); assertEquals(Bytes.toLong(byteValue), longValue10); } }
/** * To ensure we write these keys as Longs, not as ints */
To ensure we write these keys as Longs, not as ints
testLongExpGetValuesIntBytes
{ "repo_name": "twitter/hraven", "path": "hraven-etl/src/test/java/com/twitter/hraven/etl/TestJobHistoryFileParserHadoop2.java", "license": "apache-2.0", "size": 12478 }
[ "com.twitter.hraven.JobHistoryKeys", "org.apache.hadoop.hbase.util.Bytes", "org.junit.Assert" ]
import com.twitter.hraven.JobHistoryKeys; import org.apache.hadoop.hbase.util.Bytes; import org.junit.Assert;
import com.twitter.hraven.*; import org.apache.hadoop.hbase.util.*; import org.junit.*;
[ "com.twitter.hraven", "org.apache.hadoop", "org.junit" ]
com.twitter.hraven; org.apache.hadoop; org.junit;
1,390,582
@JsonProperty("statistics") public void setStatistics(Set<Statistic> statistics) { this.statistics = statistics; }
@JsonProperty(STR) void function(Set<Statistic> statistics) { this.statistics = statistics; }
/** * Statistics * <p> * Summary statistics on the number and nature of bids received. Where information is provided on individual * bids, these statistics should match those that can be calculated from the bid details array. */
Statistics Summary statistics on the number and nature of bids received. Where information is provided on individual bids, these statistics should match those that can be calculated from the bid details array
setStatistics
{ "repo_name": "devgateway/oc-explorer", "path": "persistence-mongodb/src/main/java/org/devgateway/ocds/persistence/mongo/Bids.java", "license": "mit", "size": 4586 }
[ "com.fasterxml.jackson.annotation.JsonProperty", "java.util.Set" ]
import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Set;
import com.fasterxml.jackson.annotation.*; import java.util.*;
[ "com.fasterxml.jackson", "java.util" ]
com.fasterxml.jackson; java.util;
2,476,804
public jpl.mipl.spice.jni.JdbcResultSet executeSelectAll(String sql) throws java.sql.SQLException { try { if (!sql.toUpperCase().startsWith(FROM)) { throw new java.security.InvalidParameterException( "ResultSet.executeSelectAll: query must begin with 'FROM '."); } int tableNameEnd = sql.indexOf(' ', FROM.length()); if (tableNameEnd == -1) { tableNameEnd = sql.length(); } String tableName = sql.substring(FROM.length(), tableNameEnd). trim(); Table table = m_pool.getTable(tableName); if (table == null) { throw new java.security.InvalidParameterException( "ResultSet.executeSelectAll: no table '" + tableName + "' currently loaded."); } return executeSelectAll(table, sql.substring(tableNameEnd).trim()); } catch (SpiceException e) { throw new java.sql.SQLException("SpiceException: " + e.getMessage()); } }
jpl.mipl.spice.jni.JdbcResultSet function(String sql) throws java.sql.SQLException { try { if (!sql.toUpperCase().startsWith(FROM)) { throw new java.security.InvalidParameterException( STR); } int tableNameEnd = sql.indexOf(' ', FROM.length()); if (tableNameEnd == -1) { tableNameEnd = sql.length(); } String tableName = sql.substring(FROM.length(), tableNameEnd). trim(); Table table = m_pool.getTable(tableName); if (table == null) { throw new java.security.InvalidParameterException( STR + tableName + STR); } return executeSelectAll(table, sql.substring(tableNameEnd).trim()); } catch (SpiceException e) { throw new java.sql.SQLException(STR + e.getMessage()); } }
/** Executes a statment, prepending "SELECT * " to the specified sql string. * @param sql should begin with the word "FROM" * @throws SpiceException * @throws QueryException * @return */
Executes a statment, prepending "SELECT * " to the specified sql string
executeSelectAll
{ "repo_name": "marrocamp/nasa-VICAR", "path": "vos/java/jpl/mipl/spice/jni/JdbcStatement.java", "license": "bsd-3-clause", "size": 10395 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,927,781
EAttribute getCEGNode_Type();
EAttribute getCEGNode_Type();
/** * Returns the meta object for the attribute '{@link com.specmate.model.requirements.CEGNode#getType <em>Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Type</em>'. * @see com.specmate.model.requirements.CEGNode#getType() * @see #getCEGNode() * @generated */
Returns the meta object for the attribute '<code>com.specmate.model.requirements.CEGNode#getType Type</code>'.
getCEGNode_Type
{ "repo_name": "junkerm/specmate", "path": "bundles/specmate-model-gen/src/com/specmate/model/requirements/RequirementsPackage.java", "license": "apache-2.0", "size": 31389 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,995,140
void setLeader(Genome leader);
void setLeader(Genome leader);
/** * Set the leader of this species. * @param leader The leader of this species. */
Set the leader of this species
setLeader
{ "repo_name": "larhoy/SentimentProjectV2", "path": "SentimentAnalysisV2/encog-core-3.1.0/src/main/java/org/encog/ml/genetic/species/Species.java", "license": "mit", "size": 2781 }
[ "org.encog.ml.genetic.genome.Genome" ]
import org.encog.ml.genetic.genome.Genome;
import org.encog.ml.genetic.genome.*;
[ "org.encog.ml" ]
org.encog.ml;
2,619,342
@ServiceMethod(returns = ReturnType.SINGLE) InboundEndpointInner get(String resourceGroupName, String dnsResolverName, String inboundEndpointName);
@ServiceMethod(returns = ReturnType.SINGLE) InboundEndpointInner get(String resourceGroupName, String dnsResolverName, String inboundEndpointName);
/** * Gets properties of an inbound endpoint for a DNS resolver. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param dnsResolverName The name of the DNS resolver. * @param inboundEndpointName The name of the inbound endpoint for the DNS resolver. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return properties of an inbound endpoint for a DNS resolver. */
Gets properties of an inbound endpoint for a DNS resolver
get
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/dnsresolver/azure-resourcemanager-dnsresolver/src/main/java/com/azure/resourcemanager/dnsresolver/fluent/InboundEndpointsClient.java", "license": "mit", "size": 23253 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.dnsresolver.fluent.models.InboundEndpointInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.dnsresolver.fluent.models.InboundEndpointInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.dnsresolver.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,640,197
@Test public void testDeliveryPatternParsing() throws Exception { Path xmlPath = MavenProjectsHelper.getRequiredPathTowardsRoot(NewspaperUI.class, "DeliveryPattern.xml"); FileInputStream is = new FileInputStream(xmlPath.toFile()); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); DeliveryPattern deserializedObject = (DeliveryPattern) jaxbUnmarshaller.unmarshal(is); WeekPattern deliveryInfo = deserializedObject.getWeekPattern("viborgstiftsfolkeblad"); assertEquals(deliveryInfo.getDayState(DayOfWeek.MONDAY), TRUE); assertEquals(deliveryInfo.getDayState(DayOfWeek.TUESDAY), TRUE); assertEquals(deliveryInfo.getDayState(DayOfWeek.WEDNESDAY), TRUE); assertEquals(deliveryInfo.getDayState(DayOfWeek.THURSDAY), TRUE); assertEquals(deliveryInfo.getDayState(DayOfWeek.FRIDAY), TRUE); assertEquals(deliveryInfo.getDayState(DayOfWeek.SATURDAY), TRUE); assertEquals(deliveryInfo.getDayState(DayOfWeek.SUNDAY), FALSE); }
void function() throws Exception { Path xmlPath = MavenProjectsHelper.getRequiredPathTowardsRoot(NewspaperUI.class, STR); FileInputStream is = new FileInputStream(xmlPath.toFile()); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); DeliveryPattern deserializedObject = (DeliveryPattern) jaxbUnmarshaller.unmarshal(is); WeekPattern deliveryInfo = deserializedObject.getWeekPattern(STR); assertEquals(deliveryInfo.getDayState(DayOfWeek.MONDAY), TRUE); assertEquals(deliveryInfo.getDayState(DayOfWeek.TUESDAY), TRUE); assertEquals(deliveryInfo.getDayState(DayOfWeek.WEDNESDAY), TRUE); assertEquals(deliveryInfo.getDayState(DayOfWeek.THURSDAY), TRUE); assertEquals(deliveryInfo.getDayState(DayOfWeek.FRIDAY), TRUE); assertEquals(deliveryInfo.getDayState(DayOfWeek.SATURDAY), TRUE); assertEquals(deliveryInfo.getDayState(DayOfWeek.SUNDAY), FALSE); }
/** * Validate that it is possible to convert between xml and the object DeliveryTitleInfo * @throws Exception */
Validate that it is possible to convert between xml and the object DeliveryTitleInfo
testDeliveryPatternParsing
{ "repo_name": "statsbiblioteket/digital-pligtaflevering-aviser-tools", "path": "tools/dpa-manualcontrol/src/test/java/org/statsbiblioteket/digital_pligtaflevering_aviser/ui/TestSerializing.java", "license": "apache-2.0", "size": 16492 }
[ "dk.statsbiblioteket.digital_pligtaflevering_aviser.tools.convertersFunctions.DeliveryPattern", "dk.statsbiblioteket.digital_pligtaflevering_aviser.tools.convertersFunctions.WeekPattern", "dk.statsbiblioteket.digital_pligtaflevering_aviser.tools.maven.MavenProjectsHelper", "java.io.FileInputStream", "java.nio.file.Path", "java.time.DayOfWeek", "javax.xml.bind.Unmarshaller", "org.junit.Assert" ]
import dk.statsbiblioteket.digital_pligtaflevering_aviser.tools.convertersFunctions.DeliveryPattern; import dk.statsbiblioteket.digital_pligtaflevering_aviser.tools.convertersFunctions.WeekPattern; import dk.statsbiblioteket.digital_pligtaflevering_aviser.tools.maven.MavenProjectsHelper; import java.io.FileInputStream; import java.nio.file.Path; import java.time.DayOfWeek; import javax.xml.bind.Unmarshaller; import org.junit.Assert;
import dk.statsbiblioteket.digital_pligtaflevering_aviser.tools.*; import dk.statsbiblioteket.digital_pligtaflevering_aviser.tools.maven.*; import java.io.*; import java.nio.file.*; import java.time.*; import javax.xml.bind.*; import org.junit.*;
[ "dk.statsbiblioteket.digital_pligtaflevering_aviser", "java.io", "java.nio", "java.time", "javax.xml", "org.junit" ]
dk.statsbiblioteket.digital_pligtaflevering_aviser; java.io; java.nio; java.time; javax.xml; org.junit;
295,637
public static synchronized void init(ResourceBundle resourceBundle) { if (alreadyInitialized) { return; } I18n.resourceBundle = resourceBundle; alreadyInitialized = true; }
static synchronized void function(ResourceBundle resourceBundle) { if (alreadyInitialized) { return; } I18n.resourceBundle = resourceBundle; alreadyInitialized = true; }
/** * Method init * @param resourceBundle */
Method init
init
{ "repo_name": "md-5/jdk10", "path": "src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/I18n.java", "license": "gpl-2.0", "size": 5714 }
[ "java.util.ResourceBundle" ]
import java.util.ResourceBundle;
import java.util.*;
[ "java.util" ]
java.util;
126
public void retrieveMediaAsync(final Callback callback) { LogHelper.d(TAG, "retrieveMediaAsync called"); if (mCurrentState == State.INITIALIZED) { // Nothing to do, execute callback immediately callback.onMusicCatalogReady(true); return; }
void function(final Callback callback) { LogHelper.d(TAG, STR); if (mCurrentState == State.INITIALIZED) { callback.onMusicCatalogReady(true); return; }
/** * Get the list of music tracks from a server and caches the track information * for future reference, keying tracks by musicId and grouping by genre. */
Get the list of music tracks from a server and caches the track information for future reference, keying tracks by musicId and grouping by genre
retrieveMediaAsync
{ "repo_name": "DeathPluto/android-UniversalMusicPlayer", "path": "mobile/src/main/java/com/example/android/uamp/model/MusicProvider.java", "license": "apache-2.0", "size": 12741 }
[ "com.example.android.uamp.utils.LogHelper" ]
import com.example.android.uamp.utils.LogHelper;
import com.example.android.uamp.utils.*;
[ "com.example.android" ]
com.example.android;
1,570,935
EEnum getDirection();
EEnum getDirection();
/** * Returns the meta object for enum '{@link org.yakindu.base.types.Direction <em>Direction</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for enum '<em>Direction</em>'. * @see org.yakindu.base.types.Direction * @generated */
Returns the meta object for enum '<code>org.yakindu.base.types.Direction Direction</code>'.
getDirection
{ "repo_name": "Yakindu/statecharts", "path": "plugins/org.yakindu.base.types/src-gen/org/yakindu/base/types/TypesPackage.java", "license": "epl-1.0", "size": 91972 }
[ "org.eclipse.emf.ecore.EEnum" ]
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
722,124
public String getIncrementerFactoryClassName() { return incrementerFactoryClassName; } private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2; //NOPMD private byte calculation;
String function() { return incrementerFactoryClassName; } private int PSEUDO_SERIAL_VERSION_UID = JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2; private byte calculation;
/** * Returns the incrementer factory class name. * <p> * The factory will be used to increment the value of the master report variable * with the value from the subreport. * * @return the incrementer factory class name. */
Returns the incrementer factory class name. The factory will be used to increment the value of the master report variable with the value from the subreport
getIncrementerFactoryClassName
{ "repo_name": "sikachu/jasperreports", "path": "src/net/sf/jasperreports/engine/base/JRBaseSubreportReturnValue.java", "license": "lgpl-3.0", "size": 4455 }
[ "net.sf.jasperreports.engine.JRConstants" ]
import net.sf.jasperreports.engine.JRConstants;
import net.sf.jasperreports.engine.*;
[ "net.sf.jasperreports" ]
net.sf.jasperreports;
92,653
@Test // //@PerfTest(invocations =4, threads = 4) public void testTimeForGeneration1_QMARI() { GraphGenerator graphFrame; try { ProjectBean pbean = datahandler.getProject("/ABI_SYSBIO/QMARI"); graphFrame = new GraphGenerator(pbean, openbisClient); Resource resource = graphFrame.getRes(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
void function() { GraphGenerator graphFrame; try { ProjectBean pbean = datahandler.getProject(STR); graphFrame = new GraphGenerator(pbean, openbisClient); Resource resource = graphFrame.getRes(); } catch (IOException e) { e.printStackTrace(); } }
/** * samples: 4 max: 632303 average: 632285.75 median: 632288 */
samples: 4 max: 632303 average: 632285.75 median: 632288
testTimeForGeneration1_QMARI
{ "repo_name": "qbicsoftware/qnavigator", "path": "QBiCMainPortlet/test/de/uni_tuebingen/qbic/qbicmainportlet/TestGraphGenerator.java", "license": "gpl-3.0", "size": 4190 }
[ "com.vaadin.server.Resource", "java.io.IOException" ]
import com.vaadin.server.Resource; import java.io.IOException;
import com.vaadin.server.*; import java.io.*;
[ "com.vaadin.server", "java.io" ]
com.vaadin.server; java.io;
1,663,378
public static List<String> compareMd5(HttpServletRequest request, HttpServletResponse response, Map<String, String> clientMd5Map) { List<String> changedGroupKeys = new ArrayList<String>(); String tag = request.getHeader("Vipserver-Tag"); for (Map.Entry<String, String> entry : clientMd5Map.entrySet()) { String groupKey = entry.getKey(); String clientMd5 = entry.getValue(); String ip = RequestUtil.getRemoteIp(request); boolean isUptodate = ConfigCacheService.isUptodate(groupKey, clientMd5, ip, tag); if (!isUptodate) { changedGroupKeys.add(groupKey); } } return changedGroupKeys; }
static List<String> function(HttpServletRequest request, HttpServletResponse response, Map<String, String> clientMd5Map) { List<String> changedGroupKeys = new ArrayList<String>(); String tag = request.getHeader(STR); for (Map.Entry<String, String> entry : clientMd5Map.entrySet()) { String groupKey = entry.getKey(); String clientMd5 = entry.getValue(); String ip = RequestUtil.getRemoteIp(request); boolean isUptodate = ConfigCacheService.isUptodate(groupKey, clientMd5, ip, tag); if (!isUptodate) { changedGroupKeys.add(groupKey); } } return changedGroupKeys; }
/** * Compare Md5. */
Compare Md5
compareMd5
{ "repo_name": "alibaba/nacos", "path": "config/src/main/java/com/alibaba/nacos/config/server/utils/MD5Util.java", "license": "apache-2.0", "size": 7098 }
[ "com.alibaba.nacos.config.server.service.ConfigCacheService", "java.util.ArrayList", "java.util.List", "java.util.Map", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import com.alibaba.nacos.config.server.service.ConfigCacheService; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import com.alibaba.nacos.config.server.service.*; import java.util.*; import javax.servlet.http.*;
[ "com.alibaba.nacos", "java.util", "javax.servlet" ]
com.alibaba.nacos; java.util; javax.servlet;
784,621
public int loadBeanDefinitions(InputSource inputSource) throws BeanDefinitionStoreException { return loadBeanDefinitions(inputSource, "resource loaded through SAX InputSource"); }
int function(InputSource inputSource) throws BeanDefinitionStoreException { return loadBeanDefinitions(inputSource, STR); }
/** * Load bean definitions from the specified XML file. * @param inputSource the SAX InputSource to read from * @return the number of bean definitions found * @throws BeanDefinitionStoreException in case of loading or parsing errors */
Load bean definitions from the specified XML file
loadBeanDefinitions
{ "repo_name": "kingtang/spring-learn", "path": "spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java", "license": "gpl-3.0", "size": 21077 }
[ "org.springframework.beans.factory.BeanDefinitionStoreException", "org.xml.sax.InputSource" ]
import org.springframework.beans.factory.BeanDefinitionStoreException; import org.xml.sax.InputSource;
import org.springframework.beans.factory.*; import org.xml.sax.*;
[ "org.springframework.beans", "org.xml.sax" ]
org.springframework.beans; org.xml.sax;
114,533
public Color getDefaultForeground() { return defaultForeground; }
Color function() { return defaultForeground; }
/** * Get the value of defaultForeground. * * @return the value of defaultForeground */
Get the value of defaultForeground
getDefaultForeground
{ "repo_name": "kingkybel/JavaBayes", "path": "src/BayesGUI/OutputPanel.java", "license": "gpl-3.0", "size": 18744 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,509,112
@RequestMapping(params = "update") // GET or POST public String update(@Valid final TbCfcApplicationMst tbCfcApplicationMst, final BindingResult bindingResult, final Model model, final HttpServletRequest httpServletRequest) { log("Action 'update'"); try { if (!bindingResult.hasErrors()) { // --- Perform database operations final TbCfcApplicationMst tbCfcApplicationMstSaved = tbCfcApplicationMstService.update(tbCfcApplicationMst); model.addAttribute(MAIN_ENTITY_NAME, tbCfcApplicationMstSaved); // --- Set the result message // messageHelper.addMessage(redirectAttributes, new Message(MessageType.SUCCESS,"save.ok")); log("Action 'update' : update done - redirect"); return redirectToForm(httpServletRequest, tbCfcApplicationMst.getApmApplicationId()); } else { log("Action 'update' : binding errors"); populateModel(model, tbCfcApplicationMst, FormMode.UPDATE); return JSP_FORM; } } catch (final Exception e) { messageHelper.addException(model, "tbCfcApplicationMst.error.update", e); log("Action 'update' : Exception - " + e.getMessage()); populateModel(model, tbCfcApplicationMst, FormMode.UPDATE); return JSP_FORM; } }
@RequestMapping(params = STR) String function(@Valid final TbCfcApplicationMst tbCfcApplicationMst, final BindingResult bindingResult, final Model model, final HttpServletRequest httpServletRequest) { log(STR); try { if (!bindingResult.hasErrors()) { final TbCfcApplicationMst tbCfcApplicationMstSaved = tbCfcApplicationMstService.update(tbCfcApplicationMst); model.addAttribute(MAIN_ENTITY_NAME, tbCfcApplicationMstSaved); log(STR); return redirectToForm(httpServletRequest, tbCfcApplicationMst.getApmApplicationId()); } else { log(STR); populateModel(model, tbCfcApplicationMst, FormMode.UPDATE); return JSP_FORM; } } catch (final Exception e) { messageHelper.addException(model, STR, e); log(STR + e.getMessage()); populateModel(model, tbCfcApplicationMst, FormMode.UPDATE); return JSP_FORM; } }
/** * 'UPDATE' action processing. <br> * This action is based on the 'Post/Redirect/Get (PRG)' pattern, so it ends by 'http redirect'<br> * @param tbCfcApplicationMst entity to be updated * @param bindingResult Spring MVC binding result * @param model Spring MVC model * @param redirectAttributes Spring MVC redirect attributes * @param httpServletRequest * @return */
'UPDATE' action processing. This action is based on the 'Post/Redirect/Get (PRG)' pattern, so it ends by 'http redirect'
update
{ "repo_name": "abmindiarepomanager/ABMOpenMainet", "path": "Mainet1.1/MainetServiceParent/MainetServiceCommon/src/main/java/com/abm/mainet/common/master/ui/controller/TbCfcApplicationMstController.java", "license": "gpl-3.0", "size": 10145 }
[ "com.abm.mainet.common.constant.MainetConstants", "com.abm.mainet.common.master.dto.TbCfcApplicationMst", "javax.servlet.http.HttpServletRequest", "javax.validation.Valid", "org.springframework.ui.Model", "org.springframework.validation.BindingResult", "org.springframework.web.bind.annotation.RequestMapping" ]
import com.abm.mainet.common.constant.MainetConstants; import com.abm.mainet.common.master.dto.TbCfcApplicationMst; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.RequestMapping;
import com.abm.mainet.common.constant.*; import com.abm.mainet.common.master.dto.*; import javax.servlet.http.*; import javax.validation.*; import org.springframework.ui.*; import org.springframework.validation.*; import org.springframework.web.bind.annotation.*;
[ "com.abm.mainet", "javax.servlet", "javax.validation", "org.springframework.ui", "org.springframework.validation", "org.springframework.web" ]
com.abm.mainet; javax.servlet; javax.validation; org.springframework.ui; org.springframework.validation; org.springframework.web;
2,342,473
Map<String, DataFormatDefinition> getDataFormats(); /** * Resolve a data format definition given its name * * @param name the data format definition name or a reference to it in the {@link org.apache.camel.spi.Registry}
Map<String, DataFormatDefinition> getDataFormats(); /** * Resolve a data format definition given its name * * @param name the data format definition name or a reference to it in the {@link org.apache.camel.spi.Registry}
/** * Gets the data formats that can be referenced in the routes. * * @return the data formats available */
Gets the data formats that can be referenced in the routes
getDataFormats
{ "repo_name": "punkhorn/camel-upstream", "path": "core/camel-core/src/main/java/org/apache/camel/model/ModelCamelContext.java", "license": "apache-2.0", "size": 10180 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,757,338
private Version getHeadVersion(NodeRef nodeRef) { Version version = null; StoreRef storeRef = nodeRef.getStoreRef(); NodeRef versionHistoryNodeRef = getVersionHistoryNodeRef(nodeRef); if (versionHistoryNodeRef != null) { List<ChildAssociationRef> versionsAssoc = this.dbNodeService.getChildAssocs(versionHistoryNodeRef, RegexQNamePattern.MATCH_ALL, VersionModel.CHILD_QNAME_VERSIONS); for (ChildAssociationRef versionAssoc : versionsAssoc) { NodeRef versionNodeRef = versionAssoc.getChildRef(); List<AssociationRef> successors = this.dbNodeService.getTargetAssocs(versionNodeRef, VersionModel.ASSOC_SUCCESSOR); if (successors.size() == 0) { String storeProtocol = (String)this.dbNodeService.getProperty( versionNodeRef, QName.createQName(NAMESPACE_URI, VersionModel.PROP_FROZEN_NODE_STORE_PROTOCOL)); String storeId = (String)this.dbNodeService.getProperty( versionNodeRef, QName.createQName(NAMESPACE_URI, VersionModel.PROP_FROZEN_NODE_STORE_ID)); StoreRef versionStoreRef = new StoreRef(storeProtocol, storeId); if (storeRef.equals(versionStoreRef) == true) { version = getVersion(versionNodeRef); } } } } return version; }
Version function(NodeRef nodeRef) { Version version = null; StoreRef storeRef = nodeRef.getStoreRef(); NodeRef versionHistoryNodeRef = getVersionHistoryNodeRef(nodeRef); if (versionHistoryNodeRef != null) { List<ChildAssociationRef> versionsAssoc = this.dbNodeService.getChildAssocs(versionHistoryNodeRef, RegexQNamePattern.MATCH_ALL, VersionModel.CHILD_QNAME_VERSIONS); for (ChildAssociationRef versionAssoc : versionsAssoc) { NodeRef versionNodeRef = versionAssoc.getChildRef(); List<AssociationRef> successors = this.dbNodeService.getTargetAssocs(versionNodeRef, VersionModel.ASSOC_SUCCESSOR); if (successors.size() == 0) { String storeProtocol = (String)this.dbNodeService.getProperty( versionNodeRef, QName.createQName(NAMESPACE_URI, VersionModel.PROP_FROZEN_NODE_STORE_PROTOCOL)); String storeId = (String)this.dbNodeService.getProperty( versionNodeRef, QName.createQName(NAMESPACE_URI, VersionModel.PROP_FROZEN_NODE_STORE_ID)); StoreRef versionStoreRef = new StoreRef(storeProtocol, storeId); if (storeRef.equals(versionStoreRef) == true) { version = getVersion(versionNodeRef); } } } } return version; }
/** * Get the head version given a node reference * * @param nodeRef the node reference * @return the 'head' version */
Get the head version given a node reference
getHeadVersion
{ "repo_name": "loftuxab/community-edition-old", "path": "projects/repository/source/java/org/alfresco/repo/version/VersionServiceImpl.java", "license": "lgpl-3.0", "size": 59003 }
[ "java.util.List", "org.alfresco.service.cmr.repository.AssociationRef", "org.alfresco.service.cmr.repository.ChildAssociationRef", "org.alfresco.service.cmr.repository.NodeRef", "org.alfresco.service.cmr.repository.StoreRef", "org.alfresco.service.cmr.version.Version", "org.alfresco.service.namespace.QName", "org.alfresco.service.namespace.RegexQNamePattern" ]
import java.util.List; import org.alfresco.service.cmr.repository.AssociationRef; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.StoreRef; import org.alfresco.service.cmr.version.Version; import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.RegexQNamePattern;
import java.util.*; import org.alfresco.service.cmr.repository.*; import org.alfresco.service.cmr.version.*; import org.alfresco.service.namespace.*;
[ "java.util", "org.alfresco.service" ]
java.util; org.alfresco.service;
150,520
@Override public EJBHome getEJBHome() throws RemoteException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "getEJBHome"); if (home == null) { if (homeJNDIName != null && homeJNDIName.contains(":")) { throw new NoSuchObjectException("EJBHome JNDI name not allowed : " + homeJNDIName); } try { Class<?> homeClass = null; try { // // If we are running on the server side, then the thread // context loader would have been set appropriately by // the container. If running on a client, then check the // thread context class loader first // ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl != null) { homeClass = cl.loadClass(homeInterface); } else { throw new ClassNotFoundException(); } } catch (ClassNotFoundException ex) { //FFDCFilter.processException(ex, CLASS_NAME + ".getEJBHome", "141", this); try { homeClass = Class.forName(homeInterface); } catch (ClassNotFoundException e) { //FFDCFilter.processException(e, CLASS_NAME + ".getEJBHome", // "148", this); throw new ClassNotFoundException(homeInterface); } } InitialContext ctx = null; try { // Locate the home //91851 begin if (this.initialContextProperties == null) { ctx = new InitialContext(); } else { try { ctx = new InitialContext(this.initialContextProperties); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) // d144064 Tr.debug(tc, "Created an initial context with the " + "initialContextProperties, providerURL = " + (String) initialContextProperties.get("java.naming.provider.url") + " INITIAL_CONTEXT_FACTORY = " + (String) initialContextProperties.get(Context.INITIAL_CONTEXT_FACTORY)); } catch (NamingException ne) { //FFDCFilter.processException(ne, CLASS_NAME + ".getEJBHome", // "177", this); ctx = new InitialContext(); } } //91851 end home = (EJBHome) PortableRemoteObject.narrow(ctx.lookup(homeJNDIName), homeClass); } catch (NoInitialContextException e) { //FFDCFilter.processException(e, CLASS_NAME + ".getEJBHome", "188", this); java.util.Properties p = new java.util.Properties(); p.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory"); ctx = new InitialContext(p); home = (EJBHome) PortableRemoteObject.narrow(ctx.lookup(homeJNDIName), homeClass); } } catch (NamingException e) { // Problem looking up the home //FFDCFilter.processException(e, CLASS_NAME + ".getEJBHome", "201", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "getEJBHome", e); RemoteException re = new NoSuchObjectException("Could not find home in JNDI"); re.detail = e; throw re; } catch (ClassNotFoundException e) { // We couldn't find the home interface's class //FFDCFilter.processException(e, CLASS_NAME + ".getEJBHome", "213", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "getEJBHome", e); throw new RemoteException("Could not load home interface", e); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "getEJBHome"); return home; } // getEJBHome
EJBHome function() throws RemoteException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, STR); if (home == null) { if (homeJNDIName != null && homeJNDIName.contains(":")) { throw new NoSuchObjectException(STR + homeJNDIName); } try { Class<?> homeClass = null; try { if (cl != null) { homeClass = cl.loadClass(homeInterface); } else { throw new ClassNotFoundException(); } } catch (ClassNotFoundException ex) { try { homeClass = Class.forName(homeInterface); } catch (ClassNotFoundException e) { throw new ClassNotFoundException(homeInterface); } } InitialContext ctx = null; try { if (this.initialContextProperties == null) { ctx = new InitialContext(); } else { try { ctx = new InitialContext(this.initialContextProperties); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, STR + STR + (String) initialContextProperties.get(STR) + STR + (String) initialContextProperties.get(Context.INITIAL_CONTEXT_FACTORY)); } catch (NamingException ne) { ctx = new InitialContext(); } } home = (EJBHome) PortableRemoteObject.narrow(ctx.lookup(homeJNDIName), homeClass); } catch (NoInitialContextException e) { java.util.Properties p = new java.util.Properties(); p.put(Context.INITIAL_CONTEXT_FACTORY, STR); ctx = new InitialContext(p); home = (EJBHome) PortableRemoteObject.narrow(ctx.lookup(homeJNDIName), homeClass); } } catch (NamingException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, STR, e); RemoteException re = new NoSuchObjectException(STR); re.detail = e; throw re; } catch (ClassNotFoundException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, STR, e); throw new RemoteException(STR, e); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, STR); return home; }
/** * Return <code>EJBHome</code> reference for this HomeHandle. <p> */
Return <code>EJBHome</code> reference for this HomeHandle.
getEJBHome
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EntityHomeHandle.java", "license": "epl-1.0", "size": 8696 }
[ "com.ibm.websphere.ras.Tr", "com.ibm.websphere.ras.TraceComponent", "java.rmi.NoSuchObjectException", "java.rmi.RemoteException", "java.util.Properties", "javax.ejb.EJBHome", "javax.naming.Context", "javax.naming.InitialContext", "javax.naming.NamingException", "javax.naming.NoInitialContextException", "javax.rmi.PortableRemoteObject" ]
import com.ibm.websphere.ras.Tr; import com.ibm.websphere.ras.TraceComponent; import java.rmi.NoSuchObjectException; import java.rmi.RemoteException; import java.util.Properties; import javax.ejb.EJBHome; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.naming.NoInitialContextException; import javax.rmi.PortableRemoteObject;
import com.ibm.websphere.ras.*; import java.rmi.*; import java.util.*; import javax.ejb.*; import javax.naming.*; import javax.rmi.*;
[ "com.ibm.websphere", "java.rmi", "java.util", "javax.ejb", "javax.naming", "javax.rmi" ]
com.ibm.websphere; java.rmi; java.util; javax.ejb; javax.naming; javax.rmi;
2,389,264
public void sendMessage(String message) throws IOException { ServerWriter.write(message); }
void function(String message) throws IOException { ServerWriter.write(message); }
/** * Attempts to send the server the given message. Messages * must always begin with their corresponding request code * so the server can identify the desired action. * * @param message the message to be sent to the server */
Attempts to send the server the given message. Messages must always begin with their corresponding request code so the server can identify the desired action
sendMessage
{ "repo_name": "JamoBox/JamChat_Core", "path": "src/main/java/com/jamobox/jamchatcore/server/Server.java", "license": "gpl-3.0", "size": 5334 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,626,900
int bulkUpdate(String queryString, Object value) throws DataAccessException;
int bulkUpdate(String queryString, Object value) throws DataAccessException;
/** * Update/delete all objects according to the given query, binding one value * to a "?" parameter in the query string. * @param queryString an update/delete query expressed in Hibernate's query language * @param value the value of the parameter * @return the number of instances updated/deleted * @throws org.springframework.dao.DataAccessException in case of Hibernate errors * @see org.hibernate.Session#createQuery * @see org.hibernate.Query#executeUpdate */
Update/delete all objects according to the given query, binding one value to a "?" parameter in the query string
bulkUpdate
{ "repo_name": "cbeams-archive/spring-framework-2.5.x", "path": "src/org/springframework/orm/hibernate3/HibernateOperations.java", "license": "apache-2.0", "size": 44752 }
[ "org.springframework.dao.DataAccessException" ]
import org.springframework.dao.DataAccessException;
import org.springframework.dao.*;
[ "org.springframework.dao" ]
org.springframework.dao;
122,158
public Formula recodeEnterInvariants() { // sig RecodeEnter extends Enter { } // { // card.k1 = room.key.pre // key.post = key.pre ++ room -> card.k2 // // prev.unchanged // holds.unchanged // occ.unchanged // } final List<Formula> invs = new ArrayList<Formula>(); invs.add( RecodeEnter.in(Enter)); final Variable r = Variable.unary("n"); invs.add( card(r).join(k1).eq(room(r).join(key).join(pre(r))).forAll(r.oneOf(RecodeEnter))); invs.add( key.join(post(r)).eq(key.join(pre(r)).override(room(r).product(card(r).join(k2)))).forAll(r.oneOf(RecodeEnter))); invs.add( unchanged(r, prev).forAll(r.oneOf(RecodeEnter))); invs.add( unchanged(r, holds).forAll(r.oneOf(RecodeEnter))); invs.add( unchanged(r, occ).forAll(r.oneOf(RecodeEnter))); return Formula.and(invs); }
Formula function() { final List<Formula> invs = new ArrayList<Formula>(); invs.add( RecodeEnter.in(Enter)); final Variable r = Variable.unary("n"); invs.add( card(r).join(k1).eq(room(r).join(key).join(pre(r))).forAll(r.oneOf(RecodeEnter))); invs.add( key.join(post(r)).eq(key.join(pre(r)).override(room(r).product(card(r).join(k2)))).forAll(r.oneOf(RecodeEnter))); invs.add( unchanged(r, prev).forAll(r.oneOf(RecodeEnter))); invs.add( unchanged(r, holds).forAll(r.oneOf(RecodeEnter))); invs.add( unchanged(r, occ).forAll(r.oneOf(RecodeEnter))); return Formula.and(invs); }
/** * Returns the invariants for RecodeEnter and its fields. * @return invariants for RecodeEnter and its fields. */
Returns the invariants for RecodeEnter and its fields
recodeEnterInvariants
{ "repo_name": "emina/kodkod", "path": "examples/kodkod/examples/alloy/Hotel.java", "license": "mit", "size": 20551 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,582,025
public static Object invokeMethod(Object instance, String className, PackageType packageType, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException { return invokeMethod(instance, packageType.getClass(className), methodName, arguments); }
static Object function(Object instance, String className, PackageType packageType, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException { return invokeMethod(instance, packageType.getClass(className), methodName, arguments); }
/** * Invokes a method of a desired class on an object with the given arguments * * @param instance Target object * @param className Name of the desired target class * @param packageType Package where the desired target class is located * @param methodName Name of the desired method * @param arguments Arguments which are used to invoke the desired method * @return The result of invoking the desired method on the target object * @throws IllegalAccessException If the desired method cannot be accessed due to certain circumstances * @throws IllegalArgumentException If the types of the arguments do not match the parameter types of the method (this should not occur since it searches for a method with the types of the arguments) * @throws InvocationTargetException If the desired method cannot be invoked on the target object * @throws NoSuchMethodException If the desired method of the desired target class with the specified name and arguments cannot be found * @throws ClassNotFoundException If the desired target class with the specified name and package cannot be found * @see #getClass(String, PackageType) * @see #invokeMethod(Object, Class, String, Object...) */
Invokes a method of a desired class on an object with the given arguments
invokeMethod
{ "repo_name": "MDrollette/Residence", "path": "src/com/bekvon/bukkit/residence/utils/ReflectionUtils.java", "license": "gpl-3.0", "size": 27938 }
[ "java.lang.reflect.InvocationTargetException" ]
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
467,649
public static void copyExifInfo(Context context, Uri sourceUri, Uri saveUri, int outputWidth, int outputHeight) { if (sourceUri == null || saveUri == null) return; try { File sourceFile = Utils.getFileFromUri(context, sourceUri); File saveFile = Utils.getFileFromUri(context, saveUri); if (sourceFile == null || saveFile == null) { return; } String sourcePath = sourceFile.getAbsolutePath(); String savePath = saveFile.getAbsolutePath(); ExifInterface sourceExif = new ExifInterface(sourcePath); List<String> tags = new ArrayList<>(); tags.add(ExifInterface.TAG_DATETIME); tags.add(ExifInterface.TAG_FLASH); tags.add(ExifInterface.TAG_FOCAL_LENGTH); tags.add(ExifInterface.TAG_GPS_ALTITUDE); tags.add(ExifInterface.TAG_GPS_ALTITUDE_REF); tags.add(ExifInterface.TAG_GPS_DATESTAMP); tags.add(ExifInterface.TAG_GPS_LATITUDE); tags.add(ExifInterface.TAG_GPS_LATITUDE_REF); tags.add(ExifInterface.TAG_GPS_LONGITUDE); tags.add(ExifInterface.TAG_GPS_LONGITUDE_REF); tags.add(ExifInterface.TAG_GPS_PROCESSING_METHOD); tags.add(ExifInterface.TAG_GPS_TIMESTAMP); tags.add(ExifInterface.TAG_MAKE); tags.add(ExifInterface.TAG_MODEL); tags.add(ExifInterface.TAG_WHITE_BALANCE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { tags.add(ExifInterface.TAG_EXPOSURE_TIME); //noinspection deprecation tags.add(ExifInterface.TAG_APERTURE); //noinspection deprecation tags.add(ExifInterface.TAG_ISO); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { tags.add(ExifInterface.TAG_DATETIME_DIGITIZED); tags.add(ExifInterface.TAG_SUBSEC_TIME); //noinspection deprecation tags.add(ExifInterface.TAG_SUBSEC_TIME_DIG); //noinspection deprecation tags.add(ExifInterface.TAG_SUBSEC_TIME_ORIG); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { tags.add(ExifInterface.TAG_F_NUMBER); tags.add(ExifInterface.TAG_ISO_SPEED_RATINGS); tags.add(ExifInterface.TAG_SUBSEC_TIME_DIGITIZED); tags.add(ExifInterface.TAG_SUBSEC_TIME_ORIGINAL); } ExifInterface saveExif = new ExifInterface(savePath); String value; for (String tag : tags) { value = sourceExif.getAttribute(tag); if (!TextUtils.isEmpty(value)) { saveExif.setAttribute(tag, value); } } saveExif.setAttribute(ExifInterface.TAG_IMAGE_WIDTH, String.valueOf(outputWidth)); saveExif.setAttribute(ExifInterface.TAG_IMAGE_LENGTH, String.valueOf(outputHeight)); saveExif.setAttribute(ExifInterface.TAG_ORIENTATION, String.valueOf(ExifInterface.ORIENTATION_UNDEFINED)); saveExif.saveAttributes(); } catch (IOException e) { e.printStackTrace(); } }
static void function(Context context, Uri sourceUri, Uri saveUri, int outputWidth, int outputHeight) { if (sourceUri == null saveUri == null) return; try { File sourceFile = Utils.getFileFromUri(context, sourceUri); File saveFile = Utils.getFileFromUri(context, saveUri); if (sourceFile == null saveFile == null) { return; } String sourcePath = sourceFile.getAbsolutePath(); String savePath = saveFile.getAbsolutePath(); ExifInterface sourceExif = new ExifInterface(sourcePath); List<String> tags = new ArrayList<>(); tags.add(ExifInterface.TAG_DATETIME); tags.add(ExifInterface.TAG_FLASH); tags.add(ExifInterface.TAG_FOCAL_LENGTH); tags.add(ExifInterface.TAG_GPS_ALTITUDE); tags.add(ExifInterface.TAG_GPS_ALTITUDE_REF); tags.add(ExifInterface.TAG_GPS_DATESTAMP); tags.add(ExifInterface.TAG_GPS_LATITUDE); tags.add(ExifInterface.TAG_GPS_LATITUDE_REF); tags.add(ExifInterface.TAG_GPS_LONGITUDE); tags.add(ExifInterface.TAG_GPS_LONGITUDE_REF); tags.add(ExifInterface.TAG_GPS_PROCESSING_METHOD); tags.add(ExifInterface.TAG_GPS_TIMESTAMP); tags.add(ExifInterface.TAG_MAKE); tags.add(ExifInterface.TAG_MODEL); tags.add(ExifInterface.TAG_WHITE_BALANCE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { tags.add(ExifInterface.TAG_EXPOSURE_TIME); tags.add(ExifInterface.TAG_APERTURE); tags.add(ExifInterface.TAG_ISO); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { tags.add(ExifInterface.TAG_DATETIME_DIGITIZED); tags.add(ExifInterface.TAG_SUBSEC_TIME); tags.add(ExifInterface.TAG_SUBSEC_TIME_DIG); tags.add(ExifInterface.TAG_SUBSEC_TIME_ORIG); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { tags.add(ExifInterface.TAG_F_NUMBER); tags.add(ExifInterface.TAG_ISO_SPEED_RATINGS); tags.add(ExifInterface.TAG_SUBSEC_TIME_DIGITIZED); tags.add(ExifInterface.TAG_SUBSEC_TIME_ORIGINAL); } ExifInterface saveExif = new ExifInterface(savePath); String value; for (String tag : tags) { value = sourceExif.getAttribute(tag); if (!TextUtils.isEmpty(value)) { saveExif.setAttribute(tag, value); } } saveExif.setAttribute(ExifInterface.TAG_IMAGE_WIDTH, String.valueOf(outputWidth)); saveExif.setAttribute(ExifInterface.TAG_IMAGE_LENGTH, String.valueOf(outputHeight)); saveExif.setAttribute(ExifInterface.TAG_ORIENTATION, String.valueOf(ExifInterface.ORIENTATION_UNDEFINED)); saveExif.saveAttributes(); } catch (IOException e) { e.printStackTrace(); } }
/** * Copy EXIF info to new file * * ========================================= * * NOTE: PNG cannot not have EXIF info. * * source: JPEG, save: JPEG * copies all EXIF data * * source: JPEG, save: PNG * saves no EXIF data * * source: PNG, save: JPEG * saves only width and height EXIF data * * source: PNG, save: PNG * saves no EXIF data * * ========================================= */
Copy EXIF info to new file ========================================= source: JPEG, save: JPEG copies all EXIF data source: JPEG, save: PNG saves no EXIF data source: PNG, save: JPEG saves only width and height EXIF data source: PNG, save: PNG saves no EXIF data =========================================
copyExifInfo
{ "repo_name": "IsseiAoki/SimpleCropView", "path": "simplecropview/src/main/java/com/isseiaoki/simplecropview/util/Utils.java", "license": "mit", "size": 18985 }
[ "android.content.Context", "android.media.ExifInterface", "android.net.Uri", "android.os.Build", "android.text.TextUtils", "java.io.File", "java.io.IOException", "java.util.ArrayList", "java.util.List" ]
import android.content.Context; import android.media.ExifInterface; import android.net.Uri; import android.os.Build; import android.text.TextUtils; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List;
import android.content.*; import android.media.*; import android.net.*; import android.os.*; import android.text.*; import java.io.*; import java.util.*;
[ "android.content", "android.media", "android.net", "android.os", "android.text", "java.io", "java.util" ]
android.content; android.media; android.net; android.os; android.text; java.io; java.util;
1,155,144
@JsonSetter("checkInterval") public void setCheckInterval(final int checkInterval) { this.checkInterval = checkInterval; }
@JsonSetter(STR) void function(final int checkInterval) { this.checkInterval = checkInterval; }
/** * Set the check interval. * * @param checkInterval The check interval. */
Set the check interval
setCheckInterval
{ "repo_name": "jschlichtholz/jiffybox", "path": "src/main/java/eu/df/jiffybox/models/MonitoringCheck.java", "license": "mit", "size": 7843 }
[ "com.fasterxml.jackson.annotation.JsonSetter" ]
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.*;
[ "com.fasterxml.jackson" ]
com.fasterxml.jackson;
1,201,863
public StepInterface getStepInterface( String stepname, int copy ) { if ( steps == null ) { return null; } // Now start all the threads... for ( int i = 0; i < steps.size(); i++ ) { StepMetaDataCombi sid = steps.get( i ); if ( sid.stepname.equalsIgnoreCase( stepname ) && sid.copy == copy ) { return sid.step; } } return null; }
StepInterface function( String stepname, int copy ) { if ( steps == null ) { return null; } for ( int i = 0; i < steps.size(); i++ ) { StepMetaDataCombi sid = steps.get( i ); if ( sid.stepname.equalsIgnoreCase( stepname ) && sid.copy == copy ) { return sid.step; } } return null; }
/** * Find the StepInterface (thread) by looking it up using the name. * * @param stepname * The name of the step to look for * @param copy * the copy number of the step to look for * @return the StepInterface or null if nothing was found. */
Find the StepInterface (thread) by looking it up using the name
getStepInterface
{ "repo_name": "ma459006574/pentaho-kettle", "path": "engine/src/org/pentaho/di/trans/Trans.java", "license": "apache-2.0", "size": 191984 }
[ "org.pentaho.di.trans.step.StepInterface", "org.pentaho.di.trans.step.StepMetaDataCombi" ]
import org.pentaho.di.trans.step.StepInterface; import org.pentaho.di.trans.step.StepMetaDataCombi;
import org.pentaho.di.trans.step.*;
[ "org.pentaho.di" ]
org.pentaho.di;
2,772,031
private void executeCacheTestWithUnreachableClient(boolean forceClientToSrvConnections) throws Exception { LogListener lsnr = LogListener.matches("Failed to send message to remote node").atMost(0).build(); for (int i = 0; i < SRVS_NUM; i++) { ccfg = cacheConfiguration(CACHE_NAME, ATOMIC); startGrid(i, (UnaryOperator<IgniteConfiguration>)cfg -> { ListeningTestLogger log = new ListeningTestLogger(false, cfg.getGridLogger()); log.registerListener(lsnr); return cfg.setGridLogger(log); }); } this.forceClientToSrvConnections = forceClientToSrvConnections; startClientGrid(SRVS_NUM); putAndCheckKey(); assertTrue(lsnr.check()); }
void function(boolean forceClientToSrvConnections) throws Exception { LogListener lsnr = LogListener.matches(STR).atMost(0).build(); for (int i = 0; i < SRVS_NUM; i++) { ccfg = cacheConfiguration(CACHE_NAME, ATOMIC); startGrid(i, (UnaryOperator<IgniteConfiguration>)cfg -> { ListeningTestLogger log = new ListeningTestLogger(false, cfg.getGridLogger()); log.registerListener(lsnr); return cfg.setGridLogger(log); }); } this.forceClientToSrvConnections = forceClientToSrvConnections; startClientGrid(SRVS_NUM); putAndCheckKey(); assertTrue(lsnr.check()); }
/** * Executes cache test with "unreachable" client. * * @param forceClientToSrvConnections Flag for the client mode. * @throws Exception If failed. */
Executes cache test with "unreachable" client
executeCacheTestWithUnreachableClient
{ "repo_name": "NSAmelchev/ignite", "path": "modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationInverseConnectionEstablishingTest.java", "license": "apache-2.0", "size": 16280 }
[ "java.util.function.UnaryOperator", "org.apache.ignite.configuration.IgniteConfiguration", "org.apache.ignite.testframework.ListeningTestLogger", "org.apache.ignite.testframework.LogListener" ]
import java.util.function.UnaryOperator; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.testframework.ListeningTestLogger; import org.apache.ignite.testframework.LogListener;
import java.util.function.*; import org.apache.ignite.configuration.*; import org.apache.ignite.testframework.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
1,389,296
public void decrypt(String password) throws CryptographyException, IOException, InvalidPasswordException { try { StandardDecryptionMaterial m = new StandardDecryptionMaterial(password); this.openProtection(m); document.dereferenceObjectStreams(); } catch (BadSecurityHandlerException e) { throw new CryptographyException(e); } }
void function(String password) throws CryptographyException, IOException, InvalidPasswordException { try { StandardDecryptionMaterial m = new StandardDecryptionMaterial(password); this.openProtection(m); document.dereferenceObjectStreams(); } catch (BadSecurityHandlerException e) { throw new CryptographyException(e); } }
/** * This will decrypt a document. This method is provided for compatibility reasons only. User should use the new security layer instead and the * openProtection method especially. * * @param password Either the user or owner password. * * @throws CryptographyException If there is an error decrypting the document. * @throws IOException If there is an error getting the stream data. * @throws InvalidPasswordException If the password is not a user or owner password. * */
This will decrypt a document. This method is provided for compatibility reasons only. User should use the new security layer instead and the openProtection method especially
decrypt
{ "repo_name": "sencko/NALB", "path": "nalb2013/src/org/apache/pdfbox/pdmodel/PDDocument.java", "license": "gpl-2.0", "size": 52170 }
[ "java.io.IOException", "org.apache.pdfbox.exceptions.CryptographyException", "org.apache.pdfbox.exceptions.InvalidPasswordException", "org.apache.pdfbox.pdmodel.encryption.BadSecurityHandlerException", "org.apache.pdfbox.pdmodel.encryption.StandardDecryptionMaterial" ]
import java.io.IOException; import org.apache.pdfbox.exceptions.CryptographyException; import org.apache.pdfbox.exceptions.InvalidPasswordException; import org.apache.pdfbox.pdmodel.encryption.BadSecurityHandlerException; import org.apache.pdfbox.pdmodel.encryption.StandardDecryptionMaterial;
import java.io.*; import org.apache.pdfbox.exceptions.*; import org.apache.pdfbox.pdmodel.encryption.*;
[ "java.io", "org.apache.pdfbox" ]
java.io; org.apache.pdfbox;
1,387,764
public void setRangeToOne(int firstBitIndex, int count) { int startByteIndex = BitVectorHelper.byteIndex(firstBitIndex); final int lastBitIndex = firstBitIndex + count; final int endByteIndex = BitVectorHelper.byteIndex(lastBitIndex); final int startByteBitIndex = BitVectorHelper.bitIndex(firstBitIndex); final int endBytebitIndex = BitVectorHelper.bitIndex(lastBitIndex); if (count < 8 && startByteIndex == endByteIndex) { // handles the case where we don't have a first and a last byte byte bitMask = 0; for (int i = startByteBitIndex; i < endBytebitIndex; ++i) { bitMask |= (byte) (1L << i); } BitVectorHelper.setBitMaskedByte(validityBuffer, startByteIndex, bitMask); BitVectorHelper.setBitMaskedByte(valueBuffer, startByteIndex, bitMask); } else { // fill in first byte (if it's not full) if (startByteBitIndex != 0) { final byte bitMask = (byte) (0xFFL << startByteBitIndex); BitVectorHelper.setBitMaskedByte(validityBuffer, startByteIndex, bitMask); BitVectorHelper.setBitMaskedByte(valueBuffer, startByteIndex, bitMask); ++startByteIndex; } // fill in one full byte at a time for (int i = startByteIndex; i < endByteIndex; i++) { validityBuffer.setByte(i, 0xFF); valueBuffer.setByte(i, 0xFF); } // fill in the last byte (if it's not full) if (endBytebitIndex != 0) { final int byteIndex = BitVectorHelper.byteIndex(lastBitIndex - endBytebitIndex); final byte bitMask = (byte) (0xFFL >>> ((8 - endBytebitIndex) & 7)); BitVectorHelper.setBitMaskedByte(validityBuffer, byteIndex, bitMask); BitVectorHelper.setBitMaskedByte(valueBuffer, byteIndex, bitMask); } } } /** * Construct a TransferPair comprising of this and and a target vector of * the same type. * * @param ref name of the target vector * @param allocator allocator for the target vector * @return {@link TransferPair}
void function(int firstBitIndex, int count) { int startByteIndex = BitVectorHelper.byteIndex(firstBitIndex); final int lastBitIndex = firstBitIndex + count; final int endByteIndex = BitVectorHelper.byteIndex(lastBitIndex); final int startByteBitIndex = BitVectorHelper.bitIndex(firstBitIndex); final int endBytebitIndex = BitVectorHelper.bitIndex(lastBitIndex); if (count < 8 && startByteIndex == endByteIndex) { byte bitMask = 0; for (int i = startByteBitIndex; i < endBytebitIndex; ++i) { bitMask = (byte) (1L << i); } BitVectorHelper.setBitMaskedByte(validityBuffer, startByteIndex, bitMask); BitVectorHelper.setBitMaskedByte(valueBuffer, startByteIndex, bitMask); } else { if (startByteBitIndex != 0) { final byte bitMask = (byte) (0xFFL << startByteBitIndex); BitVectorHelper.setBitMaskedByte(validityBuffer, startByteIndex, bitMask); BitVectorHelper.setBitMaskedByte(valueBuffer, startByteIndex, bitMask); ++startByteIndex; } for (int i = startByteIndex; i < endByteIndex; i++) { validityBuffer.setByte(i, 0xFF); valueBuffer.setByte(i, 0xFF); } if (endBytebitIndex != 0) { final int byteIndex = BitVectorHelper.byteIndex(lastBitIndex - endBytebitIndex); final byte bitMask = (byte) (0xFFL >>> ((8 - endBytebitIndex) & 7)); BitVectorHelper.setBitMaskedByte(validityBuffer, byteIndex, bitMask); BitVectorHelper.setBitMaskedByte(valueBuffer, byteIndex, bitMask); } } } /** * Construct a TransferPair comprising of this and and a target vector of * the same type. * * @param ref name of the target vector * @param allocator allocator for the target vector * @return {@link TransferPair}
/** * Set count bits to 1 in data starting at firstBitIndex. * * @param firstBitIndex the index of the first bit to set * @param count the number of bits to set */
Set count bits to 1 in data starting at firstBitIndex
setRangeToOne
{ "repo_name": "pcmoritz/arrow", "path": "java/vector/src/main/java/org/apache/arrow/vector/BitVector.java", "license": "apache-2.0", "size": 18911 }
[ "org.apache.arrow.vector.util.TransferPair" ]
import org.apache.arrow.vector.util.TransferPair;
import org.apache.arrow.vector.util.*;
[ "org.apache.arrow" ]
org.apache.arrow;
713,760
public static Test suite() { TestSuite suite = new TestSuite("DataSourceSerializationTest"); String filePrefix = "functionTests/testData/serializedDataSources/"; // De-serialize embedded data sources only if we have the engine code. if (Derby.hasEmbedded()) { suite.addTest(new DataSourceSerializationTest( "serTestEmbeddedDataSource")); suite.addTest(new DataSourceSerializationTest( "serTestEmbeddedConnectionPoolDataSource")); suite.addTest(new DataSourceSerializationTest( "serTestEmbeddedXADataSource")); } // De-serialize client data sources only if we have the client code. if (Derby.hasClient()) { suite.addTest(new DataSourceSerializationTest( "serTestClientDataSource")); suite.addTest(new DataSourceSerializationTest( "serTestClientConnectionPoolDataSource")); suite.addTest(new DataSourceSerializationTest( "serTestClientXADataSource")); } return new SupportFilesSetup(suite, new String[] { // 10.0 resources filePrefix + "EmbeddedDataSource-10_0_2_1.ser", filePrefix + "EmbeddedConnectionPoolDataSource-10_0_2_1.ser", filePrefix + "EmbeddedXADataSource-10_0_2_1.ser", // 10.1 resources filePrefix + "EmbeddedDataSource-10_1_3_1.ser", filePrefix + "EmbeddedConnectionPoolDataSource-10_1_3_1.ser", filePrefix + "EmbeddedXADataSource-10_1_3_1.ser", filePrefix + "ClientDataSource-10_1_3_1.ser", filePrefix + "ClientConnectionPoolDataSource-10_1_3_1.ser", filePrefix + "ClientXADataSource-10_1_3_1.ser", // 10.2 resources filePrefix + "EmbeddedDataSource-10_2_2_0.ser", filePrefix + "EmbeddedConnectionPoolDataSource-10_2_2_0.ser", filePrefix + "EmbeddedXADataSource-10_2_2_0.ser", filePrefix + "ClientDataSource-10_2_2_0.ser", filePrefix + "ClientConnectionPoolDataSource-10_2_2_0.ser", filePrefix + "ClientXADataSource-10_2_2_0.ser", // 10.3 resources filePrefix + "EmbeddedDataSource-10_3_2_1.ser", filePrefix + "EmbeddedConnectionPoolDataSource-10_3_2_1.ser", filePrefix + "EmbeddedXADataSource-10_3_2_1.ser", filePrefix + "ClientDataSource-10_3_2_1.ser", filePrefix + "ClientConnectionPoolDataSource-10_3_2_1.ser", filePrefix + "ClientXADataSource-10_3_2_1.ser", }); }
static Test function() { TestSuite suite = new TestSuite(STR); String filePrefix = STR; if (Derby.hasEmbedded()) { suite.addTest(new DataSourceSerializationTest( STR)); suite.addTest(new DataSourceSerializationTest( STR)); suite.addTest(new DataSourceSerializationTest( STR)); } if (Derby.hasClient()) { suite.addTest(new DataSourceSerializationTest( STR)); suite.addTest(new DataSourceSerializationTest( STR)); suite.addTest(new DataSourceSerializationTest( STR)); } return new SupportFilesSetup(suite, new String[] { filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, filePrefix + STR, }); }
/** * Returns an appropariate suite of tests to run. * * @return A test suite. */
Returns an appropariate suite of tests to run
suite
{ "repo_name": "lpxz/grail-derby104", "path": "java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DataSourceSerializationTest.java", "license": "apache-2.0", "size": 12575 }
[ "junit.framework.Test", "junit.framework.TestSuite", "org.apache.derbyTesting.junit.Derby", "org.apache.derbyTesting.junit.SupportFilesSetup" ]
import junit.framework.Test; import junit.framework.TestSuite; import org.apache.derbyTesting.junit.Derby; import org.apache.derbyTesting.junit.SupportFilesSetup;
import junit.framework.*; import org.apache.*;
[ "junit.framework", "org.apache" ]
junit.framework; org.apache;
1,185,678