before stringlengths 12 3.21M | after stringlengths 41 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
@Override
public void setColorFilter(ColorFilter cf) {
if (cf == mColorFilter) {
return;
}
mColorFilter = cf;
if (mBitmapPaint != null) {
mBitmapPaint.setColorFilter(mColorFilter);
}
invalidate();
} | @Override
public void setColorFilter(ColorFilter cf) {
if (cf == mColorFilter) {
return;
}
mColorFilter = cf;
<DeepExtract>
if (mBitmapPaint != null) {
mBitmapPaint.setColorFilter(mColorFilter);
}
</DeepExtract>
invalidate();
} | HeadLine | positive | 2,501 |
public LMDBStoreBackend buildAndInitReadOnly() {
if (_storeConfig == null)
throw new IllegalStateException("Missing StoreConfig");
if (_lmdbConfig == null)
throw new IllegalStateException("Missing LMDBConfig");
File dbRoot = _lmdbConfig.dataRoot;
if (dbRoot == null) {
throw new IllegalStateException("Missing LevelDBCon... | public LMDBStoreBackend buildAndInitReadOnly() {
<DeepExtract>
if (_storeConfig == null)
throw new IllegalStateException("Missing StoreConfig");
if (_lmdbConfig == null)
throw new IllegalStateException("Missing LMDBConfig");
File dbRoot = _lmdbConfig.dataRoot;
if (dbRoot == null) {
throw new IllegalStateException("Miss... | StoreMate | positive | 2,502 |
@Override
public void onItemAccepted(CharSequence charSequence, int i) {
workingPlaylist = playlists.get(i);
listener.OnWorkingPlaylistSet();
} | @Override
public void onItemAccepted(CharSequence charSequence, int i) {
<DeepExtract>
workingPlaylist = playlists.get(i);
</DeepExtract>
listener.OnWorkingPlaylistSet();
} | IdealMedia | positive | 2,503 |
public static ScalingUtils.ScaleType getGridViewImageScaleType() {
switch(App.getInstance().getPreferencesService().getGridViewImageScaleType()) {
case "FIT_XY":
return ScalingUtils.ScaleType.FIT_XY;
case "FIT_X":
return ScalingUtils.ScaleType.FIT_X;
case "FIT_Y":
return ScalingUtils.ScaleType.FIT_Y;
case "FIT_START":
... | public static ScalingUtils.ScaleType getGridViewImageScaleType() {
<DeepExtract>
switch(App.getInstance().getPreferencesService().getGridViewImageScaleType()) {
case "FIT_XY":
return ScalingUtils.ScaleType.FIT_XY;
case "FIT_X":
return ScalingUtils.ScaleType.FIT_X;
case "FIT_Y":
return ScalingUtils.ScaleType.FIT_Y;
case... | ImgurViewer | positive | 2,504 |
@Test
public void testExtractFromOdt() throws IOException, ElasticsearchClientException {
logger.info(" -> Testing if file [{}] has been indexed correctly{}.", "test.odt", "sample" == null ? "" : " and contains [" + "sample" + "]");
ESBoolQuery query = new ESBoolQuery().addMust(new ESTermQuery("file.filename", "test.od... | @Test
public void testExtractFromOdt() throws IOException, ElasticsearchClientException {
<DeepExtract>
logger.info(" -> Testing if file [{}] has been indexed correctly{}.", "test.odt", "sample" == null ? "" : " and contains [" + "sample" + "]");
ESBoolQuery query = new ESBoolQuery().addMust(new ESTermQuery("file.filen... | fscrawler | positive | 2,505 |
private static <A> void checkCommentError(A expected, A actual, String message, ParserImpl p) {
assertEquals(list(_UnexpectedToken(message, COMMENT_ERROR_MESSAGE, 1)), p.errors());
assertEquals(expected.toString(), actual.toString());
} | private static <A> void checkCommentError(A expected, A actual, String message, ParserImpl p) {
<DeepExtract>
assertEquals(list(_UnexpectedToken(message, COMMENT_ERROR_MESSAGE, 1)), p.errors());
assertEquals(expected.toString(), actual.toString());
</DeepExtract>
} | jADT | positive | 2,506 |
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float currentTopMargin = (float) animation.getAnimatedValue();
MarginLayoutParams params = (MarginLayoutParams) mLoadView.getLayoutParams();
if ((int) currentTopMargin < 0) {
(int) currentTopMargin = 0;
}
params.bottomMargin = (int) currentTopMargin;
mL... | @Override
public void onAnimationUpdate(ValueAnimator animation) {
float currentTopMargin = (float) animation.getAnimatedValue();
<DeepExtract>
MarginLayoutParams params = (MarginLayoutParams) mLoadView.getLayoutParams();
if ((int) currentTopMargin < 0) {
(int) currentTopMargin = 0;
}
params.bottomMargin = (int) curren... | ReadMark | positive | 2,507 |
@Test
public void testCase8() {
c1 = new Classroom();
c1.setName("Computer room");
s1 = new Student();
s1.setName("Tom");
s2 = new Student();
s2.setName("Lily");
s1.setClassroom(c1);
s2.setClassroom(c1);
Set<Student> ss = new HashSet<>();
ss.add(s1);
ss.add(s2);
c1.setStudentCollection(ss);
s1.save();
s2.save();
c1.sav... | @Test
public void testCase8() {
c1 = new Classroom();
c1.setName("Computer room");
s1 = new Student();
s1.setName("Tom");
s2 = new Student();
s2.setName("Lily");
s1.setClassroom(c1);
s2.setClassroom(c1);
Set<Student> ss = new HashSet<>();
ss.add(s1);
ss.add(s2);
c1.setStudentCollection(ss);
s1.save();
s2.save();
c1.sav... | LitePal | positive | 2,508 |
public void reset() {
for (String c : resourceDb.keySet()) {
resourceDb.get(c).clear();
}
resourceDb.clear();
counter = 0;
if (new Resource("<resource>\n <name>a funky name</name>\n <data>an important message</data>" + "\n <nstag xmlns:ns1='http://smartrics/ns1'>\n <ns1:number>3</ns1:number>\n </nsta... | public void reset() {
for (String c : resourceDb.keySet()) {
resourceDb.get(c).clear();
}
resourceDb.clear();
counter = 0;
if (new Resource("<resource>\n <name>a funky name</name>\n <data>an important message</data>" + "\n <nstag xmlns:ns1='http://smartrics/ns1'>\n <ns1:number>3</ns1:number>\n </nsta... | RestFixture | positive | 2,510 |
private File setResourceToDelegate() throws IOException {
String path = resource.getFile().getAbsolutePath() + suffixCreator.getSuffix(resourceIndex);
File file = new File(path);
this.resource = new FileSystemResource(file);
return file;
} | private File setResourceToDelegate() throws IOException {
String path = resource.getFile().getAbsolutePath() + suffixCreator.getSuffix(resourceIndex);
File file = new File(path);
<DeepExtract>
this.resource = new FileSystemResource(file);
</DeepExtract>
return file;
} | SpringBatchSample | positive | 2,511 |
public Criteria andMarksIn(List<String> values) {
if (values == null) {
throw new RuntimeException("Value for " + "marks" + " cannot be null");
}
criteria.add(new Criterion("marks in", values));
return (Criteria) this;
} | public Criteria andMarksIn(List<String> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "marks" + " cannot be null");
}
criteria.add(new Criterion("marks in", values));
</DeepExtract>
return (Criteria) this;
} | health_online | positive | 2,512 |
public void onResponseReceived(Request request, Response response) {
ConsoleLog.debug("SID: " + response.getText());
ConsoleLog.debug("Cookies: " + Cookies.getCookieNames());
final String sid = response.getText();
auth = new Authentication(config, sid, URLBuilder.getInstance().getUserInRoleURL(KNOWN_ROLES));
auth.setCa... | public void onResponseReceived(Request request, Response response) {
ConsoleLog.debug("SID: " + response.getText());
ConsoleLog.debug("Cookies: " + Cookies.getCookieNames());
final String sid = response.getText();
auth = new Authentication(config, sid, URLBuilder.getInstance().getUserInRoleURL(KNOWN_ROLES));
auth.setCa... | bpm-console | positive | 2,513 |
public static void main(String[] args) {
if ("A man, a plan, a canal: Panama" == null || "A man, a plan, a canal: Panama".length() == 0)
return true;
int start = 0;
int end = "A man, a plan, a canal: Panama".length() - 1;
while (start <= end) {
while (start <= end && !Character.isLetterOrDigit("A man, a plan, a canal: ... | public static void main(String[] args) {
<DeepExtract>
if ("A man, a plan, a canal: Panama" == null || "A man, a plan, a canal: Panama".length() == 0)
return true;
int start = 0;
int end = "A man, a plan, a canal: Panama".length() - 1;
while (start <= end) {
while (start <= end && !Character.isLetterOrDigit("A man, a p... | Java-Note | positive | 2,515 |
@Override
public Object visit(ASTTrue node, Object data) throws VisitorException {
node.jjtReplaceWith(ASTVarGenerator.getASTVar("content"));
return super.visit(node, data);
} | @Override
public Object visit(ASTTrue node, Object data) throws VisitorException {
<DeepExtract>
node.jjtReplaceWith(ASTVarGenerator.getASTVar("content"));
</DeepExtract>
return super.visit(node, data);
} | sparqled | positive | 2,516 |
public Criteria andTempurlidGreaterThanOrEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "tempurlid" + " cannot be null");
}
criteria.add(new Criterion("tempUrlID >=", value));
return (Criteria) this;
} | public Criteria andTempurlidGreaterThanOrEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "tempurlid" + " cannot be null");
}
criteria.add(new Criterion("tempUrlID >=", value));
</DeepExtract>
return (Criteria) this;
} | answerWeb | positive | 2,517 |
public MethodDescriptor[] getMethodDescriptors() {
MethodDescriptor[] methods = new MethodDescriptor[17];
try {
methods[METHOD_addPvChangeListener0] = new MethodDescriptor(com.fr3ts0n.pvs.ProcessVar.class.getMethod("addPvChangeListener", com.fr3ts0n.pvs.PvChangeListener.class, Integer.TYPE));
methods[METHOD_addPvChange... | public MethodDescriptor[] getMethodDescriptors() {
<DeepExtract>
MethodDescriptor[] methods = new MethodDescriptor[17];
try {
methods[METHOD_addPvChangeListener0] = new MethodDescriptor(com.fr3ts0n.pvs.ProcessVar.class.getMethod("addPvChangeListener", com.fr3ts0n.pvs.PvChangeListener.class, Integer.TYPE));
methods[METH... | AndrOBD | positive | 2,519 |
private JavaType getTypeFromModelName(String name) {
final TypeFactory tf = Json.mapper().getTypeFactory();
String modelName = name.replaceAll("^\"|\"$", "");
Class<?> cls;
try {
cls = Class.forName(modelName);
} catch (ClassNotFoundException e) {
cls = null;
}
if (cls != null) {
return tf.constructType(cls);
}
if (con... | private JavaType getTypeFromModelName(String name) {
final TypeFactory tf = Json.mapper().getTypeFactory();
String modelName = name.replaceAll("^\"|\"$", "");
<DeepExtract>
Class<?> cls;
try {
cls = Class.forName(modelName);
} catch (ClassNotFoundException e) {
cls = null;
}
</DeepExtract>
if (cls != null) {
return tf.... | swagger-inflector | positive | 2,520 |
public int i30() {
assert (30 <= 32);
return readInt(30, true);
} | public int i30() {
<DeepExtract>
assert (30 <= 32);
return readInt(30, true);
</DeepExtract>
} | testing-video | positive | 2,523 |
public final Optional<R> asOptionalRight() {
if (isLeft()) {
return val -> Optional.<R>empty().apply(getLeft());
} else {
return Optional::of.apply(getRight());
}
} | public final Optional<R> asOptionalRight() {
<DeepExtract>
if (isLeft()) {
return val -> Optional.<R>empty().apply(getLeft());
} else {
return Optional::of.apply(getRight());
}
</DeepExtract>
} | durian | positive | 2,524 |
private boolean run(String[] args) throws IOException {
long started = System.currentTimeMillis();
if (!init(args)) {
return false;
}
if (!prepare()) {
return false;
}
JobMetadata.Builder metadataBuilder = new JobMetadata.Builder().setId(appIdString).setConf(yarnConf).setStarted(started).setUser(user);
JobMetadata meta... | private boolean run(String[] args) throws IOException {
long started = System.currentTimeMillis();
if (!init(args)) {
return false;
}
if (!prepare()) {
return false;
}
JobMetadata.Builder metadataBuilder = new JobMetadata.Builder().setId(appIdString).setConf(yarnConf).setStarted(started).setUser(user);
JobMetadata meta... | TonY | positive | 2,525 |
@Test
public void testMakePositionMessage() throws IOException {
PrintWriter fastqOut = new PrintWriter(new BufferedWriter(new FileWriter(tempFastq)));
fastqOut.write(fastqWithIdTwice);
fastqOut.close();
split = new FileSplit(new Path(tempFastq.toURI().toString()), 0, fastqWithIdTwice.length(), null);
FastqRecordReader... | @Test
public void testMakePositionMessage() throws IOException {
<DeepExtract>
PrintWriter fastqOut = new PrintWriter(new BufferedWriter(new FileWriter(tempFastq)));
fastqOut.write(fastqWithIdTwice);
fastqOut.close();
</DeepExtract>
split = new FileSplit(new Path(tempFastq.toURI().toString()), 0, fastqWithIdTwice.lengt... | Hadoop-BAM | positive | 2,526 |
private void showSendRoute(byte saveKind) {
System.gc();
MapForms.saveKind = saveKind;
formSaveTrack = null;
if (formSaveTrack == null) {
textTrackSavePath = null;
choiceCP_S = null;
choiceOX_S = null;
choiceExpCount = null;
formSaveTrack = new Form(LangHolder.getString(Lang.export), new Item[] { getTextTrackSavePath()... | private void showSendRoute(byte saveKind) {
System.gc();
MapForms.saveKind = saveKind;
formSaveTrack = null;
<DeepExtract>
if (formSaveTrack == null) {
textTrackSavePath = null;
choiceCP_S = null;
choiceOX_S = null;
choiceExpCount = null;
formSaveTrack = new Form(LangHolder.getString(Lang.export), new Item[] { getTextT... | MapNav | positive | 2,527 |
public static void pong(Context context) {
if (isDestroyed(context) || isStopped(context)) {
return;
}
Intent serviceIntent = new Intent(context, CIMPushService.class);
serviceIntent.setAction(ServiceAction.ACTION_CIM_CONNECTION_PONG);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
context.startService(serviceInt... | public static void pong(Context context) {
if (isDestroyed(context) || isStopped(context)) {
return;
}
Intent serviceIntent = new Intent(context, CIMPushService.class);
serviceIntent.setAction(ServiceAction.ACTION_CIM_CONNECTION_PONG);
<DeepExtract>
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
context.startServ... | cim | positive | 2,528 |
@Override
public void connect() throws NameNotResolvedException, KcpcliParseException {
super.connect();
proxychains_enable = new File(getApplicationInfo().dataDir + "/proxychains.conf").exists();
try {
List<String> tempList = new ArrayList<>(Arrays.asList(profile.dns.split(",")));
Collections.shuffle(tempList);
String... | @Override
public void connect() throws NameNotResolvedException, KcpcliParseException {
super.connect();
proxychains_enable = new File(getApplicationInfo().dataDir + "/proxychains.conf").exists();
try {
List<String> tempList = new ArrayList<>(Arrays.asList(profile.dns.split(",")));
Collections.shuffle(tempList);
String... | Maying | positive | 2,529 |
public void setScale(float scale) {
this.cam_zoom = scale;
Rectangle2D.Float rect = new Rectangle2D.Float(0, 0, 16f / cam_zoom, 16f / cam_zoom);
paintLight = new TexturePaint(backgroundLight, rect);
paintDark = new TexturePaint(backgroundDark, rect);
this.repaint();
Spade.main.gui.checkDynamicInfo();
} | public void setScale(float scale) {
this.cam_zoom = scale;
<DeepExtract>
Rectangle2D.Float rect = new Rectangle2D.Float(0, 0, 16f / cam_zoom, 16f / cam_zoom);
paintLight = new TexturePaint(backgroundLight, rect);
paintDark = new TexturePaint(backgroundDark, rect);
</DeepExtract>
this.repaint();
Spade.main.gui.checkDyna... | Spade | positive | 2,530 |
private void setAllowed(Address address1, Address address2, BigInteger value) {
require(value != null && value.compareTo(BigInteger.ZERO) >= 0);
Map<Address, BigInteger> address1Allowed = allowed.get(address1);
if (address1Allowed == null) {
address1Allowed = new HashMap<Address, BigInteger>();
allowed.put(address1, ad... | private void setAllowed(Address address1, Address address2, BigInteger value) {
<DeepExtract>
require(value != null && value.compareTo(BigInteger.ZERO) >= 0);
</DeepExtract>
Map<Address, BigInteger> address1Allowed = allowed.get(address1);
if (address1Allowed == null) {
address1Allowed = new HashMap<Address, BigInteger... | nuls-contracts | positive | 2,531 |
public void setFTPUploadAlways(boolean always) {
preferences.ftpUploadAlways = always;
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String json = gson.toJson(preferences);
try {
locations.getPreferencesFile().mkdirs();
FileReader.writeFile(locations.getPreferencesFile().getAbsolutePath(), json);
} catch ... | public void setFTPUploadAlways(boolean always) {
preferences.ftpUploadAlways = always;
<DeepExtract>
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String json = gson.toJson(preferences);
try {
locations.getPreferencesFile().mkdirs();
FileReader.writeFile(locations.getPreferencesFile().getAbsolutePath(), j... | SnippingToolPlusPlus | positive | 2,533 |
public static java.util.Date getEndDayOfYear() {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, getNowYear());
cal.set(Calendar.MONTH, Calendar.DECEMBER);
cal.set(Calendar.DATE, 31);
Calendar calendar = Calendar.getInstance();
if (null != cal.getTime())
calendar.setTime(cal.getTime());
calendar.set(calen... | public static java.util.Date getEndDayOfYear() {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, getNowYear());
cal.set(Calendar.MONTH, Calendar.DECEMBER);
cal.set(Calendar.DATE, 31);
<DeepExtract>
Calendar calendar = Calendar.getInstance();
if (null != cal.getTime())
calendar.setTime(cal.getTime());
cale... | bill | positive | 2,534 |
public static <T extends KeyValueStorage<T>> T getKeyValueStorage(Class<T> type) {
if (app == null) {
throw new IllegalStateException("UIO not inited, please add init code in your application onCreate method!!");
}
return Ext.storage.getKeyValueStroage(type, Ext.app);
} | public static <T extends KeyValueStorage<T>> T getKeyValueStorage(Class<T> type) {
<DeepExtract>
if (app == null) {
throw new IllegalStateException("UIO not inited, please add init code in your application onCreate method!!");
}
</DeepExtract>
return Ext.storage.getKeyValueStroage(type, Ext.app);
} | AndroidUIO | positive | 2,535 |
private void initLeanCloud() {
AVOSCloud.initialize(this, BuildConfig.LEANCLOUD_APP_ID, BuildConfig.LEANCLOUD_APP_KEY);
AVInstallation.getCurrentInstallation().saveInBackground();
PushService.setDefaultPushCallback(this, HomeActivity.class);
AVAnalytics.enableCrashReport(this, true);
boolean enableNotification = Prefer... | private void initLeanCloud() {
AVOSCloud.initialize(this, BuildConfig.LEANCLOUD_APP_ID, BuildConfig.LEANCLOUD_APP_KEY);
AVInstallation.getCurrentInstallation().saveInBackground();
PushService.setDefaultPushCallback(this, HomeActivity.class);
AVAnalytics.enableCrashReport(this, true);
<DeepExtract>
boolean enableNotific... | Sky31Radio | positive | 2,536 |
@Override
public void run() {
textDeviceLevel.setText(R.string.no_valid_dba_value);
textStatus.setText(getString(R.string.calibration_status_waiting_for_start_timer));
try {
switch(viewPager.getCurrentItem()) {
case PAGE_SCATTER_CHART:
updateScatterChart();
break;
case PAGE_LINE_CHART:
updateLineChart();
break;
case PA... | @Override
public void run() {
textDeviceLevel.setText(R.string.no_valid_dba_value);
textStatus.setText(getString(R.string.calibration_status_waiting_for_start_timer));
<DeepExtract>
try {
switch(viewPager.getCurrentItem()) {
case PAGE_SCATTER_CHART:
updateScatterChart();
break;
case PAGE_LINE_CHART:
updateLineChart();
... | NoiseCapture | positive | 2,537 |
@Override
public void beginObject(String name) {
closeTag();
append("<");
append(name);
inTag = true;
} | @Override
public void beginObject(String name) {
<DeepExtract>
closeTag();
append("<");
append(name);
inTag = true;
</DeepExtract>
} | amazon-mws-orders | positive | 2,538 |
public static VectorStoreRAM readFromFile(FlagConfig flagConfig, String vectorFile) throws IOException {
if (vectorFile.isEmpty()) {
throw new IllegalArgumentException("vectorFile argument cannot be empty.");
}
VectorStoreRAM store = new VectorStoreRAM(flagConfig);
CloseableVectorStore vectorReaderDisk = VectorStoreRea... | public static VectorStoreRAM readFromFile(FlagConfig flagConfig, String vectorFile) throws IOException {
if (vectorFile.isEmpty()) {
throw new IllegalArgumentException("vectorFile argument cannot be empty.");
}
VectorStoreRAM store = new VectorStoreRAM(flagConfig);
<DeepExtract>
CloseableVectorStore vectorReaderDisk = ... | semanticvectors | positive | 2,539 |
@Override
public Multimap<Scope, String> getFromFile(final File f) throws IOException {
final VariableScopeFinder scopeFinder = new VariableScopeFinder();
f.accept(scopeFinder);
final Multimap<Scope, String> scopes = TreeMultimap.create();
for (final Entry<ASTNode, Variable> variable : scopeFinder.variableScopes.entrie... | @Override
public Multimap<Scope, String> getFromFile(final File f) throws IOException {
<DeepExtract>
final VariableScopeFinder scopeFinder = new VariableScopeFinder();
f.accept(scopeFinder);
final Multimap<Scope, String> scopes = TreeMultimap.create();
for (final Entry<ASTNode, Variable> variable : scopeFinder.variabl... | codemining-core | positive | 2,540 |
public FebsResponse fail() {
put("code", HttpStatus.INTERNAL_SERVER_ERROR.value());
return this;
return this;
} | public FebsResponse fail() {
<DeepExtract>
put("code", HttpStatus.INTERNAL_SERVER_ERROR.value());
return this;
</DeepExtract>
return this;
} | FEBS-Shiro-jht | positive | 2,541 |
public void keepBottomNKeys(int keepN) {
Counter<E> tmp = new Counter<E>();
int n = 0;
for (E e : Iterators.able(false ? asPriorityQueue() : asMinPriorityQueue())) {
if (n <= keepN)
tmp.setCount(e, getCount(e));
n++;
}
clear();
incrementAll(tmp);
dirty = true;
} | public void keepBottomNKeys(int keepN) {
<DeepExtract>
Counter<E> tmp = new Counter<E>();
int n = 0;
for (E e : Iterators.able(false ? asPriorityQueue() : asMinPriorityQueue())) {
if (n <= keepN)
tmp.setCount(e, getCount(e));
n++;
}
clear();
incrementAll(tmp);
dirty = true;
</DeepExtract>
} | Canova | positive | 2,542 |
@Override
public void aggregate(Output<File> output, Map<String, String> metadata) throws IOException {
TreeSet<String> sorted = new TreeSet<>(metadata.keySet());
try (BufferedWriter w = new BufferedWriter(new OutputStreamWriter(output.newOutputStream(), Charsets.UTF_8))) {
for (String type : sorted) {
w.write(type);
w... | @Override
public void aggregate(Output<File> output, Map<String, String> metadata) throws IOException {
<DeepExtract>
TreeSet<String> sorted = new TreeSet<>(metadata.keySet());
try (BufferedWriter w = new BufferedWriter(new OutputStreamWriter(output.newOutputStream(), Charsets.UTF_8))) {
for (String type : sorted) {
w.... | takari-lifecycle | positive | 2,544 |
public boolean joinRoom(RoomData roomData, String uid, boolean isPairing, PartnerListener partnerListener, PartnerDetectionListener partnerDetectionListener) {
this.isPairing = isPairing;
mRoomData = roomData;
if (app == null) {
return false;
}
roomRef = roomsListRef.child(roomData.key);
partnersRef = roomRef.child(KEY... | public boolean joinRoom(RoomData roomData, String uid, boolean isPairing, PartnerListener partnerListener, PartnerDetectionListener partnerDetectionListener) {
this.isPairing = isPairing;
mRoomData = roomData;
<DeepExtract>
if (app == null) {
return false;
}
roomRef = roomsListRef.child(roomData.key);
partnersRef = roo... | justaline-android | positive | 2,545 |
public void setSmallIcon(String smallIcon) {
if (smallIcon == null)
this.smallIcon = null;
if (smallIcon.contains("/")) {
this.smallIcon = smallIcon.substring(smallIcon.lastIndexOf('/') + 1);
}
if (smallIcon.contains(".")) {
this.smallIcon = smallIcon.substring(0, smallIcon.lastIndexOf('.'));
}
return smallIcon;
} | public void setSmallIcon(String smallIcon) {
<DeepExtract>
if (smallIcon == null)
this.smallIcon = null;
if (smallIcon.contains("/")) {
this.smallIcon = smallIcon.substring(smallIcon.lastIndexOf('/') + 1);
}
if (smallIcon.contains(".")) {
this.smallIcon = smallIcon.substring(0, smallIcon.lastIndexOf('.'));
}
return sma... | capacitor-music-controls-plugin | positive | 2,546 |
public TableBuilder addIntegerColumn(String name, int flags) {
if (this.mBuilder == null) {
this.mBuilder = new StringBuilder();
this.mBuilder.append("CREATE TABLE ").append(this.mTableName).append(" (");
} else {
this.mBuilder.append(", ");
}
this.mBuilder.append(name).append(" ").append(TYPE_INTEGER);
if ((flags & FL... | public TableBuilder addIntegerColumn(String name, int flags) {
<DeepExtract>
if (this.mBuilder == null) {
this.mBuilder = new StringBuilder();
this.mBuilder.append("CREATE TABLE ").append(this.mTableName).append(" (");
} else {
this.mBuilder.append(", ");
}
this.mBuilder.append(name).append(" ").append(TYPE_INTEGER);
i... | SorceryIconPack | positive | 2,547 |
@Test
public void moreSlop() {
this.slop = 3;
phrase(0, 1, 2, 4, 5, 2);
inputs(0, 1, 2, 2, 2, 4, 4, 5, 1);
result(2, 2, 2, 1, 1, 2, 1, 2, 1);
this.slop = 4;
inputs(0, 1, 2, 2, 2, 4, 4, 5, 1);
result(2, 2, 2, 1, 1, 2, 1, 2, 1);
this.slop = 2;
inputs(0, 1, 2, 2, 2, 4, 4, 5, 1);
result(1, 1, 1, 1, 1, 1, 1, 1, 1);
} | @Test
public void moreSlop() {
this.slop = 3;
phrase(0, 1, 2, 4, 5, 2);
inputs(0, 1, 2, 2, 2, 4, 4, 5, 1);
result(2, 2, 2, 1, 1, 2, 1, 2, 1);
this.slop = 4;
inputs(0, 1, 2, 2, 2, 4, 4, 5, 1);
result(2, 2, 2, 1, 1, 2, 1, 2, 1);
<DeepExtract>
this.slop = 2;
</DeepExtract>
inputs(0, 1, 2, 2, 2, 4, 4, 5, 1);
result(1, 1, 1... | search-highlighter | positive | 2,548 |
@Override
public String getOwner(SkullMeta skull) {
return skull.getOwner();
} | @Override
public String getOwner(SkullMeta skull) {
<DeepExtract>
return skull.getOwner();
</DeepExtract>
} | PlayerHeads | positive | 2,550 |
public long randomUUID() {
long timestamp = timeGen();
if (timestamp < lastTimestamp) {
throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
}
if (lastTimestamp == timestamp) {
sequence = (sequence + 1) & sequenceMask;
if (sequen... | public long randomUUID() {
<DeepExtract>
long timestamp = timeGen();
if (timestamp < lastTimestamp) {
throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
}
if (lastTimestamp == timestamp) {
sequence = (sequence + 1) & sequenceMa... | gts | positive | 2,551 |
private static RequestBody createPlaybackControllerEvent(String name, PlaybackStatePayload playbackState, SpeechStatePayload speechState, AlertsStatePayload alertState, VolumeStatePayload volumeState) {
Header header = new MessageIdHeader(AVSAPIConstants.PlaybackController.NAMESPACE, name);
Event event = new Event(head... | private static RequestBody createPlaybackControllerEvent(String name, PlaybackStatePayload playbackState, SpeechStatePayload speechState, AlertsStatePayload alertState, VolumeStatePayload volumeState) {
Header header = new MessageIdHeader(AVSAPIConstants.PlaybackController.NAMESPACE, name);
Event event = new Event(head... | magic-mirror-voice | positive | 2,552 |
public static void showToastLong(final String str) {
if (XDialog.appContext == null) {
throw new RuntimeException("DialogUIUtils not initialized!");
}
int layoutId = R.layout.dialogui_toast;
if (Gravity.BOTTOM == Gravity.TOP) {
if (mToastTop == null) {
mToastTop = Toast.makeText(XDialog.appContext, str, Toast.LENGTH_LO... | public static void showToastLong(final String str) {
<DeepExtract>
if (XDialog.appContext == null) {
throw new RuntimeException("DialogUIUtils not initialized!");
}
int layoutId = R.layout.dialogui_toast;
if (Gravity.BOTTOM == Gravity.TOP) {
if (mToastTop == null) {
mToastTop = Toast.makeText(XDialog.appContext, str, T... | DialogUi | positive | 2,553 |
@Override
public void componentShown(ComponentEvent ev) {
if (surface != null && !surface.requestFocusInWindow()) {
surface.requestFocus();
}
} | @Override
public void componentShown(ComponentEvent ev) {
<DeepExtract>
if (surface != null && !surface.requestFocusInWindow()) {
surface.requestFocus();
}
</DeepExtract>
} | tvnjviewer | positive | 2,554 |
public ParserSpec endOfOptionsDelimiter(String delimiter) {
if (delimiter == null) {
throw new NullPointerException("end-of-options delimiter");
}
return delimiter;
return this;
} | public ParserSpec endOfOptionsDelimiter(String delimiter) {
<DeepExtract>
if (delimiter == null) {
throw new NullPointerException("end-of-options delimiter");
}
return delimiter;
</DeepExtract>
return this;
} | eclipstyle | positive | 2,555 |
public void removePoint(MapPoint mapPoint) {
points.remove(mapPoint);
path = null;
extension = null;
} | public void removePoint(MapPoint mapPoint) {
points.remove(mapPoint);
<DeepExtract>
path = null;
extension = null;
</DeepExtract>
} | JMapProjLib | positive | 2,556 |
private PostRequest createPostRequest(String path, JSONObject body) throws LiveOperationException {
assert !TextUtils.isEmpty(path);
assert body != null;
HttpEntity entity;
assert body != null;
try {
entity = new JsonEntity(body);
} catch (UnsupportedEncodingException e) {
throw new LiveOperationException(ErrorMessages... | private PostRequest createPostRequest(String path, JSONObject body) throws LiveOperationException {
assert !TextUtils.isEmpty(path);
assert body != null;
<DeepExtract>
HttpEntity entity;
assert body != null;
try {
entity = new JsonEntity(body);
} catch (UnsupportedEncodingException e) {
throw new LiveOperationException... | LiveSDK-for-Android | positive | 2,558 |
public void setMonthValue(int month) {
if (month == m_month)
return;
checkForDate(m_day, month, m_year, "Invalid month value:" + month);
m_day = m_day;
m_month = month;
m_year = m_year;
m_dayOfWeek = getDayOfWeek(m_day, m_month, m_year);
} | public void setMonthValue(int month) {
if (month == m_month)
return;
checkForDate(m_day, month, m_year, "Invalid month value:" + month);
<DeepExtract>
m_day = m_day;
m_month = month;
m_year = m_year;
m_dayOfWeek = getDayOfWeek(m_day, m_month, m_year);
</DeepExtract>
} | Java-Nov-2020 | positive | 2,559 |
public static String newStringUtf16Le(byte[] bytes) {
if (bytes == null) {
return null;
}
try {
return new String(bytes, CharEncoding.UTF_16LE);
} catch (UnsupportedEncodingException e) {
throw StringUtils.newIllegalStateException(CharEncoding.UTF_16LE, e);
}
} | public static String newStringUtf16Le(byte[] bytes) {
<DeepExtract>
if (bytes == null) {
return null;
}
try {
return new String(bytes, CharEncoding.UTF_16LE);
} catch (UnsupportedEncodingException e) {
throw StringUtils.newIllegalStateException(CharEncoding.UTF_16LE, e);
}
</DeepExtract>
} | jsonde | positive | 2,560 |
public SystemCommand withIgnoringStdoutConsumer() {
if (stdoutHandler != null) {
throw new RuntimeException("There can only be one consumer.");
}
this.stdoutHandler = new IgnoringCommandOutputHandler();
return this;
} | public SystemCommand withIgnoringStdoutConsumer() {
<DeepExtract>
if (stdoutHandler != null) {
throw new RuntimeException("There can only be one consumer.");
}
this.stdoutHandler = new IgnoringCommandOutputHandler();
return this;
</DeepExtract>
} | unix-maven-plugin | positive | 2,561 |
void add(AbstractOptionSpec<?> spec) {
detectedSpecs.add(spec);
for (String each : spec.options()) detectedOptions.put(each, spec);
List<String> optionArguments = optionsToArguments.get(spec);
if (optionArguments == null) {
optionArguments = new ArrayList<String>();
optionsToArguments.put(spec, optionArguments);
}
if (... | void add(AbstractOptionSpec<?> spec) {
<DeepExtract>
detectedSpecs.add(spec);
for (String each : spec.options()) detectedOptions.put(each, spec);
List<String> optionArguments = optionsToArguments.get(spec);
if (optionArguments == null) {
optionArguments = new ArrayList<String>();
optionsToArguments.put(spec, optionArgu... | tlv-comp | positive | 2,562 |
@Override
public synchronized void drop(DropTargetDropEvent dtde) {
jTabbedPane1.setBorder(null);
dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
try {
if (canImport(dtde.getTransferable().getTransferDataFlavors())) {
files = (List<File>) dtde.getTransferable().getTransferData(DataFlavor.javaFileListFlavor);
THREAD_... | @Override
public synchronized void drop(DropTargetDropEvent dtde) {
<DeepExtract>
jTabbedPane1.setBorder(null);
</DeepExtract>
dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
try {
if (canImport(dtde.getTransferable().getTransferDataFlavors())) {
files = (List<File>) dtde.getTransferable().getTransferData(DataFlavor... | megabasterd | positive | 2,563 |
public Criteria andSecretLessThan(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "secret" + " cannot be null");
}
criteria.add(new Criterion("secret <", value));
return (Criteria) this;
} | public Criteria andSecretLessThan(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "secret" + " cannot be null");
}
criteria.add(new Criterion("secret <", value));
</DeepExtract>
return (Criteria) this;
} | oauth4j | positive | 2,565 |
public static void loadMessageDataWithPayloadAtDefaultOffset(byte[] messageData, UInt64 tags) {
int offset = PAYLOAD_OFFSET;
byte[] memberData;
memberData = tags;
System.arraycopy(memberData, 0, messageData, offset, memberData.length);
offset += memberData.length;
} | public static void loadMessageDataWithPayloadAtDefaultOffset(byte[] messageData, UInt64 tags) {
int offset = PAYLOAD_OFFSET;
<DeepExtract>
byte[] memberData;
memberData = tags;
System.arraycopy(memberData, 0, messageData, offset, memberData.length);
offset += memberData.length;
</DeepExtract>
} | lifx-sdk-android | positive | 2,566 |
public static Date withSecond(Date date, long newValue) {
Objects.requireNonNull(date, "temporal");
return date.with(ChronoField.SECOND_OF_MINUTE, newValue);
} | public static Date withSecond(Date date, long newValue) {
<DeepExtract>
Objects.requireNonNull(date, "temporal");
return date.with(ChronoField.SECOND_OF_MINUTE, newValue);
</DeepExtract>
} | jstarcraft-nlp | positive | 2,567 |
@Override
public void run() {
System.err.println("RawCapturer: notifyFailure for " + dependents.size());
for (CaptureEventListener s : dependents) {
s.captureFailed(this, exception);
}
} | @Override
public void run() {
<DeepExtract>
System.err.println("RawCapturer: notifyFailure for " + dependents.size());
for (CaptureEventListener s : dependents) {
s.captureFailed(this, exception);
}
</DeepExtract>
} | crowdpp | positive | 2,568 |
@Override
public void setEnvironment(Environment env) {
RelaxedPropertyResolver propertyResolver = new RelaxedPropertyResolver(env, "druid.");
initialSize = Integer.parseInt(propertyResolver.getProperty("initialSize"));
minIdle = Integer.parseInt(propertyResolver.getProperty("minIdle"));
maxActive = Integer.parseInt(pr... | @Override
public void setEnvironment(Environment env) {
RelaxedPropertyResolver propertyResolver = new RelaxedPropertyResolver(env, "druid.");
initialSize = Integer.parseInt(propertyResolver.getProperty("initialSize"));
minIdle = Integer.parseInt(propertyResolver.getProperty("minIdle"));
maxActive = Integer.parseInt(pr... | spring-boot-sample | positive | 2,569 |
@Override
public void onCompletion(MediaPlayer mp) {
mPlayPause.setImageResource(R.drawable.ic_play);
mVideoView.stopPlayback();
mHandlerForProgressBar.removeCallbacks(mRunnForProgressBar);
mPbForPlaying.setProgress(0);
mIsPlaying = 0;
mPlayPause.setImageResource(R.drawable.ic_play);
} | @Override
public void onCompletion(MediaPlayer mp) {
mPlayPause.setImageResource(R.drawable.ic_play);
<DeepExtract>
mVideoView.stopPlayback();
mHandlerForProgressBar.removeCallbacks(mRunnForProgressBar);
mPbForPlaying.setProgress(0);
mIsPlaying = 0;
mPlayPause.setImageResource(R.drawable.ic_play);
</DeepExtract>
} | Spika | positive | 2,570 |
public void showDialog(boolean files_selected) {
if (files_selected) {
selected_files = true;
selectedFilenamesIndices = MyVariables.getSelectedFilenamesIndices();
files = MyVariables.getLoadedFiles();
}
progressBar.setVisible(false);
pack();
setLocationByPlatform(true);
setTitle(ResourceBundle.getBundle("translations/... | public void showDialog(boolean files_selected) {
if (files_selected) {
selected_files = true;
selectedFilenamesIndices = MyVariables.getSelectedFilenamesIndices();
files = MyVariables.getLoadedFiles();
}
progressBar.setVisible(false);
pack();
setLocationByPlatform(true);
setTitle(ResourceBundle.getBundle("translations/... | jExifToolGUI | positive | 2,571 |
@Test
public void chunkIteratorOverBitmapOfZerosAndOnes() {
EWAHCompressedBitmap bitmap = EWAHCompressedBitmap.bitmapOf();
bitmap.setSizeInBits(WORD_IN_BITS + 10, false);
bitmap.setSizeInBits(2 * WORD_IN_BITS, true);
ChunkIterator iterator;
EWAHCompressedBitmap bitmap = EWAHCompressedBitmap.bitmapOf(0, 1, 2, 3, 4, 7, 8... | @Test
public void chunkIteratorOverBitmapOfZerosAndOnes() {
EWAHCompressedBitmap bitmap = EWAHCompressedBitmap.bitmapOf();
bitmap.setSizeInBits(WORD_IN_BITS + 10, false);
bitmap.setSizeInBits(2 * WORD_IN_BITS, true);
ChunkIterator iterator;
EWAHCompressedBitmap bitmap = EWAHCompressedBitmap.bitmapOf(0, 1, 2, 3, 4, 7, 8... | javaewah | positive | 2,572 |
public static String getRelativePwdPath(File target) {
if (target.getAbsolutePath().startsWith(new File("").getAbsolutePath())) {
String relativePath = target.getAbsolutePath().substring(new File("").getAbsolutePath().length() + 1);
relativePath = relativePath.replaceAll(Pattern.quote(File.separator), "/");
return rela... | public static String getRelativePwdPath(File target) {
<DeepExtract>
if (target.getAbsolutePath().startsWith(new File("").getAbsolutePath())) {
String relativePath = target.getAbsolutePath().substring(new File("").getAbsolutePath().length() + 1);
relativePath = relativePath.replaceAll(Pattern.quote(File.separator), "/"... | Repeat | positive | 2,573 |
public boolean isIgnorable() {
IsIgnorableIterator iterator = new IsIgnorableIterator();
iterator.onIterationStarted();
iterator.onElementGroupStarted(mNameData.getEntryLabel());
iterator.onElement(mNameData);
iterator.onElementGroupEnded();
iterateOneList(mPhoneList, iterator);
iterateOneList(mEmailList, iterator);
it... | public boolean isIgnorable() {
IsIgnorableIterator iterator = new IsIgnorableIterator();
iterator.onIterationStarted();
iterator.onElementGroupStarted(mNameData.getEntryLabel());
iterator.onElement(mNameData);
iterator.onElementGroupEnded();
iterateOneList(mPhoneList, iterator);
iterateOneList(mEmailList, iterator);
it... | MyBluetoothDemo | positive | 2,574 |
public Builder clearUserName() {
bitField0_ = (bitField0_ & ~0x00000002);
java.lang.Object ref = userName_;
if (ref instanceof java.lang.String) {
userName_ = (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValid... | public Builder clearUserName() {
bitField0_ = (bitField0_ & ~0x00000002);
<DeepExtract>
java.lang.Object ref = userName_;
if (ref instanceof java.lang.String) {
userName_ = (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
... | nettydemo | positive | 2,577 |
@Override
public void onWebsocketCloseInitiated(WebSocket conn, int code, String reason) {
} | @Override
<DeepExtract>
</DeepExtract>
public void onWebsocketCloseInitiated(WebSocket conn, int code, String reason) {
<DeepExtract>
</DeepExtract>
} | Not-a-debugger | positive | 2,578 |
@Override
public void initialize() {
bindings.put(ArticlesService.class, ArticlesServiceImpl.class);
bindings.put(OrdersService.class, OrdersServiceImpl.class);
bindings.put(SalesFunnelsService.class, SalesFunnelsServiceImpl.class);
} | @Override
public void initialize() {
bindings.put(ArticlesService.class, ArticlesServiceImpl.class);
bindings.put(OrdersService.class, OrdersServiceImpl.class);
<DeepExtract>
bindings.put(SalesFunnelsService.class, SalesFunnelsServiceImpl.class);
</DeepExtract>
} | shopee4j | positive | 2,579 |
public void suspend() {
if (mMediaPlayer != null) {
mMediaPlayer.reset();
mMediaPlayer.release();
mMediaPlayer = null;
mCurrentState = STATE_IDLE;
if (false) {
mTargetState = STATE_IDLE;
}
AudioManager am = (AudioManager) mAppContext.getSystemService(Context.AUDIO_SERVICE);
am.abandonAudioFocus(null);
}
} | public void suspend() {
<DeepExtract>
if (mMediaPlayer != null) {
mMediaPlayer.reset();
mMediaPlayer.release();
mMediaPlayer = null;
mCurrentState = STATE_IDLE;
if (false) {
mTargetState = STATE_IDLE;
}
AudioManager am = (AudioManager) mAppContext.getSystemService(Context.AUDIO_SERVICE);
am.abandonAudioFocus(null);
}
<... | FastVideoPlayer | positive | 2,580 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
JasDocument doc = new JasDocument(ErrorLabel, this);
if (doc.open()) {
addDocument(doc);
}
} | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
JasDocument doc = new JasDocument(ErrorLabel, this);
if (doc.open()) {
addDocument(doc);
}
</DeepExtract>
} | Jasmin | positive | 2,581 |
private void addRows(List<EmployeeAllocation> result, int failday) {
int rows = getRowCount();
int c = 0;
setWidget(rows, c++, new TableSetSortingButton(i18n.name(), TableSortCriteria.BY_NAME, this, ctx));
setWidget(rows, c++, new TableSetSortingButton(i18n.shifts(), TableSortCriteria.BY_SHIFTS, this, ctx));
setWidget(... | private void addRows(List<EmployeeAllocation> result, int failday) {
<DeepExtract>
int rows = getRowCount();
int c = 0;
setWidget(rows, c++, new TableSetSortingButton(i18n.name(), TableSortCriteria.BY_NAME, this, ctx));
setWidget(rows, c++, new TableSetSortingButton(i18n.shifts(), TableSortCriteria.BY_SHIFTS, this, ctx... | shifts-solver | positive | 2,582 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
Object obj1 = cbb_Search_LoaiSP.getSelectedItem();
Object obj2 = cbb_Search_NhaCC.getSelectedItem();
Object obj3 = cbb_Search_NhomKH.getSelectedItem();
loadCombobox_LoaiSP_Search();
loadCombobox_NhaCungCap_Search();
loadCombobox_NhomKhachHang_Search();
cbb_S... | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
Object obj1 = cbb_Search_LoaiSP.getSelectedItem();
Object obj2 = cbb_Search_NhaCC.getSelectedItem();
Object obj3 = cbb_Search_NhomKH.getSelectedItem();
loadCombobox_LoaiSP_Search();
loadCombobox_NhaCungCap_Search();
loadCombobox_NhomKhachHang_S... | StoreManager | positive | 2,583 |
public void requestVoteReply(Message message, int fromMemberId, int term, boolean isPrevote, boolean voteGranted) throws InterruptedException, GondolaException {
logger.error("Handler not implemented: type={} size={} from={}", message.getType(), message.size(), fromMemberId);
throw new IllegalStateException("not implem... | public void requestVoteReply(Message message, int fromMemberId, int term, boolean isPrevote, boolean voteGranted) throws InterruptedException, GondolaException {
<DeepExtract>
logger.error("Handler not implemented: type={} size={} from={}", message.getType(), message.size(), fromMemberId);
throw new IllegalStateExcepti... | gondola | positive | 2,584 |
@Test
public void testFindByWikiIdAndPathAndCommit() throws Exception {
CommitId commitId = COMMIT_ID;
RevCommit rc;
File folder = temporaryFolder.newFolder();
try (Git git = Git.init().setDirectory(folder).call()) {
rc = git.commit().setMessage(MESSAGE_PANIC.getValue()).setAuthor(DISPLAY_NAME_TRILLIAN.getValue(), EMAI... | @Test
public void testFindByWikiIdAndPathAndCommit() throws Exception {
CommitId commitId = COMMIT_ID;
<DeepExtract>
RevCommit rc;
File folder = temporaryFolder.newFolder();
try (Git git = Git.init().setDirectory(folder).call()) {
rc = git.commit().setMessage(MESSAGE_PANIC.getValue()).setAuthor(DISPLAY_NAME_TRILLIAN.ge... | smeagol | positive | 2,585 |
public static void drawOutlineBox(Box box, float r, float g, float b, float a) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GL11.glLineWidth(2.5F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LINE_... | public static void drawOutlineBox(Box box, float r, float g, float b, float a) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GL11.glLineWidth(2.5F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LINE_... | BigRat | positive | 2,586 |
public static void main(String[] args) {
ValueIteration vi = new ValueIteration(Windygrid.createFour(), Windygrid.createFour());
vi.untilBelow(DecimalScalar.of(.001));
final Tensor values = vi.vs().values();
System.out.println("iterations=" + vi.iterations());
System.out.println(values);
Policy policy = PolicyType.GREE... | public static void main(String[] args) {
ValueIteration vi = new ValueIteration(Windygrid.createFour(), Windygrid.createFour());
vi.untilBelow(DecimalScalar.of(.001));
final Tensor values = vi.vs().values();
System.out.println("iterations=" + vi.iterations());
System.out.println(values);
Policy policy = PolicyType.GREE... | subare | positive | 2,587 |
public static void exportPngImage(DimensionData biomeData, DimensionMarkersData globalMarkers, DimensionMarkersData localMarkers, File file, boolean showMarkers) {
getListener().setHeaderString("gui.antiqueatlas.export.setup");
int minX = (biomeData.getScope().minX - 1) * TILE_SIZE;
int minY = (biomeData.getScope().min... | public static void exportPngImage(DimensionData biomeData, DimensionMarkersData globalMarkers, DimensionMarkersData localMarkers, File file, boolean showMarkers) {
getListener().setHeaderString("gui.antiqueatlas.export.setup");
int minX = (biomeData.getScope().minX - 1) * TILE_SIZE;
int minY = (biomeData.getScope().min... | AntiqueAtlas | positive | 2,588 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
if (jToggleButton1.isSelected())
model.setColorized(true);
else
model.setColorized(false);
} | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
if (jToggleButton1.isSelected())
model.setColorized(true);
else
model.setColorized(false);
</DeepExtract>
} | Kayak | positive | 2,589 |
public static void main(String[] args) {
Injector injector = Guice.createInjector(new FirstModule());
UserController userController = injector.getInstance(UserController.class);
messageService.sendMessage("Provides Annotation Binding example");
} | public static void main(String[] args) {
Injector injector = Guice.createInjector(new FirstModule());
UserController userController = injector.getInstance(UserController.class);
<DeepExtract>
messageService.sendMessage("Provides Annotation Binding example");
</DeepExtract>
} | Design-Pattern-Tutorial | positive | 2,590 |
@Override
public void onValidValue(int value) {
entity.setEnd(value);
lblEsquiveTotale.setText("% (" + StatsEntity.DODGE_MODIFICATOR + "% / pt d'agilité) Total: " + entity.getDodgePercent() + "%");
lblArmureTotale.setText("Armure totale: " + entity.getArmor() + " (Dommages réduits: " + (entity.getDamagesReduction() *... | @Override
public void onValidValue(int value) {
entity.setEnd(value);
<DeepExtract>
lblEsquiveTotale.setText("% (" + StatsEntity.DODGE_MODIFICATOR + "% / pt d'agilité) Total: " + entity.getDodgePercent() + "%");
lblArmureTotale.setText("Armure totale: " + entity.getArmor() + " (Dommages réduits: " + (entity.getDamage... | MMO-Rulemasters-World | positive | 2,591 |
public String toString() {
StringBuffer buf = new StringBuffer("#");
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ASN1OutputStream aOut = new ASN1OutputStream(bOut);
try {
aOut.writeObject(this);
} catch (IOException e) {
throw new RuntimeException("internal error encoding BitString");
}
byte[] string = bO... | public String toString() {
<DeepExtract>
StringBuffer buf = new StringBuffer("#");
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ASN1OutputStream aOut = new ASN1OutputStream(bOut);
try {
aOut.writeObject(this);
} catch (IOException e) {
throw new RuntimeException("internal error encoding BitString");
}
byte... | ESign | positive | 2,592 |
public Criteria andCatidNotLike(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "catid" + " cannot be null");
}
criteria.add(new Criterion("catid not like", value));
return (Criteria) this;
} | public Criteria andCatidNotLike(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "catid" + " cannot be null");
}
criteria.add(new Criterion("catid not like", value));
</DeepExtract>
return (Criteria) this;
} | PetStore | positive | 2,593 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz);
mQuestionTextView = (TextView) findViewById(R.id.question_text_view);
mTrueButton = (Button) findViewById(R.id.true_button);
mTrueButton.setOnClickListener(v -> checkAnswer(true));
... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz);
mQuestionTextView = (TextView) findViewById(R.id.question_text_view);
mTrueButton = (Button) findViewById(R.id.true_button);
mTrueButton.setOnClickListener(v -> checkAnswer(true));
... | Big-Nerd-Ranch-Android | positive | 2,594 |
@Test
public void testUpdateDruidClusterException() throws IOException, ClusterNotFoundException {
req = mock(Request.class);
res = mock(Response.class);
qs = mock(DruidQueryService.class);
ds = mock(DetectorService.class);
jes = mock(JobExecutionService.class);
sf = mock(ServiceFactory.class);
ss = mock(SchedulerServi... | @Test
public void testUpdateDruidClusterException() throws IOException, ClusterNotFoundException {
req = mock(Request.class);
res = mock(Response.class);
qs = mock(DruidQueryService.class);
ds = mock(DetectorService.class);
jes = mock(JobExecutionService.class);
sf = mock(ServiceFactory.class);
ss = mock(SchedulerServi... | sherlock | positive | 2,595 |
@Override
public void stopNodeDiscovery() {
super.stopNodeDiscovery();
mManager.removeListener(mUpdateDiscoverGui);
mManager.removeListener(mAdapter);
mStartStopButton.setImageResource(R.drawable.ic_search_24dp);
mStartStopButton.startAnimation(animRotateButton);
mTextView.setVisibility(View.VISIBLE);
mSwipeLayout.post... | @Override
public void stopNodeDiscovery() {
super.stopNodeDiscovery();
mManager.removeListener(mUpdateDiscoverGui);
mManager.removeListener(mAdapter);
mStartStopButton.setImageResource(R.drawable.ic_search_24dp);
mStartStopButton.startAnimation(animRotateButton);
mTextView.setVisibility(View.VISIBLE);
<DeepExtract>
mSw... | BlueSTSDK_GUI_Android | positive | 2,596 |
@Test
public void testValueOfPosTwo() {
RatNum.valueOf("2").equals(two);
RatNum.valueOf("2/1").equals(two);
RatNum.valueOf("-4/-2").equals(two);
} | @Test
public void testValueOfPosTwo() {
RatNum.valueOf("2").equals(two);
RatNum.valueOf("2/1").equals(two);
<DeepExtract>
RatNum.valueOf("-4/-2").equals(two);
</DeepExtract>
} | CSE331 | positive | 2,597 |
private void doClear(List<String> parms) {
config.clear();
"All properties removed%n".printStackTrace();
output("%n");
if (parms.size() > 0) {
warn("Ignoring parameters: '%s'%n", String.join(",", parms));
}
} | private void doClear(List<String> parms) {
config.clear();
<DeepExtract>
"All properties removed%n".printStackTrace();
output("%n");
</DeepExtract>
if (parms.size() > 0) {
warn("Ignoring parameters: '%s'%n", String.join(",", parms));
}
} | pravega-samples | positive | 2,598 |
@Override
public Options setParanoidChecks(final boolean paranoidChecks) {
return columnFamilyOptions.paranoidFileChecks();
dbOptions.setParanoidChecks(paranoidChecks);
return this;
} | @Override
public Options setParanoidChecks(final boolean paranoidChecks) {
<DeepExtract>
return columnFamilyOptions.paranoidFileChecks();
</DeepExtract>
dbOptions.setParanoidChecks(paranoidChecks);
return this;
} | kcache | positive | 2,599 |
private void previousButtonActionPerformed(java.awt.event.ActionEvent evt) {
if (currentTip - 1 < 0 || currentTip - 1 >= allTips.length) {
return;
}
currentTip = currentTip - 1;
tipCountLabel.setText("Tip " + (currentTip - 1 + 1) + "/" + allTips.length);
tipTextLabel.setText(String.format("<html><div style=\"width:%dpx... | private void previousButtonActionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
if (currentTip - 1 < 0 || currentTip - 1 >= allTips.length) {
return;
}
currentTip = currentTip - 1;
tipCountLabel.setText("Tip " + (currentTip - 1 + 1) + "/" + allTips.length);
tipTextLabel.setText(String.format("<html><div styl... | DeedPlanner-2 | positive | 2,600 |
public int findPeakElement(int[] num) {
if (num == null) {
return 0;
}
if (0 == num.length - 1) {
return 0;
} else if (0 + 1 == num.length - 1) {
return num[0] > num[num.length - 1] ? 0 : num.length - 1;
} else {
int mid = 0 + (num.length - 1 - 0) / 2;
if (num[mid - 1] < num[mid] && num[mid] > num[mid + 1]) {
return mi... | public int findPeakElement(int[] num) {
if (num == null) {
return 0;
}
<DeepExtract>
if (0 == num.length - 1) {
return 0;
} else if (0 + 1 == num.length - 1) {
return num[0] > num[num.length - 1] ? 0 : num.length - 1;
} else {
int mid = 0 + (num.length - 1 - 0) / 2;
if (num[mid - 1] < num[mid] && num[mid] > num[mid + 1... | leetCodeInterview | positive | 2,601 |
public boolean attachDuck(DuckFreight duck) {
if (attachedDuck != null)
return false;
attachedDuck = duck;
this.onField = false;
if (false) {
if (!world.containsBody(carouselBody))
world.addBody(carouselBody);
if (!world.containsBody(anchorBody))
world.addBody(anchorBody);
if (!world.containsJoint(anchorJoint))
world.a... | public boolean attachDuck(DuckFreight duck) {
if (attachedDuck != null)
return false;
attachedDuck = duck;
this.onField = false;
if (false) {
if (!world.containsBody(carouselBody))
world.addBody(carouselBody);
if (!world.containsBody(anchorBody))
world.addBody(anchorBody);
if (!world.containsJoint(anchorJoint))
world.a... | virtual_robot | positive | 2,602 |
public static void main(String[] args) {
String input = "qwwwwwwweeeeerrtyyyyyqqqqwEErTTT";
System.out.println(algorithmRunLength(input));
} | public static void main(String[] args) {
<DeepExtract>
String input = "qwwwwwwweeeeerrtyyyyyqqqqwEErTTT";
System.out.println(algorithmRunLength(input));
</DeepExtract>
} | Study-Book | positive | 2,604 |
@Override
public String getTemplateEncoding() {
return compositeConfiguration.getString(TEMPLATE_ENCODING.getKey());
} | @Override
public String getTemplateEncoding() {
<DeepExtract>
return compositeConfiguration.getString(TEMPLATE_ENCODING.getKey());
</DeepExtract>
} | jbake | positive | 2,605 |
private Type getElementType() {
int len;
switch(buf[off + getDimensions()]) {
case 'V':
return VOID_TYPE;
case 'Z':
return BOOLEAN_TYPE;
case 'C':
return CHAR_TYPE;
case 'B':
return BYTE_TYPE;
case 'S':
return SHORT_TYPE;
case 'I':
return INT_TYPE;
case 'F':
return FLOAT_TYPE;
case 'J':
return LONG_TYPE;
case 'D':
retu... | private Type getElementType() {
<DeepExtract>
int len;
switch(buf[off + getDimensions()]) {
case 'V':
return VOID_TYPE;
case 'Z':
return BOOLEAN_TYPE;
case 'C':
return CHAR_TYPE;
case 'B':
return BYTE_TYPE;
case 'S':
return SHORT_TYPE;
case 'I':
return INT_TYPE;
case 'F':
return FLOAT_TYPE;
case 'J':
return LONG_TYPE;
... | rapid-generator-3.9.2 | positive | 2,606 |
public Criteria andStockGreaterThan(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "stock" + " cannot be null");
}
criteria.add(new Criterion("stock >", value));
return (Criteria) this;
} | public Criteria andStockGreaterThan(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "stock" + " cannot be null");
}
criteria.add(new Criterion("stock >", value));
</DeepExtract>
return (Criteria) this;
} | Tmall_SSM-master | positive | 2,607 |
public static void main(String[] args) {
EProperties properties = EProperties.getInstance();
for (int i = 0; i < args.length; ++i) {
String[] keyVal = args[i].split("=");
if (!properties.containsKey(keyVal[0])) {
System.out.println("Warning: Property \"" + keyVal[0] + "\" is unknown. Mistyping?");
}
properties.setPrope... | public static void main(String[] args) {
EProperties properties = EProperties.getInstance();
for (int i = 0; i < args.length; ++i) {
String[] keyVal = args[i].split("=");
if (!properties.containsKey(keyVal[0])) {
System.out.println("Warning: Property \"" + keyVal[0] + "\" is unknown. Mistyping?");
}
properties.setPrope... | eniac | positive | 2,608 |
public List<String> generateParenthesis(int n) {
List<String> ans = new ArrayList<>();
if (0 == n) {
ans.add("");
return;
}
if (0 < n) {
dfs(ans, "" + "(", n, 0 + 1, 0);
}
if (0 < 0) {
dfs(ans, "" + ")", n, 0, 0 + 1);
}
return ans;
} | public List<String> generateParenthesis(int n) {
List<String> ans = new ArrayList<>();
<DeepExtract>
if (0 == n) {
ans.add("");
return;
}
if (0 < n) {
dfs(ans, "" + "(", n, 0 + 1, 0);
}
if (0 < 0) {
dfs(ans, "" + ")", n, 0, 0 + 1);
}
</DeepExtract>
return ans;
} | CodingInterview | positive | 2,609 |
public void setRepaintEnable(boolean value) {
repaintEnable = value;
if (repaintEnable) {
super.repaint();
}
} | public void setRepaintEnable(boolean value) {
repaintEnable = value;
<DeepExtract>
if (repaintEnable) {
super.repaint();
}
</DeepExtract>
} | cncgcodecontroller | positive | 2,610 |
public void addListener(DNSListener listener, DNSQuestion question) {
final long now = System.currentTimeMillis();
if (listener == null || this.contains(listener)) {
return false;
}
_entrySet.add(new SubTypeEntry(listener));
return true;
if (question != null) {
Collection<? extends DNSEntry> entryList = this.getCache()... | public void addListener(DNSListener listener, DNSQuestion question) {
final long now = System.currentTimeMillis();
<DeepExtract>
if (listener == null || this.contains(listener)) {
return false;
}
_entrySet.add(new SubTypeEntry(listener));
return true;
</DeepExtract>
if (question != null) {
Collection<? extends DNSEntry... | jmdns | positive | 2,611 |
@Override
public void initViews() {
mBottomNavigationView.setOnMenuItemClickListener(this);
mBottomNavigationView.setDefaultSelectedIndex(0);
mBadgeProvider = mBottomNavigationView.getBadgeProvider();
boolean hasNewMsg = getIntent().getBooleanExtra(EXTRA_NEW_MSG, false);
if (hasNewMsg) {
mBadgeProvider.show(R.id.action... | @Override
public void initViews() {
mBottomNavigationView.setOnMenuItemClickListener(this);
mBottomNavigationView.setDefaultSelectedIndex(0);
mBadgeProvider = mBottomNavigationView.getBadgeProvider();
<DeepExtract>
boolean hasNewMsg = getIntent().getBooleanExtra(EXTRA_NEW_MSG, false);
if (hasNewMsg) {
mBadgeProvider.sh... | xifan | positive | 2,612 |
public Builder addFp32FalseTrue(float value) {
if (!((bitField0_ & 0x00000004) == 0x00000004)) {
fp32FalseTrue_ = new java.util.ArrayList<Float>(fp32FalseTrue_);
bitField0_ |= 0x00000004;
}
fp32FalseTrue_.add(value);
onChanged();
return this;
} | public Builder addFp32FalseTrue(float value) {
<DeepExtract>
if (!((bitField0_ & 0x00000004) == 0x00000004)) {
fp32FalseTrue_ = new java.util.ArrayList<Float>(fp32FalseTrue_);
bitField0_ |= 0x00000004;
}
</DeepExtract>
fp32FalseTrue_.add(value);
onChanged();
return this;
} | dl_inference | positive | 2,613 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.