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
|
---|---|---|---|---|---|---|---|---|---|---|---|
List<MqttGrantedQoS> authSubscribe(String clientId, String userName, List<MqttTopicSubscription> requestSubscriptions); | List<MqttGrantedQoS> authSubscribe(String clientId, String userName, List<MqttTopicSubscription> requestSubscriptions); | /**
* Authorize client SUBSCRIBE
*
* @param clientId Client Id
* @param userName User Name
* @param requestSubscriptions List of request Topic Subscription
* @return List of granted QoS
*/ | Authorize client SUBSCRIBE | authSubscribe | {
"repo_name": "12315jack/j1st-mqtt",
"path": "j1st-mqtt-api/src/main/java/com/github/j1stiot/mqtt/api/auth/Authenticator.java",
"license": "apache-2.0",
"size": 1715
} | [
"io.netty.handler.codec.mqtt.MqttGrantedQoS",
"io.netty.handler.codec.mqtt.MqttTopicSubscription",
"java.util.List"
] | import io.netty.handler.codec.mqtt.MqttGrantedQoS; import io.netty.handler.codec.mqtt.MqttTopicSubscription; import java.util.List; | import io.netty.handler.codec.mqtt.*; import java.util.*; | [
"io.netty.handler",
"java.util"
] | io.netty.handler; java.util; | 320,655 |
private void verifyAddedVertexRest(RexsterGraph abGraph) throws JSONException {
final Iterable<Vertex> abVertices = abGraph.getVertices();
final Iterator abIt = abVertices.iterator();
final Vertex abAndy = (Vertex) abIt.next();
assertFalse(abIt.hasNext());
final JSONArray abOccupationValues = abAndy.getProperty(OCCUPATION_PROPERTY_KEY);
assertEquals(2, abOccupationValues.length());
final Set<String> occupations = new HashSet();
occupations.add(
abOccupationValues.getJSONObject(0).getJSONObject(VALUE_KEY).getJSONObject(VALUE_KEY).getString(
VALUE_KEY));
occupations.add(
abOccupationValues.getJSONObject(1).getJSONObject(VALUE_KEY).getJSONObject(VALUE_KEY).getString(
VALUE_KEY));
final Set<String> expected = Sets.newHashSet(OCCUPATION_PROPVALUE_1, OCCUPATION_PROPVALUE_2);
assertEquals(expected, occupations);
final RexsterGraph aGraph = new RexsterGraph(
RexsterTestUtils.getGraphUrl(graphName), 1, aToken, RexsterTestUtils.ANY_NON_BLANK_PASSWORD);
final Iterable<Vertex> aVertices = aGraph.getVertices();
final Iterator aIt = aVertices.iterator();
final Vertex aAndy = (Vertex) aIt.next();
assertFalse(aIt.hasNext());
final JSONArray uOccupationValues = aAndy.getProperty(OCCUPATION_PROPERTY_KEY);
assertEquals(1, uOccupationValues.length());
assertEquals(
OCCUPATION_PROPVALUE_1,
uOccupationValues.getJSONObject(0).getJSONObject(VALUE_KEY).getJSONObject(VALUE_KEY).getString(
VALUE_KEY));
} | void function(RexsterGraph abGraph) throws JSONException { final Iterable<Vertex> abVertices = abGraph.getVertices(); final Iterator abIt = abVertices.iterator(); final Vertex abAndy = (Vertex) abIt.next(); assertFalse(abIt.hasNext()); final JSONArray abOccupationValues = abAndy.getProperty(OCCUPATION_PROPERTY_KEY); assertEquals(2, abOccupationValues.length()); final Set<String> occupations = new HashSet(); occupations.add( abOccupationValues.getJSONObject(0).getJSONObject(VALUE_KEY).getJSONObject(VALUE_KEY).getString( VALUE_KEY)); occupations.add( abOccupationValues.getJSONObject(1).getJSONObject(VALUE_KEY).getJSONObject(VALUE_KEY).getString( VALUE_KEY)); final Set<String> expected = Sets.newHashSet(OCCUPATION_PROPVALUE_1, OCCUPATION_PROPVALUE_2); assertEquals(expected, occupations); final RexsterGraph aGraph = new RexsterGraph( RexsterTestUtils.getGraphUrl(graphName), 1, aToken, RexsterTestUtils.ANY_NON_BLANK_PASSWORD); final Iterable<Vertex> aVertices = aGraph.getVertices(); final Iterator aIt = aVertices.iterator(); final Vertex aAndy = (Vertex) aIt.next(); assertFalse(aIt.hasNext()); final JSONArray uOccupationValues = aAndy.getProperty(OCCUPATION_PROPERTY_KEY); assertEquals(1, uOccupationValues.length()); assertEquals( OCCUPATION_PROPVALUE_1, uOccupationValues.getJSONObject(0).getJSONObject(VALUE_KEY).getJSONObject(VALUE_KEY).getString( VALUE_KEY)); } | /**
* Use Rexster's rest interface to read a canned vertex from the the backend (for reads using Gremlin, see {@code
* verifyAddedVertexRexPro()}.) Does basically the same thing as {@code verifyAddedVertexRexPro()}.
*
* @param abGraph Reuses a graph with A+B auths, if possible.
*/ | Use Rexster's rest interface to read a canned vertex from the the backend (for reads using Gremlin, see verifyAddedVertexRexPro().) Does basically the same thing as verifyAddedVertexRexPro() | verifyAddedVertexRest | {
"repo_name": "infochimps-forks/ezbake-data-access",
"path": "ezgraph/rexster-server/src/test/java/ezbake/data/graph/rexster/VisibilityFilterGraphWrapperIntegrationTest.java",
"license": "apache-2.0",
"size": 16453
} | [
"com.google.common.collect.Sets",
"com.tinkerpop.blueprints.Vertex",
"com.tinkerpop.blueprints.impls.rexster.RexsterGraph",
"java.util.HashSet",
"java.util.Iterator",
"java.util.Set",
"org.codehaus.jettison.json.JSONArray",
"org.codehaus.jettison.json.JSONException",
"org.junit.Assert"
] | import com.google.common.collect.Sets; import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints.impls.rexster.RexsterGraph; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import org.codehaus.jettison.json.JSONArray; import org.codehaus.jettison.json.JSONException; import org.junit.Assert; | import com.google.common.collect.*; import com.tinkerpop.blueprints.*; import com.tinkerpop.blueprints.impls.rexster.*; import java.util.*; import org.codehaus.jettison.json.*; import org.junit.*; | [
"com.google.common",
"com.tinkerpop.blueprints",
"java.util",
"org.codehaus.jettison",
"org.junit"
] | com.google.common; com.tinkerpop.blueprints; java.util; org.codehaus.jettison; org.junit; | 1,515,735 |
void save(Alert alert); | void save(Alert alert); | /**
* Saves an alert.
* @param alert The alert to save.
*/ | Saves an alert | save | {
"repo_name": "SEEG-Oxford/ABRAID-MP",
"path": "src/Common/src/uk/ac/ox/zoo/seeg/abraid/mp/common/dao/AlertDao.java",
"license": "apache-2.0",
"size": 740
} | [
"uk.ac.ox.zoo.seeg.abraid.mp.common.domain.Alert"
] | import uk.ac.ox.zoo.seeg.abraid.mp.common.domain.Alert; | import uk.ac.ox.zoo.seeg.abraid.mp.common.domain.*; | [
"uk.ac.ox"
] | uk.ac.ox; | 633,963 |
void enterVariableDeclarator(@NotNull JavaParser.VariableDeclaratorContext ctx);
void exitVariableDeclarator(@NotNull JavaParser.VariableDeclaratorContext ctx); | void enterVariableDeclarator(@NotNull JavaParser.VariableDeclaratorContext ctx); void exitVariableDeclarator(@NotNull JavaParser.VariableDeclaratorContext ctx); | /**
* Exit a parse tree produced by {@link JavaParser#variableDeclarator}.
* @param ctx the parse tree
*/ | Exit a parse tree produced by <code>JavaParser#variableDeclarator</code> | exitVariableDeclarator | {
"repo_name": "code4craft/daogen",
"path": "daogen-core/src/main/java/com/dianping/daogen/antlr/JavaListener.java",
"license": "mit",
"size": 38983
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 2,470,286 |
ArgumentChecker.isTrue(instrument instanceof SwaptionPhysicalFixedIbor, "Calibration instruments should be swaptions");
getBasket().add(instrument);
getMethod().add(method);
getCalibrationPrice().add(0.0);
_calibrationTimes.add(((SwaptionPhysicalFixedIbor) instrument).getTimeToExpiry());
} | ArgumentChecker.isTrue(instrument instanceof SwaptionPhysicalFixedIbor, STR); getBasket().add(instrument); getMethod().add(method); getCalibrationPrice().add(0.0); _calibrationTimes.add(((SwaptionPhysicalFixedIbor) instrument).getTimeToExpiry()); } | /**
* Add an instrument to the basket and the associated calculator.
* @param instrument An interest rate derivative.
* @param method A calculator.
*/ | Add an instrument to the basket and the associated calculator | addInstrument | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/interestrate/swaption/method/SwaptionPhysicalHullWhiteSuccessiveRootFinderCalibrationEngine.java",
"license": "apache-2.0",
"size": 3426
} | [
"com.opengamma.analytics.financial.interestrate.swaption.derivative.SwaptionPhysicalFixedIbor",
"com.opengamma.util.ArgumentChecker"
] | import com.opengamma.analytics.financial.interestrate.swaption.derivative.SwaptionPhysicalFixedIbor; import com.opengamma.util.ArgumentChecker; | import com.opengamma.analytics.financial.interestrate.swaption.derivative.*; import com.opengamma.util.*; | [
"com.opengamma.analytics",
"com.opengamma.util"
] | com.opengamma.analytics; com.opengamma.util; | 2,003,013 |
public Object[] getKeys(Object[] keys) {
if (table == null) {
return null;
}
if (isArray()) {
Object[] array = (Object[])table;
if (keys == null) {
keys = new Object[array.length / 2];
}
for (int i = 0, index = 0 ;i < array.length-1 ; i+=2,
index++) {
keys[index] = array[i];
}
} else {
Hashtable<?,?> tmp = (Hashtable)table;
Enumeration<?> enum_ = tmp.keys();
int counter = tmp.size();
if (keys == null) {
keys = new Object[counter];
}
while (counter > 0) {
keys[--counter] = enum_.nextElement();
}
}
return keys;
} | Object[] function(Object[] keys) { if (table == null) { return null; } if (isArray()) { Object[] array = (Object[])table; if (keys == null) { keys = new Object[array.length / 2]; } for (int i = 0, index = 0 ;i < array.length-1 ; i+=2, index++) { keys[index] = array[i]; } } else { Hashtable<?,?> tmp = (Hashtable)table; Enumeration<?> enum_ = tmp.keys(); int counter = tmp.size(); if (keys == null) { keys = new Object[counter]; } while (counter > 0) { keys[--counter] = enum_.nextElement(); } } return keys; } | /**
* Returns the keys of the table, or <code>null</code> if there
* are currently no bindings.
* @param keys array of keys
* @return an array of bindings
*/ | Returns the keys of the table, or <code>null</code> if there are currently no bindings | getKeys | {
"repo_name": "shun634501730/java_source_cn",
"path": "src_en/javax/swing/ArrayTable.java",
"license": "apache-2.0",
"size": 10193
} | [
"java.util.Enumeration",
"java.util.Hashtable"
] | import java.util.Enumeration; import java.util.Hashtable; | import java.util.*; | [
"java.util"
] | java.util; | 955,201 |
public AWSDeviceFarm withLogger(PrintStream logger) {
this.log = logger;
return this;
} | AWSDeviceFarm function(PrintStream logger) { this.log = logger; return this; } | /**
* Logger setter.
*
* @param logger The log print stream.
* @return The AWSDeviceFarm object.
*/ | Logger setter | withLogger | {
"repo_name": "anurag1408/aws-device-farm-jenkins-plugin",
"path": "src/main/java/org/jenkinsci/plugins/awsdevicefarm/AWSDeviceFarm.java",
"license": "apache-2.0",
"size": 33278
} | [
"java.io.PrintStream"
] | import java.io.PrintStream; | import java.io.*; | [
"java.io"
] | java.io; | 193,417 |
public void syncPersistNewDirectory(InodeDirectory dir)
throws InvalidPathException, FileDoesNotExistException, IOException {
Preconditions.checkState(!mInodes.containsId(dir.getId()));
dir.setPersistenceState(PersistenceState.TO_BE_PERSISTED);
syncPersistDirectory(dir).ifPresent(status -> {
// If the directory already exists in the UFS, update our metadata to match the UFS.
dir.setOwner(status.getOwner())
.setGroup(status.getGroup())
.setMode(status.getMode());
Long lastModificationTime = status.getLastModifiedTime();
if (lastModificationTime != null) {
dir.setLastModificationTimeMs(lastModificationTime, true);
}
});
dir.setPersistenceState(PersistenceState.PERSISTED);
} | void function(InodeDirectory dir) throws InvalidPathException, FileDoesNotExistException, IOException { Preconditions.checkState(!mInodes.containsId(dir.getId())); dir.setPersistenceState(PersistenceState.TO_BE_PERSISTED); syncPersistDirectory(dir).ifPresent(status -> { dir.setOwner(status.getOwner()) .setGroup(status.getGroup()) .setMode(status.getMode()); Long lastModificationTime = status.getLastModifiedTime(); if (lastModificationTime != null) { dir.setLastModificationTimeMs(lastModificationTime, true); } }); dir.setPersistenceState(PersistenceState.PERSISTED); } | /**
* Synchronously persists an {@link InodeDirectory} to the UFS.
*
* This method does not handle concurrent modification to the given inode, so the inode must not
* yet be added to the inode tree.
*
* @param dir the {@link InodeDirectory} to persist
*/ | Synchronously persists an <code>InodeDirectory</code> to the UFS. This method does not handle concurrent modification to the given inode, so the inode must not yet be added to the inode tree | syncPersistNewDirectory | {
"repo_name": "Reidddddd/alluxio",
"path": "core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java",
"license": "apache-2.0",
"size": 45668
} | [
"com.google.common.base.Preconditions",
"java.io.IOException"
] | import com.google.common.base.Preconditions; import java.io.IOException; | import com.google.common.base.*; import java.io.*; | [
"com.google.common",
"java.io"
] | com.google.common; java.io; | 2,526,186 |
void deserialize(DataInputStream in) throws IOException; | void deserialize(DataInputStream in) throws IOException; | /**
* Read object field from the input stream.
* @param in Input stream
* @throws IOException
*/ | Read object field from the input stream | deserialize | {
"repo_name": "mwohlert/vcardio",
"path": "app/src/main/java/com/funambol/storage/Serializable.java",
"license": "gpl-3.0",
"size": 2415
} | [
"java.io.DataInputStream",
"java.io.IOException"
] | import java.io.DataInputStream; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,864,738 |
public Observable<ServiceResponse<ExpressRouteCircuitStatsInner>> getPeeringStatsWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (circuitName == null) {
throw new IllegalArgumentException("Parameter circuitName is required and cannot be null.");
}
if (peeringName == null) {
throw new IllegalArgumentException("Parameter peeringName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
} | Observable<ServiceResponse<ExpressRouteCircuitStatsInner>> function(String resourceGroupName, String circuitName, String peeringName) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (circuitName == null) { throw new IllegalArgumentException(STR); } if (peeringName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } | /**
* Gets all stats from an express route circuit in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param circuitName The name of the express route circuit.
* @param peeringName The name of the peering.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRouteCircuitStatsInner object
*/ | Gets all stats from an express route circuit in a resource group | getPeeringStatsWithServiceResponseAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_11_01/src/main/java/com/microsoft/azure/management/network/v2019_11_01/implementation/ExpressRouteCircuitsInner.java",
"license": "mit",
"size": 117005
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 1,227,893 |
@JsonIgnore
public SLAEvent.EventStatus getEventStatus() {
return eventStatus;
} | SLAEvent.EventStatus function() { return eventStatus; } | /**
* Get event status
*
* @return event status
*/ | Get event status | getEventStatus | {
"repo_name": "terrancesnyder/oozie-hadoop2",
"path": "client/src/main/java/org/apache/oozie/client/event/message/SLAMessage.java",
"license": "apache-2.0",
"size": 9345
} | [
"org.apache.oozie.client.event.SLAEvent"
] | import org.apache.oozie.client.event.SLAEvent; | import org.apache.oozie.client.event.*; | [
"org.apache.oozie"
] | org.apache.oozie; | 807,795 |
@Parameters(name = "{index}: {0}")
public static final Format[] params() {
return Format.values();
}
private static final int ORIGINAL_RGBA = 0x22446680;
private final Format format;
public PixmapPremultiplyTest(Format format) {
this.format = format;
} | @Parameters(name = STR) static final Format[] function() { return Format.values(); } private static final int ORIGINAL_RGBA = 0x22446680; private final Format format; public PixmapPremultiplyTest(Format format) { this.format = format; } | /**
* Run this test for every libGDX pixmap format.
*/ | Run this test for every libGDX pixmap format | params | {
"repo_name": "anonl/nvlist",
"path": "core/src/test/java/nl/weeaboo/vn/gdx/graphics/PixmapPremultiplyTest.java",
"license": "apache-2.0",
"size": 2164
} | [
"com.badlogic.gdx.graphics.Pixmap",
"org.junit.runners.Parameterized"
] | import com.badlogic.gdx.graphics.Pixmap; import org.junit.runners.Parameterized; | import com.badlogic.gdx.graphics.*; import org.junit.runners.*; | [
"com.badlogic.gdx",
"org.junit.runners"
] | com.badlogic.gdx; org.junit.runners; | 72,791 |
public void paste(SpriteInfoBlock newsib)
{
if (newsib == null)
return;
if (this.numSprites != newsib.numSprites)
{
if (JOptionPane.showConfirmDialog(null,
"The number of sprites in the "
+ "copied SPT entry does not match\n"
+ "the number of sprites in "
+ "this SPT entry. Continue anyway?", "Error!",
JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION)
return;
}
for (int i = 0; i < address.length; i++)
{
this.address[i] = newsib.address[i];
}
this.bank = newsib.bank;
this.height = newsib.height;
this.width = newsib.width;
// this.name = new String(newsib.name);
// this.num = newsib.num;
// this.numSprites = newsib.numSprites;
this.palette = newsib.palette;
// this.pointer =newsib.pointer;
for (int i = 0; i < unknown.length; i++)
{
this.unknown[i] = newsib.unknown[i];
}
}
} | void function(SpriteInfoBlock newsib) { if (newsib == null) return; if (this.numSprites != newsib.numSprites) { if (JOptionPane.showConfirmDialog(null, STR + STR + STR + STR, STR, JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) return; } for (int i = 0; i < address.length; i++) { this.address[i] = newsib.address[i]; } this.bank = newsib.bank; this.height = newsib.height; this.width = newsib.width; this.palette = newsib.palette; for (int i = 0; i < unknown.length; i++) { this.unknown[i] = newsib.unknown[i]; } } } | /**
* Changes the values in this to the values in the specified
* SpriteInfoBlock
*
* @param newsib SpriteInfoBlock to paste values of
*/ | Changes the values in this to the values in the specified SpriteInfoBlock | paste | {
"repo_name": "dperelman/jhack",
"path": "src/net/starmen/pkhack/eb/SpriteEditor.java",
"license": "gpl-3.0",
"size": 53554
} | [
"javax.swing.JOptionPane"
] | import javax.swing.JOptionPane; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 710,943 |
private EpsonProjectorBindingProvider findFirstMatchingBindingProvider(
String itemName, Command command) {
EpsonProjectorBindingProvider firstMatchingProvider = null;
for (EpsonProjectorBindingProvider provider : this.providers) {
EpsonProjectorCommandType commmandType = provider.getCommandType(itemName);
if (commmandType != null) {
firstMatchingProvider = provider;
break;
}
}
return firstMatchingProvider;
} | EpsonProjectorBindingProvider function( String itemName, Command command) { EpsonProjectorBindingProvider firstMatchingProvider = null; for (EpsonProjectorBindingProvider provider : this.providers) { EpsonProjectorCommandType commmandType = provider.getCommandType(itemName); if (commmandType != null) { firstMatchingProvider = provider; break; } } return firstMatchingProvider; } | /**
* Find the first matching {@link ExecBindingProvider} according to
* <code>itemName</code> and <code>command</code>. If no direct match is
* found, a second match is issued with wilcard-command '*'.
*
* @param itemName
* @param command
*
* @return the matching binding provider or <code>null</code> if no binding
* provider could be found
*/ | Find the first matching <code>ExecBindingProvider</code> according to <code>itemName</code> and <code>command</code>. If no direct match is found, a second match is issued with wilcard-command '*' | findFirstMatchingBindingProvider | {
"repo_name": "noushadali/openhab",
"path": "bundles/binding/org.openhab.binding.epsonprojector/src/main/java/org/openhab/binding/epsonprojector/internal/EpsonProjectorBinding.java",
"license": "gpl-3.0",
"size": 20557
} | [
"org.openhab.binding.epsonprojector.EpsonProjectorBindingProvider",
"org.openhab.core.types.Command"
] | import org.openhab.binding.epsonprojector.EpsonProjectorBindingProvider; import org.openhab.core.types.Command; | import org.openhab.binding.epsonprojector.*; import org.openhab.core.types.*; | [
"org.openhab.binding",
"org.openhab.core"
] | org.openhab.binding; org.openhab.core; | 563,192 |
public static stanModelIDType fromPerAligned(byte[] encodedBytes) {
stanModelIDType result = new stanModelIDType();
result.decodePerAligned(new BitStreamReader(encodedBytes));
return result;
} | static stanModelIDType function(byte[] encodedBytes) { stanModelIDType result = new stanModelIDType(); result.decodePerAligned(new BitStreamReader(encodedBytes)); return result; } | /**
* Creates a new stanModelIDType from encoded stream.
*/ | Creates a new stanModelIDType from encoded stream | fromPerAligned | {
"repo_name": "google/supl-client",
"path": "src/main/java/com/google/location/suplclient/asn1/supl2/rrlp_components/StandardClockModelElementV12.java",
"license": "apache-2.0",
"size": 27908
} | [
"com.google.location.suplclient.asn1.base.BitStreamReader"
] | import com.google.location.suplclient.asn1.base.BitStreamReader; | import com.google.location.suplclient.asn1.base.*; | [
"com.google.location"
] | com.google.location; | 1,306,852 |
private void readInputFiles(StringTokenizer line){
String new_line = line.nextToken(); //We read the input data line
StringTokenizer data = new StringTokenizer(new_line, " = \" ");
data.nextToken(); //inputFile
trainingFile = data.nextToken();
validationFile = data.nextToken();
testFile = data.nextToken();
while(data.hasMoreTokens()){
inputFiles.add(data.nextToken());
}
}
| void function(StringTokenizer line){ String new_line = line.nextToken(); StringTokenizer data = new StringTokenizer(new_line, STR "); data.nextToken(); trainingFile = data.nextToken(); validationFile = data.nextToken(); testFile = data.nextToken(); while(data.hasMoreTokens()){ inputFiles.add(data.nextToken()); } } | /**
* We read the input data-set files and all the possible input files
* @param line StringTokenizer It is the line containing the input files.
*/ | We read the input data-set files and all the possible input files | readInputFiles | {
"repo_name": "SCI2SUGR/KEEL",
"path": "src/keel/Algorithms/RE_SL_Postprocess/Post_A_T_Lateral_FRBSs/parseParameters.java",
"license": "gpl-3.0",
"size": 9483
} | [
"java.util.StringTokenizer"
] | import java.util.StringTokenizer; | import java.util.*; | [
"java.util"
] | java.util; | 679,901 |
public void connectionFailed(String errorMsg) {
if (Platform.getInstance().isLoggingEnabled()) Log.d(TAG, "Connection Failed");
//ToastTracker.showToast("xmpp connection failed");
// mService.stopSelf();
}
| void function(String errorMsg) { if (Platform.getInstance().isLoggingEnabled()) Log.d(TAG, STR); } | /**
* Connection failed callback.
* @param errorMsg smack failure message
*/ | Connection failed callback | connectionFailed | {
"repo_name": "arpit87/SBProd",
"path": "Hopin/src/in/co/hopin/ChatService/XMPPConnectionListenersAdapter.java",
"license": "lgpl-3.0",
"size": 14252
} | [
"android.util.Log",
"in.co.hopin.Platform"
] | import android.util.Log; import in.co.hopin.Platform; | import android.util.*; import in.co.hopin.*; | [
"android.util",
"in.co.hopin"
] | android.util; in.co.hopin; | 2,113,080 |
private void getGroups(String docPath) {
Main.get().mainPanel.desktop.browser.tabMultiple.status.setGroupProperties();
propertyGroupService.getGroups(docPath, callbackGetGroups);
}
| void function(String docPath) { Main.get().mainPanel.desktop.browser.tabMultiple.status.setGroupProperties(); propertyGroupService.getGroups(docPath, callbackGetGroups); } | /**
* Gets all property groups assigned to document
*/ | Gets all property groups assigned to document | getGroups | {
"repo_name": "papamas/DMS-KANGREG-XI-MANADO",
"path": "src/main/java/com/openkm/frontend/client/widget/properties/TabDocument.java",
"license": "gpl-3.0",
"size": 19924
} | [
"com.openkm.frontend.client.Main"
] | import com.openkm.frontend.client.Main; | import com.openkm.frontend.client.*; | [
"com.openkm.frontend"
] | com.openkm.frontend; | 1,322,572 |
public EmptyListHLAPI getContainerEmptyListHLAPI(){
if(item.getContainerEmptyList() == null) return null;
return new EmptyListHLAPI(item.getContainerEmptyList());
}
| EmptyListHLAPI function(){ if(item.getContainerEmptyList() == null) return null; return new EmptyListHLAPI(item.getContainerEmptyList()); } | /**
* This accessor automatically encapsulate an element of the current object.
* WARNING : this creates a new object in memory.
* @return : null if the element is null
*/ | This accessor automatically encapsulate an element of the current object. WARNING : this creates a new object in memory | getContainerEmptyListHLAPI | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/finiteIntRanges/hlapi/FiniteIntRangeHLAPI.java",
"license": "epl-1.0",
"size": 21672
} | [
"fr.lip6.move.pnml.hlpn.lists.hlapi.EmptyListHLAPI"
] | import fr.lip6.move.pnml.hlpn.lists.hlapi.EmptyListHLAPI; | import fr.lip6.move.pnml.hlpn.lists.hlapi.*; | [
"fr.lip6.move"
] | fr.lip6.move; | 2,475,236 |
LastPostInfo getLastPostInfo(int forumId) ;
/**
* Get all moderators of some forum
* @param forumId the forum's id to inspect
* @return a list with all moderators. Each entry is an instance of
* {@link net.jforum.entities.ModeratorInfo} | LastPostInfo getLastPostInfo(int forumId) ; /** * Get all moderators of some forum * @param forumId the forum's id to inspect * @return a list with all moderators. Each entry is an instance of * {@link net.jforum.entities.ModeratorInfo} | /**
* Gets information about the latest message posted in some forum.
*
* @param forumId the forum's id to inspect
* @return A {@link LastPostInfo} instance
*/ | Gets information about the latest message posted in some forum | getLastPostInfo | {
"repo_name": "3mtee/jforum",
"path": "target/jforum/src/main/java/net/jforum/dao/ForumDAO.java",
"license": "bsd-3-clause",
"size": 7875
} | [
"net.jforum.entities.LastPostInfo",
"net.jforum.entities.ModeratorInfo"
] | import net.jforum.entities.LastPostInfo; import net.jforum.entities.ModeratorInfo; | import net.jforum.entities.*; | [
"net.jforum.entities"
] | net.jforum.entities; | 855,623 |
public boolean find(Category category, long languageId, boolean live, String orderBy, User user, boolean respectFrontendRoles); | boolean function(Category category, long languageId, boolean live, String orderBy, User user, boolean respectFrontendRoles); | /**
* Will return all content assigned to a specified Category
* @param category Category to look for
* @param languageId language to pull content for. If 0 will return all languages
* @param live should return live or working content
* @param orderBy indexName(previously known as dbColumnName) to order by. Can be null or empty string
* @param user
* @param respectFrontendRoles
* @return
*/ | Will return all content assigned to a specified Category | find | {
"repo_name": "jtesser/core-2.x",
"path": "src/com/dotmarketing/portlets/contentlet/business/ContentletAPIPreHook.java",
"license": "gpl-3.0",
"size": 46259
} | [
"com.dotmarketing.portlets.categories.model.Category",
"com.liferay.portal.model.User"
] | import com.dotmarketing.portlets.categories.model.Category; import com.liferay.portal.model.User; | import com.dotmarketing.portlets.categories.model.*; import com.liferay.portal.model.*; | [
"com.dotmarketing.portlets",
"com.liferay.portal"
] | com.dotmarketing.portlets; com.liferay.portal; | 2,427,072 |
EAttribute getMandatoryManyTransition_Val(); | EAttribute getMandatoryManyTransition_Val(); | /**
* Returns the meta object for the attribute '{@link org.eclipse.xtext.serializer.syntacticsequencertest.MandatoryManyTransition#getVal <em>Val</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Val</em>'.
* @see org.eclipse.xtext.serializer.syntacticsequencertest.MandatoryManyTransition#getVal()
* @see #getMandatoryManyTransition()
* @generated
*/ | Returns the meta object for the attribute '<code>org.eclipse.xtext.serializer.syntacticsequencertest.MandatoryManyTransition#getVal Val</code>'. | getMandatoryManyTransition_Val | {
"repo_name": "miklossy/xtext-core",
"path": "org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/serializer/syntacticsequencertest/SyntacticsequencertestPackage.java",
"license": "epl-1.0",
"size": 94105
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,616,627 |
@SuppressWarnings({ "unchecked", "rawtypes" })
private void parseOrderDefined() {
orderDefined = false;
OrderBy orderBy = null;
if (Is.empty(orderProperty)) {
try {
Field collectionField = parentClass.getDeclaredField(collectionName);
if (collectionField.isAnnotationPresent(OrderBy.class)) {
orderBy = collectionField.getAnnotation(OrderBy.class);
}
} catch (SecurityException e) {
log.error(e);
} catch (NoSuchFieldException e) {
log.debug(e.getMessage());
}
if (orderBy == null){
Method collectionMethod = null;
try {
collectionMethod = parentClass.getDeclaredMethod("get" + Strings.firstUpper(collectionName), new Class[]{});
} catch (Exception e) {
log.debug(e);
}
if (collectionMethod == null){
try {
collectionMethod = parentClass.getDeclaredMethod("is" + Strings.firstUpper(collectionName), new Class[]{});
} catch (Exception e) {
log.debug(e);
}
}
if (collectionMethod != null && collectionMethod.isAnnotationPresent(OrderBy.class)) {
orderBy = collectionMethod.getAnnotation(OrderBy.class);
}
}
if (orderBy != null){
String [] fieldNames = orderBy.value().split(",");
if (fieldNames.length > 0) {
orderProperty = fieldNames[fieldNames.length - 1].trim();
}
}
}
if (!Is.empty(orderProperty)) {
try {
Object itemObject = nodeClass.newInstance();
Class propertyType = PropertyUtils.getPropertyType(itemObject, orderProperty);
if (propertyType.isAssignableFrom(Integer.class)) {
orderDefined = true;
}
} catch (IllegalAccessException e) {
log.error(e);
} catch (InvocationTargetException e) {
log.error(e);
} catch (NoSuchMethodException e) {
log.error(e);
} catch (Exception e) {
log.error(e);
}
}
} | @SuppressWarnings({ STR, STR }) void function() { orderDefined = false; OrderBy orderBy = null; if (Is.empty(orderProperty)) { try { Field collectionField = parentClass.getDeclaredField(collectionName); if (collectionField.isAnnotationPresent(OrderBy.class)) { orderBy = collectionField.getAnnotation(OrderBy.class); } } catch (SecurityException e) { log.error(e); } catch (NoSuchFieldException e) { log.debug(e.getMessage()); } if (orderBy == null){ Method collectionMethod = null; try { collectionMethod = parentClass.getDeclaredMethod("get" + Strings.firstUpper(collectionName), new Class[]{}); } catch (Exception e) { log.debug(e); } if (collectionMethod == null){ try { collectionMethod = parentClass.getDeclaredMethod("is" + Strings.firstUpper(collectionName), new Class[]{}); } catch (Exception e) { log.debug(e); } } if (collectionMethod != null && collectionMethod.isAnnotationPresent(OrderBy.class)) { orderBy = collectionMethod.getAnnotation(OrderBy.class); } } if (orderBy != null){ String [] fieldNames = orderBy.value().split(","); if (fieldNames.length > 0) { orderProperty = fieldNames[fieldNames.length - 1].trim(); } } } if (!Is.empty(orderProperty)) { try { Object itemObject = nodeClass.newInstance(); Class propertyType = PropertyUtils.getPropertyType(itemObject, orderProperty); if (propertyType.isAssignableFrom(Integer.class)) { orderDefined = true; } } catch (IllegalAccessException e) { log.error(e); } catch (InvocationTargetException e) { log.error(e); } catch (NoSuchMethodException e) { log.error(e); } catch (Exception e) { log.error(e); } } } | /**
* Determines if the property orderProperty was defined for the object.
*/ | Determines if the property orderProperty was defined for the object | parseOrderDefined | {
"repo_name": "jecuendet/maven4openxava",
"path": "dist/openxava/workspace/OpenXava/src/org/openxava/web/editors/TreeView.java",
"license": "apache-2.0",
"size": 15849
} | [
"java.lang.reflect.Field",
"java.lang.reflect.InvocationTargetException",
"java.lang.reflect.Method",
"javax.persistence.OrderBy",
"org.apache.commons.beanutils.PropertyUtils",
"org.openxava.util.Is",
"org.openxava.util.Strings"
] | import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import javax.persistence.OrderBy; import org.apache.commons.beanutils.PropertyUtils; import org.openxava.util.Is; import org.openxava.util.Strings; | import java.lang.reflect.*; import javax.persistence.*; import org.apache.commons.beanutils.*; import org.openxava.util.*; | [
"java.lang",
"javax.persistence",
"org.apache.commons",
"org.openxava.util"
] | java.lang; javax.persistence; org.apache.commons; org.openxava.util; | 351,893 |
@WebMethod
@WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201403")
@RequestWrapper(localName = "performContentBundleAction", targetNamespace = "https://www.google.com/apis/ads/publisher/v201403", className = "com.google.api.ads.dfp.jaxws.v201403.ContentBundleServiceInterfaceperformContentBundleAction")
@ResponseWrapper(localName = "performContentBundleActionResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201403", className = "com.google.api.ads.dfp.jaxws.v201403.ContentBundleServiceInterfaceperformContentBundleActionResponse")
public UpdateResult performContentBundleAction(
@WebParam(name = "contentBundleAction", targetNamespace = "https://www.google.com/apis/ads/publisher/v201403")
ContentBundleAction contentBundleAction,
@WebParam(name = "filterStatement", targetNamespace = "https://www.google.com/apis/ads/publisher/v201403")
Statement filterStatement)
throws ApiException_Exception
; | @WebResult(name = "rval", targetNamespace = STRperformContentBundleActionSTRhttps: @ResponseWrapper(localName = "performContentBundleActionResponseSTRhttps: UpdateResult function( @WebParam(name = "contentBundleActionSTRhttps: ContentBundleAction contentBundleAction, @WebParam(name = "filterStatementSTRhttps: Statement filterStatement) throws ApiException_Exception ; | /**
*
* Performs actions on {@link ContentBundle} objects that match the given
* {@link Statement#query}.
*
* @param contentBundleAction the action to perform
* @param filterStatement a Publisher Query Language statement used to filter
* a set of content bundles
* @return the result of the action performed
*
*
* @param filterStatement
* @param contentBundleAction
* @return
* returns com.google.api.ads.dfp.jaxws.v201403.UpdateResult
* @throws ApiException_Exception
*/ | Performs actions on <code>ContentBundle</code> objects that match the given <code>Statement#query</code> | performContentBundleAction | {
"repo_name": "nafae/developer",
"path": "modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201403/ContentBundleServiceInterface.java",
"license": "apache-2.0",
"size": 7202
} | [
"javax.jws.WebParam",
"javax.jws.WebResult",
"javax.xml.ws.ResponseWrapper"
] | import javax.jws.WebParam; import javax.jws.WebResult; import javax.xml.ws.ResponseWrapper; | import javax.jws.*; import javax.xml.ws.*; | [
"javax.jws",
"javax.xml"
] | javax.jws; javax.xml; | 1,099,110 |
public static void resetCallbackClient(
GatewayServer gatewayServer,
String callbackServerListeningAddress,
int callbackServerListeningPort)
throws UnknownHostException, InvocationTargetException, NoSuchMethodException,
IllegalAccessException, NoSuchFieldException {
gatewayServer.resetCallbackClient(
InetAddress.getByName(callbackServerListeningAddress), callbackServerListeningPort);
resetCallbackClientExecutorService(gatewayServer);
}
private static GatewayServer gatewayServer = null; | static void function( GatewayServer gatewayServer, String callbackServerListeningAddress, int callbackServerListeningPort) throws UnknownHostException, InvocationTargetException, NoSuchMethodException, IllegalAccessException, NoSuchFieldException { gatewayServer.resetCallbackClient( InetAddress.getByName(callbackServerListeningAddress), callbackServerListeningPort); resetCallbackClientExecutorService(gatewayServer); } private static GatewayServer gatewayServer = null; | /**
* Reset the callback client of gatewayServer with the given callbackListeningAddress and
* callbackListeningPort after the callback server started.
*
* @param callbackServerListeningAddress the listening address of the callback server.
* @param callbackServerListeningPort the listening port of the callback server.
*/ | Reset the callback client of gatewayServer with the given callbackListeningAddress and callbackListeningPort after the callback server started | resetCallbackClient | {
"repo_name": "StephanEwen/incubator-flink",
"path": "flink-python/src/main/java/org/apache/flink/client/python/PythonEnvUtils.java",
"license": "apache-2.0",
"size": 22570
} | [
"java.lang.reflect.InvocationTargetException",
"java.net.InetAddress",
"java.net.UnknownHostException"
] | import java.lang.reflect.InvocationTargetException; import java.net.InetAddress; import java.net.UnknownHostException; | import java.lang.reflect.*; import java.net.*; | [
"java.lang",
"java.net"
] | java.lang; java.net; | 1,701,780 |
public Activity getActivity() {
if (mActivity != null) {
return mActivity;
} else if (getContext() instanceof Activity) {
return (Activity)getContext();
}
// Never achieve here.
assert(false);
return null;
} | Activity function() { if (mActivity != null) { return mActivity; } else if (getContext() instanceof Activity) { return (Activity)getContext(); } assert(false); return null; } | /**
* Get the current activity passed from callers. It's never null.
* @return the activity instance passed from callers.
*
* @hide
*/ | Get the current activity passed from callers. It's never null | getActivity | {
"repo_name": "tomatell/crosswalk",
"path": "runtime/android/core_internal/src/org/xwalk/core/internal/XWalkViewInternal.java",
"license": "bsd-3-clause",
"size": 40312
} | [
"android.app.Activity"
] | import android.app.Activity; | import android.app.*; | [
"android.app"
] | android.app; | 557,762 |
public static Long translateVersionNumber(Long versionNumber) {
if(versionNumber == null || versionNumber < 1) {
return NodeConstants.DEFAULT_VERSION_NUMBER;
}
return versionNumber;
}
| static Long function(Long versionNumber) { if(versionNumber == null versionNumber < 1) { return NodeConstants.DEFAULT_VERSION_NUMBER; } return versionNumber; } | /**
* Translate the given version number.
* @param versionNumber
* @return
*/ | Translate the given version number | translateVersionNumber | {
"repo_name": "zimingd/Synapse-Repository-Services",
"path": "lib/jdomodels/src/main/java/org/sagebionetworks/repo/model/dbo/dao/NodeUtils.java",
"license": "apache-2.0",
"size": 12274
} | [
"org.sagebionetworks.repo.model.NodeConstants"
] | import org.sagebionetworks.repo.model.NodeConstants; | import org.sagebionetworks.repo.model.*; | [
"org.sagebionetworks.repo"
] | org.sagebionetworks.repo; | 1,881,185 |
@Override public void exitTypeSwitchCase(@NotNull GolangParser.TypeSwitchCaseContext ctx) { } | @Override public void exitTypeSwitchCase(@NotNull GolangParser.TypeSwitchCaseContext ctx) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | enterTypeSwitchCase | {
"repo_name": "IsThisThePayneResidence/intellidots",
"path": "src/main/java/ua/edu/hneu/ast/parsers/GolangBaseListener.java",
"license": "gpl-3.0",
"size": 35571
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 726,710 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents()
{
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
itemList = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
itemComped = new javax.swing.JLabel();
amount = new javax.swing.JLabel();
waiterID = new javax.swing.JLabel();
reason = new javax.swing.JTextField();
dateTime = new javax.swing.JLabel();
jToggleButton1 = new javax.swing.JToggleButton();
alert = new javax.swing.JLabel();
setBackground(new java.awt.Color(153, 0, 0));
jLabel1.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 255, 0));
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("SELECT ITEM TO COMP");
jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 0)));
itemList.setLayout(new javax.swing.BoxLayout(itemList, javax.swing.BoxLayout.Y_AXIS));
jScrollPane1.setViewportView(itemList);
jLabel2.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
jLabel2.setText("Item Comped: ");
jLabel3.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
jLabel3.setText("Amount: ");
jLabel4.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
jLabel4.setText("Waiter ID: ");
jLabel5.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
jLabel5.setText("Reason: ");
jLabel6.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
jLabel6.setText("Date & Time: "); | @SuppressWarnings(STR) void function() { jLabel1 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); itemList = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); itemComped = new javax.swing.JLabel(); amount = new javax.swing.JLabel(); waiterID = new javax.swing.JLabel(); reason = new javax.swing.JTextField(); dateTime = new javax.swing.JLabel(); jToggleButton1 = new javax.swing.JToggleButton(); alert = new javax.swing.JLabel(); setBackground(new java.awt.Color(153, 0, 0)); jLabel1.setFont(new java.awt.Font(STR, 0, 24)); jLabel1.setForeground(new java.awt.Color(255, 255, 0)); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText(STR); jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 0))); itemList.setLayout(new javax.swing.BoxLayout(itemList, javax.swing.BoxLayout.Y_AXIS)); jScrollPane1.setViewportView(itemList); jLabel2.setFont(new java.awt.Font(STR, 0, 18)); jLabel2.setText(STR); jLabel3.setFont(new java.awt.Font(STR, 0, 18)); jLabel3.setText(STR); jLabel4.setFont(new java.awt.Font(STR, 0, 18)); jLabel4.setText(STR); jLabel5.setFont(new java.awt.Font(STR, 0, 18)); jLabel5.setText(STR); jLabel6.setFont(new java.awt.Font(STR, 0, 18)); jLabel6.setText(STR); | /**
* 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. regenerated by the Form Editor | initComponents | {
"repo_name": "noairresistance/restaurant-app",
"path": "src/Manager/CompItem.java",
"license": "mit",
"size": 15348
} | [
"javax.swing.JLabel"
] | import javax.swing.JLabel; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 256,611 |
private void addOp(String op, String path, float value) {
if (this.operations == null) {
this.operations = new JsonArray();
}
this.operations.add(new JsonObject()
.add("op", op)
.add("path", path)
.add("value", value));
} | void function(String op, String path, float value) { if (this.operations == null) { this.operations = new JsonArray(); } this.operations.add(new JsonObject() .add("op", op) .add("path", path) .add("value", value)); } | /**
* Adds a patch operation.
*
* @param op the operation type. Must be add, replace, remove, or test.
* @param path the path that designates the key. Must be prefixed with a "/".
* @param value the value to be set.
*/ | Adds a patch operation | addOp | {
"repo_name": "box/box-java-sdk",
"path": "src/main/java/com/box/sdk/Metadata.java",
"license": "apache-2.0",
"size": 16853
} | [
"com.eclipsesource.json.JsonArray",
"com.eclipsesource.json.JsonObject"
] | import com.eclipsesource.json.JsonArray; import com.eclipsesource.json.JsonObject; | import com.eclipsesource.json.*; | [
"com.eclipsesource.json"
] | com.eclipsesource.json; | 1,096,532 |
void dropColumn(Session session, TableHandle tableHandle, ColumnHandle column); | void dropColumn(Session session, TableHandle tableHandle, ColumnHandle column); | /**
* Drop the specified column.
*/ | Drop the specified column | dropColumn | {
"repo_name": "mvp/presto",
"path": "presto-main/src/main/java/com/facebook/presto/metadata/Metadata.java",
"license": "apache-2.0",
"size": 19804
} | [
"com.facebook.presto.Session",
"com.facebook.presto.spi.ColumnHandle",
"com.facebook.presto.spi.TableHandle"
] | import com.facebook.presto.Session; import com.facebook.presto.spi.ColumnHandle; import com.facebook.presto.spi.TableHandle; | import com.facebook.presto.*; import com.facebook.presto.spi.*; | [
"com.facebook.presto"
] | com.facebook.presto; | 2,404,714 |
void addTypes(Collection<? extends IType> types) throws NotHandledException;
// ////////////////////////////////////////////////////////////////////////
// INFORMATION RETRIEVAL
// //////////////////////////////////////////////////////////////////////// | void addTypes(Collection<? extends IType> types) throws NotHandledException; | /**
* Create a shape (of type S) and mapping for the given types
*
* @param types
* @throws NotHandledException
*/ | Create a shape (of type S) and mapping for the given types | addTypes | {
"repo_name": "jdtimmerman/orm-prototyper",
"path": "OrmViewAPI/src/main/java/nl/ru/jtimmerm/view/graph/IShapeMapper.java",
"license": "gpl-3.0",
"size": 2647
} | [
"java.util.Collection",
"nl.ru.jtimmerm.orm.types.IType",
"nl.ru.jtimmerm.view.NotHandledException"
] | import java.util.Collection; import nl.ru.jtimmerm.orm.types.IType; import nl.ru.jtimmerm.view.NotHandledException; | import java.util.*; import nl.ru.jtimmerm.orm.types.*; import nl.ru.jtimmerm.view.*; | [
"java.util",
"nl.ru.jtimmerm"
] | java.util; nl.ru.jtimmerm; | 2,844,968 |
public void readIn
(InStream in)
throws IOException
{
// Read fields.
taskID = in.readLong();
taskClassName = in.readString();
args = in.readStringArray();
inputTuples = null;
properties = in.readFields (new TaskProperties());
jar = in.readByteArray();
size = in.readInt();
rank = in.readInt();
devnum = in.readIntArray();
moreData = null;
marshaledInputTuples = in.readByteArray();
} | void function (InStream in) throws IOException { taskID = in.readLong(); taskClassName = in.readString(); args = in.readStringArray(); inputTuples = null; properties = in.readFields (new TaskProperties()); jar = in.readByteArray(); size = in.readInt(); rank = in.readInt(); devnum = in.readIntArray(); moreData = null; marshaledInputTuples = in.readByteArray(); } | /**
* Read this task info object from the given in stream.
*
* @param in In stream.
*
* @exception IOException
* Thrown if an I/O error occurred.
*/ | Read this task info object from the given in stream | readIn | {
"repo_name": "JimiHFord/pj2",
"path": "lib/edu/rit/pj2/tracker/TaskInfo.java",
"license": "lgpl-3.0",
"size": 6572
} | [
"edu.rit.io.InStream",
"java.io.IOException"
] | import edu.rit.io.InStream; import java.io.IOException; | import edu.rit.io.*; import java.io.*; | [
"edu.rit.io",
"java.io"
] | edu.rit.io; java.io; | 1,812,457 |
private void fillBuffer() throws IOException {
if (!endOfInput && (lastCoderResult == null || lastCoderResult.isUnderflow())) {
encoderIn.compact();
final int position = encoderIn.position();
// We don't use Reader#read(CharBuffer) here because it is more efficient
// to write directly to the underlying char array (the default implementation
// copies data to a temporary char array).
final int c = reader.read(encoderIn.array(), position, encoderIn.remaining());
if (c == EOF) {
endOfInput = true;
} else {
encoderIn.position(position + c);
}
encoderIn.flip();
}
encoderOut.compact();
lastCoderResult = charsetEncoder.encode(encoderIn, encoderOut, endOfInput);
if (endOfInput) {
lastCoderResult = charsetEncoder.flush(encoderOut);
}
if (lastCoderResult.isError()) {
lastCoderResult.throwException();
}
encoderOut.flip();
} | void function() throws IOException { if (!endOfInput && (lastCoderResult == null lastCoderResult.isUnderflow())) { encoderIn.compact(); final int position = encoderIn.position(); final int c = reader.read(encoderIn.array(), position, encoderIn.remaining()); if (c == EOF) { endOfInput = true; } else { encoderIn.position(position + c); } encoderIn.flip(); } encoderOut.compact(); lastCoderResult = charsetEncoder.encode(encoderIn, encoderOut, endOfInput); if (endOfInput) { lastCoderResult = charsetEncoder.flush(encoderOut); } if (lastCoderResult.isError()) { lastCoderResult.throwException(); } encoderOut.flip(); } | /**
* Fills the internal char buffer from the reader.
*
* @throws IOException If an I/O error occurs
*/ | Fills the internal char buffer from the reader | fillBuffer | {
"repo_name": "apache/commons-io",
"path": "src/main/java/org/apache/commons/io/input/ReaderInputStream.java",
"license": "apache-2.0",
"size": 13922
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 27,370 |
@Override
public MappedAppSchema getMappedSchema() {
FeatureType[] fts = ftNameToFt.values().toArray( new FeatureType[ftNameToFt.size()] );
FeatureTypeMapping[] ftMappings = ftNameToMapping.values().toArray( new FeatureTypeMapping[ftNameToMapping.size()] );
Map<FeatureType, FeatureType> ftToSuperFt = null;
Map<String, String> prefixToNs = null;
GMLSchemaInfoSet xsModel = null;
// TODO
GeometryStorageParams geometryParams = new GeometryStorageParams( CRSManager.getCRSRef( "EPSG:4326" ),
dialect.getUndefinedSrid(),
CoordinateDimension.DIM_2 );
return new MappedAppSchema( fts, ftToSuperFt, prefixToNs, xsModel, ftMappings, null, null, geometryParams,
deleteCascadingByDB, null, null, null );
} | MappedAppSchema function() { FeatureType[] fts = ftNameToFt.values().toArray( new FeatureType[ftNameToFt.size()] ); FeatureTypeMapping[] ftMappings = ftNameToMapping.values().toArray( new FeatureTypeMapping[ftNameToMapping.size()] ); Map<FeatureType, FeatureType> ftToSuperFt = null; Map<String, String> prefixToNs = null; GMLSchemaInfoSet xsModel = null; GeometryStorageParams geometryParams = new GeometryStorageParams( CRSManager.getCRSRef( STR ), dialect.getUndefinedSrid(), CoordinateDimension.DIM_2 ); return new MappedAppSchema( fts, ftToSuperFt, prefixToNs, xsModel, ftMappings, null, null, geometryParams, deleteCascadingByDB, null, null, null ); } | /**
* Returns the {@link MappedAppSchema} derived from configuration / tables.
*
* @return mapped application schema, never <code>null</code>
*/ | Returns the <code>MappedAppSchema</code> derived from configuration / tables | getMappedSchema | {
"repo_name": "deegree/deegree3",
"path": "deegree-datastores/deegree-featurestores/deegree-featurestore-sql/src/main/java/org/deegree/feature/persistence/sql/config/MappedSchemaBuilderTable.java",
"license": "lgpl-2.1",
"size": 31298
} | [
"java.util.Map",
"org.deegree.cs.persistence.CRSManager",
"org.deegree.feature.persistence.sql.FeatureTypeMapping",
"org.deegree.feature.persistence.sql.GeometryStorageParams",
"org.deegree.feature.persistence.sql.MappedAppSchema",
"org.deegree.feature.types.FeatureType",
"org.deegree.feature.types.property.GeometryPropertyType",
"org.deegree.gml.schema.GMLSchemaInfoSet"
] | import java.util.Map; import org.deegree.cs.persistence.CRSManager; import org.deegree.feature.persistence.sql.FeatureTypeMapping; import org.deegree.feature.persistence.sql.GeometryStorageParams; import org.deegree.feature.persistence.sql.MappedAppSchema; import org.deegree.feature.types.FeatureType; import org.deegree.feature.types.property.GeometryPropertyType; import org.deegree.gml.schema.GMLSchemaInfoSet; | import java.util.*; import org.deegree.cs.persistence.*; import org.deegree.feature.persistence.sql.*; import org.deegree.feature.types.*; import org.deegree.feature.types.property.*; import org.deegree.gml.schema.*; | [
"java.util",
"org.deegree.cs",
"org.deegree.feature",
"org.deegree.gml"
] | java.util; org.deegree.cs; org.deegree.feature; org.deegree.gml; | 2,559,625 |
public void cleanCaches() {
try {
FileUtils.cleanDirectory(getCacheDir());
}
catch (IOException ioe) {
LOGGER.warn("Unable to clean the cache directory.", ioe);
}
}
| void function() { try { FileUtils.cleanDirectory(getCacheDir()); } catch (IOException ioe) { LOGGER.warn(STR, ioe); } } | /**
* Clean all the caches
*/ | Clean all the caches | cleanCaches | {
"repo_name": "lotaris/rox-client-java",
"path": "rox-client-java/src/main/java/com/lotaris/rox/core/cache/CacheOptimizerStore.java",
"license": "mit",
"size": 6463
} | [
"java.io.IOException",
"org.apache.commons.io.FileUtils"
] | import java.io.IOException; import org.apache.commons.io.FileUtils; | import java.io.*; import org.apache.commons.io.*; | [
"java.io",
"org.apache.commons"
] | java.io; org.apache.commons; | 1,237,868 |
List<ProtocolOnlineReviewDocumentBase> getProtocolReviewDocumentsForCurrentSubmission(ProtocolBase protocol);
| List<ProtocolOnlineReviewDocumentBase> getProtocolReviewDocumentsForCurrentSubmission(ProtocolBase protocol); | /**
* Get a list of current ProtocolReview documents associated with the protocol and current submission.
* @param protocol
* @return
*/ | Get a list of current ProtocolReview documents associated with the protocol and current submission | getProtocolReviewDocumentsForCurrentSubmission | {
"repo_name": "blackcathacker/kc.preclean",
"path": "coeus-code/src/main/java/org/kuali/kra/protocol/onlinereview/ProtocolOnlineReviewService.java",
"license": "apache-2.0",
"size": 8607
} | [
"java.util.List",
"org.kuali.kra.protocol.ProtocolBase",
"org.kuali.kra.protocol.ProtocolOnlineReviewDocumentBase"
] | import java.util.List; import org.kuali.kra.protocol.ProtocolBase; import org.kuali.kra.protocol.ProtocolOnlineReviewDocumentBase; | import java.util.*; import org.kuali.kra.protocol.*; | [
"java.util",
"org.kuali.kra"
] | java.util; org.kuali.kra; | 1,860,445 |
//Métodos de Retorno de data atual=========================================================================
public static DateTime getNowDateTime() {
// return new org.joda.time.DateTime();
return org.joda.time.LocalDateTime.now().toDateTime();
} | static DateTime function() { return org.joda.time.LocalDateTime.now().toDateTime(); } | /**
* Retorna a data e hora de hoje.
* @return Hora de Hoje
*/ | Retorna a data e hora de hoje | getNowDateTime | {
"repo_name": "dbsoftcombr/dbssdk",
"path": "src/main/java/br/com/dbsoft/util/DBSDate.java",
"license": "mit",
"size": 65869
} | [
"org.joda.time.DateTime",
"org.joda.time.LocalDateTime"
] | import org.joda.time.DateTime; import org.joda.time.LocalDateTime; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 1,605,897 |
public void setDestinationFolder( String foldername, boolean createFolder ) throws KettleException {
try {
// Open destination folder
this.destinationIMAPFolder = store.getFolder( foldername );
if ( !this.destinationIMAPFolder.exists() ) {
if ( createFolder ) {
// Create folder
this.destinationIMAPFolder.create( Folder.HOLDS_MESSAGES );
} else {
throw new KettleException( BaseMessages.getString(
PKG, "MailConnection.Error.FolderNotFound", foldername ) );
}
}
} catch ( Exception e ) {
throw new KettleException( e );
}
} | void function( String foldername, boolean createFolder ) throws KettleException { try { this.destinationIMAPFolder = store.getFolder( foldername ); if ( !this.destinationIMAPFolder.exists() ) { if ( createFolder ) { this.destinationIMAPFolder.create( Folder.HOLDS_MESSAGES ); } else { throw new KettleException( BaseMessages.getString( PKG, STR, foldername ) ); } } } catch ( Exception e ) { throw new KettleException( e ); } } | /**
* Set destination folder
*
* @param foldername
* destination foldername
* @param createFolder
* flag create folder if needed
* @throws KettleException
*/ | Set destination folder | setDestinationFolder | {
"repo_name": "rfellows/pentaho-kettle",
"path": "engine/src/org/pentaho/di/job/entries/getpop/MailConnection.java",
"license": "apache-2.0",
"size": 40631
} | [
"javax.mail.Folder",
"org.pentaho.di.core.exception.KettleException",
"org.pentaho.di.i18n.BaseMessages"
] | import javax.mail.Folder; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.i18n.BaseMessages; | import javax.mail.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.i18n.*; | [
"javax.mail",
"org.pentaho.di"
] | javax.mail; org.pentaho.di; | 1,299,952 |
private boolean isSettable(final Field field) {
return !(
field instanceof LineDividerField ||
field instanceof TabDividerField ||
field instanceof ColumnField ||
field instanceof PermissionTabField ||
field instanceof RelationshipsTabField
);
} | boolean function(final Field field) { return !( field instanceof LineDividerField field instanceof TabDividerField field instanceof ColumnField field instanceof PermissionTabField field instanceof RelationshipsTabField ); } | /**
* Used to determine if we're looking at readOnly field.
* @param field
* @return
*/ | Used to determine if we're looking at readOnly field | isSettable | {
"repo_name": "dotCMS/core",
"path": "dotCMS/src/main/java/com/dotcms/content/business/json/ContentletJsonAPIImpl.java",
"license": "gpl-3.0",
"size": 25489
} | [
"com.dotcms.contenttype.model.field.ColumnField",
"com.dotcms.contenttype.model.field.Field",
"com.dotcms.contenttype.model.field.LineDividerField",
"com.dotcms.contenttype.model.field.PermissionTabField",
"com.dotcms.contenttype.model.field.RelationshipsTabField",
"com.dotcms.contenttype.model.field.TabDividerField"
] | import com.dotcms.contenttype.model.field.ColumnField; import com.dotcms.contenttype.model.field.Field; import com.dotcms.contenttype.model.field.LineDividerField; import com.dotcms.contenttype.model.field.PermissionTabField; import com.dotcms.contenttype.model.field.RelationshipsTabField; import com.dotcms.contenttype.model.field.TabDividerField; | import com.dotcms.contenttype.model.field.*; | [
"com.dotcms.contenttype"
] | com.dotcms.contenttype; | 2,378,506 |
private boolean startAnimation(SurfaceSession session, long maxAnimationDuration,
float animationScale, int finalWidth, int finalHeight, boolean dismissing,
int exitAnim, int enterAnim) {
if (mSurfaceControl == null) {
// Can't do animation.
return false;
}
if (mStarted) {
return true;
}
mStarted = true;
boolean firstStart = false;
// Figure out how the screen has moved from the original rotation.
int delta = deltaRotation(mCurRotation, mOriginalRotation);
if (TWO_PHASE_ANIMATION && mFinishExitAnimation == null
&& (!dismissing || delta != Surface.ROTATION_0)) {
if (DEBUG_STATE) Slog.v(TAG, "Creating start and finish animations");
firstStart = true;
mStartExitAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_start_exit);
mStartEnterAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_start_enter);
if (USE_CUSTOM_BLACK_FRAME) {
mStartFrameAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_start_frame);
}
mFinishExitAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_finish_exit);
mFinishEnterAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_finish_enter);
if (USE_CUSTOM_BLACK_FRAME) {
mFinishFrameAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_finish_frame);
}
}
if (DEBUG_STATE) Slog.v(TAG, "Rotation delta: " + delta + " finalWidth="
+ finalWidth + " finalHeight=" + finalHeight
+ " origWidth=" + mOriginalWidth + " origHeight=" + mOriginalHeight);
final boolean customAnim;
if (exitAnim != 0 && enterAnim != 0) {
customAnim = true;
mRotateExitAnimation = AnimationUtils.loadAnimation(mContext, exitAnim);
mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext, enterAnim);
} else {
customAnim = false;
switch (delta) {
case Surface.ROTATION_0:
mRotateExitAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_0_exit);
mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_0_enter);
if (USE_CUSTOM_BLACK_FRAME) {
mRotateFrameAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_0_frame);
}
break;
case Surface.ROTATION_90:
mRotateExitAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_plus_90_exit);
mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_plus_90_enter);
if (USE_CUSTOM_BLACK_FRAME) {
mRotateFrameAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_plus_90_frame);
}
break;
case Surface.ROTATION_180:
mRotateExitAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_180_exit);
mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_180_enter);
if (USE_CUSTOM_BLACK_FRAME) {
mRotateFrameAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_180_frame);
}
break;
case Surface.ROTATION_270:
mRotateExitAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_minus_90_exit);
mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_minus_90_enter);
if (USE_CUSTOM_BLACK_FRAME) {
mRotateFrameAnimation = AnimationUtils.loadAnimation(mContext,
com.android.internal.R.anim.screen_rotate_minus_90_frame);
}
break;
}
}
mRotateExitAnimation.setDuration(mRotateExitAnimation.getDuration()*2/3);
mRotateEnterAnimation.setDuration(mRotateEnterAnimation.getDuration()*2/3);
// Initialize the animations. This is a hack, redefining what "parent"
// means to allow supplying the last and next size. In this definition
// "%p" is the original (let's call it "previous") size, and "%" is the
// screen's current/new size.
if (TWO_PHASE_ANIMATION && firstStart) {
// Compute partial steps between original and final sizes. These
// are used for the dimensions of the exiting and entering elements,
// so they are never stretched too significantly.
final int halfWidth = (finalWidth + mOriginalWidth) / 2;
final int halfHeight = (finalHeight + mOriginalHeight) / 2;
if (DEBUG_STATE) Slog.v(TAG, "Initializing start and finish animations");
mStartEnterAnimation.initialize(finalWidth, finalHeight,
halfWidth, halfHeight);
mStartExitAnimation.initialize(halfWidth, halfHeight,
mOriginalWidth, mOriginalHeight);
mFinishEnterAnimation.initialize(finalWidth, finalHeight,
halfWidth, halfHeight);
mFinishExitAnimation.initialize(halfWidth, halfHeight,
mOriginalWidth, mOriginalHeight);
if (USE_CUSTOM_BLACK_FRAME) {
mStartFrameAnimation.initialize(finalWidth, finalHeight,
mOriginalWidth, mOriginalHeight);
mFinishFrameAnimation.initialize(finalWidth, finalHeight,
mOriginalWidth, mOriginalHeight);
}
}
mRotateEnterAnimation.initialize(finalWidth, finalHeight, mOriginalWidth, mOriginalHeight);
mRotateExitAnimation.initialize(finalWidth, finalHeight, mOriginalWidth, mOriginalHeight);
if (USE_CUSTOM_BLACK_FRAME) {
mRotateFrameAnimation.initialize(finalWidth, finalHeight, mOriginalWidth,
mOriginalHeight);
}
mAnimRunning = false;
mFinishAnimReady = false;
mFinishAnimStartTime = -1;
if (TWO_PHASE_ANIMATION && firstStart) {
mStartExitAnimation.restrictDuration(maxAnimationDuration);
mStartExitAnimation.scaleCurrentDuration(animationScale);
mStartEnterAnimation.restrictDuration(maxAnimationDuration);
mStartEnterAnimation.scaleCurrentDuration(animationScale);
mFinishExitAnimation.restrictDuration(maxAnimationDuration);
mFinishExitAnimation.scaleCurrentDuration(animationScale);
mFinishEnterAnimation.restrictDuration(maxAnimationDuration);
mFinishEnterAnimation.scaleCurrentDuration(animationScale);
if (USE_CUSTOM_BLACK_FRAME) {
mStartFrameAnimation.restrictDuration(maxAnimationDuration);
mStartFrameAnimation.scaleCurrentDuration(animationScale);
mFinishFrameAnimation.restrictDuration(maxAnimationDuration);
mFinishFrameAnimation.scaleCurrentDuration(animationScale);
}
}
mRotateExitAnimation.restrictDuration(maxAnimationDuration);
mRotateExitAnimation.scaleCurrentDuration(animationScale);
mRotateEnterAnimation.restrictDuration(maxAnimationDuration);
mRotateEnterAnimation.scaleCurrentDuration(animationScale);
if (USE_CUSTOM_BLACK_FRAME) {
mRotateFrameAnimation.restrictDuration(maxAnimationDuration);
mRotateFrameAnimation.scaleCurrentDuration(animationScale);
}
final int layerStack = mDisplayContent.getDisplay().getLayerStack();
if (USE_CUSTOM_BLACK_FRAME && mCustomBlackFrame == null) {
if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i(
WindowManagerService.TAG,
">>> OPEN TRANSACTION ScreenRotationAnimation.startAnimation");
SurfaceControl.openTransaction();
// Compute the transformation matrix that must be applied
// the the black frame to make it stay in the initial position
// before the new screen rotation. This is different than the
// snapshot transformation because the snapshot is always based
// of the native orientation of the screen, not the orientation
// we were last in.
createRotationMatrix(delta, mOriginalWidth, mOriginalHeight, mFrameInitialMatrix);
try {
Rect outer = new Rect(-mOriginalWidth*1, -mOriginalHeight*1,
mOriginalWidth*2, mOriginalHeight*2);
Rect inner = new Rect(0, 0, mOriginalWidth, mOriginalHeight);
mCustomBlackFrame = new BlackFrame(session, outer, inner, FREEZE_LAYER + 3,
layerStack, false);
mCustomBlackFrame.setMatrix(mFrameInitialMatrix);
} catch (OutOfResourcesException e) {
Slog.w(TAG, "Unable to allocate black surface", e);
} finally {
SurfaceControl.closeTransaction();
if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i(
WindowManagerService.TAG,
"<<< CLOSE TRANSACTION ScreenRotationAnimation.startAnimation");
}
}
if (!customAnim && mExitingBlackFrame == null) {
if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i(
WindowManagerService.TAG,
">>> OPEN TRANSACTION ScreenRotationAnimation.startAnimation");
SurfaceControl.openTransaction();
try {
// Compute the transformation matrix that must be applied
// the the black frame to make it stay in the initial position
// before the new screen rotation. This is different than the
// snapshot transformation because the snapshot is always based
// of the native orientation of the screen, not the orientation
// we were last in.
createRotationMatrix(delta, mOriginalWidth, mOriginalHeight, mFrameInitialMatrix);
final Rect outer;
final Rect inner;
if (mForceDefaultOrientation) {
// Going from a smaller Display to a larger Display, add curtains to sides
// or top and bottom. Going from a larger to smaller display will result in
// no BlackSurfaces being constructed.
outer = mCurrentDisplayRect;
inner = mOriginalDisplayRect;
} else {
outer = new Rect(-mOriginalWidth*1, -mOriginalHeight*1,
mOriginalWidth*2, mOriginalHeight*2);
inner = new Rect(0, 0, mOriginalWidth, mOriginalHeight);
}
mExitingBlackFrame = new BlackFrame(session, outer, inner, FREEZE_LAYER + 2,
layerStack, mForceDefaultOrientation);
mExitingBlackFrame.setMatrix(mFrameInitialMatrix);
} catch (OutOfResourcesException e) {
Slog.w(TAG, "Unable to allocate black surface", e);
} finally {
SurfaceControl.closeTransaction();
if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i(
WindowManagerService.TAG,
"<<< CLOSE TRANSACTION ScreenRotationAnimation.startAnimation");
}
}
if (customAnim && mEnteringBlackFrame == null) {
if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i(
WindowManagerService.TAG,
">>> OPEN TRANSACTION ScreenRotationAnimation.startAnimation");
SurfaceControl.openTransaction();
try {
Rect outer = new Rect(-finalWidth*1, -finalHeight*1,
finalWidth*2, finalHeight*2);
Rect inner = new Rect(0, 0, finalWidth, finalHeight);
mEnteringBlackFrame = new BlackFrame(session, outer, inner, FREEZE_LAYER,
layerStack, false);
} catch (OutOfResourcesException e) {
Slog.w(TAG, "Unable to allocate black surface", e);
} finally {
SurfaceControl.closeTransaction();
if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS || DEBUG_STATE) Slog.i(
WindowManagerService.TAG,
"<<< CLOSE TRANSACTION ScreenRotationAnimation.startAnimation");
}
}
return true;
} | boolean function(SurfaceSession session, long maxAnimationDuration, float animationScale, int finalWidth, int finalHeight, boolean dismissing, int exitAnim, int enterAnim) { if (mSurfaceControl == null) { return false; } if (mStarted) { return true; } mStarted = true; boolean firstStart = false; int delta = deltaRotation(mCurRotation, mOriginalRotation); if (TWO_PHASE_ANIMATION && mFinishExitAnimation == null && (!dismissing delta != Surface.ROTATION_0)) { if (DEBUG_STATE) Slog.v(TAG, STR); firstStart = true; mStartExitAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_start_exit); mStartEnterAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_start_enter); if (USE_CUSTOM_BLACK_FRAME) { mStartFrameAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_start_frame); } mFinishExitAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_finish_exit); mFinishEnterAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_finish_enter); if (USE_CUSTOM_BLACK_FRAME) { mFinishFrameAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_finish_frame); } } if (DEBUG_STATE) Slog.v(TAG, STR + delta + STR + finalWidth + STR + finalHeight + STR + mOriginalWidth + STR + mOriginalHeight); final boolean customAnim; if (exitAnim != 0 && enterAnim != 0) { customAnim = true; mRotateExitAnimation = AnimationUtils.loadAnimation(mContext, exitAnim); mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext, enterAnim); } else { customAnim = false; switch (delta) { case Surface.ROTATION_0: mRotateExitAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_0_exit); mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_0_enter); if (USE_CUSTOM_BLACK_FRAME) { mRotateFrameAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_0_frame); } break; case Surface.ROTATION_90: mRotateExitAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_plus_90_exit); mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_plus_90_enter); if (USE_CUSTOM_BLACK_FRAME) { mRotateFrameAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_plus_90_frame); } break; case Surface.ROTATION_180: mRotateExitAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_180_exit); mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_180_enter); if (USE_CUSTOM_BLACK_FRAME) { mRotateFrameAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_180_frame); } break; case Surface.ROTATION_270: mRotateExitAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_minus_90_exit); mRotateEnterAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_minus_90_enter); if (USE_CUSTOM_BLACK_FRAME) { mRotateFrameAnimation = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.screen_rotate_minus_90_frame); } break; } } mRotateExitAnimation.setDuration(mRotateExitAnimation.getDuration()*2/3); mRotateEnterAnimation.setDuration(mRotateEnterAnimation.getDuration()*2/3); if (TWO_PHASE_ANIMATION && firstStart) { final int halfWidth = (finalWidth + mOriginalWidth) / 2; final int halfHeight = (finalHeight + mOriginalHeight) / 2; if (DEBUG_STATE) Slog.v(TAG, STR); mStartEnterAnimation.initialize(finalWidth, finalHeight, halfWidth, halfHeight); mStartExitAnimation.initialize(halfWidth, halfHeight, mOriginalWidth, mOriginalHeight); mFinishEnterAnimation.initialize(finalWidth, finalHeight, halfWidth, halfHeight); mFinishExitAnimation.initialize(halfWidth, halfHeight, mOriginalWidth, mOriginalHeight); if (USE_CUSTOM_BLACK_FRAME) { mStartFrameAnimation.initialize(finalWidth, finalHeight, mOriginalWidth, mOriginalHeight); mFinishFrameAnimation.initialize(finalWidth, finalHeight, mOriginalWidth, mOriginalHeight); } } mRotateEnterAnimation.initialize(finalWidth, finalHeight, mOriginalWidth, mOriginalHeight); mRotateExitAnimation.initialize(finalWidth, finalHeight, mOriginalWidth, mOriginalHeight); if (USE_CUSTOM_BLACK_FRAME) { mRotateFrameAnimation.initialize(finalWidth, finalHeight, mOriginalWidth, mOriginalHeight); } mAnimRunning = false; mFinishAnimReady = false; mFinishAnimStartTime = -1; if (TWO_PHASE_ANIMATION && firstStart) { mStartExitAnimation.restrictDuration(maxAnimationDuration); mStartExitAnimation.scaleCurrentDuration(animationScale); mStartEnterAnimation.restrictDuration(maxAnimationDuration); mStartEnterAnimation.scaleCurrentDuration(animationScale); mFinishExitAnimation.restrictDuration(maxAnimationDuration); mFinishExitAnimation.scaleCurrentDuration(animationScale); mFinishEnterAnimation.restrictDuration(maxAnimationDuration); mFinishEnterAnimation.scaleCurrentDuration(animationScale); if (USE_CUSTOM_BLACK_FRAME) { mStartFrameAnimation.restrictDuration(maxAnimationDuration); mStartFrameAnimation.scaleCurrentDuration(animationScale); mFinishFrameAnimation.restrictDuration(maxAnimationDuration); mFinishFrameAnimation.scaleCurrentDuration(animationScale); } } mRotateExitAnimation.restrictDuration(maxAnimationDuration); mRotateExitAnimation.scaleCurrentDuration(animationScale); mRotateEnterAnimation.restrictDuration(maxAnimationDuration); mRotateEnterAnimation.scaleCurrentDuration(animationScale); if (USE_CUSTOM_BLACK_FRAME) { mRotateFrameAnimation.restrictDuration(maxAnimationDuration); mRotateFrameAnimation.scaleCurrentDuration(animationScale); } final int layerStack = mDisplayContent.getDisplay().getLayerStack(); if (USE_CUSTOM_BLACK_FRAME && mCustomBlackFrame == null) { if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS DEBUG_STATE) Slog.i( WindowManagerService.TAG, STR); SurfaceControl.openTransaction(); createRotationMatrix(delta, mOriginalWidth, mOriginalHeight, mFrameInitialMatrix); try { Rect outer = new Rect(-mOriginalWidth*1, -mOriginalHeight*1, mOriginalWidth*2, mOriginalHeight*2); Rect inner = new Rect(0, 0, mOriginalWidth, mOriginalHeight); mCustomBlackFrame = new BlackFrame(session, outer, inner, FREEZE_LAYER + 3, layerStack, false); mCustomBlackFrame.setMatrix(mFrameInitialMatrix); } catch (OutOfResourcesException e) { Slog.w(TAG, STR, e); } finally { SurfaceControl.closeTransaction(); if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS DEBUG_STATE) Slog.i( WindowManagerService.TAG, STR); } } if (!customAnim && mExitingBlackFrame == null) { if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS DEBUG_STATE) Slog.i( WindowManagerService.TAG, STR); SurfaceControl.openTransaction(); try { createRotationMatrix(delta, mOriginalWidth, mOriginalHeight, mFrameInitialMatrix); final Rect outer; final Rect inner; if (mForceDefaultOrientation) { outer = mCurrentDisplayRect; inner = mOriginalDisplayRect; } else { outer = new Rect(-mOriginalWidth*1, -mOriginalHeight*1, mOriginalWidth*2, mOriginalHeight*2); inner = new Rect(0, 0, mOriginalWidth, mOriginalHeight); } mExitingBlackFrame = new BlackFrame(session, outer, inner, FREEZE_LAYER + 2, layerStack, mForceDefaultOrientation); mExitingBlackFrame.setMatrix(mFrameInitialMatrix); } catch (OutOfResourcesException e) { Slog.w(TAG, STR, e); } finally { SurfaceControl.closeTransaction(); if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS DEBUG_STATE) Slog.i( WindowManagerService.TAG, STR); } } if (customAnim && mEnteringBlackFrame == null) { if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS DEBUG_STATE) Slog.i( WindowManagerService.TAG, STR); SurfaceControl.openTransaction(); try { Rect outer = new Rect(-finalWidth*1, -finalHeight*1, finalWidth*2, finalHeight*2); Rect inner = new Rect(0, 0, finalWidth, finalHeight); mEnteringBlackFrame = new BlackFrame(session, outer, inner, FREEZE_LAYER, layerStack, false); } catch (OutOfResourcesException e) { Slog.w(TAG, STR, e); } finally { SurfaceControl.closeTransaction(); if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS DEBUG_STATE) Slog.i( WindowManagerService.TAG, STR); } } return true; } | /**
* Returns true if animating.
*/ | Returns true if animating | startAnimation | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "frameworks/base/services/core/java/com/android/server/wm/ScreenRotationAnimation.java",
"license": "gpl-3.0",
"size": 47423
} | [
"android.graphics.Rect",
"android.util.Slog",
"android.view.Surface",
"android.view.SurfaceControl",
"android.view.SurfaceSession",
"android.view.animation.AnimationUtils"
] | import android.graphics.Rect; import android.util.Slog; import android.view.Surface; import android.view.SurfaceControl; import android.view.SurfaceSession; import android.view.animation.AnimationUtils; | import android.graphics.*; import android.util.*; import android.view.*; import android.view.animation.*; | [
"android.graphics",
"android.util",
"android.view"
] | android.graphics; android.util; android.view; | 2,399,903 |
@Test
public void queryAllEntries() throws CommitFailedException, ParseException, RepositoryException {
setTravesalEnabled(false);
// index automatically created by the framework:
// {@code createTestIndexNode()}
Tree rTree = root.getTree("/");
Tree test = rTree.addChild("test");
List<ValuePathTuple> nodes = addChildNodes(generateOrderedValues(NUMBER_OF_NODES), test,
OrderDirection.ASC, Type.STRING);
root.commit();
// querying
Iterator<? extends ResultRow> results;
results = executeQuery(String.format("SELECT * from [%s] WHERE foo IS NOT NULL", NT_UNSTRUCTURED), SQL2, null)
.getRows().iterator();
assertRightOrder(nodes, results);
setTravesalEnabled(true);
} | void function() throws CommitFailedException, ParseException, RepositoryException { setTravesalEnabled(false); Tree rTree = root.getTree("/"); Tree test = rTree.addChild("test"); List<ValuePathTuple> nodes = addChildNodes(generateOrderedValues(NUMBER_OF_NODES), test, OrderDirection.ASC, Type.STRING); root.commit(); Iterator<? extends ResultRow> results; results = executeQuery(String.format(STR, NT_UNSTRUCTURED), SQL2, null) .getRows().iterator(); assertRightOrder(nodes, results); setTravesalEnabled(true); } | /**
* Query the index for retrieving all the entries
*
* @throws CommitFailedException
* @throws ParseException
* @throws RepositoryException
*/ | Query the index for retrieving all the entries | queryAllEntries | {
"repo_name": "denismo/jackrabbit-dynamodb-store",
"path": "oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedPropertyIndexQueryTest.java",
"license": "apache-2.0",
"size": 34273
} | [
"java.text.ParseException",
"java.util.Iterator",
"java.util.List",
"javax.jcr.RepositoryException",
"org.apache.jackrabbit.oak.api.CommitFailedException",
"org.apache.jackrabbit.oak.api.ResultRow",
"org.apache.jackrabbit.oak.api.Tree",
"org.apache.jackrabbit.oak.api.Type",
"org.apache.jackrabbit.oak.plugins.index.property.OrderedIndex"
] | import java.text.ParseException; import java.util.Iterator; import java.util.List; import javax.jcr.RepositoryException; import org.apache.jackrabbit.oak.api.CommitFailedException; import org.apache.jackrabbit.oak.api.ResultRow; import org.apache.jackrabbit.oak.api.Tree; import org.apache.jackrabbit.oak.api.Type; import org.apache.jackrabbit.oak.plugins.index.property.OrderedIndex; | import java.text.*; import java.util.*; import javax.jcr.*; import org.apache.jackrabbit.oak.api.*; import org.apache.jackrabbit.oak.plugins.index.property.*; | [
"java.text",
"java.util",
"javax.jcr",
"org.apache.jackrabbit"
] | java.text; java.util; javax.jcr; org.apache.jackrabbit; | 291,338 |
public List<QueryBuilder> should() {
return this.shouldClauses;
} | List<QueryBuilder> function() { return this.shouldClauses; } | /**
* Gets the list of clauses that <b>should</b> be matched by the returned documents.
*
* @see #should(QueryBuilder)
* @see #minimumNumberShouldMatch(int)
*/ | Gets the list of clauses that should be matched by the returned documents | should | {
"repo_name": "snikch/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/index/query/BoolQueryBuilder.java",
"license": "apache-2.0",
"size": 13444
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,784,622 |
public boolean any(TIntList onBits) {
for(TIntIterator i = onBits.iterator();i.hasNext();) {
if(sparseMap.containsKey(i.next())) return true;
}
return false;
} | boolean function(TIntList onBits) { for(TIntIterator i = onBits.iterator();i.hasNext();) { if(sparseMap.containsKey(i.next())) return true; } return false; } | /**
* Returns true if any of the on bit indexes of the specified collection are
* matched by the on bits of this matrix. It is allowed that
* this matrix have more on bits than the specified matrix.
*
* @param matrix
* @return
*/ | Returns true if any of the on bit indexes of the specified collection are matched by the on bits of this matrix. It is allowed that this matrix have more on bits than the specified matrix | any | {
"repo_name": "antidata/htm.java.experiments",
"path": "src/main/java/org/numenta/nupic/util/SparseBinaryMatrixSupport.java",
"license": "agpl-3.0",
"size": 11059
} | [
"gnu.trove.iterator.TIntIterator",
"gnu.trove.list.TIntList"
] | import gnu.trove.iterator.TIntIterator; import gnu.trove.list.TIntList; | import gnu.trove.iterator.*; import gnu.trove.list.*; | [
"gnu.trove.iterator",
"gnu.trove.list"
] | gnu.trove.iterator; gnu.trove.list; | 422,135 |
public boolean clear(GridCacheVersion ver, boolean readers) throws IgniteCheckedException; | boolean function(GridCacheVersion ver, boolean readers) throws IgniteCheckedException; | /**
* Marks entry as obsolete and, if possible or required, removes it
* from swap storage.
*
* @param ver Obsolete version.
* @param readers Flag to clear readers as well.
* @throws IgniteCheckedException If failed to remove from swap.
* @return {@code True} if entry was not being used, passed the filter and could be removed.
*/ | Marks entry as obsolete and, if possible or required, removes it from swap storage | clear | {
"repo_name": "nizhikov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java",
"license": "apache-2.0",
"size": 47298
} | [
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.internal.processors.cache.version.GridCacheVersion"
] | import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; | import org.apache.ignite.*; import org.apache.ignite.internal.processors.cache.version.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,825,909 |
public void addDocField(String field, String format) {
docFields.add(new FieldAndFormat(field, format));
} | void function(String field, String format) { docFields.add(new FieldAndFormat(field, format)); } | /**
* Retrieve the requested field from doc values (or fielddata) of the document
*/ | Retrieve the requested field from doc values (or fielddata) of the document | addDocField | {
"repo_name": "coding0011/elasticsearch",
"path": "x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/execution/search/SqlSourceBuilder.java",
"license": "apache-2.0",
"size": 2511
} | [
"org.elasticsearch.search.fetch.subphase.DocValueFieldsContext"
] | import org.elasticsearch.search.fetch.subphase.DocValueFieldsContext; | import org.elasticsearch.search.fetch.subphase.*; | [
"org.elasticsearch.search"
] | org.elasticsearch.search; | 281,309 |
public static int encode(
byte[] data,
int off,
int length,
OutputStream out)
throws IOException
{
return encoder.encode(data, off, length, out);
} | static int function( byte[] data, int off, int length, OutputStream out) throws IOException { return encoder.encode(data, off, length, out); } | /**
* Encode the byte data to base 64 writing it to the given output stream.
*
* @return the number of bytes produced.
*/ | Encode the byte data to base 64 writing it to the given output stream | encode | {
"repo_name": "Skywalker-11/spongycastle",
"path": "core/src/main/java/org/spongycastle/util/encoders/Base64.java",
"license": "mit",
"size": 3991
} | [
"java.io.IOException",
"java.io.OutputStream"
] | import java.io.IOException; import java.io.OutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 741,701 |
public Integer getIntegerOrNull(int columnIndex) throws SQLException; | Integer function(int columnIndex) throws SQLException; | /**
* Returns <code>null</code> when null, not <code>0</code> as
* JDBC does by default!
*/ | Returns <code>null</code> when null, not <code>0</code> as JDBC does by default | getIntegerOrNull | {
"repo_name": "spincast/spincast-framework",
"path": "spincast-plugins/spincast-plugins-jdbc-parent/spincast-plugins-jdbc/src/main/java/org/spincast/plugins/jdbc/SpincastResultSet.java",
"license": "apache-2.0",
"size": 7942
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,568,652 |
@SuppressWarnings("ForLoopReplaceableByForEach")
private MiniFuture miniFuture(IgniteUuid miniId) {
// We iterate directly over the futs collection here to avoid copy.
synchronized (sync) {
int size = futuresCountNoLock();
// Avoid iterator creation.
for (int i = 0; i < size; i++) {
IgniteInternalFuture<Boolean> fut = future(i);
if (!isMini(fut))
continue;
MiniFuture mini = (MiniFuture)fut;
if (mini.futureId().equals(miniId)) {
if (!mini.isDone())
return mini;
else
return null;
}
}
}
return null;
} | @SuppressWarnings(STR) MiniFuture function(IgniteUuid miniId) { synchronized (sync) { int size = futuresCountNoLock(); for (int i = 0; i < size; i++) { IgniteInternalFuture<Boolean> fut = future(i); if (!isMini(fut)) continue; MiniFuture mini = (MiniFuture)fut; if (mini.futureId().equals(miniId)) { if (!mini.isDone()) return mini; else return null; } } } return null; } | /**
* Finds pending mini future by the given mini ID.
*
* @param miniId Mini ID to find.
* @return Mini future.
*/ | Finds pending mini future by the given mini ID | miniFuture | {
"repo_name": "nivanov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxRecoveryFuture.java",
"license": "apache-2.0",
"size": 20814
} | [
"org.apache.ignite.internal.IgniteInternalFuture",
"org.apache.ignite.lang.IgniteUuid"
] | import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.lang.IgniteUuid; | import org.apache.ignite.internal.*; import org.apache.ignite.lang.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,060,914 |
public void undeleteBlobContainer() {
// BEGIN: com.azure.storage.blob.BlobServiceAsyncClient.undeleteBlobContainer#String-String
ListBlobContainersOptions listBlobContainersOptions = new ListBlobContainersOptions();
listBlobContainersOptions.getDetails().setRetrieveDeleted(true);
client.listBlobContainers(listBlobContainersOptions).flatMap(
deletedContainer -> {
Mono<BlobContainerAsyncClient> blobContainerClient = client.undeleteBlobContainer(
deletedContainer.getName(), deletedContainer.getVersion());
return blobContainerClient;
}
).then().block();
// END: com.azure.storage.blob.BlobServiceAsyncClient.undeleteBlobContainer#String-String
} | void function() { ListBlobContainersOptions listBlobContainersOptions = new ListBlobContainersOptions(); listBlobContainersOptions.getDetails().setRetrieveDeleted(true); client.listBlobContainers(listBlobContainersOptions).flatMap( deletedContainer -> { Mono<BlobContainerAsyncClient> blobContainerClient = client.undeleteBlobContainer( deletedContainer.getName(), deletedContainer.getVersion()); return blobContainerClient; } ).then().block(); } | /**
* Code snippet for {@link BlobServiceAsyncClient#undeleteBlobContainer(String, String)}.
*/ | Code snippet for <code>BlobServiceAsyncClient#undeleteBlobContainer(String, String)</code> | undeleteBlobContainer | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/BlobServiceAsyncClientJavaDocCodeSnippets.java",
"license": "mit",
"size": 19033
} | [
"com.azure.storage.blob.models.ListBlobContainersOptions"
] | import com.azure.storage.blob.models.ListBlobContainersOptions; | import com.azure.storage.blob.models.*; | [
"com.azure.storage"
] | com.azure.storage; | 2,799,994 |
public StepMeta findPrevStep( StepMeta stepMeta, int nr ) {
return findPrevStep( stepMeta, nr, false );
} | StepMeta function( StepMeta stepMeta, int nr ) { return findPrevStep( stepMeta, nr, false ); } | /**
* Find the previous step on a certain location (i.e. the specified index).
*
* @param stepMeta
* The source step information
* @param nr
* the index into the hops list
*
* @return The preceding step found.
*/ | Find the previous step on a certain location (i.e. the specified index) | findPrevStep | {
"repo_name": "dkincade/pentaho-kettle",
"path": "engine/src/main/java/org/pentaho/di/trans/TransMeta.java",
"license": "apache-2.0",
"size": 227503
} | [
"org.pentaho.di.trans.step.StepMeta"
] | import org.pentaho.di.trans.step.StepMeta; | import org.pentaho.di.trans.step.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 634,914 |
public void setDate(Date value) {
set(4, value);
} | void function(Date value) { set(4, value); } | /**
* Setter for <code>public.sell_log.date</code>.
*/ | Setter for <code>public.sell_log.date</code> | setDate | {
"repo_name": "chebykinn/university",
"path": "dbs/courseWorkPart2/target/generated-sources/jooq/classes/tables/records/SellLogRecord.java",
"license": "mit",
"size": 6018
} | [
"java.sql.Date"
] | import java.sql.Date; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,563,626 |
@Test
public void convertLineToRowTest() throws Exception {
LogChannelInterface log = Mockito.mock( LogChannelInterface.class );
TextFileLine textFileLine = Mockito.mock( TextFileLine.class );
textFileLine.line = "testData1;testData2;testData3";
InputFileMetaInterface info = Mockito.mock( InputFileMetaInterface.class );
TextFileInputField[] textFileInputFields = { new TextFileInputField(), new TextFileInputField(), new TextFileInputField() };
Mockito.doReturn( textFileInputFields ).when( info ).getInputFields();
Mockito.doReturn( "CSV" ).when( info ).getFileType();
Mockito.doReturn( "/" ).when( info ).getEscapeCharacter();
Mockito.doReturn( true ).when( info ).isErrorIgnored();
Mockito.doReturn( true ).when( info ).isErrorLineSkipped();
RowMetaInterface outputRowMeta = Mockito.mock( RowMetaInterface.class );
Mockito.doReturn( 15 ).when( outputRowMeta ).size();
ValueMetaInterface valueMetaWithError = Mockito.mock( ValueMetaInterface.class );
Mockito.doThrow( new KettleValueException( "Error converting" ) ).when( valueMetaWithError ).convertDataFromString( Mockito.anyString(),
Mockito.any( ValueMetaInterface.class ), Mockito.anyString(), Mockito.anyString(), Mockito.anyInt() );
Mockito.doReturn( valueMetaWithError ).when( outputRowMeta ).getValueMeta( Mockito.anyInt() );
//it should run without NPE
TextFileInput.convertLineToRow( log, textFileLine, info, new Object[3], 1, outputRowMeta,
Mockito.mock( RowMetaInterface.class ), null, 1L, ";", null, "/", Mockito.mock( FileErrorHandler.class ),
false, false, false, false, false, false, false, false, null, null, false, new Date(), null, null, null, 1L );
} | void function() throws Exception { LogChannelInterface log = Mockito.mock( LogChannelInterface.class ); TextFileLine textFileLine = Mockito.mock( TextFileLine.class ); textFileLine.line = STR; InputFileMetaInterface info = Mockito.mock( InputFileMetaInterface.class ); TextFileInputField[] textFileInputFields = { new TextFileInputField(), new TextFileInputField(), new TextFileInputField() }; Mockito.doReturn( textFileInputFields ).when( info ).getInputFields(); Mockito.doReturn( "CSV" ).when( info ).getFileType(); Mockito.doReturn( "/" ).when( info ).getEscapeCharacter(); Mockito.doReturn( true ).when( info ).isErrorIgnored(); Mockito.doReturn( true ).when( info ).isErrorLineSkipped(); RowMetaInterface outputRowMeta = Mockito.mock( RowMetaInterface.class ); Mockito.doReturn( 15 ).when( outputRowMeta ).size(); ValueMetaInterface valueMetaWithError = Mockito.mock( ValueMetaInterface.class ); Mockito.doThrow( new KettleValueException( STR ) ).when( valueMetaWithError ).convertDataFromString( Mockito.anyString(), Mockito.any( ValueMetaInterface.class ), Mockito.anyString(), Mockito.anyString(), Mockito.anyInt() ); Mockito.doReturn( valueMetaWithError ).when( outputRowMeta ).getValueMeta( Mockito.anyInt() ); TextFileInput.convertLineToRow( log, textFileLine, info, new Object[3], 1, outputRowMeta, Mockito.mock( RowMetaInterface.class ), null, 1L, ";", null, "/", Mockito.mock( FileErrorHandler.class ), false, false, false, false, false, false, false, false, null, null, false, new Date(), null, null, null, 1L ); } | /**
* PDI-14390 Text file input throws NPE if skipping error rows and passing through incoming fieds
*
* @throws Exception
*/ | PDI-14390 Text file input throws NPE if skipping error rows and passing through incoming fieds | convertLineToRowTest | {
"repo_name": "alina-ipatina/pentaho-kettle",
"path": "engine/test-src/org/pentaho/di/trans/steps/textfileinput/TextFileInputTest.java",
"license": "apache-2.0",
"size": 12790
} | [
"java.util.Date",
"org.mockito.Mockito",
"org.pentaho.di.core.exception.KettleValueException",
"org.pentaho.di.core.logging.LogChannelInterface",
"org.pentaho.di.core.row.RowMetaInterface",
"org.pentaho.di.core.row.ValueMetaInterface",
"org.pentaho.di.trans.step.errorhandling.FileErrorHandler"
] | import java.util.Date; import org.mockito.Mockito; import org.pentaho.di.core.exception.KettleValueException; import org.pentaho.di.core.logging.LogChannelInterface; import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.core.row.ValueMetaInterface; import org.pentaho.di.trans.step.errorhandling.FileErrorHandler; | import java.util.*; import org.mockito.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.core.logging.*; import org.pentaho.di.core.row.*; import org.pentaho.di.trans.step.errorhandling.*; | [
"java.util",
"org.mockito",
"org.pentaho.di"
] | java.util; org.mockito; org.pentaho.di; | 1,471,897 |
public boolean validate(SessionKey macKey) {
verifyNotReleased();
//_beforeValidate = _context.clock().now();
boolean eq = false;
Arrays.fill(_validateBuf, (byte)0);
// validate by comparing _data[0:15] and
// HMAC(payload + IV + (payloadLength ^ protocolVersion), macKey)
int payloadLength = _packet.getLength() - MAC_SIZE - IV_SIZE;
if (payloadLength > 0) {
int off = 0;
System.arraycopy(_data, _packet.getOffset() + MAC_SIZE + IV_SIZE, _validateBuf, off, payloadLength);
off += payloadLength;
System.arraycopy(_data, _packet.getOffset() + MAC_SIZE, _validateBuf, off, IV_SIZE);
off += IV_SIZE;
DataHelper.toLong(_validateBuf, off, 2, payloadLength );
off += 2;
eq = _context.hmac().verify(macKey, _validateBuf, 0, off, _data, _packet.getOffset(), MAC_SIZE);
} else {
//if (_log.shouldLog(Log.WARN))
// _log.warn("Payload length is " + payloadLength);
}
//_afterValidate = _context.clock().now();
_validateCount++;
return eq;
} | boolean function(SessionKey macKey) { verifyNotReleased(); boolean eq = false; Arrays.fill(_validateBuf, (byte)0); int payloadLength = _packet.getLength() - MAC_SIZE - IV_SIZE; if (payloadLength > 0) { int off = 0; System.arraycopy(_data, _packet.getOffset() + MAC_SIZE + IV_SIZE, _validateBuf, off, payloadLength); off += payloadLength; System.arraycopy(_data, _packet.getOffset() + MAC_SIZE, _validateBuf, off, IV_SIZE); off += IV_SIZE; DataHelper.toLong(_validateBuf, off, 2, payloadLength ); off += 2; eq = _context.hmac().verify(macKey, _validateBuf, 0, off, _data, _packet.getOffset(), MAC_SIZE); } else { } _validateCount++; return eq; } | /**
* Validate the packet against the MAC specified, returning true if the
* MAC matches, false otherwise.
*
*/ | Validate the packet against the MAC specified, returning true if the MAC matches, false otherwise | validate | {
"repo_name": "oakes/Nightweb",
"path": "common/java/router/net/i2p/router/transport/udp/UDPPacket.java",
"license": "unlicense",
"size": 15512
} | [
"java.util.Arrays",
"net.i2p.data.DataHelper",
"net.i2p.data.SessionKey"
] | import java.util.Arrays; import net.i2p.data.DataHelper; import net.i2p.data.SessionKey; | import java.util.*; import net.i2p.data.*; | [
"java.util",
"net.i2p.data"
] | java.util; net.i2p.data; | 1,597,571 |
static void handleDialog(int event, int oldValue, int newValue, AccessibleContext context)
{
if(event == AccessibleContext.ACCESSIBLE_STATE_CHANGED)
{
if( Util.hasTransitionedToState(oldValue, newValue, AccessibleState.ACTIVE))
{
// Dialog became active, read it.
Util.speak("New dialog opened " + context.getAccessibleName());
for(int i = 0; i < context.getAccessibleChildCount(); i++)
{
AccessibleContext child = context.getAccessibleChildAt(i);
ChildReader.readChildElement(child);
}
}
}
}
| static void handleDialog(int event, int oldValue, int newValue, AccessibleContext context) { if(event == AccessibleContext.ACCESSIBLE_STATE_CHANGED) { if( Util.hasTransitionedToState(oldValue, newValue, AccessibleState.ACTIVE)) { Util.speak(STR + context.getAccessibleName()); for(int i = 0; i < context.getAccessibleChildCount(); i++) { AccessibleContext child = context.getAccessibleChildAt(i); ChildReader.readChildElement(child); } } } } | /**
* Handles event generated by accessible component with role AccessibleRole.DIALOG
* @param event Accessible event that occured
* @param oldValue Depends on event type
* @param newValue Depends on event type
* @param context Field on which event occured
*/ | Handles event generated by accessible component with role AccessibleRole.DIALOG | handleDialog | {
"repo_name": "petegerhat/blackberrymessenger",
"path": "src/lib/accessibility/reader/ScreenReaderHandler.java",
"license": "apache-2.0",
"size": 40954
} | [
"net.rim.device.api.ui.accessibility.AccessibleContext",
"net.rim.device.api.ui.accessibility.AccessibleState"
] | import net.rim.device.api.ui.accessibility.AccessibleContext; import net.rim.device.api.ui.accessibility.AccessibleState; | import net.rim.device.api.ui.accessibility.*; | [
"net.rim.device"
] | net.rim.device; | 961,157 |
private void applyChanges() {
if (selectedGroupFriendlyName != null) {
// we are applying changes to an existing group
try {
System.out.println("Members to add:");
for (Link l: membersToAdd) {
System.out.println(l.targetName());
}
System.out.println("Members to remove:");
for (Link l: membersToRemove) {
System.out.println(l.targetName());
}
Group g = gm.getGroup(selectedGroupFriendlyName, SystemConfiguration.getDefaultTimeout());
g.modify(membersToAdd, membersToRemove);
} catch (AccessDeniedException ade) {
JOptionPane.showMessageDialog(this, "You do not have the access right to edit this group.");
ade.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}
}
else {
// we are creating a new group
String newName = newGroupName.getText();
if (validateNewGroupName(newName)) {
try {
System.out.println("Members to add:");
for (Link l: membersToAdd) {
System.out.println(l.targetName());
}
gm.createGroup(newName, membersToAdd, SystemConfiguration.getDefaultTimeout());
} catch (Exception e) {
e.printStackTrace();
}
groupsContentNameList = pEnum.enumerateGroups();
groupEditorModel.clear();
groupEditorModel.addAll(groupsContentNameList.toArray());
selectGroupView();
}
}
}
| void function() { if (selectedGroupFriendlyName != null) { try { System.out.println(STR); for (Link l: membersToAdd) { System.out.println(l.targetName()); } System.out.println(STR); for (Link l: membersToRemove) { System.out.println(l.targetName()); } Group g = gm.getGroup(selectedGroupFriendlyName, SystemConfiguration.getDefaultTimeout()); g.modify(membersToAdd, membersToRemove); } catch (AccessDeniedException ade) { JOptionPane.showMessageDialog(this, STR); ade.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } else { String newName = newGroupName.getText(); if (validateNewGroupName(newName)) { try { System.out.println(STR); for (Link l: membersToAdd) { System.out.println(l.targetName()); } gm.createGroup(newName, membersToAdd, SystemConfiguration.getDefaultTimeout()); } catch (Exception e) { e.printStackTrace(); } groupsContentNameList = pEnum.enumerateGroups(); groupEditorModel.clear(); groupEditorModel.addAll(groupsContentNameList.toArray()); selectGroupView(); } } } | /**
* Apply all batched operations (addition or removal of principals)
*/ | Apply all batched operations (addition or removal of principals) | applyChanges | {
"repo_name": "ebollens/ccnmp",
"path": "javasrc/src/org/ccnx/ccn/utils/explorer/GroupManagerGUI.java",
"license": "lgpl-2.1",
"size": 17915
} | [
"javax.swing.JOptionPane",
"org.ccnx.ccn.config.SystemConfiguration",
"org.ccnx.ccn.io.content.Link",
"org.ccnx.ccn.profiles.security.access.AccessDeniedException",
"org.ccnx.ccn.profiles.security.access.group.Group"
] | import javax.swing.JOptionPane; import org.ccnx.ccn.config.SystemConfiguration; import org.ccnx.ccn.io.content.Link; import org.ccnx.ccn.profiles.security.access.AccessDeniedException; import org.ccnx.ccn.profiles.security.access.group.Group; | import javax.swing.*; import org.ccnx.ccn.config.*; import org.ccnx.ccn.io.content.*; import org.ccnx.ccn.profiles.security.access.*; import org.ccnx.ccn.profiles.security.access.group.*; | [
"javax.swing",
"org.ccnx.ccn"
] | javax.swing; org.ccnx.ccn; | 372,539 |
public static PixelImage read(ImageType type, PixelFormat format, InputStream is) throws IOException {
switch(type) {
case PSD:
PsdImage psdImage = new PsdImage();
psdImage.read(is, format, false);
return psdImage;
case DDS: // Not yet implemented
case TGA: // Not yet implemented
default:
throw new IOException("No Support ImageType:"+type.toString());
}
}
| static PixelImage function(ImageType type, PixelFormat format, InputStream is) throws IOException { switch(type) { case PSD: PsdImage psdImage = new PsdImage(); psdImage.read(is, format, false); return psdImage; case DDS: case TGA: default: throw new IOException(STR+type.toString()); } } | /**
* create a PixelImage instance from InputStream with pixel format.
* DDS/TGA is not yet implemented.
* @param type image type
* @param format pixel format
* @param is InputStream
* @return a PixelImage instance
* @throws IOException throws IOException
*/ | create a PixelImage instance from InputStream with pixel format. DDS/TGA is not yet implemented | read | {
"repo_name": "npedotnet/npe-image-library",
"path": "src/net/npe/image/util/ImageReader.java",
"license": "mit",
"size": 3525
} | [
"java.io.IOException",
"java.io.InputStream",
"net.npe.image.PixelFormat",
"net.npe.image.PixelImage",
"net.npe.image.psd.PsdImage"
] | import java.io.IOException; import java.io.InputStream; import net.npe.image.PixelFormat; import net.npe.image.PixelImage; import net.npe.image.psd.PsdImage; | import java.io.*; import net.npe.image.*; import net.npe.image.psd.*; | [
"java.io",
"net.npe.image"
] | java.io; net.npe.image; | 880,529 |
public void workflowStateChanged(final WorkflowEvent event) {
if (event == null)
return;
switch (event.getId()) {
case WorkflowEvent.ELEMENTS_STOP_EVENT:
stop();
break;
case WorkflowEvent.ELEMENTS_PAUSE_EVENT:
pause();
break;
case WorkflowEvent.ELEMENTS_RESUME_EVENT:
resume();
break;
default:
break;
}
}
//
// Constructor
//
public Algorithm() throws PlatformException {
} | void function(final WorkflowEvent event) { if (event == null) return; switch (event.getId()) { case WorkflowEvent.ELEMENTS_STOP_EVENT: stop(); break; case WorkflowEvent.ELEMENTS_PAUSE_EVENT: pause(); break; case WorkflowEvent.ELEMENTS_RESUME_EVENT: resume(); break; default: break; } } public Algorithm() throws PlatformException { } | /**
* Invoked when the target of the listener has changed its state.
* @param event a WorkflowEvent object
*/ | Invoked when the target of the listener has changed its state | workflowStateChanged | {
"repo_name": "GenomicParisCentre/doelan",
"path": "src/main/java/fr/ens/transcriptome/nividic/platform/workflow/Algorithm.java",
"license": "gpl-2.0",
"size": 8846
} | [
"fr.ens.transcriptome.nividic.platform.PlatformException"
] | import fr.ens.transcriptome.nividic.platform.PlatformException; | import fr.ens.transcriptome.nividic.platform.*; | [
"fr.ens.transcriptome"
] | fr.ens.transcriptome; | 2,844,828 |
protected static String getOutputName(JobContext job) {
return job.getConfiguration().get(BASE_OUTPUT_NAME, PART);
} | static String function(JobContext job) { return job.getConfiguration().get(BASE_OUTPUT_NAME, PART); } | /**
* Get the base output name for the output file.
*/ | Get the base output name for the output file | getOutputName | {
"repo_name": "dennishuo/hadoop",
"path": "hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/FileOutputFormat.java",
"license": "apache-2.0",
"size": 13803
} | [
"org.apache.hadoop.mapreduce.JobContext"
] | import org.apache.hadoop.mapreduce.JobContext; | import org.apache.hadoop.mapreduce.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,246,709 |
@Override
protected Sequencial getFixture() {
return (Sequencial)fixture;
} | Sequencial function() { return (Sequencial)fixture; } | /**
* Returns the fixture for this Sequencial test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | Returns the fixture for this Sequencial test case. | getFixture | {
"repo_name": "netuh/DecodePlatformPlugin",
"path": "br.edu.ufpe.ines.decode.model.tests/src/br/edu/ufpe/ines/decode/taskDescription/tests/SequencialTest.java",
"license": "gpl-3.0",
"size": 1474
} | [
"br.edu.ufpe.ines.decode.taskDescription.Sequencial"
] | import br.edu.ufpe.ines.decode.taskDescription.Sequencial; | import br.edu.ufpe.ines.decode.*; | [
"br.edu.ufpe"
] | br.edu.ufpe; | 1,419,927 |
public static Map<String, CmsClientProperty> makeLazyCopy(Map<String, CmsClientProperty> properties) {
if (properties == null) {
return null;
}
return toLazyMap(copyProperties(properties));
} | static Map<String, CmsClientProperty> function(Map<String, CmsClientProperty> properties) { if (properties == null) { return null; } return toLazyMap(copyProperties(properties)); } | /**
* Makes a "lazy copy" of a map of properties, which will create properties on lookup if they don't already exist.<p>
*
* @param properties the properties to copy
*
* @return the lazy copy of the properties
*/ | Makes a "lazy copy" of a map of properties, which will create properties on lookup if they don't already exist | makeLazyCopy | {
"repo_name": "serrapos/opencms-core",
"path": "src/org/opencms/gwt/shared/property/CmsClientProperty.java",
"license": "lgpl-2.1",
"size": 11737
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,521,317 |
protected char getHandleMementoDelimiter(){
Assert.isTrue(false, "Should not be called"); //$NON-NLS-1$
return 0;
} | char function(){ Assert.isTrue(false, STR); return 0; } | /**
* Returns the <code>char</code> that marks the start of this handles
* contribution to a memento.
*/ | Returns the <code>char</code> that marks the start of this handles contribution to a memento | getHandleMementoDelimiter | {
"repo_name": "dhuebner/che",
"path": "plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/core/JavaModel.java",
"license": "epl-1.0",
"size": 15589
} | [
"org.eclipse.core.runtime.Assert"
] | import org.eclipse.core.runtime.Assert; | import org.eclipse.core.runtime.*; | [
"org.eclipse.core"
] | org.eclipse.core; | 415,735 |
public static void close() {
synchronized (INSTANCE_LOCK) {
if (INSTANCE != null) {
Logger innerLogger = INSTANCE.logger;
// remove any existing handlers
cleanupLogger(innerLogger);
}
// make singleton null
INSTANCE = null;
}
} | static void function() { synchronized (INSTANCE_LOCK) { if (INSTANCE != null) { Logger innerLogger = INSTANCE.logger; cleanupLogger(innerLogger); } INSTANCE = null; } } | /**
* Closes the current LogWrapper.
*/ | Closes the current LogWrapper | close | {
"repo_name": "deepakddixit/incubator-geode",
"path": "geode-core/src/main/java/org/apache/geode/management/internal/cli/LogWrapper.java",
"license": "apache-2.0",
"size": 11299
} | [
"java.util.logging.Logger"
] | import java.util.logging.Logger; | import java.util.logging.*; | [
"java.util"
] | java.util; | 1,591,289 |
protected Locale getUserLocale(final HttpServletRequest request) {
Locale locale = null;
UserContext userContext = getUserContext(request);
if (null != userContext) {
locale = userContext.getCurrentLocale();
}
return locale;
}
private class DummyBusinessService implements BusinessService { | Locale function(final HttpServletRequest request) { Locale locale = null; UserContext userContext = getUserContext(request); if (null != userContext) { locale = userContext.getCurrentLocale(); } return locale; } private class DummyBusinessService implements BusinessService { | /**
* used by JSP functions in view.
*/ | used by JSP functions in view | getUserLocale | {
"repo_name": "mifos/1.4.x",
"path": "application/src/main/java/org/mifos/application/collectionsheet/struts/action/CollectionSheetEntryAction.java",
"license": "apache-2.0",
"size": 29830
} | [
"java.util.Locale",
"javax.servlet.http.HttpServletRequest",
"org.mifos.framework.business.service.BusinessService",
"org.mifos.framework.security.util.UserContext"
] | import java.util.Locale; import javax.servlet.http.HttpServletRequest; import org.mifos.framework.business.service.BusinessService; import org.mifos.framework.security.util.UserContext; | import java.util.*; import javax.servlet.http.*; import org.mifos.framework.business.service.*; import org.mifos.framework.security.util.*; | [
"java.util",
"javax.servlet",
"org.mifos.framework"
] | java.util; javax.servlet; org.mifos.framework; | 1,616,727 |
public void synchroniseAutoLoad(final Theme theme) {
final List<String> enabled = identityController.getGlobalConfiguration()
.getOptionList("themes", "enabled", true);
if (theme.isEnabled()) {
enabled.add(theme.getFileName());
} else {
enabled.remove(theme.getFileName());
}
identityController.getUserSettings()
.setOption("themes", "enabled", enabled);
} | void function(final Theme theme) { final List<String> enabled = identityController.getGlobalConfiguration() .getOptionList(STR, STR, true); if (theme.isEnabled()) { enabled.add(theme.getFileName()); } else { enabled.remove(theme.getFileName()); } identityController.getUserSettings() .setOption(STR, STR, enabled); } | /**
* Updates the theme auto load list with the state of the specified theme.
*
* @param theme Theme to update auto load
*/ | Updates the theme auto load list with the state of the specified theme | synchroniseAutoLoad | {
"repo_name": "csmith/DMDirc",
"path": "src/main/java/com/dmdirc/ui/themes/ThemeManager.java",
"license": "mit",
"size": 5404
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 961,372 |
public void setDisplayProperties(FileDisplayProperties displayProperties) {
this.displayProperties = displayProperties;
} | void function(FileDisplayProperties displayProperties) { this.displayProperties = displayProperties; } | /**
* Sets the display properties.
*
* @param displayProperties the new display properties
*/ | Sets the display properties | setDisplayProperties | {
"repo_name": "taconaut/ums-mlx",
"path": "core/src/main/java/net/pms/medialibrary/dlna/MediaLibraryRealFile.java",
"license": "gpl-2.0",
"size": 12810
} | [
"net.pms.medialibrary.commons.dataobjects.FileDisplayProperties"
] | import net.pms.medialibrary.commons.dataobjects.FileDisplayProperties; | import net.pms.medialibrary.commons.dataobjects.*; | [
"net.pms.medialibrary"
] | net.pms.medialibrary; | 1,563,899 |
public static void disposeCursors() {
for (Cursor cursor : m_idToCursorMap.values()) {
cursor.dispose();
}
m_idToCursorMap.clear();
} | static void function() { for (Cursor cursor : m_idToCursorMap.values()) { cursor.dispose(); } m_idToCursorMap.clear(); } | /**
* Dispose all of the cached cursors.
*/ | Dispose all of the cached cursors | disposeCursors | {
"repo_name": "0359xiaodong/swtUI4",
"path": "src/main/java/eclipse/wb/swt/SWTResourceManager.java",
"license": "apache-2.0",
"size": 14526
} | [
"org.eclipse.swt.graphics.Cursor"
] | import org.eclipse.swt.graphics.Cursor; | import org.eclipse.swt.graphics.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 1,900,363 |
public void concatMatrix(final AffineTransform at) throws IOException {
getCurrentState().concatMatrix(at);
writeln(formatMatrix(at) + " " + mapCommand("concat"));
} | void function(final AffineTransform at) throws IOException { getCurrentState().concatMatrix(at); writeln(formatMatrix(at) + " " + mapCommand(STR)); } | /**
* Concats the transformations matric.
*
* @param at
* the AffineTransform whose matrix to use
* @exception IOException
* In case of an I/O problem
*/ | Concats the transformations matric | concatMatrix | {
"repo_name": "Guronzan/Apache-XmlGraphics",
"path": "src/main/java/org/apache/xmlgraphics/ps/PSGenerator.java",
"license": "apache-2.0",
"size": 32360
} | [
"java.awt.geom.AffineTransform",
"java.io.IOException"
] | import java.awt.geom.AffineTransform; import java.io.IOException; | import java.awt.geom.*; import java.io.*; | [
"java.awt",
"java.io"
] | java.awt; java.io; | 1,530,128 |
public boolean tryUnpackNil()
throws IOException
{
// makes sure that buffer has at least 1 byte
if (!ensureBuffer()) {
throw new MessageInsufficientBufferException();
}
byte b = buffer.getByte(position);
if (b == Code.NIL) {
readByte();
return true;
}
return false;
} | boolean function() throws IOException { if (!ensureBuffer()) { throw new MessageInsufficientBufferException(); } byte b = buffer.getByte(position); if (b == Code.NIL) { readByte(); return true; } return false; } | /**
* Peeks a Nil byte and reads it if next byte is a nil value.
*
* The difference from {@link unpackNil} is that unpackNil throws an exception if the next byte is not nil value
* while this tryUnpackNil method returns false without changing position.
*
* @return true if a nil value is read
* @throws MessageInsufficientBufferException when the end of file reached
* @throws IOException when underlying input throws IOException
*/ | Peeks a Nil byte and reads it if next byte is a nil value. The difference from <code>unpackNil</code> is that unpackNil throws an exception if the next byte is not nil value while this tryUnpackNil method returns false without changing position | tryUnpackNil | {
"repo_name": "msgpack/msgpack-java",
"path": "msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java",
"license": "apache-2.0",
"size": 62729
} | [
"java.io.IOException",
"org.msgpack.core.MessagePack"
] | import java.io.IOException; import org.msgpack.core.MessagePack; | import java.io.*; import org.msgpack.core.*; | [
"java.io",
"org.msgpack.core"
] | java.io; org.msgpack.core; | 1,353,445 |
@FIXVersion(introduced="5.0SP1")
public UnderlyingLegSecurityAltIDGroup[] getUnderlyingLegSecurityAltIDGroups() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
} | @FIXVersion(introduced=STR) UnderlyingLegSecurityAltIDGroup[] function() { throw new UnsupportedOperationException(getUnsupportedTagMessage()); } | /**
* Message field getter for <code>UnderlyingLegSecurityAltIDGroup</code> array of groups.
* @return field array value
*/ | Message field getter for <code>UnderlyingLegSecurityAltIDGroup</code> array of groups | getUnderlyingLegSecurityAltIDGroups | {
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/comp/UnderlyingLegInstrument.java",
"license": "gpl-3.0",
"size": 27982
} | [
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.group.UnderlyingLegSecurityAltIDGroup"
] | import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.group.UnderlyingLegSecurityAltIDGroup; | import net.hades.fix.message.anno.*; import net.hades.fix.message.group.*; | [
"net.hades.fix"
] | net.hades.fix; | 1,046,779 |
public MatchResult toMatchResult() {
final AutomatonMatcher match = new AutomatonMatcher(chars, automaton);
match.matchStart = this.matchStart;
match.matchEnd = this.matchEnd;
return match;
} | MatchResult function() { final AutomatonMatcher match = new AutomatonMatcher(chars, automaton); match.matchStart = this.matchStart; match.matchEnd = this.matchEnd; return match; } | /**
* Returns the current state of this {@code AutomatonMatcher} as a
* {@code MatchResult}.
* The result is unaffected by subsequent operations on this object.
*
* @return a {@code MatchResult} with the state of this
* {@code AutomatonMatcher}.
*/ | Returns the current state of this AutomatonMatcher as a MatchResult. The result is unaffected by subsequent operations on this object | toMatchResult | {
"repo_name": "biotextmining/processes",
"path": "src/main/java/com/silicolife/textmining/processes/ie/ner/linnaeus/adapt/dk/brics/automaton/AutomatonMatcher.java",
"license": "lgpl-3.0",
"size": 9042
} | [
"java.util.regex.MatchResult"
] | import java.util.regex.MatchResult; | import java.util.regex.*; | [
"java.util"
] | java.util; | 309,397 |
public Input getAggregate() {
return aggregate;
} | Input function() { return aggregate; } | /**
* Gets the aggregate.
*
* @return the aggregate
*/ | Gets the aggregate | getAggregate | {
"repo_name": "freeacs/web",
"path": "src/com/owera/xaps/web/app/page/unit/UnitStatusData.java",
"license": "mit",
"size": 3293
} | [
"com.owera.xaps.web.app.input.Input"
] | import com.owera.xaps.web.app.input.Input; | import com.owera.xaps.web.app.input.*; | [
"com.owera.xaps"
] | com.owera.xaps; | 863,671 |
public void scheduleAdminEmailForSending(String emailId, String emailReceiver, String emailSubject,
String emailContent) {
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put(ParamsNames.ADMIN_EMAIL_RECEIVER, emailReceiver);
paramMap.put(ParamsNames.ADMIN_EMAIL_SUBJECT, emailSubject);
paramMap.put(ParamsNames.ADMIN_EMAIL_CONTENT, emailContent);
try {
addTask(TaskQueue.ADMIN_SEND_EMAIL_QUEUE_NAME, TaskQueue.ADMIN_SEND_EMAIL_WORKER_URL, paramMap);
} catch (IllegalArgumentException e) {
if (e.getMessage().toLowerCase().contains("task size too large")) {
log.info("Email task size exceeds max limit. Switching to large email task mode.");
paramMap.remove(ParamsNames.ADMIN_EMAIL_SUBJECT);
paramMap.remove(ParamsNames.ADMIN_EMAIL_CONTENT);
paramMap.put(ParamsNames.ADMIN_EMAIL_ID, emailId);
addTask(TaskQueue.ADMIN_SEND_EMAIL_QUEUE_NAME, TaskQueue.ADMIN_SEND_EMAIL_WORKER_URL, paramMap);
}
}
} | void function(String emailId, String emailReceiver, String emailSubject, String emailContent) { Map<String, String> paramMap = new HashMap<String, String>(); paramMap.put(ParamsNames.ADMIN_EMAIL_RECEIVER, emailReceiver); paramMap.put(ParamsNames.ADMIN_EMAIL_SUBJECT, emailSubject); paramMap.put(ParamsNames.ADMIN_EMAIL_CONTENT, emailContent); try { addTask(TaskQueue.ADMIN_SEND_EMAIL_QUEUE_NAME, TaskQueue.ADMIN_SEND_EMAIL_WORKER_URL, paramMap); } catch (IllegalArgumentException e) { if (e.getMessage().toLowerCase().contains(STR)) { log.info(STR); paramMap.remove(ParamsNames.ADMIN_EMAIL_SUBJECT); paramMap.remove(ParamsNames.ADMIN_EMAIL_CONTENT); paramMap.put(ParamsNames.ADMIN_EMAIL_ID, emailId); addTask(TaskQueue.ADMIN_SEND_EMAIL_QUEUE_NAME, TaskQueue.ADMIN_SEND_EMAIL_WORKER_URL, paramMap); } } } | /**
* Schedules an admin email to be sent.
*
* @param emailId the ID of admin email to be retrieved from the database (if needed)
* @param emailReceiver the email address of the email receiver
* @param emailSubject the subject of the email
* @param emailContent the content of the email
*/ | Schedules an admin email to be sent | scheduleAdminEmailForSending | {
"repo_name": "karthikaacharya/teammates",
"path": "src/main/java/teammates/logic/api/TaskQueuer.java",
"license": "gpl-2.0",
"size": 15617
} | [
"java.util.HashMap",
"java.util.Map"
] | import java.util.HashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,722,036 |
public static Request aClass(Class<?> clazz) {
return new ClassRequest(clazz);
}
| static Request function(Class<?> clazz) { return new ClassRequest(clazz); } | /**
* Create a <code>Request</code> that, when processed, will run all the tests
* in a class. The odd name is necessary because <code>class</code> is a reserved word.
*
* @param clazz the class containing the tests
* @return a <code>Request</code> that will cause all tests in the class to be run
*/ | Create a <code>Request</code> that, when processed, will run all the tests in a class. The odd name is necessary because <code>class</code> is a reserved word | aClass | {
"repo_name": "UnimibSoftEngCourse1516/lab2-es3-m.polonioli",
"path": "src/main/java/org/junit/runner/Request.java",
"license": "epl-1.0",
"size": 6563
} | [
"org.junit.internal.requests.ClassRequest"
] | import org.junit.internal.requests.ClassRequest; | import org.junit.internal.requests.*; | [
"org.junit.internal"
] | org.junit.internal; | 1,771,495 |
public static void println(int line, String text) {
if (line < 1 || line > 6) {
return;
}
// if (marqueedLines[line - 1] != null) {
// marqueedLines[line - 1] = null;
// }
//truncate the text if it's longer than the maximum length and add a marker to indicate that it was truncated
if (text.length() > MAX_LINE_LENGTH) {
text = text.substring(0, MAX_LINE_LENGTH - TRUNCATE_MARKER.length()) + TRUNCATE_MARKER;
}
switch (line) {
case 1:
display.println(DriverStationLCD.Line.kUser1, 1, text);
break;
case 2:
display.println(DriverStationLCD.Line.kUser2, 1, text);
break;
case 3:
display.println(DriverStationLCD.Line.kUser3, 1, text);
break;
case 4:
display.println(DriverStationLCD.Line.kUser4, 1, text);
break;
case 5:
display.println(DriverStationLCD.Line.kUser5, 1, text);
break;
case 6:
display.println(DriverStationLCD.Line.kUser6, 1, text);
break;
}
} | static void function(int line, String text) { if (line < 1 line > 6) { return; } if (text.length() > MAX_LINE_LENGTH) { text = text.substring(0, MAX_LINE_LENGTH - TRUNCATE_MARKER.length()) + TRUNCATE_MARKER; } switch (line) { case 1: display.println(DriverStationLCD.Line.kUser1, 1, text); break; case 2: display.println(DriverStationLCD.Line.kUser2, 1, text); break; case 3: display.println(DriverStationLCD.Line.kUser3, 1, text); break; case 4: display.println(DriverStationLCD.Line.kUser4, 1, text); break; case 5: display.println(DriverStationLCD.Line.kUser5, 1, text); break; case 6: display.println(DriverStationLCD.Line.kUser6, 1, text); break; } } | /**
* Prints text to a specific line on the LCD display
*
* @param line Line number from [1,6].
* @param text String to print out. If it's longer than
* {@link #MAX_LINE_LENGTH} characters, it will be truncated and a marker
* ({@link #TRUNCATE_MARKER}) will be added on to the end.
*/ | Prints text to a specific line on the LCD display | println | {
"repo_name": "SaratogaMSET/649mset2014testcode",
"path": "src/edu/wpi/first/wpilibj/templates/Display.java",
"license": "bsd-3-clause",
"size": 6960
} | [
"edu.wpi.first.wpilibj.DriverStationLCD"
] | import edu.wpi.first.wpilibj.DriverStationLCD; | import edu.wpi.first.wpilibj.*; | [
"edu.wpi.first"
] | edu.wpi.first; | 2,464,905 |
public Query like(File f) throws IOException {
if (fieldNames == null) {
// gather list of valid fields from lucene
Collection<String> fields = ir.getFieldNames( IndexReader.FieldOption.INDEXED);
fieldNames = fields.toArray(new String[fields.size()]);
}
return like(new FileReader(f));
} | Query function(File f) throws IOException { if (fieldNames == null) { Collection<String> fields = ir.getFieldNames( IndexReader.FieldOption.INDEXED); fieldNames = fields.toArray(new String[fields.size()]); } return like(new FileReader(f)); } | /**
* Return a query that will return docs like the passed file.
*
* @return a query that will return docs like the passed file.
*/ | Return a query that will return docs like the passed file | like | {
"repo_name": "sluk3r/lucene-3.0.2-src-study",
"path": "contrib/queries/src/java/org/apache/lucene/search/similar/MoreLikeThis.java",
"license": "apache-2.0",
"size": 34179
} | [
"java.io.File",
"java.io.FileReader",
"java.io.IOException",
"java.util.Collection",
"org.apache.lucene.index.IndexReader",
"org.apache.lucene.search.Query"
] | import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.Collection; import org.apache.lucene.index.IndexReader; import org.apache.lucene.search.Query; | import java.io.*; import java.util.*; import org.apache.lucene.index.*; import org.apache.lucene.search.*; | [
"java.io",
"java.util",
"org.apache.lucene"
] | java.io; java.util; org.apache.lucene; | 1,548,226 |
@Test
public void setupPathTest19() {
build4RouterTopo(false, false, false, false, 0);
List<ExplicitPathInfo> explicitPathInfoList = Lists.newLinkedList();
ExplicitPathInfo obj = new ExplicitPathInfo(ExplicitPathInfo.Type.LOOSE, link1);
explicitPathInfoList.add(obj);
obj = new ExplicitPathInfo(ExplicitPathInfo.Type.STRICT, D2.deviceId());
explicitPathInfoList.add(obj);
boolean result = pceManager.setupPath(D1.deviceId(), D5.deviceId(), "T123", null, WITH_SIGNALLING,
explicitPathInfoList);
Tunnel tunnel = pceManager.queryAllPath().iterator().next();
List<Link> links = new LinkedList<>();
links.add(link1);
links.add(link5);
assertThat(result, is(true));
assertThat(tunnel.path().links().equals(links), is(true));
} | void function() { build4RouterTopo(false, false, false, false, 0); List<ExplicitPathInfo> explicitPathInfoList = Lists.newLinkedList(); ExplicitPathInfo obj = new ExplicitPathInfo(ExplicitPathInfo.Type.LOOSE, link1); explicitPathInfoList.add(obj); obj = new ExplicitPathInfo(ExplicitPathInfo.Type.STRICT, D2.deviceId()); explicitPathInfoList.add(obj); boolean result = pceManager.setupPath(D1.deviceId(), D5.deviceId(), "T123", null, WITH_SIGNALLING, explicitPathInfoList); Tunnel tunnel = pceManager.queryAllPath().iterator().next(); List<Link> links = new LinkedList<>(); links.add(link1); links.add(link5); assertThat(result, is(true)); assertThat(tunnel.path().links().equals(links), is(true)); } | /**
* Tests path setup with explicit path with loose D1-D2, strict D2.
*/ | Tests path setup with explicit path with loose D1-D2, strict D2 | setupPathTest19 | {
"repo_name": "wuwenbin2/onos_bgp_evpn",
"path": "apps/pce/app/src/test/java/org/onosproject/pce/pceservice/PceManagerTest.java",
"license": "apache-2.0",
"size": 64771
} | [
"com.google.common.collect.Lists",
"java.util.LinkedList",
"java.util.List",
"org.hamcrest.MatcherAssert",
"org.hamcrest.core.Is",
"org.onosproject.incubator.net.tunnel.Tunnel",
"org.onosproject.net.Link"
] | import com.google.common.collect.Lists; import java.util.LinkedList; import java.util.List; import org.hamcrest.MatcherAssert; import org.hamcrest.core.Is; import org.onosproject.incubator.net.tunnel.Tunnel; import org.onosproject.net.Link; | import com.google.common.collect.*; import java.util.*; import org.hamcrest.*; import org.hamcrest.core.*; import org.onosproject.incubator.net.tunnel.*; import org.onosproject.net.*; | [
"com.google.common",
"java.util",
"org.hamcrest",
"org.hamcrest.core",
"org.onosproject.incubator",
"org.onosproject.net"
] | com.google.common; java.util; org.hamcrest; org.hamcrest.core; org.onosproject.incubator; org.onosproject.net; | 414,460 |
public static Map<String, List<String> > getEvaluatedNavigationParameters(
FacesContext facesContext,
Map<String, List<String> > parameters)
{
Map<String,List<String>> evaluatedParameters = null;
if (parameters != null && parameters.size() > 0)
{
evaluatedParameters = new HashMap<String, List<String>>();
for (Map.Entry<String, List<String>> pair : parameters.entrySet())
{
boolean containsEL = false;
for (String value : pair.getValue())
{
if (_isExpression(value))
{
containsEL = true;
break;
}
}
if (containsEL)
{
evaluatedParameters.put(pair.getKey(),
_evaluateValueExpressions(facesContext, pair.getValue()));
}
else
{
evaluatedParameters.put(pair.getKey(), pair.getValue());
}
}
}
else
{
evaluatedParameters = parameters;
}
return evaluatedParameters;
} | static Map<String, List<String> > function( FacesContext facesContext, Map<String, List<String> > parameters) { Map<String,List<String>> evaluatedParameters = null; if (parameters != null && parameters.size() > 0) { evaluatedParameters = new HashMap<String, List<String>>(); for (Map.Entry<String, List<String>> pair : parameters.entrySet()) { boolean containsEL = false; for (String value : pair.getValue()) { if (_isExpression(value)) { containsEL = true; break; } } if (containsEL) { evaluatedParameters.put(pair.getKey(), _evaluateValueExpressions(facesContext, pair.getValue())); } else { evaluatedParameters.put(pair.getKey(), pair.getValue()); } } } else { evaluatedParameters = parameters; } return evaluatedParameters; } | /**
* Evaluate all EL expressions found as parameters and return a map that can be used for
* redirect or render bookmark links
*
* @param parameters parameter map retrieved from NavigationCase.getParameters()
* @return
*/ | Evaluate all EL expressions found as parameters and return a map that can be used for redirect or render bookmark links | getEvaluatedNavigationParameters | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/application/_NavigationUtils.java",
"license": "epl-1.0",
"size": 3633
} | [
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"javax.faces.context.FacesContext"
] | import java.util.HashMap; import java.util.List; import java.util.Map; import javax.faces.context.FacesContext; | import java.util.*; import javax.faces.context.*; | [
"java.util",
"javax.faces"
] | java.util; javax.faces; | 565,368 |
public List<String> getImageSizesDescription(Context context) {
ArrayList<String> imagesSizesDescriptionList = new ArrayList<>();
if (null != mFullImageSize) {
imagesSizesDescriptionList.add(context.getString(R.string.compression_opt_list_original));
}
if (null != mLargeImageSize) {
imagesSizesDescriptionList.add(context.getString(R.string.compression_opt_list_large));
}
if (null != mMediumImageSize) {
imagesSizesDescriptionList.add(context.getString(R.string.compression_opt_list_medium));
}
if (null != mSmallImageSize) {
imagesSizesDescriptionList.add(context.getString(R.string.compression_opt_list_small));
}
return imagesSizesDescriptionList;
} | List<String> function(Context context) { ArrayList<String> imagesSizesDescriptionList = new ArrayList<>(); if (null != mFullImageSize) { imagesSizesDescriptionList.add(context.getString(R.string.compression_opt_list_original)); } if (null != mLargeImageSize) { imagesSizesDescriptionList.add(context.getString(R.string.compression_opt_list_large)); } if (null != mMediumImageSize) { imagesSizesDescriptionList.add(context.getString(R.string.compression_opt_list_medium)); } if (null != mSmallImageSize) { imagesSizesDescriptionList.add(context.getString(R.string.compression_opt_list_small)); } return imagesSizesDescriptionList; } | /**
* Provides the defined compression description.
* @param context the context
* @return the list of compression description
*/ | Provides the defined compression description | getImageSizesDescription | {
"repo_name": "vt0r/vector-android",
"path": "vector/src/main/java/im/vector/util/VectorRoomMediasSender.java",
"license": "apache-2.0",
"size": 36775
} | [
"android.content.Context",
"java.util.ArrayList",
"java.util.List"
] | import android.content.Context; import java.util.ArrayList; import java.util.List; | import android.content.*; import java.util.*; | [
"android.content",
"java.util"
] | android.content; java.util; | 821,056 |
public static URL download(URL url)
throws IOException
{
if ("file".equals(url.getProtocol()))
{
return url;
}
File tempFile = null;
try (InputStream in = openGetStream(url))
{
tempFile = File.createTempFile("portecle", null);
try (OutputStream out = new BufferedOutputStream(new FileOutputStream(tempFile)))
{
byte[] buf = new byte[2048];
int n;
while ((n = in.read(buf)) != -1)
{
out.write(buf, 0, n);
}
}
}
catch (IOException e)
{
if (tempFile != null && !tempFile.delete())
{
LOG.log(Level.WARNING, "Could not delete temporary file " + tempFile);
}
throw e;
}
tempFile.deleteOnExit();
return tempFile.toURI().toURL();
} | static URL function(URL url) throws IOException { if ("file".equals(url.getProtocol())) { return url; } File tempFile = null; try (InputStream in = openGetStream(url)) { tempFile = File.createTempFile(STR, null); try (OutputStream out = new BufferedOutputStream(new FileOutputStream(tempFile))) { byte[] buf = new byte[2048]; int n; while ((n = in.read(buf)) != -1) { out.write(buf, 0, n); } } } catch (IOException e) { if (tempFile != null && !tempFile.delete()) { LOG.log(Level.WARNING, STR + tempFile); } throw e; } tempFile.deleteOnExit(); return tempFile.toURI().toURL(); } | /**
* Download the given URL to a temporary local file. The temporary file is marked for deletion at exit.
*
* @param url
* @return URL pointing to the temporary file, <code>url</code> itself if it's a file: one.
* @throws IOException
*/ | Download the given URL to a temporary local file. The temporary file is marked for deletion at exit | download | {
"repo_name": "scop/portecle",
"path": "src/main/net/sf/portecle/NetUtil.java",
"license": "gpl-2.0",
"size": 4510
} | [
"java.io.BufferedOutputStream",
"java.io.File",
"java.io.FileOutputStream",
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream",
"java.util.logging.Level"
] | import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.logging.Level; | import java.io.*; import java.util.logging.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,042,061 |
public static HtmlPrintElement getHtmlPrintElement() throws JRException
{
HtmlPrintElementFactory printElementFactory = getHtmlPrintElementFactory();
return printElementFactory.getHtmlPrintElement();
}
private HtmlPrintElementUtils()
{
} | static HtmlPrintElement function() throws JRException { HtmlPrintElementFactory printElementFactory = getHtmlPrintElementFactory(); return printElementFactory.getHtmlPrintElement(); } private HtmlPrintElementUtils() { } | /**
* Produces an {@link HtmlPrintElement} instance by means of the factory
* returned by {@link #getHtmlPrintElementFactory() getHtmlPrintElementFactory()}.
*
* @return an HtmlPrintElement instance
* @throws JRException if the {@link #PROPERTY_HTML_PRINTELEMENT_FACTORY html print element property} is not defined
* or the factory cannot be instantiated.
*/ | Produces an <code>HtmlPrintElement</code> instance by means of the factory returned by <code>#getHtmlPrintElementFactory() getHtmlPrintElementFactory()</code> | getHtmlPrintElement | {
"repo_name": "aleatorio12/ProVentasConnector",
"path": "jasperreports-6.2.1-project/jasperreports-6.2.1/demo/samples/htmlcomponent/src/net/sf/jasperreports/engine/util/HtmlPrintElementUtils.java",
"license": "gpl-3.0",
"size": 3395
} | [
"net.sf.jasperreports.engine.JRException"
] | import net.sf.jasperreports.engine.JRException; | import net.sf.jasperreports.engine.*; | [
"net.sf.jasperreports"
] | net.sf.jasperreports; | 2,180,264 |
public Map<String, SignalListenerContainer> getSignalListeners();
| Map<String, SignalListenerContainer> function(); | /**
* Gets the list of available signal listeners that the sub-system is listening to
*
* @return A mapping of listener names to listener concrete implementations
*/ | Gets the list of available signal listeners that the sub-system is listening to | getSignalListeners | {
"repo_name": "danielricci/gosling-engine",
"path": "src/engine/communication/internal/signal/ISignalListener.java",
"license": "mit",
"size": 7268
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 989,971 |
public XQueryExpression xquery(String expression, Class<?> resultType) {
XQueryExpression answer = new XQueryExpression(expression);
answer.setResultType(resultType);
configure(answer);
return answer;
} | XQueryExpression function(String expression, Class<?> resultType) { XQueryExpression answer = new XQueryExpression(expression); answer.setResultType(resultType); configure(answer); return answer; } | /**
* Creates the XQuery expression using the current namespace context
* and the given expected return type
*/ | Creates the XQuery expression using the current namespace context and the given expected return type | xquery | {
"repo_name": "chicagozer/rheosoft",
"path": "camel-core/src/main/java/org/apache/camel/builder/xml/Namespaces.java",
"license": "apache-2.0",
"size": 5185
} | [
"org.apache.camel.model.language.XQueryExpression"
] | import org.apache.camel.model.language.XQueryExpression; | import org.apache.camel.model.language.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,705,049 |
public DateTime lastUpdateUtc() {
return this.lastUpdateUtc;
} | DateTime function() { return this.lastUpdateUtc; } | /**
* Get timestamp of the last update to the tracked resource.
*
* @return the lastUpdateUtc value
*/ | Get timestamp of the last update to the tracked resource | lastUpdateUtc | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/policyinsights/mgmt-v2018_07_01_preview/src/main/java/com/microsoft/azure/management/policyinsights/v2018_07_01_preview/implementation/PolicyTrackedResourceInner.java",
"license": "mit",
"size": 2945
} | [
"org.joda.time.DateTime"
] | import org.joda.time.DateTime; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 1,187,830 |
private Bitmap getRotatedBitmap(int rotate, Bitmap bitmap, ExifHelper exif) {
Matrix matrix = new Matrix();
if (rotate == 180) {
matrix.setRotate(rotate);
} else {
matrix.setRotate(rotate, (float) bitmap.getWidth() / 2, (float) bitmap.getHeight() / 2);
}
try
{
bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
exif.resetOrientation();
}
catch (OutOfMemoryError oom)
{
// You can run out of memory if the image is very large:
// http://simonmacdonald.blogspot.ca/2012/07/change-to-camera-code-in-phonegap-190.html
// If this happens, simply do not rotate the image and return it unmodified.
// If you do not catch the OutOfMemoryError, the Android app crashes.
}
return bitmap;
} | Bitmap function(int rotate, Bitmap bitmap, ExifHelper exif) { Matrix matrix = new Matrix(); if (rotate == 180) { matrix.setRotate(rotate); } else { matrix.setRotate(rotate, (float) bitmap.getWidth() / 2, (float) bitmap.getHeight() / 2); } try { bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); exif.resetOrientation(); } catch (OutOfMemoryError oom) { } return bitmap; } | /**
* Figure out if the bitmap should be rotated. For instance if the picture was taken in
* portrait mode
*
* @param rotate
* @param bitmap
* @return rotated bitmap
*/ | Figure out if the bitmap should be rotated. For instance if the picture was taken in portrait mode | getRotatedBitmap | {
"repo_name": "ddrmanxbxfr/IWasHerePhonegapClient",
"path": "plugins/org.apache.cordova.camera/src/android/CameraLauncher.java",
"license": "gpl-3.0",
"size": 39727
} | [
"android.graphics.Bitmap",
"android.graphics.Matrix"
] | import android.graphics.Bitmap; import android.graphics.Matrix; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 153,702 |
public Set getRegisteredFamilies() {
return Utilities.getKeySet(fontFamilies);
} | Set function() { return Utilities.getKeySet(fontFamilies); } | /**
* Gets a set of registered fontnames.
* @return a set of registered font families
*/ | Gets a set of registered fontnames | getRegisteredFamilies | {
"repo_name": "yogthos/itext",
"path": "src/com/lowagie/text/FontFactoryImp.java",
"license": "lgpl-3.0",
"size": 28617
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,480,322 |
protected static void updatecomboMachineConfigName(String stringMachConfig) {
String path = PropertiesHandler
.getProperty("app.MachineDataPathPrefix")
+ "/"
+ stringMachConfig + "/MachineConfig/";
File subdir = new File(path);
// check if subdirectory exists, then show possible configurations to
// select
if (subdir.exists()) {
String[] subitems = subdir.list();
Arrays.sort(subitems);
comboMachineConfigName.setItems(subitems);
if (1 == subitems.length)
comboMachineConfigName.setText(subitems[0]);
else
comboMachineConfigName.setText(LocalizationHandler
.getItem("app.gui.startup.selectmachineconfigname"));
}
// otherwise inform the user to create a new SimConfig
else {
comboMachineConfigName.removeAll();
comboMachineConfigName.setText(LocalizationHandler
.getItem("app.gui.startup.newmachineconfigname"));
}
}
| static void function(String stringMachConfig) { String path = PropertiesHandler .getProperty(STR) + "/" + stringMachConfig + STR; File subdir = new File(path); if (subdir.exists()) { String[] subitems = subdir.list(); Arrays.sort(subitems); comboMachineConfigName.setItems(subitems); if (1 == subitems.length) comboMachineConfigName.setText(subitems[0]); else comboMachineConfigName.setText(LocalizationHandler .getItem(STR)); } else { comboMachineConfigName.removeAll(); comboMachineConfigName.setText(LocalizationHandler .getItem(STR)); } } | /**
* update the comboMachineConfigName according to the selection of
* comboMachineName
*
* @param stringMachConfig
* update the selection of possible machine conifgurations
*/ | update the comboMachineConfigName according to the selection of comboMachineName | updatecomboMachineConfigName | {
"repo_name": "sizuest/EMod",
"path": "ch.ethz.inspire.emod/src/ch/ethz/inspire/emod/gui/EModStartupGUI.java",
"license": "gpl-3.0",
"size": 18077
} | [
"ch.ethz.inspire.emod.utils.LocalizationHandler",
"ch.ethz.inspire.emod.utils.PropertiesHandler",
"java.io.File",
"java.util.Arrays"
] | import ch.ethz.inspire.emod.utils.LocalizationHandler; import ch.ethz.inspire.emod.utils.PropertiesHandler; import java.io.File; import java.util.Arrays; | import ch.ethz.inspire.emod.utils.*; import java.io.*; import java.util.*; | [
"ch.ethz.inspire",
"java.io",
"java.util"
] | ch.ethz.inspire; java.io; java.util; | 1,399,955 |
public void testResultTuple()
{
EntityManager em = getEM();
EntityTransaction tx = em.getTransaction();
try
{
tx.begin();
CriteriaBuilder cb = emf.getCriteriaBuilder();
CriteriaQuery<Tuple> crit = cb.createTupleQuery();
Root<Manager> candidate = crit.from(Manager.class);
Set<Join<Manager, ?>> joins = candidate.getJoins();
assertNotNull(joins); // Make sure joins returns empty set
assertEquals(0, joins.size());
Set<Fetch<Manager, ?>> fetches = candidate.getFetches();
assertNotNull(fetches); // Make sure fetches returns empty set
assertEquals(0, fetches.size());
candidate.alias("m");
crit.multiselect(candidate.get(Manager_.firstName), candidate.get(Manager_.lastName));
// DN extension
assertEquals("Generated JPQL query is incorrect",
"SELECT m.firstName,m.lastName FROM org.datanucleus.samples.jpa.query.Manager m", crit.toString());
Query q = em.createQuery(crit);
List<Tuple> results = q.getResultList();
assertNotNull("Null results returned!", results);
assertEquals("Number of results is incorrect", 2, results.size());
boolean mourinho = false;
boolean guardiola = false;
Iterator<Tuple> resultIter = results.iterator();
while (resultIter.hasNext())
{
Tuple result = resultIter.next();
List<TupleElement<?>> tupleElements = result.getElements();
assertEquals(2, tupleElements.size());
Object elem0 = result.get(0);
Object elem1 = result.get(1);
assertTrue(elem0 instanceof String);
assertTrue(elem1 instanceof String);
String first = (String)elem0;
String last = (String)elem1;
if (first.equals("Jose") && last.equals("Mourinho"))
{
mourinho = true;
}
else if (first.equals("Pep") && last.equals("Guardiola"))
{
guardiola = true;
}
}
if (!mourinho)
{
fail("Jose Mourinho not returned");
}
if (!guardiola)
{
fail("Pep Guardiola not returned");
}
tx.rollback();
}
finally
{
if (tx.isActive())
{
tx.rollback();
}
em.close();
}
}
| void function() { EntityManager em = getEM(); EntityTransaction tx = em.getTransaction(); try { tx.begin(); CriteriaBuilder cb = emf.getCriteriaBuilder(); CriteriaQuery<Tuple> crit = cb.createTupleQuery(); Root<Manager> candidate = crit.from(Manager.class); Set<Join<Manager, ?>> joins = candidate.getJoins(); assertNotNull(joins); assertEquals(0, joins.size()); Set<Fetch<Manager, ?>> fetches = candidate.getFetches(); assertNotNull(fetches); assertEquals(0, fetches.size()); candidate.alias("m"); crit.multiselect(candidate.get(Manager_.firstName), candidate.get(Manager_.lastName)); assertEquals(STR, STR, crit.toString()); Query q = em.createQuery(crit); List<Tuple> results = q.getResultList(); assertNotNull(STR, results); assertEquals(STR, 2, results.size()); boolean mourinho = false; boolean guardiola = false; Iterator<Tuple> resultIter = results.iterator(); while (resultIter.hasNext()) { Tuple result = resultIter.next(); List<TupleElement<?>> tupleElements = result.getElements(); assertEquals(2, tupleElements.size()); Object elem0 = result.get(0); Object elem1 = result.get(1); assertTrue(elem0 instanceof String); assertTrue(elem1 instanceof String); String first = (String)elem0; String last = (String)elem1; if (first.equals("Jose") && last.equals(STR)) { mourinho = true; } else if (first.equals("Pep") && last.equals(STR)) { guardiola = true; } } if (!mourinho) { fail(STR); } if (!guardiola) { fail(STR); } tx.rollback(); } finally { if (tx.isActive()) { tx.rollback(); } em.close(); } } | /**
* Test basic querying with a result as a Tuple.
*/ | Test basic querying with a result as a Tuple | testResultTuple | {
"repo_name": "datanucleus/tests",
"path": "jakarta/criteria/src/test/org/datanucleus/tests/CriteriaMetaModelTest.java",
"license": "apache-2.0",
"size": 58749
} | [
"jakarta.persistence.EntityManager",
"jakarta.persistence.EntityTransaction",
"jakarta.persistence.Query",
"jakarta.persistence.Tuple",
"jakarta.persistence.TupleElement",
"jakarta.persistence.criteria.CriteriaBuilder",
"jakarta.persistence.criteria.CriteriaQuery",
"jakarta.persistence.criteria.Fetch",
"jakarta.persistence.criteria.Join",
"jakarta.persistence.criteria.Root",
"java.util.Iterator",
"java.util.List",
"java.util.Set",
"org.datanucleus.samples.jpa.query.Manager"
] | import jakarta.persistence.EntityManager; import jakarta.persistence.EntityTransaction; import jakarta.persistence.Query; import jakarta.persistence.Tuple; import jakarta.persistence.TupleElement; import jakarta.persistence.criteria.CriteriaBuilder; import jakarta.persistence.criteria.CriteriaQuery; import jakarta.persistence.criteria.Fetch; import jakarta.persistence.criteria.Join; import jakarta.persistence.criteria.Root; import java.util.Iterator; import java.util.List; import java.util.Set; import org.datanucleus.samples.jpa.query.Manager; | import jakarta.persistence.*; import jakarta.persistence.criteria.*; import java.util.*; import org.datanucleus.samples.jpa.query.*; | [
"jakarta.persistence",
"jakarta.persistence.criteria",
"java.util",
"org.datanucleus.samples"
] | jakarta.persistence; jakarta.persistence.criteria; java.util; org.datanucleus.samples; | 1,077,460 |
@Override
public void flush(ChannelHandlerContext ctx) {
flushRequested = true;
} | void function(ChannelHandlerContext ctx) { flushRequested = true; } | /**
* Calls to this method will not trigger an immediate flush. The flush will be deferred until
* {@link #writeBufferedAndRemove(ChannelHandlerContext)}.
*/ | Calls to this method will not trigger an immediate flush. The flush will be deferred until <code>#writeBufferedAndRemove(ChannelHandlerContext)</code> | flush | {
"repo_name": "dapengzhang0/grpc-java",
"path": "netty/src/main/java/io/grpc/netty/WriteBufferingAndExceptionHandler.java",
"license": "apache-2.0",
"size": 9503
} | [
"io.netty.channel.ChannelHandlerContext"
] | import io.netty.channel.ChannelHandlerContext; | import io.netty.channel.*; | [
"io.netty.channel"
] | io.netty.channel; | 1,913,647 |
@ReportableProperty(order=23, value="Invalid MIDI note message.")
public Message getInvalidMIDINoteMessage() {
return this.invalidMIDINoteMessage;
}
| @ReportableProperty(order=23, value=STR) Message function() { return this.invalidMIDINoteMessage; } | /** Get invalid MIDI note message.
* @return Invalid MIDI note message
*/ | Get invalid MIDI note message | getInvalidMIDINoteMessage | {
"repo_name": "opf-labs/jhove2",
"path": "src/main/java/org/jhove2/module/format/wave/InstrumentChunk.java",
"license": "bsd-2-clause",
"size": 11020
} | [
"org.jhove2.annotation.ReportableProperty",
"org.jhove2.core.Message"
] | import org.jhove2.annotation.ReportableProperty; import org.jhove2.core.Message; | import org.jhove2.annotation.*; import org.jhove2.core.*; | [
"org.jhove2.annotation",
"org.jhove2.core"
] | org.jhove2.annotation; org.jhove2.core; | 818,555 |
public AbstractFunction findFunction(String name)
{
int id = _quercus.findFunctionId(name);
if (id >= 0) {
if (id < _fun.length && ! (_fun[id] instanceof UndefinedFunction)) {
return _fun[id];
}
else {
return null;
}
}
if (_anonymousFunMap != null)
return _anonymousFunMap.get(name);
else
return null;
} | AbstractFunction function(String name) { int id = _quercus.findFunctionId(name); if (id >= 0) { if (id < _fun.length && ! (_fun[id] instanceof UndefinedFunction)) { return _fun[id]; } else { return null; } } if (_anonymousFunMap != null) return _anonymousFunMap.get(name); else return null; } | /**
* Returns the function with a given name.
*
* Compiled mode normally uses the _fun array directly, so this call
* is rare.
*/ | Returns the function with a given name. Compiled mode normally uses the _fun array directly, so this call is rare | findFunction | {
"repo_name": "dwango/quercus",
"path": "src/main/java/com/caucho/quercus/env/Env.java",
"license": "gpl-2.0",
"size": 161703
} | [
"com.caucho.quercus.function.AbstractFunction",
"com.caucho.quercus.program.UndefinedFunction"
] | import com.caucho.quercus.function.AbstractFunction; import com.caucho.quercus.program.UndefinedFunction; | import com.caucho.quercus.function.*; import com.caucho.quercus.program.*; | [
"com.caucho.quercus"
] | com.caucho.quercus; | 246,713 |
public void addValue() {
Base.removeAll(this.model, this.getResource(), VALUE);
}
| void function() { Base.removeAll(this.model, this.getResource(), VALUE); } | /**
* Removes all values of property Value * [Generated from RDFReactor
* template rule #removeall1dynamic]
*/ | Removes all values of property Value * [Generated from RDFReactor template rule #removeall1dynamic] | addValue | {
"repo_name": "semweb4j/semweb4j",
"path": "org.semweb4j.rdfreactor.generator/src/main/java/org/ontoware/rdfreactor/schema/bootstrap/Resource.java",
"license": "bsd-2-clause",
"size": 83665
} | [
"org.ontoware.rdfreactor.runtime.Base"
] | import org.ontoware.rdfreactor.runtime.Base; | import org.ontoware.rdfreactor.runtime.*; | [
"org.ontoware.rdfreactor"
] | org.ontoware.rdfreactor; | 1,541,769 |
@Override
ResultSet getImportedKeys( String catalog, String schema, String table )
throws SQLException; | ResultSet getImportedKeys( String catalog, String schema, String table ) throws SQLException; | /**
* <strong>Drill</strong>: Currently, returns an empty (zero-row) result set.
* (Note: Currently, result set might not have the expected columns.)
*/ | Drill: Currently, returns an empty (zero-row) result set. (Note: Currently, result set might not have the expected columns.) | getImportedKeys | {
"repo_name": "cwestin/incubator-drill",
"path": "exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillDatabaseMetaData.java",
"license": "apache-2.0",
"size": 15269
} | [
"java.sql.ResultSet",
"java.sql.SQLException"
] | import java.sql.ResultSet; import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 344,887 |
public PeerID getPeerID() {
return this.peerid;
} | PeerID function() { return this.peerid; } | /**
* Gets the PeerID
*
* @return peerid the <code>net.jxta.peer.PeerID</code> value
*/ | Gets the PeerID | getPeerID | {
"repo_name": "johnjianfang/jxse",
"path": "src/main/java/net/jxta/platform/NetworkConfigurator.java",
"license": "apache-2.0",
"size": 82829
} | [
"net.jxta.peer.PeerID"
] | import net.jxta.peer.PeerID; | import net.jxta.peer.*; | [
"net.jxta.peer"
] | net.jxta.peer; | 1,284,800 |
@Override
public void updatePermissionFlagsForAllApps(int flagMask, int flagValues, int userId) {
if (!sUserManager.exists(userId)) {
return;
}
enforceGrantRevokeRuntimePermissionPermissions("updatePermissionFlagsForAllApps");
enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false,
"updatePermissionFlagsForAllApps");
// Only the system can change system fixed flags.
if (getCallingUid() != Process.SYSTEM_UID) {
flagMask &= ~PackageManager.FLAG_PERMISSION_SYSTEM_FIXED;
flagValues &= ~PackageManager.FLAG_PERMISSION_SYSTEM_FIXED;
}
synchronized (mPackages) {
boolean changed = false;
final int packageCount = mPackages.size();
for (int pkgIndex = 0; pkgIndex < packageCount; pkgIndex++) {
final PackageParser.Package pkg = mPackages.valueAt(pkgIndex);
SettingBase sb = (SettingBase) pkg.mExtras;
if (sb == null) {
continue;
}
PermissionsState permissionsState = sb.getPermissionsState();
changed |= permissionsState.updatePermissionFlagsForAllPermissions(
userId, flagMask, flagValues);
}
if (changed) {
mSettings.writeRuntimePermissionsForUserLPr(userId, false);
}
}
} | void function(int flagMask, int flagValues, int userId) { if (!sUserManager.exists(userId)) { return; } enforceGrantRevokeRuntimePermissionPermissions(STR); enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false, STR); if (getCallingUid() != Process.SYSTEM_UID) { flagMask &= ~PackageManager.FLAG_PERMISSION_SYSTEM_FIXED; flagValues &= ~PackageManager.FLAG_PERMISSION_SYSTEM_FIXED; } synchronized (mPackages) { boolean changed = false; final int packageCount = mPackages.size(); for (int pkgIndex = 0; pkgIndex < packageCount; pkgIndex++) { final PackageParser.Package pkg = mPackages.valueAt(pkgIndex); SettingBase sb = (SettingBase) pkg.mExtras; if (sb == null) { continue; } PermissionsState permissionsState = sb.getPermissionsState(); changed = permissionsState.updatePermissionFlagsForAllPermissions( userId, flagMask, flagValues); } if (changed) { mSettings.writeRuntimePermissionsForUserLPr(userId, false); } } } | /**
* Update the permission flags for all packages and runtime permissions of a user in order
* to allow device or profile owner to remove POLICY_FIXED.
*/ | Update the permission flags for all packages and runtime permissions of a user in order to allow device or profile owner to remove POLICY_FIXED | updatePermissionFlagsForAllApps | {
"repo_name": "syslover33/ctank",
"path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/com/android/server/pm/PackageManagerService.java",
"license": "gpl-3.0",
"size": 736676
} | [
"android.content.pm.PackageManager",
"android.content.pm.PackageParser",
"android.os.Binder",
"android.os.Process"
] | import android.content.pm.PackageManager; import android.content.pm.PackageParser; import android.os.Binder; import android.os.Process; | import android.content.pm.*; import android.os.*; | [
"android.content",
"android.os"
] | android.content; android.os; | 2,404,402 |
public static String addClassifier(String mavenCoords, String classifier) {
DefaultArtifact base = new DefaultArtifact(mavenCoords);
return new DefaultArtifact(
base.getGroupId(),
base.getArtifactId(),
classifier,
base.getExtension(),
base.getVersion()).toString();
} | static String function(String mavenCoords, String classifier) { DefaultArtifact base = new DefaultArtifact(mavenCoords); return new DefaultArtifact( base.getGroupId(), base.getArtifactId(), classifier, base.getExtension(), base.getVersion()).toString(); } | /**
* Transforms maven coordinates, adding the specified classifier
*/ | Transforms maven coordinates, adding the specified classifier | addClassifier | {
"repo_name": "liuyang-li/buck",
"path": "src/com/facebook/buck/maven/AetherUtil.java",
"license": "apache-2.0",
"size": 3544
} | [
"org.eclipse.aether.artifact.DefaultArtifact"
] | import org.eclipse.aether.artifact.DefaultArtifact; | import org.eclipse.aether.artifact.*; | [
"org.eclipse.aether"
] | org.eclipse.aether; | 1,998,254 |
public void setTarget (Object theTarget) {
boolean exists = theTarget != null
&& Model.getFacade().getMultiplicity(theTarget) != null;
setSelected(exists);
}
}
| void function (Object theTarget) { boolean exists = theTarget != null && Model.getFacade().getMultiplicity(theTarget) != null; setSelected(exists); } } | /**
* Sets the target
* @param theTarget
*/ | Sets the target | setTarget | {
"repo_name": "ckaestne/LEADT",
"path": "workspace/argouml_diagrams/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMultiplicityPanel.java",
"license": "gpl-3.0",
"size": 11936
} | [
"org.argouml.model.Model"
] | import org.argouml.model.Model; | import org.argouml.model.*; | [
"org.argouml.model"
] | org.argouml.model; | 1,060,655 |
EList<ModifyDataTypeType> getModifyDataType(); | EList<ModifyDataTypeType> getModifyDataType(); | /**
* Returns the value of the '<em><b>Modify Data Type</b></em>' containment reference list.
* The list contents are of type {@link org.liquibase.xml.ns.dbchangelog.ModifyDataTypeType}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Modify Data Type</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Modify Data Type</em>' containment reference list.
* @see org.liquibase.xml.ns.dbchangelog.DbchangelogPackage#getChangeSetType_ModifyDataType()
* @model containment="true" transient="true" volatile="true" derived="true"
* extendedMetaData="kind='element' name='modifyDataType' namespace='##targetNamespace' group='#ChangeSetChildren:3'"
* @generated
*/ | Returns the value of the 'Modify Data Type' containment reference list. The list contents are of type <code>org.liquibase.xml.ns.dbchangelog.ModifyDataTypeType</code>. If the meaning of the 'Modify Data Type' containment reference list isn't clear, there really should be more of a description here... | getModifyDataType | {
"repo_name": "dzonekl/LiquibaseEditor",
"path": "plugins/org.liquidbase.model/src/org/liquibase/xml/ns/dbchangelog/ChangeSetType.java",
"license": "mit",
"size": 64498
} | [
"org.eclipse.emf.common.util.EList"
] | import org.eclipse.emf.common.util.EList; | import org.eclipse.emf.common.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,136,440 |
public void decorateObjectDispatcher(ObjectDispatcher dispatcher) {
for (ObjectHandler handler : objectHandlers) {
dispatcher.bind(handler);
}
}
| void function(ObjectDispatcher dispatcher) { for (ObjectHandler handler : objectHandlers) { dispatcher.bind(handler); } } | /**
* Decorates an object dispatcher with all the object handlers registered to the context.
*
* @param dispatcher The dispatcher to decorate.
*/ | Decorates an object dispatcher with all the object handlers registered to the context | decorateObjectDispatcher | {
"repo_name": "davidi2/mopar",
"path": "src/net/scapeemulator/game/plugin/ScriptContext.java",
"license": "isc",
"size": 7626
} | [
"net.scapeemulator.game.dispatcher.object.ObjectDispatcher",
"net.scapeemulator.game.dispatcher.object.ObjectHandler"
] | import net.scapeemulator.game.dispatcher.object.ObjectDispatcher; import net.scapeemulator.game.dispatcher.object.ObjectHandler; | import net.scapeemulator.game.dispatcher.object.*; | [
"net.scapeemulator.game"
] | net.scapeemulator.game; | 2,002,430 |
@Override
public List<String> listAttachment() {
if (cos == null) {
return db.listAttachment();
}
List<String> files = new ArrayList<String>();
try {
ObjectListing objectListing = cos.listObjects(new ListObjectsRequest().withBucketName(bucket_name));
for (S3ObjectSummary objectSummary : objectListing.getObjectSummaries()) {
files.add(objectSummary.getKey());
}
} catch (Exception e) {
e.printStackTrace();
}
return files;
} | List<String> function() { if (cos == null) { return db.listAttachment(); } List<String> files = new ArrayList<String>(); try { ObjectListing objectListing = cos.listObjects(new ListObjectsRequest().withBucketName(bucket_name)); for (S3ObjectSummary objectSummary : objectListing.getObjectSummaries()) { files.add(objectSummary.getKey()); } } catch (Exception e) { e.printStackTrace(); } return files; } | /**
* Attachment handlers - Use cloud object storage
*/ | Attachment handlers - Use cloud object storage | listAttachment | {
"repo_name": "hulop/MapService",
"path": "MapService/src/hulop/hokoukukan/utils/COSAdapter.java",
"license": "mit",
"size": 9006
} | [
"com.ibm.cloud.objectstorage.services.s3.model.ListObjectsRequest",
"com.ibm.cloud.objectstorage.services.s3.model.ObjectListing",
"com.ibm.cloud.objectstorage.services.s3.model.S3ObjectSummary",
"java.util.ArrayList",
"java.util.List"
] | import com.ibm.cloud.objectstorage.services.s3.model.ListObjectsRequest; import com.ibm.cloud.objectstorage.services.s3.model.ObjectListing; import com.ibm.cloud.objectstorage.services.s3.model.S3ObjectSummary; import java.util.ArrayList; import java.util.List; | import com.ibm.cloud.objectstorage.services.s3.model.*; import java.util.*; | [
"com.ibm.cloud",
"java.util"
] | com.ibm.cloud; java.util; | 1,117,219 |
Subsets and Splits