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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
List<PublishingDashboardItem> getPublishingHistory(String siteId, String environment, String path, String publisher,
ZonedDateTime dateFrom, ZonedDateTime dateTo, String contentType,
long state, String sortBy, String order, int offset, int limit); | List<PublishingDashboardItem> getPublishingHistory(String siteId, String environment, String path, String publisher, ZonedDateTime dateFrom, ZonedDateTime dateTo, String contentType, long state, String sortBy, String order, int offset, int limit); | /**
* Get deployment history items for given search parameters
*
* @param siteId site identifier
* @param environment environment to get publishing history
* @param path regular expression to filter paths
* @param publisher filter publishing history for specified user
* @param dateFrom lower boundary for date range
* @param dateTo upper boundary for date range
* @param contentType publishing history for specified content type
* @param state filter items by their state
* @param sortBy sort publishing history
* @param order apply order to publishing history
* @param offset offset of the first item in the result set
* @param limit number of items to return
*
* @return total number of publishing packages
*/ | Get deployment history items for given search parameters | getPublishingHistory | {
"repo_name": "craftercms/studio",
"path": "src/main/java/org/craftercms/studio/api/v2/service/publish/PublishService.java",
"license": "gpl-3.0",
"size": 6017
} | [
"java.time.ZonedDateTime",
"java.util.List",
"org.craftercms.studio.model.rest.dashboard.PublishingDashboardItem"
] | import java.time.ZonedDateTime; import java.util.List; import org.craftercms.studio.model.rest.dashboard.PublishingDashboardItem; | import java.time.*; import java.util.*; import org.craftercms.studio.model.rest.dashboard.*; | [
"java.time",
"java.util",
"org.craftercms.studio"
] | java.time; java.util; org.craftercms.studio; | 2,416,991 |
public static void copyAssetFileToInternalStorage(Context context,
Context testContext, String assetPath) {
String filePath = getAssetFileInternalStorageLocation(context,
assetPath);
try {
copyAssetFile(testContext, assetPath, filePath);
} catch (IOException e) {
throw new GeoPackageException(
"Failed to copy asset file to internal storage: "
+ assetPath, e);
}
} | static void function(Context context, Context testContext, String assetPath) { String filePath = getAssetFileInternalStorageLocation(context, assetPath); try { copyAssetFile(testContext, assetPath, filePath); } catch (IOException e) { throw new GeoPackageException( STR + assetPath, e); } } | /**
* Copy the asset file to the internal memory storage
*
* @param context
* @param assetPath
*/ | Copy the asset file to the internal memory storage | copyAssetFileToInternalStorage | {
"repo_name": "boundlessgeo/geopackage-android",
"path": "geopackage-sdk/src/androidTest/java/mil/nga/geopackage/test/TestUtils.java",
"license": "mit",
"size": 16456
} | [
"android.content.Context",
"java.io.IOException",
"mil.nga.geopackage.GeoPackageException"
] | import android.content.Context; import java.io.IOException; import mil.nga.geopackage.GeoPackageException; | import android.content.*; import java.io.*; import mil.nga.geopackage.*; | [
"android.content",
"java.io",
"mil.nga.geopackage"
] | android.content; java.io; mil.nga.geopackage; | 2,842,268 |
protected Component getErrorComponent(IRequest componentRequest) throws ComponentInitializationException, ComponentNotFoundException {
try {
return this.componentManager.getComponent(configuration.getErrorComponentName());
} catch (ComponentNotFoundException e) {
return this.getMissingComponent(componentRequest);
}
} | Component function(IRequest componentRequest) throws ComponentInitializationException, ComponentNotFoundException { try { return this.componentManager.getComponent(configuration.getErrorComponentName()); } catch (ComponentNotFoundException e) { return this.getMissingComponent(componentRequest); } } | /**
* Get the id of the error component to use based on information in the component request
* and return the associated component
*
* Default method returns a constant value
*
* @param request - the httpRequest
* @param response - the httpResponse
* @throws ComponentLayoutInitializationException
* @throws ComponentLayoutNotFoundException
*/ | Get the id of the error component to use based on information in the component request and return the associated component Default method returns a constant value | getErrorComponent | {
"repo_name": "toobs/Toobs",
"path": "trunk/PresFramework/src/main/java/org/toobsframework/pres/component/controller/ComponentViewHandler.java",
"license": "apache-2.0",
"size": 8198
} | [
"org.toobsframework.pres.component.Component",
"org.toobsframework.pres.component.ComponentInitializationException",
"org.toobsframework.pres.component.ComponentNotFoundException",
"org.toobsframework.util.IRequest"
] | import org.toobsframework.pres.component.Component; import org.toobsframework.pres.component.ComponentInitializationException; import org.toobsframework.pres.component.ComponentNotFoundException; import org.toobsframework.util.IRequest; | import org.toobsframework.pres.component.*; import org.toobsframework.util.*; | [
"org.toobsframework.pres",
"org.toobsframework.util"
] | org.toobsframework.pres; org.toobsframework.util; | 1,250,209 |
public synchronized void printResults() throws Exception {
ClientStats stats = fullStatsContext.fetch().getStats();
// 1. Get/Put performance results
String display = "\n" +
HORIZONTAL_RULE +
" KV Store Results\n" +
HORIZONTAL_RULE +
"\nA total of %,d operations were posted...\n" +
" - GETs: %,9d Operations (%,d Misses and %,d Failures)\n" +
" %,9d Multi-partition Operations (%.2f%%)\n" +
" %,9d Single-partition Operations (%.2f%%)\n" +
" %,9d MB in compressed store data\n" +
" %,9d MB in uncompressed application data\n" +
" Network Throughput: %6.3f Gbps*\n" +
" - PUTs: %,9d Operations (%,d Failures)\n" +
" %,9d Multi-partition Operations (%.2f%%)\n" +
" %,9d Single-partition Operations (%.2f%%)\n" +
" %,9d MB in compressed store data\n" +
" %,9d MB in uncompressed application data\n" +
" Network Throughput: %6.3f Gbps*\n" +
" - Total Network Throughput: %6.3f Gbps*\n\n" +
"* Figure includes key & value traffic but not database protocol overhead.\n\n";
double oneGigabit = (1024 * 1024 * 1024) / 8;
long oneMB = (1024 * 1024);
double getThroughput = networkGetData.get() + (successfulGets.get() * config.keysize);
getThroughput /= (oneGigabit * config.duration);
long totalPuts = successfulPuts.get() + failedPuts.get();
double putThroughput = networkGetData.get() + (totalPuts * config.keysize);
putThroughput /= (oneGigabit * config.duration);
long gtt = successfulGetsMPT.get() + successfulGetsMPF.get();
long gst = successfulGetsMPT.get();
long gsf = successfulGetsMPF.get();
double getMptR = (double)(100.00*gst/gtt);
double getMpfR = (double)(100.00*gsf/gtt);
//System.out.printf("st = %d, sf = %d, tt = %d, getMptR = '%.2f%%', getMpfR = '%.2f%%',",
// gst, gsf, gtt, getMptR, getMpfR);
long ptt = successfulPutsMPT.get() + successfulPutsMPF.get();
long pst = successfulPutsMPT.get();
long psf = successfulPutsMPF.get();
double putMptR = (double)(100.00*pst/ptt);
double putMpfR = (double)(100.00*psf/ptt);
System.out.printf(display,
stats.getInvocationsCompleted(),
successfulGets.get(), missedGets.get(), failedGets.get(),
successfulGetsMPT.get(), getMptR, successfulGetsMPF.get(), getMpfR,
networkGetData.get() / oneMB,
rawGetData.get() / oneMB,
getThroughput,
successfulPuts.get(), failedPuts.get(),
successfulPutsMPT.get(), putMptR, successfulPutsMPF.get(), putMpfR,
networkPutData.get() / oneMB,
rawPutData.get() / oneMB,
putThroughput,
getThroughput + putThroughput);
// 2. Performance statistics
System.out.print(HORIZONTAL_RULE);
System.out.println(" Client Workload Statistics");
System.out.println(HORIZONTAL_RULE);
System.out.printf("Average throughput: %,9d txns/sec\n", stats.getTxnThroughput());
System.out.printf("Average latency: %,9.2f ms\n", stats.getAverageLatency());
System.out.printf("95th percentile latency: %,9.2f ms\n", stats.kPercentileLatencyAsDouble(.95));
System.out.printf("99th percentile latency: %,9.2f ms\n", stats.kPercentileLatencyAsDouble(.99));
System.out.print("\n" + HORIZONTAL_RULE);
System.out.println(" System Server Statistics");
System.out.println(HORIZONTAL_RULE);
if (config.autotune) {
System.out.printf("Targeted Internal Avg Latency: %,9d ms\n", config.latencytarget);
}
System.out.printf("Reported Internal Avg Latency: %,9.2f ms\n", stats.getAverageInternalLatency());
// 3. Write stats to file if requested
client.writeSummaryCSV(stats, config.statsfile);
}
class GetCallback implements ProcedureCallback {
double rand;
GetCallback(double rand) {
this.rand = rand;
} | synchronized void function() throws Exception { ClientStats stats = fullStatsContext.fetch().getStats(); String display = "\n" + HORIZONTAL_RULE + STR + HORIZONTAL_RULE + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR; double oneGigabit = (1024 * 1024 * 1024) / 8; long oneMB = (1024 * 1024); double getThroughput = networkGetData.get() + (successfulGets.get() * config.keysize); getThroughput /= (oneGigabit * config.duration); long totalPuts = successfulPuts.get() + failedPuts.get(); double putThroughput = networkGetData.get() + (totalPuts * config.keysize); putThroughput /= (oneGigabit * config.duration); long gtt = successfulGetsMPT.get() + successfulGetsMPF.get(); long gst = successfulGetsMPT.get(); long gsf = successfulGetsMPF.get(); double getMptR = (double)(100.00*gst/gtt); double getMpfR = (double)(100.00*gsf/gtt); long ptt = successfulPutsMPT.get() + successfulPutsMPF.get(); long pst = successfulPutsMPT.get(); long psf = successfulPutsMPF.get(); double putMptR = (double)(100.00*pst/ptt); double putMpfR = (double)(100.00*psf/ptt); System.out.printf(display, stats.getInvocationsCompleted(), successfulGets.get(), missedGets.get(), failedGets.get(), successfulGetsMPT.get(), getMptR, successfulGetsMPF.get(), getMpfR, networkGetData.get() / oneMB, rawGetData.get() / oneMB, getThroughput, successfulPuts.get(), failedPuts.get(), successfulPutsMPT.get(), putMptR, successfulPutsMPF.get(), putMpfR, networkPutData.get() / oneMB, rawPutData.get() / oneMB, putThroughput, getThroughput + putThroughput); System.out.print(HORIZONTAL_RULE); System.out.println(STR); System.out.println(HORIZONTAL_RULE); System.out.printf(STR, stats.getTxnThroughput()); System.out.printf(STR, stats.getAverageLatency()); System.out.printf(STR, stats.kPercentileLatencyAsDouble(.95)); System.out.printf(STR, stats.kPercentileLatencyAsDouble(.99)); System.out.print("\n" + HORIZONTAL_RULE); System.out.println(STR); System.out.println(HORIZONTAL_RULE); if (config.autotune) { System.out.printf(STR, config.latencytarget); } System.out.printf(STR, stats.getAverageInternalLatency()); client.writeSummaryCSV(stats, config.statsfile); } class GetCallback implements ProcedureCallback { double rand; GetCallback(double rand) { this.rand = rand; } | /**
* Prints the results of the voting simulation and statistics
* about performance.
*
* @throws Exception if anything unexpected happens.
*/ | Prints the results of the voting simulation and statistics about performance | printResults | {
"repo_name": "paulmartel/voltdb",
"path": "tests/test_apps/voltkvqa/src/voltkvqa/AsyncBenchmark.java",
"license": "agpl-3.0",
"size": 45489
} | [
"org.voltdb.client.ClientStats",
"org.voltdb.client.ProcedureCallback"
] | import org.voltdb.client.ClientStats; import org.voltdb.client.ProcedureCallback; | import org.voltdb.client.*; | [
"org.voltdb.client"
] | org.voltdb.client; | 935,648 |
public static <T> TagReadProtocol<T> readTagName(Function1<QName,T> f) {
return new TagReadProtocol<>(Option.none(), Vector.empty(), args -> f.apply((QName) args.get(0)));
} | static <T> TagReadProtocol<T> function(Function1<QName,T> f) { return new TagReadProtocol<>(Option.none(), Vector.empty(), args -> f.apply((QName) args.get(0))); } | /**
* Reads a tag with any name, creating its result using [f].
*/ | Reads a tag with any name, creating its result using [f] | readTagName | {
"repo_name": "Tradeshift/ts-reaktive",
"path": "ts-reaktive-marshal/src/main/java/com/tradeshift/reaktive/xml/XMLProtocol.java",
"license": "mit",
"size": 22485
} | [
"io.vavr.Function1",
"io.vavr.collection.Vector",
"io.vavr.control.Option",
"javax.xml.namespace.QName"
] | import io.vavr.Function1; import io.vavr.collection.Vector; import io.vavr.control.Option; import javax.xml.namespace.QName; | import io.vavr.*; import io.vavr.collection.*; import io.vavr.control.*; import javax.xml.namespace.*; | [
"io.vavr",
"io.vavr.collection",
"io.vavr.control",
"javax.xml"
] | io.vavr; io.vavr.collection; io.vavr.control; javax.xml; | 785,604 |
/////////////////////////////////////////////////////////////
// graphics plotting related
////////////////////////////////////////////////////////////
public final java.awt.FontMetrics getFontMetrics(final java.awt.Font theFont)
{
java.awt.FontMetrics res = null;
if (_theDest != null)
{
if (theFont != null)
res = _theDest.getFontMetrics(theFont);
else
res = _theDest.getFontMetrics();
}
return res;
}
| final java.awt.FontMetrics function(final java.awt.Font theFont) { java.awt.FontMetrics res = null; if (_theDest != null) { if (theFont != null) res = _theDest.getFontMetrics(theFont); else res = _theDest.getFontMetrics(); } return res; } | /**
* find out the current metrics.
*
* @param theFont the font to try
* @return the metrics object
*/ | find out the current metrics | getFontMetrics | {
"repo_name": "theanuradha/debrief",
"path": "org.mwc.cmap.legacy/src/MWC/GUI/Canvas/Swing/SwingCanvas.java",
"license": "epl-1.0",
"size": 34120
} | [
"java.awt.Font"
] | import java.awt.Font; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,921,876 |
public static Camera<ImageCameraWrapper, VideoCameraWrapper> camera(Activity activity) {
return new AlbumCamera(activity);
} | static Camera<ImageCameraWrapper, VideoCameraWrapper> function(Activity activity) { return new AlbumCamera(activity); } | /**
* Open the camera from the activity.
*/ | Open the camera from the activity | camera | {
"repo_name": "yanzhenjie/Album",
"path": "album/src/main/java/com/yanzhenjie/album/Album.java",
"license": "apache-2.0",
"size": 9384
} | [
"android.app.Activity",
"com.yanzhenjie.album.api.ImageCameraWrapper",
"com.yanzhenjie.album.api.VideoCameraWrapper",
"com.yanzhenjie.album.api.camera.AlbumCamera",
"com.yanzhenjie.album.api.camera.Camera"
] | import android.app.Activity; import com.yanzhenjie.album.api.ImageCameraWrapper; import com.yanzhenjie.album.api.VideoCameraWrapper; import com.yanzhenjie.album.api.camera.AlbumCamera; import com.yanzhenjie.album.api.camera.Camera; | import android.app.*; import com.yanzhenjie.album.api.*; import com.yanzhenjie.album.api.camera.*; | [
"android.app",
"com.yanzhenjie.album"
] | android.app; com.yanzhenjie.album; | 576,473 |
public QName getType(NodeRef nodeRef) throws InvalidNodeRefException
{
// frozen node type -> replaced by actual node type of the version node
return (QName)this.dbNodeService.getType(VersionUtil.convertNodeRef(nodeRef));
}
| QName function(NodeRef nodeRef) throws InvalidNodeRefException { return (QName)this.dbNodeService.getType(VersionUtil.convertNodeRef(nodeRef)); } | /**
* Type translation for version store
*/ | Type translation for version store | getType | {
"repo_name": "Alfresco/alfresco-repository",
"path": "src/main/java/org/alfresco/repo/version/Node2ServiceImpl.java",
"license": "lgpl-3.0",
"size": 10705
} | [
"org.alfresco.repo.version.common.VersionUtil",
"org.alfresco.service.cmr.repository.InvalidNodeRefException",
"org.alfresco.service.cmr.repository.NodeRef",
"org.alfresco.service.namespace.QName"
] | import org.alfresco.repo.version.common.VersionUtil; import org.alfresco.service.cmr.repository.InvalidNodeRefException; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; | import org.alfresco.repo.version.common.*; import org.alfresco.service.cmr.repository.*; import org.alfresco.service.namespace.*; | [
"org.alfresco.repo",
"org.alfresco.service"
] | org.alfresco.repo; org.alfresco.service; | 894,637 |
Collection<ProjectResponse> getProjects(String repositoryName); | Collection<ProjectResponse> getProjects(String repositoryName); | /**
* [GET] /repositories/{repositoryName}/projects/
*/ | [GET] /repositories/{repositoryName}/projects | getProjects | {
"repo_name": "psiroky/kie-wb-distributions",
"path": "kie-wb-tests/kie-wb-tests-rest/src/main/java/org/kie/wb/test/rest/client/WorkbenchClient.java",
"license": "apache-2.0",
"size": 4976
} | [
"java.util.Collection",
"org.guvnor.rest.client.ProjectResponse"
] | import java.util.Collection; import org.guvnor.rest.client.ProjectResponse; | import java.util.*; import org.guvnor.rest.client.*; | [
"java.util",
"org.guvnor.rest"
] | java.util; org.guvnor.rest; | 2,316,001 |
private void showPersonDetails(Person person) {
if (person != null) {
// Fill the labels with info from the person object.
firstNameLabel.setText(person.getFirstName());
lastNameLabel.setText(person.getLastName());
streetLabel.setText(person.getStreet());
postalCodeLabel.setText(Integer.toString(person.getPostalCode()));
cityLabel.setText(person.getCity());
birthdayLabel.setText(DateUtil.format(person.getBirthday()));
} else {
// Person is null, remove all the text.
firstNameLabel.setText("");
lastNameLabel.setText("");
streetLabel.setText("");
postalCodeLabel.setText("");
cityLabel.setText("");
birthdayLabel.setText("");
}
}
| void function(Person person) { if (person != null) { firstNameLabel.setText(person.getFirstName()); lastNameLabel.setText(person.getLastName()); streetLabel.setText(person.getStreet()); postalCodeLabel.setText(Integer.toString(person.getPostalCode())); cityLabel.setText(person.getCity()); birthdayLabel.setText(DateUtil.format(person.getBirthday())); } else { firstNameLabel.setText(STRSTRSTRSTRSTR"); } } | /**
* Fills all text fields to show details about the person.
* If the specified person is null, all text fields are cleared.
*
* @param person the person or null
*/ | Fills all text fields to show details about the person. If the specified person is null, all text fields are cleared | showPersonDetails | {
"repo_name": "ObZenTish/INFORMATICA_4IC",
"path": "Project NetBeans/JavaFX/Rubrica/src/ch/makery/address/view/PersonOverviewController.java",
"license": "gpl-3.0",
"size": 5284
} | [
"ch.makery.address.model.Person",
"ch.makery.address.util.DateUtil"
] | import ch.makery.address.model.Person; import ch.makery.address.util.DateUtil; | import ch.makery.address.model.*; import ch.makery.address.util.*; | [
"ch.makery.address"
] | ch.makery.address; | 1,211,524 |
public void testExpiration() throws Exception {
IgniteCache<Integer, Integer> cache = jcache(Integer.class, Integer.class);
cache.withExpiryPolicy(new TouchedExpiryPolicy(new Duration(MILLISECONDS, 1000))).put(7, 1);
List<Cache.Entry<Integer, Integer>> qry =
cache.query(new SqlQuery<Integer, Integer>(Integer.class, "1=1")).getAll();
Cache.Entry<Integer, Integer> res = F.first(qry);
assertEquals(1, res.getValue().intValue());
U.sleep(800); // Less than minimal amount of time that must pass before a cache entry is considered expired.
qry = cache.query(new SqlQuery<Integer, Integer>(Integer.class, "1=1")).getAll();
res = F.first(qry);
assertEquals(1, res.getValue().intValue());
U.sleep(1200); // No expiry guarantee here. Test should be refactored in case of fails.
qry = cache.query(new SqlQuery<Integer, Integer>(Integer.class, "1=1")).getAll();
res = F.first(qry);
assertNull(res);
} | void function() throws Exception { IgniteCache<Integer, Integer> cache = jcache(Integer.class, Integer.class); cache.withExpiryPolicy(new TouchedExpiryPolicy(new Duration(MILLISECONDS, 1000))).put(7, 1); List<Cache.Entry<Integer, Integer>> qry = cache.query(new SqlQuery<Integer, Integer>(Integer.class, "1=1")).getAll(); Cache.Entry<Integer, Integer> res = F.first(qry); assertEquals(1, res.getValue().intValue()); U.sleep(800); qry = cache.query(new SqlQuery<Integer, Integer>(Integer.class, "1=1")).getAll(); res = F.first(qry); assertEquals(1, res.getValue().intValue()); U.sleep(1200); qry = cache.query(new SqlQuery<Integer, Integer>(Integer.class, "1=1")).getAll(); res = F.first(qry); assertNull(res); } | /**
* Expired entries are not included to result.
*
* @throws Exception If failed.
*/ | Expired entries are not included to result | testExpiration | {
"repo_name": "WilliamDo/ignite",
"path": "modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java",
"license": "apache-2.0",
"size": 71006
} | [
"java.util.List",
"javax.cache.Cache",
"javax.cache.expiry.Duration",
"javax.cache.expiry.TouchedExpiryPolicy",
"org.apache.ignite.IgniteCache",
"org.apache.ignite.cache.query.SqlQuery",
"org.apache.ignite.internal.util.typedef.F",
"org.apache.ignite.internal.util.typedef.internal.U"
] | import java.util.List; import javax.cache.Cache; import javax.cache.expiry.Duration; import javax.cache.expiry.TouchedExpiryPolicy; import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.query.SqlQuery; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.internal.util.typedef.internal.U; | import java.util.*; import javax.cache.*; import javax.cache.expiry.*; import org.apache.ignite.*; import org.apache.ignite.cache.query.*; import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.internal.*; | [
"java.util",
"javax.cache",
"org.apache.ignite"
] | java.util; javax.cache; org.apache.ignite; | 2,888,677 |
@Test
public void lsReportMessageTest11() throws PcepParseException, PcepOutOfBoundMessageException {
byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x60, // common header
(byte) 0xE0, 0x10, 0x00, 0x5C, // LS Object Header
0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, // LS-ID
(byte) 0xFF, 0x01, 0x00, 0x08, // Routing Universe TLV
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01,
(byte) 0xFF, 0x02, 0x00, 0x24, // Local Node Descriptors TLV
0x00, 0x01, 0x00, 0x04, //AutonomousSystemSubTlv
0x00, 0x00, 0x00, 0x11,
0x00, 0x02, 0x00, 0x04, //BGPLSidentifierSubTlv
0x00, 0x00, 0x00, 0x11,
0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
0x00, 0x00, 0x00, 0x11,
0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
0x00, 0x00, 0x00, 0x11,
0x00, 0x00, 0x00, 0x11,
(byte) 0xFF, 0x03, 0x00, 0x14, //RemoteNodeDescriptorsTLV
0x00, 0x03, 0x00, 0x04, //OSPFareaIDsubTlv
0x00, 0x00, 0x00, 0x11,
0x00, 0x04, 0x00, 0x08, //IgpRouterIdSubTlv
0x00, 0x00, 0x00, 0x11,
0x00, 0x00, 0x00, 0x11
};
ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
buffer.writeBytes(lsReportMsg);
PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader();
PcepMessage message = null;
message = reader.readFrom(buffer);
byte[] testReportMsg = {0};
assertThat(message, instanceOf(PcepLSReportMsg.class));
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
message.writeTo(buf);
int readLen = buf.writerIndex();
testReportMsg = new byte[readLen];
buf.readBytes(testReportMsg, 0, readLen);
assertThat(testReportMsg, is(lsReportMsg));
} | void function() throws PcepParseException, PcepOutOfBoundMessageException { byte[] lsReportMsg = new byte[]{0x20, (byte) 0xE0, 0x00, 0x60, (byte) 0xE0, 0x10, 0x00, 0x5C, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, (byte) 0xFF, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, (byte) 0xFF, 0x02, 0x00, 0x24, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x11, (byte) 0xFF, 0x03, 0x00, 0x14, 0x00, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x11 }; ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); buffer.writeBytes(lsReportMsg); PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); PcepMessage message = null; message = reader.readFrom(buffer); byte[] testReportMsg = {0}; assertThat(message, instanceOf(PcepLSReportMsg.class)); ChannelBuffer buf = ChannelBuffers.dynamicBuffer(); message.writeTo(buf); int readLen = buf.writerIndex(); testReportMsg = new byte[readLen]; buf.readBytes(testReportMsg, 0, readLen); assertThat(testReportMsg, is(lsReportMsg)); } | /**
* This test case checks for
* LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv
* OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(OSPFareaIDsubTlv, IgpRouterIdSubTlv))
* in PcLSRpt message.
*/ | This test case checks for LS Object (Routing Universe TLV,Local Node Descriptors TLV(AutonomousSystemSubTlv, BGPLSidentifierSubTlv OSPFareaIDsubTlv, IgpRouterIdSubTlv), RemoteNodeDescriptorsTLV(OSPFareaIDsubTlv, IgpRouterIdSubTlv)) in PcLSRpt message | lsReportMessageTest11 | {
"repo_name": "donNewtonAlpha/onos",
"path": "protocols/pcep/pcepio/src/test/java/org/onosproject/pcepio/protocol/PcepLSReportMsgTest.java",
"license": "apache-2.0",
"size": 73490
} | [
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers",
"org.hamcrest.core.Is",
"org.jboss.netty.buffer.ChannelBuffer",
"org.jboss.netty.buffer.ChannelBuffers",
"org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException",
"org.onosproject.pcepio.exceptions.PcepParseException"
] | import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.hamcrest.core.Is; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException; import org.onosproject.pcepio.exceptions.PcepParseException; | import org.hamcrest.*; import org.hamcrest.core.*; import org.jboss.netty.buffer.*; import org.onosproject.pcepio.exceptions.*; | [
"org.hamcrest",
"org.hamcrest.core",
"org.jboss.netty",
"org.onosproject.pcepio"
] | org.hamcrest; org.hamcrest.core; org.jboss.netty; org.onosproject.pcepio; | 1,653,745 |
public void warn(Object message, Throwable exception) {
log(Level.WARNING, String.valueOf(message), exception);
} | void function(Object message, Throwable exception) { log(Level.WARNING, String.valueOf(message), exception); } | /**
* Logs a message with <code>java.util.logging.Level.WARNING</code>.
*
* @param message to log
* @param exception log this cause
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
*/ | Logs a message with <code>java.util.logging.Level.WARNING</code> | warn | {
"repo_name": "mohanaraosv/commons-logging",
"path": "src/main/java/org/apache/commons/logging/impl/Jdk14Logger.java",
"license": "apache-2.0",
"size": 8427
} | [
"java.util.logging.Level"
] | import java.util.logging.Level; | import java.util.logging.*; | [
"java.util"
] | java.util; | 1,245,524 |
public void addRebellionTile(final int coordX,
final int coordY) {
final String filename = DIR_EVENTS + "rebellion.png";
sectorTiles.add(new CoordinateDTO(coordX, coordY, filename, LAYER_REBELLION));
} | void function(final int coordX, final int coordY) { final String filename = DIR_EVENTS + STR; sectorTiles.add(new CoordinateDTO(coordX, coordY, filename, LAYER_REBELLION)); } | /**
* Select the tile for the rebellion.
*
* @param coordX the X coordinate.
* @param coordY the Y coordinate.
*/ | Select the tile for the rebellion | addRebellionTile | {
"repo_name": "EaW1805/engine",
"path": "src/main/java/com/eaw1805/map/TilesSelector.java",
"license": "mit",
"size": 50964
} | [
"com.eaw1805.data.dto.common.CoordinateDTO"
] | import com.eaw1805.data.dto.common.CoordinateDTO; | import com.eaw1805.data.dto.common.*; | [
"com.eaw1805.data"
] | com.eaw1805.data; | 1,506,777 |
@ServiceMethod(returns = ReturnType.SINGLE)
public void start(String resourceGroupName, String networkWatcherName, String connectionMonitorName) {
startAsync(resourceGroupName, networkWatcherName, connectionMonitorName).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) void function(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { startAsync(resourceGroupName, networkWatcherName, connectionMonitorName).block(); } | /**
* Starts the specified connection monitor.
*
* @param resourceGroupName The name of the resource group containing Network Watcher.
* @param networkWatcherName The name of the Network Watcher resource.
* @param connectionMonitorName The name of the connection monitor.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/ | Starts the specified connection monitor | start | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ConnectionMonitorsClientImpl.java",
"license": "mit",
"size": 107051
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; | import com.azure.core.annotation.*; | [
"com.azure.core"
] | com.azure.core; | 328,804 |
protected final NLTMAuthenticator getNTLMAuthenticator()
{
if (!(this.authenticationComponent instanceof NLTMAuthenticator))
{
throw new IllegalStateException("Attempt to use non SSO-enabled authentication component for SSO");
}
return (NLTMAuthenticator)this.authenticationComponent;
}
| final NLTMAuthenticator function() { if (!(this.authenticationComponent instanceof NLTMAuthenticator)) { throw new IllegalStateException(STR); } return (NLTMAuthenticator)this.authenticationComponent; } | /**
* Returns an SSO-enabled authentication component.
*
* @return NLTMAuthenticator
*/ | Returns an SSO-enabled authentication component | getNTLMAuthenticator | {
"repo_name": "Alfresco/community-edition",
"path": "projects/repository/source/java/org/alfresco/filesys/auth/cifs/CifsAuthenticatorBase.java",
"license": "lgpl-3.0",
"size": 22690
} | [
"org.alfresco.repo.security.authentication.ntlm.NLTMAuthenticator"
] | import org.alfresco.repo.security.authentication.ntlm.NLTMAuthenticator; | import org.alfresco.repo.security.authentication.ntlm.*; | [
"org.alfresco.repo"
] | org.alfresco.repo; | 1,891,350 |
private int hash(Object k) {
int h = hashSeed;
if ((0 != h) && (k instanceof String)) {
return Hashing7.stringHash32((String) k);
}
h ^= k.hashCode();
// Spread bits to regularize both segment and index locations,
// using variant of single-word Wang/Jenkins hash.
h += (h << 15) ^ 0xffffcd7d;
h ^= (h >>> 10);
h += (h << 3);
h ^= (h >>> 6);
h += (h << 2) + (h << 14);
return h ^ (h >>> 16);
}
static final class Segment<K, V> extends ReentrantLock implements Serializable {
private static final long serialVersionUID = 2249069246763182397L;
static final int MAX_SCAN_RETRIES =
Runtime.getRuntime().availableProcessors() > 1 ? 64 : 1;
transient volatile HashEntry<K, V>[] table;
transient int count;
transient int modCount;
transient int threshold;
final float loadFactor;
Segment(float lf, int threshold, HashEntry<K, V>[] tab) {
this.loadFactor = lf;
this.threshold = threshold;
this.table = tab;
} | int function(Object k) { int h = hashSeed; if ((0 != h) && (k instanceof String)) { return Hashing7.stringHash32((String) k); } h ^= k.hashCode(); h += (h << 15) ^ 0xffffcd7d; h ^= (h >>> 10); h += (h << 3); h ^= (h >>> 6); h += (h << 2) + (h << 14); return h ^ (h >>> 16); } static final class Segment<K, V> extends ReentrantLock implements Serializable { private static final long serialVersionUID = 2249069246763182397L; static final int MAX_SCAN_RETRIES = Runtime.getRuntime().availableProcessors() > 1 ? 64 : 1; transient volatile HashEntry<K, V>[] table; transient int count; transient int modCount; transient int threshold; final float loadFactor; Segment(float lf, int threshold, HashEntry<K, V>[] tab) { this.loadFactor = lf; this.threshold = threshold; this.table = tab; } | /**
* Applies a supplemental hash function to a given hashCode, which
* defends against poor quality hash functions. This is critical
* because ConcurrentHashMap uses power-of-two length hash tables,
* that otherwise encounter collisions for hashCodes that do not
* differ in lower or upper bits.
*/ | Applies a supplemental hash function to a given hashCode, which defends against poor quality hash functions. This is critical because ConcurrentHashMap uses power-of-two length hash tables, that otherwise encounter collisions for hashCodes that do not differ in lower or upper bits | hash | {
"repo_name": "NorthFacing/step-by-Java",
"path": "java-base/src/main/java/com/bob/jdk/java/util/concurrent/MyConcurrentHashMap7.java",
"license": "gpl-2.0",
"size": 51981
} | [
"com.bob.jdk.sun.misc.Hashing7",
"java.io.Serializable",
"java.util.concurrent.locks.ReentrantLock"
] | import com.bob.jdk.sun.misc.Hashing7; import java.io.Serializable; import java.util.concurrent.locks.ReentrantLock; | import com.bob.jdk.sun.misc.*; import java.io.*; import java.util.concurrent.locks.*; | [
"com.bob.jdk",
"java.io",
"java.util"
] | com.bob.jdk; java.io; java.util; | 1,338,929 |
public Observable<ServiceResponse<ExpressRoutePortInner>> beginUpdateTagsWithServiceResponseAsync(String resourceGroupName, String expressRoutePortName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (expressRoutePortName == null) {
throw new IllegalArgumentException("Parameter expressRoutePortName is required and cannot be null.");
} | Observable<ServiceResponse<ExpressRoutePortInner>> function(String resourceGroupName, String expressRoutePortName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (expressRoutePortName == null) { throw new IllegalArgumentException(STR); } | /**
* Update ExpressRoutePort tags.
*
* @param resourceGroupName The name of the resource group.
* @param expressRoutePortName The name of the ExpressRoutePort resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ExpressRoutePortInner object
*/ | Update ExpressRoutePort tags | beginUpdateTagsWithServiceResponseAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/ExpressRoutePortsInner.java",
"license": "mit",
"size": 74971
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 2,267,010 |
protected boolean scaleBufferedImage(SunGraphics2D sg, BufferedImage bImg,
Color bgColor,
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
int xOrig, int yOrig,
int xNew, int yNew,
int width, int height) {
AffineTransform atfm = null;
if ((dx2-dx1 != sx2-sx1) || (dy2-dy1 != sy2-sy1)) {
// Append the new transform
atfm = new AffineTransform();
atfm.translate( dx1, dy1);
double m00 = (double)(dx2-dx1)/(sx2-sx1);
double m11 = (double)(dy2-dy1)/(sy2-sy1);
atfm.scale(m00, m11);
atfm.translate(xOrig-sx1, yOrig-sy1);
xNew = yNew = 0;
}
if (xOrig >= 0 && yOrig >=0) {
int bw = bImg.getWidth();
int bh = bImg.getHeight();
// Make sure we are not out of bounds
if (xOrig + width > bw) {
width = bw - xOrig;
}
if (yOrig + height > bh) {
height = bh - yOrig;
}
// The actual semantics of this method is to draw the image
// up to, but not including the width and height. We need
// to include the width and height in the source image so
// that the interpolation will have enough data to fill in
// the last pixel(s). We subtract the last point in the
// bounding box rectangle in renderingPipeImage.
bImg = bImg.getSubimage(xOrig+bImg.getMinX(),
yOrig+bImg.getMinY(), width, height);
}
transformImage(sg, bImg, xNew, yNew, null, atfm, bgColor);
return true;
} | boolean function(SunGraphics2D sg, BufferedImage bImg, Color bgColor, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, int xOrig, int yOrig, int xNew, int yNew, int width, int height) { AffineTransform atfm = null; if ((dx2-dx1 != sx2-sx1) (dy2-dy1 != sy2-sy1)) { atfm = new AffineTransform(); atfm.translate( dx1, dy1); double m00 = (double)(dx2-dx1)/(sx2-sx1); double m11 = (double)(dy2-dy1)/(sy2-sy1); atfm.scale(m00, m11); atfm.translate(xOrig-sx1, yOrig-sy1); xNew = yNew = 0; } if (xOrig >= 0 && yOrig >=0) { int bw = bImg.getWidth(); int bh = bImg.getHeight(); if (xOrig + width > bw) { width = bw - xOrig; } if (yOrig + height > bh) { height = bh - yOrig; } bImg = bImg.getSubimage(xOrig+bImg.getMinX(), yOrig+bImg.getMinY(), width, height); } transformImage(sg, bImg, xNew, yNew, null, atfm, bgColor); return true; } | /**
* Draws a subrectangle of an image scaled to a destination rectangle in
* nonblocking mode with a solid background color and a callback object.
*/ | Draws a subrectangle of an image scaled to a destination rectangle in nonblocking mode with a solid background color and a callback object | scaleBufferedImage | {
"repo_name": "ivmai/JCGO",
"path": "sunawt/fix/sun/java2d/pipe/DrawImage.java",
"license": "gpl-2.0",
"size": 34437
} | [
"java.awt.Color",
"java.awt.geom.AffineTransform",
"java.awt.image.BufferedImage"
] | import java.awt.Color; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; | import java.awt.*; import java.awt.geom.*; import java.awt.image.*; | [
"java.awt"
] | java.awt; | 1,098,079 |
private void writeObject(java.io.ObjectOutputStream stream) throws IOException {
if (stubDelegate == null) {
setDefaultDelegate();
}
if (stubDelegate != null) {
stubDelegate.writeObject(this, stream);
}
} | void function(java.io.ObjectOutputStream stream) throws IOException { if (stubDelegate == null) { setDefaultDelegate(); } if (stubDelegate != null) { stubDelegate.writeObject(this, stream); } } | /**
* Serialization method to save the IOR state.
* @serialData The length of the IOR type ID (int), followed by the IOR type ID
* (byte array encoded using ISO8859-1), followed by the number of IOR profiles
* (int), followed by the IOR profiles. Each IOR profile is written as a
* profile tag (int), followed by the length of the profile data (int), followed
* by the profile data (byte array).
*/ | Serialization method to save the IOR state | writeObject | {
"repo_name": "TheTypoMaster/Scaper",
"path": "openjdk/corba/src/share/classes/javax/rmi/CORBA/Stub.java",
"license": "gpl-2.0",
"size": 8820
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,481,476 |
public BigDecimal getTotalLines ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_TotalLines);
if (bd == null)
return Env.ZERO;
return bd;
} | BigDecimal function () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_TotalLines); if (bd == null) return Env.ZERO; return bd; } | /** Get Total Lines.
@return Total of all document lines
*/ | Get Total Lines | getTotalLines | {
"repo_name": "geneos/adempiere",
"path": "base/src/org/compiere/model/X_C_Invoice.java",
"license": "gpl-2.0",
"size": 39900
} | [
"java.math.BigDecimal",
"org.compiere.util.Env"
] | import java.math.BigDecimal; import org.compiere.util.Env; | import java.math.*; import org.compiere.util.*; | [
"java.math",
"org.compiere.util"
] | java.math; org.compiere.util; | 2,114,342 |
ArrayList<Vector3D> convexHull = new ArrayList<Vector3D>();
if (Vector3Ds.size() < 3) return (ArrayList<Vector3D>) Vector3Ds.clone();
// find extremals
int minVector3D = -1, maxVector3D = -1;
float minX = Float.POSITIVE_INFINITY;
float maxX = Float.NEGATIVE_INFINITY;
for (int i = 0; i < Vector3Ds.size(); i++) {
if (Vector3Ds.get(i).getX() < minX) {
minX = Vector3Ds.get(i).getX();
minVector3D = i;
}
if (Vector3Ds.get(i).getX() > maxX) {
maxX = Vector3Ds.get(i).getX();
maxVector3D = i;
}
}
Vector3D A = Vector3Ds.get(minVector3D);
Vector3D B = Vector3Ds.get(maxVector3D);
convexHull.add(A);
convexHull.add(B);
Vector3Ds.remove(A);
Vector3Ds.remove(B);
ArrayList<Vector3D> leftSet = new ArrayList<Vector3D>();
ArrayList<Vector3D> rightSet = new ArrayList<Vector3D>();
for (Vector3D p : Vector3Ds) {
if (Vector3DLocation(A, B, p) == -1)
leftSet.add(p);
else
rightSet.add(p);
}
hullSet(A,B,rightSet,convexHull);
hullSet(B,A,leftSet,convexHull);
return convexHull;
} | ArrayList<Vector3D> convexHull = new ArrayList<Vector3D>(); if (Vector3Ds.size() < 3) return (ArrayList<Vector3D>) Vector3Ds.clone(); int minVector3D = -1, maxVector3D = -1; float minX = Float.POSITIVE_INFINITY; float maxX = Float.NEGATIVE_INFINITY; for (int i = 0; i < Vector3Ds.size(); i++) { if (Vector3Ds.get(i).getX() < minX) { minX = Vector3Ds.get(i).getX(); minVector3D = i; } if (Vector3Ds.get(i).getX() > maxX) { maxX = Vector3Ds.get(i).getX(); maxVector3D = i; } } Vector3D A = Vector3Ds.get(minVector3D); Vector3D B = Vector3Ds.get(maxVector3D); convexHull.add(A); convexHull.add(B); Vector3Ds.remove(A); Vector3Ds.remove(B); ArrayList<Vector3D> leftSet = new ArrayList<Vector3D>(); ArrayList<Vector3D> rightSet = new ArrayList<Vector3D>(); for (Vector3D p : Vector3Ds) { if (Vector3DLocation(A, B, p) == -1) leftSet.add(p); else rightSet.add(p); } hullSet(A,B,rightSet,convexHull); hullSet(B,A,leftSet,convexHull); return convexHull; } | /**
* Gets the convex hull2 d.
*
* @param Vector3Ds the vector3 ds
*
* @return the convex hull2 d
*/ | Gets the convex hull2 d | getConvexHull2D | {
"repo_name": "rogiermars/mt4j-core",
"path": "src/org/mt4j/util/math/ConvexQuickHull2D.java",
"license": "gpl-2.0",
"size": 4678
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 2,584,078 |
public Optional<Proxy> getProxy() {
return Optional.ofNullable(proxy);
} | Optional<Proxy> function() { return Optional.ofNullable(proxy); } | /**
* The proxy which should be used to connect to the Discord REST API and websocket.
*
* @return the proxy which should be used to connect to the Discord REST API and websocket.
*/ | The proxy which should be used to connect to the Discord REST API and websocket | getProxy | {
"repo_name": "BtoBastian/Javacord",
"path": "javacord-core/src/main/java/org/javacord/core/DiscordApiImpl.java",
"license": "lgpl-3.0",
"size": 79294
} | [
"java.net.Proxy",
"java.util.Optional"
] | import java.net.Proxy; import java.util.Optional; | import java.net.*; import java.util.*; | [
"java.net",
"java.util"
] | java.net; java.util; | 1,060,949 |
public static Object instantiateObject(Class<?> clazz, Object... arguments) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException {
return getConstructor(clazz, DataType.getPrimitive(arguments)).newInstance(arguments);
}
| static Object function(Class<?> clazz, Object... arguments) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException { return getConstructor(clazz, DataType.getPrimitive(arguments)).newInstance(arguments); } | /**
* Returns an instance of a class with the given arguments
*
* @param clazz Target class
* @param arguments Arguments which are used to construct an object of the target class
* @return The instance of the target class with the specified arguments
* @throws InstantiationException If you cannot create an instance of the target class due to certain circumstances
* @throws IllegalAccessException If the desired constructor cannot be accessed due to certain circumstances
* @throws IllegalArgumentException If the types of the arguments do not match the parameter types of the constructor (this should not occur since it searches for a constructor with the types of the arguments)
* @throws InvocationTargetException If the desired constructor cannot be invoked
* @throws NoSuchMethodException If the desired constructor with the specified arguments cannot be found
*/ | Returns an instance of a class with the given arguments | instantiateObject | {
"repo_name": "Mert1602/Advanced-API",
"path": "src/main/java/me/mert1602/advancedapi/ReflectionUtils.java",
"license": "gpl-3.0",
"size": 16589
} | [
"java.lang.reflect.InvocationTargetException"
] | import java.lang.reflect.InvocationTargetException; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 2,688,233 |
public List<COSObjectKey> getPreparedKeys()
{
return Collections.unmodifiableList(preparedKeys);
} | List<COSObjectKey> function() { return Collections.unmodifiableList(preparedKeys); } | /**
* Returns all {@link COSObjectKey}s, that shall be added to the object stream, when
* {@link COSWriterObjectStream#writeObjectsToStream(COSStream)} is called.
*
* @return All {@link COSObjectKey}s, that shall be added to the object stream.
*/ | Returns all <code>COSObjectKey</code>s, that shall be added to the object stream, when <code>COSWriterObjectStream#writeObjectsToStream(COSStream)</code> is called | getPreparedKeys | {
"repo_name": "kalaspuffar/pdfbox",
"path": "pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/compress/COSWriterObjectStream.java",
"license": "apache-2.0",
"size": 15011
} | [
"java.util.Collections",
"java.util.List",
"org.apache.pdfbox.cos.COSObjectKey"
] | import java.util.Collections; import java.util.List; import org.apache.pdfbox.cos.COSObjectKey; | import java.util.*; import org.apache.pdfbox.cos.*; | [
"java.util",
"org.apache.pdfbox"
] | java.util; org.apache.pdfbox; | 2,118,278 |
private Object hitToOutput(EvaluationContext ctx, FEEL feel, DTDecisionRule rule) {
List<CompiledExpression> outputEntries = rule.getOutputEntry();
Map<String, Object> values = ctx.getAllValues();
if ( outputEntries.size() == 1 ) {
Object value = feel.evaluate( outputEntries.get( 0 ), values );
return value;
} else {
// zip outputEntries with its name:
return IntStream.range( 0, outputs.size() ).boxed()
.collect( toMap( i -> outputs.get( i ).getName(), i -> feel.evaluate( outputEntries.get( i ), values ) ) );
}
} | Object function(EvaluationContext ctx, FEEL feel, DTDecisionRule rule) { List<CompiledExpression> outputEntries = rule.getOutputEntry(); Map<String, Object> values = ctx.getAllValues(); if ( outputEntries.size() == 1 ) { Object value = feel.evaluate( outputEntries.get( 0 ), values ); return value; } else { return IntStream.range( 0, outputs.size() ).boxed() .collect( toMap( i -> outputs.get( i ).getName(), i -> feel.evaluate( outputEntries.get( i ), values ) ) ); } } | /**
* Each hit results in one output value (multiple outputs are collected into a single context value)
*/ | Each hit results in one output value (multiple outputs are collected into a single context value) | hitToOutput | {
"repo_name": "sutaakar/drools",
"path": "kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/decisiontables/DecisionTableImpl.java",
"license": "apache-2.0",
"size": 11173
} | [
"java.util.List",
"java.util.Map",
"java.util.stream.Collectors",
"java.util.stream.IntStream",
"org.kie.dmn.feel.lang.CompiledExpression",
"org.kie.dmn.feel.lang.EvaluationContext"
] | import java.util.List; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.kie.dmn.feel.lang.CompiledExpression; import org.kie.dmn.feel.lang.EvaluationContext; | import java.util.*; import java.util.stream.*; import org.kie.dmn.feel.lang.*; | [
"java.util",
"org.kie.dmn"
] | java.util; org.kie.dmn; | 970,463 |
public Map<SimpleString, List<Binding>> getRoutingNameBindingMap() {
return routingNameBindingMap.copyAsMap();
} | Map<SimpleString, List<Binding>> function() { return routingNameBindingMap.copyAsMap(); } | /**
* debug method: used just for tests!!
* @return
*/ | debug method: used just for tests! | getRoutingNameBindingMap | {
"repo_name": "graben/activemq-artemis",
"path": "artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/BindingsImpl.java",
"license": "apache-2.0",
"size": 22921
} | [
"java.util.List",
"java.util.Map",
"org.apache.activemq.artemis.api.core.SimpleString",
"org.apache.activemq.artemis.core.postoffice.Binding"
] | import java.util.List; import java.util.Map; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.postoffice.Binding; | import java.util.*; import org.apache.activemq.artemis.api.core.*; import org.apache.activemq.artemis.core.postoffice.*; | [
"java.util",
"org.apache.activemq"
] | java.util; org.apache.activemq; | 659,444 |
private static String getStyleSheet() {
if (fgStyleSheet == null)
fgStyleSheet= loadStyleSheet();
String css= fgStyleSheet;
if (css != null) {
FontData fontData= JFaceResources.getFontRegistry().getFontData(PreferenceConstants.APPEARANCE_JAVADOC_FONT)[0];
css= HTMLPrinter.convertTopLevelFont(css, fontData);
}
return css;
} | static String function() { if (fgStyleSheet == null) fgStyleSheet= loadStyleSheet(); String css= fgStyleSheet; if (css != null) { FontData fontData= JFaceResources.getFontRegistry().getFontData(PreferenceConstants.APPEARANCE_JAVADOC_FONT)[0]; css= HTMLPrinter.convertTopLevelFont(css, fontData); } return css; } | /**
* Returns the Javadoc hover style sheet with the current Javadoc font from the preferences.
* @return the updated style sheet
* @since 3.4
*/ | Returns the Javadoc hover style sheet with the current Javadoc font from the preferences | getStyleSheet | {
"repo_name": "brunyuriy/quick-fix-scout",
"path": "org.eclipse.jdt.ui_3.7.1.r371_v20110824-0800/src/org/eclipse/jdt/internal/ui/text/java/hover/JavadocHover.java",
"license": "mit",
"size": 41988
} | [
"org.eclipse.jdt.ui.PreferenceConstants",
"org.eclipse.jface.internal.text.html.HTMLPrinter",
"org.eclipse.jface.resource.JFaceResources",
"org.eclipse.swt.graphics.FontData"
] | import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jface.internal.text.html.HTMLPrinter; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.swt.graphics.FontData; | import org.eclipse.jdt.ui.*; import org.eclipse.jface.internal.text.html.*; import org.eclipse.jface.resource.*; import org.eclipse.swt.graphics.*; | [
"org.eclipse.jdt",
"org.eclipse.jface",
"org.eclipse.swt"
] | org.eclipse.jdt; org.eclipse.jface; org.eclipse.swt; | 2,616,449 |
List<Attribute> getAttributes(PerunSession sess, Facility facility, User user) throws InternalErrorException; | List<Attribute> getAttributes(PerunSession sess, Facility facility, User user) throws InternalErrorException; | /**
* Get all <b>non-empty</b> attributes associated with the user on the facility.
*
* @param sess perun session
* @param facility
* @param user
* @return list of attributes
*
* @throws InternalErrorException
*/ | Get all non-empty attributes associated with the user on the facility | getAttributes | {
"repo_name": "Natrezim/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/implApi/AttributesManagerImplApi.java",
"license": "bsd-2-clause",
"size": 104335
} | [
"cz.metacentrum.perun.core.api.Attribute",
"cz.metacentrum.perun.core.api.Facility",
"cz.metacentrum.perun.core.api.PerunSession",
"cz.metacentrum.perun.core.api.User",
"cz.metacentrum.perun.core.api.exceptions.InternalErrorException",
"java.util.List"
] | import cz.metacentrum.perun.core.api.Attribute; import cz.metacentrum.perun.core.api.Facility; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.User; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException; import java.util.List; | import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*; import java.util.*; | [
"cz.metacentrum.perun",
"java.util"
] | cz.metacentrum.perun; java.util; | 961,640 |
public Map<String, Double> getAttributeWeights() {
// For backwards compatibility
if (this.attributeWeights==null) {
this.attributeWeights = new HashMap<String, Double>();
}
return new HashMap<String, Double>(this.attributeWeights);
} | Map<String, Double> function() { if (this.attributeWeights==null) { this.attributeWeights = new HashMap<String, Double>(); } return new HashMap<String, Double>(this.attributeWeights); } | /**
* Returns all configured attribute weights. For attributes which are not a key in this
* set the default attribute weight will be assumed by ARX. This default value is
* currently set to 0.5.
*
* @return
*/ | Returns all configured attribute weights. For attributes which are not a key in this set the default attribute weight will be assumed by ARX. This default value is currently set to 0.5 | getAttributeWeights | {
"repo_name": "kbabioch/arx",
"path": "src/main/org/deidentifier/arx/ARXConfiguration.java",
"license": "apache-2.0",
"size": 47814
} | [
"java.util.HashMap",
"java.util.Map"
] | import java.util.HashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,602,251 |
public Observable<ServerData> getServerRx() {
return serverRx.asObservable();
} | Observable<ServerData> function() { return serverRx.asObservable(); } | /**
* Get observable emitting server items.
*
* @return observable emitting server items.
*/ | Get observable emitting server items | getServerRx | {
"repo_name": "robbyb67/openhab2",
"path": "addons/binding/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/handler/server/MinecraftSocketHandler.java",
"license": "epl-1.0",
"size": 3874
} | [
"org.openhab.binding.minecraft.message.data.ServerData"
] | import org.openhab.binding.minecraft.message.data.ServerData; | import org.openhab.binding.minecraft.message.data.*; | [
"org.openhab.binding"
] | org.openhab.binding; | 2,300,961 |
public List<User> getAllUsers()
{
return manager.getUsers();
} | List<User> function() { return manager.getUsers(); } | /**
* Returns all the users in the system
*/ | Returns all the users in the system | getAllUsers | {
"repo_name": "StevenThuriot/MOP",
"path": "Java/src/controller/InvitationController.java",
"license": "mit",
"size": 2030
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,633,131 |
public synchronized void stopJob(long jobId) {
logger.log(Level.INFO, "Stopping search job {0}", jobId); //NON-NLS
commit();
SearchJobInfo job;
job = jobs.get(jobId);
if (job == null) {
return;
}
//stop currentSearcher
IngestSearchRunner.Searcher currentSearcher = job.getCurrentSearcher();
if ((currentSearcher != null) && (!currentSearcher.isDone())) {
logger.log(Level.INFO, "Cancelling search job {0}", jobId); //NON-NLS
currentSearcher.cancel(true);
}
jobs.remove(jobId);
if (jobs.isEmpty()) {
// no more jobs left. stop the PeriodicSearchTask.
// A new one will be created for future jobs.
logger.log(Level.INFO, "No more search jobs. Stopping periodic search task"); //NON-NLS
periodicSearchTaskRunning = false;
jobProcessingTaskFuture.cancel(true);
}
} | synchronized void function(long jobId) { logger.log(Level.INFO, STR, jobId); commit(); SearchJobInfo job; job = jobs.get(jobId); if (job == null) { return; } IngestSearchRunner.Searcher currentSearcher = job.getCurrentSearcher(); if ((currentSearcher != null) && (!currentSearcher.isDone())) { logger.log(Level.INFO, STR, jobId); currentSearcher.cancel(true); } jobs.remove(jobId); if (jobs.isEmpty()) { logger.log(Level.INFO, STR); periodicSearchTaskRunning = false; jobProcessingTaskFuture.cancel(true); } } | /**
* Immediate stop and removal of job from SearchRunner. Cancels the
* associated search worker if it's still running.
*
* @param jobId
*/ | Immediate stop and removal of job from SearchRunner. Cancels the associated search worker if it's still running | stopJob | {
"repo_name": "millmanorama/autopsy",
"path": "KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IngestSearchRunner.java",
"license": "apache-2.0",
"size": 30350
} | [
"java.util.logging.Level"
] | import java.util.logging.Level; | import java.util.logging.*; | [
"java.util"
] | java.util; | 718,348 |
private static String md5(String input) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] messageDigest;
messageDigest = md.digest(input.getBytes());
BigInteger number = new BigInteger(1, messageDigest);
return String.format("%032x", number);
}
| static String function(String input) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("MD5"); byte[] messageDigest; messageDigest = md.digest(input.getBytes()); BigInteger number = new BigInteger(1, messageDigest); return String.format("%032x", number); } | /**
* Message Digest
* @throws NoSuchAlgorithmException
*/ | Message Digest | md5 | {
"repo_name": "PRImA-Research-Lab/prima-gwt-lib",
"path": "src/org/primaresearch/web/gwt/server/UserServiceImpl.java",
"license": "apache-2.0",
"size": 16768
} | [
"java.math.BigInteger",
"java.security.MessageDigest",
"java.security.NoSuchAlgorithmException"
] | import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; | import java.math.*; import java.security.*; | [
"java.math",
"java.security"
] | java.math; java.security; | 825,234 |
public static boolean sendMessageToAllCCUs(IMCMessage msg){
boolean result=true;
synchronized (sysList.getList()) {
for (Sys s : sysList.getList()){
if (s.isCCU()==true){
boolean bool = sendMessage(msg, s);
if (bool==false) {
result = false;
}
}
}
}
post("INFO - "+"Sent "+msg.getAbbrev()+" to ALL CCU");
return result;
} | static boolean function(IMCMessage msg){ boolean result=true; synchronized (sysList.getList()) { for (Sys s : sysList.getList()){ if (s.isCCU()==true){ boolean bool = sendMessage(msg, s); if (bool==false) { result = false; } } } } post(STR+STR+msg.getAbbrev()+STR); return result; } | /**
* Send a IMCMessage to ALL CCUs
* @param msg The IMCMessage to be sent
* @return true if every IMCMessage was sent without erros, false otherwise.
*/ | Send a IMCMessage to ALL CCUs | sendMessageToAllCCUs | {
"repo_name": "pmfg/ALVIi",
"path": "app/src/main/java/pt/lsts/accl/bus/AcclBus.java",
"license": "mit",
"size": 15256
} | [
"pt.lsts.accl.sys.Sys",
"pt.lsts.imc.IMCMessage"
] | import pt.lsts.accl.sys.Sys; import pt.lsts.imc.IMCMessage; | import pt.lsts.accl.sys.*; import pt.lsts.imc.*; | [
"pt.lsts.accl",
"pt.lsts.imc"
] | pt.lsts.accl; pt.lsts.imc; | 1,355,550 |
public Adapter createPostBoxTypeAdapter() {
return null;
} | Adapter function() { return null; } | /**
* Creates a new adapter for an object of class '{@link org.oasis.xAL.PostBoxType <em>Post Box Type</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
* @see org.oasis.xAL.PostBoxType
* @generated
*/ | Creates a new adapter for an object of class '<code>org.oasis.xAL.PostBoxType Post Box Type</code>'. This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. | createPostBoxTypeAdapter | {
"repo_name": "markus1978/citygml4emf",
"path": "de.hub.citygml.emf.ecore/src/org/oasis/xAL/util/XALAdapterFactory.java",
"license": "apache-2.0",
"size": 61937
} | [
"org.eclipse.emf.common.notify.Adapter"
] | import org.eclipse.emf.common.notify.Adapter; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,353,552 |
List<ColumnFamily> columnFamilies = new LinkedList<ColumnFamily>();
columnFamilies.add(columnFamily);
Message message = createMessage(keyspace, rowKey, cfName, columnFamilies);
for (EndPoint endpoint : StorageService.instance().getReadStorageEndPoints(rowKey)) {
MessagingService.getMessagingInstance().sendOneWay(message, endpoint);
}
} | List<ColumnFamily> columnFamilies = new LinkedList<ColumnFamily>(); columnFamilies.add(columnFamily); Message message = createMessage(keyspace, rowKey, cfName, columnFamilies); for (EndPoint endpoint : StorageService.instance().getReadStorageEndPoints(rowKey)) { MessagingService.getMessagingInstance().sendOneWay(message, endpoint); } } | /**
* Make the message and send to all the right nodes
*
* @param rowKey Row key of the data
* @param columnFamily Column family with data to send
* @throws IOException
*/ | Make the message and send to all the right nodes | sendColumnFamily | {
"repo_name": "ebottabi/cassandraoutputformat",
"path": "src/java/fm/last/hadoop/mapred/CassandraClient.java",
"license": "mit",
"size": 5994
} | [
"java.util.LinkedList",
"java.util.List",
"org.apache.cassandra.db.ColumnFamily",
"org.apache.cassandra.net.EndPoint",
"org.apache.cassandra.net.Message",
"org.apache.cassandra.net.MessagingService",
"org.apache.cassandra.service.StorageService"
] | import java.util.LinkedList; import java.util.List; import org.apache.cassandra.db.ColumnFamily; import org.apache.cassandra.net.EndPoint; import org.apache.cassandra.net.Message; import org.apache.cassandra.net.MessagingService; import org.apache.cassandra.service.StorageService; | import java.util.*; import org.apache.cassandra.db.*; import org.apache.cassandra.net.*; import org.apache.cassandra.service.*; | [
"java.util",
"org.apache.cassandra"
] | java.util; org.apache.cassandra; | 1,540,191 |
public int insertAlarmCluster(AlarmClusterInfo clusterInfo); | int function(AlarmClusterInfo clusterInfo); | /**
* Storage alarm cluster,such as kafka or zookeeper.
*/ | Storage alarm cluster,such as kafka or zookeeper | insertAlarmCluster | {
"repo_name": "smartloli/kafka-eagle",
"path": "kafka-eagle-web/src/main/java/org/smartloli/kafka/eagle/web/mapper/dao/KeAlertDao.java",
"license": "apache-2.0",
"size": 4579
} | [
"org.smartloli.kafka.eagle.common.protocol.alarm.AlarmClusterInfo"
] | import org.smartloli.kafka.eagle.common.protocol.alarm.AlarmClusterInfo; | import org.smartloli.kafka.eagle.common.protocol.alarm.*; | [
"org.smartloli.kafka"
] | org.smartloli.kafka; | 1,514,947 |
private void init() {
menuBar = new JMeterMenuBar();
setJMenuBar(menuBar);
JPanel all = new JPanel(new BorderLayout());
all.add(createToolBar(), BorderLayout.NORTH);
JSplitPane treeAndMain = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
treePanel = createTreePanel();
treeAndMain.setLeftComponent(treePanel);
JSplitPane topAndDown = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
topAndDown.setOneTouchExpandable(true);
topAndDown.setDividerLocation(0.8);
topAndDown.setResizeWeight(.8);
topAndDown.setContinuousLayout(true);
topAndDown.setBorder(null); // see bug jdk 4131528
if (!DISPLAY_LOGGER_PANEL) {
topAndDown.setDividerSize(0);
}
mainPanel = createMainPanel();
logPanel = createLoggerPanel();
if (DISPLAY_ERROR_FATAL_COUNTER) {
errorsAndFatalsCounterLogTarget = new ErrorsAndFatalsCounterLogTarget();
LoggingManager.addLogTargetToRootLogger(new LogTarget[]{
logPanel,
errorsAndFatalsCounterLogTarget
});
} else {
LoggingManager.addLogTargetToRootLogger(new LogTarget[]{
logPanel
});
}
topAndDown.setTopComponent(mainPanel);
topAndDown.setBottomComponent(logPanel);
treeAndMain.setRightComponent(topAndDown);
treeAndMain.setResizeWeight(.2);
treeAndMain.setContinuousLayout(true);
all.add(treeAndMain, BorderLayout.CENTER);
getContentPane().add(all);
tree.setSelectionRow(1);
addWindowListener(new WindowHappenings());
// Building is complete, register as listener
GuiPackage.getInstance().registerAsListener();
setTitle(DEFAULT_TITLE);
setIconImage(JMeterUtils.getImage("icon-apache.png").getImage());// $NON-NLS-1$
setWindowTitle(); // define AWT WM_CLASS string
} | void function() { menuBar = new JMeterMenuBar(); setJMenuBar(menuBar); JPanel all = new JPanel(new BorderLayout()); all.add(createToolBar(), BorderLayout.NORTH); JSplitPane treeAndMain = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); treePanel = createTreePanel(); treeAndMain.setLeftComponent(treePanel); JSplitPane topAndDown = new JSplitPane(JSplitPane.VERTICAL_SPLIT); topAndDown.setOneTouchExpandable(true); topAndDown.setDividerLocation(0.8); topAndDown.setResizeWeight(.8); topAndDown.setContinuousLayout(true); topAndDown.setBorder(null); if (!DISPLAY_LOGGER_PANEL) { topAndDown.setDividerSize(0); } mainPanel = createMainPanel(); logPanel = createLoggerPanel(); if (DISPLAY_ERROR_FATAL_COUNTER) { errorsAndFatalsCounterLogTarget = new ErrorsAndFatalsCounterLogTarget(); LoggingManager.addLogTargetToRootLogger(new LogTarget[]{ logPanel, errorsAndFatalsCounterLogTarget }); } else { LoggingManager.addLogTargetToRootLogger(new LogTarget[]{ logPanel }); } topAndDown.setTopComponent(mainPanel); topAndDown.setBottomComponent(logPanel); treeAndMain.setRightComponent(topAndDown); treeAndMain.setResizeWeight(.2); treeAndMain.setContinuousLayout(true); all.add(treeAndMain, BorderLayout.CENTER); getContentPane().add(all); tree.setSelectionRow(1); addWindowListener(new WindowHappenings()); GuiPackage.getInstance().registerAsListener(); setTitle(DEFAULT_TITLE); setIconImage(JMeterUtils.getImage(STR).getImage()); setWindowTitle(); } | /**
* Create the GUI components and layout.
*/ | Create the GUI components and layout | init | {
"repo_name": "hemikak/jmeter",
"path": "src/core/org/apache/jmeter/gui/MainFrame.java",
"license": "apache-2.0",
"size": 31904
} | [
"java.awt.BorderLayout",
"javax.swing.JPanel",
"javax.swing.JSplitPane",
"org.apache.jmeter.gui.util.JMeterMenuBar",
"org.apache.jmeter.util.JMeterUtils",
"org.apache.jorphan.logging.LoggingManager",
"org.apache.log.LogTarget"
] | import java.awt.BorderLayout; import javax.swing.JPanel; import javax.swing.JSplitPane; import org.apache.jmeter.gui.util.JMeterMenuBar; import org.apache.jmeter.util.JMeterUtils; import org.apache.jorphan.logging.LoggingManager; import org.apache.log.LogTarget; | import java.awt.*; import javax.swing.*; import org.apache.jmeter.gui.util.*; import org.apache.jmeter.util.*; import org.apache.jorphan.logging.*; import org.apache.log.*; | [
"java.awt",
"javax.swing",
"org.apache.jmeter",
"org.apache.jorphan",
"org.apache.log"
] | java.awt; javax.swing; org.apache.jmeter; org.apache.jorphan; org.apache.log; | 1,634,214 |
public UserApplication getUserApplication() {
return userApplication;
} | UserApplication function() { return userApplication; } | /**
* Gets the user application.
*
* @return the user application.
*/ | Gets the user application | getUserApplication | {
"repo_name": "lorislab/appky",
"path": "appky-process/src/main/java/org/lorislab/appky/application/wrapper/model/PlatformWrapper.java",
"license": "apache-2.0",
"size": 5636
} | [
"org.lorislab.appky.application.model.UserApplication"
] | import org.lorislab.appky.application.model.UserApplication; | import org.lorislab.appky.application.model.*; | [
"org.lorislab.appky"
] | org.lorislab.appky; | 2,514,667 |
@ItemAttributeTrait(attrType=StoreAttributes.END_DATE, traitType=TraitType.STRING)
@XmlElement(name="end-date")
@RDFUri(uri=StoreNS.END_DATE)
@RDFSubject
public String getEndDate() {
return endDate;
}
| @ItemAttributeTrait(attrType=StoreAttributes.END_DATE, traitType=TraitType.STRING) @XmlElement(name=STR) @RDFUri(uri=StoreNS.END_DATE) String function() { return endDate; } | /**
* Get the grant end date
*
* @return The end date
*/ | Get the grant end date | getEndDate | {
"repo_name": "anu-doi/metadata-stores",
"path": "store/src/main/java/au/edu/anu/metadatastores/store/grants/Grant.java",
"license": "gpl-3.0",
"size": 7993
} | [
"au.edu.anu.metadatastores.datamodel.store.annotations.ItemAttributeTrait",
"au.edu.anu.metadatastores.datamodel.store.annotations.TraitType",
"au.edu.anu.metadatastores.datamodel.store.ext.StoreAttributes",
"au.edu.anu.metadatastores.rdf.annotation.RDFUri",
"au.edu.anu.metadatastores.rdf.namespace.StoreNS"... | import au.edu.anu.metadatastores.datamodel.store.annotations.ItemAttributeTrait; import au.edu.anu.metadatastores.datamodel.store.annotations.TraitType; import au.edu.anu.metadatastores.datamodel.store.ext.StoreAttributes; import au.edu.anu.metadatastores.rdf.annotation.RDFUri; import au.edu.anu.metadatastores.rdf.namespace.StoreNS; import javax.xml.bind.annotation.XmlElement; | import au.edu.anu.metadatastores.datamodel.store.annotations.*; import au.edu.anu.metadatastores.datamodel.store.ext.*; import au.edu.anu.metadatastores.rdf.annotation.*; import au.edu.anu.metadatastores.rdf.namespace.*; import javax.xml.bind.annotation.*; | [
"au.edu.anu",
"javax.xml"
] | au.edu.anu; javax.xml; | 2,432,401 |
void revokeRoles(Session session, Set<String> roles, Set<PrestoPrincipal> grantees, boolean adminOptionFor, Optional<PrestoPrincipal> grantor, String catalog); | void revokeRoles(Session session, Set<String> roles, Set<PrestoPrincipal> grantees, boolean adminOptionFor, Optional<PrestoPrincipal> grantor, String catalog); | /**
* Revokes the specified roles from the specified grantees in the specified catalog
*
* @param grantor represents the principal specified by GRANTED BY statement
*/ | Revokes the specified roles from the specified grantees in the specified catalog | revokeRoles | {
"repo_name": "ptkool/presto",
"path": "presto-main/src/main/java/com/facebook/presto/metadata/Metadata.java",
"license": "apache-2.0",
"size": 17661
} | [
"com.facebook.presto.Session",
"com.facebook.presto.spi.security.PrestoPrincipal",
"java.util.Optional",
"java.util.Set"
] | import com.facebook.presto.Session; import com.facebook.presto.spi.security.PrestoPrincipal; import java.util.Optional; import java.util.Set; | import com.facebook.presto.*; import com.facebook.presto.spi.security.*; import java.util.*; | [
"com.facebook.presto",
"java.util"
] | com.facebook.presto; java.util; | 2,099,368 |
public UserProxy getUserProxy(User user) {
try {
return com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false);
} catch (Exception e) {
Logger.error(this, e.getMessage(), e);
throw new DotRuntimeException(e.getMessage(), e);
}
}
| UserProxy function(User user) { try { return com.dotmarketing.business.APILocator.getUserProxyAPI().getUserProxy(user,APILocator.getUserAPI().getSystemUser(), false); } catch (Exception e) { Logger.error(this, e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } } | /**
* This method return user proxy of the specified user
* @param user User
* @return UserProxy
*/ | This method return user proxy of the specified user | getUserProxy | {
"repo_name": "ggonzales/dotcms",
"path": "src/com/dotmarketing/viewtools/CMSUsersWebAPI.java",
"license": "gpl-3.0",
"size": 14181
} | [
"com.dotmarketing.beans.UserProxy",
"com.dotmarketing.business.APILocator",
"com.dotmarketing.exception.DotRuntimeException",
"com.dotmarketing.util.Logger",
"com.liferay.portal.model.User"
] | import com.dotmarketing.beans.UserProxy; import com.dotmarketing.business.APILocator; import com.dotmarketing.exception.DotRuntimeException; import com.dotmarketing.util.Logger; import com.liferay.portal.model.User; | import com.dotmarketing.beans.*; import com.dotmarketing.business.*; import com.dotmarketing.exception.*; import com.dotmarketing.util.*; import com.liferay.portal.model.*; | [
"com.dotmarketing.beans",
"com.dotmarketing.business",
"com.dotmarketing.exception",
"com.dotmarketing.util",
"com.liferay.portal"
] | com.dotmarketing.beans; com.dotmarketing.business; com.dotmarketing.exception; com.dotmarketing.util; com.liferay.portal; | 181,491 |
@Override
public Adapter createCemeteryAdapter() {
if (cemeteryItemProvider == null) {
cemeteryItemProvider = new CemeteryItemProvider(this);
}
return cemeteryItemProvider;
} | Adapter function() { if (cemeteryItemProvider == null) { cemeteryItemProvider = new CemeteryItemProvider(this); } return cemeteryItemProvider; } | /**
* This creates an adapter for a {@link org.eclipse.viatra.dse.merge.scope.Cemetery}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This creates an adapter for a <code>org.eclipse.viatra.dse.merge.scope.Cemetery</code>. | createCemeteryAdapter | {
"repo_name": "FTSRG/mondo-collab-mergespaceexploration",
"path": "plugins/org.eclipse.viatra.dse.merge.edit/src/org/eclipse/viatra/dse/merge/scope/provider/ScopeItemProviderAdapterFactory.java",
"license": "epl-1.0",
"size": 7119
} | [
"org.eclipse.emf.common.notify.Adapter"
] | import org.eclipse.emf.common.notify.Adapter; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 137,877 |
public void setPopupPosition(int left, int top) {
// Account for the difference between absolute position and the
// body's positioning context.
left -= Document.get().getBodyOffsetLeft();
top -= Document.get().getBodyOffsetTop();
// Set the popup's position manually, allowing setPopupPosition() to be
// called before show() is called (so a popup can be positioned without it
// 'jumping' on the screen).
Element elem = contentContainer.getElement();
elem.getStyle().setPropertyPx("left", left);
elem.getStyle().setPropertyPx("top", top);
}
@UiTemplate("View.ui.xml")
interface MyBinder extends UiBinder<FlowPanel, View> {}
private class MouseHandler implements MouseDownHandler, MouseUpHandler, MouseMoveHandler { | void function(int left, int top) { left -= Document.get().getBodyOffsetLeft(); top -= Document.get().getBodyOffsetTop(); Element elem = contentContainer.getElement(); elem.getStyle().setPropertyPx("left", left); elem.getStyle().setPropertyPx("top", top); } @UiTemplate(STR) interface MyBinder extends UiBinder<FlowPanel, View> {} private class MouseHandler implements MouseDownHandler, MouseUpHandler, MouseMoveHandler { | /**
* Sets the popup's position relative to the browser's client area. The popup's position may be
* set before calling {@link #setShowing(boolean)}.
*
* @param left the left position, in pixels
* @param top the top position, in pixels
*/ | Sets the popup's position relative to the browser's client area. The popup's position may be set before calling <code>#setShowing(boolean)</code> | setPopupPosition | {
"repo_name": "jonahkichwacoders/che",
"path": "ide/che-core-ide-ui/src/main/java/org/eclipse/che/ide/ui/window/View.java",
"license": "epl-1.0",
"size": 11431
} | [
"com.google.gwt.dom.client.Document",
"com.google.gwt.dom.client.Element",
"com.google.gwt.event.dom.client.MouseDownHandler",
"com.google.gwt.event.dom.client.MouseMoveHandler",
"com.google.gwt.event.dom.client.MouseUpHandler",
"com.google.gwt.uibinder.client.UiBinder",
"com.google.gwt.uibinder.client.... | import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; import com.google.gwt.event.dom.client.MouseDownHandler; import com.google.gwt.event.dom.client.MouseMoveHandler; import com.google.gwt.event.dom.client.MouseUpHandler; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiTemplate; import com.google.gwt.user.client.ui.FlowPanel; | import com.google.gwt.dom.client.*; import com.google.gwt.event.dom.client.*; import com.google.gwt.uibinder.client.*; import com.google.gwt.user.client.ui.*; | [
"com.google.gwt"
] | com.google.gwt; | 1,702,959 |
@Generated
@StructureField(order = 6, isGetter = true)
public native byte leftClass(); | @StructureField(order = 6, isGetter = true) native byte function(); | /**
* maps left glyph to offset into kern index
*/ | maps left glyph to offset into kern index | leftClass | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/coretext/struct/KernIndexArrayHeader.java",
"license": "apache-2.0",
"size": 3762
} | [
"org.moe.natj.c.ann.StructureField"
] | import org.moe.natj.c.ann.StructureField; | import org.moe.natj.c.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 2,640,963 |
public void reportDone(final ReportEvent event)
{
event.getReport().getPageFooter().getElement("page-footer-content").setVisible(false);
event.getReport().getPageFooter().getElement("fake-report-footer").setVisible(true);
} | void function(final ReportEvent event) { event.getReport().getPageFooter().getElement(STR).setVisible(false); event.getReport().getPageFooter().getElement(STR).setVisible(true); } | /**
* Receives notification that report generation has completed, the report footer was printed, no more output is done.
* This is a helper event to shut down the output service.
*
* @param event The event.
*/ | Receives notification that report generation has completed, the report footer was printed, no more output is done. This is a helper event to shut down the output service | reportDone | {
"repo_name": "EgorZhuk/pentaho-reporting",
"path": "engine/demo/src/main/java/org/pentaho/reporting/engine/classic/demo/ancient/demo/reportfooter/TriggerComplexPageFooterFunction.java",
"license": "lgpl-2.1",
"size": 2542
} | [
"org.pentaho.reporting.engine.classic.core.event.ReportEvent"
] | import org.pentaho.reporting.engine.classic.core.event.ReportEvent; | import org.pentaho.reporting.engine.classic.core.event.*; | [
"org.pentaho.reporting"
] | org.pentaho.reporting; | 1,825,084 |
void dropOnMap(MapDnDEvent mde);
void dragOverMap(MapDnDEvent mde); | void dropOnMap(MapDnDEvent mde); void dragOverMap(MapDnDEvent mde); | /**
* DOCUMENT ME!
*
* @param mde DOCUMENT ME!
*/ | DOCUMENT ME | dragOverMap | {
"repo_name": "cismet/cismap-commons",
"path": "src/main/java/de/cismet/cismap/commons/interaction/MapDnDListener.java",
"license": "lgpl-3.0",
"size": 743
} | [
"de.cismet.cismap.commons.interaction.events.MapDnDEvent"
] | import de.cismet.cismap.commons.interaction.events.MapDnDEvent; | import de.cismet.cismap.commons.interaction.events.*; | [
"de.cismet.cismap"
] | de.cismet.cismap; | 2,282,912 |
public void setProperties(Properties properties) {
this.properties = properties;
} | void function(Properties properties) { this.properties = properties; } | /**
* Sets the properties for the repository connection
*
* @param properties
* the properties or null
*/ | Sets the properties for the repository connection | setProperties | {
"repo_name": "naidu/mercurialeclipse",
"path": "plugin/src/com/vectrace/MercurialEclipse/wizards/HgWizardPage.java",
"license": "epl-1.0",
"size": 2763
} | [
"java.util.Properties"
] | import java.util.Properties; | import java.util.*; | [
"java.util"
] | java.util; | 1,062,282 |
private static Optional<AnnotatedValueResolver> of(AnnotatedElement annotatedElement,
AnnotatedElement typeElement, Class<?> type,
Set<String> pathParams,
List<RequestObjectResolver> objectResolvers) {
requireNonNull(annotatedElement, "annotatedElement");
requireNonNull(typeElement, "typeElement");
requireNonNull(type, "type");
requireNonNull(pathParams, "pathParams");
requireNonNull(objectResolvers, "objectResolvers");
final Param param = annotatedElement.getAnnotation(Param.class);
if (param != null) {
final String name = findName(param, typeElement);
if (pathParams.contains(name)) {
return Optional.of(ofPathVariable(param, name, annotatedElement, typeElement, type));
} else {
return Optional.of(ofHttpParameter(param, name, annotatedElement, typeElement, type));
}
}
final Header header = annotatedElement.getAnnotation(Header.class);
if (header != null) {
return Optional.of(ofHeader(header, annotatedElement, typeElement, type));
}
final RequestObject requestObject = annotatedElement.getAnnotation(RequestObject.class);
if (requestObject != null) {
return Optional.of(ofRequestObject(requestObject, annotatedElement, type,
pathParams, objectResolvers));
}
// There should be no '@Default' annotation on 'annotatedElement' if 'annotatedElement' is
// different from 'typeElement', because it was checked before calling this method.
// So, 'typeElement' should be used when finding an injectable type because we need to check
// syntactic errors like below:
//
// void method1(@Default("a") ServiceRequestContext) { ... }
//
return Optional.ofNullable(ofInjectableTypes(typeElement, type));
} | static Optional<AnnotatedValueResolver> function(AnnotatedElement annotatedElement, AnnotatedElement typeElement, Class<?> type, Set<String> pathParams, List<RequestObjectResolver> objectResolvers) { requireNonNull(annotatedElement, STR); requireNonNull(typeElement, STR); requireNonNull(type, "type"); requireNonNull(pathParams, STR); requireNonNull(objectResolvers, STR); final Param param = annotatedElement.getAnnotation(Param.class); if (param != null) { final String name = findName(param, typeElement); if (pathParams.contains(name)) { return Optional.of(ofPathVariable(param, name, annotatedElement, typeElement, type)); } else { return Optional.of(ofHttpParameter(param, name, annotatedElement, typeElement, type)); } } final Header header = annotatedElement.getAnnotation(Header.class); if (header != null) { return Optional.of(ofHeader(header, annotatedElement, typeElement, type)); } final RequestObject requestObject = annotatedElement.getAnnotation(RequestObject.class); if (requestObject != null) { return Optional.of(ofRequestObject(requestObject, annotatedElement, type, pathParams, objectResolvers)); } } | /**
* Creates a new {@link AnnotatedValueResolver} instance if the specified {@code annotatedElement} is
* a component of {@link AnnotatedHttpService}.
*
* @param annotatedElement an element which is annotated with a value specifier such as {@link Param} and
* {@link Header}.
* @param typeElement an element which is used for retrieving its type and name.
* @param type a type of the given {@link Parameter} or {@link Field}. It is a type of
* the specified {@code typeElement} parameter.
* @param pathParams a set of path variables.
* @param objectResolvers a list of {@link RequestObjectResolver} to be evaluated for the objects which
* are annotated with {@link RequestObject} annotation.
*/ | Creates a new <code>AnnotatedValueResolver</code> instance if the specified annotatedElement is a component of <code>AnnotatedHttpService</code> | of | {
"repo_name": "jmostella/armeria",
"path": "core/src/main/java/com/linecorp/armeria/server/AnnotatedValueResolver.java",
"license": "apache-2.0",
"size": 48024
} | [
"com.linecorp.armeria.server.AnnotatedElementNameUtil",
"com.linecorp.armeria.server.annotation.Header",
"com.linecorp.armeria.server.annotation.Param",
"com.linecorp.armeria.server.annotation.RequestObject",
"java.lang.reflect.AnnotatedElement",
"java.util.List",
"java.util.Objects",
"java.util.Optio... | import com.linecorp.armeria.server.AnnotatedElementNameUtil; import com.linecorp.armeria.server.annotation.Header; import com.linecorp.armeria.server.annotation.Param; import com.linecorp.armeria.server.annotation.RequestObject; import java.lang.reflect.AnnotatedElement; import java.util.List; import java.util.Objects; import java.util.Optional; import java.util.Set; | import com.linecorp.armeria.server.*; import com.linecorp.armeria.server.annotation.*; import java.lang.reflect.*; import java.util.*; | [
"com.linecorp.armeria",
"java.lang",
"java.util"
] | com.linecorp.armeria; java.lang; java.util; | 1,287,421 |
public ContractsAndGrantsBillingAward getAward() {
award = SpringContext.getBean(ContractsAndGrantsModuleBillingService.class).updateAwardIfNecessary(proposalNumber, award);
return award;
} | ContractsAndGrantsBillingAward function() { award = SpringContext.getBean(ContractsAndGrantsModuleBillingService.class).updateAwardIfNecessary(proposalNumber, award); return award; } | /**
* Gets the award attribute.
*
* @return Returns the award.
*/ | Gets the award attribute | getAward | {
"repo_name": "bhutchinson/kfs",
"path": "kfs-ar/src/main/java/org/kuali/kfs/module/ar/businessobject/Bill.java",
"license": "agpl-3.0",
"size": 3119
} | [
"org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAward",
"org.kuali.kfs.integration.cg.ContractsAndGrantsModuleBillingService",
"org.kuali.kfs.sys.context.SpringContext"
] | import org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAward; import org.kuali.kfs.integration.cg.ContractsAndGrantsModuleBillingService; import org.kuali.kfs.sys.context.SpringContext; | import org.kuali.kfs.integration.cg.*; import org.kuali.kfs.sys.context.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 2,133,405 |
public void setMosilabInstallation(IMosilabEnvironment env) {
if (mosilabInstallation != null)
mosilabInstallation.removeReferencedBy(this);
mosilabInstallation = env;
if (env != null)
mosilabInstallation.setReferencedBy(this);
} | void function(IMosilabEnvironment env) { if (mosilabInstallation != null) mosilabInstallation.removeReferencedBy(this); mosilabInstallation = env; if (env != null) mosilabInstallation.setReferencedBy(this); } | /**
* set the IMosilabEnvironment of this project
*
* @param env
* the new Environment or null if none
*/ | set the IMosilabEnvironment of this project | setMosilabInstallation | {
"repo_name": "choeger/eModelica",
"path": "src/main/java/de/tuberlin/uebb/emodelica/model/project/impl/MosilabProject.java",
"license": "epl-1.0",
"size": 16771
} | [
"de.tuberlin.uebb.emodelica.model.project.IMosilabEnvironment"
] | import de.tuberlin.uebb.emodelica.model.project.IMosilabEnvironment; | import de.tuberlin.uebb.emodelica.model.project.*; | [
"de.tuberlin.uebb"
] | de.tuberlin.uebb; | 402,834 |
@XmlElement(name="alcanceBloqueio")
@ApiModelProperty(example = "T", value = "Indica o alcance do bloqueio.<br/> Tamanho: 1<br/>T - Total<br/>P - Parcial")
private AlcanceBloqueioEnum alcanceBloqueio = null;
@JsonProperty("tipoBloqueio")
public String getTipoBloqueio() {
return tipoBloqueio;
} | @XmlElement(name=STR) @ApiModelProperty(example = "T", value = STR) AlcanceBloqueioEnum alcanceBloqueio = null; @JsonProperty(STR) public String function() { return tipoBloqueio; } | /**
* Tipo do bloqueio aplicado<br>Tamanho: 100<br/>
* @return tipoBloqueio
**/ | Tipo do bloqueio aplicado<br>Tamanho: 100<br/> | getTipoBloqueio | {
"repo_name": "samuelfac/portalunico.siscomex.gov.br",
"path": "src/main/java/br/gov/siscomex/portalunico/ccta/model/BloqueioConsultaDetalhada.java",
"license": "mit",
"size": 7411
} | [
"com.fasterxml.jackson.annotation.JsonProperty",
"io.swagger.annotations.ApiModelProperty",
"javax.xml.bind.annotation.XmlElement"
] | import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import javax.xml.bind.annotation.XmlElement; | import com.fasterxml.jackson.annotation.*; import io.swagger.annotations.*; import javax.xml.bind.annotation.*; | [
"com.fasterxml.jackson",
"io.swagger.annotations",
"javax.xml"
] | com.fasterxml.jackson; io.swagger.annotations; javax.xml; | 2,461,507 |
private void undeployWhenDeleting(APIEvent apiEvent) throws NotifierException {
Map<String, Environment> gatewayEnvironments = APIUtil.getReadOnlyGatewayEnvironments();
boolean deleted;
String apiId = apiEvent.getUuid();
try {
List<APIRevisionDeployment> test = apiMgtDAO.getAPIRevisionDeploymentsByApiUUID(apiId);
for (APIRevisionDeployment deployment : test) {
String deploymentEnv = deployment.getDeployment();
if (gatewayEnvironments.containsKey(deploymentEnv)) {
ExternalGatewayDeployer deployer = ServiceReferenceHolder.getInstance().getExternalGatewayDeployer
(gatewayEnvironments.get(deploymentEnv).getProvider());
if (deployer != null) {
try {
deleted = deployer.undeploy(apiEvent.getApiName(), apiEvent.getApiVersion(),
apiEvent.getApiContext(), gatewayEnvironments.get(deploymentEnv));
if (!deleted) {
throw new NotifierException("Error while deleting API product from Solace broker");
}
} catch (DeployerException e) {
throw new NotifierException(e.getMessage());
}
}
}
}
} catch (APIManagementException e) {
throw new NotifierException(e.getMessage());
}
} | void function(APIEvent apiEvent) throws NotifierException { Map<String, Environment> gatewayEnvironments = APIUtil.getReadOnlyGatewayEnvironments(); boolean deleted; String apiId = apiEvent.getUuid(); try { List<APIRevisionDeployment> test = apiMgtDAO.getAPIRevisionDeploymentsByApiUUID(apiId); for (APIRevisionDeployment deployment : test) { String deploymentEnv = deployment.getDeployment(); if (gatewayEnvironments.containsKey(deploymentEnv)) { ExternalGatewayDeployer deployer = ServiceReferenceHolder.getInstance().getExternalGatewayDeployer (gatewayEnvironments.get(deploymentEnv).getProvider()); if (deployer != null) { try { deleted = deployer.undeploy(apiEvent.getApiName(), apiEvent.getApiVersion(), apiEvent.getApiContext(), gatewayEnvironments.get(deploymentEnv)); if (!deleted) { throw new NotifierException(STR); } } catch (DeployerException e) { throw new NotifierException(e.getMessage()); } } } } } catch (APIManagementException e) { throw new NotifierException(e.getMessage()); } } | /**
* Undeploy APIs from external gateway when API is deleted
*
* @param apiEvent APIEvent to undeploy APIs from external gateway
* @throws NotifierException if error occurs when undeploying APIs from external gateway
*/ | Undeploy APIs from external gateway when API is deleted | undeployWhenDeleting | {
"repo_name": "ruks/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/notifier/ExternallyDeployedApiNotifier.java",
"license": "apache-2.0",
"size": 6852
} | [
"java.util.List",
"java.util.Map",
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.api.model.APIRevisionDeployment",
"org.wso2.carbon.apimgt.api.model.Environment",
"org.wso2.carbon.apimgt.impl.deployer.ExternalGatewayDeployer",
"org.wso2.carbon.apimgt.impl.deployer.exceptio... | import java.util.List; import java.util.Map; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.APIRevisionDeployment; import org.wso2.carbon.apimgt.api.model.Environment; import org.wso2.carbon.apimgt.impl.deployer.ExternalGatewayDeployer; import org.wso2.carbon.apimgt.impl.deployer.exceptions.DeployerException; import org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder; import org.wso2.carbon.apimgt.impl.notifier.events.APIEvent; import org.wso2.carbon.apimgt.impl.notifier.exceptions.NotifierException; import org.wso2.carbon.apimgt.impl.utils.APIUtil; | import java.util.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.deployer.*; import org.wso2.carbon.apimgt.impl.deployer.exceptions.*; import org.wso2.carbon.apimgt.impl.internal.*; import org.wso2.carbon.apimgt.impl.notifier.events.*; import org.wso2.carbon.apimgt.impl.notifier.exceptions.*; import org.wso2.carbon.apimgt.impl.utils.*; | [
"java.util",
"org.wso2.carbon"
] | java.util; org.wso2.carbon; | 2,700,750 |
private void checkBounds(
final int myOffset,
final int otherLength,
final int otherOffset,
final int count) {
Preconditions.checkArgument(count >= 0);
Preconditions.checkArgument(myOffset >= 0);
Preconditions.checkArgument(otherOffset >= 0);
Preconditions.checkArgument(myOffset + count <= mSize);
Preconditions.checkArgument(otherOffset + count <= otherLength);
} | void function( final int myOffset, final int otherLength, final int otherOffset, final int count) { Preconditions.checkArgument(count >= 0); Preconditions.checkArgument(myOffset >= 0); Preconditions.checkArgument(otherOffset >= 0); Preconditions.checkArgument(myOffset + count <= mSize); Preconditions.checkArgument(otherOffset + count <= otherLength); } | /**
* Check that copy/read/write operation won't access memory it should not
*/ | Check that copy/read/write operation won't access memory it should not | checkBounds | {
"repo_name": "s1rius/fresco",
"path": "imagepipeline/src/main/java/com/facebook/imagepipeline/memory/NativeMemoryChunk.java",
"license": "mit",
"size": 9026
} | [
"com.facebook.common.internal.Preconditions"
] | import com.facebook.common.internal.Preconditions; | import com.facebook.common.internal.*; | [
"com.facebook.common"
] | com.facebook.common; | 2,558,989 |
public T secureXML(String secureTag, boolean secureTagContents, String passPhrase) {
XMLSecurityDataFormat xsdf = new XMLSecurityDataFormat(secureTag, secureTagContents, passPhrase);
return dataFormat(xsdf);
} | T function(String secureTag, boolean secureTagContents, String passPhrase) { XMLSecurityDataFormat xsdf = new XMLSecurityDataFormat(secureTag, secureTagContents, passPhrase); return dataFormat(xsdf); } | /**
* Uses the XML Security data format
*/ | Uses the XML Security data format | secureXML | {
"repo_name": "kingargyle/turmeric-bot",
"path": "camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java",
"license": "apache-2.0",
"size": 11182
} | [
"org.apache.camel.model.dataformat.XMLSecurityDataFormat"
] | import org.apache.camel.model.dataformat.XMLSecurityDataFormat; | import org.apache.camel.model.dataformat.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,314,202 |
public VirtualNetworkGatewayConnectionListEntityInner withLocalNetworkGateway2(VirtualNetworkConnectionGatewayReference localNetworkGateway2) {
this.localNetworkGateway2 = localNetworkGateway2;
return this;
} | VirtualNetworkGatewayConnectionListEntityInner function(VirtualNetworkConnectionGatewayReference localNetworkGateway2) { this.localNetworkGateway2 = localNetworkGateway2; return this; } | /**
* Set the reference to local network gateway resource.
*
* @param localNetworkGateway2 the localNetworkGateway2 value to set
* @return the VirtualNetworkGatewayConnectionListEntityInner object itself.
*/ | Set the reference to local network gateway resource | withLocalNetworkGateway2 | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_02_01/src/main/java/com/microsoft/azure/management/network/v2019_02_01/implementation/VirtualNetworkGatewayConnectionListEntityInner.java",
"license": "mit",
"size": 16813
} | [
"com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkConnectionGatewayReference"
] | import com.microsoft.azure.management.network.v2019_02_01.VirtualNetworkConnectionGatewayReference; | import com.microsoft.azure.management.network.v2019_02_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 989,028 |
public static byte [] getKeyIdentifier(Key key) {
// Works on symmetric and public.
return CCNDigestHelper.digest(key.getEncoded());
}
| static byte [] function(Key key) { return CCNDigestHelper.digest(key.getEncoded()); } | /**
* Returns the digest of a specified key.
* @param key the key.
* @return the digest.
*/ | Returns the digest of a specified key | getKeyIdentifier | {
"repo_name": "StefanoSalsano/alien-ofelia-conet-ccnx",
"path": "javasrc/src/org/ccnx/ccn/impl/security/keys/SecureKeyCache.java",
"license": "lgpl-2.1",
"size": 17495
} | [
"java.security.Key",
"org.ccnx.ccn.impl.security.crypto.CCNDigestHelper"
] | import java.security.Key; import org.ccnx.ccn.impl.security.crypto.CCNDigestHelper; | import java.security.*; import org.ccnx.ccn.impl.security.crypto.*; | [
"java.security",
"org.ccnx.ccn"
] | java.security; org.ccnx.ccn; | 947,620 |
public void setPatternList(List patternList) {
this.mPatternList = patternList;
Vector childNames = getPatternNames();
mChildPattern.updateComboBoxEntries(childNames, childNames);
} | void function(List patternList) { this.mPatternList = patternList; Vector childNames = getPatternNames(); mChildPattern.updateComboBoxEntries(childNames, childNames); } | /**
* For the child pattern box, the list is set here.
*
*/ | For the child pattern box, the list is set here | setPatternList | {
"repo_name": "iwabuchiken/freemind_1.0.0_20140624_214725",
"path": "freemind/modes/mindmapmode/dialogs/StylePatternFrame.java",
"license": "gpl-2.0",
"size": 25538
} | [
"java.util.List",
"java.util.Vector"
] | import java.util.List; import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 1,948,952 |
private void saveLocaleLocked(Locale l, boolean isDiff, boolean isPersist) {
if(isDiff) {
SystemProperties.set("user.language", l.getLanguage());
SystemProperties.set("user.region", l.getCountry());
}
if(isPersist) {
SystemProperties.set("persist.sys.language", l.getLanguage());
SystemProperties.set("persist.sys.country", l.getCountry());
SystemProperties.set("persist.sys.localevar", l.getVariant());
mHandler.sendMessage(mHandler.obtainMessage(SEND_LOCALE_TO_MOUNT_DAEMON_MSG, l));
}
} | void function(Locale l, boolean isDiff, boolean isPersist) { if(isDiff) { SystemProperties.set(STR, l.getLanguage()); SystemProperties.set(STR, l.getCountry()); } if(isPersist) { SystemProperties.set(STR, l.getLanguage()); SystemProperties.set(STR, l.getCountry()); SystemProperties.set(STR, l.getVariant()); mHandler.sendMessage(mHandler.obtainMessage(SEND_LOCALE_TO_MOUNT_DAEMON_MSG, l)); } } | /**
* Save the locale. You must be inside a synchronized (this) block.
*/ | Save the locale. You must be inside a synchronized (this) block | saveLocaleLocked | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java",
"license": "gpl-3.0",
"size": 864752
} | [
"android.os.SystemProperties",
"java.util.Locale"
] | import android.os.SystemProperties; import java.util.Locale; | import android.os.*; import java.util.*; | [
"android.os",
"java.util"
] | android.os; java.util; | 2,059,516 |
public String declare(VariableRef initialValueRef) {
String valueExpr = cast(initialValueRef);
declared = true;
return format("\n%s %s = %s", typeName(), name(), valueExpr);
}
| String function(VariableRef initialValueRef) { String valueExpr = cast(initialValueRef); declared = true; return format(STR, typeName(), name(), valueExpr); } | /**
* Returns Java code which declares this variable, initialized with the
* provided value.
*
* @param initialValueRef the VariableRef instance which describes the
* initial value of the receiver
* @return the code which declares this variable, and explicitly assigns the
* provided value.
*/ | Returns Java code which declares this variable, initialized with the provided value | declare | {
"repo_name": "Log10Solutions/orika",
"path": "core/src/main/java/ma/glasnost/orika/impl/generator/VariableRef.java",
"license": "apache-2.0",
"size": 30668
} | [
"java.lang.String"
] | import java.lang.String; | import java.lang.*; | [
"java.lang"
] | java.lang; | 2,123,896 |
EReference getConfiguration_Configuration();
| EReference getConfiguration_Configuration(); | /**
* Returns the meta object for the containment reference list '{@link org.nasdanika.config.Configuration#getConfiguration <em>Configuration</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>Configuration</em>'.
* @see org.nasdanika.config.Configuration#getConfiguration()
* @see #getConfiguration()
* @generated
*/ | Returns the meta object for the containment reference list '<code>org.nasdanika.config.Configuration#getConfiguration Configuration</code>'. | getConfiguration_Configuration | {
"repo_name": "Nasdanika/config",
"path": "org.nasdanika.config/src/org/nasdanika/config/ConfigPackage.java",
"license": "epl-1.0",
"size": 46985
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,151,618 |
protected void onBindHeaderViewHolder(RecyclerView.ViewHolder holder, int position) {
} | void function(RecyclerView.ViewHolder holder, int position) { } | /**
* Override this method to update your headers
*
* @param holder view getHolder
* @param position header position
*/ | Override this method to update your headers | onBindHeaderViewHolder | {
"repo_name": "e16din/SimpleRecycler",
"path": "library/src/main/java/com/e16din/simplerecycler/adapter/SimpleInsertsAdapter.java",
"license": "mit",
"size": 24133
} | [
"android.support.v7.widget.RecyclerView"
] | import android.support.v7.widget.RecyclerView; | import android.support.v7.widget.*; | [
"android.support"
] | android.support; | 1,751,922 |
@Override
public void hsync() throws IOException {
if (out instanceof Syncable) {
flush();
((Syncable) out).hsync();
} else {
if (!downgradeSyncable) {
throw new UnsupportedOperationException("hsync not supported by "
+ out);
} else {
flush();
}
}
} | void function() throws IOException { if (out instanceof Syncable) { flush(); ((Syncable) out).hsync(); } else { if (!downgradeSyncable) { throw new UnsupportedOperationException(STR + out); } else { flush(); } } } | /**
* If the inner stream is Syncable, flush the buffer and then
* invoke the inner stream's hsync() operation.
*
* Otherwise: throw an exception, unless the stream was constructed with
* {@link #downgradeSyncable} set to true, in which case the stream
* is just flushed.
* @throws IOException IO Problem
* @throws UnsupportedOperationException if the inner class is not syncable
*/ | If the inner stream is Syncable, flush the buffer and then invoke the inner stream's hsync() operation. Otherwise: throw an exception, unless the stream was constructed with <code>#downgradeSyncable</code> set to true, in which case the stream is just flushed | hsync | {
"repo_name": "mapr/hadoop-common",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/statistics/BufferedIOStatisticsOutputStream.java",
"license": "apache-2.0",
"size": 4955
} | [
"java.io.IOException",
"org.apache.hadoop.fs.Syncable"
] | import java.io.IOException; import org.apache.hadoop.fs.Syncable; | import java.io.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 482,219 |
public void destroy(@Observes BeforeShutdown shut) {
this.contexts.forEach((c) -> c.destroy());
this.registrations.stream().
forEach((s) -> {
try {
s.unregister();
} catch (Exception exc) {}
});
} | void function(@Observes BeforeShutdown shut) { this.contexts.forEach((c) -> c.destroy()); this.registrations.stream(). forEach((s) -> { try { s.unregister(); } catch (Exception exc) {} }); } | /**
* Destroy this extension. Removes the scope services.
*
* @param shut The shutdown event
*/ | Destroy this extension. Removes the scope services | destroy | {
"repo_name": "arievanwi/osgi.ee",
"path": "osgi.ee.extender.cdi/src/osgi/extender/cdi/extension/ScopeExtension.java",
"license": "apache-2.0",
"size": 5073
} | [
"javax.enterprise.event.Observes",
"javax.enterprise.inject.spi.BeforeShutdown"
] | import javax.enterprise.event.Observes; import javax.enterprise.inject.spi.BeforeShutdown; | import javax.enterprise.event.*; import javax.enterprise.inject.spi.*; | [
"javax.enterprise"
] | javax.enterprise; | 2,776,397 |
public boolean isCompatibleStream(InputStream is)
throws StreamCorruptedException {
for (int i=0; i<magicNumbers.length; i++) {
if (magicNumbers[i].isMatch(is)) {
return true;
}
}
return false;
} | boolean function(InputStream is) throws StreamCorruptedException { for (int i=0; i<magicNumbers.length; i++) { if (magicNumbers[i].isMatch(is)) { return true; } } return false; } | /**
* Check if the stream contains an image that can be
* handled by this format handler
*/ | Check if the stream contains an image that can be handled by this format handler | isCompatibleStream | {
"repo_name": "Squeegee/batik",
"path": "sources/org/apache/batik/ext/awt/image/spi/MagicNumberRegistryEntry.java",
"license": "apache-2.0",
"size": 11278
} | [
"java.io.InputStream",
"java.io.StreamCorruptedException"
] | import java.io.InputStream; import java.io.StreamCorruptedException; | import java.io.*; | [
"java.io"
] | java.io; | 2,400,463 |
public int execute() {
int instruction = bus.readUnsignedByteAsInt(pc);
int address;
int value;
int lo, hi;
// Gdx.app.debug(getClass().getSimpleName(), "****************************************************************");
// Gdx.app.debug(getClass().getSimpleName(), "Executing opcode: " + Integer.toHexString(instruction));
switch(instruction) {
//adc
case 0x69: //adc #
value = bus.readUnsignedByteAsInt(++pc);
a += value + status_carry;
//Check for overflow
if (a > 0xff) {
status_carry = 1;
a -= 0x100;
} else {
status_carry = 0;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc++;
break;
case 0x65: //adc zp
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
a += value + status_carry;
//Check for overflow
if (a > 0xff) {
status_carry = 1;
a -= 0x100;
} else {
status_carry = 0;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc++;
break;
case 0x75: //adc zp,x
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
a += value + status_carry;
//Check for overflow
if (a > 0xff) {
status_carry = 1;
a -= 0x100;
} else {
status_carry = 0;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc++;
break;
case 0x6d: //adc abs
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
a += value + status_carry;
//Check for overflow
if (a > 0xff) {
status_carry = 1;
a -= 0x100;
} else {
status_carry = 0;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc += 2;
break;
case 0x7d: //adc abs,x
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
a += value + status_carry;
//Check for overflow
if (a > 0xff) {
status_carry = 1;
a -= 0x100;
} else {
status_carry = 0;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc += 2;
break;
case 0x79: //adc abs,y
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + y);
a += value + status_carry;
//Check for overflow
if (a > 0xff) {
status_carry = 1;
a -= 0x100;
} else {
status_carry = 0;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc += 2;
break;
case 0x61: //adc (indirect,x)
throw new RuntimeException("adc (indirect,x) not implemented!");
case 0x71: //adc (indirect),y
address = bus.readUnsignedByteAsInt(++pc);
address = bus.readUnsignedWordAsInt(address);
value = bus.readUnsignedByteAsInt(address + y);
a += value + status_carry;
//Check for overflow
if (a > 0xff) {
status_carry = 1;
a -= 0x100;
} else {
status_carry = 0;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc++;
break;
//and
case 0x29: //and #
a &= bus.readUnsignedByteAsInt(++pc);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0x25: //and zp
address = bus.readUnsignedByteAsInt(++pc);
a &= bus.readUnsignedByteAsInt(address);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0x35: //and zp,x
address = bus.readUnsignedByteAsInt(++pc);
a &= bus.readUnsignedByteAsInt(address + x);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0x2d: //and abs
address = bus.readUnsignedWordAsInt(++pc);
a &= bus.readUnsignedByteAsInt(address);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc += 2;
break;
case 0x3d: //and abs,x
address = bus.readUnsignedWordAsInt(++pc);
a &= bus.readUnsignedByteAsInt(address + x);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc += 2;
break;
case 0x39: //and abs,y
address = bus.readUnsignedWordAsInt(++pc);
a &= bus.readUnsignedByteAsInt(address + y);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc += 2;
break;
case 0x21: //and (indirect,x)
throw new RuntimeException("and (indirect,x) not implemented!");
case 0x31: //and (indirect),y
address = bus.readUnsignedByteAsInt(++pc);
address = bus.readUnsignedWordAsInt(address);
a &= bus.readUnsignedByteAsInt(address + y);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
//asl
case 0x0a: //asl a
a <<= 1;
status_carry = (a & 0x100) >> 8;
a &= 0xff;
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0x06: //asl zp
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
value <<= 1;
status_carry = (value & 0x100) >> 8;
value &= 0xff;
status_negative = (value & 0x80) == 0x80;
status_zero = a == 0;
bus.writeIntAsByte(address, value);
pc++;
break;
case 0x16: //asl zp,x
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
value <<= 1;
status_carry = (value & 0x100) >> 8;
value &= 0xff;
status_negative = (value & 0x80) == 0x80;
status_zero = a == 0;
bus.writeIntAsByte(address + x, value);
pc++;
break;
case 0x0e: //asl abs
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
value <<= 1;
status_carry = (value & 0x100) >> 8;
value &= 0xff;
status_negative = (value & 0x80) == 0x80;
status_zero = a == 0;
bus.writeIntAsByte(address, value);
pc += 2;
break;
case 0x1e: //asl abs,x
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
value <<= 1;
status_carry = (value & 0x100) >> 8;
value &= 0xff;
status_negative = (value & 0x80) == 0x80;
status_zero = a == 0;
bus.writeIntAsByte(address + x, value);
pc += 2;
break;
//bcc
case 0x90:
if (status_carry == 0) {
pc += bus.readSignedByte(++pc);
}
pc += 2;
break;
//bcs
case 0xb0:
if (status_carry == 1) {
pc += bus.readSignedByte(++pc);
}
pc += 2;
break;
//beq
case 0xf0:
if (status_zero) {
pc += bus.readSignedByte(++pc);
}
pc += 2;
break;
//bit
case 0x24: //bit zp
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
status_zero = (value & a) == 0;
status_negative = (value & 0x80) == 0x80;
status_overflow = (value & 0x40) == 0x40;
pc++;
break;
case 0x2c: //bit abs
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
status_zero = (value & a) == 0;
status_negative = (value & 0x80) == 0x80;
status_overflow = (value & 0x40) == 0x40;
pc += 2;
break;
//bmi
case 0x30:
if (status_negative) {
pc += bus.readSignedByte(++pc);
}
pc += 2;
break;
//bne
case 0xd0:
if (!status_zero) {
pc += bus.readSignedByte(++pc);
}
pc += 2;
break;
//bpl
case 0x10:
if (!status_negative) {
pc += bus.readSignedByte(++pc);
}
pc += 2;
break;
//brk
case 0x00:
printRegisters();
throw new RuntimeException("brk not implemented!");
//bvc:
case 0x50:
if (!status_overflow) {
pc += bus.readSignedByte(++pc);
}
pc += 2;
break;
//bvs:
case 0x70:
if (status_overflow) {
pc += bus.readSignedByte(++pc);
}
pc += 2;
break;
//clc
case 0x18:
status_carry = 0;
pc++;
break;
//cld
case 0xd8:
status_decimal_mode = false;
pc++;
break;
//cli
case 0x58:
status_interrupt_disable = false;
pc++;
break;
//clv
case 0xb8:
status_overflow = false;
pc++;
break;
//cmp
case 0xc9: //cmp #
value = bus.readUnsignedByteAsInt(++pc);
//Unsigned comparison
if (a >= value) {
status_carry = 1;
} else {
status_carry = 0;
}
//Signed comparison
value = (byte) value;
if ((byte) a >= (byte) value) {
status_negative = false;
} else {
status_negative = true;
}
status_zero = a == (value & 0xff);
pc++;
break;
case 0xc5: //cmp zp
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
//Unsigned comparison
if (a >= value) {
status_carry = 1;
} else {
status_carry = 0;
}
//Signed comparison
value = (byte) value;
if ((byte) a >= (byte) value) {
status_negative = false;
} else {
status_negative = true;
}
status_zero = a == (value & 0xff);
pc++;
break;
case 0xd5: //cmp zp,x
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
//Unsigned comparison
if (a >= value) {
status_carry = 1;
} else {
status_carry = 0;
}
//Signed comparison
value = (byte) value;
if ((byte) a >= (byte) value) {
status_negative = false;
} else {
status_negative = true;
}
status_zero = a == (value & 0xff);
pc++;
break;
case 0xcd: //cmp abs
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
//Unsigned comparison
if (a >= value) {
status_carry = 1;
} else {
status_carry = 0;
}
//Signed comparison
value = (byte) value;
if ((byte) a >= (byte) value) {
status_negative = false;
} else {
status_negative = true;
}
status_zero = a == (value & 0xff);
pc += 2;
break;
case 0xdd: //cmp abs,x
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
//Unsigned comparison
if (a >= value) {
status_carry = 1;
} else {
status_carry = 0;
}
//Signed comparison
value = (byte) value;
if ((byte) a >= (byte) value) {
status_negative = false;
} else {
status_negative = true;
}
status_zero = a == (value & 0xff);
pc += 2;
break;
case 0xd9: //cmp abs,y
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + y);
//Unsigned comparison
if (a >= value) {
status_carry = 1;
} else {
status_carry = 0;
}
//Signed comparison
value = (byte) value;
if ((byte) a >= (byte) value) {
status_negative = false;
} else {
status_negative = true;
}
status_zero = a == (value & 0xff);
pc += 2;
break;
case 0xc1: //cmp (indirect,x)
throw new RuntimeException("cmp (indirect,x) not implemented!");
case 0xd1: //cmp (indirect),y
address = bus.readUnsignedByteAsInt(++pc);
address = bus.readUnsignedWordAsInt(address);
value = bus.readUnsignedByteAsInt(address + y);
//Unsigned comparison
if (a >= value) {
status_carry = 1;
} else {
status_carry = 0;
}
//Signed comparison
value = (byte) value;
if ((byte) a >= (byte) value) {
status_negative = false;
} else {
status_negative = true;
}
status_zero = a == (value & 0xff);
pc++;
break;
//cpx
case 0xe0: //cpx #
value = bus.readUnsignedByteAsInt(++pc);
//Unsigned comparison
if (x >= value) {
status_carry = 1;
} else {
status_carry = 0;
}
//Signed comparison
value = (byte) value;
if ((byte) x >= (byte) value) {
status_negative = false;
} else {
status_negative = true;
}
status_zero = x == (value & 0xff);
pc++;
break;
case 0xe4: //cpx zp
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
//Unsigned comparison
if (x >= value) {
status_carry = 1;
} else {
status_carry = 0;
}
//Signed comparison
value = (byte) value;
if ((byte) x >= (byte) value) {
status_negative = false;
} else {
status_negative = true;
}
status_zero = x == (value & 0xff);
pc++;
break;
case 0xec: //cpx abs
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
//Unsigned comparison
if (x >= value) {
status_carry = 1;
} else {
status_carry = 0;
}
//Signed comparison
value = (byte) value;
if ((byte) x >= (byte) value) {
status_negative = false;
} else {
status_negative = true;
}
status_zero = x == (value & 0xff);
pc += 2;
break;
//cpy
case 0xc0: //cpy #
value = bus.readUnsignedByteAsInt(++pc);
//Unsigned comparison
if (y >= value) {
status_carry = 1;
} else {
status_carry = 0;
}
//Signed comparison
value = (byte) value;
if ((byte) y >= (byte) value) {
status_negative = false;
} else {
status_negative = true;
}
status_zero = y == (value & 0xff);
pc++;
break;
case 0xc4: //cpy zp
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
//Unsigned comparison
if (y >= value) {
status_carry = 1;
} else {
status_carry = 0;
}
//Signed comparison
value = (byte) value;
if ((byte) y >= (byte) value) {
status_negative = false;
} else {
status_negative = true;
}
status_zero = y == (value & 0xff);
pc++;
break;
case 0xcc: //cpy abs
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
//Unsigned comparison
if (y >= value) {
status_carry = 1;
} else {
status_carry = 0;
}
//Signed comparison
value = (byte) value;
if ((byte) y >= (byte) value) {
status_negative = false;
} else {
status_negative = true;
}
status_zero = y == (value & 0xff);
pc += 2;
break;
//dec
case 0xc6: //dec zp
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address) - 1;
value &= 0xff;
status_zero = value == 0;
status_negative = (value & 0x80) == 0x80;
bus.writeIntAsByte(address, value);
pc++;
break;
case 0xd6: //dec zp,x
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x) - 1;
value &= 0xff;
status_zero = value == 0;
status_negative = (value & 0x80) == 0x80;
bus.writeIntAsByte(address + x, value);
pc++;
break;
case 0xce: //dec abs
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address) - 1;
value &= 0xff;
status_zero = value == 0;
status_negative = (value & 0x80) == 0x80;
bus.writeIntAsByte(address, value);
pc += 2;
break;
case 0xde: //dec abs,x
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x) - 1;
value &= 0xff;
status_zero = value == 0;
status_negative = (value & 0x80) == 0x80;
bus.writeIntAsByte(address + x, value);
pc += 2;
break;
//dex
case 0xca:
x--;
x &= 0xff;
status_zero = x == 0;
status_negative = (x & 0x80) == 0x80;
pc++;
break;
//dey
case 0x88:
y--;
y &= 0xff;
status_zero = y == 0;
status_negative = (y & 0x80) == 0x80;
pc++;
break;
//eor:
case 0x49: //eor #
a ^= bus.readUnsignedByteAsInt(++pc);
status_zero = a == 0;
status_negative = (a & 0x80) == 0x80;
pc++;
break;
case 0x45: //eor zp
address = bus.readUnsignedByteAsInt(++pc);
a ^= bus.readUnsignedByteAsInt(address);
status_zero = a == 0;
status_negative = (a & 0x80) == 0x80;
pc++;
break;
case 0x55: //eor zp,x
address = bus.readUnsignedByteAsInt(++pc);
a ^= bus.readUnsignedByteAsInt(address + x);
status_zero = a == 0;
status_negative = (a & 0x80) == 0x80;
pc++;
break;
case 0x4d: //eor abs
address = bus.readUnsignedWordAsInt(++pc);
a ^= bus.readUnsignedByteAsInt(address);
status_zero = a == 0;
status_negative = (a & 0x80) == 0x80;
pc += 2;
break;
case 0x5d: //eor abs,x
address = bus.readUnsignedWordAsInt(++pc);
a ^= bus.readUnsignedByteAsInt(address + x);
status_zero = a == 0;
status_negative = (a & 0x80) == 0x80;
pc += 2;
break;
case 0x59: //eor abs,y
address = bus.readUnsignedWordAsInt(++pc);
a ^= bus.readUnsignedByteAsInt(address + y);
status_zero = a == 0;
status_negative = (a & 0x80) == 0x80;
pc += 2;
break;
case 0x41: //eor (indirect,x)
throw new RuntimeException("eor (indirect,x) not implemented!");
case 0x51: //eor (indirect),y
address = bus.readUnsignedByteAsInt(++pc);
address = bus.readUnsignedWordAsInt(address);
a ^= bus.readUnsignedByteAsInt(address + y);
status_zero = a == 0;
status_negative = (a & 0x80) == 0x80;
pc++;
break;
//inc
case 0xe6: //inc zp
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address) + 1;
value &= 0xff;
status_zero = value == 0;
status_negative = (value & 0x80) == 0x80;
bus.writeIntAsByte(address, value);
pc++;
break;
case 0xf6: //inc zp,x
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x) + 1;
value &= 0xff;
status_zero = value == 0;
status_negative = (value & 0x80) == 0x80;
bus.writeIntAsByte(address + x, value);
pc++;
break;
case 0xee: //inc abs
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address) + 1;
value &= 0xff;
status_zero = value == 0;
status_negative = (value & 0x80) == 0x80;
bus.writeIntAsByte(address, value);
pc += 2;
break;
case 0xfe: //inc abs,x
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x) + 1;
value &= 0xff;
status_zero = value == 0;
status_negative = (value & 0x80) == 0x80;
bus.writeIntAsByte(address + x, value);
pc += 2;
break;
//inx
case 0xe8:
x++;
x &= 0xff;
status_zero = x == 0;
status_negative = (x & 0x80) == 0x80;
pc++;
break;
//iny
case 0xc8:
y++;
y &= 0xff;
status_zero = y == 0;
status_negative = (y & 0x80) == 0x80;
pc++;
break;
//jmp
case 0x4c: //jmp abs
address = bus.readUnsignedWordAsInt(++pc);
pc = address;
break;
case 0x6c: //jmp (indirect)
address = bus.readUnsignedWordAsInt(++pc);
address = bus.readUnsignedWordAsInt(address);
pc = address;
break;
//jsr
case 0x20:
int returnPoint = pc + 2;
lo = returnPoint & 0xff;
hi = (returnPoint & 0xff00) >> 8;
bus.writeIntAsByte(postDecSp(), hi);
bus.writeIntAsByte(postDecSp(), lo);
pc = bus.readUnsignedWordAsInt(++pc);
break;
//lda
case 0xa9: //lda #
a = bus.readUnsignedByteAsInt(++pc);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0xa5: //lda zp
address = bus.readUnsignedByteAsInt(++pc);
a = bus.readUnsignedByteAsInt(address);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0xb5: //lda zp,x
address = bus.readUnsignedByteAsInt(++pc);
a = bus.readUnsignedByteAsInt(address + x);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0xad: //lda abs
address = bus.readUnsignedWordAsInt(++pc);
a = bus.readUnsignedByteAsInt(address);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc += 2;
break;
case 0xbd: //lda abs,x
address = bus.readUnsignedWordAsInt(++pc);
a = bus.readUnsignedByteAsInt(address + x);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc += 2;
break;
case 0xb9: //lda abs,y
address = bus.readUnsignedWordAsInt(++pc);
a = bus.readUnsignedByteAsInt(address + y);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc += 2;
break;
case 0xa1: //lda (indirect,x)
address = bus.readUnsignedByteAsInt(++pc);
address = bus.readUnsignedWordAsInt(address + x);
a = bus.readUnsignedByteAsInt(address);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0xb1: // lda (indirect),y
address = bus.readUnsignedByteAsInt(++pc);
address = bus.readUnsignedWordAsInt(address);
a = bus.readUnsignedByteAsInt(address + y);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
//ldx
case 0xa2: //ldx #
x = bus.readUnsignedByteAsInt(++pc);
status_negative = (x & 0x80) == 0x80;
status_zero = x == 0;
pc++;
break;
case 0xa6: //ldx zp
address = bus.readUnsignedByteAsInt(++pc);
x = bus.readUnsignedByteAsInt(address);
status_negative = (x & 0x80) == 0x80;
status_zero = x == 0;
pc++;
break;
case 0xb6: //ldx zp,y
address = bus.readUnsignedByteAsInt(++pc);
x = bus.readUnsignedByteAsInt(address + y);
status_negative = (x & 0x80) == 0x80;
status_zero = x == 0;
pc++;
break;
case 0xae: //ldx abs
address = bus.readUnsignedWordAsInt(++pc);
x = bus.readUnsignedByteAsInt(address);
status_negative = (x & 0x80) == 0x80;
status_zero = x == 0;
pc += 2;
break;
case 0xbe: //ldx abs,y
address = bus.readUnsignedWordAsInt(++pc);
x = bus.readUnsignedByteAsInt(address + y);
status_negative = (x & 0x80) == 0x80;
status_zero = x == 0;
pc += 2;
break;
//ldy
case 0xa0: //ldy #
y = bus.readUnsignedByteAsInt(++pc);
status_negative = (y & 0x80) == 0x80;
status_zero = y == 0;
pc++;
break;
case 0xa4: //ldy zp
address = bus.readUnsignedByteAsInt(++pc);
y = bus.readUnsignedByteAsInt(address);
status_negative = (y & 0x80) == 0x80;
status_zero = y == 0;
pc++;
break;
case 0xb4: //ldy zp,x
address = bus.readUnsignedByteAsInt(++pc);
y = bus.readUnsignedByteAsInt(address + x);
status_negative = (y & 0x80) == 0x80;
status_zero = y == 0;
pc++;
break;
case 0xac: //ldy abs
address = bus.readUnsignedWordAsInt(++pc);
y = bus.readUnsignedByteAsInt(address);
status_negative = (y & 0x80) == 0x80;
status_zero = y == 0;
pc += 2;
break;
case 0xbc: //ldy abs,x
address = bus.readUnsignedWordAsInt(++pc);
y = bus.readUnsignedByteAsInt(address + x);
status_negative = (y & 0x80) == 0x80;
status_zero = y == 0;
pc += 2;
break;
//lsr
case 0x4a: //lsr a
status_carry = a & 1;
a >>= 1;
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0x46: //lsr zp
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
status_carry = value & 1;
value >>= 1;
bus.writeIntAsByte(address, value);
status_negative = (value & 0x80) == 0x80;
status_zero = value == 0;
pc++;
break;
case 0x56: //lsr zp,x
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
status_carry = value & 1;
value >>= 1;
bus.writeIntAsByte(address + x, value);
status_negative = (value & 0x80) == 0x80;
status_zero = value == 0;
pc++;
break;
case 0x4e: //lsr abs
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
status_carry = value & 1;
value >>= 1;
bus.writeIntAsByte(address, value);
status_negative = (value & 0x80) == 0x80;
status_zero = value == 0;
pc += 2;
break;
case 0x5e: //lsr abs,x
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
status_carry = value & 1;
value >>= 1;
bus.writeIntAsByte(address + x, value);
status_negative = (value & 0x80) == 0x80;
status_zero = value == 0;
pc += 2;
break;
//nop
case 0xea:
pc++;
break;
//ora
case 0x09: //ora #
a |= bus.readUnsignedByteAsInt(++pc);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0x05: //ora zp
address = bus.readUnsignedByteAsInt(++pc);
a |= bus.readUnsignedByteAsInt(address);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0x15: //ora zp,x
address = bus.readUnsignedByteAsInt(++pc);
a |= bus.readUnsignedByteAsInt(address + x);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0x0d: //ora abs
address = bus.readUnsignedWordAsInt(++pc);
a |= bus.readUnsignedByteAsInt(address);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc += 2;
break;
case 0x1d: //ora abs,x
address = bus.readUnsignedWordAsInt(++pc);
a |= bus.readUnsignedByteAsInt(address + x);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc += 2;
break;
case 0x19: //ora abs,y
address = bus.readUnsignedWordAsInt(++pc);
a |= bus.readUnsignedByteAsInt(address + y);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc += 2;
break;
case 0x01: //ora (indirect,x)
throw new RuntimeException("ora (indirect,x) not implemented!");
case 0x11: //ora (indirect),y
address = bus.readUnsignedByteAsInt(++pc);
address = bus.readUnsignedWordAsInt(address);
a |= bus.readUnsignedByteAsInt(address + y);
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
//pha
case 0x48:
bus.writeIntAsByte(postDecSp(), a);
pc++;
break;
//php
case 0x08:
value = 0;
if (status_carry == 1) {
value = (1 << 6);
}
if (status_zero) {
value |= (1 << 5);
}
if (status_interrupt_disable) {
value |= (1 << 4);
}
if (status_decimal_mode) {
value |= (1 << 3);
}
//TODO: Implement break mode flag?
//TODO: This would be 1 << 2 here
if (status_overflow) {
value |= (1 << 1);
}
if (status_negative) {
value |= 1;
}
bus.writeIntAsByte(postDecSp(), value);
pc++;
break;
//pla
case 0x68:
a = bus.readUnsignedByteAsInt(preIncSp());
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
//plp
case 0x28:
value = bus.readUnsignedByteAsInt(preIncSp());
if ((value & (1 << 6)) != 0) {
status_carry = 1;
} else {
status_carry = 0;
}
if ((value & (1 << 5)) != 0) {
status_zero = true;
} else {
status_zero = false;
}
if ((value & (1 << 4)) != 0) {
status_interrupt_disable = true;
} else {
status_interrupt_disable = false;
}
if ((value & (1 << 3)) != 0) {
status_decimal_mode = true;
} else {
status_decimal_mode = false;
}
//TODO: Implement break mode flag?
//TODO: This would be 1 << 2 here
if ((value & (1 << 1)) != 0) {
status_overflow = true;
} else {
status_overflow = false;
}
if ((value & 1) != 0) {
status_negative = true;
} else {
status_negative = false;
}
pc++;
break;
//rol
case 0x2a: //rol a
a <<= 1;
a |= status_carry;
status_carry = (a & (1 << 8)) >> 8;
a &= 0xff;
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0x26: //rol zp
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
value <<= 1;
value |= status_carry;
status_carry = (value & (1 << 8)) >> 8;
value &= 0xff;
status_negative = (value & 0x80) == 0x80;
status_zero = value == 0;
bus.writeIntAsByte(address, value);
pc++;
break;
case 0x36: //rol zp,x
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
value <<= 1;
value |= status_carry;
status_carry = (value & (1 << 8)) >> 8;
value &= 0xff;
status_negative = (value & 0x80) == 0x80;
status_zero = value == 0;
bus.writeIntAsByte(address + x, value);
pc++;
break;
case 0x2e: //rol abs
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
value <<= 1;
value |= status_carry;
status_carry = (value & (1 << 8)) >> 8;
value &= 0xff;
status_negative = (value & 0x80) == 0x80;
status_zero = value == 0;
bus.writeIntAsByte(address, value);
pc += 2;
break;
case 0x3e: //rol abs,x
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
value <<= 1;
value |= status_carry;
status_carry = (value & (1 << 8)) >> 8;
value &= 0xff;
status_negative = (value & 0x80) == 0x80;
status_zero = value == 0;
bus.writeIntAsByte(address + x, value);
pc += 2;
break;
//ror
case 0x6a: //ror a
a |= (status_carry << 8);
status_carry = a & 1;
a >>= 1;
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
case 0x66: //ror zp
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
value |= (status_carry << 8);
status_carry = value & 1;
value >>= 1;
bus.writeIntAsByte(address, value);
status_negative = (value & 0x80) == 0x80;
status_zero = value == 0;
pc++;
break;
case 0x76: //ror zp,x
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
value |= (status_carry << 8);
status_carry = value & 1;
value >>= 1;
bus.writeIntAsByte(address + x, value);
status_negative = (value & 0x80) == 0x80;
status_zero = value == 0;
pc++;
break;
case 0x6e: //ror abs
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
value |= (status_carry << 8);
status_carry = value & 1;
value >>= 1;
bus.writeIntAsByte(address, value);
status_negative = (value & 0x80) == 0x80;
status_zero = value == 0;
pc += 2;
break;
case 0x7e: //ror abs,x
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
value |= (status_carry << 8);
status_carry = value & 1;
value >>= 1;
bus.writeIntAsByte(address + x, value);
status_negative = (value & 0x80) == 0x80;
status_zero = value == 0;
pc += 2;
break;
//rti
case 0x40:
value = bus.readUnsignedByteAsInt(preIncSp());
if ((value & (1 << 6)) != 0) {
status_carry = 1;
} else {
status_carry = 0;
}
if ((value & (1 << 5)) != 0) {
status_zero = true;
} else {
status_zero = false;
}
if ((value & (1 << 4)) != 0) {
status_interrupt_disable = true;
} else {
status_interrupt_disable = false;
}
if ((value & (1 << 3)) != 0) {
status_decimal_mode = true;
} else {
status_decimal_mode = false;
}
//TODO: Implement break mode flag?
//TODO: This would be 1 << 2 here
if ((value & (1 << 1)) != 0) {
status_overflow = true;
} else {
status_overflow = false;
}
if ((value & 1) != 0) {
status_negative = true;
} else {
status_negative = false;
}
lo = bus.readUnsignedByteAsInt(preIncSp());
hi = bus.readUnsignedByteAsInt(preIncSp());
pc = ((hi << 8) | lo) + 1;
break;
//rts
case 0x60:
lo = bus.readUnsignedByteAsInt(preIncSp());
hi = bus.readUnsignedByteAsInt(preIncSp());
pc = ((hi << 8) | lo) + 1;
break;
//sbc
case 0xe9: //sbc #
value = bus.readUnsignedByteAsInt(++pc);
a = a - value - (1 - status_carry);
if (a < 0) {
a &= 0xff;
status_carry = 0;
} else {
status_carry = 1;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc++;
break;
case 0xe5: //sbc zp
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
a = a - value - (1 - status_carry);
if (a < 0) {
a &= 0xff;
status_carry = 0;
} else {
status_carry = 1;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc++;
break;
case 0xf5: //sbc zp,x
address = bus.readUnsignedByteAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
a = a - value - (1 - status_carry);
if (a < 0) {
a &= 0xff;
status_carry = 0;
} else {
status_carry = 1;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc++;
break;
case 0xed: //sbc abs
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address);
a = a - value - (1 - status_carry);
if (a < 0) {
a &= 0xff;
status_carry = 0;
} else {
status_carry = 1;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc += 2;
break;
case 0xfd: //sbc abs,x
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + x);
a = a - value - (1 - status_carry);
if (a < 0) {
a &= 0xff;
status_carry = 0;
} else {
status_carry = 1;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc += 2;
break;
case 0xf9: //sbc abs,y
address = bus.readUnsignedWordAsInt(++pc);
value = bus.readUnsignedByteAsInt(address + y);
a = a - value - (1 - status_carry);
if (a < 0) {
a &= 0xff;
status_carry = 0;
} else {
status_carry = 1;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc += 2;
break;
case 0xe1: //sbc (indirect,x)
throw new RuntimeException("sbc (indirect,x) not implemented!");
case 0xf1: //sbc (indirect),y
address = bus.readUnsignedByteAsInt(++pc);
address = bus.readUnsignedWordAsInt(address);
value = bus.readUnsignedByteAsInt(address + y);
a = a - value - (1 - status_carry);
if (a < 0) {
a &= 0xff;
status_carry = 0;
} else {
status_carry = 1;
}
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
//TODO: Implement overflow flag? I never use it.
pc++;
break;
//sec
case 0x38:
status_carry = 1;
pc++;
break;
//sed
case 0xf8:
status_decimal_mode = true;
pc++;
break;
//sei
case 0x78:
status_interrupt_disable = true;
pc++;
break;
//sta
case 0x85: //sta zp
address = bus.readUnsignedByteAsInt(++pc);
bus.writeIntAsByte(address, a);
pc++;
break;
case 0x95: //sta zp,x
address = bus.readUnsignedByteAsInt(++pc);
bus.writeIntAsByte(address + x, a);
pc++;
break;
case 0x8d: //sta abs
address = bus.readUnsignedWordAsInt(++pc);
bus.writeIntAsByte(address, a);
pc += 2;
break;
case 0x9d: //sta abs,x
address = bus.readUnsignedWordAsInt(++pc);
bus.writeIntAsByte(address + x, a);
pc += 2;
break;
case 0x99: //sta abs,y
address = bus.readUnsignedWordAsInt(++pc);
bus.writeIntAsByte(address + y, a);
pc += 2;
break;
case 0x81: //sta (indirect,x)
throw new RuntimeException("sta (indirect,x) not implemented!");
case 0x91: // sta (indirect),y
address = bus.readUnsignedByteAsInt(++pc);
address = bus.readUnsignedWordAsInt(address);
bus.writeIntAsByte(address + y, a);
pc++;
break;
//stx
case 0x86: //stx zp
address = bus.readUnsignedByteAsInt(++pc);
bus.writeIntAsByte(address, x);
pc++;
break;
case 0x96: //stx zp,y
address = bus.readUnsignedByteAsInt(++pc);
bus.writeIntAsByte(address + y, x);
pc++;
break;
case 0x8e: //stx abs
address = bus.readUnsignedWordAsInt(++pc);
bus.writeIntAsByte(address, x);
pc += 2;
break;
//sty
case 0x84: //sty zp
address = bus.readUnsignedByteAsInt(++pc);
bus.writeIntAsByte(address, y);
pc++;
break;
case 0x94: //sty zp,x
address = bus.readUnsignedByteAsInt(++pc);
bus.writeIntAsByte(address + x, y);
pc++;
break;
case 0x8c: //sty abs
address = bus.readUnsignedWordAsInt(++pc);
bus.writeIntAsByte(address, y);
pc += 2;
break;
//tax
case 0xaa:
x = a;
status_negative = (x & 0x80) == 0x80;
status_zero = x == 0;
pc++;
break;
//tay
case 0xa8:
y = a;
status_negative = (y & 0x80) == 0x80;
status_zero = y == 0;
pc++;
break;
//tsx
case 0xba:
x = sp - 0x100;
status_negative = (x & 0x80) == 0x80;
status_zero = x == 0;
pc++;
break;
//txa
case 0x8a:
a = x;
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
//txs:
case 0x9a:
sp = 0x100 + x;
pc++;
break;
//tya:
case 0x98:
a = y;
status_negative = (a & 0x80) == 0x80;
status_zero = a == 0;
pc++;
break;
default:
printRegisters();
Gdx.app.error(getClass().getSimpleName(), "Instruction: " + instruction + " not implemented.");
throw new RuntimeException("Instruction: " + instruction + " not implemented.");
}
instructionCount++;
return instruction;
}
| int function() { int instruction = bus.readUnsignedByteAsInt(pc); int address; int value; int lo, hi; switch(instruction) { case 0x69: value = bus.readUnsignedByteAsInt(++pc); a += value + status_carry; if (a > 0xff) { status_carry = 1; a -= 0x100; } else { status_carry = 0; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x65: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address); a += value + status_carry; if (a > 0xff) { status_carry = 1; a -= 0x100; } else { status_carry = 0; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x75: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); a += value + status_carry; if (a > 0xff) { status_carry = 1; a -= 0x100; } else { status_carry = 0; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x6d: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address); a += value + status_carry; if (a > 0xff) { status_carry = 1; a -= 0x100; } else { status_carry = 0; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0x7d: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); a += value + status_carry; if (a > 0xff) { status_carry = 1; a -= 0x100; } else { status_carry = 0; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0x79: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address + y); a += value + status_carry; if (a > 0xff) { status_carry = 1; a -= 0x100; } else { status_carry = 0; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0x61: throw new RuntimeException(STR); case 0x71: address = bus.readUnsignedByteAsInt(++pc); address = bus.readUnsignedWordAsInt(address); value = bus.readUnsignedByteAsInt(address + y); a += value + status_carry; if (a > 0xff) { status_carry = 1; a -= 0x100; } else { status_carry = 0; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x29: a &= bus.readUnsignedByteAsInt(++pc); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x25: address = bus.readUnsignedByteAsInt(++pc); a &= bus.readUnsignedByteAsInt(address); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x35: address = bus.readUnsignedByteAsInt(++pc); a &= bus.readUnsignedByteAsInt(address + x); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x2d: address = bus.readUnsignedWordAsInt(++pc); a &= bus.readUnsignedByteAsInt(address); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0x3d: address = bus.readUnsignedWordAsInt(++pc); a &= bus.readUnsignedByteAsInt(address + x); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0x39: address = bus.readUnsignedWordAsInt(++pc); a &= bus.readUnsignedByteAsInt(address + y); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0x21: throw new RuntimeException(STR); case 0x31: address = bus.readUnsignedByteAsInt(++pc); address = bus.readUnsignedWordAsInt(address); a &= bus.readUnsignedByteAsInt(address + y); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x0a: a <<= 1; status_carry = (a & 0x100) >> 8; a &= 0xff; status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x06: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address); value <<= 1; status_carry = (value & 0x100) >> 8; value &= 0xff; status_negative = (value & 0x80) == 0x80; status_zero = a == 0; bus.writeIntAsByte(address, value); pc++; break; case 0x16: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); value <<= 1; status_carry = (value & 0x100) >> 8; value &= 0xff; status_negative = (value & 0x80) == 0x80; status_zero = a == 0; bus.writeIntAsByte(address + x, value); pc++; break; case 0x0e: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address); value <<= 1; status_carry = (value & 0x100) >> 8; value &= 0xff; status_negative = (value & 0x80) == 0x80; status_zero = a == 0; bus.writeIntAsByte(address, value); pc += 2; break; case 0x1e: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); value <<= 1; status_carry = (value & 0x100) >> 8; value &= 0xff; status_negative = (value & 0x80) == 0x80; status_zero = a == 0; bus.writeIntAsByte(address + x, value); pc += 2; break; case 0x90: if (status_carry == 0) { pc += bus.readSignedByte(++pc); } pc += 2; break; case 0xb0: if (status_carry == 1) { pc += bus.readSignedByte(++pc); } pc += 2; break; case 0xf0: if (status_zero) { pc += bus.readSignedByte(++pc); } pc += 2; break; case 0x24: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address); status_zero = (value & a) == 0; status_negative = (value & 0x80) == 0x80; status_overflow = (value & 0x40) == 0x40; pc++; break; case 0x2c: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address); status_zero = (value & a) == 0; status_negative = (value & 0x80) == 0x80; status_overflow = (value & 0x40) == 0x40; pc += 2; break; case 0x30: if (status_negative) { pc += bus.readSignedByte(++pc); } pc += 2; break; case 0xd0: if (!status_zero) { pc += bus.readSignedByte(++pc); } pc += 2; break; case 0x10: if (!status_negative) { pc += bus.readSignedByte(++pc); } pc += 2; break; case 0x00: printRegisters(); throw new RuntimeException(STR); case 0x50: if (!status_overflow) { pc += bus.readSignedByte(++pc); } pc += 2; break; case 0x70: if (status_overflow) { pc += bus.readSignedByte(++pc); } pc += 2; break; case 0x18: status_carry = 0; pc++; break; case 0xd8: status_decimal_mode = false; pc++; break; case 0x58: status_interrupt_disable = false; pc++; break; case 0xb8: status_overflow = false; pc++; break; case 0xc9: value = bus.readUnsignedByteAsInt(++pc); if (a >= value) { status_carry = 1; } else { status_carry = 0; } value = (byte) value; if ((byte) a >= (byte) value) { status_negative = false; } else { status_negative = true; } status_zero = a == (value & 0xff); pc++; break; case 0xc5: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address); if (a >= value) { status_carry = 1; } else { status_carry = 0; } value = (byte) value; if ((byte) a >= (byte) value) { status_negative = false; } else { status_negative = true; } status_zero = a == (value & 0xff); pc++; break; case 0xd5: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); if (a >= value) { status_carry = 1; } else { status_carry = 0; } value = (byte) value; if ((byte) a >= (byte) value) { status_negative = false; } else { status_negative = true; } status_zero = a == (value & 0xff); pc++; break; case 0xcd: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address); if (a >= value) { status_carry = 1; } else { status_carry = 0; } value = (byte) value; if ((byte) a >= (byte) value) { status_negative = false; } else { status_negative = true; } status_zero = a == (value & 0xff); pc += 2; break; case 0xdd: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); if (a >= value) { status_carry = 1; } else { status_carry = 0; } value = (byte) value; if ((byte) a >= (byte) value) { status_negative = false; } else { status_negative = true; } status_zero = a == (value & 0xff); pc += 2; break; case 0xd9: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address + y); if (a >= value) { status_carry = 1; } else { status_carry = 0; } value = (byte) value; if ((byte) a >= (byte) value) { status_negative = false; } else { status_negative = true; } status_zero = a == (value & 0xff); pc += 2; break; case 0xc1: throw new RuntimeException(STR); case 0xd1: address = bus.readUnsignedByteAsInt(++pc); address = bus.readUnsignedWordAsInt(address); value = bus.readUnsignedByteAsInt(address + y); if (a >= value) { status_carry = 1; } else { status_carry = 0; } value = (byte) value; if ((byte) a >= (byte) value) { status_negative = false; } else { status_negative = true; } status_zero = a == (value & 0xff); pc++; break; case 0xe0: value = bus.readUnsignedByteAsInt(++pc); if (x >= value) { status_carry = 1; } else { status_carry = 0; } value = (byte) value; if ((byte) x >= (byte) value) { status_negative = false; } else { status_negative = true; } status_zero = x == (value & 0xff); pc++; break; case 0xe4: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address); if (x >= value) { status_carry = 1; } else { status_carry = 0; } value = (byte) value; if ((byte) x >= (byte) value) { status_negative = false; } else { status_negative = true; } status_zero = x == (value & 0xff); pc++; break; case 0xec: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address); if (x >= value) { status_carry = 1; } else { status_carry = 0; } value = (byte) value; if ((byte) x >= (byte) value) { status_negative = false; } else { status_negative = true; } status_zero = x == (value & 0xff); pc += 2; break; case 0xc0: value = bus.readUnsignedByteAsInt(++pc); if (y >= value) { status_carry = 1; } else { status_carry = 0; } value = (byte) value; if ((byte) y >= (byte) value) { status_negative = false; } else { status_negative = true; } status_zero = y == (value & 0xff); pc++; break; case 0xc4: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address); if (y >= value) { status_carry = 1; } else { status_carry = 0; } value = (byte) value; if ((byte) y >= (byte) value) { status_negative = false; } else { status_negative = true; } status_zero = y == (value & 0xff); pc++; break; case 0xcc: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address); if (y >= value) { status_carry = 1; } else { status_carry = 0; } value = (byte) value; if ((byte) y >= (byte) value) { status_negative = false; } else { status_negative = true; } status_zero = y == (value & 0xff); pc += 2; break; case 0xc6: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address) - 1; value &= 0xff; status_zero = value == 0; status_negative = (value & 0x80) == 0x80; bus.writeIntAsByte(address, value); pc++; break; case 0xd6: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x) - 1; value &= 0xff; status_zero = value == 0; status_negative = (value & 0x80) == 0x80; bus.writeIntAsByte(address + x, value); pc++; break; case 0xce: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address) - 1; value &= 0xff; status_zero = value == 0; status_negative = (value & 0x80) == 0x80; bus.writeIntAsByte(address, value); pc += 2; break; case 0xde: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x) - 1; value &= 0xff; status_zero = value == 0; status_negative = (value & 0x80) == 0x80; bus.writeIntAsByte(address + x, value); pc += 2; break; case 0xca: x--; x &= 0xff; status_zero = x == 0; status_negative = (x & 0x80) == 0x80; pc++; break; case 0x88: y--; y &= 0xff; status_zero = y == 0; status_negative = (y & 0x80) == 0x80; pc++; break; case 0x49: a ^= bus.readUnsignedByteAsInt(++pc); status_zero = a == 0; status_negative = (a & 0x80) == 0x80; pc++; break; case 0x45: address = bus.readUnsignedByteAsInt(++pc); a ^= bus.readUnsignedByteAsInt(address); status_zero = a == 0; status_negative = (a & 0x80) == 0x80; pc++; break; case 0x55: address = bus.readUnsignedByteAsInt(++pc); a ^= bus.readUnsignedByteAsInt(address + x); status_zero = a == 0; status_negative = (a & 0x80) == 0x80; pc++; break; case 0x4d: address = bus.readUnsignedWordAsInt(++pc); a ^= bus.readUnsignedByteAsInt(address); status_zero = a == 0; status_negative = (a & 0x80) == 0x80; pc += 2; break; case 0x5d: address = bus.readUnsignedWordAsInt(++pc); a ^= bus.readUnsignedByteAsInt(address + x); status_zero = a == 0; status_negative = (a & 0x80) == 0x80; pc += 2; break; case 0x59: address = bus.readUnsignedWordAsInt(++pc); a ^= bus.readUnsignedByteAsInt(address + y); status_zero = a == 0; status_negative = (a & 0x80) == 0x80; pc += 2; break; case 0x41: throw new RuntimeException(STR); case 0x51: address = bus.readUnsignedByteAsInt(++pc); address = bus.readUnsignedWordAsInt(address); a ^= bus.readUnsignedByteAsInt(address + y); status_zero = a == 0; status_negative = (a & 0x80) == 0x80; pc++; break; case 0xe6: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address) + 1; value &= 0xff; status_zero = value == 0; status_negative = (value & 0x80) == 0x80; bus.writeIntAsByte(address, value); pc++; break; case 0xf6: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x) + 1; value &= 0xff; status_zero = value == 0; status_negative = (value & 0x80) == 0x80; bus.writeIntAsByte(address + x, value); pc++; break; case 0xee: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address) + 1; value &= 0xff; status_zero = value == 0; status_negative = (value & 0x80) == 0x80; bus.writeIntAsByte(address, value); pc += 2; break; case 0xfe: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x) + 1; value &= 0xff; status_zero = value == 0; status_negative = (value & 0x80) == 0x80; bus.writeIntAsByte(address + x, value); pc += 2; break; case 0xe8: x++; x &= 0xff; status_zero = x == 0; status_negative = (x & 0x80) == 0x80; pc++; break; case 0xc8: y++; y &= 0xff; status_zero = y == 0; status_negative = (y & 0x80) == 0x80; pc++; break; case 0x4c: address = bus.readUnsignedWordAsInt(++pc); pc = address; break; case 0x6c: address = bus.readUnsignedWordAsInt(++pc); address = bus.readUnsignedWordAsInt(address); pc = address; break; case 0x20: int returnPoint = pc + 2; lo = returnPoint & 0xff; hi = (returnPoint & 0xff00) >> 8; bus.writeIntAsByte(postDecSp(), hi); bus.writeIntAsByte(postDecSp(), lo); pc = bus.readUnsignedWordAsInt(++pc); break; case 0xa9: a = bus.readUnsignedByteAsInt(++pc); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0xa5: address = bus.readUnsignedByteAsInt(++pc); a = bus.readUnsignedByteAsInt(address); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0xb5: address = bus.readUnsignedByteAsInt(++pc); a = bus.readUnsignedByteAsInt(address + x); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0xad: address = bus.readUnsignedWordAsInt(++pc); a = bus.readUnsignedByteAsInt(address); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0xbd: address = bus.readUnsignedWordAsInt(++pc); a = bus.readUnsignedByteAsInt(address + x); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0xb9: address = bus.readUnsignedWordAsInt(++pc); a = bus.readUnsignedByteAsInt(address + y); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0xa1: address = bus.readUnsignedByteAsInt(++pc); address = bus.readUnsignedWordAsInt(address + x); a = bus.readUnsignedByteAsInt(address); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0xb1: address = bus.readUnsignedByteAsInt(++pc); address = bus.readUnsignedWordAsInt(address); a = bus.readUnsignedByteAsInt(address + y); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0xa2: x = bus.readUnsignedByteAsInt(++pc); status_negative = (x & 0x80) == 0x80; status_zero = x == 0; pc++; break; case 0xa6: address = bus.readUnsignedByteAsInt(++pc); x = bus.readUnsignedByteAsInt(address); status_negative = (x & 0x80) == 0x80; status_zero = x == 0; pc++; break; case 0xb6: address = bus.readUnsignedByteAsInt(++pc); x = bus.readUnsignedByteAsInt(address + y); status_negative = (x & 0x80) == 0x80; status_zero = x == 0; pc++; break; case 0xae: address = bus.readUnsignedWordAsInt(++pc); x = bus.readUnsignedByteAsInt(address); status_negative = (x & 0x80) == 0x80; status_zero = x == 0; pc += 2; break; case 0xbe: address = bus.readUnsignedWordAsInt(++pc); x = bus.readUnsignedByteAsInt(address + y); status_negative = (x & 0x80) == 0x80; status_zero = x == 0; pc += 2; break; case 0xa0: y = bus.readUnsignedByteAsInt(++pc); status_negative = (y & 0x80) == 0x80; status_zero = y == 0; pc++; break; case 0xa4: address = bus.readUnsignedByteAsInt(++pc); y = bus.readUnsignedByteAsInt(address); status_negative = (y & 0x80) == 0x80; status_zero = y == 0; pc++; break; case 0xb4: address = bus.readUnsignedByteAsInt(++pc); y = bus.readUnsignedByteAsInt(address + x); status_negative = (y & 0x80) == 0x80; status_zero = y == 0; pc++; break; case 0xac: address = bus.readUnsignedWordAsInt(++pc); y = bus.readUnsignedByteAsInt(address); status_negative = (y & 0x80) == 0x80; status_zero = y == 0; pc += 2; break; case 0xbc: address = bus.readUnsignedWordAsInt(++pc); y = bus.readUnsignedByteAsInt(address + x); status_negative = (y & 0x80) == 0x80; status_zero = y == 0; pc += 2; break; case 0x4a: status_carry = a & 1; a >>= 1; status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x46: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address); status_carry = value & 1; value >>= 1; bus.writeIntAsByte(address, value); status_negative = (value & 0x80) == 0x80; status_zero = value == 0; pc++; break; case 0x56: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); status_carry = value & 1; value >>= 1; bus.writeIntAsByte(address + x, value); status_negative = (value & 0x80) == 0x80; status_zero = value == 0; pc++; break; case 0x4e: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address); status_carry = value & 1; value >>= 1; bus.writeIntAsByte(address, value); status_negative = (value & 0x80) == 0x80; status_zero = value == 0; pc += 2; break; case 0x5e: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); status_carry = value & 1; value >>= 1; bus.writeIntAsByte(address + x, value); status_negative = (value & 0x80) == 0x80; status_zero = value == 0; pc += 2; break; case 0xea: pc++; break; case 0x09: a = bus.readUnsignedByteAsInt(++pc); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x05: address = bus.readUnsignedByteAsInt(++pc); a = bus.readUnsignedByteAsInt(address); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x15: address = bus.readUnsignedByteAsInt(++pc); a = bus.readUnsignedByteAsInt(address + x); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x0d: address = bus.readUnsignedWordAsInt(++pc); a = bus.readUnsignedByteAsInt(address); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0x1d: address = bus.readUnsignedWordAsInt(++pc); a = bus.readUnsignedByteAsInt(address + x); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0x19: address = bus.readUnsignedWordAsInt(++pc); a = bus.readUnsignedByteAsInt(address + y); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0x01: throw new RuntimeException(STR); case 0x11: address = bus.readUnsignedByteAsInt(++pc); address = bus.readUnsignedWordAsInt(address); a = bus.readUnsignedByteAsInt(address + y); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x48: bus.writeIntAsByte(postDecSp(), a); pc++; break; case 0x08: value = 0; if (status_carry == 1) { value = (1 << 6); } if (status_zero) { value = (1 << 5); } if (status_interrupt_disable) { value = (1 << 4); } if (status_decimal_mode) { value = (1 << 3); } if (status_overflow) { value = (1 << 1); } if (status_negative) { value = 1; } bus.writeIntAsByte(postDecSp(), value); pc++; break; case 0x68: a = bus.readUnsignedByteAsInt(preIncSp()); status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x28: value = bus.readUnsignedByteAsInt(preIncSp()); if ((value & (1 << 6)) != 0) { status_carry = 1; } else { status_carry = 0; } if ((value & (1 << 5)) != 0) { status_zero = true; } else { status_zero = false; } if ((value & (1 << 4)) != 0) { status_interrupt_disable = true; } else { status_interrupt_disable = false; } if ((value & (1 << 3)) != 0) { status_decimal_mode = true; } else { status_decimal_mode = false; } if ((value & (1 << 1)) != 0) { status_overflow = true; } else { status_overflow = false; } if ((value & 1) != 0) { status_negative = true; } else { status_negative = false; } pc++; break; case 0x2a: a <<= 1; a = status_carry; status_carry = (a & (1 << 8)) >> 8; a &= 0xff; status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x26: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address); value <<= 1; value = status_carry; status_carry = (value & (1 << 8)) >> 8; value &= 0xff; status_negative = (value & 0x80) == 0x80; status_zero = value == 0; bus.writeIntAsByte(address, value); pc++; break; case 0x36: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); value <<= 1; value = status_carry; status_carry = (value & (1 << 8)) >> 8; value &= 0xff; status_negative = (value & 0x80) == 0x80; status_zero = value == 0; bus.writeIntAsByte(address + x, value); pc++; break; case 0x2e: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address); value <<= 1; value = status_carry; status_carry = (value & (1 << 8)) >> 8; value &= 0xff; status_negative = (value & 0x80) == 0x80; status_zero = value == 0; bus.writeIntAsByte(address, value); pc += 2; break; case 0x3e: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); value <<= 1; value = status_carry; status_carry = (value & (1 << 8)) >> 8; value &= 0xff; status_negative = (value & 0x80) == 0x80; status_zero = value == 0; bus.writeIntAsByte(address + x, value); pc += 2; break; case 0x6a: a = (status_carry << 8); status_carry = a & 1; a >>= 1; status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x66: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address); value = (status_carry << 8); status_carry = value & 1; value >>= 1; bus.writeIntAsByte(address, value); status_negative = (value & 0x80) == 0x80; status_zero = value == 0; pc++; break; case 0x76: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); value = (status_carry << 8); status_carry = value & 1; value >>= 1; bus.writeIntAsByte(address + x, value); status_negative = (value & 0x80) == 0x80; status_zero = value == 0; pc++; break; case 0x6e: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address); value = (status_carry << 8); status_carry = value & 1; value >>= 1; bus.writeIntAsByte(address, value); status_negative = (value & 0x80) == 0x80; status_zero = value == 0; pc += 2; break; case 0x7e: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); value = (status_carry << 8); status_carry = value & 1; value >>= 1; bus.writeIntAsByte(address + x, value); status_negative = (value & 0x80) == 0x80; status_zero = value == 0; pc += 2; break; case 0x40: value = bus.readUnsignedByteAsInt(preIncSp()); if ((value & (1 << 6)) != 0) { status_carry = 1; } else { status_carry = 0; } if ((value & (1 << 5)) != 0) { status_zero = true; } else { status_zero = false; } if ((value & (1 << 4)) != 0) { status_interrupt_disable = true; } else { status_interrupt_disable = false; } if ((value & (1 << 3)) != 0) { status_decimal_mode = true; } else { status_decimal_mode = false; } if ((value & (1 << 1)) != 0) { status_overflow = true; } else { status_overflow = false; } if ((value & 1) != 0) { status_negative = true; } else { status_negative = false; } lo = bus.readUnsignedByteAsInt(preIncSp()); hi = bus.readUnsignedByteAsInt(preIncSp()); pc = ((hi << 8) lo) + 1; break; case 0x60: lo = bus.readUnsignedByteAsInt(preIncSp()); hi = bus.readUnsignedByteAsInt(preIncSp()); pc = ((hi << 8) lo) + 1; break; case 0xe9: value = bus.readUnsignedByteAsInt(++pc); a = a - value - (1 - status_carry); if (a < 0) { a &= 0xff; status_carry = 0; } else { status_carry = 1; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0xe5: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address); a = a - value - (1 - status_carry); if (a < 0) { a &= 0xff; status_carry = 0; } else { status_carry = 1; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0xf5: address = bus.readUnsignedByteAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); a = a - value - (1 - status_carry); if (a < 0) { a &= 0xff; status_carry = 0; } else { status_carry = 1; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0xed: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address); a = a - value - (1 - status_carry); if (a < 0) { a &= 0xff; status_carry = 0; } else { status_carry = 1; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0xfd: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address + x); a = a - value - (1 - status_carry); if (a < 0) { a &= 0xff; status_carry = 0; } else { status_carry = 1; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0xf9: address = bus.readUnsignedWordAsInt(++pc); value = bus.readUnsignedByteAsInt(address + y); a = a - value - (1 - status_carry); if (a < 0) { a &= 0xff; status_carry = 0; } else { status_carry = 1; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc += 2; break; case 0xe1: throw new RuntimeException(STR); case 0xf1: address = bus.readUnsignedByteAsInt(++pc); address = bus.readUnsignedWordAsInt(address); value = bus.readUnsignedByteAsInt(address + y); a = a - value - (1 - status_carry); if (a < 0) { a &= 0xff; status_carry = 0; } else { status_carry = 1; } status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x38: status_carry = 1; pc++; break; case 0xf8: status_decimal_mode = true; pc++; break; case 0x78: status_interrupt_disable = true; pc++; break; case 0x85: address = bus.readUnsignedByteAsInt(++pc); bus.writeIntAsByte(address, a); pc++; break; case 0x95: address = bus.readUnsignedByteAsInt(++pc); bus.writeIntAsByte(address + x, a); pc++; break; case 0x8d: address = bus.readUnsignedWordAsInt(++pc); bus.writeIntAsByte(address, a); pc += 2; break; case 0x9d: address = bus.readUnsignedWordAsInt(++pc); bus.writeIntAsByte(address + x, a); pc += 2; break; case 0x99: address = bus.readUnsignedWordAsInt(++pc); bus.writeIntAsByte(address + y, a); pc += 2; break; case 0x81: throw new RuntimeException(STR); case 0x91: address = bus.readUnsignedByteAsInt(++pc); address = bus.readUnsignedWordAsInt(address); bus.writeIntAsByte(address + y, a); pc++; break; case 0x86: address = bus.readUnsignedByteAsInt(++pc); bus.writeIntAsByte(address, x); pc++; break; case 0x96: address = bus.readUnsignedByteAsInt(++pc); bus.writeIntAsByte(address + y, x); pc++; break; case 0x8e: address = bus.readUnsignedWordAsInt(++pc); bus.writeIntAsByte(address, x); pc += 2; break; case 0x84: address = bus.readUnsignedByteAsInt(++pc); bus.writeIntAsByte(address, y); pc++; break; case 0x94: address = bus.readUnsignedByteAsInt(++pc); bus.writeIntAsByte(address + x, y); pc++; break; case 0x8c: address = bus.readUnsignedWordAsInt(++pc); bus.writeIntAsByte(address, y); pc += 2; break; case 0xaa: x = a; status_negative = (x & 0x80) == 0x80; status_zero = x == 0; pc++; break; case 0xa8: y = a; status_negative = (y & 0x80) == 0x80; status_zero = y == 0; pc++; break; case 0xba: x = sp - 0x100; status_negative = (x & 0x80) == 0x80; status_zero = x == 0; pc++; break; case 0x8a: a = x; status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; case 0x9a: sp = 0x100 + x; pc++; break; case 0x98: a = y; status_negative = (a & 0x80) == 0x80; status_zero = a == 0; pc++; break; default: printRegisters(); Gdx.app.error(getClass().getSimpleName(), STR + instruction + STR); throw new RuntimeException(STR + instruction + STR); } instructionCount++; return instruction; } | /**
* Looks at the instruction located on the bus at the current program
* counter, then jumps to the case associated with that opcode and performs
* the associated logic.
*
* @return Returns the instruction that was executed (for use by nmi to determine
* when rti has been executed).
*/ | Looks at the instruction located on the bus at the current program counter, then jumps to the case associated with that opcode and performs the associated logic | execute | {
"repo_name": "gradualgames/ggvm",
"path": "core/src/com/gradualgames/ggvm/Cpu.java",
"license": "unlicense",
"size": 64960
} | [
"com.badlogic.gdx.Gdx"
] | import com.badlogic.gdx.Gdx; | import com.badlogic.gdx.*; | [
"com.badlogic.gdx"
] | com.badlogic.gdx; | 1,058,780 |
@Override
public byte[] transformClass(MixinEnvironment environment, String name, byte[] classBytes) {
ClassNode classNode = this.readClass(name, classBytes);
if (this.processor.applyMixins(environment, name, classNode)) {
return this.writeClass(classNode);
}
return classBytes;
} | byte[] function(MixinEnvironment environment, String name, byte[] classBytes) { ClassNode classNode = this.readClass(name, classBytes); if (this.processor.applyMixins(environment, name, classNode)) { return this.writeClass(classNode); } return classBytes; } | /**
* Apply mixins and postprocessors to the supplied class
*
* @param environment Current environment
* @param name Class transformed name
* @param classBytes Class bytecode
* @return Transformed bytecode
*/ | Apply mixins and postprocessors to the supplied class | transformClass | {
"repo_name": "SpongePowered/Mixin",
"path": "src/main/java/org/spongepowered/asm/mixin/transformer/MixinTransformer.java",
"license": "mit",
"size": 10439
} | [
"org.objectweb.asm.tree.ClassNode",
"org.spongepowered.asm.mixin.MixinEnvironment"
] | import org.objectweb.asm.tree.ClassNode; import org.spongepowered.asm.mixin.MixinEnvironment; | import org.objectweb.asm.tree.*; import org.spongepowered.asm.mixin.*; | [
"org.objectweb.asm",
"org.spongepowered.asm"
] | org.objectweb.asm; org.spongepowered.asm; | 458,402 |
@Transient
public List<StudySite> getActiveStudySites(){
List<StudySite> sites = new ArrayList<StudySite>();
for(StudySite site : getStudySites()){
if(!site.isRetired()) sites.add(site);
}
return sites;
}
| List<StudySite> function(){ List<StudySite> sites = new ArrayList<StudySite>(); for(StudySite site : getStudySites()){ if(!site.isRetired()) sites.add(site); } return sites; } | /**
* Will return the {@link StudySite}s that are not retired.
*
* @return the active study sites
*/ | Will return the <code>StudySite</code>s that are not retired | getActiveStudySites | {
"repo_name": "CBIIT/caaers",
"path": "caAERS/software/core/src/main/java/gov/nih/nci/cabig/caaers/domain/Study.java",
"license": "bsd-3-clause",
"size": 80505
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 832,092 |
public static MozuClient<com.mozu.api.contracts.core.Behavior> getBehaviorClient(Integer behaviorId) throws Exception
{
return getBehaviorClient( behaviorId, null);
} | static MozuClient<com.mozu.api.contracts.core.Behavior> function(Integer behaviorId) throws Exception { return getBehaviorClient( behaviorId, null); } | /**
* Retrieves the details of a behavior based on the behavior ID specified in the request.
* <p><pre><code>
* MozuClient<com.mozu.api.contracts.core.Behavior> mozuClient=GetBehaviorClient( behaviorId);
* client.setBaseAddress(url);
* client.executeRequest();
* Behavior behavior = client.Result();
* </code></pre></p>
* @param behaviorId Unique identifier of the behavior.
* @return Mozu.Api.MozuClient <com.mozu.api.contracts.core.Behavior>
* @see com.mozu.api.contracts.core.Behavior
*/ | Retrieves the details of a behavior based on the behavior ID specified in the request. <code><code> MozuClient mozuClient=GetBehaviorClient( behaviorId); client.setBaseAddress(url); client.executeRequest(); Behavior behavior = client.Result(); </code></code> | getBehaviorClient | {
"repo_name": "sanjaymandadi/mozu-java",
"path": "mozu-java-core/src/main/java/com/mozu/api/clients/platform/ReferenceDataClient.java",
"license": "mit",
"size": 27032
} | [
"com.mozu.api.MozuClient"
] | import com.mozu.api.MozuClient; | import com.mozu.api.*; | [
"com.mozu.api"
] | com.mozu.api; | 1,472,069 |
private void showApplications(final String searchStr) {
setDirty(false);
List<PackageInfoData> searchApp = new ArrayList<>();
HashSet<Integer> unique = new HashSet<>();
final List<PackageInfoData> apps = Api.getApps(this, null);
boolean isResultsFound = false;
if (searchStr != null && searchStr.length() > 1) {
for (PackageInfoData app : apps) {
for (String str : app.names) {
if (str != null && searchStr != null) {
if (str.contains(searchStr.toLowerCase()) || str.toLowerCase().contains(searchStr.toLowerCase())
&& !searchApp.contains(app) || (G.showUid() && (str + " " + app.uid).contains(searchStr) && !unique.contains(app.uid))) {
searchApp.add(app);
unique.add(app.uid);
isResultsFound = true;
}
}
}
}
}
List<PackageInfoData> apps2 = null;
if (searchStr != null && searchStr.equals("")) {
apps2 = apps;
} else if (isResultsFound || searchApp.size() > 0) {
apps2 = searchApp;
}
// Sort applications - selected first, then alphabetically
try {
if (apps2 != null) {
Collections.sort(apps2, new PackageComparator());
ArrayAdapter appAdapter;
if(selectedColumns <= DEFAULT_VIEW_LIMIT) {
appAdapter = new AppListArrayAdapter(this, getApplicationContext(), apps2, true);
} else {
appAdapter = new AppListArrayAdapter(this, getApplicationContext(), apps2);
}
this.listview.setAdapter(appAdapter);
// restore
this.listview.setSelectionFromTop(index, top);
}
} catch (Exception e) {
Log.d(Api.TAG, "Exception on Sorting");
}
} | void function(final String searchStr) { setDirty(false); List<PackageInfoData> searchApp = new ArrayList<>(); HashSet<Integer> unique = new HashSet<>(); final List<PackageInfoData> apps = Api.getApps(this, null); boolean isResultsFound = false; if (searchStr != null && searchStr.length() > 1) { for (PackageInfoData app : apps) { for (String str : app.names) { if (str != null && searchStr != null) { if (str.contains(searchStr.toLowerCase()) str.toLowerCase().contains(searchStr.toLowerCase()) && !searchApp.contains(app) (G.showUid() && (str + " " + app.uid).contains(searchStr) && !unique.contains(app.uid))) { searchApp.add(app); unique.add(app.uid); isResultsFound = true; } } } } } List<PackageInfoData> apps2 = null; if (searchStr != null && searchStr.equals(STRException on Sorting"); } } | /**
* Show the list of applications
*/ | Show the list of applications | showApplications | {
"repo_name": "ukanth/afwall",
"path": "app/src/main/java/dev/ukanth/ufirewall/MainActivity.java",
"license": "gpl-3.0",
"size": 103821
} | [
"dev.ukanth.ufirewall.Api",
"dev.ukanth.ufirewall.util.G",
"java.util.ArrayList",
"java.util.HashSet",
"java.util.List"
] | import dev.ukanth.ufirewall.Api; import dev.ukanth.ufirewall.util.G; import java.util.ArrayList; import java.util.HashSet; import java.util.List; | import dev.ukanth.ufirewall.*; import dev.ukanth.ufirewall.util.*; import java.util.*; | [
"dev.ukanth.ufirewall",
"java.util"
] | dev.ukanth.ufirewall; java.util; | 1,960,603 |
String toJsonString() {
try {
return from(s3obj.getObjectContent());
} catch (Exception e) {
throw new AmazonClientException("Error parsing JSON: " + e.getMessage());
}
} | String toJsonString() { try { return from(s3obj.getObjectContent()); } catch (Exception e) { throw new AmazonClientException(STR + e.getMessage()); } } | /**
* Converts and return the underlying S3 object as a json string.
*
* @throws AmazonClientException if failed in JSON conversion.
*/ | Converts and return the underlying S3 object as a json string | toJsonString | {
"repo_name": "flofreud/aws-sdk-java",
"path": "aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/S3ObjectWrapper.java",
"license": "apache-2.0",
"size": 5482
} | [
"com.amazonaws.AmazonClientException"
] | import com.amazonaws.AmazonClientException; | import com.amazonaws.*; | [
"com.amazonaws"
] | com.amazonaws; | 1,208,552 |
@Test
public void testGetConvertedListDTOFromDomain( ) throws Exception {
logger.debug( "Starting GetConvertedListDTOFromDomain" );
List< SidebarType > sidebarDTOList;
List< com.mana.innovative.domain.common.SidebarType > sidebarDomainList = new ArrayList<>( );
sidebarDomainList.add( sidebarDomain );
if ( sidebarDomain.getSidebarTypeId( ) != TestConstants.TEST_ID ) {
TestDummyDomainObjectGenerator.setTestSidebarTypeDomainZEROIDObject( sidebarDomain );
}
sidebarDTOList = SidebarDomainDTOConverter.getConvertedListDTOFromDomain( sidebarDomainList );
Assert.assertNotNull( TestConstants.nullMessage, sidebarDTOList );
Assert.assertFalse( TestConstants.trueMessage, sidebarDTOList.isEmpty( ) );
Assert.assertNotNull( TestConstants.nullMessage, sidebarDTOList.get( TestConstants.ZERO ) );
Assert.assertEquals( TestConstants.notEqualsMessage, sidebarDTO, sidebarDTOList.get( TestConstants.ZERO ) );
logger.debug( "Finishing GetConvertedListDTOFromDomain" );
} | void function( ) throws Exception { logger.debug( STR ); List< SidebarType > sidebarDTOList; List< com.mana.innovative.domain.common.SidebarType > sidebarDomainList = new ArrayList<>( ); sidebarDomainList.add( sidebarDomain ); if ( sidebarDomain.getSidebarTypeId( ) != TestConstants.TEST_ID ) { TestDummyDomainObjectGenerator.setTestSidebarTypeDomainZEROIDObject( sidebarDomain ); } sidebarDTOList = SidebarDomainDTOConverter.getConvertedListDTOFromDomain( sidebarDomainList ); Assert.assertNotNull( TestConstants.nullMessage, sidebarDTOList ); Assert.assertFalse( TestConstants.trueMessage, sidebarDTOList.isEmpty( ) ); Assert.assertNotNull( TestConstants.nullMessage, sidebarDTOList.get( TestConstants.ZERO ) ); Assert.assertEquals( TestConstants.notEqualsMessage, sidebarDTO, sidebarDTOList.get( TestConstants.ZERO ) ); logger.debug( STR ); } | /**
* Test get converted list dTO from domain.
*
* @throws Exception the exception
*/ | Test get converted list dTO from domain | testGetConvertedListDTOFromDomain | {
"repo_name": "arkoghosh11/bloom-test",
"path": "bloom-converter/src/test/java/com/mana/innovative/converter/response/WhenSidebarConversionThenTestSiderbarConverterDomainDTOMethods.java",
"license": "apache-2.0",
"size": 7879
} | [
"com.mana.innovative.constants.TestConstants",
"com.mana.innovative.converter.TestDummyDomainObjectGenerator",
"com.mana.innovative.dto.common.SidebarType",
"java.util.ArrayList",
"java.util.List",
"junit.framework.Assert"
] | import com.mana.innovative.constants.TestConstants; import com.mana.innovative.converter.TestDummyDomainObjectGenerator; import com.mana.innovative.dto.common.SidebarType; import java.util.ArrayList; import java.util.List; import junit.framework.Assert; | import com.mana.innovative.constants.*; import com.mana.innovative.converter.*; import com.mana.innovative.dto.common.*; import java.util.*; import junit.framework.*; | [
"com.mana.innovative",
"java.util",
"junit.framework"
] | com.mana.innovative; java.util; junit.framework; | 1,569,853 |
CommandManager manager = new CommandManager(null, null, null, null);
Color def = (Color) SettingManager.get("color");
manager.parseCommand("let color=SKYBLUE");
assertEquals(Color.SKYBLUE, SettingManager.get("color"));
manager.parseCommand("let color = MAROON");
assertEquals(Color.MAROON, SettingManager.get("color"));
manager.parseCommand("let color = MAGENTA");
assertEquals(Color.MAGENTA, SettingManager.get("color"));
} | CommandManager manager = new CommandManager(null, null, null, null); Color def = (Color) SettingManager.get("color"); manager.parseCommand(STR); assertEquals(Color.SKYBLUE, SettingManager.get("color")); manager.parseCommand(STR); assertEquals(Color.MAROON, SettingManager.get("color")); manager.parseCommand(STR); assertEquals(Color.MAGENTA, SettingManager.get("color")); } | /**
* A test that will check to see if the setting manager is working properly
*/ | A test that will check to see if the setting manager is working properly | testColorSwitch | {
"repo_name": "jgkamat/ViPaint",
"path": "src/test/java/io/github/jgkamat/ViPaint/CommandTests.java",
"license": "gpl-3.0",
"size": 2581
} | [
"io.github.jgkamat.ViPaint",
"org.junit.Assert"
] | import io.github.jgkamat.ViPaint; import org.junit.Assert; | import io.github.jgkamat.*; import org.junit.*; | [
"io.github.jgkamat",
"org.junit"
] | io.github.jgkamat; org.junit; | 1,808,251 |
Map<Operator, OperatorEstimate> estimate(Collection<? extends Operator> operators); | Map<Operator, OperatorEstimate> estimate(Collection<? extends Operator> operators); | /**
* Estimates statistics for the target operators.
* If the target operator is not a predecessor of the current estimating one,
* this always returns {@link OperatorEstimate#UNKNOWN unknown}.
* @param operators the target operators
* @return the estimate for each operator
* @throws DiagnosticException if failed to estimate statistics for the target operators
*/ | Estimates statistics for the target operators. If the target operator is not a predecessor of the current estimating one, this always returns <code>OperatorEstimate#UNKNOWN unknown</code> | estimate | {
"repo_name": "ashigeru/asakusafw-compiler",
"path": "compiler-project/optimizer/src/main/java/com/asakusafw/lang/compiler/optimizer/OperatorEstimator.java",
"license": "apache-2.0",
"size": 4844
} | [
"com.asakusafw.lang.compiler.model.graph.Operator",
"java.util.Collection",
"java.util.Map"
] | import com.asakusafw.lang.compiler.model.graph.Operator; import java.util.Collection; import java.util.Map; | import com.asakusafw.lang.compiler.model.graph.*; import java.util.*; | [
"com.asakusafw.lang",
"java.util"
] | com.asakusafw.lang; java.util; | 975,094 |
public ActionForward approve( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) throws Exception {
KualiDocumentFormBase kualiDocumentFormBase = (KualiDocumentFormBase) form;
doProcessingAfterPost( kualiDocumentFormBase, request );
kualiDocumentFormBase.setDerivedValuesOnForm( request );
ActionForward preRulesForward = promptBeforeValidation( mapping, form, request, response );
if ( preRulesForward != null ) {
return preRulesForward;
}
Document document = kualiDocumentFormBase.getDocument();
ActionForward forward = checkAndWarnAboutSensitiveData( mapping, form, request, response, KRADPropertyConstants.DOCUMENT_EXPLANATION, document.getDocumentHeader().getExplanation(), "approve", "" );
if ( forward != null ) {
return forward;
}
getDocumentService().approveDocument( document, kualiDocumentFormBase.getAnnotation(), combineAdHocRecipients( kualiDocumentFormBase ) );
KNSGlobalVariables.getMessageList().add( RiceKeyConstants.MESSAGE_ROUTE_APPROVED );
kualiDocumentFormBase.setAnnotation( "" );
return returnToSender( request, mapping, kualiDocumentFormBase );
} | ActionForward function( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) throws Exception { KualiDocumentFormBase kualiDocumentFormBase = (KualiDocumentFormBase) form; doProcessingAfterPost( kualiDocumentFormBase, request ); kualiDocumentFormBase.setDerivedValuesOnForm( request ); ActionForward preRulesForward = promptBeforeValidation( mapping, form, request, response ); if ( preRulesForward != null ) { return preRulesForward; } Document document = kualiDocumentFormBase.getDocument(); ActionForward forward = checkAndWarnAboutSensitiveData( mapping, form, request, response, KRADPropertyConstants.DOCUMENT_EXPLANATION, document.getDocumentHeader().getExplanation(), STR, STR" ); return returnToSender( request, mapping, kualiDocumentFormBase ); } | /**
* Calls the document service to approve the document
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
* @throws Exception
*/ | Calls the document service to approve the document | approve | {
"repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua",
"path": "rice-middleware/kns/src/main/java/org/kuali/rice/kns/web/struts/action/KualiDocumentActionBase.java",
"license": "apache-2.0",
"size": 107002
} | [
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.apache.struts.action.ActionForm",
"org.apache.struts.action.ActionForward",
"org.apache.struts.action.ActionMapping",
"org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase",
"org.kuali.rice.krad.document.Document... | import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase; import org.kuali.rice.krad.document.Document; import org.kuali.rice.krad.util.KRADPropertyConstants; | import javax.servlet.http.*; import org.apache.struts.action.*; import org.kuali.rice.kns.web.struts.form.*; import org.kuali.rice.krad.document.*; import org.kuali.rice.krad.util.*; | [
"javax.servlet",
"org.apache.struts",
"org.kuali.rice"
] | javax.servlet; org.apache.struts; org.kuali.rice; | 960,429 |
private void invoke(String workflowId, String workplaceName) {
WorkflowService service = get(WorkflowService.class);
DefaultWorkflowDescription wfDesc = DefaultWorkflowDescription.builder()
.workplaceName(workplaceName)
.id(workflowId)
.data(JsonNodeFactory.instance.objectNode())
.build();
try {
service.invokeWorkflow(wfDesc);
} catch (WorkflowException e) {
error(e.getMessage() + "trace: " + Arrays.asList(e.getStackTrace()));
}
} | void function(String workflowId, String workplaceName) { WorkflowService service = get(WorkflowService.class); DefaultWorkflowDescription wfDesc = DefaultWorkflowDescription.builder() .workplaceName(workplaceName) .id(workflowId) .data(JsonNodeFactory.instance.objectNode()) .build(); try { service.invokeWorkflow(wfDesc); } catch (WorkflowException e) { error(e.getMessage() + STR + Arrays.asList(e.getStackTrace())); } } | /**
* Invokes workflow.
* @param workflowId workflow id
* @param workplaceName workplace name
*/ | Invokes workflow | invoke | {
"repo_name": "kuujo/onos",
"path": "apps/workflow/app/src/main/java/org/onosproject/workflow/cli/WorkFlowTestCommand.java",
"license": "apache-2.0",
"size": 3297
} | [
"com.fasterxml.jackson.databind.node.JsonNodeFactory",
"java.util.Arrays",
"org.onosproject.workflow.api.DefaultWorkflowDescription",
"org.onosproject.workflow.api.WorkflowException",
"org.onosproject.workflow.api.WorkflowService"
] | import com.fasterxml.jackson.databind.node.JsonNodeFactory; import java.util.Arrays; import org.onosproject.workflow.api.DefaultWorkflowDescription; import org.onosproject.workflow.api.WorkflowException; import org.onosproject.workflow.api.WorkflowService; | import com.fasterxml.jackson.databind.node.*; import java.util.*; import org.onosproject.workflow.api.*; | [
"com.fasterxml.jackson",
"java.util",
"org.onosproject.workflow"
] | com.fasterxml.jackson; java.util; org.onosproject.workflow; | 1,059,327 |
void switchFilterMode(FilterDelegate.FilterMode filterMode); | void switchFilterMode(FilterDelegate.FilterMode filterMode); | /**
* Changes the filter mode and repaints the filter layout
*/ | Changes the filter mode and repaints the filter layout | switchFilterMode | {
"repo_name": "dimone-kun/cuba",
"path": "modules/gui/src/com/haulmont/cuba/gui/components/Filter.java",
"license": "apache-2.0",
"size": 9915
} | [
"com.haulmont.cuba.gui.components.filter.FilterDelegate"
] | import com.haulmont.cuba.gui.components.filter.FilterDelegate; | import com.haulmont.cuba.gui.components.filter.*; | [
"com.haulmont.cuba"
] | com.haulmont.cuba; | 2,185,512 |
public void finish() throws IOException {
if (!def.finished()) {
def.finish();
while (!def.finished()) {
deflate();
}
}
} | void function() throws IOException { if (!def.finished()) { def.finish(); while (!def.finished()) { deflate(); } } } | /**
* Finishes writing compressed data to the output stream without closing
* the underlying stream. Use this method when applying multiple filters
* in succession to the same output stream.
* @exception IOException if an I/O error has occurred
*/ | Finishes writing compressed data to the output stream without closing the underlying stream. Use this method when applying multiple filters in succession to the same output stream | finish | {
"repo_name": "chfoo/areca-backup-release-mirror",
"path": "src/com/myJava/file/archive/zip64/DeflaterOutputStream.java",
"license": "gpl-2.0",
"size": 5480
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,217,140 |
private boolean addDocumentToOmnivore(
final String title,
final String category,
final String dateStr,
final Path file,
final String keywords
) throws IOException, ElexisException{
String logPrefix = "addDocumentToOmnivore() - ";//$NON-NLS-1$
this.checkCreateCategory(category);
//First check if the document is not already in the database
List<IOpaqueDocument> documentList =
this.omnivoreDocManager.listDocuments(
this.patient,
category,
title,
null,
new TimeSpan(dateStr+ "-" + dateStr),
null
);
//If no document has been found, we can add it to the database
if (documentList == null || documentList.size() == 0) {
//Get the document mimeType
String mimeType = null;
try {
mimeType = Files.probeContentType(file);
LOGGER.debug(logPrefix+"Mimetype for "+file.toString()+" is "+mimeType);//$NON-NLS-1$
}
catch(IOException | SecurityException e) {
//ignore exceptions
LOGGER.warn(logPrefix+"Unable to find the mimetype of the following file "+file.toString());//$NON-NLS-1$
}
this.omnivoreDocManager.addDocument(
new GenericDocument(
this.patient,
title,
category,
file.toFile(),
dateStr,
keywords,
mimeType
)
);
//If the document has successfully been added
LOGGER.debug(logPrefix+"This document has successfully been added to the omnivore database."+file.toString());//$NON-NLS-1$
return true;
}
else {
//If the document already exists, log it
LOGGER.warn(logPrefix+"This document already exists in the omnivore database. It will not be imported: " + title +" "+file.toString());//$NON-NLS-1$
return false;
}
}
| boolean function( final String title, final String category, final String dateStr, final Path file, final String keywords ) throws IOException, ElexisException{ String logPrefix = STR; this.checkCreateCategory(category); List<IOpaqueDocument> documentList = this.omnivoreDocManager.listDocuments( this.patient, category, title, null, new TimeSpan(dateStr+ "-" + dateStr), null ); if (documentList == null documentList.size() == 0) { String mimeType = null; try { mimeType = Files.probeContentType(file); LOGGER.debug(logPrefix+STR+file.toString()+STR+mimeType); } catch(IOException SecurityException e) { LOGGER.warn(logPrefix+STR+file.toString()); } this.omnivoreDocManager.addDocument( new GenericDocument( this.patient, title, category, file.toFile(), dateStr, keywords, mimeType ) ); LOGGER.debug(logPrefix+STR+file.toString()); return true; } else { LOGGER.warn(logPrefix+STR + title +" "+file.toString()); return false; } } | /**
* Add a new document to Omnivore
* @param title
* @param category
* @param dateStr
* @param file
* @param keywords
* @return true if was successful
* @throws IOException
* @throws ElexisException
*/ | Add a new document to Omnivore | addDocumentToOmnivore | {
"repo_name": "DavidGutknecht/elexis-3-base",
"path": "bundles/ch.novcom.elexis.mednet.plugin/src/ch/novcom/elexis/mednet/plugin/data/PatientDocumentManager.java",
"license": "epl-1.0",
"size": 17530
} | [
"ch.elexis.core.data.interfaces.text.IOpaqueDocument",
"ch.elexis.core.exceptions.ElexisException",
"ch.elexis.core.ui.text.GenericDocument",
"ch.rgw.tools.TimeSpan",
"java.io.IOException",
"java.nio.file.Files",
"java.nio.file.Path",
"java.util.List"
] | import ch.elexis.core.data.interfaces.text.IOpaqueDocument; import ch.elexis.core.exceptions.ElexisException; import ch.elexis.core.ui.text.GenericDocument; import ch.rgw.tools.TimeSpan; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; | import ch.elexis.core.data.interfaces.text.*; import ch.elexis.core.exceptions.*; import ch.elexis.core.ui.text.*; import ch.rgw.tools.*; import java.io.*; import java.nio.file.*; import java.util.*; | [
"ch.elexis.core",
"ch.rgw.tools",
"java.io",
"java.nio",
"java.util"
] | ch.elexis.core; ch.rgw.tools; java.io; java.nio; java.util; | 1,850,900 |
@Test
public void testExtractBadEvent4() {
String badData1 = "<123123123123123123123123123123> bad bad data\n";
SyslogUtils util = new SyslogUtils(false);
ChannelBuffer buff = ChannelBuffers.buffer(100);
buff.writeBytes(badData1.getBytes());
Event e = util.extractEvent(buff);
if (e == null) {
throw new NullPointerException("Event is null");
}
Map<String, String> headers = e.getHeaders();
Assert.assertEquals("0", headers.get(SyslogUtils.SYSLOG_FACILITY));
Assert.assertEquals("0", headers.get(SyslogUtils.SYSLOG_SEVERITY));
Assert.assertEquals(SyslogUtils.SyslogStatus.INVALID.getSyslogStatus(),
headers.get(SyslogUtils.EVENT_STATUS));
Assert.assertEquals(badData1.trim(), new String(e.getBody()).trim());
} | void function() { String badData1 = STR; SyslogUtils util = new SyslogUtils(false); ChannelBuffer buff = ChannelBuffers.buffer(100); buff.writeBytes(badData1.getBytes()); Event e = util.extractEvent(buff); if (e == null) { throw new NullPointerException(STR); } Map<String, String> headers = e.getHeaders(); Assert.assertEquals("0", headers.get(SyslogUtils.SYSLOG_FACILITY)); Assert.assertEquals("0", headers.get(SyslogUtils.SYSLOG_SEVERITY)); Assert.assertEquals(SyslogUtils.SyslogStatus.INVALID.getSyslogStatus(), headers.get(SyslogUtils.EVENT_STATUS)); Assert.assertEquals(badData1.trim(), new String(e.getBody()).trim()); } | /**
* Test bad event format 4: Priority too long
*/ | Test bad event format 4: Priority too long | testExtractBadEvent4 | {
"repo_name": "wangcy6/storm_app",
"path": "frame/apache-flume-1.7.0-src/flume-ng-core/src/test/java/org/apache/flume/source/TestSyslogUtils.java",
"license": "apache-2.0",
"size": 22868
} | [
"java.util.Map",
"org.apache.flume.Event",
"org.jboss.netty.buffer.ChannelBuffer",
"org.jboss.netty.buffer.ChannelBuffers",
"org.junit.Assert"
] | import java.util.Map; import org.apache.flume.Event; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.junit.Assert; | import java.util.*; import org.apache.flume.*; import org.jboss.netty.buffer.*; import org.junit.*; | [
"java.util",
"org.apache.flume",
"org.jboss.netty",
"org.junit"
] | java.util; org.apache.flume; org.jboss.netty; org.junit; | 911,810 |
void writeToCopy(byte[] buf, int off, int siz) throws SQLException; | void writeToCopy(byte[] buf, int off, int siz) throws SQLException; | /**
* Writes specified part of given byte array to an open and writable copy operation.
* @param buf array of bytes to write
* @param off offset of first byte to write (normally zero)
* @param siz number of bytes to write (normally buf.length)
* @throws SQLException if the operation fails
*/ | Writes specified part of given byte array to an open and writable copy operation | writeToCopy | {
"repo_name": "devsunny/app-galleries",
"path": "postgres-odbc-server/src/main/java/org/postgresql/copy/CopyIn.java",
"license": "mit",
"size": 1460
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,128,657 |
public static Rop opCmpg(TypeBearer type) {
switch (type.getBasicType()) {
case Type.BT_FLOAT: return CMPG_FLOAT;
case Type.BT_DOUBLE: return CMPG_DOUBLE;
}
return throwBadType(type);
} | static Rop function(TypeBearer type) { switch (type.getBasicType()) { case Type.BT_FLOAT: return CMPG_FLOAT; case Type.BT_DOUBLE: return CMPG_DOUBLE; } return throwBadType(type); } | /**
* Returns the appropriate {@code cmpg} rop for the given type. The
* result is a shared instance.
*
* @param type {@code non-null;} type of value being compared
* @return {@code non-null;} an appropriate instance
*/ | Returns the appropriate cmpg rop for the given type. The result is a shared instance | opCmpg | {
"repo_name": "raviagarwal7/buck",
"path": "third-party/java/dx/src/com/android/dx/rop/code/Rops.java",
"license": "apache-2.0",
"size": 82635
} | [
"com.android.dx.rop.type.Type",
"com.android.dx.rop.type.TypeBearer"
] | import com.android.dx.rop.type.Type; import com.android.dx.rop.type.TypeBearer; | import com.android.dx.rop.type.*; | [
"com.android.dx"
] | com.android.dx; | 837,867 |
public FDateAssert isNotBetween(final FDate start, final FDate end) {
return isNotBetween(start, end, true, false);
} | FDateAssert function(final FDate start, final FDate end) { return isNotBetween(start, end, true, false); } | /**
* Verifies that the actual {@code FDate} is not in [start, end[ period
*
* @param start
* the period start (inclusive), expected not to be null.
* @param end
* the period end (exclusive), expected not to be null.
* @return this assertion object.
* @throws AssertionError
* if the actual {@code FDate} is {@code null}.
* @throws NullPointerException
* if start {@code FDate} is {@code null}.
* @throws NullPointerException
* if end {@code FDate} is {@code null}.
* @throws AssertionError
* if the actual {@code FDate} is in [start, end[ period.
* @throws AssertionError
* if one of the given date as String could not be converted to a FDate.
*/ | Verifies that the actual FDate is not in [start, end[ period | isNotBetween | {
"repo_name": "subes/invesdwin-util",
"path": "invesdwin-util-parent/invesdwin-util/src/main/java/de/invesdwin/util/assertions/type/FDateAssert.java",
"license": "lgpl-3.0",
"size": 110738
} | [
"de.invesdwin.util.time.date.FDate"
] | import de.invesdwin.util.time.date.FDate; | import de.invesdwin.util.time.date.*; | [
"de.invesdwin.util"
] | de.invesdwin.util; | 2,525,579 |
ServiceResponse<List<DateTime>> getDateTimeInvalidChars() throws ErrorException, IOException; | ServiceResponse<List<DateTime>> getDateTimeInvalidChars() throws ErrorException, IOException; | /**
* Get date array value ['2000-12-01t00:00:01z', 'date-time'].
*
* @throws ErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the List<DateTime> object wrapped in {@link ServiceResponse} if successful.
*/ | Get date array value ['2000-12-01t00:00:01z', 'date-time'] | getDateTimeInvalidChars | {
"repo_name": "haocs/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodyarray/Arrays.java",
"license": "mit",
"size": 72234
} | [
"com.microsoft.rest.ServiceResponse",
"java.io.IOException",
"java.util.List",
"org.joda.time.DateTime"
] | import com.microsoft.rest.ServiceResponse; import java.io.IOException; import java.util.List; import org.joda.time.DateTime; | import com.microsoft.rest.*; import java.io.*; import java.util.*; import org.joda.time.*; | [
"com.microsoft.rest",
"java.io",
"java.util",
"org.joda.time"
] | com.microsoft.rest; java.io; java.util; org.joda.time; | 2,501,216 |
@Test
public void testAcquireReadWriteLocksOnSameKey() throws InterruptedException {
final String key = "key";
final Vector<Integer> threadsCompleted = new Vector<Integer>();
| void function() throws InterruptedException { final String key = "key"; final Vector<Integer> threadsCompleted = new Vector<Integer>(); | /**
* For two threads trying to respectively acquire the read and write locks on the same key, only one succeeds.
*/ | For two threads trying to respectively acquire the read and write locks on the same key, only one succeeds | testAcquireReadWriteLocksOnSameKey | {
"repo_name": "turing123/lockmanager",
"path": "src/test/java/turing123/SimpleReadWriteLockManagerTest.java",
"license": "mit",
"size": 3840
} | [
"java.util.Vector"
] | import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 107,068 |
public static <E> NonNullList<E> withSize(int size, E fill)
{
Validate.notNull(fill);
Object[] aobject = new Object[size];
Arrays.fill(aobject, fill);
return new NonNullList<E>(Arrays.asList((E[])aobject), fill);
} | static <E> NonNullList<E> function(int size, E fill) { Validate.notNull(fill); Object[] aobject = new Object[size]; Arrays.fill(aobject, fill); return new NonNullList<E>(Arrays.asList((E[])aobject), fill); } | /**
* Creates a new NonNullList with <i>fixed</i> size, and filled with the object passed.
*/ | Creates a new NonNullList with fixed size, and filled with the object passed | withSize | {
"repo_name": "TheGreatAndPowerfulWeegee/wipunknown",
"path": "build/tmp/recompileMc/sources/net/minecraft/util/NonNullList.java",
"license": "gpl-3.0",
"size": 2083
} | [
"java.util.Arrays",
"org.apache.commons.lang3.Validate"
] | import java.util.Arrays; import org.apache.commons.lang3.Validate; | import java.util.*; import org.apache.commons.lang3.*; | [
"java.util",
"org.apache.commons"
] | java.util; org.apache.commons; | 683,634 |
@Test
public void testReplicationNRoot2() throws Exception {
int replicationFactor = 2;
Number160 keyA = new Number160("0xa");
int[][] expectedA =
// as first node, node a is always replicating given key
{{ 1, 0, 0 },
// node a and b have to replicate key a, node a has to notify newly
// joined node b
{ 0, 1, 0 },
// node a and b still have to replicate key a (node a and b are closer
// to key a than newly joined node c), node a doesn't has to notify
// newly joined node c
{ 0, 0, 0 },
// node a and b still have to replicate key a (node b is closer to key a
// than newly joined node d), node a doesn't has to notify newly joined
// node d
{ 0, 0, 0 }};
int[][] leaveA =
// leaving node b was also responsible for key a, node a has to
// notify it's replications set (node a and c are closest to key a)
{ { 1, 0, 0 },
// leaving node c was also responsible for key a, node a has to
// notify it's replications set (node a and d are closest to key a)
{ 1, 0, 0 },
// leaving node d was also responsible for key a, node a has to
// notify it's replications set
{ 1, 0, 0 }};
testReplication(keyA, replicationFactor, true, expectedA, leaveA);
Number160 keyB = new Number160("0xb");
int[][] expectedB =
// as first node, node a is always replicating given key
{{ 1, 0, 0 },
// node a and b have to replicate key b, node a has to notify newly
// joined node b
{ 0, 1, 0 },
// node a and b still have to replicate key b (node a and b are closer
// to key b than newly joined c), node a doesn't has to notify newly
// joined node c
{ 0, 0, 0 },
// node a and b still have to replicate key b (node a and b are closer
// to key b than newly joined d), node a doesn't has to notify newly
// joined node d
{ 0, 0, 0 }};
int[][] leaveB =
// leaving node b was also responsible for key b, node a has to
// notify it's replications set (node a and d are closest to key a)
{ { 1, 0, 0 },
// leaving node c was not responsible for key b, node a has not to
// notify someone (node a and d are closest to key a)
{ 0, 0, 0 },
// leaving node d was also responsible for key a, node a has to
// notify it's replications set
{ 1, 0, 0 }};
testReplication(keyB, replicationFactor, true, expectedB, leaveB);
Number160 keyC = new Number160("0xc");
int[][] expectedC =
// as first node, node a is always replicating given key
{{ 1, 0, 0 },
// node a and b have to replicate key c, node a has to notify newly
// joined node b
{ 0, 1, 0 },
// node a and c have to replicate key c (node a and c are closer to key
// c than node b), node a has to notify newly joined node c
{ 0, 1, 0 },
// node c and d have to replicate key c (node c and d are closer to key
// c than node a), node a doesn't has to replicate anymore, node a has
// to notify newly joined node d
{ 0, 0, 1 }};
int[][] leaveC =
// node a doesn't know any replication responsibilities of
// leaving node b
{ { 0, 0, 0 },
// node a doesn't know any replication responsibilities of
// leaving node c
{ 0, 0, 0 },
// node a doesn't know any replication responsibilities of
// leaving node d
{ 0, 0, 0 }};
testReplication(keyC, replicationFactor, true, expectedC, leaveC);
Number160 keyD = new Number160("0xd");
int[][] expectedD =
// as first node, node a is always replicating given key
{{ 1, 0, 0 },
// node a and b have to replicate key d, node a has to notify newly
// joined node b
{ 0, 1, 0 },
// node b and c have to replicate key d (node b and c are closer to key
// d than node a), node a has to notify newly joined node c
{ 0, 0, 1 },
// node a has no replication responsibilities to check
{ 0, 0, 0 }};
int[][] leaveD =
// node a has no replication responsibilities to check
{ { 0, 0, 0 },
// node a has no replication responsibilities to check
{ 0, 0, 0 },
// node a has no replication responsibilities to check
{ 0, 0, 0 }};
testReplication(keyD, replicationFactor, true, expectedD, leaveD);
}
| void function() throws Exception { int replicationFactor = 2; Number160 keyA = new Number160("0xa"); int[][] expectedA = {{ 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 0 }, { 0, 0, 0 }}; int[][] leaveA = { { 1, 0, 0 }, { 1, 0, 0 }, { 1, 0, 0 }}; testReplication(keyA, replicationFactor, true, expectedA, leaveA); Number160 keyB = new Number160("0xb"); int[][] expectedB = {{ 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 0 }, { 0, 0, 0 }}; int[][] leaveB = { { 1, 0, 0 }, { 0, 0, 0 }, { 1, 0, 0 }}; testReplication(keyB, replicationFactor, true, expectedB, leaveB); Number160 keyC = new Number160("0xc"); int[][] expectedC = {{ 1, 0, 0 }, { 0, 1, 0 }, { 0, 1, 0 }, { 0, 0, 1 }}; int[][] leaveC = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }}; testReplication(keyC, replicationFactor, true, expectedC, leaveC); Number160 keyD = new Number160("0xd"); int[][] expectedD = {{ 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }}; int[][] leaveD = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }}; testReplication(keyD, replicationFactor, true, expectedD, leaveD); } | /**
* Test the responsibility and the notifications for the n-root replication
* approach with replication factor 2.
*
* @throws Exception
*/ | Test the responsibility and the notifications for the n-root replication approach with replication factor 2 | testReplicationNRoot2 | {
"repo_name": "tomp2p/TomP2P",
"path": "replication/src/test/java/net/tomp2p/replication/TestStoreReplication.java",
"license": "apache-2.0",
"size": 42588
} | [
"net.tomp2p.peers.Number160"
] | import net.tomp2p.peers.Number160; | import net.tomp2p.peers.*; | [
"net.tomp2p.peers"
] | net.tomp2p.peers; | 1,550,287 |
public int getPercentile(double percentile) {
// NOTE: This implementation uses the nearest-rank method.
// https://en.wikipedia.org/wiki/Percentile#The_nearest-rank_method
//
// If called concurrently with record, this implementation biases low.
// Since we read count before iterating the array, more elements might have been recorded
// and we might not iterate far enough to be fair.
// Still, this probably won't matter greatly in practice.
Preconditions.checkArgument(percentile > 0.0);
Preconditions.checkArgument(percentile <= 100.0);
long targetRank = (long) Math.ceil(percentile * count.get() / 100);
long rank = 0;
for (int i = 0; i < buckets.length(); i++) {
rank += buckets.get(i);
if (rank >= targetRank) {
return i;
}
}
return buckets.length();
} | int function(double percentile) { Preconditions.checkArgument(percentile > 0.0); Preconditions.checkArgument(percentile <= 100.0); long targetRank = (long) Math.ceil(percentile * count.get() / 100); long rank = 0; for (int i = 0; i < buckets.length(); i++) { rank += buckets.get(i); if (rank >= targetRank) { return i; } } return buckets.length(); } | /**
* Get the percentile of recorded values. If called concurrently with {@link #record(int)}, the
* result is an approximate.
*/ | Get the percentile of recorded values. If called concurrently with <code>#record(int)</code>, the result is an approximate | getPercentile | {
"repo_name": "googleapis/gax-java",
"path": "gax/src/main/java/com/google/api/gax/core/Distribution.java",
"license": "bsd-3-clause",
"size": 4050
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 1,382,338 |
public void setDepend (Depend depend)
{
this.depend = depend;
} | void function (Depend depend) { this.depend = depend; } | /**
* A Depend object for use within the Scarab API.
*/ | A Depend object for use within the Scarab API | setDepend | {
"repo_name": "SpoonLabs/gumtree-spoon-ast-diff",
"path": "src/test/resources/examples/t_225724/right_ScarabRequestTool_1.37.java",
"license": "apache-2.0",
"size": 16946
} | [
"org.tigris.scarab.om.Depend"
] | import org.tigris.scarab.om.Depend; | import org.tigris.scarab.om.*; | [
"org.tigris.scarab"
] | org.tigris.scarab; | 555,797 |
public int optInt(@Nullable String name, int fallback) {
Object object = opt(name);
Integer result = JSON.toInteger(object);
return result != null ? result : fallback;
} | int function(@Nullable String name, int fallback) { Object object = opt(name); Integer result = JSON.toInteger(object); return result != null ? result : fallback; } | /**
* Returns the value mapped by {@code name} if it exists and is an int or
* can be coerced to an int, or {@code fallback} otherwise.
*/ | Returns the value mapped by name if it exists and is an int or can be coerced to an int, or fallback otherwise | optInt | {
"repo_name": "smartdevicelink/sdl_android",
"path": "javaSE/javaSE/src/main/java/org/json/JSONObject.java",
"license": "bsd-3-clause",
"size": 30612
} | [
"androidx.annotation.Nullable"
] | import androidx.annotation.Nullable; | import androidx.annotation.*; | [
"androidx.annotation"
] | androidx.annotation; | 457,300 |
protected DataRowDataSource getDataRowDataSource() {
return dataRowDataSource;
} | DataRowDataSource function() { return dataRowDataSource; } | /**
* Returns the datarow data source used in this template.
*
* @return the datarow data source.
*/ | Returns the datarow data source used in this template | getDataRowDataSource | {
"repo_name": "EgorZhuk/pentaho-reporting",
"path": "engine/core/src/main/java/org/pentaho/reporting/engine/classic/core/filter/templates/AnchorFieldTemplate.java",
"license": "lgpl-2.1",
"size": 3840
} | [
"org.pentaho.reporting.engine.classic.core.filter.DataRowDataSource"
] | import org.pentaho.reporting.engine.classic.core.filter.DataRowDataSource; | import org.pentaho.reporting.engine.classic.core.filter.*; | [
"org.pentaho.reporting"
] | org.pentaho.reporting; | 2,145,402 |
public static Rectangle2D toAwtRectangle(Rectangle rect) {
Rectangle2D rect2d = new Rectangle2D.Double();
rect2d.setRect(rect.x, rect.y, rect.width, rect.height);
return rect2d;
} | static Rectangle2D function(Rectangle rect) { Rectangle2D rect2d = new Rectangle2D.Double(); rect2d.setRect(rect.x, rect.y, rect.width, rect.height); return rect2d; } | /**
* Transform a swt Rectangle instance into an awt one.
* @param rect the swt <code>Rectangle</code>
* @return a Rectangle2D.Double instance with
* the eappropriate location and size.
*/ | Transform a swt Rectangle instance into an awt one | toAwtRectangle | {
"repo_name": "ilyessou/jfreechart",
"path": "swt/org/jfree/experimental/swt/SWTUtils.java",
"license": "lgpl-2.1",
"size": 18372
} | [
"java.awt.geom.Rectangle2D",
"org.eclipse.swt.graphics.Rectangle"
] | import java.awt.geom.Rectangle2D; import org.eclipse.swt.graphics.Rectangle; | import java.awt.geom.*; import org.eclipse.swt.graphics.*; | [
"java.awt",
"org.eclipse.swt"
] | java.awt; org.eclipse.swt; | 1,573,230 |
public static byte[] createByteArray(int size, String data) {
byte[] byteArray = new byte[size];
for (int i = 0; i < size; i++) {
byteArray[i] = Byte.parseByte(data, 2);
}
return byteArray;
}
public static class ZonedDateTimeMatcher extends TypeSafeDiagnosingMatcher<String> {
private final ZonedDateTime date;
public ZonedDateTimeMatcher(ZonedDateTime date) {
this.date = date;
} | static byte[] function(int size, String data) { byte[] byteArray = new byte[size]; for (int i = 0; i < size; i++) { byteArray[i] = Byte.parseByte(data, 2); } return byteArray; } public static class ZonedDateTimeMatcher extends TypeSafeDiagnosingMatcher<String> { private final ZonedDateTime date; public ZonedDateTimeMatcher(ZonedDateTime date) { this.date = date; } | /**
* Create a byte array with a specific size filled with specified data.
*
* @param size the size of the byte array
* @param data the data to put in the byte array
* @return the JSON byte array
*/ | Create a byte array with a specific size filled with specified data | createByteArray | {
"repo_name": "ajeans/sandbox",
"path": "sandbox-hipster/src/test/java/com/ajeansen/sandbox/web/rest/TestUtil.java",
"license": "gpl-3.0",
"size": 4387
} | [
"java.time.ZonedDateTime",
"org.hamcrest.TypeSafeDiagnosingMatcher"
] | import java.time.ZonedDateTime; import org.hamcrest.TypeSafeDiagnosingMatcher; | import java.time.*; import org.hamcrest.*; | [
"java.time",
"org.hamcrest"
] | java.time; org.hamcrest; | 1,422,269 |
public static void writeMatrix(MatrixSquare matrix, String filename, boolean gzip) throws FileNotFoundException, IOException {
BufferedOutputStream bufferedOutputStream = openBufferedOutputStream(filename, gzip);
String line = String.format("%d %d %s\n", matrix.numCols(), matrix.numRows(), matrix.getClass().getSimpleName());
bufferedOutputStream.write(line.getBytes());
writeMatrixData(matrix, bufferedOutputStream);
bufferedOutputStream.close();
} | static void function(MatrixSquare matrix, String filename, boolean gzip) throws FileNotFoundException, IOException { BufferedOutputStream bufferedOutputStream = openBufferedOutputStream(filename, gzip); String line = String.format(STR, matrix.numCols(), matrix.numRows(), matrix.getClass().getSimpleName()); bufferedOutputStream.write(line.getBytes()); writeMatrixData(matrix, bufferedOutputStream); bufferedOutputStream.close(); } | /**
* Write matrix.
*
* @param matrix the matrix
* @param filename the filename
* @param gzip the gzip
* @throws FileNotFoundException the file not found exception
* @throws IOException Signals that an I/O exception has occurred.
*/ | Write matrix | writeMatrix | {
"repo_name": "ahmetaa/lium-diarization",
"path": "src/fr/lium/spkDiarization/libMatrix/MatrixIO.java",
"license": "gpl-3.0",
"size": 10428
} | [
"java.io.BufferedOutputStream",
"java.io.FileNotFoundException",
"java.io.IOException"
] | import java.io.BufferedOutputStream; import java.io.FileNotFoundException; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,749,066 |
public void execute(String tenant, File tenantDirectory, DateTime deltaUptoTime) {
TenantContext.setTenantId(tenant);
audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), "Delta Extract Initiation",
LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0019, DATE_TIME_FORMATTER.print(deltaUptoTime)));
Map<String, Set<String>> appsPerEdOrg = appsPerEdOrg();
ExtractFile publicDeltaExtractFile = createPublicExtractFile(tenantDirectory, deltaUptoTime);
deltaEntityIterator.init(tenant, deltaUptoTime);
while (deltaEntityIterator.hasNext()) {
DeltaRecord delta = deltaEntityIterator.next();
if (delta.getOp() == Operation.UPDATE) {
extractUpdate(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime);
} else if (delta.getOp() == Operation.DELETE) {
extractDelete(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime);
} else if (delta.getOp() == Operation.PURGE) {
extractPurge(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime);
}
}
logEntityCounts();
audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), "Delta Extract Finished",
LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0021, DATE_TIME_FORMATTER.print(deltaUptoTime)));
finalizeExtraction(tenant, deltaUptoTime);
} | void function(String tenant, File tenantDirectory, DateTime deltaUptoTime) { TenantContext.setTenantId(tenant); audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), STR, LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0019, DATE_TIME_FORMATTER.print(deltaUptoTime))); Map<String, Set<String>> appsPerEdOrg = appsPerEdOrg(); ExtractFile publicDeltaExtractFile = createPublicExtractFile(tenantDirectory, deltaUptoTime); deltaEntityIterator.init(tenant, deltaUptoTime); while (deltaEntityIterator.hasNext()) { DeltaRecord delta = deltaEntityIterator.next(); if (delta.getOp() == Operation.UPDATE) { extractUpdate(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } else if (delta.getOp() == Operation.DELETE) { extractDelete(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } else if (delta.getOp() == Operation.PURGE) { extractPurge(delta, publicDeltaExtractFile, appsPerEdOrg, tenantDirectory, deltaUptoTime); } } logEntityCounts(); audit(securityEventUtil.createSecurityEvent(this.getClass().getName(), STR, LogLevelType.TYPE_INFO, BEMessageCode.BE_SE_CODE_0021, DATE_TIME_FORMATTER.print(deltaUptoTime))); finalizeExtraction(tenant, deltaUptoTime); } | /**
* Creates delta data bulk extract files if any are needed for the given tenant.
*
* @param tenant - name of tenant to extract
* @param tenantDirectory - Base directory of the tenant
* @param deltaUptoTime - Extract for all deltas up to this time
*/ | Creates delta data bulk extract files if any are needed for the given tenant | execute | {
"repo_name": "inbloom/secure-data-service",
"path": "sli/bulk-extract/src/main/java/org/slc/sli/bulk/extract/extractor/DeltaExtractor.java",
"license": "apache-2.0",
"size": 16438
} | [
"java.io.File",
"java.util.Map",
"java.util.Set",
"org.joda.time.DateTime",
"org.slc.sli.bulk.extract.LogUtil",
"org.slc.sli.bulk.extract.delta.DeltaEntityIterator",
"org.slc.sli.bulk.extract.files.ExtractFile",
"org.slc.sli.bulk.extract.message.BEMessageCode",
"org.slc.sli.common.util.logging.LogLe... | import java.io.File; import java.util.Map; import java.util.Set; import org.joda.time.DateTime; import org.slc.sli.bulk.extract.LogUtil; import org.slc.sli.bulk.extract.delta.DeltaEntityIterator; import org.slc.sli.bulk.extract.files.ExtractFile; import org.slc.sli.bulk.extract.message.BEMessageCode; import org.slc.sli.common.util.logging.LogLevelType; import org.slc.sli.common.util.tenantdb.TenantContext; | import java.io.*; import java.util.*; import org.joda.time.*; import org.slc.sli.bulk.extract.*; import org.slc.sli.bulk.extract.delta.*; import org.slc.sli.bulk.extract.files.*; import org.slc.sli.bulk.extract.message.*; import org.slc.sli.common.util.logging.*; import org.slc.sli.common.util.tenantdb.*; | [
"java.io",
"java.util",
"org.joda.time",
"org.slc.sli"
] | java.io; java.util; org.joda.time; org.slc.sli; | 2,400,806 |
@Message(id = Message.NONE, value = "Runs the server with a security manager installed.")
String argSecMgr(); | @Message(id = Message.NONE, value = STR) String argSecMgr(); | /**
* Instructions for the {@link CommandLineConstants#SECMGR} command line argument.
*
* @return the message
*/ | Instructions for the <code>CommandLineConstants#SECMGR</code> command line argument | argSecMgr | {
"repo_name": "darranl/wildfly-core",
"path": "server/src/main/java/org/jboss/as/server/logging/ServerLogger.java",
"license": "lgpl-2.1",
"size": 68179
} | [
"org.jboss.logging.annotations.Message"
] | import org.jboss.logging.annotations.Message; | import org.jboss.logging.annotations.*; | [
"org.jboss.logging"
] | org.jboss.logging; | 2,856,693 |
public boolean cancel(int rid) {
// remove elements in ridToTimeToTid
NavigableMap<Integer,Set<Integer>> timeToTid = ridToTimeToTid.remove(rid);
if (timeToTid != null) {
for(int dt : timeToTid.keySet()) {
// remove elements in timeToRidToTid
if (timeToRidToTid.containsKey(dt)) {
timeToRidToTid.get(dt).remove(rid);
}
// remove time-tiles in grids
if (grids.containsKey(dt)) {
int[] grid = grids.get(dt);
for(int tid : timeToTid.get(dt)) {
grid[tid] = -1;
}
}
}
assert (!SHOULD_CHECK_CONSISTENCY) || checkConsistency();
return true;
} else {
return false; // the rid is not found
}
} | boolean function(int rid) { NavigableMap<Integer,Set<Integer>> timeToTid = ridToTimeToTid.remove(rid); if (timeToTid != null) { for(int dt : timeToTid.keySet()) { if (timeToRidToTid.containsKey(dt)) { timeToRidToTid.get(dt).remove(rid); } if (grids.containsKey(dt)) { int[] grid = grids.get(dt); for(int tid : timeToTid.get(dt)) { grid[tid] = -1; } } } assert (!SHOULD_CHECK_CONSISTENCY) checkConsistency(); return true; } else { return false; } } | /**
* Cancel a reservation
*
* @param rid the reservation ID
* @return whether the cancellation is successful
*/ | Cancel a reservation | cancel | {
"repo_name": "Xanders94/AIM-Simulator",
"path": "src/main/java/aim4/im/v2i/reservation/ReservationArray.java",
"license": "gpl-3.0",
"size": 13945
} | [
"java.util.NavigableMap",
"java.util.Set"
] | import java.util.NavigableMap; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 116,908 |
public String getTypeDescription(File file)
{
return null;
} | String function(File file) { return null; } | /**
* Returns a description for the type of the specified file. This method
* always returns <code>null</code> and should be overridden by subclasses.
*
* @param file the file.
*
* @return Always <code>null</code>.
*/ | Returns a description for the type of the specified file. This method always returns <code>null</code> and should be overridden by subclasses | getTypeDescription | {
"repo_name": "shaotuanchen/sunflower_exp",
"path": "tools/source/gcc-4.2.4/libjava/classpath/javax/swing/filechooser/FileView.java",
"license": "bsd-3-clause",
"size": 3732
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 57,614 |
public void setRecord( final MfRecord record ) {
final int id = record.getParam( POS_OBJECT_ID );
setObjectId( id );
} | void function( final MfRecord record ) { final int id = record.getParam( POS_OBJECT_ID ); setObjectId( id ); } | /**
* Reads the command data from the given record and adjusts the internal parameters according to the data parsed.
* <p/>
* After the raw record was read from the datasource, the record is parsed by the concrete implementation.
*
* @param record the raw data that makes up the record.
*/ | Reads the command data from the given record and adjusts the internal parameters according to the data parsed. After the raw record was read from the datasource, the record is parsed by the concrete implementation | setRecord | {
"repo_name": "EgorZhuk/pentaho-reporting",
"path": "libraries/libpixie/src/main/java/org/pentaho/reporting/libraries/pixie/wmf/records/MfCmdSelectPalette.java",
"license": "lgpl-2.1",
"size": 4009
} | [
"org.pentaho.reporting.libraries.pixie.wmf.MfRecord"
] | import org.pentaho.reporting.libraries.pixie.wmf.MfRecord; | import org.pentaho.reporting.libraries.pixie.wmf.*; | [
"org.pentaho.reporting"
] | org.pentaho.reporting; | 250,301 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.