id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
164,300 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CTInboxBaseMessageViewHolder.java | CTInboxBaseMessageViewHolder.calculateDisplayTimestamp | String calculateDisplayTimestamp(long time){
long now = System.currentTimeMillis()/1000;
long diff = now-time;
if(diff < 60){
return "Just Now";
}else if(diff > 60 && diff < 59*60){
return (diff/(60)) + " mins ago";
}else if(diff > 59*60 && diff < 23*59*60... | java | String calculateDisplayTimestamp(long time){
long now = System.currentTimeMillis()/1000;
long diff = now-time;
if(diff < 60){
return "Just Now";
}else if(diff > 60 && diff < 59*60){
return (diff/(60)) + " mins ago";
}else if(diff > 59*60 && diff < 23*59*60... | [
"String",
"calculateDisplayTimestamp",
"(",
"long",
"time",
")",
"{",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"/",
"1000",
";",
"long",
"diff",
"=",
"now",
"-",
"time",
";",
"if",
"(",
"diff",
"<",
"60",
")",
"{",
"return",
... | Logic for timestamp
@param time Epoch date of creation
@return String timestamp | [
"Logic",
"for",
"timestamp"
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CTInboxBaseMessageViewHolder.java#L71-L87 |
164,301 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CTInboxStyleConfig.java | CTInboxStyleConfig.setTabs | public void setTabs(ArrayList<String>tabs) {
if (tabs == null || tabs.size() <= 0) return;
if (platformSupportsTabs) {
ArrayList<String> toAdd;
if (tabs.size() > MAX_TABS) {
toAdd = new ArrayList<>(tabs.subList(0, MAX_TABS));
} else {
... | java | public void setTabs(ArrayList<String>tabs) {
if (tabs == null || tabs.size() <= 0) return;
if (platformSupportsTabs) {
ArrayList<String> toAdd;
if (tabs.size() > MAX_TABS) {
toAdd = new ArrayList<>(tabs.subList(0, MAX_TABS));
} else {
... | [
"public",
"void",
"setTabs",
"(",
"ArrayList",
"<",
"String",
">",
"tabs",
")",
"{",
"if",
"(",
"tabs",
"==",
"null",
"||",
"tabs",
".",
"size",
"(",
")",
"<=",
"0",
")",
"return",
";",
"if",
"(",
"platformSupportsTabs",
")",
"{",
"ArrayList",
"<",
... | Sets the name of the optional two tabs.
The contents of the tabs are filtered based on the name of the tab.
@param tabs ArrayList of Strings | [
"Sets",
"the",
"name",
"of",
"the",
"optional",
"two",
"tabs",
".",
"The",
"contents",
"of",
"the",
"tabs",
"are",
"filtered",
"based",
"on",
"the",
"name",
"of",
"the",
"tab",
"."
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CTInboxStyleConfig.java#L184-L198 |
164,302 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/EventHandler.java | EventHandler.push | @Deprecated
@SuppressWarnings("deprecation")
public void push(String eventName, HashMap<String, Object> chargeDetails,
ArrayList<HashMap<String, Object>> items)
throws InvalidEventNameException {
// This method is for only charged events
if (!eventName.equals(Con... | java | @Deprecated
@SuppressWarnings("deprecation")
public void push(String eventName, HashMap<String, Object> chargeDetails,
ArrayList<HashMap<String, Object>> items)
throws InvalidEventNameException {
// This method is for only charged events
if (!eventName.equals(Con... | [
"@",
"Deprecated",
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"void",
"push",
"(",
"String",
"eventName",
",",
"HashMap",
"<",
"String",
",",
"Object",
">",
"chargeDetails",
",",
"ArrayList",
"<",
"HashMap",
"<",
"String",
",",
"Object",
... | Push an event which describes a purchase made.
@param eventName Has to be specified as "Charged". Anything other than this
will result in an {@link InvalidEventNameException} being thrown.
@param chargeDetails A {@link HashMap}, with keys as strings, and values as {@link String},
{@link Integer}, {@link Long}, {@l... | [
"Push",
"an",
"event",
"which",
"describes",
"a",
"purchase",
"made",
"."
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/EventHandler.java#L68-L83 |
164,303 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CTInboxMessage.java | CTInboxMessage.getCarouselImages | public ArrayList<String> getCarouselImages(){
ArrayList<String> carouselImages = new ArrayList<>();
for(CTInboxMessageContent ctInboxMessageContent: getInboxMessageContents()){
carouselImages.add(ctInboxMessageContent.getMedia());
}
return carouselImages;
} | java | public ArrayList<String> getCarouselImages(){
ArrayList<String> carouselImages = new ArrayList<>();
for(CTInboxMessageContent ctInboxMessageContent: getInboxMessageContents()){
carouselImages.add(ctInboxMessageContent.getMedia());
}
return carouselImages;
} | [
"public",
"ArrayList",
"<",
"String",
">",
"getCarouselImages",
"(",
")",
"{",
"ArrayList",
"<",
"String",
">",
"carouselImages",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"CTInboxMessageContent",
"ctInboxMessageContent",
":",
"getInboxMessageConte... | Returns an ArrayList of String URLs of the Carousel Images
@return ArrayList of Strings | [
"Returns",
"an",
"ArrayList",
"of",
"String",
"URLs",
"of",
"the",
"Carousel",
"Images"
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CTInboxMessage.java#L251-L257 |
164,304 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java | DBAdapter.storeObject | synchronized int storeObject(JSONObject obj, Table table) {
if (!this.belowMemThreshold()) {
Logger.v("There is not enough space left on the device to store data, data discarded");
return DB_OUT_OF_MEMORY_ERROR;
}
final String tableName = table.getName();
Cursor... | java | synchronized int storeObject(JSONObject obj, Table table) {
if (!this.belowMemThreshold()) {
Logger.v("There is not enough space left on the device to store data, data discarded");
return DB_OUT_OF_MEMORY_ERROR;
}
final String tableName = table.getName();
Cursor... | [
"synchronized",
"int",
"storeObject",
"(",
"JSONObject",
"obj",
",",
"Table",
"table",
")",
"{",
"if",
"(",
"!",
"this",
".",
"belowMemThreshold",
"(",
")",
")",
"{",
"Logger",
".",
"v",
"(",
"\"There is not enough space left on the device to store data, data discar... | Adds a JSON string to the DB.
@param obj the JSON to record
@param table the table to insert into
@return the number of rows in the table, or DB_OUT_OF_MEMORY_ERROR/DB_UPDATE_ERROR | [
"Adds",
"a",
"JSON",
"string",
"to",
"the",
"DB",
"."
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java#L209-L246 |
164,305 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java | DBAdapter.storeUserProfile | synchronized long storeUserProfile(String id, JSONObject obj) {
if (id == null) return DB_UPDATE_ERROR;
if (!this.belowMemThreshold()) {
getConfigLogger().verbose("There is not enough space left on the device to store data, data discarded");
return DB_OUT_OF_MEMORY_ERROR;
... | java | synchronized long storeUserProfile(String id, JSONObject obj) {
if (id == null) return DB_UPDATE_ERROR;
if (!this.belowMemThreshold()) {
getConfigLogger().verbose("There is not enough space left on the device to store data, data discarded");
return DB_OUT_OF_MEMORY_ERROR;
... | [
"synchronized",
"long",
"storeUserProfile",
"(",
"String",
"id",
",",
"JSONObject",
"obj",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"return",
"DB_UPDATE_ERROR",
";",
"if",
"(",
"!",
"this",
".",
"belowMemThreshold",
"(",
")",
")",
"{",
"getConfigLogge... | Adds a JSON string representing to the DB.
@param obj the JSON to record
@return the number of rows in the table, or DB_OUT_OF_MEMORY_ERROR/DB_UPDATE_ERROR | [
"Adds",
"a",
"JSON",
"string",
"representing",
"to",
"the",
"DB",
"."
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java#L254-L280 |
164,306 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java | DBAdapter.removeUserProfile | synchronized void removeUserProfile(String id) {
if (id == null) return;
final String tableName = Table.USER_PROFILES.getName();
try {
final SQLiteDatabase db = dbHelper.getWritableDatabase();
db.delete(tableName, "_id = ?", new String[]{id});
} catch (final SQLi... | java | synchronized void removeUserProfile(String id) {
if (id == null) return;
final String tableName = Table.USER_PROFILES.getName();
try {
final SQLiteDatabase db = dbHelper.getWritableDatabase();
db.delete(tableName, "_id = ?", new String[]{id});
} catch (final SQLi... | [
"synchronized",
"void",
"removeUserProfile",
"(",
"String",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"return",
";",
"final",
"String",
"tableName",
"=",
"Table",
".",
"USER_PROFILES",
".",
"getName",
"(",
")",
";",
"try",
"{",
"final",
"SQLite... | remove the user profile with id from the db. | [
"remove",
"the",
"user",
"profile",
"with",
"id",
"from",
"the",
"db",
"."
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java#L285-L298 |
164,307 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java | DBAdapter.removeEvents | synchronized void removeEvents(Table table) {
final String tName = table.getName();
try {
final SQLiteDatabase db = dbHelper.getWritableDatabase();
db.delete(tName, null, null);
} catch (final SQLiteException e) {
getConfigLogger().verbose("Error removing all... | java | synchronized void removeEvents(Table table) {
final String tName = table.getName();
try {
final SQLiteDatabase db = dbHelper.getWritableDatabase();
db.delete(tName, null, null);
} catch (final SQLiteException e) {
getConfigLogger().verbose("Error removing all... | [
"synchronized",
"void",
"removeEvents",
"(",
"Table",
"table",
")",
"{",
"final",
"String",
"tName",
"=",
"table",
".",
"getName",
"(",
")",
";",
"try",
"{",
"final",
"SQLiteDatabase",
"db",
"=",
"dbHelper",
".",
"getWritableDatabase",
"(",
")",
";",
"db",... | Removes all events from table
@param table the table to remove events | [
"Removes",
"all",
"events",
"from",
"table"
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java#L338-L350 |
164,308 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java | DBAdapter.fetchEvents | synchronized JSONObject fetchEvents(Table table, final int limit) {
final String tName = table.getName();
Cursor cursor = null;
String lastId = null;
final JSONArray events = new JSONArray();
//noinspection TryFinallyCanBeTryWithResources
try {
final SQLiteD... | java | synchronized JSONObject fetchEvents(Table table, final int limit) {
final String tName = table.getName();
Cursor cursor = null;
String lastId = null;
final JSONArray events = new JSONArray();
//noinspection TryFinallyCanBeTryWithResources
try {
final SQLiteD... | [
"synchronized",
"JSONObject",
"fetchEvents",
"(",
"Table",
"table",
",",
"final",
"int",
"limit",
")",
"{",
"final",
"String",
"tName",
"=",
"table",
".",
"getName",
"(",
")",
";",
"Cursor",
"cursor",
"=",
"null",
";",
"String",
"lastId",
"=",
"null",
";... | Returns a JSONObject keyed with the lastId retrieved and a value of a JSONArray of the retrieved JSONObject events
@param table the table to read from
@return JSONObject containing the max row ID and a JSONArray of the JSONObject events or null | [
"Returns",
"a",
"JSONObject",
"keyed",
"with",
"the",
"lastId",
"retrieved",
"and",
"a",
"value",
"of",
"a",
"JSONArray",
"of",
"the",
"retrieved",
"JSONObject",
"events"
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java#L413-L459 |
164,309 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java | DBAdapter.storeUninstallTimestamp | synchronized void storeUninstallTimestamp() {
if (!this.belowMemThreshold()) {
getConfigLogger().verbose("There is not enough space left on the device to store data, data discarded");
return ;
}
final String tableName = Table.UNINSTALL_TS.getName();
try {
... | java | synchronized void storeUninstallTimestamp() {
if (!this.belowMemThreshold()) {
getConfigLogger().verbose("There is not enough space left on the device to store data, data discarded");
return ;
}
final String tableName = Table.UNINSTALL_TS.getName();
try {
... | [
"synchronized",
"void",
"storeUninstallTimestamp",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"belowMemThreshold",
"(",
")",
")",
"{",
"getConfigLogger",
"(",
")",
".",
"verbose",
"(",
"\"There is not enough space left on the device to store data, data discarded\"",
")... | Adds a String timestamp representing uninstall flag to the DB. | [
"Adds",
"a",
"String",
"timestamp",
"representing",
"uninstall",
"flag",
"to",
"the",
"DB",
"."
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java#L588-L608 |
164,310 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java | DBAdapter.deleteMessageForId | synchronized boolean deleteMessageForId(String messageId, String userId){
if(messageId == null || userId == null) return false;
final String tName = Table.INBOX_MESSAGES.getName();
try {
final SQLiteDatabase db = dbHelper.getWritableDatabase();
db.delete(tName, _ID + " ... | java | synchronized boolean deleteMessageForId(String messageId, String userId){
if(messageId == null || userId == null) return false;
final String tName = Table.INBOX_MESSAGES.getName();
try {
final SQLiteDatabase db = dbHelper.getWritableDatabase();
db.delete(tName, _ID + " ... | [
"synchronized",
"boolean",
"deleteMessageForId",
"(",
"String",
"messageId",
",",
"String",
"userId",
")",
"{",
"if",
"(",
"messageId",
"==",
"null",
"||",
"userId",
"==",
"null",
")",
"return",
"false",
";",
"final",
"String",
"tName",
"=",
"Table",
".",
... | Deletes the inbox message for given messageId
@param messageId String messageId
@return boolean value based on success of operation | [
"Deletes",
"the",
"inbox",
"message",
"for",
"given",
"messageId"
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java#L672-L687 |
164,311 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java | DBAdapter.markReadMessageForId | synchronized boolean markReadMessageForId(String messageId, String userId){
if(messageId == null || userId == null) return false;
final String tName = Table.INBOX_MESSAGES.getName();
try{
final SQLiteDatabase db = dbHelper.getWritableDatabase();
ContentValues cv = new Co... | java | synchronized boolean markReadMessageForId(String messageId, String userId){
if(messageId == null || userId == null) return false;
final String tName = Table.INBOX_MESSAGES.getName();
try{
final SQLiteDatabase db = dbHelper.getWritableDatabase();
ContentValues cv = new Co... | [
"synchronized",
"boolean",
"markReadMessageForId",
"(",
"String",
"messageId",
",",
"String",
"userId",
")",
"{",
"if",
"(",
"messageId",
"==",
"null",
"||",
"userId",
"==",
"null",
")",
"return",
"false",
";",
"final",
"String",
"tName",
"=",
"Table",
".",
... | Marks inbox message as read for given messageId
@param messageId String messageId
@return boolean value depending on success of operation | [
"Marks",
"inbox",
"message",
"as",
"read",
"for",
"given",
"messageId"
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java#L694-L710 |
164,312 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java | DBAdapter.getMessages | synchronized ArrayList<CTMessageDAO> getMessages(String userId){
final String tName = Table.INBOX_MESSAGES.getName();
Cursor cursor;
ArrayList<CTMessageDAO> messageDAOArrayList = new ArrayList<>();
try{
final SQLiteDatabase db = dbHelper.getWritableDatabase();
cur... | java | synchronized ArrayList<CTMessageDAO> getMessages(String userId){
final String tName = Table.INBOX_MESSAGES.getName();
Cursor cursor;
ArrayList<CTMessageDAO> messageDAOArrayList = new ArrayList<>();
try{
final SQLiteDatabase db = dbHelper.getWritableDatabase();
cur... | [
"synchronized",
"ArrayList",
"<",
"CTMessageDAO",
">",
"getMessages",
"(",
"String",
"userId",
")",
"{",
"final",
"String",
"tName",
"=",
"Table",
".",
"INBOX_MESSAGES",
".",
"getName",
"(",
")",
";",
"Cursor",
"cursor",
";",
"ArrayList",
"<",
"CTMessageDAO",
... | Retrieves list of inbox messages based on given userId
@param userId String userid
@return ArrayList of {@link CTMessageDAO} | [
"Retrieves",
"list",
"of",
"inbox",
"messages",
"based",
"on",
"given",
"userId"
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java#L717-L750 |
164,313 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java | GifHeaderParser.readContents | private void readContents(int maxFrames) {
// Read GIF file content blocks.
boolean done = false;
while (!(done || err() || header.frameCount > maxFrames)) {
int code = read();
switch (code) {
// Image separator.
case 0x2C:
... | java | private void readContents(int maxFrames) {
// Read GIF file content blocks.
boolean done = false;
while (!(done || err() || header.frameCount > maxFrames)) {
int code = read();
switch (code) {
// Image separator.
case 0x2C:
... | [
"private",
"void",
"readContents",
"(",
"int",
"maxFrames",
")",
"{",
"// Read GIF file content blocks.",
"boolean",
"done",
"=",
"false",
";",
"while",
"(",
"!",
"(",
"done",
"||",
"err",
"(",
")",
"||",
"header",
".",
"frameCount",
">",
"maxFrames",
")",
... | Main file parser. Reads GIF content blocks. Stops after reading maxFrames | [
"Main",
"file",
"parser",
".",
"Reads",
"GIF",
"content",
"blocks",
".",
"Stops",
"after",
"reading",
"maxFrames"
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java#L115-L180 |
164,314 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java | GifHeaderParser.readBitmap | private void readBitmap() {
// (sub)image position & size.
header.currentFrame.ix = readShort();
header.currentFrame.iy = readShort();
header.currentFrame.iw = readShort();
header.currentFrame.ih = readShort();
int packed = read();
// 1 - local color table flag i... | java | private void readBitmap() {
// (sub)image position & size.
header.currentFrame.ix = readShort();
header.currentFrame.iy = readShort();
header.currentFrame.iw = readShort();
header.currentFrame.ih = readShort();
int packed = read();
// 1 - local color table flag i... | [
"private",
"void",
"readBitmap",
"(",
")",
"{",
"// (sub)image position & size.",
"header",
".",
"currentFrame",
".",
"ix",
"=",
"readShort",
"(",
")",
";",
"header",
".",
"currentFrame",
".",
"iy",
"=",
"readShort",
"(",
")",
";",
"header",
".",
"currentFra... | Reads next frame image. | [
"Reads",
"next",
"frame",
"image",
"."
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java#L213-L249 |
164,315 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java | GifHeaderParser.readNetscapeExt | private void readNetscapeExt() {
do {
readBlock();
if (block[0] == 1) {
// Loop count sub-block.
int b1 = ((int) block[1]) & 0xff;
int b2 = ((int) block[2]) & 0xff;
header.loopCount = (b2 << 8) | b1;
if(heade... | java | private void readNetscapeExt() {
do {
readBlock();
if (block[0] == 1) {
// Loop count sub-block.
int b1 = ((int) block[1]) & 0xff;
int b2 = ((int) block[2]) & 0xff;
header.loopCount = (b2 << 8) | b1;
if(heade... | [
"private",
"void",
"readNetscapeExt",
"(",
")",
"{",
"do",
"{",
"readBlock",
"(",
")",
";",
"if",
"(",
"block",
"[",
"0",
"]",
"==",
"1",
")",
"{",
"// Loop count sub-block.",
"int",
"b1",
"=",
"(",
"(",
"int",
")",
"block",
"[",
"1",
"]",
")",
"... | Reads Netscape extension to obtain iteration count. | [
"Reads",
"Netscape",
"extension",
"to",
"obtain",
"iteration",
"count",
"."
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java#L254-L267 |
164,316 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java | GifHeaderParser.readLSD | private void readLSD() {
// Logical screen size.
header.width = readShort();
header.height = readShort();
// Packed fields
int packed = read();
// 1 : global color table flag.
header.gctFlag = (packed & 0x80) != 0;
// 2-4 : color resolution.
// 5 :... | java | private void readLSD() {
// Logical screen size.
header.width = readShort();
header.height = readShort();
// Packed fields
int packed = read();
// 1 : global color table flag.
header.gctFlag = (packed & 0x80) != 0;
// 2-4 : color resolution.
// 5 :... | [
"private",
"void",
"readLSD",
"(",
")",
"{",
"// Logical screen size.",
"header",
".",
"width",
"=",
"readShort",
"(",
")",
";",
"header",
".",
"height",
"=",
"readShort",
"(",
")",
";",
"// Packed fields",
"int",
"packed",
"=",
"read",
"(",
")",
";",
"/... | Reads Logical Screen Descriptor. | [
"Reads",
"Logical",
"Screen",
"Descriptor",
"."
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java#L292-L308 |
164,317 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java | GifHeaderParser.readColorTable | private int[] readColorTable(int ncolors) {
int nbytes = 3 * ncolors;
int[] tab = null;
byte[] c = new byte[nbytes];
try {
rawData.get(c);
// Max size to avoid bounds checks.
tab = new int[MAX_BLOCK_SIZE];
int i = 0;
int j = 0... | java | private int[] readColorTable(int ncolors) {
int nbytes = 3 * ncolors;
int[] tab = null;
byte[] c = new byte[nbytes];
try {
rawData.get(c);
// Max size to avoid bounds checks.
tab = new int[MAX_BLOCK_SIZE];
int i = 0;
int j = 0... | [
"private",
"int",
"[",
"]",
"readColorTable",
"(",
"int",
"ncolors",
")",
"{",
"int",
"nbytes",
"=",
"3",
"*",
"ncolors",
";",
"int",
"[",
"]",
"tab",
"=",
"null",
";",
"byte",
"[",
"]",
"c",
"=",
"new",
"byte",
"[",
"nbytes",
"]",
";",
"try",
... | Reads color table as 256 RGB integer values.
@param ncolors int number of colors to read.
@return int array containing 256 colors (packed ARGB with full alpha). | [
"Reads",
"color",
"table",
"as",
"256",
"RGB",
"integer",
"values",
"."
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java#L316-L342 |
164,318 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java | GifHeaderParser.skip | private void skip() {
try {
int blockSize;
do {
blockSize = read();
rawData.position(rawData.position() + blockSize);
} while (blockSize > 0);
} catch (IllegalArgumentException ex) {
}
} | java | private void skip() {
try {
int blockSize;
do {
blockSize = read();
rawData.position(rawData.position() + blockSize);
} while (blockSize > 0);
} catch (IllegalArgumentException ex) {
}
} | [
"private",
"void",
"skip",
"(",
")",
"{",
"try",
"{",
"int",
"blockSize",
";",
"do",
"{",
"blockSize",
"=",
"read",
"(",
")",
";",
"rawData",
".",
"position",
"(",
"rawData",
".",
"position",
"(",
")",
"+",
"blockSize",
")",
";",
"}",
"while",
"(",... | Skips variable length blocks up to and including next zero length block. | [
"Skips",
"variable",
"length",
"blocks",
"up",
"to",
"and",
"including",
"next",
"zero",
"length",
"block",
"."
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java#L357-L366 |
164,319 | CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java | GifHeaderParser.read | private int read() {
int curByte = 0;
try {
curByte = rawData.get() & 0xFF;
} catch (Exception e) {
header.status = GifDecoder.STATUS_FORMAT_ERROR;
}
return curByte;
} | java | private int read() {
int curByte = 0;
try {
curByte = rawData.get() & 0xFF;
} catch (Exception e) {
header.status = GifDecoder.STATUS_FORMAT_ERROR;
}
return curByte;
} | [
"private",
"int",
"read",
"(",
")",
"{",
"int",
"curByte",
"=",
"0",
";",
"try",
"{",
"curByte",
"=",
"rawData",
".",
"get",
"(",
")",
"&",
"0xFF",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"header",
".",
"status",
"=",
"GifDecoder",
".... | Reads a single byte from the input stream. | [
"Reads",
"a",
"single",
"byte",
"from",
"the",
"input",
"stream",
"."
] | be134c06a4f07494c398335ad9ff4976633743e1 | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/GifHeaderParser.java#L399-L407 |
164,320 | SpoonLabs/gumtree-spoon-ast-diff | src/main/java/gumtree/spoon/builder/TreeScanner.java | TreeScanner.isToIgnore | private boolean isToIgnore(CtElement element) {
if (element instanceof CtStatementList && !(element instanceof CtCase)) {
if (element.getRoleInParent() == CtRole.ELSE || element.getRoleInParent() == CtRole.THEN) {
return false;
}
return true;
}
return element.isImplicit() || element instanceof CtRefe... | java | private boolean isToIgnore(CtElement element) {
if (element instanceof CtStatementList && !(element instanceof CtCase)) {
if (element.getRoleInParent() == CtRole.ELSE || element.getRoleInParent() == CtRole.THEN) {
return false;
}
return true;
}
return element.isImplicit() || element instanceof CtRefe... | [
"private",
"boolean",
"isToIgnore",
"(",
"CtElement",
"element",
")",
"{",
"if",
"(",
"element",
"instanceof",
"CtStatementList",
"&&",
"!",
"(",
"element",
"instanceof",
"CtCase",
")",
")",
"{",
"if",
"(",
"element",
".",
"getRoleInParent",
"(",
")",
"==",
... | Ignore some element from the AST
@param element
@return | [
"Ignore",
"some",
"element",
"from",
"the",
"AST"
] | 361364ddaad3e8f0921a068275d4d21b6e836e85 | https://github.com/SpoonLabs/gumtree-spoon-ast-diff/blob/361364ddaad3e8f0921a068275d4d21b6e836e85/src/main/java/gumtree/spoon/builder/TreeScanner.java#L71-L79 |
164,321 | SpoonLabs/gumtree-spoon-ast-diff | src/main/java/gumtree/spoon/builder/Json4SpoonGenerator.java | Json4SpoonGenerator.getJSONwithOperations | public JsonObject getJSONwithOperations(TreeContext context, ITree tree, List<Operation> operations) {
OperationNodePainter opNodePainter = new OperationNodePainter(operations);
Collection<NodePainter> painters = new ArrayList<NodePainter>();
painters.add(opNodePainter);
return getJSONwithCustorLabels(context,... | java | public JsonObject getJSONwithOperations(TreeContext context, ITree tree, List<Operation> operations) {
OperationNodePainter opNodePainter = new OperationNodePainter(operations);
Collection<NodePainter> painters = new ArrayList<NodePainter>();
painters.add(opNodePainter);
return getJSONwithCustorLabels(context,... | [
"public",
"JsonObject",
"getJSONwithOperations",
"(",
"TreeContext",
"context",
",",
"ITree",
"tree",
",",
"List",
"<",
"Operation",
">",
"operations",
")",
"{",
"OperationNodePainter",
"opNodePainter",
"=",
"new",
"OperationNodePainter",
"(",
"operations",
")",
";"... | Decorates a node with the affected operator, if any.
@param context
@param tree
@param operations
@return | [
"Decorates",
"a",
"node",
"with",
"the",
"affected",
"operator",
"if",
"any",
"."
] | 361364ddaad3e8f0921a068275d4d21b6e836e85 | https://github.com/SpoonLabs/gumtree-spoon-ast-diff/blob/361364ddaad3e8f0921a068275d4d21b6e836e85/src/main/java/gumtree/spoon/builder/Json4SpoonGenerator.java#L76-L82 |
164,322 | SpoonLabs/gumtree-spoon-ast-diff | src/main/java/gumtree/spoon/diff/ActionClassifier.java | ActionClassifier.getRootActions | public List<Action> getRootActions() {
final List<Action> rootActions = srcUpdTrees.stream().map(t -> originalActionsSrc.get(t))
.collect(Collectors.toList());
rootActions.addAll(srcDelTrees.stream() //
.filter(t -> !srcDelTrees.contains(t.getParent()) && !srcUpdTrees.contains(t.getParent())) //
.map(t... | java | public List<Action> getRootActions() {
final List<Action> rootActions = srcUpdTrees.stream().map(t -> originalActionsSrc.get(t))
.collect(Collectors.toList());
rootActions.addAll(srcDelTrees.stream() //
.filter(t -> !srcDelTrees.contains(t.getParent()) && !srcUpdTrees.contains(t.getParent())) //
.map(t... | [
"public",
"List",
"<",
"Action",
">",
"getRootActions",
"(",
")",
"{",
"final",
"List",
"<",
"Action",
">",
"rootActions",
"=",
"srcUpdTrees",
".",
"stream",
"(",
")",
".",
"map",
"(",
"t",
"->",
"originalActionsSrc",
".",
"get",
"(",
"t",
")",
")",
... | This method retrieves ONLY the ROOT actions | [
"This",
"method",
"retrieves",
"ONLY",
"the",
"ROOT",
"actions"
] | 361364ddaad3e8f0921a068275d4d21b6e836e85 | https://github.com/SpoonLabs/gumtree-spoon-ast-diff/blob/361364ddaad3e8f0921a068275d4d21b6e836e85/src/main/java/gumtree/spoon/diff/ActionClassifier.java#L72-L93 |
164,323 | SpoonLabs/gumtree-spoon-ast-diff | src/main/java/gumtree/spoon/AstComparator.java | AstComparator.compare | public Diff compare(File f1, File f2) throws Exception {
return this.compare(getCtType(f1), getCtType(f2));
} | java | public Diff compare(File f1, File f2) throws Exception {
return this.compare(getCtType(f1), getCtType(f2));
} | [
"public",
"Diff",
"compare",
"(",
"File",
"f1",
",",
"File",
"f2",
")",
"throws",
"Exception",
"{",
"return",
"this",
".",
"compare",
"(",
"getCtType",
"(",
"f1",
")",
",",
"getCtType",
"(",
"f2",
")",
")",
";",
"}"
] | compares two java files | [
"compares",
"two",
"java",
"files"
] | 361364ddaad3e8f0921a068275d4d21b6e836e85 | https://github.com/SpoonLabs/gumtree-spoon-ast-diff/blob/361364ddaad3e8f0921a068275d4d21b6e836e85/src/main/java/gumtree/spoon/AstComparator.java#L76-L78 |
164,324 | SpoonLabs/gumtree-spoon-ast-diff | src/main/java/gumtree/spoon/AstComparator.java | AstComparator.compare | public Diff compare(String left, String right) {
return compare(getCtType(left), getCtType(right));
} | java | public Diff compare(String left, String right) {
return compare(getCtType(left), getCtType(right));
} | [
"public",
"Diff",
"compare",
"(",
"String",
"left",
",",
"String",
"right",
")",
"{",
"return",
"compare",
"(",
"getCtType",
"(",
"left",
")",
",",
"getCtType",
"(",
"right",
")",
")",
";",
"}"
] | compares two snippet | [
"compares",
"two",
"snippet"
] | 361364ddaad3e8f0921a068275d4d21b6e836e85 | https://github.com/SpoonLabs/gumtree-spoon-ast-diff/blob/361364ddaad3e8f0921a068275d4d21b6e836e85/src/main/java/gumtree/spoon/AstComparator.java#L83-L85 |
164,325 | SpoonLabs/gumtree-spoon-ast-diff | src/main/java/gumtree/spoon/AstComparator.java | AstComparator.compare | public Diff compare(CtElement left, CtElement right) {
final SpoonGumTreeBuilder scanner = new SpoonGumTreeBuilder();
return new DiffImpl(scanner.getTreeContext(), scanner.getTree(left), scanner.getTree(right));
} | java | public Diff compare(CtElement left, CtElement right) {
final SpoonGumTreeBuilder scanner = new SpoonGumTreeBuilder();
return new DiffImpl(scanner.getTreeContext(), scanner.getTree(left), scanner.getTree(right));
} | [
"public",
"Diff",
"compare",
"(",
"CtElement",
"left",
",",
"CtElement",
"right",
")",
"{",
"final",
"SpoonGumTreeBuilder",
"scanner",
"=",
"new",
"SpoonGumTreeBuilder",
"(",
")",
";",
"return",
"new",
"DiffImpl",
"(",
"scanner",
".",
"getTreeContext",
"(",
")... | compares two AST nodes | [
"compares",
"two",
"AST",
"nodes"
] | 361364ddaad3e8f0921a068275d4d21b6e836e85 | https://github.com/SpoonLabs/gumtree-spoon-ast-diff/blob/361364ddaad3e8f0921a068275d4d21b6e836e85/src/main/java/gumtree/spoon/AstComparator.java#L90-L93 |
164,326 | mcxiaoke/Android-Next | ui/src/main/java/com/mcxiaoke/next/ui/widget/ArrayAdapterCompat.java | ArrayAdapterCompat.set | public void set(int index, T object) {
synchronized (mLock) {
if (mOriginalValues != null) {
mOriginalValues.set(index, object);
} else {
mObjects.set(index, object);
}
}
if (mNotifyOnChange) notifyDataSetChanged();
} | java | public void set(int index, T object) {
synchronized (mLock) {
if (mOriginalValues != null) {
mOriginalValues.set(index, object);
} else {
mObjects.set(index, object);
}
}
if (mNotifyOnChange) notifyDataSetChanged();
} | [
"public",
"void",
"set",
"(",
"int",
"index",
",",
"T",
"object",
")",
"{",
"synchronized",
"(",
"mLock",
")",
"{",
"if",
"(",
"mOriginalValues",
"!=",
"null",
")",
"{",
"mOriginalValues",
".",
"set",
"(",
"index",
",",
"object",
")",
";",
"}",
"else... | set the specified object at index
@param object The object to add at the end of the array. | [
"set",
"the",
"specified",
"object",
"at",
"index"
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/ui/src/main/java/com/mcxiaoke/next/ui/widget/ArrayAdapterCompat.java#L152-L161 |
164,327 | mcxiaoke/Android-Next | ui/src/main/java/com/mcxiaoke/next/ui/widget/ArrayAdapterCompat.java | ArrayAdapterCompat.addAll | public void addAll(int index, T... items) {
List<T> collection = Arrays.asList(items);
synchronized (mLock) {
if (mOriginalValues != null) {
mOriginalValues.addAll(index, collection);
} else {
mObjects.addAll(index, collection);
}
... | java | public void addAll(int index, T... items) {
List<T> collection = Arrays.asList(items);
synchronized (mLock) {
if (mOriginalValues != null) {
mOriginalValues.addAll(index, collection);
} else {
mObjects.addAll(index, collection);
}
... | [
"public",
"void",
"addAll",
"(",
"int",
"index",
",",
"T",
"...",
"items",
")",
"{",
"List",
"<",
"T",
">",
"collection",
"=",
"Arrays",
".",
"asList",
"(",
"items",
")",
";",
"synchronized",
"(",
"mLock",
")",
"{",
"if",
"(",
"mOriginalValues",
"!="... | Inserts the specified objects at the specified index in the array.
@param items The objects to insert into the array.
@param index The index at which the object must be inserted. | [
"Inserts",
"the",
"specified",
"objects",
"at",
"the",
"specified",
"index",
"in",
"the",
"array",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/ui/src/main/java/com/mcxiaoke/next/ui/widget/ArrayAdapterCompat.java#L228-L238 |
164,328 | mcxiaoke/Android-Next | ui/src/main/java/com/mcxiaoke/next/ui/widget/ArrayAdapterCompat.java | ArrayAdapterCompat.removeAt | public void removeAt(int index) {
synchronized (mLock) {
if (mOriginalValues != null) {
mOriginalValues.remove(index);
} else {
mObjects.remove(index);
}
}
if (mNotifyOnChange) notifyDataSetChanged();
} | java | public void removeAt(int index) {
synchronized (mLock) {
if (mOriginalValues != null) {
mOriginalValues.remove(index);
} else {
mObjects.remove(index);
}
}
if (mNotifyOnChange) notifyDataSetChanged();
} | [
"public",
"void",
"removeAt",
"(",
"int",
"index",
")",
"{",
"synchronized",
"(",
"mLock",
")",
"{",
"if",
"(",
"mOriginalValues",
"!=",
"null",
")",
"{",
"mOriginalValues",
".",
"remove",
"(",
"index",
")",
";",
"}",
"else",
"{",
"mObjects",
".",
"rem... | Removes the specified object in index from the array.
@param index The index to remove. | [
"Removes",
"the",
"specified",
"object",
"in",
"index",
"from",
"the",
"array",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/ui/src/main/java/com/mcxiaoke/next/ui/widget/ArrayAdapterCompat.java#L316-L325 |
164,329 | mcxiaoke/Android-Next | ui/src/main/java/com/mcxiaoke/next/ui/widget/ArrayAdapterCompat.java | ArrayAdapterCompat.removeAll | public boolean removeAll(Collection<?> collection) {
boolean result = false;
synchronized (mLock) {
Iterator<?> it;
if (mOriginalValues != null) {
it = mOriginalValues.iterator();
} else {
it = mObjects.iterator();
}
... | java | public boolean removeAll(Collection<?> collection) {
boolean result = false;
synchronized (mLock) {
Iterator<?> it;
if (mOriginalValues != null) {
it = mOriginalValues.iterator();
} else {
it = mObjects.iterator();
}
... | [
"public",
"boolean",
"removeAll",
"(",
"Collection",
"<",
"?",
">",
"collection",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"synchronized",
"(",
"mLock",
")",
"{",
"Iterator",
"<",
"?",
">",
"it",
";",
"if",
"(",
"mOriginalValues",
"!=",
"null",
... | Removes the specified objects.
@param collection The collection to remove. | [
"Removes",
"the",
"specified",
"objects",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/ui/src/main/java/com/mcxiaoke/next/ui/widget/ArrayAdapterCompat.java#L333-L352 |
164,330 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerArrayAdapter.java | AdvancedRecyclerArrayAdapter.addAll | public void addAll(@NonNull final Collection<T> collection) {
final int length = collection.size();
if (length == 0) {
return;
}
synchronized (mLock) {
final int position = getItemCount();
mObjects.addAll(collection);
notifyItemRangeInserte... | java | public void addAll(@NonNull final Collection<T> collection) {
final int length = collection.size();
if (length == 0) {
return;
}
synchronized (mLock) {
final int position = getItemCount();
mObjects.addAll(collection);
notifyItemRangeInserte... | [
"public",
"void",
"addAll",
"(",
"@",
"NonNull",
"final",
"Collection",
"<",
"T",
">",
"collection",
")",
"{",
"final",
"int",
"length",
"=",
"collection",
".",
"size",
"(",
")",
";",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
";",
"}",
"s... | Adds the specified list of objects at the end of the array.
@param collection The objects to add at the end of the array. | [
"Adds",
"the",
"specified",
"list",
"of",
"objects",
"at",
"the",
"end",
"of",
"the",
"array",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerArrayAdapter.java#L81-L91 |
164,331 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerArrayAdapter.java | AdvancedRecyclerArrayAdapter.getItem | @Nullable
public T getItem(final int position) {
if (position < 0 || position >= mObjects.size()) {
return null;
}
return mObjects.get(position);
} | java | @Nullable
public T getItem(final int position) {
if (position < 0 || position >= mObjects.size()) {
return null;
}
return mObjects.get(position);
} | [
"@",
"Nullable",
"public",
"T",
"getItem",
"(",
"final",
"int",
"position",
")",
"{",
"if",
"(",
"position",
"<",
"0",
"||",
"position",
">=",
"mObjects",
".",
"size",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"mObjects",
".",
"get",
... | Returns the item at the specified position.
@param position index of the item to return
@return the item at the specified position or {@code null} when not found | [
"Returns",
"the",
"item",
"at",
"the",
"specified",
"position",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerArrayAdapter.java#L154-L160 |
164,332 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerArrayAdapter.java | AdvancedRecyclerArrayAdapter.replaceItem | public void replaceItem(@NonNull final T oldObject, @NonNull final T newObject) {
synchronized (mLock) {
final int position = getPosition(oldObject);
if (position == -1) {
// not found, don't replace
return;
}
mObjects.remove(posit... | java | public void replaceItem(@NonNull final T oldObject, @NonNull final T newObject) {
synchronized (mLock) {
final int position = getPosition(oldObject);
if (position == -1) {
// not found, don't replace
return;
}
mObjects.remove(posit... | [
"public",
"void",
"replaceItem",
"(",
"@",
"NonNull",
"final",
"T",
"oldObject",
",",
"@",
"NonNull",
"final",
"T",
"newObject",
")",
"{",
"synchronized",
"(",
"mLock",
")",
"{",
"final",
"int",
"position",
"=",
"getPosition",
"(",
"oldObject",
")",
";",
... | replaces the old with the new item. The new item will not be added when the old one is not
found.
@param oldObject will be removed
@param newObject is added only when hte old item is removed | [
"replaces",
"the",
"old",
"with",
"the",
"new",
"item",
".",
"The",
"new",
"item",
"will",
"not",
"be",
"added",
"when",
"the",
"old",
"one",
"is",
"not",
"found",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/AdvancedRecyclerArrayAdapter.java#L283-L308 |
164,333 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/ViewUtils.java | ViewUtils.hideSystemUI | @TargetApi(VERSION_CODES.KITKAT)
public static void hideSystemUI(Activity activity) {
// Set the IMMERSIVE flag.
// Set the content to appear under the system bars so that the content
// doesn't resize when the system bars hideSelf and show.
View decorView = activity.getWindow().getD... | java | @TargetApi(VERSION_CODES.KITKAT)
public static void hideSystemUI(Activity activity) {
// Set the IMMERSIVE flag.
// Set the content to appear under the system bars so that the content
// doesn't resize when the system bars hideSelf and show.
View decorView = activity.getWindow().getD... | [
"@",
"TargetApi",
"(",
"VERSION_CODES",
".",
"KITKAT",
")",
"public",
"static",
"void",
"hideSystemUI",
"(",
"Activity",
"activity",
")",
"{",
"// Set the IMMERSIVE flag.",
"// Set the content to appear under the system bars so that the content",
"// doesn't resize when the syste... | This intro hides the system bars. | [
"This",
"intro",
"hides",
"the",
"system",
"bars",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/ViewUtils.java#L28-L42 |
164,334 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/ViewUtils.java | ViewUtils.showSystemUI | @TargetApi(VERSION_CODES.KITKAT)
public static void showSystemUI(Activity activity) {
View decorView = activity.getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
... | java | @TargetApi(VERSION_CODES.KITKAT)
public static void showSystemUI(Activity activity) {
View decorView = activity.getWindow().getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
... | [
"@",
"TargetApi",
"(",
"VERSION_CODES",
".",
"KITKAT",
")",
"public",
"static",
"void",
"showSystemUI",
"(",
"Activity",
"activity",
")",
"{",
"View",
"decorView",
"=",
"activity",
".",
"getWindow",
"(",
")",
".",
"getDecorView",
"(",
")",
";",
"decorView",
... | except for the ones that make the content appear under the system bars. | [
"except",
"for",
"the",
"ones",
"that",
"make",
"the",
"content",
"appear",
"under",
"the",
"system",
"bars",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/ViewUtils.java#L46-L54 |
164,335 | mcxiaoke/Android-Next | ui/src/main/java/com/mcxiaoke/next/ui/internal/AdapterWrapper.java | AdapterWrapper.getView | @Override
public View getView(int position, View convertView,
ViewGroup parent) {
return (wrapped.getView(position, convertView, parent));
} | java | @Override
public View getView(int position, View convertView,
ViewGroup parent) {
return (wrapped.getView(position, convertView, parent));
} | [
"@",
"Override",
"public",
"View",
"getView",
"(",
"int",
"position",
",",
"View",
"convertView",
",",
"ViewGroup",
"parent",
")",
"{",
"return",
"(",
"wrapped",
".",
"getView",
"(",
"position",
",",
"convertView",
",",
"parent",
")",
")",
";",
"}"
] | Get a View that displays the data at the specified
position in the data set.
@param position Position of the item whose data we want
@param convertView View to recycle, if not null
@param parent ViewGroup containing the returned View | [
"Get",
"a",
"View",
"that",
"displays",
"the",
"data",
"at",
"the",
"specified",
"position",
"in",
"the",
"data",
"set",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/ui/src/main/java/com/mcxiaoke/next/ui/internal/AdapterWrapper.java#L141-L145 |
164,336 | mcxiaoke/Android-Next | ui/src/main/java/com/mcxiaoke/next/ui/dialog/v4/ProgressDialogFragment.java | ProgressDialogFragment.onDismiss | @Override
public void onDismiss(DialogInterface dialog) {
if (mOldDialog != null && mOldDialog == dialog) {
// This is the callback from the old progress dialog that was already dismissed before
// the device orientation change, so just ignore it.
return;
}
... | java | @Override
public void onDismiss(DialogInterface dialog) {
if (mOldDialog != null && mOldDialog == dialog) {
// This is the callback from the old progress dialog that was already dismissed before
// the device orientation change, so just ignore it.
return;
}
... | [
"@",
"Override",
"public",
"void",
"onDismiss",
"(",
"DialogInterface",
"dialog",
")",
"{",
"if",
"(",
"mOldDialog",
"!=",
"null",
"&&",
"mOldDialog",
"==",
"dialog",
")",
"{",
"// This is the callback from the old progress dialog that was already dismissed before",
"// t... | There is a race condition that is not handled properly by the DialogFragment class.
If we don't check that this onDismiss callback isn't for the old progress dialog from before
the device orientation change, then this will cause the newly created dialog after the
orientation change to be dismissed immediately. | [
"There",
"is",
"a",
"race",
"condition",
"that",
"is",
"not",
"handled",
"properly",
"by",
"the",
"DialogFragment",
"class",
".",
"If",
"we",
"don",
"t",
"check",
"that",
"this",
"onDismiss",
"callback",
"isn",
"t",
"for",
"the",
"old",
"progress",
"dialog... | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/ui/src/main/java/com/mcxiaoke/next/ui/dialog/v4/ProgressDialogFragment.java#L123-L131 |
164,337 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/ReflectionUtils.java | ReflectionUtils.isToStringMethod | public static boolean isToStringMethod(Method method) {
return (method != null && method.getName().equals("readString") && method.getParameterTypes().length == 0);
} | java | public static boolean isToStringMethod(Method method) {
return (method != null && method.getName().equals("readString") && method.getParameterTypes().length == 0);
} | [
"public",
"static",
"boolean",
"isToStringMethod",
"(",
"Method",
"method",
")",
"{",
"return",
"(",
"method",
"!=",
"null",
"&&",
"method",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"\"readString\"",
")",
"&&",
"method",
".",
"getParameterTypes",
"(",
... | Determine whether the given method is a "readString" method.
@see Object#toString() | [
"Determine",
"whether",
"the",
"given",
"method",
"is",
"a",
"readString",
"method",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/ReflectionUtils.java#L411-L413 |
164,338 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/ReflectionUtils.java | ReflectionUtils.getUniqueDeclaredMethods | public static Method[] getUniqueDeclaredMethods(Class<?> leafClass) throws IllegalArgumentException {
final List<Method> methods = new ArrayList<Method>(32);
doWithMethods(leafClass, new MethodCallback() {
@Override
public void doWith(Method method) {
boolean know... | java | public static Method[] getUniqueDeclaredMethods(Class<?> leafClass) throws IllegalArgumentException {
final List<Method> methods = new ArrayList<Method>(32);
doWithMethods(leafClass, new MethodCallback() {
@Override
public void doWith(Method method) {
boolean know... | [
"public",
"static",
"Method",
"[",
"]",
"getUniqueDeclaredMethods",
"(",
"Class",
"<",
"?",
">",
"leafClass",
")",
"throws",
"IllegalArgumentException",
"{",
"final",
"List",
"<",
"Method",
">",
"methods",
"=",
"new",
"ArrayList",
"<",
"Method",
">",
"(",
"3... | Get the unique set of declared methods on the leaf class and all superclasses. Leaf
class methods are included first and while traversing the superclass hierarchy any methods found
with signatures matching a method already included are filtered out. | [
"Get",
"the",
"unique",
"set",
"of",
"declared",
"methods",
"on",
"the",
"leaf",
"class",
"and",
"all",
"superclasses",
".",
"Leaf",
"class",
"methods",
"are",
"included",
"first",
"and",
"while",
"traversing",
"the",
"superclass",
"hierarchy",
"any",
"methods... | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/ReflectionUtils.java#L547-L576 |
164,339 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/collection/WeakFastHashMap.java | WeakFastHashMap.put | @Override
public V put(K key, V value) {
if (fast) {
synchronized (this) {
Map<K, V> temp = cloneMap(map);
V result = temp.put(key, value);
map = temp;
return (result);
}
} else {
synchroniz... | java | @Override
public V put(K key, V value) {
if (fast) {
synchronized (this) {
Map<K, V> temp = cloneMap(map);
V result = temp.put(key, value);
map = temp;
return (result);
}
} else {
synchroniz... | [
"@",
"Override",
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"if",
"(",
"fast",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Map",
"<",
"K",
",",
"V",
">",
"temp",
"=",
"cloneMap",
"(",
"map",
")",
";",
"V",
"resu... | Associate the specified value with the specified key in this map.
If the map previously contained a mapping for this key, the old
value is replaced and returned.
@param key the key with which the value is to be associated
@param value the value to be associated with this key
@return the value previously mapped to th... | [
"Associate",
"the",
"specified",
"value",
"with",
"the",
"specified",
"key",
"in",
"this",
"map",
".",
"If",
"the",
"map",
"previously",
"contained",
"a",
"mapping",
"for",
"this",
"key",
"the",
"old",
"value",
"is",
"replaced",
"and",
"returned",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/collection/WeakFastHashMap.java#L357-L371 |
164,340 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/collection/WeakFastHashMap.java | WeakFastHashMap.putAll | @Override
public void putAll(Map<? extends K, ? extends V> in) {
if (fast) {
synchronized (this) {
Map<K, V> temp = cloneMap(map);
temp.putAll(in);
map = temp;
}
} else {
synchronized (map) {
... | java | @Override
public void putAll(Map<? extends K, ? extends V> in) {
if (fast) {
synchronized (this) {
Map<K, V> temp = cloneMap(map);
temp.putAll(in);
map = temp;
}
} else {
synchronized (map) {
... | [
"@",
"Override",
"public",
"void",
"putAll",
"(",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
"in",
")",
"{",
"if",
"(",
"fast",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Map",
"<",
"K",
",",
"V",
">",
"temp",
"=",
... | Copy all of the mappings from the specified map to this one, replacing
any mappings with the same keys.
@param in the map whose mappings are to be copied | [
"Copy",
"all",
"of",
"the",
"mappings",
"from",
"the",
"specified",
"map",
"to",
"this",
"one",
"replacing",
"any",
"mappings",
"with",
"the",
"same",
"keys",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/collection/WeakFastHashMap.java#L382-L395 |
164,341 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/collection/WeakFastHashMap.java | WeakFastHashMap.remove | @Override
public V remove(Object key) {
if (fast) {
synchronized (this) {
Map<K, V> temp = cloneMap(map);
V result = temp.remove(key);
map = temp;
return (result);
}
} else {
synchronized (m... | java | @Override
public V remove(Object key) {
if (fast) {
synchronized (this) {
Map<K, V> temp = cloneMap(map);
V result = temp.remove(key);
map = temp;
return (result);
}
} else {
synchronized (m... | [
"@",
"Override",
"public",
"V",
"remove",
"(",
"Object",
"key",
")",
"{",
"if",
"(",
"fast",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Map",
"<",
"K",
",",
"V",
">",
"temp",
"=",
"cloneMap",
"(",
"map",
")",
";",
"V",
"result",
"=",
"te... | Remove any mapping for this key, and return any previously
mapped value.
@param key the key whose mapping is to be removed
@return the value removed, or null | [
"Remove",
"any",
"mapping",
"for",
"this",
"key",
"and",
"return",
"any",
"previously",
"mapped",
"value",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/collection/WeakFastHashMap.java#L404-L418 |
164,342 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java | IOUtils.isFileExist | public static boolean isFileExist(String filePath) {
if (StringUtils.isEmpty(filePath)) {
return false;
}
File file = new File(filePath);
return (file.exists() && file.isFile());
} | java | public static boolean isFileExist(String filePath) {
if (StringUtils.isEmpty(filePath)) {
return false;
}
File file = new File(filePath);
return (file.exists() && file.isFile());
} | [
"public",
"static",
"boolean",
"isFileExist",
"(",
"String",
"filePath",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"filePath",
")",
")",
"{",
"return",
"false",
";",
"}",
"File",
"file",
"=",
"new",
"File",
"(",
"filePath",
")",
";",
"re... | Indicates if this file represents a file on the underlying file system.
@param filePath
@return | [
"Indicates",
"if",
"this",
"file",
"represents",
"a",
"file",
"on",
"the",
"underlying",
"file",
"system",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java#L1436-L1443 |
164,343 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java | IOUtils.isFolderExist | public static boolean isFolderExist(String directoryPath) {
if (StringUtils.isEmpty(directoryPath)) {
return false;
}
File dire = new File(directoryPath);
return (dire.exists() && dire.isDirectory());
} | java | public static boolean isFolderExist(String directoryPath) {
if (StringUtils.isEmpty(directoryPath)) {
return false;
}
File dire = new File(directoryPath);
return (dire.exists() && dire.isDirectory());
} | [
"public",
"static",
"boolean",
"isFolderExist",
"(",
"String",
"directoryPath",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"directoryPath",
")",
")",
"{",
"return",
"false",
";",
"}",
"File",
"dire",
"=",
"new",
"File",
"(",
"directoryPath",
... | Indicates if this file represents a directory on the underlying file system.
@param directoryPath
@return | [
"Indicates",
"if",
"this",
"file",
"represents",
"a",
"directory",
"on",
"the",
"underlying",
"file",
"system",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java#L1451-L1458 |
164,344 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/AndroidUtils.java | AndroidUtils.addToMediaStore | public static void addToMediaStore(Context context, File file) {
String[] path = new String[]{file.getPath()};
MediaScannerConnection.scanFile(context, path, null, null);
} | java | public static void addToMediaStore(Context context, File file) {
String[] path = new String[]{file.getPath()};
MediaScannerConnection.scanFile(context, path, null, null);
} | [
"public",
"static",
"void",
"addToMediaStore",
"(",
"Context",
"context",
",",
"File",
"file",
")",
"{",
"String",
"[",
"]",
"path",
"=",
"new",
"String",
"[",
"]",
"{",
"file",
".",
"getPath",
"(",
")",
"}",
";",
"MediaScannerConnection",
".",
"scanFile... | another media scan way | [
"another",
"media",
"scan",
"way"
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/AndroidUtils.java#L331-L334 |
164,345 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/io/CountingInputStream.java | CountingInputStream.skip | @Override
public synchronized long skip(final long length) throws IOException {
final long skip = super.skip(length);
this.count += skip;
return skip;
} | java | @Override
public synchronized long skip(final long length) throws IOException {
final long skip = super.skip(length);
this.count += skip;
return skip;
} | [
"@",
"Override",
"public",
"synchronized",
"long",
"skip",
"(",
"final",
"long",
"length",
")",
"throws",
"IOException",
"{",
"final",
"long",
"skip",
"=",
"super",
".",
"skip",
"(",
"length",
")",
";",
"this",
".",
"count",
"+=",
"skip",
";",
"return",
... | Skips the stream over the specified number of bytes, adding the skipped
amount to the count.
@param length the number of bytes to skip
@return the actual number of bytes skipped
@throws java.io.IOException if an I/O error occurs
@see java.io.InputStream#skip(long) | [
"Skips",
"the",
"stream",
"over",
"the",
"specified",
"number",
"of",
"bytes",
"adding",
"the",
"skipped",
"amount",
"to",
"the",
"count",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/io/CountingInputStream.java#L58-L63 |
164,346 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyHeaderItemRangeInserted | public final void notifyHeaderItemRangeInserted(int positionStart, int itemCount) {
int newHeaderItemCount = getHeaderItemCount();
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > newHeaderItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionSta... | java | public final void notifyHeaderItemRangeInserted(int positionStart, int itemCount) {
int newHeaderItemCount = getHeaderItemCount();
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > newHeaderItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionSta... | [
"public",
"final",
"void",
"notifyHeaderItemRangeInserted",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"int",
"newHeaderItemCount",
"=",
"getHeaderItemCount",
"(",
")",
";",
"if",
"(",
"positionStart",
"<",
"0",
"||",
"itemCount",
"<",
"0",
... | Notifies that multiple header items are inserted.
@param positionStart the position.
@param itemCount the item count. | [
"Notifies",
"that",
"multiple",
"header",
"items",
"are",
"inserted",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L132-L138 |
164,347 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyHeaderItemChanged | public final void notifyHeaderItemChanged(int position) {
if (position < 0 || position >= headerItemCount) {
throw new IndexOutOfBoundsException("The given position " + position + " is not within the position bounds for header items [0 - " + (headerItemCount - 1) + "].");
}
notifyIte... | java | public final void notifyHeaderItemChanged(int position) {
if (position < 0 || position >= headerItemCount) {
throw new IndexOutOfBoundsException("The given position " + position + " is not within the position bounds for header items [0 - " + (headerItemCount - 1) + "].");
}
notifyIte... | [
"public",
"final",
"void",
"notifyHeaderItemChanged",
"(",
"int",
"position",
")",
"{",
"if",
"(",
"position",
"<",
"0",
"||",
"position",
">=",
"headerItemCount",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"The given position \"",
"+",
"positio... | Notifies that a header item is changed.
@param position the position. | [
"Notifies",
"that",
"a",
"header",
"item",
"is",
"changed",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L145-L150 |
164,348 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyHeaderItemRangeChanged | public final void notifyHeaderItemRangeChanged(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount >= headerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - " + (positionStart + itemCount - 1) + "] is not w... | java | public final void notifyHeaderItemRangeChanged(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount >= headerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - " + (positionStart + itemCount - 1) + "] is not w... | [
"public",
"final",
"void",
"notifyHeaderItemRangeChanged",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"if",
"(",
"positionStart",
"<",
"0",
"||",
"itemCount",
"<",
"0",
"||",
"positionStart",
"+",
"itemCount",
">=",
"headerItemCount",
")",
... | Notifies that multiple header items are changed.
@param positionStart the position.
@param itemCount the item count. | [
"Notifies",
"that",
"multiple",
"header",
"items",
"are",
"changed",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L158-L163 |
164,349 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyHeaderItemMoved | public void notifyHeaderItemMoved(int fromPosition, int toPosition) {
if (fromPosition < 0 || toPosition < 0 || fromPosition >= headerItemCount || toPosition >= headerItemCount) {
throw new IndexOutOfBoundsException("The given fromPosition " + fromPosition + " or toPosition " + toPosition + " is not... | java | public void notifyHeaderItemMoved(int fromPosition, int toPosition) {
if (fromPosition < 0 || toPosition < 0 || fromPosition >= headerItemCount || toPosition >= headerItemCount) {
throw new IndexOutOfBoundsException("The given fromPosition " + fromPosition + " or toPosition " + toPosition + " is not... | [
"public",
"void",
"notifyHeaderItemMoved",
"(",
"int",
"fromPosition",
",",
"int",
"toPosition",
")",
"{",
"if",
"(",
"fromPosition",
"<",
"0",
"||",
"toPosition",
"<",
"0",
"||",
"fromPosition",
">=",
"headerItemCount",
"||",
"toPosition",
">=",
"headerItemCoun... | Notifies that an existing header item is moved to another position.
@param fromPosition the original position.
@param toPosition the new position. | [
"Notifies",
"that",
"an",
"existing",
"header",
"item",
"is",
"moved",
"to",
"another",
"position",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L172-L177 |
164,350 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyHeaderItemRangeRemoved | public void notifyHeaderItemRangeRemoved(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > headerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - " + (positionStart + itemCount - 1) + "] is not within t... | java | public void notifyHeaderItemRangeRemoved(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > headerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - " + (positionStart + itemCount - 1) + "] is not within t... | [
"public",
"void",
"notifyHeaderItemRangeRemoved",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"if",
"(",
"positionStart",
"<",
"0",
"||",
"itemCount",
"<",
"0",
"||",
"positionStart",
"+",
"itemCount",
">",
"headerItemCount",
")",
"{",
"thr... | Notifies that multiple header items are removed.
@param positionStart the position.
@param itemCount the item count. | [
"Notifies",
"that",
"multiple",
"header",
"items",
"are",
"removed",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L197-L202 |
164,351 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyContentItemInserted | public final void notifyContentItemInserted(int position) {
int newHeaderItemCount = getHeaderItemCount();
int newContentItemCount = getContentItemCount();
if (position < 0 || position >= newContentItemCount) {
throw new IndexOutOfBoundsException("The given position " + position + " ... | java | public final void notifyContentItemInserted(int position) {
int newHeaderItemCount = getHeaderItemCount();
int newContentItemCount = getContentItemCount();
if (position < 0 || position >= newContentItemCount) {
throw new IndexOutOfBoundsException("The given position " + position + " ... | [
"public",
"final",
"void",
"notifyContentItemInserted",
"(",
"int",
"position",
")",
"{",
"int",
"newHeaderItemCount",
"=",
"getHeaderItemCount",
"(",
")",
";",
"int",
"newContentItemCount",
"=",
"getContentItemCount",
"(",
")",
";",
"if",
"(",
"position",
"<",
... | Notifies that a content item is inserted.
@param position the position of the content item. | [
"Notifies",
"that",
"a",
"content",
"item",
"is",
"inserted",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L209-L216 |
164,352 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyContentItemRangeInserted | public final void notifyContentItemRangeInserted(int positionStart, int itemCount) {
int newHeaderItemCount = getHeaderItemCount();
int newContentItemCount = getContentItemCount();
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > newContentItemCount) {
throw new ... | java | public final void notifyContentItemRangeInserted(int positionStart, int itemCount) {
int newHeaderItemCount = getHeaderItemCount();
int newContentItemCount = getContentItemCount();
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > newContentItemCount) {
throw new ... | [
"public",
"final",
"void",
"notifyContentItemRangeInserted",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"int",
"newHeaderItemCount",
"=",
"getHeaderItemCount",
"(",
")",
";",
"int",
"newContentItemCount",
"=",
"getContentItemCount",
"(",
")",
";... | Notifies that multiple content items are inserted.
@param positionStart the position.
@param itemCount the item count. | [
"Notifies",
"that",
"multiple",
"content",
"items",
"are",
"inserted",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L224-L233 |
164,353 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyContentItemChanged | public final void notifyContentItemChanged(int position) {
if (position < 0 || position >= contentItemCount) {
throw new IndexOutOfBoundsException("The given position " + position
+ " is not within the position bounds for content items [0 - " + (contentItemCount - 1) + "].");
... | java | public final void notifyContentItemChanged(int position) {
if (position < 0 || position >= contentItemCount) {
throw new IndexOutOfBoundsException("The given position " + position
+ " is not within the position bounds for content items [0 - " + (contentItemCount - 1) + "].");
... | [
"public",
"final",
"void",
"notifyContentItemChanged",
"(",
"int",
"position",
")",
"{",
"if",
"(",
"position",
"<",
"0",
"||",
"position",
">=",
"contentItemCount",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"The given position \"",
"+",
"posit... | Notifies that a content item is changed.
@param position the position. | [
"Notifies",
"that",
"a",
"content",
"item",
"is",
"changed",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L240-L246 |
164,354 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyContentItemRangeChanged | public final void notifyContentItemRangeChanged(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > contentItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCou... | java | public final void notifyContentItemRangeChanged(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > contentItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCou... | [
"public",
"final",
"void",
"notifyContentItemRangeChanged",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"if",
"(",
"positionStart",
"<",
"0",
"||",
"itemCount",
"<",
"0",
"||",
"positionStart",
"+",
"itemCount",
">",
"contentItemCount",
")",
... | Notifies that multiple content items are changed.
@param positionStart the position.
@param itemCount the item count. | [
"Notifies",
"that",
"multiple",
"content",
"items",
"are",
"changed",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L254-L261 |
164,355 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyContentItemMoved | public final void notifyContentItemMoved(int fromPosition, int toPosition) {
if (fromPosition < 0 || toPosition < 0 || fromPosition >= contentItemCount || toPosition >= contentItemCount) {
throw new IndexOutOfBoundsException("The given fromPosition " + fromPosition + " or toPosition "
... | java | public final void notifyContentItemMoved(int fromPosition, int toPosition) {
if (fromPosition < 0 || toPosition < 0 || fromPosition >= contentItemCount || toPosition >= contentItemCount) {
throw new IndexOutOfBoundsException("The given fromPosition " + fromPosition + " or toPosition "
... | [
"public",
"final",
"void",
"notifyContentItemMoved",
"(",
"int",
"fromPosition",
",",
"int",
"toPosition",
")",
"{",
"if",
"(",
"fromPosition",
"<",
"0",
"||",
"toPosition",
"<",
"0",
"||",
"fromPosition",
">=",
"contentItemCount",
"||",
"toPosition",
">=",
"c... | Notifies that an existing content item is moved to another position.
@param fromPosition the original position.
@param toPosition the new position. | [
"Notifies",
"that",
"an",
"existing",
"content",
"item",
"is",
"moved",
"to",
"another",
"position",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L269-L275 |
164,356 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyContentItemRemoved | public final void notifyContentItemRemoved(int position) {
if (position < 0 || position >= contentItemCount) {
throw new IndexOutOfBoundsException("The given position " + position
+ " is not within the position bounds for content items [0 - "
+ (contentItemCou... | java | public final void notifyContentItemRemoved(int position) {
if (position < 0 || position >= contentItemCount) {
throw new IndexOutOfBoundsException("The given position " + position
+ " is not within the position bounds for content items [0 - "
+ (contentItemCou... | [
"public",
"final",
"void",
"notifyContentItemRemoved",
"(",
"int",
"position",
")",
"{",
"if",
"(",
"position",
"<",
"0",
"||",
"position",
">=",
"contentItemCount",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"The given position \"",
"+",
"posit... | Notifies that a content item is removed.
@param position the position. | [
"Notifies",
"that",
"a",
"content",
"item",
"is",
"removed",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L282-L289 |
164,357 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyContentItemRangeRemoved | public final void notifyContentItemRangeRemoved(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > contentItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCou... | java | public final void notifyContentItemRangeRemoved(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > contentItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCou... | [
"public",
"final",
"void",
"notifyContentItemRangeRemoved",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"if",
"(",
"positionStart",
"<",
"0",
"||",
"itemCount",
"<",
"0",
"||",
"positionStart",
"+",
"itemCount",
">",
"contentItemCount",
")",
... | Notifies that multiple content items are removed.
@param positionStart the position.
@param itemCount the item count. | [
"Notifies",
"that",
"multiple",
"content",
"items",
"are",
"removed",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L297-L304 |
164,358 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyFooterItemInserted | public final void notifyFooterItemInserted(int position) {
int newHeaderItemCount = getHeaderItemCount();
int newContentItemCount = getContentItemCount();
int newFooterItemCount = getFooterItemCount();
// if (position < 0 || position >= newFooterItemCount) {
// throw new IndexO... | java | public final void notifyFooterItemInserted(int position) {
int newHeaderItemCount = getHeaderItemCount();
int newContentItemCount = getContentItemCount();
int newFooterItemCount = getFooterItemCount();
// if (position < 0 || position >= newFooterItemCount) {
// throw new IndexO... | [
"public",
"final",
"void",
"notifyFooterItemInserted",
"(",
"int",
"position",
")",
"{",
"int",
"newHeaderItemCount",
"=",
"getHeaderItemCount",
"(",
")",
";",
"int",
"newContentItemCount",
"=",
"getContentItemCount",
"(",
")",
";",
"int",
"newFooterItemCount",
"=",... | Notifies that a footer item is inserted.
@param position the position of the content item. | [
"Notifies",
"that",
"a",
"footer",
"item",
"is",
"inserted",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L311-L321 |
164,359 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyFooterItemRangeInserted | public final void notifyFooterItemRangeInserted(int positionStart, int itemCount) {
int newHeaderItemCount = getHeaderItemCount();
int newContentItemCount = getContentItemCount();
int newFooterItemCount = getFooterItemCount();
if (positionStart < 0 || itemCount < 0 || positionStart + ite... | java | public final void notifyFooterItemRangeInserted(int positionStart, int itemCount) {
int newHeaderItemCount = getHeaderItemCount();
int newContentItemCount = getContentItemCount();
int newFooterItemCount = getFooterItemCount();
if (positionStart < 0 || itemCount < 0 || positionStart + ite... | [
"public",
"final",
"void",
"notifyFooterItemRangeInserted",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"int",
"newHeaderItemCount",
"=",
"getHeaderItemCount",
"(",
")",
";",
"int",
"newContentItemCount",
"=",
"getContentItemCount",
"(",
")",
";"... | Notifies that multiple footer items are inserted.
@param positionStart the position.
@param itemCount the item count. | [
"Notifies",
"that",
"multiple",
"footer",
"items",
"are",
"inserted",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L329-L339 |
164,360 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyFooterItemChanged | public final void notifyFooterItemChanged(int position) {
if (position < 0 || position >= footerItemCount) {
throw new IndexOutOfBoundsException("The given position " + position
+ " is not within the position bounds for footer items [0 - "
+ (footerItemCount -... | java | public final void notifyFooterItemChanged(int position) {
if (position < 0 || position >= footerItemCount) {
throw new IndexOutOfBoundsException("The given position " + position
+ " is not within the position bounds for footer items [0 - "
+ (footerItemCount -... | [
"public",
"final",
"void",
"notifyFooterItemChanged",
"(",
"int",
"position",
")",
"{",
"if",
"(",
"position",
"<",
"0",
"||",
"position",
">=",
"footerItemCount",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"The given position \"",
"+",
"positio... | Notifies that a footer item is changed.
@param position the position. | [
"Notifies",
"that",
"a",
"footer",
"item",
"is",
"changed",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L346-L353 |
164,361 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyFooterItemRangeChanged | public final void notifyFooterItemRangeChanged(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCount... | java | public final void notifyFooterItemRangeChanged(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCount... | [
"public",
"final",
"void",
"notifyFooterItemRangeChanged",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"if",
"(",
"positionStart",
"<",
"0",
"||",
"itemCount",
"<",
"0",
"||",
"positionStart",
"+",
"itemCount",
">",
"footerItemCount",
")",
... | Notifies that multiple footer items are changed.
@param positionStart the position.
@param itemCount the item count. | [
"Notifies",
"that",
"multiple",
"footer",
"items",
"are",
"changed",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L361-L368 |
164,362 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyFooterItemMoved | public final void notifyFooterItemMoved(int fromPosition, int toPosition) {
if (fromPosition < 0 || toPosition < 0 || fromPosition >= footerItemCount || toPosition >= footerItemCount) {
throw new IndexOutOfBoundsException("The given fromPosition " + fromPosition
+ " or toPosition... | java | public final void notifyFooterItemMoved(int fromPosition, int toPosition) {
if (fromPosition < 0 || toPosition < 0 || fromPosition >= footerItemCount || toPosition >= footerItemCount) {
throw new IndexOutOfBoundsException("The given fromPosition " + fromPosition
+ " or toPosition... | [
"public",
"final",
"void",
"notifyFooterItemMoved",
"(",
"int",
"fromPosition",
",",
"int",
"toPosition",
")",
"{",
"if",
"(",
"fromPosition",
"<",
"0",
"||",
"toPosition",
"<",
"0",
"||",
"fromPosition",
">=",
"footerItemCount",
"||",
"toPosition",
">=",
"foo... | Notifies that an existing footer item is moved to another position.
@param fromPosition the original position.
@param toPosition the new position. | [
"Notifies",
"that",
"an",
"existing",
"footer",
"item",
"is",
"moved",
"to",
"another",
"position",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L376-L383 |
164,363 | mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyFooterItemRangeRemoved | public final void notifyFooterItemRangeRemoved(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCount... | java | public final void notifyFooterItemRangeRemoved(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCount... | [
"public",
"final",
"void",
"notifyFooterItemRangeRemoved",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"if",
"(",
"positionStart",
"<",
"0",
"||",
"itemCount",
"<",
"0",
"||",
"positionStart",
"+",
"itemCount",
">",
"footerItemCount",
")",
... | Notifies that multiple footer items are removed.
@param positionStart the position.
@param itemCount the item count. | [
"Notifies",
"that",
"multiple",
"footer",
"items",
"are",
"removed",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L404-L411 |
164,364 | mcxiaoke/Android-Next | ui/src/main/java/com/mcxiaoke/next/ui/list/AdapterExtend.java | AdapterExtend.getView | @Override
public View getView(int position, View convertView, ViewGroup parent) {
if (position == super.getCount() && isEnableRefreshing()) {
return (mFooter);
}
return (super.getView(position, convertView, parent));
} | java | @Override
public View getView(int position, View convertView, ViewGroup parent) {
if (position == super.getCount() && isEnableRefreshing()) {
return (mFooter);
}
return (super.getView(position, convertView, parent));
} | [
"@",
"Override",
"public",
"View",
"getView",
"(",
"int",
"position",
",",
"View",
"convertView",
",",
"ViewGroup",
"parent",
")",
"{",
"if",
"(",
"position",
"==",
"super",
".",
"getCount",
"(",
")",
"&&",
"isEnableRefreshing",
"(",
")",
")",
"{",
"retu... | Get a View that displays the data at the specified
position in the data set. In this case, if we are at
the end of the list and we are still in append mode, we
ask for a pending view and return it, plus kick off the
background task to append more data to the wrapped
adapter.
@param position Position of the item who... | [
"Get",
"a",
"View",
"that",
"displays",
"the",
"data",
"at",
"the",
"specified",
"position",
"in",
"the",
"data",
"set",
".",
"In",
"this",
"case",
"if",
"we",
"are",
"at",
"the",
"end",
"of",
"the",
"list",
"and",
"we",
"are",
"still",
"in",
"append... | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/ui/src/main/java/com/mcxiaoke/next/ui/list/AdapterExtend.java#L146-L152 |
164,365 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/StringUtils.java | StringUtils.addStringToArray | public static String[] addStringToArray(String[] array, String str) {
if (isEmpty(array)) {
return new String[]{str};
}
String[] newArr = new String[array.length + 1];
System.arraycopy(array, 0, newArr, 0, array.length);
newArr[array.length] = str;
return newA... | java | public static String[] addStringToArray(String[] array, String str) {
if (isEmpty(array)) {
return new String[]{str};
}
String[] newArr = new String[array.length + 1];
System.arraycopy(array, 0, newArr, 0, array.length);
newArr[array.length] = str;
return newA... | [
"public",
"static",
"String",
"[",
"]",
"addStringToArray",
"(",
"String",
"[",
"]",
"array",
",",
"String",
"str",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"array",
")",
")",
"{",
"return",
"new",
"String",
"[",
"]",
"{",
"str",
"}",
";",
"}",
"String... | Append the given String to the given String array, returning a new array
consisting of the input array contents plus the given String.
@param array the array to append to (can be <code>null</code>)
@param str the String to append
@return the new array (never <code>null</code>) | [
"Append",
"the",
"given",
"String",
"to",
"the",
"given",
"String",
"array",
"returning",
"a",
"new",
"array",
"consisting",
"of",
"the",
"input",
"array",
"contents",
"plus",
"the",
"given",
"String",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/StringUtils.java#L887-L895 |
164,366 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/StringUtils.java | StringUtils.sortStringArray | public static String[] sortStringArray(String[] array) {
if (isEmpty(array)) {
return new String[0];
}
Arrays.sort(array);
return array;
} | java | public static String[] sortStringArray(String[] array) {
if (isEmpty(array)) {
return new String[0];
}
Arrays.sort(array);
return array;
} | [
"public",
"static",
"String",
"[",
"]",
"sortStringArray",
"(",
"String",
"[",
"]",
"array",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"array",
")",
")",
"{",
"return",
"new",
"String",
"[",
"0",
"]",
";",
"}",
"Arrays",
".",
"sort",
"(",
"array",
")",
... | Turn given source String array into sorted array.
@param array the source array
@return the sorted array (never <code>null</code>) | [
"Turn",
"given",
"source",
"String",
"array",
"into",
"sorted",
"array",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/StringUtils.java#L957-L963 |
164,367 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/StringUtils.java | StringUtils.removeDuplicateStrings | public static String[] removeDuplicateStrings(String[] array) {
if (isEmpty(array)) {
return array;
}
Set<String> set = new TreeSet<String>();
Collections.addAll(set, array);
return toStringArray(set);
} | java | public static String[] removeDuplicateStrings(String[] array) {
if (isEmpty(array)) {
return array;
}
Set<String> set = new TreeSet<String>();
Collections.addAll(set, array);
return toStringArray(set);
} | [
"public",
"static",
"String",
"[",
"]",
"removeDuplicateStrings",
"(",
"String",
"[",
"]",
"array",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"array",
")",
")",
"{",
"return",
"array",
";",
"}",
"Set",
"<",
"String",
">",
"set",
"=",
"new",
"TreeSet",
"<"... | Remove duplicate Strings from the given array. Also sorts the array, as
it uses a TreeSet.
@param array the String array
@return an array without duplicates, in natural sort order | [
"Remove",
"duplicate",
"Strings",
"from",
"the",
"given",
"array",
".",
"Also",
"sorts",
"the",
"array",
"as",
"it",
"uses",
"a",
"TreeSet",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/StringUtils.java#L1022-L1029 |
164,368 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/StringUtils.java | StringUtils.commaDelimitedListToSet | public static Set<String> commaDelimitedListToSet(String str) {
Set<String> set = new TreeSet<String>();
String[] tokens = commaDelimitedListToStringArray(str);
Collections.addAll(set, tokens);
return set;
} | java | public static Set<String> commaDelimitedListToSet(String str) {
Set<String> set = new TreeSet<String>();
String[] tokens = commaDelimitedListToStringArray(str);
Collections.addAll(set, tokens);
return set;
} | [
"public",
"static",
"Set",
"<",
"String",
">",
"commaDelimitedListToSet",
"(",
"String",
"str",
")",
"{",
"Set",
"<",
"String",
">",
"set",
"=",
"new",
"TreeSet",
"<",
"String",
">",
"(",
")",
";",
"String",
"[",
"]",
"tokens",
"=",
"commaDelimitedListTo... | Convenience method to convert a CSV string list to a set. Note that this
will suppress duplicates.
@param str the input String
@return a Set of String entries in the list | [
"Convenience",
"method",
"to",
"convert",
"a",
"CSV",
"string",
"list",
"to",
"a",
"set",
".",
"Note",
"that",
"this",
"will",
"suppress",
"duplicates",
"."
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/StringUtils.java#L1257-L1262 |
164,369 | mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/StringUtils.java | StringUtils.toSafeFileName | public static String toSafeFileName(String name) {
int size = name.length();
StringBuilder builder = new StringBuilder(size * 2);
for (int i = 0; i < size; i++) {
char c = name.charAt(i);
boolean valid = c >= 'a' && c <= 'z';
valid = valid || (c >= 'A' && c <=... | java | public static String toSafeFileName(String name) {
int size = name.length();
StringBuilder builder = new StringBuilder(size * 2);
for (int i = 0; i < size; i++) {
char c = name.charAt(i);
boolean valid = c >= 'a' && c <= 'z';
valid = valid || (c >= 'A' && c <=... | [
"public",
"static",
"String",
"toSafeFileName",
"(",
"String",
"name",
")",
"{",
"int",
"size",
"=",
"name",
".",
"length",
"(",
")",
";",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"size",
"*",
"2",
")",
";",
"for",
"(",
"int",
"i",... | Converts any string into a string that is safe to use as a file name.
The result will only include ascii characters and numbers, and the "-","_", and "." characters. | [
"Converts",
"any",
"string",
"into",
"a",
"string",
"that",
"is",
"safe",
"to",
"use",
"as",
"a",
"file",
"name",
".",
"The",
"result",
"will",
"only",
"include",
"ascii",
"characters",
"and",
"numbers",
"and",
"the",
"-",
"_",
"and",
".",
"characters",
... | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/StringUtils.java#L1525-L1544 |
164,370 | taskadapter/trello-java-wrapper | src/main/java/com/julienvey/trello/impl/TrelloImpl.java | TrelloImpl.getBoardMemberActivity | @Override
@Deprecated
public List<CardWithActions> getBoardMemberActivity(String boardId, String memberId,
String actionFilter, Argument... args) {
if (actionFilter == null)
actionFilter = "all";
Argument[] argsAndFilter = Arrays.copyOf(args, args.length + 1);
arg... | java | @Override
@Deprecated
public List<CardWithActions> getBoardMemberActivity(String boardId, String memberId,
String actionFilter, Argument... args) {
if (actionFilter == null)
actionFilter = "all";
Argument[] argsAndFilter = Arrays.copyOf(args, args.length + 1);
arg... | [
"@",
"Override",
"@",
"Deprecated",
"public",
"List",
"<",
"CardWithActions",
">",
"getBoardMemberActivity",
"(",
"String",
"boardId",
",",
"String",
"memberId",
",",
"String",
"actionFilter",
",",
"Argument",
"...",
"args",
")",
"{",
"if",
"(",
"actionFilter",
... | FIXME Remove this method | [
"FIXME",
"Remove",
"this",
"method"
] | 70d57a890e54307eab81659a3d420d05ea48bd5d | https://github.com/taskadapter/trello-java-wrapper/blob/70d57a890e54307eab81659a3d420d05ea48bd5d/src/main/java/com/julienvey/trello/impl/TrelloImpl.java#L232-L243 |
164,371 | codelibs/jcifs | src/main/java/jcifs/smb1/smb1/SigningDigest.java | SigningDigest.sign | void sign(byte[] data, int offset, int length,
ServerMessageBlock request, ServerMessageBlock response) {
request.signSeq = signSequence;
if( response != null ) {
response.signSeq = signSequence + 1;
response.verifyFailed = false;
}
try {
... | java | void sign(byte[] data, int offset, int length,
ServerMessageBlock request, ServerMessageBlock response) {
request.signSeq = signSequence;
if( response != null ) {
response.signSeq = signSequence + 1;
response.verifyFailed = false;
}
try {
... | [
"void",
"sign",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
",",
"ServerMessageBlock",
"request",
",",
"ServerMessageBlock",
"response",
")",
"{",
"request",
".",
"signSeq",
"=",
"signSequence",
";",
"if",
"(",
"response",
"!... | Performs MAC signing of the SMB. This is done as follows.
The signature field of the SMB is overwritted with the sequence number;
The MD5 digest of the MAC signing key + the entire SMB is taken;
The first 8 bytes of this are placed in the signature field.
@param data The data.
@param offset The starting offset at whi... | [
"Performs",
"MAC",
"signing",
"of",
"the",
"SMB",
".",
"This",
"is",
"done",
"as",
"follows",
".",
"The",
"signature",
"field",
"of",
"the",
"SMB",
"is",
"overwritted",
"with",
"the",
"sequence",
"number",
";",
"The",
"MD5",
"digest",
"of",
"the",
"MAC",... | ac6a8ba2925648ae003ca2508aec32316065dc34 | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/smb1/SigningDigest.java#L125-L150 |
164,372 | codelibs/jcifs | src/main/java/jcifs/smb1/Config.java | Config.setProperty | public static Object setProperty( String key, String value ) {
return prp.setProperty( key, value );
} | java | public static Object setProperty( String key, String value ) {
return prp.setProperty( key, value );
} | [
"public",
"static",
"Object",
"setProperty",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"return",
"prp",
".",
"setProperty",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Add a property. | [
"Add",
"a",
"property",
"."
] | ac6a8ba2925648ae003ca2508aec32316065dc34 | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/Config.java#L187-L189 |
164,373 | codelibs/jcifs | src/main/java/jcifs/smb1/netbios/NbtAddress.java | NbtAddress.getAllByAddress | public static NbtAddress[] getAllByAddress( NbtAddress addr )
throws UnknownHostException {
try {
NbtAddress[] addrs = CLIENT.getNodeStatus( addr );
cacheAddressArray( addrs );
return addrs;
} catch( UnknownHostException... | java | public static NbtAddress[] getAllByAddress( NbtAddress addr )
throws UnknownHostException {
try {
NbtAddress[] addrs = CLIENT.getNodeStatus( addr );
cacheAddressArray( addrs );
return addrs;
} catch( UnknownHostException... | [
"public",
"static",
"NbtAddress",
"[",
"]",
"getAllByAddress",
"(",
"NbtAddress",
"addr",
")",
"throws",
"UnknownHostException",
"{",
"try",
"{",
"NbtAddress",
"[",
"]",
"addrs",
"=",
"CLIENT",
".",
"getNodeStatus",
"(",
"addr",
")",
";",
"cacheAddressArray",
... | Retrieve all addresses of a host by it's address. NetBIOS hosts can
have many names for a given IP address. The name and IP address make the
NetBIOS address. This provides a way to retrieve the other names for a
host with the same IP address.
@param addr the address to query
@throws UnknownHostException if address can... | [
"Retrieve",
"all",
"addresses",
"of",
"a",
"host",
"by",
"it",
"s",
"address",
".",
"NetBIOS",
"hosts",
"can",
"have",
"many",
"names",
"for",
"a",
"given",
"IP",
"address",
".",
"The",
"name",
"and",
"IP",
"address",
"make",
"the",
"NetBIOS",
"address",... | ac6a8ba2925648ae003ca2508aec32316065dc34 | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/netbios/NbtAddress.java#L517-L531 |
164,374 | codelibs/jcifs | src/main/java/jcifs/smb1/UniAddress.java | UniAddress.getHostName | public String getHostName() {
if( addr instanceof NbtAddress ) {
return ((NbtAddress)addr).getHostName();
}
return ((InetAddress)addr).getHostName();
} | java | public String getHostName() {
if( addr instanceof NbtAddress ) {
return ((NbtAddress)addr).getHostName();
}
return ((InetAddress)addr).getHostName();
} | [
"public",
"String",
"getHostName",
"(",
")",
"{",
"if",
"(",
"addr",
"instanceof",
"NbtAddress",
")",
"{",
"return",
"(",
"(",
"NbtAddress",
")",
"addr",
")",
".",
"getHostName",
"(",
")",
";",
"}",
"return",
"(",
"(",
"InetAddress",
")",
"addr",
")",
... | Return the hostname of this address such as "MYCOMPUTER". | [
"Return",
"the",
"hostname",
"of",
"this",
"address",
"such",
"as",
"MYCOMPUTER",
"."
] | ac6a8ba2925648ae003ca2508aec32316065dc34 | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/UniAddress.java#L445-L450 |
164,375 | codelibs/jcifs | src/main/java/jcifs/smb1/UniAddress.java | UniAddress.getHostAddress | public String getHostAddress() {
if( addr instanceof NbtAddress ) {
return ((NbtAddress)addr).getHostAddress();
}
return ((InetAddress)addr).getHostAddress();
} | java | public String getHostAddress() {
if( addr instanceof NbtAddress ) {
return ((NbtAddress)addr).getHostAddress();
}
return ((InetAddress)addr).getHostAddress();
} | [
"public",
"String",
"getHostAddress",
"(",
")",
"{",
"if",
"(",
"addr",
"instanceof",
"NbtAddress",
")",
"{",
"return",
"(",
"(",
"NbtAddress",
")",
"addr",
")",
".",
"getHostAddress",
"(",
")",
";",
"}",
"return",
"(",
"(",
"InetAddress",
")",
"addr",
... | Return the IP address as text such as "192.168.1.15". | [
"Return",
"the",
"IP",
"address",
"as",
"text",
"such",
"as",
"192",
".",
"168",
".",
"1",
".",
"15",
"."
] | ac6a8ba2925648ae003ca2508aec32316065dc34 | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/UniAddress.java#L456-L461 |
164,376 | codelibs/jcifs | src/main/java/jcifs/smb1/smb1/SmbFile.java | SmbFile.getUncPath | public String getUncPath() {
getUncPath0();
if( share == null ) {
return "\\\\" + url.getHost();
}
return "\\\\" + url.getHost() + canon.replace( '/', '\\' );
} | java | public String getUncPath() {
getUncPath0();
if( share == null ) {
return "\\\\" + url.getHost();
}
return "\\\\" + url.getHost() + canon.replace( '/', '\\' );
} | [
"public",
"String",
"getUncPath",
"(",
")",
"{",
"getUncPath0",
"(",
")",
";",
"if",
"(",
"share",
"==",
"null",
")",
"{",
"return",
"\"\\\\\\\\\"",
"+",
"url",
".",
"getHost",
"(",
")",
";",
"}",
"return",
"\"\\\\\\\\\"",
"+",
"url",
".",
"getHost",
... | Retuns the Windows UNC style path with backslashs intead of forward slashes.
@return The UNC path. | [
"Retuns",
"the",
"Windows",
"UNC",
"style",
"path",
"with",
"backslashs",
"intead",
"of",
"forward",
"slashes",
"."
] | ac6a8ba2925648ae003ca2508aec32316065dc34 | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/smb1/SmbFile.java#L1213-L1219 |
164,377 | codelibs/jcifs | src/main/java/jcifs/smb1/smb1/SmbFile.java | SmbFile.createNewFile | public void createNewFile() throws SmbException {
if( getUncPath0().length() == 1 ) {
throw new SmbException( "Invalid operation for workgroups, servers, or shares" );
}
close( open0( O_RDWR | O_CREAT | O_EXCL, 0, ATTR_NORMAL, 0 ), 0L );
} | java | public void createNewFile() throws SmbException {
if( getUncPath0().length() == 1 ) {
throw new SmbException( "Invalid operation for workgroups, servers, or shares" );
}
close( open0( O_RDWR | O_CREAT | O_EXCL, 0, ATTR_NORMAL, 0 ), 0L );
} | [
"public",
"void",
"createNewFile",
"(",
")",
"throws",
"SmbException",
"{",
"if",
"(",
"getUncPath0",
"(",
")",
".",
"length",
"(",
")",
"==",
"1",
")",
"{",
"throw",
"new",
"SmbException",
"(",
"\"Invalid operation for workgroups, servers, or shares\"",
")",
";... | Create a new file but fail if it already exists. The check for
existance of the file and it's creation are an atomic operation with
respect to other filesystem activities. | [
"Create",
"a",
"new",
"file",
"but",
"fail",
"if",
"it",
"already",
"exists",
".",
"The",
"check",
"for",
"existance",
"of",
"the",
"file",
"and",
"it",
"s",
"creation",
"are",
"an",
"atomic",
"operation",
"with",
"respect",
"to",
"other",
"filesystem",
... | ac6a8ba2925648ae003ca2508aec32316065dc34 | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/smb1/SmbFile.java#L2567-L2572 |
164,378 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/json/JsonReport.java | JsonReport.getProjectName | private String getProjectName() {
String pName = Strings.emptyToNull(projectName);
if (pName == null) {
pName = Strings.emptyToNull(junit4.getProject().getName());
}
if (pName == null) {
pName = "(unnamed project)";
}
return pName;
} | java | private String getProjectName() {
String pName = Strings.emptyToNull(projectName);
if (pName == null) {
pName = Strings.emptyToNull(junit4.getProject().getName());
}
if (pName == null) {
pName = "(unnamed project)";
}
return pName;
} | [
"private",
"String",
"getProjectName",
"(",
")",
"{",
"String",
"pName",
"=",
"Strings",
".",
"emptyToNull",
"(",
"projectName",
")",
";",
"if",
"(",
"pName",
"==",
"null",
")",
"{",
"pName",
"=",
"Strings",
".",
"emptyToNull",
"(",
"junit4",
".",
"getPr... | Return the project name or the default project name. | [
"Return",
"the",
"project",
"name",
"or",
"the",
"default",
"project",
"name",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/json/JsonReport.java#L184-L193 |
164,379 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/json/JsonReport.java | JsonReport.onSuiteResult | @Subscribe
@SuppressForbidden("legitimate printStackTrace().")
public void onSuiteResult(AggregatedSuiteResultEvent e) {
try {
if (jsonWriter == null)
return;
slaves.put(e.getSlave().id, e.getSlave());
e.serialize(jsonWriter, outputStreams);
} catch (Exception ex) {
ex.print... | java | @Subscribe
@SuppressForbidden("legitimate printStackTrace().")
public void onSuiteResult(AggregatedSuiteResultEvent e) {
try {
if (jsonWriter == null)
return;
slaves.put(e.getSlave().id, e.getSlave());
e.serialize(jsonWriter, outputStreams);
} catch (Exception ex) {
ex.print... | [
"@",
"Subscribe",
"@",
"SuppressForbidden",
"(",
"\"legitimate printStackTrace().\"",
")",
"public",
"void",
"onSuiteResult",
"(",
"AggregatedSuiteResultEvent",
"e",
")",
"{",
"try",
"{",
"if",
"(",
"jsonWriter",
"==",
"null",
")",
"return",
";",
"slaves",
".",
... | Emit information about a single suite and all of its tests. | [
"Emit",
"information",
"about",
"a",
"single",
"suite",
"and",
"all",
"of",
"its",
"tests",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/json/JsonReport.java#L198-L221 |
164,380 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/json/JsonReport.java | JsonReport.onQuit | @Subscribe
public void onQuit(AggregatedQuitEvent e) {
if (jsonWriter == null)
return;
try {
jsonWriter.endArray();
jsonWriter.name("slaves");
jsonWriter.beginObject();
for (Map.Entry<Integer, ForkedJvmInfo> entry : slaves.entrySet()) {
jsonWriter.name(Integer.toString(... | java | @Subscribe
public void onQuit(AggregatedQuitEvent e) {
if (jsonWriter == null)
return;
try {
jsonWriter.endArray();
jsonWriter.name("slaves");
jsonWriter.beginObject();
for (Map.Entry<Integer, ForkedJvmInfo> entry : slaves.entrySet()) {
jsonWriter.name(Integer.toString(... | [
"@",
"Subscribe",
"public",
"void",
"onQuit",
"(",
"AggregatedQuitEvent",
"e",
")",
"{",
"if",
"(",
"jsonWriter",
"==",
"null",
")",
"return",
";",
"try",
"{",
"jsonWriter",
".",
"endArray",
"(",
")",
";",
"jsonWriter",
".",
"name",
"(",
"\"slaves\"",
")... | All tests completed. | [
"All",
"tests",
"completed",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/json/JsonReport.java#L226-L259 |
164,381 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java | JUnit4.setSeed | public void setSeed(String randomSeed) {
if (!Strings.isNullOrEmpty(getProject().getUserProperty(SYSPROP_RANDOM_SEED()))) {
String userProperty = getProject().getUserProperty(SYSPROP_RANDOM_SEED());
if (!userProperty.equals(randomSeed)) {
log("Ignoring seed attribute because it is overridden by ... | java | public void setSeed(String randomSeed) {
if (!Strings.isNullOrEmpty(getProject().getUserProperty(SYSPROP_RANDOM_SEED()))) {
String userProperty = getProject().getUserProperty(SYSPROP_RANDOM_SEED());
if (!userProperty.equals(randomSeed)) {
log("Ignoring seed attribute because it is overridden by ... | [
"public",
"void",
"setSeed",
"(",
"String",
"randomSeed",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isNullOrEmpty",
"(",
"getProject",
"(",
")",
".",
"getUserProperty",
"(",
"SYSPROP_RANDOM_SEED",
"(",
")",
")",
")",
")",
"{",
"String",
"userProperty",
"=... | Initial random seed used for shuffling test suites and other sources
of pseudo-randomness. If not set, any random value is set.
<p>The seed's format is compatible with {@link RandomizedRunner} so that
seed can be fixed for suites and methods alike. | [
"Initial",
"random",
"seed",
"used",
"for",
"shuffling",
"test",
"suites",
"and",
"other",
"sources",
"of",
"pseudo",
"-",
"randomness",
".",
"If",
"not",
"set",
"any",
"random",
"value",
"is",
"set",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L484-L493 |
164,382 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java | JUnit4.setPrefix | public void setPrefix(String prefix) {
if (!Strings.isNullOrEmpty(getProject().getUserProperty(SYSPROP_PREFIX()))) {
log("Ignoring prefix attribute because it is overridden by user properties.", Project.MSG_WARN);
} else {
SysGlobals.initializeWith(prefix);
}
} | java | public void setPrefix(String prefix) {
if (!Strings.isNullOrEmpty(getProject().getUserProperty(SYSPROP_PREFIX()))) {
log("Ignoring prefix attribute because it is overridden by user properties.", Project.MSG_WARN);
} else {
SysGlobals.initializeWith(prefix);
}
} | [
"public",
"void",
"setPrefix",
"(",
"String",
"prefix",
")",
"{",
"if",
"(",
"!",
"Strings",
".",
"isNullOrEmpty",
"(",
"getProject",
"(",
")",
".",
"getUserProperty",
"(",
"SYSPROP_PREFIX",
"(",
")",
")",
")",
")",
"{",
"log",
"(",
"\"Ignoring prefix attr... | Initializes custom prefix for all junit4 properties. This must be consistent
across all junit4 invocations if done from the same classpath. Use only when REALLY needed. | [
"Initializes",
"custom",
"prefix",
"for",
"all",
"junit4",
"properties",
".",
"This",
"must",
"be",
"consistent",
"across",
"all",
"junit4",
"invocations",
"if",
"done",
"from",
"the",
"same",
"classpath",
".",
"Use",
"only",
"when",
"REALLY",
"needed",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L499-L505 |
164,383 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java | JUnit4.addFileSet | public void addFileSet(FileSet fs) {
add(fs);
if (fs.getProject() == null) {
fs.setProject(getProject());
}
} | java | public void addFileSet(FileSet fs) {
add(fs);
if (fs.getProject() == null) {
fs.setProject(getProject());
}
} | [
"public",
"void",
"addFileSet",
"(",
"FileSet",
"fs",
")",
"{",
"add",
"(",
"fs",
")",
";",
"if",
"(",
"fs",
".",
"getProject",
"(",
")",
"==",
"null",
")",
"{",
"fs",
".",
"setProject",
"(",
"getProject",
"(",
")",
")",
";",
"}",
"}"
] | Adds a set of tests based on pattern matching. | [
"Adds",
"a",
"set",
"of",
"tests",
"based",
"on",
"pattern",
"matching",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L715-L720 |
164,384 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java | JUnit4.addAssertions | public void addAssertions(Assertions asserts) {
if (getCommandline().getAssertions() != null) {
throw new BuildException("Only one assertion declaration is allowed");
}
getCommandline().setAssertions(asserts);
} | java | public void addAssertions(Assertions asserts) {
if (getCommandline().getAssertions() != null) {
throw new BuildException("Only one assertion declaration is allowed");
}
getCommandline().setAssertions(asserts);
} | [
"public",
"void",
"addAssertions",
"(",
"Assertions",
"asserts",
")",
"{",
"if",
"(",
"getCommandline",
"(",
")",
".",
"getAssertions",
"(",
")",
"!=",
"null",
")",
"{",
"throw",
"new",
"BuildException",
"(",
"\"Only one assertion declaration is allowed\"",
")",
... | Add assertions to tests execution. | [
"Add",
"assertions",
"to",
"tests",
"execution",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L746-L751 |
164,385 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java | JUnit4.validateArguments | private void validateArguments() throws BuildException {
Path tempDir = getTempDir();
if (tempDir == null) {
throw new BuildException("Temporary directory cannot be null.");
}
if (Files.exists(tempDir)) {
if (!Files.isDirectory(tempDir)) {
throw new BuildException("Temporary di... | java | private void validateArguments() throws BuildException {
Path tempDir = getTempDir();
if (tempDir == null) {
throw new BuildException("Temporary directory cannot be null.");
}
if (Files.exists(tempDir)) {
if (!Files.isDirectory(tempDir)) {
throw new BuildException("Temporary di... | [
"private",
"void",
"validateArguments",
"(",
")",
"throws",
"BuildException",
"{",
"Path",
"tempDir",
"=",
"getTempDir",
"(",
")",
";",
"if",
"(",
"tempDir",
"==",
"null",
")",
"{",
"throw",
"new",
"BuildException",
"(",
"\"Temporary directory cannot be null.\"",
... | Validate arguments. | [
"Validate",
"arguments",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L1134-L1152 |
164,386 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java | JUnit4.validateJUnit4 | private void validateJUnit4() throws BuildException {
try {
Class<?> clazz = Class.forName("org.junit.runner.Description");
if (!Serializable.class.isAssignableFrom(clazz)) {
throw new BuildException("At least JUnit version 4.10 is required on junit4's taskdef classpath.");
}
} catch (... | java | private void validateJUnit4() throws BuildException {
try {
Class<?> clazz = Class.forName("org.junit.runner.Description");
if (!Serializable.class.isAssignableFrom(clazz)) {
throw new BuildException("At least JUnit version 4.10 is required on junit4's taskdef classpath.");
}
} catch (... | [
"private",
"void",
"validateJUnit4",
"(",
")",
"throws",
"BuildException",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"Class",
".",
"forName",
"(",
"\"org.junit.runner.Description\"",
")",
";",
"if",
"(",
"!",
"Serializable",
".",
"class",
".",
... | Validate JUnit4 presence in a concrete version. | [
"Validate",
"JUnit4",
"presence",
"in",
"a",
"concrete",
"version",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L1157-L1166 |
164,387 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java | JUnit4.resolveFiles | private org.apache.tools.ant.types.Path resolveFiles(org.apache.tools.ant.types.Path path) {
org.apache.tools.ant.types.Path cloned = new org.apache.tools.ant.types.Path(getProject());
for (String location : path.list()) {
cloned.createPathElement().setLocation(new File(location));
}
return cloned... | java | private org.apache.tools.ant.types.Path resolveFiles(org.apache.tools.ant.types.Path path) {
org.apache.tools.ant.types.Path cloned = new org.apache.tools.ant.types.Path(getProject());
for (String location : path.list()) {
cloned.createPathElement().setLocation(new File(location));
}
return cloned... | [
"private",
"org",
".",
"apache",
".",
"tools",
".",
"ant",
".",
"types",
".",
"Path",
"resolveFiles",
"(",
"org",
".",
"apache",
".",
"tools",
".",
"ant",
".",
"types",
".",
"Path",
"path",
")",
"{",
"org",
".",
"apache",
".",
"tools",
".",
"ant",
... | Resolve all files from a given path and simplify its definition. | [
"Resolve",
"all",
"files",
"from",
"a",
"given",
"path",
"and",
"simplify",
"its",
"definition",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L1334-L1340 |
164,388 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java | JUnit4.determineForkedJvmCount | private int determineForkedJvmCount(TestsCollection testCollection) {
int cores = Runtime.getRuntime().availableProcessors();
int jvmCount;
if (this.parallelism.equals(PARALLELISM_AUTO)) {
if (cores >= 8) {
// Maximum parallel jvms is 4, conserve some memory and memory bandwidth.
jvmCo... | java | private int determineForkedJvmCount(TestsCollection testCollection) {
int cores = Runtime.getRuntime().availableProcessors();
int jvmCount;
if (this.parallelism.equals(PARALLELISM_AUTO)) {
if (cores >= 8) {
// Maximum parallel jvms is 4, conserve some memory and memory bandwidth.
jvmCo... | [
"private",
"int",
"determineForkedJvmCount",
"(",
"TestsCollection",
"testCollection",
")",
"{",
"int",
"cores",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"availableProcessors",
"(",
")",
";",
"int",
"jvmCount",
";",
"if",
"(",
"this",
".",
"parallelis... | Determine how many forked JVMs to use. | [
"Determine",
"how",
"many",
"forked",
"JVMs",
"to",
"use",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L1345-L1378 |
164,389 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java | JUnit4.escapeAndJoin | private String escapeAndJoin(String[] commandline) {
// TODO: we should try to escape special characters here, depending on the OS.
StringBuilder b = new StringBuilder();
Pattern specials = Pattern.compile("[\\ ]");
for (String arg : commandline) {
if (b.length() > 0) {
b.append(" ");
... | java | private String escapeAndJoin(String[] commandline) {
// TODO: we should try to escape special characters here, depending on the OS.
StringBuilder b = new StringBuilder();
Pattern specials = Pattern.compile("[\\ ]");
for (String arg : commandline) {
if (b.length() > 0) {
b.append(" ");
... | [
"private",
"String",
"escapeAndJoin",
"(",
"String",
"[",
"]",
"commandline",
")",
"{",
"// TODO: we should try to escape special characters here, depending on the OS.",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Pattern",
"specials",
"=",
"Pattern... | Try to provide an escaped, ready-to-use shell line to repeat a given command line. | [
"Try",
"to",
"provide",
"an",
"escaped",
"ready",
"-",
"to",
"-",
"use",
"shell",
"line",
"to",
"repeat",
"a",
"given",
"command",
"line",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L1617-L1633 |
164,390 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java | JUnit4.forkProcess | @SuppressForbidden("legitimate sysstreams.")
private Execute forkProcess(ForkedJvmInfo slaveInfo, EventBus eventBus,
CommandlineJava commandline,
TailInputStream eventStream, OutputStream sysout, OutputStream syserr, RandomAccessFile streamsBuffer) {
try {
String tempDir = commandline.getSyste... | java | @SuppressForbidden("legitimate sysstreams.")
private Execute forkProcess(ForkedJvmInfo slaveInfo, EventBus eventBus,
CommandlineJava commandline,
TailInputStream eventStream, OutputStream sysout, OutputStream syserr, RandomAccessFile streamsBuffer) {
try {
String tempDir = commandline.getSyste... | [
"@",
"SuppressForbidden",
"(",
"\"legitimate sysstreams.\"",
")",
"private",
"Execute",
"forkProcess",
"(",
"ForkedJvmInfo",
"slaveInfo",
",",
"EventBus",
"eventBus",
",",
"CommandlineJava",
"commandline",
",",
"TailInputStream",
"eventStream",
",",
"OutputStream",
"sysou... | Execute a slave process. Pump events to the given event bus. | [
"Execute",
"a",
"slave",
"process",
".",
"Pump",
"events",
"to",
"the",
"given",
"event",
"bus",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L1638-L1699 |
164,391 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java | JUnit4.getTempDir | private Path getTempDir() {
if (this.tempDir == null) {
if (this.dir != null) {
this.tempDir = dir;
} else {
this.tempDir = getProject().getBaseDir().toPath();
}
}
return tempDir;
} | java | private Path getTempDir() {
if (this.tempDir == null) {
if (this.dir != null) {
this.tempDir = dir;
} else {
this.tempDir = getProject().getBaseDir().toPath();
}
}
return tempDir;
} | [
"private",
"Path",
"getTempDir",
"(",
")",
"{",
"if",
"(",
"this",
".",
"tempDir",
"==",
"null",
")",
"{",
"if",
"(",
"this",
".",
"dir",
"!=",
"null",
")",
"{",
"this",
".",
"tempDir",
"=",
"dir",
";",
"}",
"else",
"{",
"this",
".",
"tempDir",
... | Resolve temporary folder. | [
"Resolve",
"temporary",
"folder",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L1774-L1783 |
164,392 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java | JUnit4.addSlaveClasspath | private org.apache.tools.ant.types.Path addSlaveClasspath() {
org.apache.tools.ant.types.Path path = new org.apache.tools.ant.types.Path(getProject());
String [] REQUIRED_SLAVE_CLASSES = {
SlaveMain.class.getName(),
Strings.class.getName(),
MethodGlobFilter.class.getName(),
TeeO... | java | private org.apache.tools.ant.types.Path addSlaveClasspath() {
org.apache.tools.ant.types.Path path = new org.apache.tools.ant.types.Path(getProject());
String [] REQUIRED_SLAVE_CLASSES = {
SlaveMain.class.getName(),
Strings.class.getName(),
MethodGlobFilter.class.getName(),
TeeO... | [
"private",
"org",
".",
"apache",
".",
"tools",
".",
"ant",
".",
"types",
".",
"Path",
"addSlaveClasspath",
"(",
")",
"{",
"org",
".",
"apache",
".",
"tools",
".",
"ant",
".",
"types",
".",
"Path",
"path",
"=",
"new",
"org",
".",
"apache",
".",
"too... | Adds a classpath source which contains the given resource.
TODO: [GH-213] this is extremely ugly; separate the code required to run on the
forked JVM into an isolated bundle and either create it on-demand (in temp.
files location?) or locate it in classpath somehow (in a portable way). | [
"Adds",
"a",
"classpath",
"source",
"which",
"contains",
"the",
"given",
"resource",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/JUnit4.java#L1891-L1911 |
164,393 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/PickFromListTask.java | PickFromListTask.validate | private void validate() {
if (Strings.emptyToNull(random) == null) {
random = Strings.emptyToNull(getProject().getProperty(SYSPROP_RANDOM_SEED()));
}
if (random == null) {
throw new BuildException("Required attribute 'seed' must not be empty. Look at <junit4:pickseed>.");
}
lo... | java | private void validate() {
if (Strings.emptyToNull(random) == null) {
random = Strings.emptyToNull(getProject().getProperty(SYSPROP_RANDOM_SEED()));
}
if (random == null) {
throw new BuildException("Required attribute 'seed' must not be empty. Look at <junit4:pickseed>.");
}
lo... | [
"private",
"void",
"validate",
"(",
")",
"{",
"if",
"(",
"Strings",
".",
"emptyToNull",
"(",
"random",
")",
"==",
"null",
")",
"{",
"random",
"=",
"Strings",
".",
"emptyToNull",
"(",
"getProject",
"(",
")",
".",
"getProperty",
"(",
"SYSPROP_RANDOM_SEED",
... | Validate arguments and state. | [
"Validate",
"arguments",
"and",
"state",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/PickFromListTask.java#L115-L132 |
164,394 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/balancers/TopHints.java | TopHints.add | public void add(ResourceCollection rc) {
if (rc instanceof FileSet) {
FileSet fs = (FileSet) rc;
fs.setProject(getProject());
}
resources.add(rc);
} | java | public void add(ResourceCollection rc) {
if (rc instanceof FileSet) {
FileSet fs = (FileSet) rc;
fs.setProject(getProject());
}
resources.add(rc);
} | [
"public",
"void",
"add",
"(",
"ResourceCollection",
"rc",
")",
"{",
"if",
"(",
"rc",
"instanceof",
"FileSet",
")",
"{",
"FileSet",
"fs",
"=",
"(",
"FileSet",
")",
"rc",
";",
"fs",
".",
"setProject",
"(",
"getProject",
"(",
")",
")",
";",
"}",
"resour... | Adds a resource collection with execution hints. | [
"Adds",
"a",
"resource",
"collection",
"with",
"execution",
"hints",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/balancers/TopHints.java#L61-L67 |
164,395 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/slave/SlaveMainSafe.java | SlaveMainSafe.verifyJUnit4Present | private static void verifyJUnit4Present() {
try {
Class<?> clazz = Class.forName("org.junit.runner.Description");
if (!Serializable.class.isAssignableFrom(clazz)) {
JvmExit.halt(SlaveMain.ERR_OLD_JUNIT);
}
} catch (ClassNotFoundException e) {
JvmExit.halt(SlaveMain.ERR_NO_JUNIT);... | java | private static void verifyJUnit4Present() {
try {
Class<?> clazz = Class.forName("org.junit.runner.Description");
if (!Serializable.class.isAssignableFrom(clazz)) {
JvmExit.halt(SlaveMain.ERR_OLD_JUNIT);
}
} catch (ClassNotFoundException e) {
JvmExit.halt(SlaveMain.ERR_NO_JUNIT);... | [
"private",
"static",
"void",
"verifyJUnit4Present",
"(",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"Class",
".",
"forName",
"(",
"\"org.junit.runner.Description\"",
")",
";",
"if",
"(",
"!",
"Serializable",
".",
"class",
".",
"isAssignableF... | Verify JUnit presence and version. | [
"Verify",
"JUnit",
"presence",
"and",
"version",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/slave/SlaveMainSafe.java#L29-L38 |
164,396 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/TextReport.java | TextReport.setShowOutput | public void setShowOutput(String mode) {
try {
this.outputMode = OutputMode.valueOf(mode.toUpperCase(Locale.ROOT));
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("showOutput accepts any of: "
+ Arrays.toString(OutputMode.values()) + ", value is not valid: " + mo... | java | public void setShowOutput(String mode) {
try {
this.outputMode = OutputMode.valueOf(mode.toUpperCase(Locale.ROOT));
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("showOutput accepts any of: "
+ Arrays.toString(OutputMode.values()) + ", value is not valid: " + mo... | [
"public",
"void",
"setShowOutput",
"(",
"String",
"mode",
")",
"{",
"try",
"{",
"this",
".",
"outputMode",
"=",
"OutputMode",
".",
"valueOf",
"(",
"mode",
".",
"toUpperCase",
"(",
"Locale",
".",
"ROOT",
")",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentE... | Display mode for output streams. | [
"Display",
"mode",
"for",
"output",
"streams",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/TextReport.java#L271-L278 |
164,397 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/TextReport.java | TextReport.flushOutput | private void flushOutput() throws IOException {
outStream.flush();
outWriter.completeLine();
errStream.flush();
errWriter.completeLine();
} | java | private void flushOutput() throws IOException {
outStream.flush();
outWriter.completeLine();
errStream.flush();
errWriter.completeLine();
} | [
"private",
"void",
"flushOutput",
"(",
")",
"throws",
"IOException",
"{",
"outStream",
".",
"flush",
"(",
")",
";",
"outWriter",
".",
"completeLine",
"(",
")",
";",
"errStream",
".",
"flush",
"(",
")",
";",
"errWriter",
".",
"completeLine",
"(",
")",
";"... | Flush output streams. | [
"Flush",
"output",
"streams",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/TextReport.java#L543-L548 |
164,398 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/TextReport.java | TextReport.emitSuiteStart | private void emitSuiteStart(Description description, long startTimestamp) throws IOException {
String suiteName = description.getDisplayName();
if (useSimpleNames) {
if (suiteName.lastIndexOf('.') >= 0) {
suiteName = suiteName.substring(suiteName.lastIndexOf('.') + 1);
}
}
logShort(s... | java | private void emitSuiteStart(Description description, long startTimestamp) throws IOException {
String suiteName = description.getDisplayName();
if (useSimpleNames) {
if (suiteName.lastIndexOf('.') >= 0) {
suiteName = suiteName.substring(suiteName.lastIndexOf('.') + 1);
}
}
logShort(s... | [
"private",
"void",
"emitSuiteStart",
"(",
"Description",
"description",
",",
"long",
"startTimestamp",
")",
"throws",
"IOException",
"{",
"String",
"suiteName",
"=",
"description",
".",
"getDisplayName",
"(",
")",
";",
"if",
"(",
"useSimpleNames",
")",
"{",
"if"... | Suite prologue. | [
"Suite",
"prologue",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/TextReport.java#L553-L563 |
164,399 | randomizedtesting/randomizedtesting | junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/TextReport.java | TextReport.emitSuiteEnd | private void emitSuiteEnd(AggregatedSuiteResultEvent e, int suitesCompleted) throws IOException {
assert showSuiteSummary;
final StringBuilder b = new StringBuilder();
final int totalErrors = this.totalErrors.addAndGet(e.isSuccessful() ? 0 : 1);
b.append(String.format(Locale.ROOT, "%sCompleted [%d/%d%s... | java | private void emitSuiteEnd(AggregatedSuiteResultEvent e, int suitesCompleted) throws IOException {
assert showSuiteSummary;
final StringBuilder b = new StringBuilder();
final int totalErrors = this.totalErrors.addAndGet(e.isSuccessful() ? 0 : 1);
b.append(String.format(Locale.ROOT, "%sCompleted [%d/%d%s... | [
"private",
"void",
"emitSuiteEnd",
"(",
"AggregatedSuiteResultEvent",
"e",
",",
"int",
"suitesCompleted",
")",
"throws",
"IOException",
"{",
"assert",
"showSuiteSummary",
";",
"final",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"final",
"int... | Suite end. | [
"Suite",
"end",
"."
] | 85a0c7eff5d03d98da4d1f9502a11af74d26478a | https://github.com/randomizedtesting/randomizedtesting/blob/85a0c7eff5d03d98da4d1f9502a11af74d26478a/junit4-ant/src/main/java/com/carrotsearch/ant/tasks/junit4/listeners/TextReport.java#L568-L603 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.