method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
@Test
public void testDeleteInfoForUnexistingUser() throws Exception {
closeResponse(executeRequest(new HttpDelete(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_INFO, "unexisting", "key1")), HttpStatus.SC_NOT_FOUND));
} | void function() throws Exception { closeResponse(executeRequest(new HttpDelete(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_INFO, STR, "key1")), HttpStatus.SC_NOT_FOUND)); } | /**
* Test deleting the info for an unexisting user.
*/ | Test deleting the info for an unexisting user | testDeleteInfoForUnexistingUser | {
"repo_name": "yvoswillens/flowable-engine",
"path": "modules/flowable-rest/src/test/java/org/flowable/rest/service/api/identity/UserInfoResourceTest.java",
"license": "apache-2.0",
"size": 15758
} | [
"org.apache.http.HttpStatus",
"org.apache.http.client.methods.HttpDelete",
"org.flowable.rest.service.api.RestUrls"
] | import org.apache.http.HttpStatus; import org.apache.http.client.methods.HttpDelete; import org.flowable.rest.service.api.RestUrls; | import org.apache.http.*; import org.apache.http.client.methods.*; import org.flowable.rest.service.api.*; | [
"org.apache.http",
"org.flowable.rest"
] | org.apache.http; org.flowable.rest; | 713,737 |
Request request = new Request.Builder()
.url(URL)
.build();
Log.i(LOG_TAG, "Sending request to " + request.url().uri());
try (Response response = mHttpClient.newCall(request).execute()) {
String dateHeader = response.header("Date");
Log.i(LOG_TAG, "Received response with Date header: " + dateHeader);
if (dateHeader == null) {
throw new IOException("No Date header in response");
}
try {
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT, Locale.US);
Date networkDate = sdf.parse(dateHeader);
return networkDate.getTime();
} catch (ParseException e) {
throw new IOException(
"Invalid Date header format in response: \"" + dateHeader + "\"");
}
}
} | Request request = new Request.Builder() .url(URL) .build(); Log.i(LOG_TAG, STR + request.url().uri()); try (Response response = mHttpClient.newCall(request).execute()) { String dateHeader = response.header("Date"); Log.i(LOG_TAG, STR + dateHeader); if (dateHeader == null) { throw new IOException(STR); } try { SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT, Locale.US); Date networkDate = sdf.parse(dateHeader); return networkDate.getTime(); } catch (ParseException e) { throw new IOException( STRSTR\""); } } } | /**
* Gets the system time by issuing a request over the network.
*
* @return time (milliseconds since epoch).
* @throws IOException if an I/O error occurs.
*/ | Gets the system time by issuing a request over the network | getNetworkTime | {
"repo_name": "Tortel/authenticator",
"path": "app/src/main/java/com/tortel/authenticator/timesync/NetworkTimeProvider.java",
"license": "apache-2.0",
"size": 2622
} | [
"android.util.Log",
"java.io.IOException",
"java.text.ParseException",
"java.text.SimpleDateFormat",
"java.util.Date",
"java.util.Locale"
] | import android.util.Log; import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; | import android.util.*; import java.io.*; import java.text.*; import java.util.*; | [
"android.util",
"java.io",
"java.text",
"java.util"
] | android.util; java.io; java.text; java.util; | 2,502,531 |
public java.util.List<fr.lip6.move.pnml.hlpn.multisets.hlapi.SubtractHLAPI> getSubterm_multisets_SubtractHLAPI(){
java.util.List<fr.lip6.move.pnml.hlpn.multisets.hlapi.SubtractHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.multisets.hlapi.SubtractHLAPI>();
for (Term elemnt : getSubterm()) {
if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.multisets.impl.SubtractImpl.class)){
retour.add(new fr.lip6.move.pnml.hlpn.multisets.hlapi.SubtractHLAPI(
(fr.lip6.move.pnml.hlpn.multisets.Subtract)elemnt
));
}
}
return retour;
}
| java.util.List<fr.lip6.move.pnml.hlpn.multisets.hlapi.SubtractHLAPI> function(){ java.util.List<fr.lip6.move.pnml.hlpn.multisets.hlapi.SubtractHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.multisets.hlapi.SubtractHLAPI>(); for (Term elemnt : getSubterm()) { if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.multisets.impl.SubtractImpl.class)){ retour.add(new fr.lip6.move.pnml.hlpn.multisets.hlapi.SubtractHLAPI( (fr.lip6.move.pnml.hlpn.multisets.Subtract)elemnt )); } } return retour; } | /**
* This accessor return a list of encapsulated subelement, only of SubtractHLAPI kind.
* WARNING : this method can creates a lot of new object in memory.
*/ | This accessor return a list of encapsulated subelement, only of SubtractHLAPI kind. WARNING : this method can creates a lot of new object in memory | getSubterm_multisets_SubtractHLAPI | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/lists/hlapi/MakeListHLAPI.java",
"license": "epl-1.0",
"size": 113889
} | [
"fr.lip6.move.pnml.hlpn.terms.Term",
"java.util.ArrayList",
"java.util.List"
] | import fr.lip6.move.pnml.hlpn.terms.Term; import java.util.ArrayList; import java.util.List; | import fr.lip6.move.pnml.hlpn.terms.*; import java.util.*; | [
"fr.lip6.move",
"java.util"
] | fr.lip6.move; java.util; | 123,472 |
void onTransformationException(
String topicPath,
TopicSpecification specification,
S value,
TransformationException e); | void onTransformationException( String topicPath, TopicSpecification specification, S value, TransformationException e); | /**
* Notifies the failure to transform a value.
*
* @param topicPath the topic path
* @param specification the topic specification
* @param value the value that could not be transformed
* @param e the exception thrown when attempting to transform the value
*/ | Notifies the failure to transform a value | onTransformationException | {
"repo_name": "pushtechnology/diffusion-transform",
"path": "streams/src/main/java/com/pushtechnology/diffusion/transform/stream/TransformedStream.java",
"license": "apache-2.0",
"size": 2686
} | [
"com.pushtechnology.diffusion.client.topics.details.TopicSpecification",
"com.pushtechnology.diffusion.transform.transformer.TransformationException"
] | import com.pushtechnology.diffusion.client.topics.details.TopicSpecification; import com.pushtechnology.diffusion.transform.transformer.TransformationException; | import com.pushtechnology.diffusion.client.topics.details.*; import com.pushtechnology.diffusion.transform.transformer.*; | [
"com.pushtechnology.diffusion"
] | com.pushtechnology.diffusion; | 2,473,508 |
public Mode getMode(); | Mode function(); | /**
* Get the mode that this view has been set to. If this returns
* <code>Mode.BOTH</code>, you can use <code>getCurrentMode()</code> to
* check which mode the view is currently in
*
* @return Mode that the view has been set to
*/ | Get the mode that this view has been set to. If this returns <code>Mode.BOTH</code>, you can use <code>getCurrentMode()</code> to check which mode the view is currently in | getMode | {
"repo_name": "bankeshkumar90/TabSwipeListener",
"path": "libs/push_lib/src/com/triazine/pulltorefresh/library/IPullToRefresh.java",
"license": "mit",
"size": 7500
} | [
"com.triazine.pulltorefresh.library.PullToRefreshBase"
] | import com.triazine.pulltorefresh.library.PullToRefreshBase; | import com.triazine.pulltorefresh.library.*; | [
"com.triazine.pulltorefresh"
] | com.triazine.pulltorefresh; | 1,875,573 |
public ApiSurface pruningPattern(Pattern pattern) {
Set<Pattern> newPatterns = Sets.newHashSet();
newPatterns.addAll(patternsToPrune);
newPatterns.add(pattern);
return new ApiSurface(rootClasses, newPatterns);
} | ApiSurface function(Pattern pattern) { Set<Pattern> newPatterns = Sets.newHashSet(); newPatterns.addAll(patternsToPrune); newPatterns.add(pattern); return new ApiSurface(rootClasses, newPatterns); } | /**
* Returns an {@link ApiSurface} like this one, but pruning transitive references from classes
* whose full name (including package) begins with the provided prefix.
*/ | Returns an <code>ApiSurface</code> like this one, but pruning transitive references from classes whose full name (including package) begins with the provided prefix | pruningPattern | {
"repo_name": "tgroh/incubator-beam",
"path": "sdks/java/core/src/main/java/org/apache/beam/sdk/util/ApiSurface.java",
"license": "apache-2.0",
"size": 28398
} | [
"com.google.common.collect.Sets",
"java.util.Set",
"java.util.regex.Pattern"
] | import com.google.common.collect.Sets; import java.util.Set; import java.util.regex.Pattern; | import com.google.common.collect.*; import java.util.*; import java.util.regex.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 560,303 |
public final void addCloseTag(final IMXMLTagData closeTag) {
closeTags.push(closeTag);
}
| final void function(final IMXMLTagData closeTag) { closeTags.push(closeTag); } | /**
* Adds a close tag to our list of tags we are tracking
* @param closeTag the {@link IMXMLTagData} that is close
*/ | Adds a close tag to our list of tags we are tracking | addCloseTag | {
"repo_name": "adufilie/flex-falcon",
"path": "compiler/src/org/apache/flex/compiler/internal/parsing/mxml/MXMLTagDataDepth.java",
"license": "apache-2.0",
"size": 9695
} | [
"org.apache.flex.compiler.mxml.IMXMLTagData"
] | import org.apache.flex.compiler.mxml.IMXMLTagData; | import org.apache.flex.compiler.mxml.*; | [
"org.apache.flex"
] | org.apache.flex; | 1,934,093 |
public boolean same(XWikiDocument document)
{
return document == this.doc || document == this.initialDoc;
} | boolean function(XWikiDocument document) { return document == this.doc document == this.initialDoc; } | /**
* Check if the passed one is the one wrapped by this {@link Document}.
*
* @param document the document to compare
* @return true if passed document is the wrapped one
* @since 8.3M1
*/ | Check if the passed one is the one wrapped by this <code>Document</code> | same | {
"repo_name": "pbondoer/xwiki-platform",
"path": "xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java",
"license": "lgpl-2.1",
"size": 112264
} | [
"com.xpn.xwiki.doc.XWikiDocument"
] | import com.xpn.xwiki.doc.XWikiDocument; | import com.xpn.xwiki.doc.*; | [
"com.xpn.xwiki"
] | com.xpn.xwiki; | 923,793 |
private void createBuildingConnectionsAlongSides(Building newBuilding) {
// Create connections along the front side of the building.
createBuildingConnectionsAlongWidthSide(newBuilding, BuildingSide.FRONT);
// Create connections along the back side of the building.
createBuildingConnectionsAlongWidthSide(newBuilding, BuildingSide.BACK);
// Create connections along the left side of the building.
createBuildingConnectionsAlongLengthSide(newBuilding, BuildingSide.LEFT);
// Create connections along the right side of the building.
createBuildingConnectionsAlongLengthSide(newBuilding, BuildingSide.RIGHT);
}
| void function(Building newBuilding) { createBuildingConnectionsAlongWidthSide(newBuilding, BuildingSide.FRONT); createBuildingConnectionsAlongWidthSide(newBuilding, BuildingSide.BACK); createBuildingConnectionsAlongLengthSide(newBuilding, BuildingSide.LEFT); createBuildingConnectionsAlongLengthSide(newBuilding, BuildingSide.RIGHT); } | /**
* Create connections along the four sides of the new building.
*
* @param newBuilding the new building.
*/ | Create connections along the four sides of the new building | createBuildingConnectionsAlongSides | {
"repo_name": "mars-sim/mars-sim",
"path": "mars-sim-core/src/main/java/org/mars_sim/msp/core/structure/building/connection/BuildingConnectorManager.java",
"license": "gpl-3.0",
"size": 29609
} | [
"org.mars_sim.msp.core.structure.building.Building"
] | import org.mars_sim.msp.core.structure.building.Building; | import org.mars_sim.msp.core.structure.building.*; | [
"org.mars_sim.msp"
] | org.mars_sim.msp; | 2,025,965 |
QueryResults<T> queryTextIndexWithFile(
TokenProxy<?, TokenType.Simple> tokenProxy,
File file,
QueryRequestBuilder params
) throws HodErrorException;
/**
* Query HP Haven OnDemand for documents using query text in a file using a token proxy
* provided by a {@link com.hp.autonomy.hod.client.token.TokenProxyService} | QueryResults<T> queryTextIndexWithFile( TokenProxy<?, TokenType.Simple> tokenProxy, File file, QueryRequestBuilder params ) throws HodErrorException; /** * Query HP Haven OnDemand for documents using query text in a file using a token proxy * provided by a {@link com.hp.autonomy.hod.client.token.TokenProxyService} | /**
* Query HP Haven OnDemand for documents using query text in a file using the given token proxy
* @param tokenProxy The token proxy to use to authenticate the request
* @param file A file containing the query text
* @param params Additional parameters to be sent as part of the request
* @return A list of documents that match the query text
* @throws com.hp.autonomy.hod.client.api.authentication.HodAuthenticationFailedException If the token associated
* with the token proxy has expired
*/ | Query HP Haven OnDemand for documents using query text in a file using the given token proxy | queryTextIndexWithFile | {
"repo_name": "hpautonomy/java-hod-client",
"path": "src/main/java/com/hp/autonomy/hod/client/api/textindex/query/search/QueryTextIndexService.java",
"license": "mit",
"size": 10039
} | [
"com.hp.autonomy.hod.client.api.authentication.TokenType",
"com.hp.autonomy.hod.client.error.HodErrorException",
"com.hp.autonomy.hod.client.token.TokenProxy",
"java.io.File"
] | import com.hp.autonomy.hod.client.api.authentication.TokenType; import com.hp.autonomy.hod.client.error.HodErrorException; import com.hp.autonomy.hod.client.token.TokenProxy; import java.io.File; | import com.hp.autonomy.hod.client.api.authentication.*; import com.hp.autonomy.hod.client.error.*; import com.hp.autonomy.hod.client.token.*; import java.io.*; | [
"com.hp.autonomy",
"java.io"
] | com.hp.autonomy; java.io; | 1,711,973 |
public boolean hasModificationOverlap(IonType ion) {
if (!hasMods() || !ion.hasMods())
return false;
IonModification[] a = mod.getAdducts();
IonModification[] b = ion.mod.getAdducts();
if (a == b)
return true;
for (final IonModification aa : a)
if (Arrays.stream(b).anyMatch(ab -> aa.equals(ab)))
return true;
return false;
}
| boolean function(IonType ion) { if (!hasMods() !ion.hasMods()) return false; IonModification[] a = mod.getAdducts(); IonModification[] b = ion.mod.getAdducts(); if (a == b) return true; for (final IonModification aa : a) if (Arrays.stream(b).anyMatch(ab -> aa.equals(ab))) return true; return false; } | /**
* checks if at least one modification is shared
*
* @param a
* @return
*/ | checks if at least one modification is shared | hasModificationOverlap | {
"repo_name": "mzmine/mzmine2",
"path": "src/main/java/net/sf/mzmine/datamodel/identities/iontype/IonType.java",
"license": "gpl-2.0",
"size": 11652
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 176,627 |
public interface SuggestionModel extends BaseModel<Suggestion> {
public long getPrimaryKey(); | interface SuggestionModel extends BaseModel<Suggestion> { public long function(); | /**
* Returns the primary key of this suggestion.
*
* @return the primary key of this suggestion
*/ | Returns the primary key of this suggestion | getPrimaryKey | {
"repo_name": "rivetlogic/liferay-suggestion-box",
"path": "portlets/suggestion-box-portlet/docroot/WEB-INF/service/com/rivetlogic/suggestionbox/model/SuggestionModel.java",
"license": "gpl-3.0",
"size": 8185
} | [
"com.liferay.portal.model.BaseModel"
] | import com.liferay.portal.model.BaseModel; | import com.liferay.portal.model.*; | [
"com.liferay.portal"
] | com.liferay.portal; | 246,793 |
@Path("/worklistItems/{ID:[0-9]*}")
@DELETE
@RESTPermit(handling = Handling.INLINE)
public Response removeWorklistItem(@PathParam("ID") Long id) {
// Access check; suitable permission or deleting your own item (if template allows it)
WorklistItem worklistItem = worklistController.findItemById(id);
if (worklistItem == null) {
return Response.status(Status.NOT_FOUND).entity("Item not found").build();
}
if (!sessionController.hasEnvironmentPermission(WorklistPermissions.DELETE_WORKLISTITEM)) {
if (!Objects.equals(sessionController.getUser().getId(), worklistItem.getOwner().getId())) {
return Response.status(Status.FORBIDDEN).build();
}
}
if (!worklistItem.getTemplate().getRemovable()) {
return Response.status(Status.FORBIDDEN).entity("Item is based on a non-removable template").build();
}
if (worklistItem.getState() == WorklistItemState.APPROVED || worklistItem.getState() == WorklistItemState.PAID) {
return Response.status(Status.FORBIDDEN).entity("Item is already approved or paid").build();
}
worklistController.remove(worklistItem, false);
return Response.noContent().build();
} | @Path(STR) @RESTPermit(handling = Handling.INLINE) Response function(@PathParam("ID") Long id) { WorklistItem worklistItem = worklistController.findItemById(id); if (worklistItem == null) { return Response.status(Status.NOT_FOUND).entity(STR).build(); } if (!sessionController.hasEnvironmentPermission(WorklistPermissions.DELETE_WORKLISTITEM)) { if (!Objects.equals(sessionController.getUser().getId(), worklistItem.getOwner().getId())) { return Response.status(Status.FORBIDDEN).build(); } } if (!worklistItem.getTemplate().getRemovable()) { return Response.status(Status.FORBIDDEN).entity(STR).build(); } if (worklistItem.getState() == WorklistItemState.APPROVED worklistItem.getState() == WorklistItemState.PAID) { return Response.status(Status.FORBIDDEN).entity(STR).build(); } worklistController.remove(worklistItem, false); return Response.noContent().build(); } | /**
* Removes an existing worklist item.
*/ | Removes an existing worklist item | removeWorklistItem | {
"repo_name": "otavanopisto/pyramus",
"path": "rest/src/main/java/fi/otavanopisto/pyramus/rest/WorklistRESTService.java",
"license": "gpl-3.0",
"size": 22919
} | [
"fi.otavanopisto.pyramus.domainmodel.worklist.WorklistItem",
"fi.otavanopisto.pyramus.domainmodel.worklist.WorklistItemState",
"fi.otavanopisto.pyramus.rest.annotation.RESTPermit",
"fi.otavanopisto.pyramus.rest.controller.permissions.WorklistPermissions",
"java.util.Objects",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"javax.ws.rs.core.Response"
] | import fi.otavanopisto.pyramus.domainmodel.worklist.WorklistItem; import fi.otavanopisto.pyramus.domainmodel.worklist.WorklistItemState; import fi.otavanopisto.pyramus.rest.annotation.RESTPermit; import fi.otavanopisto.pyramus.rest.controller.permissions.WorklistPermissions; import java.util.Objects; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.Response; | import fi.otavanopisto.pyramus.domainmodel.worklist.*; import fi.otavanopisto.pyramus.rest.annotation.*; import fi.otavanopisto.pyramus.rest.controller.permissions.*; import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*; | [
"fi.otavanopisto.pyramus",
"java.util",
"javax.ws"
] | fi.otavanopisto.pyramus; java.util; javax.ws; | 482,950 |
public void hardDrop(PlayField pf, GameplayState gps) {
while (!gps.isTetradLanded()) {
this.softDrop(pf,gps);
}
} | void function(PlayField pf, GameplayState gps) { while (!gps.isTetradLanded()) { this.softDrop(pf,gps); } } | /**
* Immediately drops the Tetrad as far as it can until it lands.
*
* @param pf the PlayField object which contains this Tetrad.
* @param gps the GameplayState object.
*/ | Immediately drops the Tetrad as far as it can until it lands | hardDrop | {
"repo_name": "quincy/tejris",
"path": "src/main/java/com/quakbo/tejris/pieces/Tetrad.java",
"license": "mit",
"size": 17368
} | [
"com.quakbo.tejris.board.PlayField",
"com.quakbo.tejris.gamestates.GameplayState"
] | import com.quakbo.tejris.board.PlayField; import com.quakbo.tejris.gamestates.GameplayState; | import com.quakbo.tejris.board.*; import com.quakbo.tejris.gamestates.*; | [
"com.quakbo.tejris"
] | com.quakbo.tejris; | 2,737,743 |
public<T extends IAppListener<? extends AppEvent>> void
register(T listener, boolean isStrongRef) {
Class<? extends AppEvent> eventClazz = getEventClazz(listener);
Reference<T> ref = isStrongRef ? new StrongRef<T>(listener)
: new WeakRef<T>(listener);
Map<Reference<? extends IAppListener<? extends AppEvent> >, Object>
listeners = slots.get(eventClazz);
synchronized (slots) {
if (listeners != null) {
listeners.put(ref, PRESENT);
} else {
Map<Reference<? extends IAppListener<? extends AppEvent> >, Object>
ls = new LinkedHashMap<>(16);
ls.put(ref, PRESENT);
}
}
} | public<T extends IAppListener<? extends AppEvent>> void register(T listener, boolean isStrongRef) { Class<? extends AppEvent> eventClazz = getEventClazz(listener); Reference<T> ref = isStrongRef ? new StrongRef<T>(listener) : new WeakRef<T>(listener); Map<Reference<? extends IAppListener<? extends AppEvent> >, Object> listeners = slots.get(eventClazz); synchronized (slots) { if (listeners != null) { listeners.put(ref, PRESENT); } else { Map<Reference<? extends IAppListener<? extends AppEvent> >, Object> ls = new LinkedHashMap<>(16); ls.put(ref, PRESENT); } } } | /**
* register listener to an event,
* listeners are stored in different slots
*
* @param listener
* @param isStrongRef
*/ | register listener to an event, listeners are stored in different slots | register | {
"repo_name": "xkommando/Gplume",
"path": "gplume/src/main/java/com/caibowen/gplume/event/Broadcaster.java",
"license": "apache-2.0",
"size": 9198
} | [
"com.caibowen.gplume.common.StrongRef",
"com.caibowen.gplume.common.WeakRef",
"java.lang.ref.Reference",
"java.util.LinkedHashMap",
"java.util.Map"
] | import com.caibowen.gplume.common.StrongRef; import com.caibowen.gplume.common.WeakRef; import java.lang.ref.Reference; import java.util.LinkedHashMap; import java.util.Map; | import com.caibowen.gplume.common.*; import java.lang.ref.*; import java.util.*; | [
"com.caibowen.gplume",
"java.lang",
"java.util"
] | com.caibowen.gplume; java.lang; java.util; | 2,180,817 |
protected void postCommand(ChannelUID channelUID, Command command) {
synchronized (this) {
if (this.callback != null) {
this.callback.postCommand(channelUID, command);
} else {
throw new IllegalStateException("Could not update state, because callback is missing");
}
}
} | void function(ChannelUID channelUID, Command command) { synchronized (this) { if (this.callback != null) { this.callback.postCommand(channelUID, command); } else { throw new IllegalStateException(STR); } } } | /**
* Sends a command for a channel of the thing.
*
* @param channelUID
* unique id of the channel, which sends the command
* @param command
* command
* @throws IllegalStateException
* if handler is not initialized correctly, because no callback is present
*/ | Sends a command for a channel of the thing | postCommand | {
"repo_name": "dvanherbergen/smarthome",
"path": "bundles/core/org.eclipse.smarthome.core.thing/src/main/java/org/eclipse/smarthome/core/thing/binding/BaseThingHandler.java",
"license": "epl-1.0",
"size": 21296
} | [
"org.eclipse.smarthome.core.thing.ChannelUID",
"org.eclipse.smarthome.core.types.Command"
] | import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.types.Command; | import org.eclipse.smarthome.core.thing.*; import org.eclipse.smarthome.core.types.*; | [
"org.eclipse.smarthome"
] | org.eclipse.smarthome; | 233,288 |
public void saveMetadata(IoStatisticsHolder statHolder) throws IgniteCheckedException; | void function(IoStatisticsHolder statHolder) throws IgniteCheckedException; | /**
* Saves storage metadata.
*/ | Saves storage metadata | saveMetadata | {
"repo_name": "NSAmelchev/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/partstorage/PartitionMetaStorage.java",
"license": "apache-2.0",
"size": 2050
} | [
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.internal.metric.IoStatisticsHolder"
] | import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.metric.IoStatisticsHolder; | import org.apache.ignite.*; import org.apache.ignite.internal.metric.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,809,297 |
public Enumeration keys() {
return new KeyIterator();
}
| Enumeration function() { return new KeyIterator(); } | /**
* Returns an enumeration of the keys in this table.
*
* @return an enumeration of the keys in this table.
* @see Enumeration
* @see #elements()
* @see #keySet()
* @see Map
*/ | Returns an enumeration of the keys in this table | keys | {
"repo_name": "ProfilingLabs/Usemon2",
"path": "usemon-agent-commons-java/src/main/java/com/usemon/lib/concurrent/ConcurrentReaderHashMap.java",
"license": "mpl-2.0",
"size": 40274
} | [
"java.util.Enumeration"
] | import java.util.Enumeration; | import java.util.*; | [
"java.util"
] | java.util; | 1,282,573 |
EClass getManifestType(); | EClass getManifestType(); | /**
* Returns the meta object for class '{@link net.opengis.ows11.ManifestType <em>Manifest Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Manifest Type</em>'.
* @see net.opengis.ows11.ManifestType
* @generated
*/ | Returns the meta object for class '<code>net.opengis.ows11.ManifestType Manifest Type</code>'. | getManifestType | {
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.ows/src/net/opengis/ows11/Ows11Package.java",
"license": "lgpl-2.1",
"size": 292282
} | [
"org.eclipse.emf.ecore.EClass"
] | import org.eclipse.emf.ecore.EClass; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,256,933 |
public void setAllProperties(List<String> allProperties) {
m_allProperties = allProperties;
} | void function(List<String> allProperties) { m_allProperties = allProperties; } | /**
* Sets the list of property names.<p>
*
* @param allProperties the list of property names
*/ | Sets the list of property names | setAllProperties | {
"repo_name": "ggiudetti/opencms-core",
"path": "src/org/opencms/gwt/shared/property/CmsPropertiesBean.java",
"license": "lgpl-2.1",
"size": 7603
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 510,768 |
public CcLinkingHelper addLinkstamps(Iterable<? extends TransitiveInfoCollection> linkstamps) {
for (TransitiveInfoCollection linkstamp : linkstamps) {
this.linkstamps.addTransitive(linkstamp.getProvider(FileProvider.class).getFilesToBuild());
}
return this;
} | CcLinkingHelper function(Iterable<? extends TransitiveInfoCollection> linkstamps) { for (TransitiveInfoCollection linkstamp : linkstamps) { this.linkstamps.addTransitive(linkstamp.getProvider(FileProvider.class).getFilesToBuild()); } return this; } | /**
* Adds the given linkstamps. Note that linkstamps are usually not compiled at the library level,
* but only in the dependent binary rules.
*/ | Adds the given linkstamps. Note that linkstamps are usually not compiled at the library level, but only in the dependent binary rules | addLinkstamps | {
"repo_name": "aehlig/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java",
"license": "apache-2.0",
"size": 41215
} | [
"com.google.devtools.build.lib.analysis.FileProvider",
"com.google.devtools.build.lib.analysis.TransitiveInfoCollection"
] | import com.google.devtools.build.lib.analysis.FileProvider; import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; | import com.google.devtools.build.lib.analysis.*; | [
"com.google.devtools"
] | com.google.devtools; | 753,920 |
@Override
public Response policiesMediationPost(MediationDTO body, String contentType, String ifMatch,
String ifUnmodifiedSince) {
InputStream contentStream = null;
try {
APIProvider apiProvider = RestApiUtil.getLoggedInUserProvider();
String content = body.getConfig();
contentStream = new ByteArrayInputStream(content.getBytes
(StandardCharsets.UTF_8));
ResourceFile contentFile = new ResourceFile(contentStream, contentType);
//Extracting mediation policy name from the mediation config
String fileName = this.getMediationNameFromConfig(content);
//constructing the registry resource path
String mediationPolicyPath = APIConstants.API_CUSTOM_SEQUENCE_LOCATION +
RegistryConstants.PATH_SEPARATOR + body.getType() +
RegistryConstants.PATH_SEPARATOR + fileName;
if (apiProvider.checkIfResourceExists(mediationPolicyPath)) {
RestApiUtil.handleConflict("Mediation policy already exists", log);
}
//Adding new global mediation sequence
// No need to check API permission, hence null as api identifier
String mediationPolicyUrl = apiProvider.addResourceFile(null, mediationPolicyPath, contentFile);
if (StringUtils.isNotBlank(mediationPolicyUrl)) {
//Getting the uuid of the created global mediation policy
String uuid = apiProvider.getCreatedResourceUuid(mediationPolicyPath);
//Getting created mediation policy
Mediation createdMediation = apiProvider.getGlobalMediationPolicy(uuid);
MediationDTO createdPolicy =
MediationMappingUtil.fromMediationToDTO(createdMediation);
URI uploadedMediationUri = new URI(mediationPolicyUrl);
return Response.created(uploadedMediationUri).entity(createdPolicy).build();
}
} catch (APIManagementException e) {
String errorMessage = "Error while adding the global mediation policy " + body.getName();
RestApiUtil.handleInternalServerError(errorMessage, e, log);
} catch (URISyntaxException e) {
String errorMessage = "Error while getting location header for created " +
"mediation policy " + body.getName();
RestApiUtil.handleInternalServerError(errorMessage, e, log);
} finally {
IOUtils.closeQuietly(contentStream);
}
return null;
} | Response function(MediationDTO body, String contentType, String ifMatch, String ifUnmodifiedSince) { InputStream contentStream = null; try { APIProvider apiProvider = RestApiUtil.getLoggedInUserProvider(); String content = body.getConfig(); contentStream = new ByteArrayInputStream(content.getBytes (StandardCharsets.UTF_8)); ResourceFile contentFile = new ResourceFile(contentStream, contentType); String fileName = this.getMediationNameFromConfig(content); String mediationPolicyPath = APIConstants.API_CUSTOM_SEQUENCE_LOCATION + RegistryConstants.PATH_SEPARATOR + body.getType() + RegistryConstants.PATH_SEPARATOR + fileName; if (apiProvider.checkIfResourceExists(mediationPolicyPath)) { RestApiUtil.handleConflict(STR, log); } String mediationPolicyUrl = apiProvider.addResourceFile(null, mediationPolicyPath, contentFile); if (StringUtils.isNotBlank(mediationPolicyUrl)) { String uuid = apiProvider.getCreatedResourceUuid(mediationPolicyPath); Mediation createdMediation = apiProvider.getGlobalMediationPolicy(uuid); MediationDTO createdPolicy = MediationMappingUtil.fromMediationToDTO(createdMediation); URI uploadedMediationUri = new URI(mediationPolicyUrl); return Response.created(uploadedMediationUri).entity(createdPolicy).build(); } } catch (APIManagementException e) { String errorMessage = STR + body.getName(); RestApiUtil.handleInternalServerError(errorMessage, e, log); } catch (URISyntaxException e) { String errorMessage = STR + STR + body.getName(); RestApiUtil.handleInternalServerError(errorMessage, e, log); } finally { IOUtils.closeQuietly(contentStream); } return null; } | /**
* Add a global mediation policy
*
* @param body Mediation DTO as request body
* @param contentType Content-Type header
* @param ifMatch If-match header value
* @param ifUnmodifiedSince If-Unmodified-Since header value
* @return created mediation DTO as response
*/ | Add a global mediation policy | policiesMediationPost | {
"repo_name": "nuwand/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.rest.api.admin/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/impl/PoliciesApiServiceImpl.java",
"license": "apache-2.0",
"size": 15710
} | [
"java.io.ByteArrayInputStream",
"java.io.InputStream",
"java.net.URISyntaxException",
"java.nio.charset.StandardCharsets",
"javax.ws.rs.core.Response",
"org.apache.commons.io.IOUtils",
"org.apache.commons.lang3.StringUtils",
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.api.APIProvider",
"org.wso2.carbon.apimgt.api.model.Mediation",
"org.wso2.carbon.apimgt.api.model.ResourceFile",
"org.wso2.carbon.apimgt.impl.APIConstants",
"org.wso2.carbon.apimgt.rest.api.admin.dto.MediationDTO",
"org.wso2.carbon.apimgt.rest.api.admin.utils.mappings.mediation.MediationMappingUtil",
"org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil",
"org.wso2.carbon.registry.core.RegistryConstants"
] | import java.io.ByteArrayInputStream; import java.io.InputStream; import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; import javax.ws.rs.core.Response; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.APIProvider; import org.wso2.carbon.apimgt.api.model.Mediation; import org.wso2.carbon.apimgt.api.model.ResourceFile; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.rest.api.admin.dto.MediationDTO; import org.wso2.carbon.apimgt.rest.api.admin.utils.mappings.mediation.MediationMappingUtil; import org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil; import org.wso2.carbon.registry.core.RegistryConstants; | import java.io.*; import java.net.*; import java.nio.charset.*; import javax.ws.rs.core.*; import org.apache.commons.io.*; import org.apache.commons.lang3.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.*; import org.wso2.carbon.apimgt.rest.api.admin.dto.*; import org.wso2.carbon.apimgt.rest.api.admin.utils.mappings.mediation.*; import org.wso2.carbon.apimgt.rest.api.util.utils.*; import org.wso2.carbon.registry.core.*; | [
"java.io",
"java.net",
"java.nio",
"javax.ws",
"org.apache.commons",
"org.wso2.carbon"
] | java.io; java.net; java.nio; javax.ws; org.apache.commons; org.wso2.carbon; | 2,528,369 |
private void drawCharRange(GC gc, int startOffset, int endOffset, int lineOffset, int lineEndOffset) {
StyledTextContent content= fTextWidget.getContent();
String lineText= content.getTextRange(lineOffset, lineEndOffset - lineOffset);
int startOffsetInLine= startOffset - lineOffset;
int endOffsetInLine= endOffset - lineOffset;
int textBegin= -1;
for (int i= 0; i < lineText.length(); ++i) {
if (!isWhitespaceCharacter(lineText.charAt(i))) {
textBegin= i;
break;
}
}
boolean isEmptyLine= textBegin == -1;
int textEnd= lineText.length() - 1;
if (!isEmptyLine) {
for (int i= lineText.length() - 1; i >= 0; --i) {
if (!isWhitespaceCharacter(lineText.charAt(i))) {
textEnd= i;
break;
}
}
}
StyleRange styleRange= null;
Color fg= null;
StringBuffer visibleChar= new StringBuffer(10);
for (int textOffset= startOffsetInLine; textOffset <= endOffsetInLine; ++textOffset) {
int delta= 0;
boolean eol= false;
if (textOffset < endOffsetInLine) {
delta= 1;
char c= lineText.charAt(textOffset);
switch (c) {
case ' ':
if (isEmptyLine) {
if (fShowLeadingSpaces || fShowEnclosedSpace || fShowTrailingSpaces) {
visibleChar.append(SPACE_SIGN);
}
} else if (textOffset < textBegin) {
if (fShowLeadingSpaces) {
visibleChar.append(SPACE_SIGN);
}
} else if (textOffset < textEnd) {
if (fShowEnclosedSpace) {
visibleChar.append(SPACE_SIGN);
}
} else {
if (fShowTrailingSpaces) {
visibleChar.append(SPACE_SIGN);
}
}
// 'continue' would improve performance but may produce drawing errors
// for long runs of space if width of space and dot differ
break;
case '\u3000': // ideographic whitespace
if (isEmptyLine) {
if (fShowLeadingIdeographicSpaces || fShowEnclosedIdeographicSpaces || fShowTrailingIdeographicSpaces) {
visibleChar.append(IDEOGRAPHIC_SPACE_SIGN);
}
} else if (textOffset < textBegin) {
if (fShowLeadingIdeographicSpaces) {
visibleChar.append(IDEOGRAPHIC_SPACE_SIGN);
}
} else if (textOffset < textEnd) {
if (fShowEnclosedIdeographicSpaces) {
visibleChar.append(IDEOGRAPHIC_SPACE_SIGN);
}
} else {
if (fShowTrailingIdeographicSpaces) {
visibleChar.append(IDEOGRAPHIC_SPACE_SIGN);
}
}
// 'continue' would improve performance but may produce drawing errors
// for long runs of space if width of space and dot differ
break;
case '\t':
if (isEmptyLine) {
if (fShowLeadingTabs || fShowEnclosedTabs || fShowTrailingTabs) {
visibleChar.append(TAB_SIGN);
}
} else if (textOffset < textBegin) {
if (fShowLeadingTabs) {
visibleChar.append(TAB_SIGN);
}
} else if (textOffset < textEnd) {
if (fShowEnclosedTabs) {
visibleChar.append(TAB_SIGN);
}
} else {
if (fShowTrailingTabs) {
visibleChar.append(TAB_SIGN);
}
}
break;
case '\r':
if (fShowCarriageReturn) {
visibleChar.append(CARRIAGE_RETURN_SIGN);
}
if (textOffset >= endOffsetInLine - 1 || lineText.charAt(textOffset + 1) != '\n') {
eol= true;
break;
}
continue;
case '\n':
if (fShowLineFeed) {
visibleChar.append(LINE_FEED_SIGN);
}
eol= true;
break;
default:
delta= 0;
break;
}
}
if (visibleChar.length() > 0) {
int widgetOffset= startOffset + textOffset - startOffsetInLine - visibleChar.length() + delta;
if (!eol || !isFoldedLine(content.getLineAtOffset(widgetOffset))) {
if (!fTextWidget.getBlockSelection() && fIsFullSelectionStyle && isOffsetSelected(fTextWidget, widgetOffset)) {
fg= fTextWidget.getSelectionForeground();
} else if (styleRange == null || styleRange.start + styleRange.length <= widgetOffset) {
styleRange= fTextWidget.getStyleRangeAtOffset(widgetOffset);
if (styleRange == null || styleRange.foreground == null) {
fg= fTextWidget.getForeground();
} else {
fg= styleRange.foreground;
}
}
draw(gc, widgetOffset, visibleChar.toString(), fg);
}
visibleChar.delete(0, visibleChar.length());
}
}
}
| void function(GC gc, int startOffset, int endOffset, int lineOffset, int lineEndOffset) { StyledTextContent content= fTextWidget.getContent(); String lineText= content.getTextRange(lineOffset, lineEndOffset - lineOffset); int startOffsetInLine= startOffset - lineOffset; int endOffsetInLine= endOffset - lineOffset; int textBegin= -1; for (int i= 0; i < lineText.length(); ++i) { if (!isWhitespaceCharacter(lineText.charAt(i))) { textBegin= i; break; } } boolean isEmptyLine= textBegin == -1; int textEnd= lineText.length() - 1; if (!isEmptyLine) { for (int i= lineText.length() - 1; i >= 0; --i) { if (!isWhitespaceCharacter(lineText.charAt(i))) { textEnd= i; break; } } } StyleRange styleRange= null; Color fg= null; StringBuffer visibleChar= new StringBuffer(10); for (int textOffset= startOffsetInLine; textOffset <= endOffsetInLine; ++textOffset) { int delta= 0; boolean eol= false; if (textOffset < endOffsetInLine) { delta= 1; char c= lineText.charAt(textOffset); switch (c) { case ' ': if (isEmptyLine) { if (fShowLeadingSpaces fShowEnclosedSpace fShowTrailingSpaces) { visibleChar.append(SPACE_SIGN); } } else if (textOffset < textBegin) { if (fShowLeadingSpaces) { visibleChar.append(SPACE_SIGN); } } else if (textOffset < textEnd) { if (fShowEnclosedSpace) { visibleChar.append(SPACE_SIGN); } } else { if (fShowTrailingSpaces) { visibleChar.append(SPACE_SIGN); } } break; case '\u3000': if (isEmptyLine) { if (fShowLeadingIdeographicSpaces fShowEnclosedIdeographicSpaces fShowTrailingIdeographicSpaces) { visibleChar.append(IDEOGRAPHIC_SPACE_SIGN); } } else if (textOffset < textBegin) { if (fShowLeadingIdeographicSpaces) { visibleChar.append(IDEOGRAPHIC_SPACE_SIGN); } } else if (textOffset < textEnd) { if (fShowEnclosedIdeographicSpaces) { visibleChar.append(IDEOGRAPHIC_SPACE_SIGN); } } else { if (fShowTrailingIdeographicSpaces) { visibleChar.append(IDEOGRAPHIC_SPACE_SIGN); } } break; case '\t': if (isEmptyLine) { if (fShowLeadingTabs fShowEnclosedTabs fShowTrailingTabs) { visibleChar.append(TAB_SIGN); } } else if (textOffset < textBegin) { if (fShowLeadingTabs) { visibleChar.append(TAB_SIGN); } } else if (textOffset < textEnd) { if (fShowEnclosedTabs) { visibleChar.append(TAB_SIGN); } } else { if (fShowTrailingTabs) { visibleChar.append(TAB_SIGN); } } break; case '\r': if (fShowCarriageReturn) { visibleChar.append(CARRIAGE_RETURN_SIGN); } if (textOffset >= endOffsetInLine - 1 lineText.charAt(textOffset + 1) != '\n') { eol= true; break; } continue; case '\n': if (fShowLineFeed) { visibleChar.append(LINE_FEED_SIGN); } eol= true; break; default: delta= 0; break; } } if (visibleChar.length() > 0) { int widgetOffset= startOffset + textOffset - startOffsetInLine - visibleChar.length() + delta; if (!eol !isFoldedLine(content.getLineAtOffset(widgetOffset))) { if (!fTextWidget.getBlockSelection() && fIsFullSelectionStyle && isOffsetSelected(fTextWidget, widgetOffset)) { fg= fTextWidget.getSelectionForeground(); } else if (styleRange == null styleRange.start + styleRange.length <= widgetOffset) { styleRange= fTextWidget.getStyleRangeAtOffset(widgetOffset); if (styleRange == null styleRange.foreground == null) { fg= fTextWidget.getForeground(); } else { fg= styleRange.foreground; } } draw(gc, widgetOffset, visibleChar.toString(), fg); } visibleChar.delete(0, visibleChar.length()); } } } | /**
* Draw characters of content range.
*
* @param gc the GC
* @param startOffset inclusive start index of the drawing range
* @param endOffset exclusive end index of the drawing range
* @param lineOffset inclusive start index of the line
* @param lineEndOffset exclusive end index of the line
*/ | Draw characters of content range | drawCharRange | {
"repo_name": "brunyuriy/quick-fix-scout",
"path": "org.eclipse.jface.text_3.8.1.v20120828-155502/src/org/eclipse/jface/text/WhitespaceCharacterPainter.java",
"license": "mit",
"size": 16876
} | [
"org.eclipse.swt.custom.StyleRange",
"org.eclipse.swt.custom.StyledTextContent",
"org.eclipse.swt.graphics.Color"
] | import org.eclipse.swt.custom.StyleRange; import org.eclipse.swt.custom.StyledTextContent; import org.eclipse.swt.graphics.Color; | import org.eclipse.swt.custom.*; import org.eclipse.swt.graphics.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 646,494 |
// first we try to get DO from the database. Return null if no data
OpenIDUserRPDO existingdo = getOpenIDUserRP(rpdo.getUserName(), rpdo.getRpUrl());
Connection connection = IdentityDatabaseUtil.getDBConnection();
PreparedStatement prepStmt = null;
try {
if (existingdo != null) { // data found in the database
// we should update the entry
prepStmt = connection.prepareStatement(OpenIDSQLQueries.UPDATE_USER_RP);
prepStmt.setString(5, rpdo.getUserName());
prepStmt.setInt(6, IdentityTenantUtil.getTenantIdOfUser(rpdo.getUserName()));
prepStmt.setString(7, rpdo.getRpUrl());
prepStmt.setString(1, rpdo.isTrustedAlways() ? "TRUE" : "FALSE");
// we set the new current date
prepStmt.setDate(2, new java.sql.Date(new Date().getTime()));
// we increment the value which is in the database
prepStmt.setInt(3, existingdo.getVisitCount() + 1); // increase visit count
prepStmt.setString(4, rpdo.getDefaultProfileName());
prepStmt.execute();
connection.commit();
} else {
// data not found, we should create the entry
prepStmt = connection.prepareStatement(OpenIDSQLQueries.STORE_USER_RP);
prepStmt.setString(1, rpdo.getUserName());
prepStmt.setInt(2, IdentityTenantUtil.getTenantIdOfUser(rpdo.getUserName()));
prepStmt.setString(3, rpdo.getRpUrl());
prepStmt.setString(4, rpdo.isTrustedAlways() ? "TRUE" : "FALSE");
// we set the current date
prepStmt.setDate(5, new java.sql.Date(new Date().getTime()));
// ok, this is the first visit
prepStmt.setInt(6, 1);
prepStmt.setString(7, rpdo.getDefaultProfileName());
prepStmt.execute();
connection.commit();
}
} catch (SQLException e) {
log.error("Failed to store RP: " + rpdo.getRpUrl() + " for user: " +
rpdo.getUserName() + " Error while accessing the database", e);
} finally {
IdentityDatabaseUtil.closeStatement(prepStmt);
IdentityDatabaseUtil.closeConnection(connection);
}
} | OpenIDUserRPDO existingdo = getOpenIDUserRP(rpdo.getUserName(), rpdo.getRpUrl()); Connection connection = IdentityDatabaseUtil.getDBConnection(); PreparedStatement prepStmt = null; try { if (existingdo != null) { prepStmt = connection.prepareStatement(OpenIDSQLQueries.UPDATE_USER_RP); prepStmt.setString(5, rpdo.getUserName()); prepStmt.setInt(6, IdentityTenantUtil.getTenantIdOfUser(rpdo.getUserName())); prepStmt.setString(7, rpdo.getRpUrl()); prepStmt.setString(1, rpdo.isTrustedAlways() ? "TRUE" : "FALSE"); prepStmt.setDate(2, new java.sql.Date(new Date().getTime())); prepStmt.setInt(3, existingdo.getVisitCount() + 1); prepStmt.setString(4, rpdo.getDefaultProfileName()); prepStmt.execute(); connection.commit(); } else { prepStmt = connection.prepareStatement(OpenIDSQLQueries.STORE_USER_RP); prepStmt.setString(1, rpdo.getUserName()); prepStmt.setInt(2, IdentityTenantUtil.getTenantIdOfUser(rpdo.getUserName())); prepStmt.setString(3, rpdo.getRpUrl()); prepStmt.setString(4, rpdo.isTrustedAlways() ? "TRUE" : "FALSE"); prepStmt.setDate(5, new java.sql.Date(new Date().getTime())); prepStmt.setInt(6, 1); prepStmt.setString(7, rpdo.getDefaultProfileName()); prepStmt.execute(); connection.commit(); } } catch (SQLException e) { log.error(STR + rpdo.getRpUrl() + STR + rpdo.getUserName() + STR, e); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); IdentityDatabaseUtil.closeConnection(connection); } } | /**
* Creates a Relying Party and associates it with the User.
* If the entry exist, then update with the new data
*
* @param rpdo
*/ | Creates a Relying Party and associates it with the User. If the entry exist, then update with the new data | createOrUpdate | {
"repo_name": "pulasthi7/carbon-identity",
"path": "components/identity-core/org.wso2.carbon.identity.core/src/main/java/org/wso2/carbon/identity/core/dao/OpenIDUserRPDAO.java",
"license": "apache-2.0",
"size": 15008
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.SQLException",
"java.util.Date",
"org.wso2.carbon.identity.core.model.OpenIDUserRPDO",
"org.wso2.carbon.identity.core.util.IdentityDatabaseUtil",
"org.wso2.carbon.identity.core.util.IdentityTenantUtil"
] | import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.Date; import org.wso2.carbon.identity.core.model.OpenIDUserRPDO; import org.wso2.carbon.identity.core.util.IdentityDatabaseUtil; import org.wso2.carbon.identity.core.util.IdentityTenantUtil; | import java.sql.*; import java.util.*; import org.wso2.carbon.identity.core.model.*; import org.wso2.carbon.identity.core.util.*; | [
"java.sql",
"java.util",
"org.wso2.carbon"
] | java.sql; java.util; org.wso2.carbon; | 2,164,448 |
public Writer writer (boolean append) {
return writer(append, null);
}
| Writer function (boolean append) { return writer(append, null); } | /** Returns a writer for writing to this file using the default charset. Parent directories will be created if necessary.
* @param append If false, this file will be overwritten if it exists, otherwise it will be appended.
* @throws GdxRuntimeException if this file handle represents a directory, if it is a {@link FileType#Classpath} or
* {@link FileType#Internal} file, or if it could not be written. */ | Returns a writer for writing to this file using the default charset. Parent directories will be created if necessary | writer | {
"repo_name": "jiachenning/libgdx",
"path": "gdx/src/com/badlogic/gdx/files/FileHandle.java",
"license": "apache-2.0",
"size": 31073
} | [
"java.io.Writer"
] | import java.io.Writer; | import java.io.*; | [
"java.io"
] | java.io; | 1,104,484 |
public void addLayoutComponent(final Component comp) {
// not used
} | void function(final Component comp) { } | /**
* Not used.
*
* @param comp the component.
*/ | Not used | addLayoutComponent | {
"repo_name": "apetresc/JCommon",
"path": "src/main/java/org/jfree/layout/LCBLayout.java",
"license": "lgpl-2.1",
"size": 9552
} | [
"java.awt.Component"
] | import java.awt.Component; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,626,267 |
protected static FloodlightContext flcontext_alloc() {
FloodlightContext flcontext = null;
if (flcontext_cache.get().empty()) {
flcontext = new FloodlightContext();
} else {
flcontext = flcontext_cache.get().pop();
}
return flcontext;
} | static FloodlightContext function() { FloodlightContext flcontext = null; if (flcontext_cache.get().empty()) { flcontext = new FloodlightContext(); } else { flcontext = flcontext_cache.get().pop(); } return flcontext; } | /**
* flcontext_alloc - pop a context off the stack, if required create a new
* one
*
* @return FloodlightContext
*/ | flcontext_alloc - pop a context off the stack, if required create a new one | flcontext_alloc | {
"repo_name": "opennetworkinglab/spring-open",
"path": "src/main/java/net/floodlightcontroller/core/internal/Controller.java",
"license": "apache-2.0",
"size": 79816
} | [
"net.floodlightcontroller.core.FloodlightContext"
] | import net.floodlightcontroller.core.FloodlightContext; | import net.floodlightcontroller.core.*; | [
"net.floodlightcontroller.core"
] | net.floodlightcontroller.core; | 200,092 |
public void setStringValue(short stringType, String stringValue) throws DOMException {
switch (stringType) {
case CSS_STRING :
case CSS_URI :
case CSS_IDENT :
case CSS_ATTR :
case CSS_URANGE :
case CSS_FORMAT :
case CSS_LOCAL :
case CSS_HASH :
case CSS_COMMA :
case CSS_SLASH :
case CSS_INHERIT_PRIMITIVE :
String oldValue = getCSSValueText();
fPrimitiveType = stringType;
fStringValue = stringValue;
notifyValueChanged(oldValue);
break;
default :
throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");//$NON-NLS-1$
}
} | void function(short stringType, String stringValue) throws DOMException { switch (stringType) { case CSS_STRING : case CSS_URI : case CSS_IDENT : case CSS_ATTR : case CSS_URANGE : case CSS_FORMAT : case CSS_LOCAL : case CSS_HASH : case CSS_COMMA : case CSS_SLASH : case CSS_INHERIT_PRIMITIVE : String oldValue = getCSSValueText(); fPrimitiveType = stringType; fStringValue = stringValue; notifyValueChanged(oldValue); break; default : throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); } } | /**
* A method to set the string value with the specified unit. If the
* property attached to this value can't accept the specified unit or the
* string value, the value will be unchanged and a
* <code>DOMException</code> will be raised.
*
* @param stringType
* A string code as defined above. The string code can only be
* a string unit type (i.e. <code>CSS_STRING</code>,
* <code>CSS_URI</code>,<code>CSS_IDENT</code>, and
* <code>CSS_ATTR</code>).
* @param stringValue
* The new string value.
* @exception DOMException
* INVALID_ACCESS_ERR: Raised if the CSS value doesn't
* contain a string value or if the string value can't be
* converted into the specified unit. <br>
* NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
* readonly.
*/ | A method to set the string value with the specified unit. If the property attached to this value can't accept the specified unit or the string value, the value will be unchanged and a <code>DOMException</code> will be raised | setStringValue | {
"repo_name": "ttimbul/eclipse.wst",
"path": "bundles/org.eclipse.wst.css.core/src/org/eclipse/wst/css/core/internal/document/CSSPrimitiveValueImpl.java",
"license": "epl-1.0",
"size": 11651
} | [
"org.w3c.dom.DOMException"
] | import org.w3c.dom.DOMException; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 2,831,456 |
public List<E> next() {
List<E> next = new LinkedList<>();
hasNext = false;
return next;
} | List<E> function() { List<E> next = new LinkedList<>(); hasNext = false; return next; } | /**
* Get next subset.
*
* @return next subset.
*/ | Get next subset | next | {
"repo_name": "redberry-cas/core",
"path": "src/main/java/cc/redberry/core/transformations/factor/jasfactor/edu/jas/util/KsubSet.java",
"license": "gpl-2.0",
"size": 6568
} | [
"java.util.LinkedList",
"java.util.List"
] | import java.util.LinkedList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,472,718 |
public static String readUTFStringNullable(DataInput in) throws IOException {
return in.readBoolean() ? in.readUTF() : null;
} | static String function(DataInput in) throws IOException { return in.readBoolean() ? in.readUTF() : null; } | /**
* Read UTF string which can be {@code null}.
*
* @param in Input stream.
* @return Value.
* @throws IOException If failed.
*/ | Read UTF string which can be null | readUTFStringNullable | {
"repo_name": "shurun19851206/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java",
"license": "apache-2.0",
"size": 289056
} | [
"java.io.DataInput",
"java.io.IOException"
] | import java.io.DataInput; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,743,024 |
public Point simplify()
{
//while(simplifySomething());
return simplifySomething();
}
| Point function() { return simplifySomething(); } | /**
* Transforms the Knot to an equivalent (simplier) one.
*/ | Transforms the Knot to an equivalent (simplier) one | simplify | {
"repo_name": "aberaud/KnotsGM",
"path": "src/org/knotsgm/core/Knot.java",
"license": "gpl-3.0",
"size": 4661
} | [
"java.awt.Point"
] | import java.awt.Point; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,213,914 |
@FxThread
public void remove(@NotNull final TreeNode<?> child) {
} | void function(@NotNull final TreeNode<?> child) { } | /**
* Remove the child from this node.
*
* @param child the child
*/ | Remove the child from this node | remove | {
"repo_name": "JavaSaBr/jME3-SpaceShift-Editor",
"path": "src/main/java/com/ss/editor/ui/control/tree/node/TreeNode.java",
"license": "apache-2.0",
"size": 10266
} | [
"org.jetbrains.annotations.NotNull"
] | import org.jetbrains.annotations.NotNull; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 2,738,781 |
public void setListener(Listener listener) {
listenerReference = new WeakReference<Listener>(listener);
} | void function(Listener listener) { listenerReference = new WeakReference<Listener>(listener); } | /**
* Set a receiver for the Listener interface
*
* @param listener The new receiver for events from the Listener interface for this endpoint instance
*/ | Set a receiver for the Listener interface | setListener | {
"repo_name": "respoke/respoke-sdk-android",
"path": "respokeSDK/src/main/java/com/digium/respokesdk/RespokeEndpoint.java",
"license": "mit",
"size": 13057
} | [
"java.lang.ref.WeakReference"
] | import java.lang.ref.WeakReference; | import java.lang.ref.*; | [
"java.lang"
] | java.lang; | 563,287 |
@Cacheable(value = PushApplicationService.APPLICATION_CACHE_BY_ID, unless = "#result == null")
PushApplication findByPushApplicationID(String pushApplicationID); | @Cacheable(value = PushApplicationService.APPLICATION_CACHE_BY_ID, unless = STR) PushApplication findByPushApplicationID(String pushApplicationID); | /**
* Returns the PushApplication entity, matching the given ID.
*
* @param pushApplicationID push application ID
*
* @return push application entity
*/ | Returns the PushApplication entity, matching the given ID | findByPushApplicationID | {
"repo_name": "aerobase/unifiedpush-server",
"path": "service/src/main/java/org/jboss/aerogear/unifiedpush/service/PushApplicationService.java",
"license": "apache-2.0",
"size": 2900
} | [
"org.jboss.aerogear.unifiedpush.api.PushApplication",
"org.springframework.cache.annotation.Cacheable"
] | import org.jboss.aerogear.unifiedpush.api.PushApplication; import org.springframework.cache.annotation.Cacheable; | import org.jboss.aerogear.unifiedpush.api.*; import org.springframework.cache.annotation.*; | [
"org.jboss.aerogear",
"org.springframework.cache"
] | org.jboss.aerogear; org.springframework.cache; | 176,434 |
class FrameListener extends InternalFrameAdapter{
public void internalFrameClosing(InternalFrameEvent e) {
MDIInternalFrame frame = (MDIInternalFrame)e.getSource();
MDIView theView = frame.getView();
theView.fireMDIViewEvent(MDIViewEvent.MDIVIEW_CLOSING);
if(theView.getDefaultCloseOperation() == MDIView.DO_NOTHING_ON_CLOSE){
frame.setDefaultCloseOperation(JInternalFrame.DO_NOTHING_ON_CLOSE);
}else{
frame.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
}
}
}
| class FrameListener extends InternalFrameAdapter{ void function(InternalFrameEvent e) { MDIInternalFrame frame = (MDIInternalFrame)e.getSource(); MDIView theView = frame.getView(); theView.fireMDIViewEvent(MDIViewEvent.MDIVIEW_CLOSING); if(theView.getDefaultCloseOperation() == MDIView.DO_NOTHING_ON_CLOSE){ frame.setDefaultCloseOperation(JInternalFrame.DO_NOTHING_ON_CLOSE); }else{ frame.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE); } } } | /**
* Invoked when an internal frame is in the process of being closed.
* This method is provided so as to fire a MDiView closing event.
*/ | Invoked when an internal frame is in the process of being closed. This method is provided so as to fire a MDiView closing event | internalFrameClosing | {
"repo_name": "google-code/aeliamdi",
"path": "src/org/aeliamdi/MDIFrame.java",
"license": "lgpl-2.1",
"size": 43557
} | [
"javax.swing.JInternalFrame",
"javax.swing.event.InternalFrameAdapter",
"javax.swing.event.InternalFrameEvent"
] | import javax.swing.JInternalFrame; import javax.swing.event.InternalFrameAdapter; import javax.swing.event.InternalFrameEvent; | import javax.swing.*; import javax.swing.event.*; | [
"javax.swing"
] | javax.swing; | 1,061,977 |
public static int copyTagsTo(Cell cell, ByteBuffer destination, int destinationOffset) {
int tlen = cell.getTagsLength();
if (cell instanceof ByteBufferExtendedCell) {
ByteBufferUtils.copyFromBufferToBuffer(((ByteBufferExtendedCell) cell).getTagsByteBuffer(),
destination, ((ByteBufferExtendedCell) cell).getTagsPosition(), destinationOffset, tlen);
} else {
ByteBufferUtils.copyFromArrayToBuffer(destination, destinationOffset, cell.getTagsArray(),
cell.getTagsOffset(), tlen);
}
return destinationOffset + tlen;
} | static int function(Cell cell, ByteBuffer destination, int destinationOffset) { int tlen = cell.getTagsLength(); if (cell instanceof ByteBufferExtendedCell) { ByteBufferUtils.copyFromBufferToBuffer(((ByteBufferExtendedCell) cell).getTagsByteBuffer(), destination, ((ByteBufferExtendedCell) cell).getTagsPosition(), destinationOffset, tlen); } else { ByteBufferUtils.copyFromArrayToBuffer(destination, destinationOffset, cell.getTagsArray(), cell.getTagsOffset(), tlen); } return destinationOffset + tlen; } | /**
* Copies the tags info into the tag portion of the cell
* @param cell
* @param destination
* @param destinationOffset
* @return the position after tags
*/ | Copies the tags info into the tag portion of the cell | copyTagsTo | {
"repo_name": "ChinmaySKulkarni/hbase",
"path": "hbase-common/src/main/java/org/apache/hadoop/hbase/PrivateCellUtil.java",
"license": "apache-2.0",
"size": 99961
} | [
"java.nio.ByteBuffer",
"org.apache.hadoop.hbase.util.ByteBufferUtils"
] | import java.nio.ByteBuffer; import org.apache.hadoop.hbase.util.ByteBufferUtils; | import java.nio.*; import org.apache.hadoop.hbase.util.*; | [
"java.nio",
"org.apache.hadoop"
] | java.nio; org.apache.hadoop; | 848,733 |
protected COSDictionary getCOSDictionary() {
return this.dictionary;
} | COSDictionary function() { return this.dictionary; } | /**
* Gets the COS dictionary.
*
* @return the COS dictionary
*/ | Gets the COS dictionary | getCOSDictionary | {
"repo_name": "sencko/NALB",
"path": "nalb2013/src/org/apache/pdfbox/pdmodel/common/PDDictionaryWrapper.java",
"license": "gpl-2.0",
"size": 2108
} | [
"org.apache.pdfbox.cos.COSDictionary"
] | import org.apache.pdfbox.cos.COSDictionary; | import org.apache.pdfbox.cos.*; | [
"org.apache.pdfbox"
] | org.apache.pdfbox; | 1,081,796 |
public List<String> getVary() {
return getValuesAsList(VARY);
} | List<String> function() { return getValuesAsList(VARY); } | /**
* Return the request header names subject to content negotiation.
* @since 4.3
*/ | Return the request header names subject to content negotiation | getVary | {
"repo_name": "Permafrost/TundraHTTP.java",
"path": "src/main/java/permafrost/tundra/org/springframework/http/HttpHeaders.java",
"license": "mit",
"size": 50526
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,857,088 |
protected void addAir_massPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_House_air_mass_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_House_air_mass_feature", "_UI_House_type"),
VisGridPackage.eINSTANCE.getHouse_Air_mass(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
} | void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), VisGridPackage.eINSTANCE.getHouse_Air_mass(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } | /**
* This adds a property descriptor for the Air mass feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds a property descriptor for the Air mass feature. | addAir_massPropertyDescriptor | {
"repo_name": "mikesligo/visGrid",
"path": "ie.tcd.gmf.visGrid.edit/src/visGrid/provider/HouseItemProvider.java",
"license": "gpl-3.0",
"size": 120584
} | [
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory",
"org.eclipse.emf.edit.provider.ItemPropertyDescriptor"
] | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; | import org.eclipse.emf.edit.provider.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,019,308 |
public boolean supportsSchemasInDataManipulation() throws SQLException {
return false;
} | boolean function() throws SQLException { return false; } | /**
* Can a schema name be used in a data manipulation statement?
*
* @return true if so
* @throws SQLException
*/ | Can a schema name be used in a data manipulation statement | supportsSchemasInDataManipulation | {
"repo_name": "slockhart/sql-app",
"path": "mysql-connector-java-5.1.34/src/com/mysql/jdbc/DatabaseMetaData.java",
"license": "gpl-2.0",
"size": 338367
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,032,057 |
EEnum getAssignmentOperator(); | EEnum getAssignmentOperator(); | /**
* Returns the meta object for enum '
* {@link org.smeup.sys.il.expr.AssignmentOperator
* <em>Assignment Operator</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
* @return the meta object for enum '<em>Assignment Operator</em>'.
* @see org.smeup.sys.il.expr.AssignmentOperator
* @generated
*/ | Returns the meta object for enum ' <code>org.smeup.sys.il.expr.AssignmentOperator Assignment Operator</code>'. | getAssignmentOperator | {
"repo_name": "smeup/asup",
"path": "org.smeup.sys.il.expr/src/org/smeup/sys/il/expr/QIntegratedLanguageExpressionPackage.java",
"license": "epl-1.0",
"size": 58569
} | [
"org.eclipse.emf.ecore.EEnum"
] | import org.eclipse.emf.ecore.EEnum; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,171,927 |
public HorizontalLayout getHLayout() {
if (this.hLayout == null) {
this.hLayout = new HorizontalLayout();
this.hLayout.setMargin(false);
this.hLayout.addStyleName("filter-header");
}
return this.hLayout;
} | HorizontalLayout function() { if (this.hLayout == null) { this.hLayout = new HorizontalLayout(); this.hLayout.setMargin(false); this.hLayout.addStyleName(STR); } return this.hLayout; } | /**
* creates the layout when not already done
*
* @return a HLayout with already set style
*/ | creates the layout when not already done | getHLayout | {
"repo_name": "melistik/vaadin-grid-util",
"path": "vaadin-grid-util/src/main/java/org/vaadin/gridutil/cell/RangeCellFilterComponent.java",
"license": "mit",
"size": 1656
} | [
"com.vaadin.ui.HorizontalLayout"
] | import com.vaadin.ui.HorizontalLayout; | import com.vaadin.ui.*; | [
"com.vaadin.ui"
] | com.vaadin.ui; | 1,414,096 |
public void addPropertyChangeListener(PropertyChangeListener listener) {
propertyChangeSupport.addPropertyChangeListener(listener);
} | void function(PropertyChangeListener listener) { propertyChangeSupport.addPropertyChangeListener(listener); } | /**
* Add PropertyChangeListener.
*
* @param listener
*/ | Add PropertyChangeListener | addPropertyChangeListener | {
"repo_name": "mzed/wekimini",
"path": "src/wekimini/LearningManager.java",
"license": "gpl-2.0",
"size": 6668
} | [
"java.beans.PropertyChangeListener"
] | import java.beans.PropertyChangeListener; | import java.beans.*; | [
"java.beans"
] | java.beans; | 2,442,561 |
@Override
protected void collectNewChildDescriptors(
Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
newChildDescriptors.add
(createChildParameter
(OclPackage.Literals.ITERATOR_EXP_VARIABLE_CS__VARIABLE_NAME,
OclFactory.eINSTANCE.createSimpleNameCS()));
newChildDescriptors.add
(createChildParameter
(OclPackage.Literals.ITERATOR_EXP_VARIABLE_CS__TYPE_NAME,
OclFactory.eINSTANCE.createTypeModelElementCS()));
newChildDescriptors.add
(createChildParameter
(OclPackage.Literals.ITERATOR_EXP_VARIABLE_CS__TYPE_NAME,
OclFactory.eINSTANCE.createTupleTypeCS()));
newChildDescriptors.add
(createChildParameter
(OclPackage.Literals.ITERATOR_EXP_VARIABLE_CS__TYPE_NAME,
OclFactory.eINSTANCE.createCollectionTypeIdentifierCS()));
}
| void function( Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); newChildDescriptors.add (createChildParameter (OclPackage.Literals.ITERATOR_EXP_VARIABLE_CS__VARIABLE_NAME, OclFactory.eINSTANCE.createSimpleNameCS())); newChildDescriptors.add (createChildParameter (OclPackage.Literals.ITERATOR_EXP_VARIABLE_CS__TYPE_NAME, OclFactory.eINSTANCE.createTypeModelElementCS())); newChildDescriptors.add (createChildParameter (OclPackage.Literals.ITERATOR_EXP_VARIABLE_CS__TYPE_NAME, OclFactory.eINSTANCE.createTupleTypeCS())); newChildDescriptors.add (createChildParameter (OclPackage.Literals.ITERATOR_EXP_VARIABLE_CS__TYPE_NAME, OclFactory.eINSTANCE.createCollectionTypeIdentifierCS())); } | /**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
* describing the children that can be created under this object. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/ | This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object. | collectNewChildDescriptors | {
"repo_name": "dresden-ocl/dresdenocl",
"path": "plugins/org.dresdenocl.language.ocl.edit/src/org/dresdenocl/language/ocl/provider/IteratorExpVariableCSItemProvider.java",
"license": "lgpl-3.0",
"size": 5884
} | [
"java.util.Collection",
"org.dresdenocl.language.ocl.OclFactory",
"org.dresdenocl.language.ocl.OclPackage"
] | import java.util.Collection; import org.dresdenocl.language.ocl.OclFactory; import org.dresdenocl.language.ocl.OclPackage; | import java.util.*; import org.dresdenocl.language.ocl.*; | [
"java.util",
"org.dresdenocl.language"
] | java.util; org.dresdenocl.language; | 2,166,335 |
private void setupIndicator(ViewGroup indicator, @ColorInt int color, @DrawableRes Integer icon, Integer iconSize) {
boolean dotVisible = icon == null;
boolean iconVisible = !dotVisible;
//setup dot
CardView dotView = (CardView) indicator.findViewById(R.id.indicator_dot_8dp);
dotView.setVisibility(dotVisible ? VISIBLE : INVISIBLE);
dotView.setCardBackgroundColor(color);
//setup icon
ImageView iconView = (ImageView) indicator.findViewById(R.id.indicator_icon);
iconSize = ( iconSize != null) ? iconSize : dotSize;
RelativeLayout.LayoutParams iconParams = new RelativeLayout.LayoutParams(iconSize, iconSize);
if (iconProvider.doColorIcon()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
iconView.setImageTintList(new ColorStateList(new int[][]{new int[]{}}, new int[]{color}));
} else {
iconView.setColorFilter(color, PorterDuff.Mode.MULTIPLY);
}
}
if (iconVisible) {
iconView.setVisibility(VISIBLE);
iconView.setImageResource(icon);
} else {
iconView.setVisibility(INVISIBLE);
}
iconView.setLayoutParams(iconParams);
} | void function(ViewGroup indicator, @ColorInt int color, @DrawableRes Integer icon, Integer iconSize) { boolean dotVisible = icon == null; boolean iconVisible = !dotVisible; CardView dotView = (CardView) indicator.findViewById(R.id.indicator_dot_8dp); dotView.setVisibility(dotVisible ? VISIBLE : INVISIBLE); dotView.setCardBackgroundColor(color); ImageView iconView = (ImageView) indicator.findViewById(R.id.indicator_icon); iconSize = ( iconSize != null) ? iconSize : dotSize; RelativeLayout.LayoutParams iconParams = new RelativeLayout.LayoutParams(iconSize, iconSize); if (iconProvider.doColorIcon()) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { iconView.setImageTintList(new ColorStateList(new int[][]{new int[]{}}, new int[]{color})); } else { iconView.setColorFilter(color, PorterDuff.Mode.MULTIPLY); } } if (iconVisible) { iconView.setVisibility(VISIBLE); iconView.setImageResource(icon); } else { iconView.setVisibility(INVISIBLE); } iconView.setLayoutParams(iconParams); } | /**
* Apply the final values to the single indicator
*
* @param indicator The indicator to apply the parameters to
* @param color The color to set
* @param icon The icon to show
* @param iconSize The size of the icon to show
*/ | Apply the final values to the single indicator | setupIndicator | {
"repo_name": "f0rke/Android-PageIndicator",
"path": "pageindicator/src/main/java/de/f0rke/pageindicator/PageIndicator.java",
"license": "apache-2.0",
"size": 36919
} | [
"android.content.res.ColorStateList",
"android.graphics.PorterDuff",
"android.os.Build",
"android.support.annotation.ColorInt",
"android.support.annotation.DrawableRes",
"android.support.v7.widget.CardView",
"android.view.ViewGroup",
"android.widget.ImageView",
"android.widget.RelativeLayout"
] | import android.content.res.ColorStateList; import android.graphics.PorterDuff; import android.os.Build; import android.support.annotation.ColorInt; import android.support.annotation.DrawableRes; import android.support.v7.widget.CardView; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; | import android.content.res.*; import android.graphics.*; import android.os.*; import android.support.annotation.*; import android.support.v7.widget.*; import android.view.*; import android.widget.*; | [
"android.content",
"android.graphics",
"android.os",
"android.support",
"android.view",
"android.widget"
] | android.content; android.graphics; android.os; android.support; android.view; android.widget; | 825,037 |
static void enqueueWork(Context context, Intent work) {
try {
DownloadService.enqueueWork(context, DownloadService.class, JOB_ID, work);
} catch (IllegalStateException e) {
e.printStackTrace();
}
} | static void enqueueWork(Context context, Intent work) { try { DownloadService.enqueueWork(context, DownloadService.class, JOB_ID, work); } catch (IllegalStateException e) { e.printStackTrace(); } } | /**
* Convenience method for enqueuing work in to this service.
*/ | Convenience method for enqueuing work in to this service | enqueueWork | {
"repo_name": "leapcode/bitmask_android",
"path": "app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/DownloadService.java",
"license": "gpl-3.0",
"size": 2833
} | [
"android.content.Context",
"android.content.Intent"
] | import android.content.Context; import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 2,178,058 |
@Override public T visitLastFormalParameter(@NotNull Java8Parser.LastFormalParameterContext ctx) { return visitChildren(ctx); } | @Override public T visitLastFormalParameter(@NotNull Java8Parser.LastFormalParameterContext ctx) { return visitChildren(ctx); } | /**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/ | The default implementation returns the result of calling <code>#visitChildren</code> on ctx | visitClassBodyDeclaration | {
"repo_name": "lyncode/pal",
"path": "pal-core/src/main/java/org/paltest/pal/parser/impl/java8/Java8BaseVisitor.java",
"license": "apache-2.0",
"size": 27676
} | [
"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,041,280 |
@Given("multiply $a by $b")
public int preconditionPrm003(int a, int b) {
logger.debug("preconditionPrm003: " + a + "*" + b + "=" + (a*b));
return a * b;
}
| @Given(STR) int function(int a, int b) { logger.debug(STR + a + "*" + b + "=" + (a*b)); return a * b; } | /**
* parametrable steps
*/ | parametrable steps | preconditionPrm003 | {
"repo_name": "yroffin/jbehaviour-tools",
"path": "jbehaviour-engine/src/test/java/org/jbehaviour/plugins/SampleSteps.java",
"license": "apache-2.0",
"size": 2492
} | [
"org.jbehaviour.annotation.Given"
] | import org.jbehaviour.annotation.Given; | import org.jbehaviour.annotation.*; | [
"org.jbehaviour.annotation"
] | org.jbehaviour.annotation; | 443,966 |
@Override
protected void onStart() {
// TODO Auto-generated method stub
super.onStart();
Log.i(TAG, "onStart");
} | void function() { super.onStart(); Log.i(TAG, STR); } | /**modified the following code based on
*http://www.phonesdevelopers.com/1692572/
*@author typ587 */ | modified the following code based on HREF | onStart | {
"repo_name": "jingjing3/jingjing3ToDoList",
"path": "src/com/jliang3/todo/ListActivity.java",
"license": "lgpl-3.0",
"size": 3829
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 243,516 |
protected void debugBefore(Exchange exchange, Processor processor, ProcessorDefinition<?> definition,
String id, String label) {
} | void function(Exchange exchange, Processor processor, ProcessorDefinition<?> definition, String id, String label) { } | /**
* Single step debugs and Camel invokes this method before entering the given processor
*/ | Single step debugs and Camel invokes this method before entering the given processor | debugBefore | {
"repo_name": "engagepoint/camel",
"path": "components/camel-test/src/main/java/org/apache/camel/test/junit4/CamelTestSupport.java",
"license": "apache-2.0",
"size": 25706
} | [
"org.apache.camel.Exchange",
"org.apache.camel.Processor",
"org.apache.camel.model.ProcessorDefinition"
] | import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.model.ProcessorDefinition; | import org.apache.camel.*; import org.apache.camel.model.*; | [
"org.apache.camel"
] | org.apache.camel; | 386,609 |
private LookupRef lookForLookupRef(ResourceBase resourceBase) {
String lookupName = resourceBase.getLookupName();
if ((lookupName != null && !lookupName.equals(""))) {
return new LookupRef(resourceBase.getType(), lookupName);
}
return null;
} | LookupRef function(ResourceBase resourceBase) { String lookupName = resourceBase.getLookupName(); if ((lookupName != null && !lookupName.equals(""))) { return new LookupRef(resourceBase.getType(), lookupName); } return null; } | /**
* Gets look up reference from resource if exist.
*
* @param resourceBase resource base object
* @return lookup ref
*/ | Gets look up reference from resource if exist | lookForLookupRef | {
"repo_name": "apache/tomcat",
"path": "java/org/apache/catalina/core/NamingContextListener.java",
"license": "apache-2.0",
"size": 44586
} | [
"org.apache.naming.LookupRef",
"org.apache.tomcat.util.descriptor.web.ResourceBase"
] | import org.apache.naming.LookupRef; import org.apache.tomcat.util.descriptor.web.ResourceBase; | import org.apache.naming.*; import org.apache.tomcat.util.descriptor.web.*; | [
"org.apache.naming",
"org.apache.tomcat"
] | org.apache.naming; org.apache.tomcat; | 1,735,311 |
@Generated
@Selector("priority")
public native String priority(); | @Selector(STR) native String function(); | /**
* [@property] priority
* <p>
* Indicates the eviction priority of downloaded asset.
* <p>
* Assets with default priority will be purged first before assets with higher priorities.
* In case this is not set, default priority is used.
*/ | [@property] priority Indicates the eviction priority of downloaded asset. Assets with default priority will be purged first before assets with higher priorities. In case this is not set, default priority is used | priority | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/avfoundation/AVMutableAssetDownloadStorageManagementPolicy.java",
"license": "apache-2.0",
"size": 5852
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 1,673,072 |
protected void savePerformed(AjaxRequestTarget target) {
} | void function(AjaxRequestTarget target) { } | /**
* Override to provide call-back to situation when save button is clicked
*/ | Override to provide call-back to situation when save button is clicked | savePerformed | {
"repo_name": "PetrGasparik/midpoint",
"path": "gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/roles/component/MultiplicityPolicyPanel.java",
"license": "apache-2.0",
"size": 7626
} | [
"org.apache.wicket.ajax.AjaxRequestTarget"
] | import org.apache.wicket.ajax.AjaxRequestTarget; | import org.apache.wicket.ajax.*; | [
"org.apache.wicket"
] | org.apache.wicket; | 2,352,685 |
private boolean shouldValidate(Partition partition) {
for (String pathToken : this.ignoreDataPathIdentifierList) {
if (partition.getDataLocation().toString().toLowerCase().contains(pathToken.toLowerCase())) {
log.info("Skipping partition " + partition.getCompleteName() + " containing invalid token " + pathToken
.toLowerCase());
return false;
}
}
try {
long createTime = getPartitionCreateTime(partition.getName());
boolean withinTimeWindow = new DateTime(createTime).isAfter(this.maxLookBackTime) && new DateTime(createTime)
.isBefore(this.skipRecentThanTime);
if (!withinTimeWindow) {
log.info("Skipping partition " + partition.getCompleteName() + " as create time " + new DateTime(createTime)
.toString() + " is not within validation time window ");
} else {
log.info("Validating partition " + partition.getCompleteName());
return withinTimeWindow;
}
} catch (ParseException e) {
Throwables.propagate(e);
}
return false;
} | boolean function(Partition partition) { for (String pathToken : this.ignoreDataPathIdentifierList) { if (partition.getDataLocation().toString().toLowerCase().contains(pathToken.toLowerCase())) { log.info(STR + partition.getCompleteName() + STR + pathToken .toLowerCase()); return false; } } try { long createTime = getPartitionCreateTime(partition.getName()); boolean withinTimeWindow = new DateTime(createTime).isAfter(this.maxLookBackTime) && new DateTime(createTime) .isBefore(this.skipRecentThanTime); if (!withinTimeWindow) { log.info(STR + partition.getCompleteName() + STR + new DateTime(createTime) .toString() + STR); } else { log.info(STR + partition.getCompleteName()); return withinTimeWindow; } } catch (ParseException e) { Throwables.propagate(e); } return false; } | /**
* Determine if the {@link Table} or {@link Partition} should be validated by checking if its create time
* lies between maxLookBackTime and skipRecentThanTime window.
*/ | Determine if the <code>Table</code> or <code>Partition</code> should be validated by checking if its create time lies between maxLookBackTime and skipRecentThanTime window | shouldValidate | {
"repo_name": "sahilTakiar/gobblin",
"path": "gobblin-modules/gobblin-azkaban/src/main/java/gobblin/data/management/conversion/hive/validation/ValidationJob.java",
"license": "apache-2.0",
"size": 35428
} | [
"com.google.common.base.Throwables",
"java.text.ParseException",
"org.apache.hadoop.hive.ql.metadata.Partition",
"org.joda.time.DateTime"
] | import com.google.common.base.Throwables; import java.text.ParseException; import org.apache.hadoop.hive.ql.metadata.Partition; import org.joda.time.DateTime; | import com.google.common.base.*; import java.text.*; import org.apache.hadoop.hive.ql.metadata.*; import org.joda.time.*; | [
"com.google.common",
"java.text",
"org.apache.hadoop",
"org.joda.time"
] | com.google.common; java.text; org.apache.hadoop; org.joda.time; | 2,647,132 |
protected RetryContext open(RetryPolicy retryPolicy, RetryState state) {
if (state == null) {
return doOpenInternal(retryPolicy);
}
Object key = state.getKey();
if (state.isForceRefresh()) {
return doOpenInternal(retryPolicy);
}
// If there is no cache hit we can avoid the possible expense of the
// cache re-hydration.
if (!retryContextCache.containsKey(key)) {
// The cache is only used if there is a failure.
return doOpenInternal(retryPolicy);
}
RetryContext context = retryContextCache.get(key);
if (context == null) {
if (retryContextCache.containsKey(key)) {
throw new RetryException(
"Inconsistent state for failed item: no history found. "
+ "Consider whether equals() or hashCode() for the item might be inconsistent, "
+ "or if you need to supply a better ItemKeyGenerator");
}
// The cache could have been expired in between calls to
// containsKey(), so we have to live with this:
return doOpenInternal(retryPolicy);
}
return context;
} | RetryContext function(RetryPolicy retryPolicy, RetryState state) { if (state == null) { return doOpenInternal(retryPolicy); } Object key = state.getKey(); if (state.isForceRefresh()) { return doOpenInternal(retryPolicy); } if (!retryContextCache.containsKey(key)) { return doOpenInternal(retryPolicy); } RetryContext context = retryContextCache.get(key); if (context == null) { if (retryContextCache.containsKey(key)) { throw new RetryException( STR + STR + STR); } return doOpenInternal(retryPolicy); } return context; } | /**
* Delegate to the {@link RetryPolicy} having checked in the cache for an existing
* value if the state is not null.
*
* @param retryPolicy a {@link RetryPolicy} to delegate the context creation
* @return a retry context, either a new one or the one used last time the same state
* was encountered
*/ | Delegate to the <code>RetryPolicy</code> having checked in the cache for an existing value if the state is not null | open | {
"repo_name": "Playtika/spring-retry",
"path": "src/main/java/org/springframework/retry/support/RetryTemplate.java",
"license": "apache-2.0",
"size": 17802
} | [
"org.springframework.retry.RetryContext",
"org.springframework.retry.RetryException",
"org.springframework.retry.RetryPolicy",
"org.springframework.retry.RetryState"
] | import org.springframework.retry.RetryContext; import org.springframework.retry.RetryException; import org.springframework.retry.RetryPolicy; import org.springframework.retry.RetryState; | import org.springframework.retry.*; | [
"org.springframework.retry"
] | org.springframework.retry; | 1,881,289 |
public final Optional<E> first() {
Iterator<E> iterator = getDelegate().iterator();
return iterator.hasNext() ? Optional.of(iterator.next()) : Optional.<E>absent();
} | final Optional<E> function() { Iterator<E> iterator = getDelegate().iterator(); return iterator.hasNext() ? Optional.of(iterator.next()) : Optional.<E>absent(); } | /**
* Returns an {@link Optional} containing the first element in this fluent iterable. If the
* iterable is empty, {@code Optional.absent()} is returned.
*
* <p><b>{@code Stream} equivalent:</b> if the goal is to obtain any element, {@link
* Stream#findAny}; if it must specifically be the <i>first</i> element, {@code Stream#findFirst}.
*
* @throws NullPointerException if the first element is null; if this is a possibility, use {@code
* iterator().next()} or {@link Iterables#getFirst} instead.
*/ | Returns an <code>Optional</code> containing the first element in this fluent iterable. If the iterable is empty, Optional.absent() is returned. Stream equivalent: if the goal is to obtain any element, <code>Stream#findAny</code>; if it must specifically be the first element, Stream#findFirst | first | {
"repo_name": "EdwardLee03/guava",
"path": "guava/src/com/google/common/collect/FluentIterable.java",
"license": "apache-2.0",
"size": 34370
} | [
"com.google.common.base.Optional",
"java.util.Iterator"
] | import com.google.common.base.Optional; import java.util.Iterator; | import com.google.common.base.*; import java.util.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 1,171,380 |
public List<PartnerRequest> findAll();
| List<PartnerRequest> function(); | /**
* This method gets a list of partnerRequest that are active
*
* @return a list from PartnerRequest null if no exist records
*/ | This method gets a list of partnerRequest that are active | findAll | {
"repo_name": "CCAFS/MARLO",
"path": "marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/manager/PartnerRequestManager.java",
"license": "gpl-3.0",
"size": 2647
} | [
"java.util.List",
"org.cgiar.ccafs.marlo.data.model.PartnerRequest"
] | import java.util.List; import org.cgiar.ccafs.marlo.data.model.PartnerRequest; | import java.util.*; import org.cgiar.ccafs.marlo.data.model.*; | [
"java.util",
"org.cgiar.ccafs"
] | java.util; org.cgiar.ccafs; | 2,057,089 |
T from(Reader reader); | T from(Reader reader); | /**
* Create the object type from the given reader.
*
* @param reader the string
* @return the object instance constructed from
*/ | Create the object type from the given reader | from | {
"repo_name": "Unicon/cas",
"path": "core/cas-server-core-util/src/main/java/org/apereo/cas/util/serialization/StringSerializer.java",
"license": "apache-2.0",
"size": 2708
} | [
"java.io.Reader"
] | import java.io.Reader; | import java.io.*; | [
"java.io"
] | java.io; | 1,750,751 |
private void loadFromDB(){
typeNameCache=new HashMap<Integer, String>();
typeCache=new HashMap<Integer, FieldType>();
fieldBeanCache=new HashMap<Integer, TFieldBean>();
List<TFieldBean> fields = FieldBL.loadAll();
for (TFieldBean fieldBean : fields) {
typeNameCache.put(fieldBean.getObjectID(), fieldBean.getFieldType());
typeCache.put(fieldBean.getObjectID(), FieldType.fieldTypeFactory(fieldBean.getFieldType()));
fieldBeanCache.put(fieldBean.getObjectID(), fieldBean);
}
}
| void function(){ typeNameCache=new HashMap<Integer, String>(); typeCache=new HashMap<Integer, FieldType>(); fieldBeanCache=new HashMap<Integer, TFieldBean>(); List<TFieldBean> fields = FieldBL.loadAll(); for (TFieldBean fieldBean : fields) { typeNameCache.put(fieldBean.getObjectID(), fieldBean.getFieldType()); typeCache.put(fieldBean.getObjectID(), FieldType.fieldTypeFactory(fieldBean.getFieldType())); fieldBeanCache.put(fieldBean.getObjectID(), fieldBean); } } | /**
* Load all fields from the database and populate the two maps
*
*/ | Load all fields from the database and populate the two maps | loadFromDB | {
"repo_name": "trackplus/Genji",
"path": "src/main/java/com/aurel/track/fieldType/types/FieldTypeManager.java",
"license": "gpl-3.0",
"size": 7233
} | [
"com.aurel.track.admin.customize.treeConfig.field.FieldBL",
"com.aurel.track.beans.TFieldBean",
"java.util.HashMap",
"java.util.List"
] | import com.aurel.track.admin.customize.treeConfig.field.FieldBL; import com.aurel.track.beans.TFieldBean; import java.util.HashMap; import java.util.List; | import com.aurel.track.admin.customize.*; import com.aurel.track.beans.*; import java.util.*; | [
"com.aurel.track",
"java.util"
] | com.aurel.track; java.util; | 1,608,847 |
protected Map<String, CmsType> readTypes(CmsXmlContentDefinition xmlContentDefinition, Locale locale) {
CmsContentTypeVisitor visitor = new CmsContentTypeVisitor(getCmsObject(), null, locale);
visitor.visitTypes(xmlContentDefinition, locale);
return visitor.getTypes();
}
| Map<String, CmsType> function(CmsXmlContentDefinition xmlContentDefinition, Locale locale) { CmsContentTypeVisitor visitor = new CmsContentTypeVisitor(getCmsObject(), null, locale); visitor.visitTypes(xmlContentDefinition, locale); return visitor.getTypes(); } | /**
* Reads the types from the given content definition and adds the to the map of already registered
* types if necessary.<p>
*
* @param xmlContentDefinition the XML content definition
* @param locale the messages locale
*
* @return the types of the given content definition
*/ | Reads the types from the given content definition and adds the to the map of already registered types if necessary | readTypes | {
"repo_name": "sbonoc/opencms-core",
"path": "src/org/opencms/ade/contenteditor/CmsContentService.java",
"license": "lgpl-2.1",
"size": 69100
} | [
"java.util.Locale",
"java.util.Map",
"org.opencms.acacia.shared.CmsType",
"org.opencms.xml.CmsXmlContentDefinition"
] | import java.util.Locale; import java.util.Map; import org.opencms.acacia.shared.CmsType; import org.opencms.xml.CmsXmlContentDefinition; | import java.util.*; import org.opencms.acacia.shared.*; import org.opencms.xml.*; | [
"java.util",
"org.opencms.acacia",
"org.opencms.xml"
] | java.util; org.opencms.acacia; org.opencms.xml; | 395,958 |
public void setVisibility(String visibility)
{
ParameterCheck.mandatoryString("visibility", visibility);
SiteVisibility siteVisibility = SiteVisibility.valueOf(visibility);
this.siteInfo.setVisibility(siteVisibility);
this.isDirty = true;
}
| void function(String visibility) { ParameterCheck.mandatoryString(STR, visibility); SiteVisibility siteVisibility = SiteVisibility.valueOf(visibility); this.siteInfo.setVisibility(siteVisibility); this.isDirty = true; } | /**
* Set the site visibility
*
* @param visibility site visibility (public|moderated|private)
*/ | Set the site visibility | setVisibility | {
"repo_name": "nguyentienlong/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/site/script/Site.java",
"license": "lgpl-3.0",
"size": 39399
} | [
"org.alfresco.service.cmr.site.SiteVisibility",
"org.springframework.extensions.surf.util.ParameterCheck"
] | import org.alfresco.service.cmr.site.SiteVisibility; import org.springframework.extensions.surf.util.ParameterCheck; | import org.alfresco.service.cmr.site.*; import org.springframework.extensions.surf.util.*; | [
"org.alfresco.service",
"org.springframework.extensions"
] | org.alfresco.service; org.springframework.extensions; | 1,902,987 |
public static String quote(String string) {
StringWriter sw = new StringWriter();
synchronized (sw.getBuffer()) {
try {
return quote(string, sw).toString();
} catch (IOException ignored) {
// will never happen - we are writing to a string writer
return "";
}
}
} | static String function(String string) { StringWriter sw = new StringWriter(); synchronized (sw.getBuffer()) { try { return quote(string, sw).toString(); } catch (IOException ignored) { return ""; } } } | /**
* Produce a string in double quotes with backslash sequences in all the
* right places. A backslash will be inserted within </, producing <\/,
* allowing JSON text to be delivered in HTML. In JSON text, a string cannot
* contain a control character or an unescaped quote or backslash.
*
* @param string
* A String
* @return A String correctly formatted for insertion in a JSON text.
*/ | Produce a string in double quotes with backslash sequences in all the right places. A backslash will be inserted within </, producing <\/, allowing JSON text to be delivered in HTML. In JSON text, a string cannot contain a control character or an unescaped quote or backslash | quote | {
"repo_name": "DraughtGlobe/whoop.im.android",
"path": "src/org/json_actual/JSONObject.java",
"license": "gpl-2.0",
"size": 55883
} | [
"java.io.IOException",
"java.io.StringWriter"
] | import java.io.IOException; import java.io.StringWriter; | import java.io.*; | [
"java.io"
] | java.io; | 895,338 |
static public Interval getIntervalAroundMiddle(Interval interval, ReadablePeriod period) {
return getIntervalAround(middleOf(interval), period);
} | static Interval function(Interval interval, ReadablePeriod period) { return getIntervalAround(middleOf(interval), period); } | /**
* Get an interval the length of the given period, centered around the
* center of the given interval.
*
* @param interval The interval whose center will be the center of the new
* interval.
* @param period The length of the new interval
*
* @return An interval the length of the given period, centered around the
* center of the given interval.
*/ | Get an interval the length of the given period, centered around the center of the given interval | getIntervalAroundMiddle | {
"repo_name": "millmanorama/autopsy",
"path": "Core/src/org/sleuthkit/autopsy/timeline/utils/IntervalUtils.java",
"license": "apache-2.0",
"size": 3755
} | [
"org.joda.time.Interval",
"org.joda.time.ReadablePeriod"
] | import org.joda.time.Interval; import org.joda.time.ReadablePeriod; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 2,041,642 |
public String getUserChallengeQuestionByEmail(String email) {
String result = "";
try {
User user = APILocator.getUserAPI().loadByUserByEmail(email, APILocator.getUserAPI().getSystemUser(), false);
if (user != null) {
UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false);
ChallengeQuestion challengeQuestion = ChallengeQuestionFactory.getChallengeQuestionById(Long
.parseLong(userProxy.getChallengeQuestionId()));
if (challengeQuestion != null)
result = challengeQuestion.getChallengeQuestionText();
} else {
return null;
}
} catch (Exception e) {
Logger.warn(CMSUsersWebAPI.class, e.toString());
}
return result;
}
| String function(String email) { String result = ""; try { User user = APILocator.getUserAPI().loadByUserByEmail(email, APILocator.getUserAPI().getSystemUser(), false); if (user != null) { UserProxy userProxy = com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false); ChallengeQuestion challengeQuestion = ChallengeQuestionFactory.getChallengeQuestionById(Long .parseLong(userProxy.getChallengeQuestionId())); if (challengeQuestion != null) result = challengeQuestion.getChallengeQuestionText(); } else { return null; } } catch (Exception e) { Logger.warn(CMSUsersWebAPI.class, e.toString()); } return result; } | /**
* Return user challenge question
*
* @param email String
* @return String with the challenge question
*/ | Return user challenge question | getUserChallengeQuestionByEmail | {
"repo_name": "ggonzales/dotcms",
"path": "src/com/dotmarketing/viewtools/CMSUsersWebAPI.java",
"license": "gpl-3.0",
"size": 14181
} | [
"com.dotmarketing.beans.ChallengeQuestion",
"com.dotmarketing.beans.UserProxy",
"com.dotmarketing.business.APILocator",
"com.dotmarketing.factories.ChallengeQuestionFactory",
"com.dotmarketing.util.Logger",
"com.liferay.portal.model.User"
] | import com.dotmarketing.beans.ChallengeQuestion; import com.dotmarketing.beans.UserProxy; import com.dotmarketing.business.APILocator; import com.dotmarketing.factories.ChallengeQuestionFactory; import com.dotmarketing.util.Logger; import com.liferay.portal.model.User; | import com.dotmarketing.beans.*; import com.dotmarketing.business.*; import com.dotmarketing.factories.*; import com.dotmarketing.util.*; import com.liferay.portal.model.*; | [
"com.dotmarketing.beans",
"com.dotmarketing.business",
"com.dotmarketing.factories",
"com.dotmarketing.util",
"com.liferay.portal"
] | com.dotmarketing.beans; com.dotmarketing.business; com.dotmarketing.factories; com.dotmarketing.util; com.liferay.portal; | 181,483 |
private void analyze1DTable(){
SwingWorker worker = new SwingWorker<Object, String>(){ | void function(){ SwingWorker worker = new SwingWorker<Object, String>(){ | /**
* Thread safe operation to analyze all 1D tables
* (<code>ProfileGraph2D</code> output, not <code>MultiLevelProfiler</code> output)
* and print the results (performance increase/decrease) to the
* graphical user interface console.
*/ | Thread safe operation to analyze all 1D tables (<code>ProfileGraph2D</code> output, not <code>MultiLevelProfiler</code> output) and print the results (performance increase/decrease) to the graphical user interface console | analyze1DTable | {
"repo_name": "richardfearn/diirt",
"path": "graphene/graphene-profile/src/main/java/org/diirt/graphene/profile/VisualProfiler.java",
"license": "mit",
"size": 69352
} | [
"javax.swing.SwingWorker"
] | import javax.swing.SwingWorker; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 2,514,896 |
manager.snapshotPolicies().getWithResponse("myRG", "account1", "snapshotPolicyName", Context.NONE);
} | manager.snapshotPolicies().getWithResponse("myRG", STR, STR, Context.NONE); } | /**
* Sample code: SnapshotPolicies_Get.
*
* @param manager Entry point to NetAppFilesManager.
*/ | Sample code: SnapshotPolicies_Get | snapshotPoliciesGet | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/netapp/azure-resourcemanager-netapp/src/samples/java/com/azure/resourcemanager/netapp/generated/SnapshotPoliciesGetSamples.java",
"license": "mit",
"size": 830
} | [
"com.azure.core.util.Context"
] | import com.azure.core.util.Context; | import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 1,871,086 |
public boolean isDefaultTagStore(TagStore tagStore) {
return tagStore.getTypes().length == 1
&& (Types.NOTE.getDefaultTagStoreId().equals(tagStore.getTagStoreId())
|| Types.BLOG.getDefaultTagStoreId().equals(tagStore.getTagStoreId()) || Types.ENTITY
.getDefaultTagStoreId().equals(tagStore.getTagStoreId()));
}
| boolean function(TagStore tagStore) { return tagStore.getTypes().length == 1 && (Types.NOTE.getDefaultTagStoreId().equals(tagStore.getTagStoreId()) Types.BLOG.getDefaultTagStoreId().equals(tagStore.getTagStoreId()) Types.ENTITY .getDefaultTagStoreId().equals(tagStore.getTagStoreId())); } | /**
* Test whether the provided TagStore is one of the built-in default TagStores.
*
* @param tagStore
* the store to test
* @return true if it is a default tag store, false otherwise
*/ | Test whether the provided TagStore is one of the built-in default TagStores | isDefaultTagStore | {
"repo_name": "Communote/communote-server",
"path": "communote/persistence/src/main/java/com/communote/server/core/tag/TagStoreManagement.java",
"license": "apache-2.0",
"size": 5139
} | [
"com.communote.server.api.core.tag.TagStoreType",
"com.communote.server.persistence.tag.TagStore"
] | import com.communote.server.api.core.tag.TagStoreType; import com.communote.server.persistence.tag.TagStore; | import com.communote.server.api.core.tag.*; import com.communote.server.persistence.tag.*; | [
"com.communote.server"
] | com.communote.server; | 2,423,829 |
public List<Presence> addAdmin(JID jid, MUCRole senderRole) throws ForbiddenException,
ConflictException;
/**
* Adds a new user to the list of members.
*
* @param bareJID The bare JID of the user to add as a member.
* @param nickname The reserved nickname of the member for the room or null if none.
* @param senderRole the role of the user that is trying to modify the members list.
* @return the list of updated presences of all the client resources that the client used to
* join the room.
* @throws ForbiddenException If the user is not allowed to modify the members list.
* @throws ConflictException If the desired room nickname is already reserved for the room or if
* the room was going to lose all its owners.
* @deprecated Replaced by {@link #addMember(JID, String, MUCRole)} | List<Presence> function(JID jid, MUCRole senderRole) throws ForbiddenException, ConflictException; /** * Adds a new user to the list of members. * * @param bareJID The bare JID of the user to add as a member. * @param nickname The reserved nickname of the member for the room or null if none. * @param senderRole the role of the user that is trying to modify the members list. * @return the list of updated presences of all the client resources that the client used to * join the room. * @throws ForbiddenException If the user is not allowed to modify the members list. * @throws ConflictException If the desired room nickname is already reserved for the room or if * the room was going to lose all its owners. * @deprecated Replaced by {@link #addMember(JID, String, MUCRole)} | /**
* Adds a new user to the list of admins.
*
* @param jid The JID of the user to add as admin.
* @param senderRole The role of the user that is trying to modify the admins list.
* @return the list of updated presences of all the client resources that the client used to
* join the room.
* @throws ForbiddenException If the user is not allowed to modify the admin list.
* @throws ConflictException If the room was going to lose all its owners.
*/ | Adds a new user to the list of admins | addAdmin | {
"repo_name": "AndrewChanChina/pps1",
"path": "src/java/org/jivesoftware/openfire/muc/MUCRoom.java",
"license": "apache-2.0",
"size": 44866
} | [
"java.util.List",
"org.xmpp.packet.Presence"
] | import java.util.List; import org.xmpp.packet.Presence; | import java.util.*; import org.xmpp.packet.*; | [
"java.util",
"org.xmpp.packet"
] | java.util; org.xmpp.packet; | 829,414 |
public synchronized void unsetWebAdapter(CdiContainerListener listener) {
if (factory != null) {
factory.removeListener(listener);
}
this.webAdapter = null;
} | synchronized void function(CdiContainerListener listener) { if (factory != null) { factory.removeListener(listener); } this.webAdapter = null; } | /**
* Unsets the optional web adapter dependency.
*
* @param listener
* web adapter
*/ | Unsets the optional web adapter dependency | unsetWebAdapter | {
"repo_name": "grgrzybek/org.ops4j.pax.cdi",
"path": "pax-cdi-extender/src/main/java/org/ops4j/pax/cdi/extender/impl/CdiExtender.java",
"license": "apache-2.0",
"size": 8850
} | [
"org.ops4j.pax.cdi.spi.CdiContainerListener"
] | import org.ops4j.pax.cdi.spi.CdiContainerListener; | import org.ops4j.pax.cdi.spi.*; | [
"org.ops4j.pax"
] | org.ops4j.pax; | 387,569 |
public FacesConfigReferencedBeanType<T> referencedBeanClass(String referencedBeanClass)
{
childNode.getOrCreate("referenced-bean-class").text(referencedBeanClass);
return this;
} | FacesConfigReferencedBeanType<T> function(String referencedBeanClass) { childNode.getOrCreate(STR).text(referencedBeanClass); return this; } | /**
* Sets the <code>referenced-bean-class</code> element
* @param referencedBeanClass the value for the element <code>referenced-bean-class</code>
* @return the current instance of <code>FacesConfigReferencedBeanType<T></code>
*/ | Sets the <code>referenced-bean-class</code> element | referencedBeanClass | {
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig21/FacesConfigReferencedBeanTypeImpl.java",
"license": "epl-1.0",
"size": 11270
} | [
"org.jboss.shrinkwrap.descriptor.api.facesconfig21.FacesConfigReferencedBeanType"
] | import org.jboss.shrinkwrap.descriptor.api.facesconfig21.FacesConfigReferencedBeanType; | import org.jboss.shrinkwrap.descriptor.api.facesconfig21.*; | [
"org.jboss.shrinkwrap"
] | org.jboss.shrinkwrap; | 2,705,674 |
public Serializable getSerializable()
{
if (value==null || isNull() || value.getType() != VALUE_TYPE_SERIALIZABLE) return null;
return value.getSerializable();
} | Serializable function() { if (value==null isNull() value.getType() != VALUE_TYPE_SERIALIZABLE) return null; return value.getSerializable(); } | /**
* Get the Serializable of this Value.
* If the Value is not of type Serializable, it returns null.
* @return the Serializable of this Value.
*/ | Get the Serializable of this Value. If the Value is not of type Serializable, it returns null | getSerializable | {
"repo_name": "dianhu/Kettle-Research",
"path": "src-core/org/pentaho/di/compatibility/Value.java",
"license": "lgpl-2.1",
"size": 96484
} | [
"java.io.Serializable"
] | import java.io.Serializable; | import java.io.*; | [
"java.io"
] | java.io; | 2,800,404 |
public void setSettings(JCheckBox saveWindow, JCheckBox overall,
JTextArea windowLength, JTextArea windowOverlap) {
save_window_features_check_box = saveWindow;
save_overall_file_features_check_box = overall;
window_length_text_field = windowLength;
window_overlap_fraction_text_field = windowOverlap;
}
| void function(JCheckBox saveWindow, JCheckBox overall, JTextArea windowLength, JTextArea windowOverlap) { save_window_features_check_box = saveWindow; save_overall_file_features_check_box = overall; window_length_text_field = windowLength; window_overlap_fraction_text_field = windowOverlap; } | /**
* Acquires references to GUI components needed to save settings for a batch.
*
* @param saveWindow Should features be saved from each window of data.
* @param overall Should features be saved from over the entire file.
* @param windowLength Size of the analysis window in samples
* @param windowOverlap Percent of the window that should be duplicated.
*/ | Acquires references to GUI components needed to save settings for a batch | setSettings | {
"repo_name": "dmcennis/jAudio2Dev",
"path": "src/jAudioFeatureExtractor/actions/AddBatchAction.java",
"license": "lgpl-2.1",
"size": 7097
} | [
"javax.swing.JCheckBox",
"javax.swing.JTextArea"
] | import javax.swing.JCheckBox; import javax.swing.JTextArea; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,301,979 |
protected Node removeItem(Node item, boolean addDefault)
throws DOMException {
int index = -1;
if (nodes != null) {
final int size = nodes.size();
for (int i = 0; i < size; ++i) {
if (nodes.get(i) == item) {
index = i;
break;
}
}
}
if (index < 0) {
String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null);
throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
}
return remove((AttrImpl)item, index, addDefault);
} | Node function(Node item, boolean addDefault) throws DOMException { int index = -1; if (nodes != null) { final int size = nodes.size(); for (int i = 0; i < size; ++i) { if (nodes.get(i) == item) { index = i; break; } } } if (index < 0) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, STR, null); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } return remove((AttrImpl)item, index, addDefault); } | /**
* NON-DOM: Remove the node object
*
* NOTE: Specifically removes THIS NODE -- not the node with this
* name, nor the node with these contents. If node does not belong to
* this named node map, we throw a DOMException.
*
* @param item The node to remove
* @param addDefault true -- magically add default attribute
* @return Removed node
* @exception DOMException
*/ | name, nor the node with these contents. If node does not belong to this named node map, we throw a DOMException | removeItem | {
"repo_name": "itgeeker/jdk",
"path": "src/com/sun/org/apache/xerces/internal/dom/AttributeMap.java",
"license": "apache-2.0",
"size": 22228
} | [
"org.w3c.dom.DOMException",
"org.w3c.dom.Node"
] | import org.w3c.dom.DOMException; import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 173,775 |
private void handleIncomingDMsg(Message message) {
stats.incReceivedMessages(1L);
stats.incReceivedBytes(message.getBytesRead());
stats.incMessageChannelTime(message.resetTimestamp());
if (logger.isDebugEnabled()) {
logger.debug("Received message '{}' from <{}>", message, message.getSender());
}
scheduleIncomingMessage((DistributionMessage) message);
} | void function(Message message) { stats.incReceivedMessages(1L); stats.incReceivedBytes(message.getBytesRead()); stats.incMessageChannelTime(message.resetTimestamp()); if (logger.isDebugEnabled()) { logger.debug(STR, message, message.getSender()); } scheduleIncomingMessage((DistributionMessage) message); } | /**
* Process an incoming distribution message. This includes scheduling it correctly based on the
* message's nioPriority (executor type)
*/ | Process an incoming distribution message. This includes scheduling it correctly based on the message's nioPriority (executor type) | handleIncomingDMsg | {
"repo_name": "jdeppe-pivotal/geode",
"path": "geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java",
"license": "apache-2.0",
"size": 94410
} | [
"org.apache.geode.distributed.internal.membership.api.Message"
] | import org.apache.geode.distributed.internal.membership.api.Message; | import org.apache.geode.distributed.internal.membership.api.*; | [
"org.apache.geode"
] | org.apache.geode; | 1,728,156 |
public Hop createNextHop(QueryBuilder guidingQuery) {
Hop parent = null;
if (hops.size() > 0) {
parent = hops.get(hops.size() - 1);
}
Hop newHop = new Hop(parent);
newHop.guidingQuery = guidingQuery;
hops.add(newHop);
return newHop;
} | Hop function(QueryBuilder guidingQuery) { Hop parent = null; if (hops.size() > 0) { parent = hops.get(hops.size() - 1); } Hop newHop = new Hop(parent); newHop.guidingQuery = guidingQuery; hops.add(newHop); return newHop; } | /**
* Add a stage in the graph exploration. Each hop represents a stage of
* querying elasticsearch to identify terms which can then be connnected to
* other terms in a subsequent hop.
*
* @param guidingQuery
* optional choice of query which influences which documents are
* considered in this stage
* @return a {@link Hop} object that holds settings for a stage in the graph
* exploration
*/ | Add a stage in the graph exploration. Each hop represents a stage of querying elasticsearch to identify terms which can then be connnected to other terms in a subsequent hop | createNextHop | {
"repo_name": "ern/elasticsearch",
"path": "client/rest-high-level/src/main/java/org/elasticsearch/client/graph/GraphExploreRequest.java",
"license": "apache-2.0",
"size": 10416
} | [
"org.elasticsearch.index.query.QueryBuilder"
] | import org.elasticsearch.index.query.QueryBuilder; | import org.elasticsearch.index.query.*; | [
"org.elasticsearch.index"
] | org.elasticsearch.index; | 101,225 |
final void diffPow(final Complex z, final Complex w,
final int k, final Complex r) {
diff(z, w, d1);
diffPow(z, w, k, d1, r);
} | final void diffPow(final Complex z, final Complex w, final int k, final Complex r) { diff(z, w, d1); diffPow(z, w, k, d1, r); } | /**
* Computes sigma(z)^k - sigma(w)^k, which is returned in r.
* @param z
* @paran w
* @param k is power
* @param r = sigma(z)^k - sigma(w)^k on output
*/ | Computes sigma(z)^k - sigma(w)^k, which is returned in r | diffPow | {
"repo_name": "jupsal/schmies-jTEM",
"path": "src/de/jtem/riemann/schottky/SchottkyGroupElement.java",
"license": "bsd-2-clause",
"size": 12605
} | [
"de.jtem.mfc.field.Complex"
] | import de.jtem.mfc.field.Complex; | import de.jtem.mfc.field.*; | [
"de.jtem.mfc"
] | de.jtem.mfc; | 882,043 |
@ManagedAttribute(description = "The maximum file size for the file store in bytes")
public void setMaxFileStoreSize(long maxFileStoreSize) {
this.maxFileStoreSize = maxFileStoreSize;
} | @ManagedAttribute(description = STR) void function(long maxFileStoreSize) { this.maxFileStoreSize = maxFileStoreSize; } | /**
* Sets the maximum file size for the file store in bytes.
* You can set the value to 0 or negative to turn this off, and have unlimited file store size.
* <p/>
* The default is 32mb.
*/ | Sets the maximum file size for the file store in bytes. You can set the value to 0 or negative to turn this off, and have unlimited file store size. The default is 32mb | setMaxFileStoreSize | {
"repo_name": "Fabryprog/camel",
"path": "core/camel-support/src/main/java/org/apache/camel/support/processor/idempotent/FileIdempotentRepository.java",
"license": "apache-2.0",
"size": 18134
} | [
"org.apache.camel.api.management.ManagedAttribute"
] | import org.apache.camel.api.management.ManagedAttribute; | import org.apache.camel.api.management.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,426,110 |
private static void locateDependencyFileEntry(JarInputStream jarInputStream, String depTxtPath) throws IOException {
JarEntry nextJarEntry = jarInputStream.getNextJarEntry();
while (nextJarEntry != null) {
if (depTxtPath.equals(nextJarEntry.getName())) {// we got it so return it
return;
}
nextJarEntry = jarInputStream.getNextJarEntry();
}
throw new ComponentException(ComponentsApiErrorCode.COMPUTE_DEPENDENCIES_FAILED,
ExceptionContext.withBuilder().put("path", depTxtPath).build());
} | static void function(JarInputStream jarInputStream, String depTxtPath) throws IOException { JarEntry nextJarEntry = jarInputStream.getNextJarEntry(); while (nextJarEntry != null) { if (depTxtPath.equals(nextJarEntry.getName())) { return; } nextJarEntry = jarInputStream.getNextJarEntry(); } throw new ComponentException(ComponentsApiErrorCode.COMPUTE_DEPENDENCIES_FAILED, ExceptionContext.withBuilder().put("path", depTxtPath).build()); } | /**
* this will place the jarInputStream at the depTxtPath location or throws a ComponentException if not found
*/ | this will place the jarInputStream at the depTxtPath location or throws a ComponentException if not found | locateDependencyFileEntry | {
"repo_name": "Talend/components",
"path": "core/components-api/src/main/java/org/talend/components/api/component/runtime/DependenciesReader.java",
"license": "apache-2.0",
"size": 12484
} | [
"java.io.IOException",
"java.util.jar.JarEntry",
"java.util.jar.JarInputStream",
"org.talend.components.api.exception.ComponentException",
"org.talend.components.api.exception.error.ComponentsApiErrorCode",
"org.talend.daikon.exception.ExceptionContext"
] | import java.io.IOException; import java.util.jar.JarEntry; import java.util.jar.JarInputStream; import org.talend.components.api.exception.ComponentException; import org.talend.components.api.exception.error.ComponentsApiErrorCode; import org.talend.daikon.exception.ExceptionContext; | import java.io.*; import java.util.jar.*; import org.talend.components.api.exception.*; import org.talend.components.api.exception.error.*; import org.talend.daikon.exception.*; | [
"java.io",
"java.util",
"org.talend.components",
"org.talend.daikon"
] | java.io; java.util; org.talend.components; org.talend.daikon; | 1,198,713 |
public Range findRangeBounds(XYDataset dataset) {
if (dataset == null) {
return null;
}
double min = Double.POSITIVE_INFINITY;
double max = Double.NEGATIVE_INFINITY;
TableXYDataset d = (TableXYDataset) dataset;
int itemCount = d.getItemCount();
for (int i = 0; i < itemCount; i++) {
double[] stackValues = getStackValues((TableXYDataset) dataset,
d.getSeriesCount(), i);
min = Math.min(min, stackValues[0]);
max = Math.max(max, stackValues[1]);
}
if (min == Double.POSITIVE_INFINITY) {
return null;
}
return new Range(min, max);
}
| Range function(XYDataset dataset) { if (dataset == null) { return null; } double min = Double.POSITIVE_INFINITY; double max = Double.NEGATIVE_INFINITY; TableXYDataset d = (TableXYDataset) dataset; int itemCount = d.getItemCount(); for (int i = 0; i < itemCount; i++) { double[] stackValues = getStackValues((TableXYDataset) dataset, d.getSeriesCount(), i); min = Math.min(min, stackValues[0]); max = Math.max(max, stackValues[1]); } if (min == Double.POSITIVE_INFINITY) { return null; } return new Range(min, max); } | /**
* Returns the range of values the renderer requires to display all the
* items from the specified dataset.
*
* @param dataset the dataset (<code>null</code> permitted).
*
* @return The range (or <code>null</code> if the dataset is
* <code>null</code> or empty).
*/ | Returns the range of values the renderer requires to display all the items from the specified dataset | findRangeBounds | {
"repo_name": "SpoonLabs/astor",
"path": "examples/chart_11/source/org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java",
"license": "gpl-2.0",
"size": 19074
} | [
"org.jfree.data.Range",
"org.jfree.data.xy.TableXYDataset",
"org.jfree.data.xy.XYDataset"
] | import org.jfree.data.Range; import org.jfree.data.xy.TableXYDataset; import org.jfree.data.xy.XYDataset; | import org.jfree.data.*; import org.jfree.data.xy.*; | [
"org.jfree.data"
] | org.jfree.data; | 2,227,155 |
public NotesAndTerms getCreditnotesNotesAndTerms()throws Exception
{
String urlString = url+"/creditnotes/notesandterms"; //No I18N
String response = ZohoHTTPClient.get(urlString, getQueryMap());
NotesAndTerms notesAndTerms = settingsParser.getNotesAndTerms(response);
return notesAndTerms;
}
| NotesAndTerms function()throws Exception { String urlString = url+STR; String response = ZohoHTTPClient.get(urlString, getQueryMap()); NotesAndTerms notesAndTerms = settingsParser.getNotesAndTerms(response); return notesAndTerms; } | /**
* Get the contents of creditnote notes and terms.
* It returns the creditnotes NotesAndTerms object.
* @return Returns the NotesAndTerms object.
*/ | Get the contents of creditnote notes and terms. It returns the creditnotes NotesAndTerms object | getCreditnotesNotesAndTerms | {
"repo_name": "zoho/books-java-wrappers",
"path": "source/com/zoho/books/api/SettingsApi.java",
"license": "mit",
"size": 36415
} | [
"com.zoho.books.model.NotesAndTerms",
"com.zoho.books.util.ZohoHTTPClient"
] | import com.zoho.books.model.NotesAndTerms; import com.zoho.books.util.ZohoHTTPClient; | import com.zoho.books.model.*; import com.zoho.books.util.*; | [
"com.zoho.books"
] | com.zoho.books; | 566,133 |
public Message saveDraft(final Account account, final Message message, long existingDraftId, boolean saveRemotely) {
Message localMessage = null;
try {
LocalStore localStore = account.getLocalStore();
LocalFolder localFolder = localStore.getFolder(account.getDraftsFolderName());
localFolder.open(Folder.OPEN_MODE_RW);
if (existingDraftId != INVALID_MESSAGE_ID) {
String uid = localFolder.getMessageUidById(existingDraftId);
message.setUid(uid);
}
// Save the message to the store.
localFolder.appendMessages(Collections.singletonList(message));
// Fetch the message back from the store. This is the Message that's returned to the caller.
localMessage = localFolder.getMessage(message.getUid());
localMessage.setFlag(Flag.X_DOWNLOADED_FULL, true);
if (saveRemotely) {
PendingCommand command = new PendingCommand();
command.command = PENDING_COMMAND_APPEND;
command.arguments = new String[] {
localFolder.getName(),
localMessage.getUid()
};
queuePendingCommand(account, command);
processPendingCommands(account);
}
} catch (MessagingException e) {
Log.e(K9.LOG_TAG, "Unable to save message as draft.", e);
addErrorMessage(account, null, e);
}
return localMessage;
} | Message function(final Account account, final Message message, long existingDraftId, boolean saveRemotely) { Message localMessage = null; try { LocalStore localStore = account.getLocalStore(); LocalFolder localFolder = localStore.getFolder(account.getDraftsFolderName()); localFolder.open(Folder.OPEN_MODE_RW); if (existingDraftId != INVALID_MESSAGE_ID) { String uid = localFolder.getMessageUidById(existingDraftId); message.setUid(uid); } localFolder.appendMessages(Collections.singletonList(message)); localMessage = localFolder.getMessage(message.getUid()); localMessage.setFlag(Flag.X_DOWNLOADED_FULL, true); if (saveRemotely) { PendingCommand command = new PendingCommand(); command.command = PENDING_COMMAND_APPEND; command.arguments = new String[] { localFolder.getName(), localMessage.getUid() }; queuePendingCommand(account, command); processPendingCommands(account); } } catch (MessagingException e) { Log.e(K9.LOG_TAG, STR, e); addErrorMessage(account, null, e); } return localMessage; } | /**
* Save a draft message.
* @param account Account we are saving for.
* @param message Message to save.
* @return Message representing the entry in the local store.
*/ | Save a draft message | saveDraft | {
"repo_name": "github201407/k-9",
"path": "k9mail/src/main/java/com/fsck/k9/controller/MessagingController.java",
"license": "bsd-3-clause",
"size": 206200
} | [
"android.util.Log",
"com.fsck.k9.Account",
"com.fsck.k9.mail.Flag",
"com.fsck.k9.mail.Folder",
"com.fsck.k9.mail.Message",
"com.fsck.k9.mail.MessagingException",
"com.fsck.k9.mailstore.LocalFolder",
"com.fsck.k9.mailstore.LocalStore",
"java.util.Collections"
] | import android.util.Log; import com.fsck.k9.Account; import com.fsck.k9.mail.Flag; import com.fsck.k9.mail.Folder; import com.fsck.k9.mail.Message; import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mailstore.LocalFolder; import com.fsck.k9.mailstore.LocalStore; import java.util.Collections; | import android.util.*; import com.fsck.k9.*; import com.fsck.k9.mail.*; import com.fsck.k9.mailstore.*; import java.util.*; | [
"android.util",
"com.fsck.k9",
"java.util"
] | android.util; com.fsck.k9; java.util; | 2,335,080 |
@Override
public long getNextIncludedTime(long timeStamp) {
long nextIncludedTime = timeStamp + ONE_MILLI;
while (isTimeIncluded(nextIncludedTime)) {
LongRange timeRange = findTimeRange(timeStamp);
if (nextIncludedTime >= timeRange.getMinimumLong() && nextIncludedTime <= timeRange.getMaximumLong()) {
nextIncludedTime = timeRange.getMaximumLong() + ONE_MILLI;
} else if ((getBaseCalendar() != null) && (!getBaseCalendar().isTimeIncluded(nextIncludedTime))) {
nextIncludedTime = getBaseCalendar().getNextIncludedTime(nextIncludedTime);
} else {
nextIncludedTime++;
}
}
return nextIncludedTime;
} | long function(long timeStamp) { long nextIncludedTime = timeStamp + ONE_MILLI; while (isTimeIncluded(nextIncludedTime)) { LongRange timeRange = findTimeRange(timeStamp); if (nextIncludedTime >= timeRange.getMinimumLong() && nextIncludedTime <= timeRange.getMaximumLong()) { nextIncludedTime = timeRange.getMaximumLong() + ONE_MILLI; } else if ((getBaseCalendar() != null) && (!getBaseCalendar().isTimeIncluded(nextIncludedTime))) { nextIncludedTime = getBaseCalendar().getNextIncludedTime(nextIncludedTime); } else { nextIncludedTime++; } } return nextIncludedTime; } | /**
* Determine the next time (in milliseconds) that is 'included' by the
* Calendar after the given time.
*/ | Determine the next time (in milliseconds) that is 'included' by the Calendar after the given time | getNextIncludedTime | {
"repo_name": "computergeek1507/openhab",
"path": "bundles/io/org.openhab.io.gcal/src/main/java/org/openhab/io/gcal/internal/util/TimeRangeCalendar.java",
"license": "epl-1.0",
"size": 4127
} | [
"org.apache.commons.lang.math.LongRange"
] | import org.apache.commons.lang.math.LongRange; | import org.apache.commons.lang.math.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,116,814 |
public Date getCreationDate() {
return new Date(startDate);
} | Date function() { return new Date(startDate); } | /**
* Obtain the date the session was created.
*
* @return the session's creation date.
*/ | Obtain the date the session was created | getCreationDate | {
"repo_name": "xiupitter/openfire",
"path": "LocalSession.java",
"license": "apache-2.0",
"size": 12200
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,412,652 |
@Generated
@IsOptional
@Deprecated
@Selector("splitViewController:willShowViewController:invalidatingBarButtonItem:")
default void splitViewControllerWillShowViewControllerInvalidatingBarButtonItem(UISplitViewController svc,
UIViewController aViewController, UIBarButtonItem barButtonItem) {
throw new java.lang.UnsupportedOperationException();
} | @Selector(STR) default void splitViewControllerWillShowViewControllerInvalidatingBarButtonItem(UISplitViewController svc, UIViewController aViewController, UIBarButtonItem barButtonItem) { throw new java.lang.UnsupportedOperationException(); } | /**
* Called when the view is shown again in the split view, invalidating the button and popover controller.
*/ | Called when the view is shown again in the split view, invalidating the button and popover controller | splitViewControllerWillShowViewControllerInvalidatingBarButtonItem | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/uikit/protocol/UISplitViewControllerDelegate.java",
"license": "apache-2.0",
"size": 12030
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 1,567,559 |
@Override
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
ConnectionInfo info = (ConnectionInfo)o;
info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setClientId(tightUnmarshalString(dataIn, bs));
info.setPassword(tightUnmarshalString(dataIn, bs));
info.setUserName(tightUnmarshalString(dataIn, bs));
if (bs.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for( int i=0; i < size; i++ ) {
value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
}
info.setBrokerPath(value);
}
else {
info.setBrokerPath(null);
}
info.setBrokerMasterConnector(bs.readBoolean());
info.setManageable(bs.readBoolean());
info.setClientMaster(bs.readBoolean());
} | void function(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); ConnectionInfo info = (ConnectionInfo)o; info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setClientId(tightUnmarshalString(dataIn, bs)); info.setPassword(tightUnmarshalString(dataIn, bs)); info.setUserName(tightUnmarshalString(dataIn, bs)); if (bs.readBoolean()) { short size = dataIn.readShort(); BrokerId value[] = new BrokerId[size]; for( int i=0; i < size; i++ ) { value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs); } info.setBrokerPath(value); } else { info.setBrokerPath(null); } info.setBrokerMasterConnector(bs.readBoolean()); info.setManageable(bs.readBoolean()); info.setClientMaster(bs.readBoolean()); } | /**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/ | Un-marshal an object instance from the data input stream | tightUnmarshal | {
"repo_name": "tabish121/OpenWire",
"path": "openwire-legacy/src/main/java/io/openwire/codec/v3/ConnectionInfoMarshaller.java",
"license": "apache-2.0",
"size": 6713
} | [
"io.openwire.codec.BooleanStream",
"io.openwire.codec.OpenWireFormat",
"io.openwire.commands.BrokerId",
"io.openwire.commands.ConnectionId",
"io.openwire.commands.ConnectionInfo",
"java.io.DataInput",
"java.io.IOException"
] | import io.openwire.codec.BooleanStream; import io.openwire.codec.OpenWireFormat; import io.openwire.commands.BrokerId; import io.openwire.commands.ConnectionId; import io.openwire.commands.ConnectionInfo; import java.io.DataInput; import java.io.IOException; | import io.openwire.codec.*; import io.openwire.commands.*; import java.io.*; | [
"io.openwire.codec",
"io.openwire.commands",
"java.io"
] | io.openwire.codec; io.openwire.commands; java.io; | 727,273 |
public ActivationID getActivationID() {
return id;
} | ActivationID function() { return id; } | /**
* Returns the activation identifier supplied during construction of
* this invocation handler.
*
* @return the activation identifier
*/ | Returns the activation identifier supplied during construction of this invocation handler | getActivationID | {
"repo_name": "trasukg/river-qa-2.2",
"path": "src/net/jini/activation/ActivatableInvocationHandler.java",
"license": "apache-2.0",
"size": 43023
} | [
"java.rmi.activation.ActivationID"
] | import java.rmi.activation.ActivationID; | import java.rmi.activation.*; | [
"java.rmi"
] | java.rmi; | 2,421,940 |
public EventSubscriptionInner update(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) {
return updateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).toBlocking().last().body();
} | EventSubscriptionInner function(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { return updateWithServiceResponseAsync(scope, eventSubscriptionName, eventSubscriptionUpdateParameters).toBlocking().last().body(); } | /**
* Update an event subscription.
* Asynchronously updates an existing event subscription.
*
* @param scope The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level resource belonging to a resource provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' for a resource, and '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' for an EventGrid topic.
* @param eventSubscriptionName Name of the event subscription to be updated.
* @param eventSubscriptionUpdateParameters Updated event subscription information.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the EventSubscriptionInner object if successful.
*/ | Update an event subscription. Asynchronously updates an existing event subscription | update | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/eventgrid/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/eventgrid/v2019_06_01/implementation/EventSubscriptionsInner.java",
"license": "mit",
"size": 345238
} | [
"com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptionUpdateParameters"
] | import com.microsoft.azure.management.eventgrid.v2019_06_01.EventSubscriptionUpdateParameters; | import com.microsoft.azure.management.eventgrid.v2019_06_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 1,321,215 |
public void injectSmsPdu(byte[] pdu, String format, PendingIntent receivedIntent) {
if (!format.equals(SmsMessage.FORMAT_3GPP) && !format.equals(SmsMessage.FORMAT_3GPP2)) {
// Format must be either 3gpp or 3gpp2.
throw new IllegalArgumentException(
"Invalid pdu format. format must be either 3gpp or 3gpp2");
}
try {
ISms iccISms = ISms.Stub.asInterface(ServiceManager.getService("isms"));
if (iccISms != null) {
iccISms.injectSmsPdu(pdu, format, receivedIntent);
}
} catch (RemoteException ex) {
// ignore it
}
} | void function(byte[] pdu, String format, PendingIntent receivedIntent) { if (!format.equals(SmsMessage.FORMAT_3GPP) && !format.equals(SmsMessage.FORMAT_3GPP2)) { throw new IllegalArgumentException( STR); } try { ISms iccISms = ISms.Stub.asInterface(ServiceManager.getService("isms")); if (iccISms != null) { iccISms.injectSmsPdu(pdu, format, receivedIntent); } } catch (RemoteException ex) { } } | /**
* Inject an SMS PDU into the android application framework.
*
* The caller should have carrier privileges.
* @see android.telephony.TelephonyManager.hasCarrierPrivileges
*
* @param pdu is the byte array of pdu to be injected into android application framework
* @param format is the format of SMS pdu (3gpp or 3gpp2)
* @param receivedIntent if not NULL this <code>PendingIntent</code> is
* broadcast when the message is successfully received by the
* android application framework, or failed. This intent is broadcasted at
* the same time an SMS received from radio is acknowledged back.
* The result code will be <code>RESULT_SMS_HANDLED</code> for success, or
* <code>RESULT_SMS_GENERIC_ERROR</code> for error.
*
* @throws IllegalArgumentException if format is not one of 3gpp and 3gpp2.
*/ | Inject an SMS PDU into the android application framework. The caller should have carrier privileges | injectSmsPdu | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "frameworks/opt/telephony/src/java/android/telephony/SmsManager.java",
"license": "gpl-3.0",
"size": 58847
} | [
"android.app.PendingIntent",
"android.os.RemoteException",
"android.os.ServiceManager",
"com.android.internal.telephony.ISms"
] | import android.app.PendingIntent; import android.os.RemoteException; import android.os.ServiceManager; import com.android.internal.telephony.ISms; | import android.app.*; import android.os.*; import com.android.internal.telephony.*; | [
"android.app",
"android.os",
"com.android.internal"
] | android.app; android.os; com.android.internal; | 1,434,078 |
@SuppressWarnings("PMD.AvoidCatchingThrowable")
void runAndReschedule(DelayQueue<DelayedTask> queue, Stats stats) {
thread = Thread.currentThread();
boolean scheduleAgain = options.schedulingPolicy != Policy.RUN_ONCE;
try {
if (!isDone()) {
task.run();
}
} catch (Throwable t) {
// This catches Throwable because we cannot control the task and thus cannot
// ensure it is well behaved with respect to exceptions.
LOGGER.warn("task execution failed", t);
stats.incrementUncaught(t);
scheduleAgain = !options.stopOnFailure;
} finally {
thread = null;
if (scheduleAgain && !isDone()) {
updateNextExecutionTime(stats.skipped());
queue.put(this);
} else {
cancelled = true;
}
}
} | @SuppressWarnings(STR) void runAndReschedule(DelayQueue<DelayedTask> queue, Stats stats) { thread = Thread.currentThread(); boolean scheduleAgain = options.schedulingPolicy != Policy.RUN_ONCE; try { if (!isDone()) { task.run(); } } catch (Throwable t) { LOGGER.warn(STR, t); stats.incrementUncaught(t); scheduleAgain = !options.stopOnFailure; } finally { thread = null; if (scheduleAgain && !isDone()) { updateNextExecutionTime(stats.skipped()); queue.put(this); } else { cancelled = true; } } } | /**
* Execute the task and if reschedule another execution.
*
* @param queue
* Queue for the pool. This task will be added to the queue to schedule
* future executions.
* @param stats
* Handle to stats that should be updated based on the execution of the
* task.
*/ | Execute the task and if reschedule another execution | runAndReschedule | {
"repo_name": "Netflix/spectator",
"path": "spectator-api/src/main/java/com/netflix/spectator/impl/Scheduler.java",
"license": "apache-2.0",
"size": 16685
} | [
"java.util.concurrent.DelayQueue"
] | import java.util.concurrent.DelayQueue; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,522,464 |
public static void runIgnoringConstraintViolation(Runnable task)
{
try {
runIgnoringConstraintViolation(callable(task), null);
}
catch (Exception e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw Throwables.propagate(e);
}
} | static void function(Runnable task) { try { runIgnoringConstraintViolation(callable(task), null); } catch (Exception e) { if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } throw Throwables.propagate(e); } } | /**
* Run a SQL query as ignoring any constraint violations.
* This allows idempotent inserts (equivalent to INSERT IGNORE).
*/ | Run a SQL query as ignoring any constraint violations. This allows idempotent inserts (equivalent to INSERT IGNORE) | runIgnoringConstraintViolation | {
"repo_name": "kuzemchik/presto",
"path": "presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/SqlUtils.java",
"license": "apache-2.0",
"size": 2417
} | [
"com.google.common.base.Throwables"
] | import com.google.common.base.Throwables; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 407,212 |
@Override
public int hashCode() {
return Arrays.hashCode(new Object[] {canonicalCode, description});
} | int function() { return Arrays.hashCode(new Object[] {canonicalCode, description}); } | /**
* Hash codes on Statuses are not well defined.
*
* @see #equals
*/ | Hash codes on Statuses are not well defined | hashCode | {
"repo_name": "sebright/opencensus-java",
"path": "api/src/main/java/io/opencensus/trace/Status.java",
"license": "apache-2.0",
"size": 14266
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 2,878,081 |
public NClob createNClob() {
return lobCreationContext.execute( CREATE_NCLOB_CALLBACK );
} | NClob function() { return lobCreationContext.execute( CREATE_NCLOB_CALLBACK ); } | /**
* Create the basic contextual NCLOB reference.
*
* @return The created NCLOB reference.
*/ | Create the basic contextual NCLOB reference | createNClob | {
"repo_name": "1fechner/FeatureExtractor",
"path": "sources/FeatureExtractor/lib/hibernate-release-5.1.0.Final/project/hibernate-core/src/main/java/org/hibernate/engine/jdbc/ContextualLobCreator.java",
"license": "lgpl-2.1",
"size": 4415
} | [
"java.sql.NClob"
] | import java.sql.NClob; | import java.sql.*; | [
"java.sql"
] | java.sql; | 882,323 |
public static AlertDialogHelper newInstance(final Fragment container, final int id, final int title, final int message, final String args, final boolean neutralOnly) {
final AlertDialogHelper frag = new AlertDialogHelper();
frag.setTargetFragment(container, id);
// Caution: Don't set setRetainInstance(true) explicitly. This will cause the dialog to disappear
// see http://stackoverflow.com/questions/11307390/dialogfragment-disappears-on-rotation-despite-setretaininstancetrue
//frag.setRetainInstance(true);
final Bundle bundle = new Bundle();
bundle.putInt("dialog_id", id);
bundle.putInt("title", title);
bundle.putInt("message", message);
bundle.putString("args", args);
bundle.putBoolean("only_neutral", neutralOnly);
frag.setArguments(bundle);
return frag;
} | static AlertDialogHelper function(final Fragment container, final int id, final int title, final int message, final String args, final boolean neutralOnly) { final AlertDialogHelper frag = new AlertDialogHelper(); frag.setTargetFragment(container, id); final Bundle bundle = new Bundle(); bundle.putInt(STR, id); bundle.putInt("title", title); bundle.putInt(STR, message); bundle.putString("args", args); bundle.putBoolean(STR, neutralOnly); frag.setArguments(bundle); return frag; } | /**
* Creates a new alert dialog
* @param id Alert dialog id
* @param title Alert title resource
* @param message Alert message resource
* @param args opional argument (e.g. session id)
* @param neutralOnly show only neutral button
* @return
*/ | Creates a new alert dialog | newInstance | {
"repo_name": "wish7code/openbmap",
"path": "android/app/src/main/java/org/openbmap/activities/SessionListFragment.java",
"license": "agpl-3.0",
"size": 15135
} | [
"android.os.Bundle",
"android.support.v4.app.Fragment"
] | import android.os.Bundle; import android.support.v4.app.Fragment; | import android.os.*; import android.support.v4.app.*; | [
"android.os",
"android.support"
] | android.os; android.support; | 1,692,854 |
public GradientPaintTransformer getGradientPaintTransformer() {
return this.gradientPaintTransformer;
} | GradientPaintTransformer function() { return this.gradientPaintTransformer; } | /**
* Returns the gradient paint transformer (an object used to transform
* gradient paint objects to fit each bar).
*
* @return A transformer (<code>null</code> possible).
*
* @see #setGradientPaintTransformer(GradientPaintTransformer)
*/ | Returns the gradient paint transformer (an object used to transform gradient paint objects to fit each bar) | getGradientPaintTransformer | {
"repo_name": "akardapolov/ASH-Viewer",
"path": "jfreechart-fse/src/main/java/org/jfree/chart/renderer/xy/XYBarRenderer.java",
"license": "gpl-3.0",
"size": 41965
} | [
"org.jfree.chart.ui.GradientPaintTransformer"
] | import org.jfree.chart.ui.GradientPaintTransformer; | import org.jfree.chart.ui.*; | [
"org.jfree.chart"
] | org.jfree.chart; | 917,146 |
public void addTransitionToEntityState(String title, IMResourceStateMachine targetResourceStateMachine, IMState targetState, String method, String linkProperty) {
transitions.add(new IMEntityStateTransition(targetResourceStateMachine, targetState, linkProperty, title, method));
} | void function(String title, IMResourceStateMachine targetResourceStateMachine, IMState targetState, String method, String linkProperty) { transitions.add(new IMEntityStateTransition(targetResourceStateMachine, targetState, linkProperty, title, method)); } | /**
* Add a transition to an entity state of a resource state machine
* @param title
* @param targetResourceStateMachine
* @param targetState
* @param method
* @param linkProperty
*/ | Add a transition to an entity state of a resource state machine | addTransitionToEntityState | {
"repo_name": "junejosheeraz/IRIS",
"path": "interaction-sdk/src/main/java/com/temenos/interaction/sdk/interaction/state/IMState.java",
"license": "agpl-3.0",
"size": 5275
} | [
"com.temenos.interaction.sdk.interaction.IMResourceStateMachine",
"com.temenos.interaction.sdk.interaction.transition.IMEntityStateTransition"
] | import com.temenos.interaction.sdk.interaction.IMResourceStateMachine; import com.temenos.interaction.sdk.interaction.transition.IMEntityStateTransition; | import com.temenos.interaction.sdk.interaction.*; import com.temenos.interaction.sdk.interaction.transition.*; | [
"com.temenos.interaction"
] | com.temenos.interaction; | 332,800 |
protected String getOptionalParameter(final HttpServletRequest request, final String parameterName) {
Preconditions.checkNotNull(request, "The provided request was invalid");
return getParameter(request, parameterName, true);
} | String function(final HttpServletRequest request, final String parameterName) { Preconditions.checkNotNull(request, STR); return getParameter(request, parameterName, true); } | /**
* Attempts to extract the specified parameter from the provided request, if available
*
* @param request The request instance containing the parameter
* @param parameterName The name of the parameter to extract
* @return The value of the specified parameter if found, null otherwise
*/ | Attempts to extract the specified parameter from the provided request, if available | getOptionalParameter | {
"repo_name": "bings/lumify",
"path": "web/web-base/src/main/java/io/lumify/web/MinimalRequestHandler.java",
"license": "apache-2.0",
"size": 7560
} | [
"com.google.common.base.Preconditions",
"javax.servlet.http.HttpServletRequest"
] | import com.google.common.base.Preconditions; import javax.servlet.http.HttpServletRequest; | import com.google.common.base.*; import javax.servlet.http.*; | [
"com.google.common",
"javax.servlet"
] | com.google.common; javax.servlet; | 2,839,902 |
private static void setRuleAttributeValue(
Rule rule,
EventHandler eventHandler,
Attribute attr,
Object nativeAttrVal,
boolean explicit) {
if (attr.getName().equals("visibility")) {
@SuppressWarnings("unchecked")
List<Label> attrList = (List<Label>) nativeAttrVal;
if (!attrList.isEmpty()
&& ConstantRuleVisibility.LEGACY_PUBLIC_LABEL.equals(attrList.get(0))) {
rule.reportError(
rule.getLabel() + ": //visibility:legacy_public only allowed in package declaration",
eventHandler);
}
try {
rule.setVisibility(PackageFactory.getVisibility(rule.getLabel(), attrList));
} catch (EvalException e) {
rule.reportError(rule.getLabel() + " " + e.getMessage(), eventHandler);
}
}
rule.setAttributeValue(attr, nativeAttrVal, explicit);
checkAllowedValues(rule, attr, eventHandler);
}
/**
* Converts the build-language-typed {@code buildLangValue} to a native value via {@link
* BuildType#selectableConvert}. Canonicalizes the value's order if it is a {@link List} type
* (but not a {@link GlobList}) and {@code attr.isOrderIndependent()} returns {@code true}.
*
* <p>Throws {@link ConversionException} if the conversion fails, or if {@code buildLangValue} | static void function( Rule rule, EventHandler eventHandler, Attribute attr, Object nativeAttrVal, boolean explicit) { if (attr.getName().equals(STR)) { @SuppressWarnings(STR) List<Label> attrList = (List<Label>) nativeAttrVal; if (!attrList.isEmpty() && ConstantRuleVisibility.LEGACY_PUBLIC_LABEL.equals(attrList.get(0))) { rule.reportError( rule.getLabel() + STR " + e.getMessage(), eventHandler); } } rule.setAttributeValue(attr, nativeAttrVal, explicit); checkAllowedValues(rule, attr, eventHandler); } /** * Converts the build-language-typed {@code buildLangValue} to a native value via { * BuildType#selectableConvert}. Canonicalizes the value's order if it is a {@link List} type * (but not a {@link GlobList}) and {@code attr.isOrderIndependent()} returns {@code true}. * * <p>Throws {@link ConversionException} if the conversion fails, or if {@code buildLangValue} | /**
* Sets the value of attribute {@code attr} in {@code rule} to the native value {@code
* nativeAttrVal}, and sets the value's explicitness to {@code explicit}.
*
* <p>Handles the special case of the "visibility" attribute by also setting the rule's
* visibility with {@link Rule#setVisibility}.
*
* <p>Checks that {@code nativeAttrVal} is an allowed value via {@link #checkAllowedValues}.
*/ | Sets the value of attribute attr in rule to the native value nativeAttrVal, and sets the value's explicitness to explicit. Handles the special case of the "visibility" attribute by also setting the rule's visibility with <code>Rule#setVisibility</code>. Checks that nativeAttrVal is an allowed value via <code>#checkAllowedValues</code> | setRuleAttributeValue | {
"repo_name": "spxtr/bazel",
"path": "src/main/java/com/google/devtools/build/lib/packages/RuleClass.java",
"license": "apache-2.0",
"size": 81739
} | [
"com.google.devtools.build.lib.cmdline.Label",
"com.google.devtools.build.lib.events.EventHandler",
"com.google.devtools.build.lib.syntax.GlobList",
"com.google.devtools.build.lib.syntax.Type",
"java.util.List"
] | import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.syntax.GlobList; import com.google.devtools.build.lib.syntax.Type; import java.util.List; | import com.google.devtools.build.lib.cmdline.*; import com.google.devtools.build.lib.events.*; import com.google.devtools.build.lib.syntax.*; import java.util.*; | [
"com.google.devtools",
"java.util"
] | com.google.devtools; java.util; | 1,040,224 |
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
// Check that the function was passed exactly two arguments
if (argumentCount() != 2) {
ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR,
getName(), this);
throw new TypeCheckError(err);
}
// The first argument must be a String, or cast to a String
_base = argument(0);
Type baseType = _base.typeCheck(stable);
if (baseType != Type.String)
_base = new CastExpr(_base, Type.String);
// The second argument must also be a String, or cast to a String
_token = argument(1);
Type tokenType = _token.typeCheck(stable);
if (tokenType != Type.String)
_token = new CastExpr(_token, Type.String);
return _type = Type.Boolean;
} | Type function(SymbolTable stable) throws TypeCheckError { if (argumentCount() != 2) { ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this); throw new TypeCheckError(err); } _base = argument(0); Type baseType = _base.typeCheck(stable); if (baseType != Type.String) _base = new CastExpr(_base, Type.String); _token = argument(1); Type tokenType = _token.typeCheck(stable); if (tokenType != Type.String) _token = new CastExpr(_token, Type.String); return _type = Type.Boolean; } | /**
* Type check the two parameters for this function
*/ | Type check the two parameters for this function | typeCheck | {
"repo_name": "itgeeker/jdk",
"path": "src/com/sun/org/apache/xalan/internal/xsltc/compiler/StartsWithCall.java",
"license": "apache-2.0",
"size": 3473
} | [
"com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg",
"com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type",
"com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError"
] | import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError; | import com.sun.org.apache.xalan.internal.xsltc.compiler.util.*; | [
"com.sun.org"
] | com.sun.org; | 1,855,923 |
void displayMessage(Message message); | void displayMessage(Message message); | /**
* Method to display a message to a user.
*
* @param message the message to display.
*/ | Method to display a message to a user | displayMessage | {
"repo_name": "maheshika/carbon4-kernel",
"path": "core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/synchronization/UserInputCallback.java",
"license": "apache-2.0",
"size": 1505
} | [
"org.wso2.carbon.registry.synchronization.message.Message"
] | import org.wso2.carbon.registry.synchronization.message.Message; | import org.wso2.carbon.registry.synchronization.message.*; | [
"org.wso2.carbon"
] | org.wso2.carbon; | 2,738,550 |
Future<OperationStatusResponse> beginUpdatingAsync(String serviceName, String deploymentName, String loadBalancerName, LoadBalancerUpdateParameters parameters); | Future<OperationStatusResponse> beginUpdatingAsync(String serviceName, String deploymentName, String loadBalancerName, LoadBalancerUpdateParameters parameters); | /**
* Updates an internal load balancer associated with an existing deployment.
*
* @param serviceName Required. The name of the service.
* @param deploymentName Required. The name of the deployment.
* @param loadBalancerName Required. The name of the loadBalancer.
* @param parameters Required. Parameters supplied to the Update Load
* Balancer operation.
* @return The response body contains the status of the specified
* asynchronous operation, indicating whether it has succeeded, is
* inprogress, or has failed. Note that this status is distinct from the
* HTTP status code returned for the Get Operation Status operation itself.
* If the asynchronous operation succeeded, the response body includes the
* HTTP status code for the successful request. If the asynchronous
* operation failed, the response body includes the HTTP status code for
* the failed request and error information regarding the failure.
*/ | Updates an internal load balancer associated with an existing deployment | beginUpdatingAsync | {
"repo_name": "southworkscom/azure-sdk-for-java",
"path": "service-management/azure-svc-mgmt-compute/src/main/java/com/microsoft/windowsazure/management/compute/LoadBalancerOperations.java",
"license": "apache-2.0",
"size": 19628
} | [
"com.microsoft.windowsazure.core.OperationStatusResponse",
"com.microsoft.windowsazure.management.compute.models.LoadBalancerUpdateParameters",
"java.util.concurrent.Future"
] | import com.microsoft.windowsazure.core.OperationStatusResponse; import com.microsoft.windowsazure.management.compute.models.LoadBalancerUpdateParameters; import java.util.concurrent.Future; | import com.microsoft.windowsazure.core.*; import com.microsoft.windowsazure.management.compute.models.*; import java.util.concurrent.*; | [
"com.microsoft.windowsazure",
"java.util"
] | com.microsoft.windowsazure; java.util; | 1,659,655 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.