before
stringlengths 12
3.76M
| after
stringlengths 37
3.84M
| repo
stringlengths 1
56
| type
stringclasses 1
value |
|---|---|---|---|
private void validateConfig() throws DBException {
if (StringUtil.isEmptyString(url))
throw new DBException("DB-D0007", "driverClassName");
if (StringUtil.isEmptyString(url))
throw new DBException("DB-D0007", "url");
if (StringUtil.isEmptyString(url))
throw new DBException("DB-D0007", "username");
}
|
<DeepExtract>
if (StringUtil.isEmptyString(url))
throw new DBException("DB-D0007", "driverClassName");
</DeepExtract>
<DeepExtract>
if (StringUtil.isEmptyString(url))
throw new DBException("DB-D0007", "url");
</DeepExtract>
<DeepExtract>
if (StringUtil.isEmptyString(url))
throw new DBException("DB-D0007", "username");
</DeepExtract>
|
rexdb
|
positive
|
@SneakyThrows
public static String getAggregateStoreDDL(@Nonnull Connection connection) {
final String databaseName = JdbcUtils.getDatabaseName(connection);
if (AGGREGATE_STORE_DDLS.get(databaseName) == null) {
final String databaseName = JdbcUtils.getDatabaseName(connection);
throw new IllegalArgumentException(String.format("DDL for %s type not supported", databaseName));
}
final String schemaName = getSchemaName(connection);
final int databaseVersion = JdbcUtils.getDatabaseMajorVersion(connection);
return AGGREGATE_STORE_DDLS.get(databaseName).read(schemaName, null, databaseVersion);
}
|
<DeepExtract>
if (AGGREGATE_STORE_DDLS.get(databaseName) == null) {
final String databaseName = JdbcUtils.getDatabaseName(connection);
throw new IllegalArgumentException(String.format("DDL for %s type not supported", databaseName));
}
final String schemaName = getSchemaName(connection);
final int databaseVersion = JdbcUtils.getDatabaseMajorVersion(connection);
return AGGREGATE_STORE_DDLS.get(databaseName).read(schemaName, null, databaseVersion);
</DeepExtract>
|
jes
|
positive
|
public boolean visit(SimpleName node) {
ITypeBinding tb = node.resolveTypeBinding();
if (tb != null) {
if (tb.getName().equals("boolean")) {
expressionsInScope.add(node);
}
}
return true;
}
|
<DeepExtract>
ITypeBinding tb = node.resolveTypeBinding();
if (tb != null) {
if (tb.getName().equals("boolean")) {
expressionsInScope.add(node);
}
}
</DeepExtract>
|
genprog4java
|
positive
|
@Override
public void run() {
if (this.status != ZmqSocketStatus.PENDING) {
this.status = ZmqSocketStatus.PENDING;
metrics.setStatus(ZmqSocketStatus.PENDING);
LOGGER.log(Level.INFO, "Socket [" + name + "@" + socketAddr + "] changed status: " + ZmqSocketStatus.PENDING);
}
do {
final ZmqSocketStatus status = openSocket(this);
if (status == (ZmqSocketStatus.RUNNING) || !active.get()) {
break;
}
try {
Thread.sleep(SOCKET_RETRY_MILLI_SECOND);
} catch (InterruptedException ex) {
LOGGER.warning("Opening of socket hibernation interrupted: " + this);
}
} while (status == ZmqSocketStatus.PAUSED && active.get());
if (status == ZmqSocketStatus.RUNNING && active.get()) {
if (socketOutgoing) {
socket.setReceiveTimeOut(0);
} else {
socket.setReceiveTimeOut(socketWaitTime);
}
while (active.get()) {
if (socketOutgoing) {
status = sendSocket(this);
if (status == ZmqSocketStatus.ERROR) {
break;
}
}
if (socketIncoming) {
status = receiveSocket(this);
if (status == ZmqSocketStatus.ERROR) {
break;
}
}
}
if (socketHeartbeat && socketOutgoing && socketIncoming) {
socket.setReceiveTimeOut(socketWaitTime);
sendSocket(this);
}
}
final String socketAddr = this.socketAddr;
final ZMQ.Socket socket = this.socket;
if (socketBound) {
try {
socket.setLinger(0);
socket.unbind(socketAddr);
socket.close();
} catch (Exception ex) {
LOGGER.log(Level.SEVERE, "Socketing unbind failure: " + this, ex);
throw ex;
}
LOGGER.info("Unbind socket successful: " + this);
} else {
try {
socket.setLinger(0);
socket.disconnect(socketAddr);
socket.close();
} catch (Exception ex) {
LOGGER.log(Level.SEVERE, "Socket disconnect failure: " + this, ex);
throw ex;
}
LOGGER.info("Disconnect socket successful: " + this);
}
setStatus(ZmqSocketStatus.STOPPED);
socketListener.close(this);
return getStatus();
if (this.status != ZmqSocketStatus.STOPPED) {
this.status = ZmqSocketStatus.STOPPED;
metrics.setStatus(ZmqSocketStatus.STOPPED);
LOGGER.log(Level.INFO, "Socket [" + name + "@" + socketAddr + "] changed status: " + ZmqSocketStatus.STOPPED);
}
}
|
<DeepExtract>
if (this.status != ZmqSocketStatus.PENDING) {
this.status = ZmqSocketStatus.PENDING;
metrics.setStatus(ZmqSocketStatus.PENDING);
LOGGER.log(Level.INFO, "Socket [" + name + "@" + socketAddr + "] changed status: " + ZmqSocketStatus.PENDING);
}
</DeepExtract>
<DeepExtract>
final String socketAddr = this.socketAddr;
final ZMQ.Socket socket = this.socket;
if (socketBound) {
try {
socket.setLinger(0);
socket.unbind(socketAddr);
socket.close();
} catch (Exception ex) {
LOGGER.log(Level.SEVERE, "Socketing unbind failure: " + this, ex);
throw ex;
}
LOGGER.info("Unbind socket successful: " + this);
} else {
try {
socket.setLinger(0);
socket.disconnect(socketAddr);
socket.close();
} catch (Exception ex) {
LOGGER.log(Level.SEVERE, "Socket disconnect failure: " + this, ex);
throw ex;
}
LOGGER.info("Disconnect socket successful: " + this);
}
setStatus(ZmqSocketStatus.STOPPED);
socketListener.close(this);
return getStatus();
</DeepExtract>
<DeepExtract>
if (this.status != ZmqSocketStatus.STOPPED) {
this.status = ZmqSocketStatus.STOPPED;
metrics.setStatus(ZmqSocketStatus.STOPPED);
LOGGER.log(Level.INFO, "Socket [" + name + "@" + socketAddr + "] changed status: " + ZmqSocketStatus.STOPPED);
}
</DeepExtract>
|
jeromq-jms
|
positive
|
public Criteria andUpdateTimeLessThan(Date value) {
if (value == null) {
throw new RuntimeException("Value for " + "updateTime" + " cannot be null");
}
criteria.add(new Criterion("update_time <", value));
return (Criteria) this;
}
|
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "updateTime" + " cannot be null");
}
criteria.add(new Criterion("update_time <", value));
</DeepExtract>
|
dubbo-mock
|
positive
|
@Test
public void test2() throws Exception {
String expected = "import static com.MyUtil.kuk;\n" + "import static org.junit.Assert.assertNotNull;\n" + "import static tmutil.StringUtil.replaceText;\n\n" + "import java.util.HashMap;\n" + "import java.util.Map;\n" + "\n" + "import org.jingle.mocquer.MockControl;\n" + N + "import sun.security.action.GetLongAction;\n" + "import tmplatform.authorisation.ApiClientLink;\n" + "import tmplatform.comms.common.caaa.EvasLdapInterfaceProfileWrapper;\n" + "import base.LoadUnitTestDataTestCase;\n";
String imports = "import static com.MyUtil.kuk;\n" + "import java.util.Map;\n" + "\n" + "import static org.junit.Assert.assertNotNull;\n" + "import tmplatform.authorisation.ApiClientLink;\n" + "import java.util.HashMap;\n" + "import sun.security.action.GetLongAction;\n" + "import org.jingle.mocquer.MockControl;\n" + "import tmplatform.comms.common.caaa.EvasLdapInterfaceProfileWrapper;\n" + N + "import static tmutil.StringUtil.replaceText;\n\n" + "import base.LoadUnitTestDataTestCase;\n";
List<String> importsOrder = Arrays.asList("java", "javax", "org", "com");
List<String> strings = ImportsSorter450.sort(StringUtils.trimImports(imports), importsOrder);
StringBuilder stringBuilder = print(strings);
System.out.println("-----expected------");
System.out.println(expected);
Assert.assertEquals(expected, stringBuilder.toString());
System.out.println("-----------------");
}
|
<DeepExtract>
StringBuilder stringBuilder = print(strings);
System.out.println("-----expected------");
System.out.println(expected);
Assert.assertEquals(expected, stringBuilder.toString());
System.out.println("-----------------");
</DeepExtract>
|
EclipseCodeFormatter
|
positive
|
@PUT
@WebMethod(name = "updateFailure")
public JsonHttpResponse updateFailure(@JsonBody MyJsonObject body) {
this.message = body.getMessage() + " - NOT UPDATED";
JsonHttpResponse error500 = new JsonHttpResponse(JSONObject.fromObject(body), 500);
throw error500;
}
|
<DeepExtract>
this.message = body.getMessage() + " - NOT UPDATED";
</DeepExtract>
|
jenkins-test-harness
|
positive
|
public void chooseNewRoot() {
DirectoryChooser chooser = new DirectoryChooser();
chooser.setTitle(I18n.t(Constants.I18N_DIRECTORY_CHOOSER_TITLE));
File selectedDirectory = chooser.showDialog(stage);
if (selectedDirectory == null)
return;
Path path = selectedDirectory.toPath();
if (realRoots.containsKey(path.toString())) {
alertAddFolder(path.toString(), path.toString());
return;
}
for (String pathString : realRoots.keySet()) {
Path path = Paths.get(pathString);
if (path.startsWith(path) || path.startsWith(path)) {
alertAddFolder(path.toString(), pathString);
return;
}
}
this.setTop(top);
this.setCenter(fileExplorer);
this.setBottom(bottom);
SourceTreeDirectory rootNode = new SourceTreeDirectory(path, new SourceDirectory(path, isShowFiles()), null);
realRoots.put(path.toString(), rootNode);
PathCollection.addItem(rootNode);
rootNode.setExpanded(true);
dummyRoot.getChildren().add(rootNode);
Set<String> singlePath = new HashSet<>();
singlePath.add(path.toString());
updateAttributes(singlePath);
}
|
<DeepExtract>
if (realRoots.containsKey(path.toString())) {
alertAddFolder(path.toString(), path.toString());
return;
}
for (String pathString : realRoots.keySet()) {
Path path = Paths.get(pathString);
if (path.startsWith(path) || path.startsWith(path)) {
alertAddFolder(path.toString(), pathString);
return;
}
}
this.setTop(top);
this.setCenter(fileExplorer);
this.setBottom(bottom);
SourceTreeDirectory rootNode = new SourceTreeDirectory(path, new SourceDirectory(path, isShowFiles()), null);
realRoots.put(path.toString(), rootNode);
PathCollection.addItem(rootNode);
rootNode.setExpanded(true);
dummyRoot.getChildren().add(rootNode);
Set<String> singlePath = new HashSet<>();
singlePath.add(path.toString());
updateAttributes(singlePath);
</DeepExtract>
|
roda-in
|
positive
|
public void triggerAuthenticationDidCompleteWithPayload(JRDictionary rpx_result) {
JRAuthenticatedUser user = new JRAuthenticatedUser(rpx_result, mCurrentlyAuthenticatingProvider.getName(), getWelcomeMessageFromCookieString());
mAuthenticatedUsersByProvider.put(mCurrentlyAuthenticatingProvider.getName(), user);
Archiver.asyncSave(ARCHIVE_AUTH_USERS_BY_PROVIDER, mAuthenticatedUsersByProvider);
String authInfoToken = rpx_result.getAsString("token");
JRDictionary authInfoDict = rpx_result.getAsDictionary("auth_info");
authInfoDict.put("token", authInfoToken);
authInfoDict.put("device_token", user.getDeviceToken());
for (JRSessionDelegate delegate : getDelegatesCopy()) {
delegate.authenticationDidComplete(authInfoDict, mCurrentlyAuthenticatingProvider.getName());
}
if (!TextUtils.isEmpty(mTokenUrl)) {
makeCallToTokenUrl(mTokenUrl, authInfoToken, mCurrentlyAuthenticatingProvider.getName());
}
mCurrentlyAuthenticatingProvider.setForceReauth(false);
mCurrentlyAuthenticatingProvider = null;
}
|
<DeepExtract>
mCurrentlyAuthenticatingProvider = null;
</DeepExtract>
|
engage.android
|
positive
|
public Criteria andSaleEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "sale" + " cannot be null");
}
criteria.add(new Criterion("sale =", value));
return (Criteria) this;
}
|
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "sale" + " cannot be null");
}
criteria.add(new Criterion("sale =", value));
</DeepExtract>
|
Tmall_SSM-master
|
positive
|
@Override
public double toBytes(double d) {
double limit = MAX / C_PIB;
if (d > limit) {
return Double.MAX_VALUE;
}
if (d < -limit) {
return Double.MIN_VALUE;
}
return d * C_PIB;
}
|
<DeepExtract>
double limit = MAX / C_PIB;
if (d > limit) {
return Double.MAX_VALUE;
}
if (d < -limit) {
return Double.MIN_VALUE;
}
return d * C_PIB;
</DeepExtract>
|
hive-io-experimental
|
positive
|
public Filter.Result filter(Logger arg0, Level arg1, Marker arg2, String message, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8) {
try {
if (message == null || message.isEmpty()) {
return Filter.Result.NEUTRAL;
} else if (!Registry.ID_PATTERN.matcher(message).find() && !Registry.MENTION_TAG_CONVERTER.containsTags(message)) {
return Filter.Result.NEUTRAL;
} else {
String processed = ProcessExternalMessage.processWithoutReceiver(message);
LogManager.getRootLogger().log(arg1, processed);
return Filter.Result.DENY;
}
} catch (Throwable e) {
return Filter.Result.NEUTRAL;
}
}
|
<DeepExtract>
try {
if (message == null || message.isEmpty()) {
return Filter.Result.NEUTRAL;
} else if (!Registry.ID_PATTERN.matcher(message).find() && !Registry.MENTION_TAG_CONVERTER.containsTags(message)) {
return Filter.Result.NEUTRAL;
} else {
String processed = ProcessExternalMessage.processWithoutReceiver(message);
LogManager.getRootLogger().log(arg1, processed);
return Filter.Result.DENY;
}
} catch (Throwable e) {
return Filter.Result.NEUTRAL;
}
</DeepExtract>
|
InteractiveChat
|
positive
|
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
Glide.with(MyApplication.applicationContext).load(mList.get(position).getUrl()).crossFade(500).placeholder(R.mipmap.item_bg).diskCacheStrategy(DiskCacheStrategy.SOURCE).into(mImg);
holder.mImg.setOnClickListener(v -> {
if (mListener != null) {
mListener.onClick(holder.mImg, mList.get(position).getUrl(), position);
}
});
}
|
<DeepExtract>
Glide.with(MyApplication.applicationContext).load(mList.get(position).getUrl()).crossFade(500).placeholder(R.mipmap.item_bg).diskCacheStrategy(DiskCacheStrategy.SOURCE).into(mImg);
</DeepExtract>
|
DingDingMap
|
positive
|
public int read(char[] cbuf, int off, int len) throws IOException {
if (internalIn2 != null)
return;
String encoding;
byte[] bom = new byte[BOM_SIZE];
int n, unread;
n = internalIn.read(bom, 0, bom.length);
if ((bom[0] == (byte) 0x00) && (bom[1] == (byte) 0x00) && (bom[2] == (byte) 0xFE) && (bom[3] == (byte) 0xFF)) {
encoding = "UTF-32BE";
unread = n - 4;
} else if ((bom[0] == (byte) 0xFF) && (bom[1] == (byte) 0xFE) && (bom[2] == (byte) 0x00) && (bom[3] == (byte) 0x00)) {
encoding = "UTF-32LE";
unread = n - 4;
} else if ((bom[0] == (byte) 0xEF) && (bom[1] == (byte) 0xBB) && (bom[2] == (byte) 0xBF)) {
encoding = "UTF-8";
unread = n - 3;
} else if ((bom[0] == (byte) 0xFE) && (bom[1] == (byte) 0xFF)) {
encoding = "UTF-16BE";
unread = n - 2;
} else if ((bom[0] == (byte) 0xFF) && (bom[1] == (byte) 0xFE)) {
encoding = "UTF-16LE";
unread = n - 2;
} else {
encoding = defaultEnc;
unread = n;
}
if (unread > 0)
internalIn.unread(bom, (n - unread), unread);
if (encoding == null) {
internalIn2 = new InputStreamReader(internalIn);
} else {
internalIn2 = new InputStreamReader(internalIn, encoding);
}
return internalIn2.read(cbuf, off, len);
}
|
<DeepExtract>
if (internalIn2 != null)
return;
String encoding;
byte[] bom = new byte[BOM_SIZE];
int n, unread;
n = internalIn.read(bom, 0, bom.length);
if ((bom[0] == (byte) 0x00) && (bom[1] == (byte) 0x00) && (bom[2] == (byte) 0xFE) && (bom[3] == (byte) 0xFF)) {
encoding = "UTF-32BE";
unread = n - 4;
} else if ((bom[0] == (byte) 0xFF) && (bom[1] == (byte) 0xFE) && (bom[2] == (byte) 0x00) && (bom[3] == (byte) 0x00)) {
encoding = "UTF-32LE";
unread = n - 4;
} else if ((bom[0] == (byte) 0xEF) && (bom[1] == (byte) 0xBB) && (bom[2] == (byte) 0xBF)) {
encoding = "UTF-8";
unread = n - 3;
} else if ((bom[0] == (byte) 0xFE) && (bom[1] == (byte) 0xFF)) {
encoding = "UTF-16BE";
unread = n - 2;
} else if ((bom[0] == (byte) 0xFF) && (bom[1] == (byte) 0xFE)) {
encoding = "UTF-16LE";
unread = n - 2;
} else {
encoding = defaultEnc;
unread = n;
}
if (unread > 0)
internalIn.unread(bom, (n - unread), unread);
if (encoding == null) {
internalIn2 = new InputStreamReader(internalIn);
} else {
internalIn2 = new InputStreamReader(internalIn, encoding);
}
</DeepExtract>
|
YGORoid
|
positive
|
public static void errPrintln(Object msg) {
System.out.println(msg);
}
|
<DeepExtract>
System.out.println(msg);
</DeepExtract>
|
lmntal-compiler
|
positive
|
private void putEntry(String key, CacheHeader entry) {
if (!mEntries.containsKey(key)) {
mTotalSize += entry.size;
} else {
CacheHeader oldEntry = mEntries.get(key);
mTotalSize += (entry.size - oldEntry.size);
}
pruneIfNeeded(entry.data.length);
File file = getFileForKey(key);
try {
BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(file));
CacheHeader e = new CacheHeader(key, entry);
boolean success = e.writeHeader(fos);
if (!success) {
fos.close();
VolleyLog.d("Failed to write header for %s", file.getAbsolutePath());
throw new IOException();
}
fos.write(entry.data);
fos.close();
putEntry(key, e);
return;
} catch (IOException e) {
}
boolean deleted = file.delete();
if (!deleted) {
VolleyLog.d("Could not clean up file %s", file.getAbsolutePath());
}
}
|
<DeepExtract>
pruneIfNeeded(entry.data.length);
File file = getFileForKey(key);
try {
BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(file));
CacheHeader e = new CacheHeader(key, entry);
boolean success = e.writeHeader(fos);
if (!success) {
fos.close();
VolleyLog.d("Failed to write header for %s", file.getAbsolutePath());
throw new IOException();
}
fos.write(entry.data);
fos.close();
putEntry(key, e);
return;
} catch (IOException e) {
}
boolean deleted = file.delete();
if (!deleted) {
VolleyLog.d("Could not clean up file %s", file.getAbsolutePath());
}
</DeepExtract>
|
BaoDian
|
positive
|
public final void removeLatencies() {
for (Component c : getComponents()) c.setLatency(0);
calculateAccumulatedLatencies(false);
determineClockPeriodAndFrequency();
if (isPerformanceInstructionDependent())
calculateAccumulatedLatencies(true);
determineCriticalPath();
}
|
<DeepExtract>
calculateAccumulatedLatencies(false);
determineClockPeriodAndFrequency();
if (isPerformanceInstructionDependent())
calculateAccumulatedLatencies(true);
determineCriticalPath();
</DeepExtract>
|
drmips
|
positive
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
if (!UiUtils.showQuestionDialog(Bundle.CommentPanel_message_delete_issue())) {
return;
}
isDeleted = true;
firePropertyChange(CommentsPanel.PROP_COMMENT_DELETED, null, null);
}
|
<DeepExtract>
if (!UiUtils.showQuestionDialog(Bundle.CommentPanel_message_delete_issue())) {
return;
}
isDeleted = true;
firePropertyChange(CommentsPanel.PROP_COMMENT_DELETED, null, null);
</DeepExtract>
|
netbeans-github-issues-plugin
|
positive
|
default String resolveDSEVersion() {
return ofNullable(NodeProperties::getDSEVersion.apply(this)).orElseGet(() -> getParent().map(p -> p.resolve(NodeProperties::getDSEVersion, null)).orElse(null));
}
|
<DeepExtract>
return ofNullable(NodeProperties::getDSEVersion.apply(this)).orElseGet(() -> getParent().map(p -> p.resolve(NodeProperties::getDSEVersion, null)).orElse(null));
</DeepExtract>
|
simulacron
|
positive
|
public static Complex sin(Complex z) {
return this.mul(conj(new Complex(0, 2))).div(norm(new Complex(0, 2)));
}
|
<DeepExtract>
return this.mul(conj(new Complex(0, 2))).div(norm(new Complex(0, 2)));
</DeepExtract>
|
fractals
|
positive
|
private static void createMachineWindow() {
tabHandsetName = new CTabFolder(sashFormProject2, SWT.NONE | SWT.BORDER);
tabHandsetName.setTabHeight(20);
tabHandsetName.marginHeight = 5;
tabHandsetName.marginWidth = 5;
tabHandsetName.setMaximizeVisible(true);
tabHandsetName.setMinimizeVisible(true);
tabHandsetName.setSimple(false);
tabHandsetName.setUnselectedCloseVisible(true);
final CTabItem tabItem = new CTabItem(tabHandsetName, SWT.MULTI | SWT.V_SCROLL);
tabItem.setImage(new Image(display, ClassLoader.getSystemResourceAsStream("icons/device.png")));
tabItem.setText("手机设备");
listHandsets = new List(tabHandsetName, SWT.BORDER);
tabItem.setControl(listHandsets);
listHandsets.setFont(new Font(display, "宋体", 10, SWT.NONE));
listHandsets.addListener(SWT.MenuDetect, new Listener() {
public void handleEvent(Event event) {
if (event.detail == 0) {
if (listHandsets.getSelectionIndex() >= 0) {
device = findDevices.getDevices()[listHandsets.getSelectionIndex()];
listHandsets.setMenu(null);
createHandsetRightClickRecord();
listHandsets.setMenu(handsetMenu);
}
}
}
});
tabHandsetName.setSelection(tabItem);
}
|
<DeepExtract>
final CTabItem tabItem = new CTabItem(tabHandsetName, SWT.MULTI | SWT.V_SCROLL);
tabItem.setImage(new Image(display, ClassLoader.getSystemResourceAsStream("icons/device.png")));
tabItem.setText("手机设备");
listHandsets = new List(tabHandsetName, SWT.BORDER);
tabItem.setControl(listHandsets);
listHandsets.setFont(new Font(display, "宋体", 10, SWT.NONE));
listHandsets.addListener(SWT.MenuDetect, new Listener() {
public void handleEvent(Event event) {
if (event.detail == 0) {
if (listHandsets.getSelectionIndex() >= 0) {
device = findDevices.getDevices()[listHandsets.getSelectionIndex()];
listHandsets.setMenu(null);
createHandsetRightClickRecord();
listHandsets.setMenu(handsetMenu);
}
}
}
});
tabHandsetName.setSelection(tabItem);
</DeepExtract>
|
AndroidRobot
|
positive
|
public static ErrorType notAuthorized(String systemMsg, String userMsg) {
return new ErrorType().withCode(ErrorCodeType.AUTH_NOT_AUTHORIZED).withNonFatal(true).withSystemMessage(systemMsg).withUserMessage(userMsg);
}
|
<DeepExtract>
return new ErrorType().withCode(ErrorCodeType.AUTH_NOT_AUTHORIZED).withNonFatal(true).withSystemMessage(systemMsg).withUserMessage(userMsg);
</DeepExtract>
|
BikeMan
|
positive
|
public void insert(T item) {
items.add(item);
int k = items.size() - 1;
while (k > 0) {
int p = (k - 1) / 2;
T item = items.get(k);
T parent = items.get(p);
if (item.compareTo(parent) > 0) {
items.set(k, parent);
items.set(p, item);
k = p;
} else {
break;
}
}
}
|
<DeepExtract>
int k = items.size() - 1;
while (k > 0) {
int p = (k - 1) / 2;
T item = items.get(k);
T parent = items.get(p);
if (item.compareTo(parent) > 0) {
items.set(k, parent);
items.set(p, item);
k = p;
} else {
break;
}
}
</DeepExtract>
|
CS112-Rutgers
|
positive
|
@Override
public void clear() {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID1_ISSET_ID, false);
this.uid1 = 0;
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID2_ISSET_ID, false);
this.uid2 = 0;
}
|
<DeepExtract>
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID1_ISSET_ID, false);
</DeepExtract>
<DeepExtract>
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID2_ISSET_ID, false);
</DeepExtract>
|
thrift-rpc
|
positive
|
@Override
protected Object getCurrentProperty(final String propertyName) {
if (myGone.get()) {
final ManagedObjectNotFound cause = new ManagedObjectNotFound();
cause.setObj(getMOR());
throw new RuntimeException(cause);
}
return super.getCurrentProperty(propertyName);
}
|
<DeepExtract>
if (myGone.get()) {
final ManagedObjectNotFound cause = new ManagedObjectNotFound();
cause.setObj(getMOR());
throw new RuntimeException(cause);
}
</DeepExtract>
|
teamcity-vmware-plugin
|
positive
|
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
intent.setData(uri);
if (activityOrFragment instanceof Activity) {
((Activity) activityOrFragment).startActivityForResult(intent, settingsRequestCode);
} else if (activityOrFragment instanceof Fragment) {
((Fragment) activityOrFragment).startActivityForResult(intent, settingsRequestCode);
} else if (activityOrFragment instanceof android.app.Fragment) {
((android.app.Fragment) activityOrFragment).startActivityForResult(intent, settingsRequestCode);
}
}
|
<DeepExtract>
if (activityOrFragment instanceof Activity) {
((Activity) activityOrFragment).startActivityForResult(intent, settingsRequestCode);
} else if (activityOrFragment instanceof Fragment) {
((Fragment) activityOrFragment).startActivityForResult(intent, settingsRequestCode);
} else if (activityOrFragment instanceof android.app.Fragment) {
((android.app.Fragment) activityOrFragment).startActivityForResult(intent, settingsRequestCode);
}
</DeepExtract>
|
CustomProject
|
positive
|
@Test
public void string_escapes_modified() throws Exception {
InputStream inputTomlStream = getClass().getResourceAsStream("burntsushi/valid/" + "string-escapes-modified" + ".toml");
String inputToml = convertStreamToString(inputTomlStream).replaceAll("\r\n", "\n");
Reader expectedJsonReader = new InputStreamReader(getClass().getResourceAsStream("burntsushi/valid/" + "string-escapes-modified" + ".json"));
JsonElement expectedJson = GSON.fromJson(expectedJsonReader, JsonElement.class);
Toml toml = new Toml().read(inputToml);
JsonElement actual = TEST_GSON.toJsonTree(toml).getAsJsonObject().get("values");
assertEquals(expectedJson, actual);
try {
inputTomlStream.close();
} catch (IOException e) {
}
try {
expectedJsonReader.close();
} catch (IOException e) {
}
}
|
<DeepExtract>
InputStream inputTomlStream = getClass().getResourceAsStream("burntsushi/valid/" + "string-escapes-modified" + ".toml");
String inputToml = convertStreamToString(inputTomlStream).replaceAll("\r\n", "\n");
Reader expectedJsonReader = new InputStreamReader(getClass().getResourceAsStream("burntsushi/valid/" + "string-escapes-modified" + ".json"));
JsonElement expectedJson = GSON.fromJson(expectedJsonReader, JsonElement.class);
Toml toml = new Toml().read(inputToml);
JsonElement actual = TEST_GSON.toJsonTree(toml).getAsJsonObject().get("values");
assertEquals(expectedJson, actual);
try {
inputTomlStream.close();
} catch (IOException e) {
}
try {
expectedJsonReader.close();
} catch (IOException e) {
}
</DeepExtract>
|
toml4j
|
positive
|
public static void main(String[] args) throws InvalidDataException {
return stringUtf8(ByteBuffer.wrap(utf8Bytes("\0")));
return stringAscii(asciiBytes("\0"), 0, asciiBytes("\0").length);
}
|
<DeepExtract>
return stringUtf8(ByteBuffer.wrap(utf8Bytes("\0")));
</DeepExtract>
<DeepExtract>
return stringAscii(asciiBytes("\0"), 0, asciiBytes("\0").length);
</DeepExtract>
|
Not-a-debugger
|
positive
|
public void set(int position, byte value) throws ArrayIndexOutOfBoundsException {
if (position < 0 || position >= length) {
throw new ArrayIndexOutOfBoundsException("Position is " + position + ", array size is " + length);
}
int arrayPos = position / 2;
boolean setOnLeftFourBits = (position % 2) != 0;
byte previous = bytes[arrayPos];
if (setOnLeftFourBits) {
bytes[arrayPos] = (byte) ((previous & 0b0000__1111) | ((value << 4) & 0b1111__0000));
} else {
bytes[arrayPos] = (byte) ((previous & 0b1111__0000) | (value & 0b0000__1111));
}
}
|
<DeepExtract>
int arrayPos = position / 2;
boolean setOnLeftFourBits = (position % 2) != 0;
byte previous = bytes[arrayPos];
if (setOnLeftFourBits) {
bytes[arrayPos] = (byte) ((previous & 0b0000__1111) | ((value << 4) & 0b1111__0000));
} else {
bytes[arrayPos] = (byte) ((previous & 0b1111__0000) | (value & 0b0000__1111));
}
</DeepExtract>
|
Trident
|
positive
|
public Criteria andCUpdateTimeNotIn(List<Date> values) {
if (values == null) {
throw new RuntimeException("Value for " + "cUpdateTime" + " cannot be null");
}
criteria.add(new Criterion("c_update_time not in", values));
return (Criteria) this;
}
|
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "cUpdateTime" + " cannot be null");
}
criteria.add(new Criterion("c_update_time not in", values));
</DeepExtract>
|
webike
|
positive
|
public final void controllerAvailable(final GraphController controller) {
if (graphController != null) {
removeGraphController();
}
graphController = controller;
setEnabled(true);
}
|
<DeepExtract>
setEnabled(true);
</DeepExtract>
|
GrandUI
|
positive
|
protected void rankCandidatePaths(Network network, int volume, List<PartedPath> candidatePaths) {
if (candidatePaths.isEmpty())
throw new NoSpectrumAvailableException("There are no candidate paths to allocate the demand.");
applyMetricsToCandidatePaths(network, volume, candidatePaths);
if (candidatePaths.isEmpty())
throw new NoRegeneratorsAvailableException("There are no candidate paths to allocate the demand.");
Collections.sort(candidatePaths);
}
|
<DeepExtract>
</DeepExtract>
<DeepExtract>
Collections.sort(candidatePaths);
</DeepExtract>
|
ceons
|
positive
|
@Override
public Optional<X> getFromCache(@Nonnull K key) {
Preconditions.checkNotNull(key);
Preconditions.checkNotNull(key);
return controller(key).cache();
}
|
<DeepExtract>
Preconditions.checkNotNull(key);
return controller(key).cache();
</DeepExtract>
|
Payload
|
positive
|
public Criteria andGarbagetipLessThanOrEqualTo(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "garbagetip" + " cannot be null");
}
criteria.add(new Criterion("garbageTip <=", value));
return (Criteria) this;
}
|
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "garbagetip" + " cannot be null");
}
criteria.add(new Criterion("garbageTip <=", value));
</DeepExtract>
|
garbage-collection
|
positive
|
public static void keep_login_info_hook() {
Client.login_screen = SCREEN_USERNAME_PASSWORD_LOGIN;
if (Reflection.setLoginText == null)
return;
try {
if (Client.login_screen == Client.SCREEN_USERNAME_PASSWORD_LOGIN) {
if ("Please enter your username and password" == null || "Please enter your username and password".length() == 0) {
Panel.setControlText(Client.panelLogin, Client.controlLoginTop, "");
Panel.setControlText(Client.panelLogin, Client.controlLoginBottom, "");
} else {
Reflection.setLoginText.invoke(Client.instance, (byte) -49, "", "Please enter your username and password");
}
} else if (Client.login_screen == Client.SCREEN_PASSWORD_RECOVERY) {
Panel.setControlText(Client.panelRecovery, Client.controlRecoveryTop, "");
Panel.setControlText(Client.panelRecovery, Client.controlRecoveryBottom, "Please enter your username and password");
} else if (Client.login_screen == Client.SCREEN_REGISTER_NEW_ACCOUNT) {
Panel.setControlText(Client.panelRegister, Client.controlRegister, "" + " " + "Please enter your username and password");
}
} catch (Exception e) {
}
Panel.setFocus(Client.panelLogin, Client.loginUserInput);
}
|
<DeepExtract>
if (Reflection.setLoginText == null)
return;
try {
if (Client.login_screen == Client.SCREEN_USERNAME_PASSWORD_LOGIN) {
if ("Please enter your username and password" == null || "Please enter your username and password".length() == 0) {
Panel.setControlText(Client.panelLogin, Client.controlLoginTop, "");
Panel.setControlText(Client.panelLogin, Client.controlLoginBottom, "");
} else {
Reflection.setLoginText.invoke(Client.instance, (byte) -49, "", "Please enter your username and password");
}
} else if (Client.login_screen == Client.SCREEN_PASSWORD_RECOVERY) {
Panel.setControlText(Client.panelRecovery, Client.controlRecoveryTop, "");
Panel.setControlText(Client.panelRecovery, Client.controlRecoveryBottom, "Please enter your username and password");
} else if (Client.login_screen == Client.SCREEN_REGISTER_NEW_ACCOUNT) {
Panel.setControlText(Client.panelRegister, Client.controlRegister, "" + " " + "Please enter your username and password");
}
} catch (Exception e) {
}
</DeepExtract>
|
rscplus
|
positive
|
@Override
public StandardUsernameCredentials getCredentials() {
return new BasicSSHUserPrivateKey(CredentialsScope.SYSTEM, CREDENTIAL_ID, user, new BasicSSHUserPrivateKey.DirectEntryPrivateKeySource(privateKey), null, "private key for docker ssh agent");
}
|
<DeepExtract>
return new BasicSSHUserPrivateKey(CredentialsScope.SYSTEM, CREDENTIAL_ID, user, new BasicSSHUserPrivateKey.DirectEntryPrivateKeySource(privateKey), null, "private key for docker ssh agent");
</DeepExtract>
|
docker-plugin
|
positive
|
public Ps setInOut(int index, BigDecimal value) {
set(parameters, index, new SqlInOutParameter(Types.NUMERIC, value));
return this;
}
|
<DeepExtract>
set(parameters, index, new SqlInOutParameter(Types.NUMERIC, value));
return this;
</DeepExtract>
|
rexdb
|
positive
|
@Override
public T clone(T value) {
return factory.copy(value, pop());
}
|
<DeepExtract>
return factory.copy(value, pop());
</DeepExtract>
|
Ents
|
positive
|
public Criteria andMenuHrefLessThan(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "menuHref" + " cannot be null");
}
criteria.add(new Criterion("MENU_HREF <", value));
return (Criteria) this;
}
|
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "menuHref" + " cannot be null");
}
criteria.add(new Criterion("MENU_HREF <", value));
</DeepExtract>
|
console
|
positive
|
private void loadConfigFiles() throws IOException, FileNotValidetedException {
InputStream jarConfigFile = getResource("config.yml");
InputStream jarCommandsFile = getResource("commands.yml");
InputStream jarDropFile = getResource("drop.yml");
YamlFileCreator yamlFileCreator = new YamlFileCreator();
StandardCopyOption fileCopyOption = StandardCopyOption.REPLACE_EXISTING;
String configPath = fullPath + File.separator + "config" + ".yml";
File localConfigFile = new File(configPath);
if (localConfigFile.exists()) {
return;
}
Path configToPath = localConfigFile.toPath();
Files.copy(jarConfigFile, configToPath, fileCopyOption);
String commandsPath = fullPath + File.separator + "commands" + ".yml";
File localConfigFile = new File(commandsPath);
if (localConfigFile.exists()) {
return;
}
Path configToPath = localConfigFile.toPath();
Files.copy(jarCommandsFile, configToPath, fileCopyOption);
String dropPath = fullPath + File.separator + "drop" + ".yml";
File localConfigFile = new File(dropPath);
if (localConfigFile.exists()) {
return;
}
Path configToPath = localConfigFile.toPath();
Files.copy(jarDropFile, configToPath, fileCopyOption);
}
|
<DeepExtract>
File localConfigFile = new File(configPath);
if (localConfigFile.exists()) {
return;
}
Path configToPath = localConfigFile.toPath();
Files.copy(jarConfigFile, configToPath, fileCopyOption);
</DeepExtract>
<DeepExtract>
File localConfigFile = new File(commandsPath);
if (localConfigFile.exists()) {
return;
}
Path configToPath = localConfigFile.toPath();
Files.copy(jarCommandsFile, configToPath, fileCopyOption);
</DeepExtract>
<DeepExtract>
File localConfigFile = new File(dropPath);
if (localConfigFile.exists()) {
return;
}
Path configToPath = localConfigFile.toPath();
Files.copy(jarDropFile, configToPath, fileCopyOption);
</DeepExtract>
|
OpenGuild
|
positive
|
@Override
public void run() {
try {
previewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_START);
previewState = STATE_WAITING_LOCK;
captureSession.capture(previewRequestBuilder.build(), captureCallback, backgroundHandler);
} catch (Exception ignore) {
}
}
|
<DeepExtract>
try {
previewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_START);
previewState = STATE_WAITING_LOCK;
captureSession.capture(previewRequestBuilder.build(), captureCallback, backgroundHandler);
} catch (Exception ignore) {
}
</DeepExtract>
|
CameraFragment
|
positive
|
@Override
public PreparedStatement sql_insertSnapshotEventEntry(Connection conn, String eventIdentifier, String aggregateIdentifier, long sequenceNumber, DateTime timestamp, String eventType, String eventRevision, T eventPayload, T eventMetaData, String aggregateType) throws SQLException {
final String sql = "INSERT INTO " + snapshotEventEntryTable + " (eventIdentifier, type, aggregateIdentifier, sequenceNumber, timeStamp, payloadType, " + "payloadRevision, payload, metaData) VALUES (?,?,?,?,?,?,?,?,?)";
PreparedStatement preparedStatement = conn.prepareStatement(sql);
preparedStatement.setString(1, eventIdentifier);
preparedStatement.setString(2, aggregateType);
preparedStatement.setString(3, aggregateIdentifier);
preparedStatement.setLong(4, sequenceNumber);
preparedStatement.setString(5, sql_dateTime(timestamp));
preparedStatement.setString(6, eventType);
preparedStatement.setString(7, eventRevision);
preparedStatement.setObject(8, eventPayload);
preparedStatement.setObject(9, eventMetaData);
return preparedStatement;
}
|
<DeepExtract>
final String sql = "INSERT INTO " + snapshotEventEntryTable + " (eventIdentifier, type, aggregateIdentifier, sequenceNumber, timeStamp, payloadType, " + "payloadRevision, payload, metaData) VALUES (?,?,?,?,?,?,?,?,?)";
PreparedStatement preparedStatement = conn.prepareStatement(sql);
preparedStatement.setString(1, eventIdentifier);
preparedStatement.setString(2, aggregateType);
preparedStatement.setString(3, aggregateIdentifier);
preparedStatement.setLong(4, sequenceNumber);
preparedStatement.setString(5, sql_dateTime(timestamp));
preparedStatement.setString(6, eventType);
preparedStatement.setString(7, eventRevision);
preparedStatement.setObject(8, eventPayload);
preparedStatement.setObject(9, eventMetaData);
return preparedStatement;
</DeepExtract>
|
evaluation
|
positive
|
@Override
public void inputApkSigningBlock(DataSource apkSigningBlock) {
if (mClosed) {
throw new IllegalStateException("Engine closed");
}
if ((apkSigningBlock == null) || (apkSigningBlock.size() == 0)) {
return;
}
if (mOtherSignersSignaturesPreserved) {
return;
}
}
|
<DeepExtract>
if (mClosed) {
throw new IllegalStateException("Engine closed");
}
</DeepExtract>
|
ApkMultiChannelPlugin
|
positive
|
public Future<Long> append(K key, V value) {
CommandArgs<K, V> args = new CommandArgs<K, V>(codec).addKey(key).addValue(value);
return dispatch(APPEND, new IntegerOutput<K, V>(codec), args);
}
|
<DeepExtract>
CommandArgs<K, V> args = new CommandArgs<K, V>(codec).addKey(key).addValue(value);
return dispatch(APPEND, new IntegerOutput<K, V>(codec), args);
</DeepExtract>
|
lettuce
|
positive
|
@Test
public void acquireReadLocksOnTwoPages() throws Exception {
bp.getPage(tid1, p0, Permissions.READ_ONLY);
grabLock(tid2, p1, Permissions.READ_ONLY, true);
}
|
<DeepExtract>
bp.getPage(tid1, p0, Permissions.READ_ONLY);
grabLock(tid2, p1, Permissions.READ_ONLY, true);
</DeepExtract>
|
simple-db-hw
|
positive
|
@Deprecated
public IndexOptions SetNoStopwords() {
stopwords = new ArrayList<>(0);
return this;
}
|
<DeepExtract>
stopwords = new ArrayList<>(0);
return this;
</DeepExtract>
|
JRediSearch
|
positive
|
@Test
public void onUploadSuccessful_withChallengeResponse_ifLastImageOfChallengeWasUploaded_verifyWillBeCalled() {
this.bwsToken = VERIFICATION_TOKEN_WITH_CHALLENGE;
this.successfulUploads = 3;
presenter.onUploadSuccessful();
assertThat(presenter.verifyCalled, is(true));
}
|
<DeepExtract>
this.bwsToken = VERIFICATION_TOKEN_WITH_CHALLENGE;
</DeepExtract>
<DeepExtract>
this.successfulUploads = 3;
</DeepExtract>
|
BWS-Android
|
positive
|
public void saveFrame(File file) throws IOException {
if (!mEglCore.isCurrent(mEGLSurface)) {
throw new RuntimeException("Expected EGL context/surface is not current");
}
String filename = file.toString();
int width;
if (mWidth < 0) {
width = mEglCore.querySurface(mEGLSurface, EGL14.EGL_WIDTH);
} else {
width = mWidth;
}
int height;
if (mHeight < 0) {
height = mEglCore.querySurface(mEGLSurface, EGL14.EGL_HEIGHT);
} else {
height = mHeight;
}
ByteBuffer buf = ByteBuffer.allocateDirect(width * height * 4);
buf.order(ByteOrder.LITTLE_ENDIAN);
GLES20.glReadPixels(0, 0, width, height, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, buf);
GlUtil.checkGlError("glReadPixels");
buf.rewind();
BufferedOutputStream bos = null;
try {
bos = new BufferedOutputStream(new FileOutputStream(filename));
Bitmap bmp = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
bmp.copyPixelsFromBuffer(buf);
bmp.compress(Bitmap.CompressFormat.PNG, 90, bos);
bmp.recycle();
} finally {
if (bos != null)
bos.close();
}
Log.d(TAG, "Saved " + width + "x" + height + " frame as '" + filename + "'");
}
|
<DeepExtract>
int width;
if (mWidth < 0) {
width = mEglCore.querySurface(mEGLSurface, EGL14.EGL_WIDTH);
} else {
width = mWidth;
}
</DeepExtract>
<DeepExtract>
int height;
if (mHeight < 0) {
height = mEglCore.querySurface(mEGLSurface, EGL14.EGL_HEIGHT);
} else {
height = mHeight;
}
</DeepExtract>
|
android-gpuimage-support
|
positive
|
@Test
public void testFastNavigationToSelectImage() {
clickMenu(MENU_IMAGE);
assertTrue(isMenuEnabled(MENU_INSERT_ATTACHED_IMAGE));
clickMenu(MENU_INSERT_ATTACHED_IMAGE);
waitForDialogToLoad();
getDriver().waitUntilElementIsVisible(By.className(STEP_CURRENT_PAGE_SELECTOR));
getSelenium().click("//*[contains(@class, 'xListItem')]//*[contains(@class, 'xNewImagePreview')]");
getSelenium().doubleClick("//*[contains(@class, 'xListItem')]//*[contains(@class, 'xNewImagePreview')]");
getDriver().waitUntilElementIsVisible(By.className(STEP_UPLOAD));
closeDialog();
clickMenu(MENU_IMAGE);
assertTrue(isMenuEnabled(MENU_INSERT_ATTACHED_IMAGE));
clickMenu(MENU_INSERT_ATTACHED_IMAGE);
waitForDialogToLoad();
getDriver().waitUntilElementIsVisible(By.className(STEP_CURRENT_PAGE_SELECTOR));
getSelenium().click("//div[contains(@class, \"xNewImagePreview\")]");
getSelenium().typeKeys(IMAGES_LIST, "\\13");
getDriver().waitUntilElementIsVisible(By.className(STEP_UPLOAD));
closeDialog();
clickMenu(MENU_IMAGE);
assertTrue(isMenuEnabled(MENU_INSERT_ATTACHED_IMAGE));
clickMenu(MENU_INSERT_ATTACHED_IMAGE);
waitForDialogToLoad();
getDriver().waitUntilElementIsVisible(By.className(STEP_SELECTOR));
String tabSelector = "//div[.='" + TAB_ALL_PAGES + "']";
getSelenium().click(tabSelector);
waitForElement(SPACE_SELECTOR + "/option[. = '" + "XWiki" + "']");
getSelenium().select(SPACE_SELECTOR, "XWiki");
waitForElement(PAGE_SELECTOR + "/option[. = '" + "AdminSheet" + "']");
getSelenium().select(PAGE_SELECTOR, "AdminSheet");
getSelenium().typeKeys(PAGE_SELECTOR, "\t");
getSelenium().click("//div[@class=\"xPageChooser\"]//button[text()=\"Update\"]");
waitForElement("//*[@class = '" + STEP_EXPLORER + "']//*[contains(@class, '" + STEP_CURRENT_PAGE_SELECTOR + "')]");
getSelenium().click(getImageLocator("registration.png"));
getSelenium().doubleClick(getImageLocator("registration.png"));
getDriver().waitUntilElementIsVisible(By.className(STEP_CONFIG));
clickButtonWithText(BUTTON_INSERT_IMAGE);
switchToSource();
setSourceText("[[image:[email protected]]]");
switchToWysiwyg();
moveCaret("document.body", 0);
clickMenu(MENU_IMAGE);
assertTrue(isMenuEnabled(MENU_INSERT_ATTACHED_IMAGE));
clickMenu(MENU_INSERT_ATTACHED_IMAGE);
waitForDialogToLoad();
getDriver().waitUntilElementIsVisible(By.className(STEP_SELECTOR));
String tabSelector = "//div[.='" + TAB_ALL_PAGES + "']";
getSelenium().click(tabSelector);
waitForElement(SPACE_SELECTOR + "/option[. = '" + "XWiki" + "']");
getSelenium().select(SPACE_SELECTOR, "XWiki");
waitForElement(PAGE_SELECTOR + "/option[. = '" + "AdminSheet" + "']");
getSelenium().select(PAGE_SELECTOR, "AdminSheet");
getSelenium().typeKeys(PAGE_SELECTOR, "\t");
getSelenium().click("//div[@class=\"xPageChooser\"]//button[text()=\"Update\"]");
waitForElement("//*[@class = '" + STEP_EXPLORER + "']//*[contains(@class, '" + STEP_CURRENT_PAGE_SELECTOR + "')]");
getSelenium().click("//div[@class = '" + STEP_EXPLORER + "']//div[contains(@class, \"xNewImagePreview\")]");
getSelenium().typeKeys("//div[@class = '" + STEP_EXPLORER + "']" + IMAGES_LIST, "\\13");
getDriver().waitUntilElementIsVisible(By.className(STEP_UPLOAD));
closeDialog();
}
|
<DeepExtract>
clickMenu(MENU_IMAGE);
assertTrue(isMenuEnabled(MENU_INSERT_ATTACHED_IMAGE));
clickMenu(MENU_INSERT_ATTACHED_IMAGE);
waitForDialogToLoad();
</DeepExtract>
<DeepExtract>
getDriver().waitUntilElementIsVisible(By.className(STEP_CURRENT_PAGE_SELECTOR));
</DeepExtract>
<DeepExtract>
getDriver().waitUntilElementIsVisible(By.className(STEP_UPLOAD));
</DeepExtract>
<DeepExtract>
clickMenu(MENU_IMAGE);
assertTrue(isMenuEnabled(MENU_INSERT_ATTACHED_IMAGE));
clickMenu(MENU_INSERT_ATTACHED_IMAGE);
waitForDialogToLoad();
</DeepExtract>
<DeepExtract>
getDriver().waitUntilElementIsVisible(By.className(STEP_CURRENT_PAGE_SELECTOR));
</DeepExtract>
<DeepExtract>
getDriver().waitUntilElementIsVisible(By.className(STEP_UPLOAD));
</DeepExtract>
<DeepExtract>
clickMenu(MENU_IMAGE);
assertTrue(isMenuEnabled(MENU_INSERT_ATTACHED_IMAGE));
clickMenu(MENU_INSERT_ATTACHED_IMAGE);
waitForDialogToLoad();
</DeepExtract>
<DeepExtract>
getDriver().waitUntilElementIsVisible(By.className(STEP_SELECTOR));
</DeepExtract>
<DeepExtract>
String tabSelector = "//div[.='" + TAB_ALL_PAGES + "']";
getSelenium().click(tabSelector);
</DeepExtract>
<DeepExtract>
waitForElement(SPACE_SELECTOR + "/option[. = '" + "XWiki" + "']");
getSelenium().select(SPACE_SELECTOR, "XWiki");
waitForElement(PAGE_SELECTOR + "/option[. = '" + "AdminSheet" + "']");
getSelenium().select(PAGE_SELECTOR, "AdminSheet");
getSelenium().typeKeys(PAGE_SELECTOR, "\t");
getSelenium().click("//div[@class=\"xPageChooser\"]//button[text()=\"Update\"]");
waitForElement("//*[@class = '" + STEP_EXPLORER + "']//*[contains(@class, '" + STEP_CURRENT_PAGE_SELECTOR + "')]");
</DeepExtract>
<DeepExtract>
getDriver().waitUntilElementIsVisible(By.className(STEP_CONFIG));
</DeepExtract>
<DeepExtract>
clickMenu(MENU_IMAGE);
assertTrue(isMenuEnabled(MENU_INSERT_ATTACHED_IMAGE));
clickMenu(MENU_INSERT_ATTACHED_IMAGE);
waitForDialogToLoad();
</DeepExtract>
<DeepExtract>
getDriver().waitUntilElementIsVisible(By.className(STEP_SELECTOR));
</DeepExtract>
<DeepExtract>
String tabSelector = "//div[.='" + TAB_ALL_PAGES + "']";
getSelenium().click(tabSelector);
</DeepExtract>
<DeepExtract>
waitForElement(SPACE_SELECTOR + "/option[. = '" + "XWiki" + "']");
getSelenium().select(SPACE_SELECTOR, "XWiki");
waitForElement(PAGE_SELECTOR + "/option[. = '" + "AdminSheet" + "']");
getSelenium().select(PAGE_SELECTOR, "AdminSheet");
getSelenium().typeKeys(PAGE_SELECTOR, "\t");
getSelenium().click("//div[@class=\"xPageChooser\"]//button[text()=\"Update\"]");
waitForElement("//*[@class = '" + STEP_EXPLORER + "']//*[contains(@class, '" + STEP_CURRENT_PAGE_SELECTOR + "')]");
</DeepExtract>
<DeepExtract>
getDriver().waitUntilElementIsVisible(By.className(STEP_UPLOAD));
</DeepExtract>
|
xwiki-enterprise
|
positive
|
public static String getOutputFilePath(File directory, String extension) throws IOException {
if (!(directory.isDirectory() || directory.mkdirs())) {
throw new IOException("Couldn't create directory '" + directory + "'");
}
return directory;
String filename = UUID.randomUUID().toString();
return directory + File.separator + filename + extension;
}
|
<DeepExtract>
if (!(directory.isDirectory() || directory.mkdirs())) {
throw new IOException("Couldn't create directory '" + directory + "'");
}
return directory;
</DeepExtract>
|
react-native-camera-continued-shooting
|
positive
|
private void handleAudioMessage(final AudioMessageHolder holder, final MessageItem mItem, final View parent) {
holder.time.setText(TimeUtil.getChatTime(mItem.getDate()));
holder.time.setVisibility(View.VISIBLE);
holder.head.setBackgroundResource(PushApplication.heads[mItem.getHeadImg()]);
holder.progressBar.setVisibility(View.GONE);
holder.progressBar.setProgress(50);
holder.time.setVisibility(View.VISIBLE);
holder.msg.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.chatto_voice_playing, 0);
holder.voiceTime.setText(TimeUtil.getVoiceRecorderTime(mItem.getVoiceTime()));
holder.msg.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mItem.getMsgType() == MessageItem.MESSAGE_TYPE_RECORD) {
mSoundUtil.playRecorder(mContext, mItem.getMessage());
}
}
});
}
|
<DeepExtract>
holder.time.setText(TimeUtil.getChatTime(mItem.getDate()));
holder.time.setVisibility(View.VISIBLE);
holder.head.setBackgroundResource(PushApplication.heads[mItem.getHeadImg()]);
holder.progressBar.setVisibility(View.GONE);
holder.progressBar.setProgress(50);
holder.time.setVisibility(View.VISIBLE);
</DeepExtract>
|
zfIMDemo
|
positive
|
@Override
public void refresh(String date, TopBanners banners, List<SectionItem> mainStoryItemListWithHeader) {
tempDate = date;
banner.setOnBannerListener(new OnBannerListener() {
@Override
public void OnBannerClick(int position) {
jumpToStoryContent(banners.getIdList().get(position));
}
});
banner.setBannerStyle(BannerConfig.NUM_INDICATOR_TITLE).setImageLoader(new GlideImageLoader()).setImages(banners.getImages()).setBannerTitles(banners.getTitles()).setBannerAnimation(Transformer.Default).start();
if (tempMainStoryItemWithHeader != null) {
tempMainStoryItemWithHeader.clear();
tempMainStoryItemWithHeader.addAll(mainStoryItemListWithHeader);
mainStoryAdapter.notifyDataSetChanged();
} else {
initMainStoryView(date, mainStoryItemListWithHeader);
}
}
|
<DeepExtract>
banner.setOnBannerListener(new OnBannerListener() {
@Override
public void OnBannerClick(int position) {
jumpToStoryContent(banners.getIdList().get(position));
}
});
banner.setBannerStyle(BannerConfig.NUM_INDICATOR_TITLE).setImageLoader(new GlideImageLoader()).setImages(banners.getImages()).setBannerTitles(banners.getTitles()).setBannerAnimation(Transformer.Default).start();
</DeepExtract>
|
ZhiDaily
|
positive
|
public static WebInspector connectToRealDevice(String udid) throws IOException {
return new WebInspector(BinaryPlistSocket.openToRealDevice(udid));
}
|
<DeepExtract>
return new WebInspector(BinaryPlistSocket.openToRealDevice(udid));
</DeepExtract>
|
ios-device-control
|
positive
|
@Override
public void onClick(DialogInterface dialog, int which) {
if (promptDialog != null)
promptDialog.dismiss();
if (pJsResult != null)
pJsResult.cancel();
}
|
<DeepExtract>
if (promptDialog != null)
promptDialog.dismiss();
</DeepExtract>
<DeepExtract>
if (pJsResult != null)
pJsResult.cancel();
</DeepExtract>
|
AgentWebX5
|
positive
|
public List<UserDetail> findAll() {
String sql = "select * from userDetail";
Object[] params = {};
List<UserDetail> list = new ArrayList<UserDetail>();
ResultSet rs = dbUtil.executeQuery(sql, params);
try {
while (rs.next()) {
UserDetail user = new UserDetail(rs.getInt("id"), rs.getString("userName"), rs.getString("userPwd"), rs.getString("phone"), rs.getInt("status"));
list.add(user);
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
dbUtil.closeAll();
}
return list;
}
|
<DeepExtract>
List<UserDetail> list = new ArrayList<UserDetail>();
ResultSet rs = dbUtil.executeQuery(sql, params);
try {
while (rs.next()) {
UserDetail user = new UserDetail(rs.getInt("id"), rs.getString("userName"), rs.getString("userPwd"), rs.getString("phone"), rs.getInt("status"));
list.add(user);
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
dbUtil.closeAll();
}
return list;
</DeepExtract>
|
cailiao
|
positive
|
private void initBitmap() {
if (indicatorDrawableId != 0) {
this.indicatorDrawableId = indicatorDrawableId;
indicatorBitmap = BitmapFactory.decodeResource(getResources(), indicatorDrawableId);
}
if (thumbDrawableId != 0 && getResources() != null) {
this.thumbDrawableId = thumbDrawableId;
thumbBitmap = Utils.drawableToBitmap(thumbSize, getResources().getDrawable(thumbDrawableId));
}
if (thumbInactivatedDrawableId != 0 && getResources() != null) {
this.thumbInactivatedDrawableId = thumbInactivatedDrawableId;
thumbInactivatedBitmap = Utils.drawableToBitmap(thumbSize, getResources().getDrawable(thumbInactivatedDrawableId));
}
}
|
<DeepExtract>
if (indicatorDrawableId != 0) {
this.indicatorDrawableId = indicatorDrawableId;
indicatorBitmap = BitmapFactory.decodeResource(getResources(), indicatorDrawableId);
}
</DeepExtract>
<DeepExtract>
if (thumbDrawableId != 0 && getResources() != null) {
this.thumbDrawableId = thumbDrawableId;
thumbBitmap = Utils.drawableToBitmap(thumbSize, getResources().getDrawable(thumbDrawableId));
}
</DeepExtract>
<DeepExtract>
if (thumbInactivatedDrawableId != 0 && getResources() != null) {
this.thumbInactivatedDrawableId = thumbInactivatedDrawableId;
thumbInactivatedBitmap = Utils.drawableToBitmap(thumbSize, getResources().getDrawable(thumbInactivatedDrawableId));
}
</DeepExtract>
|
ExpectLauncher
|
positive
|
@Test
public void getCountOfUniqueTest() throws Exception {
PaymentModel testPaymentModel = createTestPaymentModel();
prepareGraphDb(createDefaultOperationProperties(testPaymentModel));
testUniqCardTokensByEmail(testPaymentModel.getEmail(), 3);
testUniqCardTokensByFingerprint(testPaymentModel.getFingerprint(), 3);
testUniqCardTokensByShop(testPaymentModel.getShopId(), 2);
testUniqCardTokensByIp(testPaymentModel.getIp(), 2);
testUniqFingerprintsByEmail(testPaymentModel.getEmail(), 2);
testUniqFingerprintsByIp(testPaymentModel.getIp(), 2);
testUniqFingerprintsByShop(testPaymentModel.getShopId(), 2);
testUniqFingerprintsByCardToken(testPaymentModel.getCardToken(), 2);
testUniqEmailsByFingerprint(testPaymentModel.getFingerprint(), 2);
testUniqEmailsByIp(testPaymentModel.getIp(), 2);
testUniqEmailsByShop(testPaymentModel.getShopId(), 2);
testUniqEmailsByCardToken(testPaymentModel.getCardToken(), 2);
testUniqShopsByParty(testPaymentModel.getPartyId(), 4);
OperationProperties operationPropertiesTwo = createDefaultOperationProperties();
insertPayments(operationPropertiesTwo, 5);
testUniqCardTokensByEmail(testPaymentModel.getEmail(), 3);
testUniqCardTokensByFingerprint(testPaymentModel.getFingerprint(), 3);
testUniqCardTokensByShop(testPaymentModel.getShopId(), 2);
testUniqCardTokensByIp(testPaymentModel.getIp(), 2);
testUniqFingerprintsByEmail(testPaymentModel.getEmail(), 2);
testUniqFingerprintsByIp(testPaymentModel.getIp(), 2);
testUniqFingerprintsByShop(testPaymentModel.getShopId(), 2);
testUniqFingerprintsByCardToken(testPaymentModel.getCardToken(), 2);
testUniqEmailsByFingerprint(testPaymentModel.getFingerprint(), 2);
testUniqEmailsByIp(testPaymentModel.getIp(), 2);
testUniqEmailsByShop(testPaymentModel.getShopId(), 2);
testUniqEmailsByCardToken(testPaymentModel.getCardToken(), 2);
testUniqShopsByParty(testPaymentModel.getPartyId(), 4);
testUniqCardTokensByEmail(operationPropertiesTwo.getEmail(), 2);
testUniqShopsByParty(operationPropertiesTwo.getPartyId(), 2);
}
|
<DeepExtract>
testUniqCardTokensByEmail(testPaymentModel.getEmail(), 3);
testUniqCardTokensByFingerprint(testPaymentModel.getFingerprint(), 3);
testUniqCardTokensByShop(testPaymentModel.getShopId(), 2);
testUniqCardTokensByIp(testPaymentModel.getIp(), 2);
testUniqFingerprintsByEmail(testPaymentModel.getEmail(), 2);
testUniqFingerprintsByIp(testPaymentModel.getIp(), 2);
testUniqFingerprintsByShop(testPaymentModel.getShopId(), 2);
testUniqFingerprintsByCardToken(testPaymentModel.getCardToken(), 2);
testUniqEmailsByFingerprint(testPaymentModel.getFingerprint(), 2);
testUniqEmailsByIp(testPaymentModel.getIp(), 2);
testUniqEmailsByShop(testPaymentModel.getShopId(), 2);
testUniqEmailsByCardToken(testPaymentModel.getCardToken(), 2);
testUniqShopsByParty(testPaymentModel.getPartyId(), 4);
</DeepExtract>
<DeepExtract>
testUniqCardTokensByEmail(testPaymentModel.getEmail(), 3);
testUniqCardTokensByFingerprint(testPaymentModel.getFingerprint(), 3);
testUniqCardTokensByShop(testPaymentModel.getShopId(), 2);
testUniqCardTokensByIp(testPaymentModel.getIp(), 2);
testUniqFingerprintsByEmail(testPaymentModel.getEmail(), 2);
testUniqFingerprintsByIp(testPaymentModel.getIp(), 2);
testUniqFingerprintsByShop(testPaymentModel.getShopId(), 2);
testUniqFingerprintsByCardToken(testPaymentModel.getCardToken(), 2);
testUniqEmailsByFingerprint(testPaymentModel.getFingerprint(), 2);
testUniqEmailsByIp(testPaymentModel.getIp(), 2);
testUniqEmailsByShop(testPaymentModel.getShopId(), 2);
testUniqEmailsByCardToken(testPaymentModel.getCardToken(), 2);
testUniqShopsByParty(testPaymentModel.getPartyId(), 4);
</DeepExtract>
<DeepExtract>
testUniqCardTokensByEmail(operationPropertiesTwo.getEmail(), 2);
testUniqShopsByParty(operationPropertiesTwo.getPartyId(), 2);
</DeepExtract>
|
fraudbusters
|
positive
|
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void releaseCapacity(String ip, int port, double capacity, ArrayList<String> vertexSequence) {
Map map = new HashMap();
map.put("operation", "release");
map.put("capacity", new Double(capacity));
map.put("vertexSequence", vertexSequence);
String json = gson.toJson(map);
System.out.println("Attempting a connection to " + ip + ":" + port + " String = " + json);
String inText = "";
Socket socket = null;
BufferedOutputStream out = null;
try {
socket = new Socket(ip, port);
out = new BufferedOutputStream(socket.getOutputStream());
System.out.println(new String(json.getBytes()));
out.write(json.getBytes());
out.flush();
out.write(new String("\n@\n").getBytes());
out.flush();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String line = "";
while ((line = bufferedReader.readLine()) != null) {
inText = inText + line;
}
System.out.println(inText);
} catch (UnknownHostException e) {
System.err.println("You are trying to connect to an unknown host!");
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (out != null)
out.close();
if (socket != null)
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return inText;
}
|
<DeepExtract>
System.out.println("Attempting a connection to " + ip + ":" + port + " String = " + json);
String inText = "";
Socket socket = null;
BufferedOutputStream out = null;
try {
socket = new Socket(ip, port);
out = new BufferedOutputStream(socket.getOutputStream());
System.out.println(new String(json.getBytes()));
out.write(json.getBytes());
out.flush();
out.write(new String("\n@\n").getBytes());
out.flush();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String line = "";
while ((line = bufferedReader.readLine()) != null) {
inText = inText + line;
}
System.out.println(inText);
} catch (UnknownHostException e) {
System.err.println("You are trying to connect to an unknown host!");
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (out != null)
out.close();
if (socket != null)
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return inText;
</DeepExtract>
|
Path-Computation-Element-Emulator
|
positive
|
public void read(org.apache.thrift.protocol.TProtocol iprot, face_sim_args struct) throws org.apache.thrift.TException {
iprot.readStructBegin();
while (true) {
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch(schemeField.id) {
case 1:
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.img_base64_1 = iprot.readString();
struct.setImg_base64_1IsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2:
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.img_base64_2 = iprot.readString();
struct.setImg_base64_2IsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
}
|
<DeepExtract>
</DeepExtract>
|
aiop-core
|
positive
|
public void putInt(String key, int value) {
mMap.put(key, value);
}
|
<DeepExtract>
mMap.put(key, value);
</DeepExtract>
|
SpiderJackson
|
positive
|
protected void tickHardware(World world) {
if (StrictMath.abs(steer) <= 0.01f) {
steer = 0.0f;
}
facing += steer * STEER_RATE;
float s;
if (StrictMath.abs(motor) <= 0.01f) {
motor = 0.0f;
return;
}
if (motor < 0) {
s = motor * 0.5f * SPEED_MAX;
} else {
s = motor * SPEED_MAX;
}
float tx = x + (float) StrictMath.cos(facing) * s;
float ty = y + (float) StrictMath.sin(facing) * s;
if (world.canRobotGoTo(tx, ty)) {
x = tx;
y = ty;
ramming = true;
} else if (world.canRobotGoTo(tx, y)) {
x = tx;
ramming = true;
} else if (world.canRobotGoTo(x, ty)) {
y = ty;
ramming = true;
} else {
ramming = false;
}
if (lazer <= 0) {
lazerEnd = 0;
return;
}
float cos = (float) StrictMath.cos(getBeamAngle());
float sin = (float) StrictMath.sin(getBeamAngle());
for (int i = 0; i < RAY_STEPS; i++) {
if ((i * RAY_INTERVAL) >= (lazer * LAZER_RANGE)) {
lazerEnd = lazer * LAZER_RANGE;
return;
}
battery -= LAZER_BATTERY_COST;
float tx = x + cos * (i * RAY_INTERVAL);
float ty = y + sin * (i * RAY_INTERVAL);
int tile = world.getTileXY(tx, ty);
int type = tile & 0b111;
int variant = (tile >> 3) & 0b11;
if (type == TILE.WALL) {
lazerEnd = i * RAY_INTERVAL;
return;
}
if (type == TILE.OBSTACLE) {
if (variant >= 2) {
world.setTileXY(tx, ty, TILE.GROUND);
}
lazerEnd = i * RAY_INTERVAL;
return;
}
Robot robot = world.getRobot(tx, ty);
if (robot != null && robot != this) {
robot.damage(LAZER_DAMAGE);
return;
}
}
lazerEnd = RAY_INTERVAL * RAY_STEPS;
}
|
<DeepExtract>
if (StrictMath.abs(steer) <= 0.01f) {
steer = 0.0f;
}
facing += steer * STEER_RATE;
</DeepExtract>
<DeepExtract>
float s;
if (StrictMath.abs(motor) <= 0.01f) {
motor = 0.0f;
return;
}
if (motor < 0) {
s = motor * 0.5f * SPEED_MAX;
} else {
s = motor * SPEED_MAX;
}
float tx = x + (float) StrictMath.cos(facing) * s;
float ty = y + (float) StrictMath.sin(facing) * s;
if (world.canRobotGoTo(tx, ty)) {
x = tx;
y = ty;
ramming = true;
} else if (world.canRobotGoTo(tx, y)) {
x = tx;
ramming = true;
} else if (world.canRobotGoTo(x, ty)) {
y = ty;
ramming = true;
} else {
ramming = false;
}
</DeepExtract>
<DeepExtract>
if (lazer <= 0) {
lazerEnd = 0;
return;
}
float cos = (float) StrictMath.cos(getBeamAngle());
float sin = (float) StrictMath.sin(getBeamAngle());
for (int i = 0; i < RAY_STEPS; i++) {
if ((i * RAY_INTERVAL) >= (lazer * LAZER_RANGE)) {
lazerEnd = lazer * LAZER_RANGE;
return;
}
battery -= LAZER_BATTERY_COST;
float tx = x + cos * (i * RAY_INTERVAL);
float ty = y + sin * (i * RAY_INTERVAL);
int tile = world.getTileXY(tx, ty);
int type = tile & 0b111;
int variant = (tile >> 3) & 0b11;
if (type == TILE.WALL) {
lazerEnd = i * RAY_INTERVAL;
return;
}
if (type == TILE.OBSTACLE) {
if (variant >= 2) {
world.setTileXY(tx, ty, TILE.GROUND);
}
lazerEnd = i * RAY_INTERVAL;
return;
}
Robot robot = world.getRobot(tx, ty);
if (robot != null && robot != this) {
robot.damage(LAZER_DAMAGE);
return;
}
}
lazerEnd = RAY_INTERVAL * RAY_STEPS;
</DeepExtract>
|
runtime
|
positive
|
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
Log.i(TAG, "onKeyUp(int keyCode, KeyEvent event) keyCode = " + keyCode + " event = " + event);
return super.onKeyUp(keyCode, event);
}
|
<DeepExtract>
Log.i(TAG, "onKeyUp(int keyCode, KeyEvent event) keyCode = " + keyCode + " event = " + event);
</DeepExtract>
|
AndroidExercises
|
positive
|
public Criteria andUser_messageNotBetween(String value1, String value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "user_message" + " cannot be null");
}
criteria.add(new Criterion("user_message not between", value1, value2));
return (Criteria) this;
}
|
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "user_message" + " cannot be null");
}
criteria.add(new Criterion("user_message not between", value1, value2));
</DeepExtract>
|
Tmall_SSM-master
|
positive
|
public void onServiceConnected(ComponentName className, IBinder service) {
return WallPaper.this;
if (null != single.env) {
dataService.setDataProviders(single.env.getDataProviders());
}
}
|
<DeepExtract>
return WallPaper.this;
</DeepExtract>
|
moss
|
positive
|
@Override
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
ItemStack itemstack = entitylivingbaseIn.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
if (itemstack.getItem() instanceof ItemArmor) {
ItemArmor itemarmor = (ItemArmor) itemstack.getItem();
if (itemarmor.getEquipmentSlot() == EntityEquipmentSlot.CHEST) {
T model = getModelFromSlot(EntityEquipmentSlot.CHEST);
model = getArmorModelHook(entitylivingbaseIn, itemstack, EntityEquipmentSlot.CHEST, model);
model.setModelAttributes(renderer.getMainModel());
model.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
setModelSlotVisible(model, EntityEquipmentSlot.CHEST);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.CHEST, null));
{
if (itemarmor.hasOverlay(itemstack)) {
int itemColor = itemarmor.getColor(itemstack);
float itemRed = (itemColor >> 16 & 255) / 255.0F;
float itemGreen = (itemColor >> 8 & 255) / 255.0F;
float itemBlue = (itemColor & 255) / 255.0F;
GlStateManager.color(colorR * itemRed, colorG * itemGreen, colorB * itemBlue, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.CHEST, "overlay"));
}
{
GlStateManager.color(colorR, colorG, colorB, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
if (!skipRenderGlint && itemstack.hasEffect()) {
renderEnchantedGlint(renderer, entitylivingbaseIn, model, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale, ClientProxy.getColorForEnchantment(EnchantmentHelper.getEnchantments(itemstack)));
}
}
}
}
ItemStack itemstack = entitylivingbaseIn.getItemStackFromSlot(EntityEquipmentSlot.LEGS);
if (itemstack.getItem() instanceof ItemArmor) {
ItemArmor itemarmor = (ItemArmor) itemstack.getItem();
if (itemarmor.getEquipmentSlot() == EntityEquipmentSlot.LEGS) {
T model = getModelFromSlot(EntityEquipmentSlot.LEGS);
model = getArmorModelHook(entitylivingbaseIn, itemstack, EntityEquipmentSlot.LEGS, model);
model.setModelAttributes(renderer.getMainModel());
model.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
setModelSlotVisible(model, EntityEquipmentSlot.LEGS);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.LEGS, null));
{
if (itemarmor.hasOverlay(itemstack)) {
int itemColor = itemarmor.getColor(itemstack);
float itemRed = (itemColor >> 16 & 255) / 255.0F;
float itemGreen = (itemColor >> 8 & 255) / 255.0F;
float itemBlue = (itemColor & 255) / 255.0F;
GlStateManager.color(colorR * itemRed, colorG * itemGreen, colorB * itemBlue, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.LEGS, "overlay"));
}
{
GlStateManager.color(colorR, colorG, colorB, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
if (!skipRenderGlint && itemstack.hasEffect()) {
renderEnchantedGlint(renderer, entitylivingbaseIn, model, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale, ClientProxy.getColorForEnchantment(EnchantmentHelper.getEnchantments(itemstack)));
}
}
}
}
ItemStack itemstack = entitylivingbaseIn.getItemStackFromSlot(EntityEquipmentSlot.FEET);
if (itemstack.getItem() instanceof ItemArmor) {
ItemArmor itemarmor = (ItemArmor) itemstack.getItem();
if (itemarmor.getEquipmentSlot() == EntityEquipmentSlot.FEET) {
T model = getModelFromSlot(EntityEquipmentSlot.FEET);
model = getArmorModelHook(entitylivingbaseIn, itemstack, EntityEquipmentSlot.FEET, model);
model.setModelAttributes(renderer.getMainModel());
model.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
setModelSlotVisible(model, EntityEquipmentSlot.FEET);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.FEET, null));
{
if (itemarmor.hasOverlay(itemstack)) {
int itemColor = itemarmor.getColor(itemstack);
float itemRed = (itemColor >> 16 & 255) / 255.0F;
float itemGreen = (itemColor >> 8 & 255) / 255.0F;
float itemBlue = (itemColor & 255) / 255.0F;
GlStateManager.color(colorR * itemRed, colorG * itemGreen, colorB * itemBlue, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.FEET, "overlay"));
}
{
GlStateManager.color(colorR, colorG, colorB, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
if (!skipRenderGlint && itemstack.hasEffect()) {
renderEnchantedGlint(renderer, entitylivingbaseIn, model, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale, ClientProxy.getColorForEnchantment(EnchantmentHelper.getEnchantments(itemstack)));
}
}
}
}
ItemStack itemstack = entitylivingbaseIn.getItemStackFromSlot(EntityEquipmentSlot.HEAD);
if (itemstack.getItem() instanceof ItemArmor) {
ItemArmor itemarmor = (ItemArmor) itemstack.getItem();
if (itemarmor.getEquipmentSlot() == EntityEquipmentSlot.HEAD) {
T model = getModelFromSlot(EntityEquipmentSlot.HEAD);
model = getArmorModelHook(entitylivingbaseIn, itemstack, EntityEquipmentSlot.HEAD, model);
model.setModelAttributes(renderer.getMainModel());
model.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
setModelSlotVisible(model, EntityEquipmentSlot.HEAD);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.HEAD, null));
{
if (itemarmor.hasOverlay(itemstack)) {
int itemColor = itemarmor.getColor(itemstack);
float itemRed = (itemColor >> 16 & 255) / 255.0F;
float itemGreen = (itemColor >> 8 & 255) / 255.0F;
float itemBlue = (itemColor & 255) / 255.0F;
GlStateManager.color(colorR * itemRed, colorG * itemGreen, colorB * itemBlue, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.HEAD, "overlay"));
}
{
GlStateManager.color(colorR, colorG, colorB, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
if (!skipRenderGlint && itemstack.hasEffect()) {
renderEnchantedGlint(renderer, entitylivingbaseIn, model, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale, ClientProxy.getColorForEnchantment(EnchantmentHelper.getEnchantments(itemstack)));
}
}
}
}
}
|
<DeepExtract>
ItemStack itemstack = entitylivingbaseIn.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
if (itemstack.getItem() instanceof ItemArmor) {
ItemArmor itemarmor = (ItemArmor) itemstack.getItem();
if (itemarmor.getEquipmentSlot() == EntityEquipmentSlot.CHEST) {
T model = getModelFromSlot(EntityEquipmentSlot.CHEST);
model = getArmorModelHook(entitylivingbaseIn, itemstack, EntityEquipmentSlot.CHEST, model);
model.setModelAttributes(renderer.getMainModel());
model.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
setModelSlotVisible(model, EntityEquipmentSlot.CHEST);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.CHEST, null));
{
if (itemarmor.hasOverlay(itemstack)) {
int itemColor = itemarmor.getColor(itemstack);
float itemRed = (itemColor >> 16 & 255) / 255.0F;
float itemGreen = (itemColor >> 8 & 255) / 255.0F;
float itemBlue = (itemColor & 255) / 255.0F;
GlStateManager.color(colorR * itemRed, colorG * itemGreen, colorB * itemBlue, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.CHEST, "overlay"));
}
{
GlStateManager.color(colorR, colorG, colorB, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
if (!skipRenderGlint && itemstack.hasEffect()) {
renderEnchantedGlint(renderer, entitylivingbaseIn, model, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale, ClientProxy.getColorForEnchantment(EnchantmentHelper.getEnchantments(itemstack)));
}
}
}
}
</DeepExtract>
<DeepExtract>
ItemStack itemstack = entitylivingbaseIn.getItemStackFromSlot(EntityEquipmentSlot.LEGS);
if (itemstack.getItem() instanceof ItemArmor) {
ItemArmor itemarmor = (ItemArmor) itemstack.getItem();
if (itemarmor.getEquipmentSlot() == EntityEquipmentSlot.LEGS) {
T model = getModelFromSlot(EntityEquipmentSlot.LEGS);
model = getArmorModelHook(entitylivingbaseIn, itemstack, EntityEquipmentSlot.LEGS, model);
model.setModelAttributes(renderer.getMainModel());
model.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
setModelSlotVisible(model, EntityEquipmentSlot.LEGS);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.LEGS, null));
{
if (itemarmor.hasOverlay(itemstack)) {
int itemColor = itemarmor.getColor(itemstack);
float itemRed = (itemColor >> 16 & 255) / 255.0F;
float itemGreen = (itemColor >> 8 & 255) / 255.0F;
float itemBlue = (itemColor & 255) / 255.0F;
GlStateManager.color(colorR * itemRed, colorG * itemGreen, colorB * itemBlue, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.LEGS, "overlay"));
}
{
GlStateManager.color(colorR, colorG, colorB, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
if (!skipRenderGlint && itemstack.hasEffect()) {
renderEnchantedGlint(renderer, entitylivingbaseIn, model, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale, ClientProxy.getColorForEnchantment(EnchantmentHelper.getEnchantments(itemstack)));
}
}
}
}
</DeepExtract>
<DeepExtract>
ItemStack itemstack = entitylivingbaseIn.getItemStackFromSlot(EntityEquipmentSlot.FEET);
if (itemstack.getItem() instanceof ItemArmor) {
ItemArmor itemarmor = (ItemArmor) itemstack.getItem();
if (itemarmor.getEquipmentSlot() == EntityEquipmentSlot.FEET) {
T model = getModelFromSlot(EntityEquipmentSlot.FEET);
model = getArmorModelHook(entitylivingbaseIn, itemstack, EntityEquipmentSlot.FEET, model);
model.setModelAttributes(renderer.getMainModel());
model.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
setModelSlotVisible(model, EntityEquipmentSlot.FEET);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.FEET, null));
{
if (itemarmor.hasOverlay(itemstack)) {
int itemColor = itemarmor.getColor(itemstack);
float itemRed = (itemColor >> 16 & 255) / 255.0F;
float itemGreen = (itemColor >> 8 & 255) / 255.0F;
float itemBlue = (itemColor & 255) / 255.0F;
GlStateManager.color(colorR * itemRed, colorG * itemGreen, colorB * itemBlue, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.FEET, "overlay"));
}
{
GlStateManager.color(colorR, colorG, colorB, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
if (!skipRenderGlint && itemstack.hasEffect()) {
renderEnchantedGlint(renderer, entitylivingbaseIn, model, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale, ClientProxy.getColorForEnchantment(EnchantmentHelper.getEnchantments(itemstack)));
}
}
}
}
</DeepExtract>
<DeepExtract>
ItemStack itemstack = entitylivingbaseIn.getItemStackFromSlot(EntityEquipmentSlot.HEAD);
if (itemstack.getItem() instanceof ItemArmor) {
ItemArmor itemarmor = (ItemArmor) itemstack.getItem();
if (itemarmor.getEquipmentSlot() == EntityEquipmentSlot.HEAD) {
T model = getModelFromSlot(EntityEquipmentSlot.HEAD);
model = getArmorModelHook(entitylivingbaseIn, itemstack, EntityEquipmentSlot.HEAD, model);
model.setModelAttributes(renderer.getMainModel());
model.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
setModelSlotVisible(model, EntityEquipmentSlot.HEAD);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.HEAD, null));
{
if (itemarmor.hasOverlay(itemstack)) {
int itemColor = itemarmor.getColor(itemstack);
float itemRed = (itemColor >> 16 & 255) / 255.0F;
float itemGreen = (itemColor >> 8 & 255) / 255.0F;
float itemBlue = (itemColor & 255) / 255.0F;
GlStateManager.color(colorR * itemRed, colorG * itemGreen, colorB * itemBlue, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
renderer.bindTexture(getArmorResource(entitylivingbaseIn, itemstack, EntityEquipmentSlot.HEAD, "overlay"));
}
{
GlStateManager.color(colorR, colorG, colorB, alpha);
model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
if (!skipRenderGlint && itemstack.hasEffect()) {
renderEnchantedGlint(renderer, entitylivingbaseIn, model, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale, ClientProxy.getColorForEnchantment(EnchantmentHelper.getEnchantments(itemstack)));
}
}
}
}
</DeepExtract>
|
ExampleMod-1.12
|
positive
|
private void init() {
mAvatarMaxSize = mContext.getResources().getDimension(R.dimen.image_width);
}
|
<DeepExtract>
mAvatarMaxSize = mContext.getResources().getDimension(R.dimen.image_width);
</DeepExtract>
|
Nimbus
|
positive
|
public static void loadDefaults() {
logger.finer("setting DefaultProperties");
Properties props = new Properties();
props.setProperty(XOPKEYS.DOMAIN, "proxy");
comments.put(XOPKEYS.DOMAIN, "The domain name for this proxy instance.");
props.setProperty(XOPKEYS.PORT, "5222");
comments.put(XOPKEYS.PORT, "The port to run the XMPP server on (for XMPP clients).");
props.setProperty(XOPKEYS.BIND.INTERFACE, "eth0");
comments.put(XOPKEYS.BIND.INTERFACE, "The interface to listen for XMPP clients or 'ANY' for all interfaces");
props.setProperty(XOPKEYS.ENABLE.GATEWAY, "false");
comments.put(XOPKEYS.ENABLE.GATEWAY, "Set to true to enable gatewaying to another XMPP server via dialback protocol, false to disable");
props.setProperty(XOPKEYS.ENABLE.COMPRESSION, "false");
comments.put(XOPKEYS.ENABLE.COMPRESSION, "Enable/disable compressing messages before sending to the Transport system. Default: false (disabled)");
props.setProperty(XOPKEYS.ENABLE.STREAM, "false");
comments.put(XOPKEYS.ENABLE.STREAM, "Set to true to enable bytestreams, false to disable");
props.setProperty(XOPKEYS.ENABLE.ANDROIDLOGGING, "false");
comments.put(XOPKEYS.ENABLE.ANDROIDLOGGING, "Set to true to enable logging in the app text view, false to disable");
props.setProperty(XOPKEYS.ENABLE.DEVICELOGGING, "false");
comments.put(XOPKEYS.ENABLE.DEVICELOGGING, "Set to true to enable text file logging on the android file system, false to disable");
props.setProperty(XOPKEYS.ENABLE.DELAY, "true");
comments.put(XOPKEYS.ENABLE.DELAY, "add delay element to messages according to XEP ");
props.setProperty(XOPKEYS.TLS.AUTH, "false");
comments.put(XOPKEYS.TLS.AUTH, "set to true if clients must connect via tls, false otherwise");
props.setProperty(XOPKEYS.STREAM.PORT, "7625");
comments.put(XOPKEYS.STREAM.PORT, "The port on which clients should connect to open a bytestream");
String xopDomain = props.getProperty(XOPKEYS.DOMAIN);
props.setProperty(XOPKEYS.STREAM.JID, "stream." + xopDomain);
comments.put(XOPKEYS.STREAM.JID, "The JID to identify the bytestream host");
props.setProperty(XOPKEYS.SSL.KEYSTORE, "config/keystore.jks");
comments.put(XOPKEYS.SSL.KEYSTORE, "Where the server keystore is located");
props.setProperty(XOPKEYS.SSL.TRUSTSTORE, "config/cacerts.jks");
comments.put(XOPKEYS.SSL.TRUSTSTORE, "Where the truststore for server-to-server connections is located");
props.setProperty(XOPKEYS.SSL.PASSWORD, "xopstore");
comments.put(XOPKEYS.SSL.PASSWORD, "The password for the keystore and truststore");
props.setProperty(XOPKEYS.SDS.SERVICE, "norm-transport");
comments.put(XOPKEYS.SDS.SERVICE, "choose which Service discovery system to use (for presence), default 'norm-transport'");
props.setProperty(XOPKEYS.SDS.INDI.ADDRESS, "225.0.2.186");
comments.put(XOPKEYS.SDS.INDI.ADDRESS, "The multicast address for INDI to bind to. default 224.0.1.186");
props.setProperty(XOPKEYS.SDS.INDI.PORT, "5353");
comments.put(XOPKEYS.SDS.INDI.PORT, "The multicast port for INDI to bind to. default 5353");
props.setProperty(XOPKEYS.SDS.INDI.TTL, "15000");
comments.put(XOPKEYS.SDS.INDI.TTL, "Lifetime (TTL) of the service in milliseconds (long)");
props.setProperty(XOPKEYS.SDS.INDI.RAI, "10000");
comments.put(XOPKEYS.SDS.INDI.RAI, "Service proactive re-advertisement interval for sending advertisements in milliseconds (long)");
props.setProperty(XOPKEYS.SDS.INDI.NUMRA, "-1");
comments.put(XOPKEYS.SDS.INDI.NUMRA, "Number of times to readvertise the service (int, -1 = forever)");
props.setProperty(XOPKEYS.SDS.INDI.CQI, "0,100,200,400,800,1600");
comments.put(XOPKEYS.SDS.INDI.CQI, "Times a client queries for a service e.g. 0,100,200 (comma separated list of longs)");
props.setProperty(XOPKEYS.SDS.INDI.SCI, "12000");
comments.put(XOPKEYS.SDS.INDI.SCI, "Proactive service cancel notification interval");
props.setProperty(XOPKEYS.SDS.INDI.NUMSCM, "3");
comments.put(XOPKEYS.SDS.INDI.NUMSCM, "Number of times to send proactive service cancellations (int)");
props.setProperty(XOPKEYS.SDS.INDI.ALLOW_LOOPBACK, "false");
comments.put(XOPKEYS.SDS.INDI.ALLOW_LOOPBACK, "sets whether the instances of indi allow loopback or not");
props.setProperty(XOPKEYS.SDS.INDI.ALLOW_DUPLICATES, "false");
comments.put(XOPKEYS.SDS.INDI.ALLOW_DUPLICATES, "sets whether the instances of indi allow duplicate adverts or whether duplicate adverts are suppressed.");
props.setProperty(XOPKEYS.GATEWAY.SERVER, "openfire");
comments.put(XOPKEYS.GATEWAY.SERVER, "The hostname of the external XMPP server to which the gateway should connect.");
props.setProperty(XOPKEYS.GATEWAY.TLSAUTH, "false");
comments.put(XOPKEYS.GATEWAY.TLSAUTH, "true to use TLS with a gatewayed server, false otherwise.");
props.setProperty(XOPKEYS.GATEWAY.BINDINTERFACE, "eth1");
comments.put(XOPKEYS.GATEWAY.BINDINTERFACE, "The bind interface for connecting to the XMPP server.");
props.setProperty(XOPKEYS.GATEWAY.PORT, "5269");
comments.put(XOPKEYS.GATEWAY.PORT, "The port to connect to on the Gatewayed XMPP server.");
props.setProperty(XOPKEYS.GATEWAY.PING, "30000");
comments.put(XOPKEYS.GATEWAY.PING, "The interval at which this server should send ping messages to the connected server");
props.setProperty(XOPKEYS.GATEWAY.REWRITEDOMAIN, "false");
comments.put(XOPKEYS.GATEWAY.REWRITEDOMAIN, "True if messages and presences domains are rewritten from the XOP.DOMAIN to the XOP.GATEWAYDOMAIN");
props.setProperty(XOPKEYS.TRANSPORT.SERVICE, "norm-transport");
comments.put(XOPKEYS.TRANSPORT.SERVICE, "Transport service to use: [transport-engine, groupcomms, norm-transport, simple-transport]");
props.setProperty(XOPKEYS.TRANSPORT.SEND_INTERFACE, "ANY");
comments.put(XOPKEYS.TRANSPORT.SEND_INTERFACE, "Bound interface to SEND transport messages or 'ANY' for all interfaces");
props.setProperty(XOPKEYS.TRANSPORT.RECV_INTERFACE, "ANY");
comments.put(XOPKEYS.TRANSPORT.RECV_INTERFACE, "Bound interface to RECEIVE transport messages or 'ANY' for all interfaces");
props.setProperty(XOPKEYS.TRANSPORT.ADDRESS, "225.0.87.4");
comments.put(XOPKEYS.TRANSPORT.ADDRESS, "default multicast group for transport");
props.setProperty(XOPKEYS.TRANSPORT.PORTRANGE, "10001-10001");
comments.put(XOPKEYS.TRANSPORT.PORTRANGE, "Port range for sending/receiving");
props.setProperty(XOPKEYS.TRANSPORT.NORM.SENDBUFFERSPACE, "65536");
comments.put(XOPKEYS.TRANSPORT.NORM.SENDBUFFERSPACE, "Bufferspace for sender threads. default: 256*256=65536");
props.setProperty(XOPKEYS.TRANSPORT.NORM.RCVBUFFERSPACE, "65536");
comments.put(XOPKEYS.TRANSPORT.NORM.RCVBUFFERSPACE, "Bufferspace for receiver threads. default: 65536");
props.setProperty(XOPKEYS.TRANSPORT.NORM.SEGMENTSIZE, "1400");
comments.put(XOPKEYS.TRANSPORT.NORM.SEGMENTSIZE, "Size of segments in bytes. default: 1400");
props.setProperty(XOPKEYS.TRANSPORT.NORM.BLOCKSIZE, "64");
comments.put(XOPKEYS.TRANSPORT.NORM.BLOCKSIZE, "Size NORM blocks in bytes. default: 64");
props.setProperty(XOPKEYS.TRANSPORT.NORM.NUMPARITY, "15");
comments.put(XOPKEYS.TRANSPORT.NORM.NUMPARITY, "Parity bits. default: 16");
props.setProperty(XOPKEYS.TRANSPORT.NORM.SD.INTERVAL, "4000");
comments.put(XOPKEYS.TRANSPORT.NORM.SD.INTERVAL, "Advertisement message send interval in ms. default: 4000");
props.setProperty(XOPKEYS.TRANSPORT.NORM.SD.TIMEOUT, "3");
comments.put(XOPKEYS.TRANSPORT.NORM.SD.TIMEOUT, "Number of messages missed before triggering lost messages. default: 3");
props.setProperty(XOPKEYS.TRANSPORT.TE.ADDRESS, "127.0.0.1");
comments.put(XOPKEYS.TRANSPORT.TE.ADDRESS, "IP address of transport engine instance");
props.setProperty(XOPKEYS.TRANSPORT.TE.LISTENPORT, "1998");
comments.put(XOPKEYS.TRANSPORT.TE.LISTENPORT, "Port transport engine instance is listening on.");
props.setProperty(XOPKEYS.TRANSPORT.TE.GROUPRANGE, "225.0.2.187-225.0.2.223");
comments.put(XOPKEYS.TRANSPORT.TE.GROUPRANGE, "The group range for sending/rcving on transport engine.");
props.setProperty(XOPKEYS.TRANSPORT.TE.PORT, "12601");
comments.put(XOPKEYS.TRANSPORT.TE.PORT, "Port simple transport instance is listening on.");
props.setProperty(XOPKEYS.TRANSPORT.TE.PERSISTTIME, "0");
comments.put(XOPKEYS.TRANSPORT.TE.PERSISTTIME, "Time to persist. TE interprets 1 as persist forever, and 0 as do not persist at all.");
props.setProperty(XOPKEYS.TRANSPORT.TE.RELIABLE, "false");
comments.put(XOPKEYS.TRANSPORT.TE.RELIABLE, "Use reliable transport for MUC and OneToOne, default: false");
props.setProperty(XOPKEYS.TRANSPORT.GC.ROOMS.BESTEFFORT, "*");
comments.put(XOPKEYS.TRANSPORT.GC.ROOMS.BESTEFFORT, "Best Effort rooms (*=catchall), default=*");
props.setProperty(XOPKEYS.TRANSPORT.GC.ROOMS.RELIABLE, "");
comments.put(XOPKEYS.TRANSPORT.GC.ROOMS.RELIABLE, "Reliable rooms (*=catchall), default=''");
props.setProperty(XOPKEYS.TRANSPORT.GC.ROOMS.ORDERED, "");
comments.put(XOPKEYS.TRANSPORT.GC.ROOMS.ORDERED, "Ordered (by sender) rooms (*=catchall), default=''");
props.setProperty(XOPKEYS.TRANSPORT.GC.ROOMS.AGREED, "");
comments.put(XOPKEYS.TRANSPORT.GC.ROOMS.AGREED, "Agreed ordered rooms (*=catchall), default=''");
props.setProperty(XOPKEYS.TRANSPORT.GC.ROOMS.SAFE, "");
comments.put(XOPKEYS.TRANSPORT.GC.ROOMS.SAFE, "Safe ordered rooms (*=catchall), default=''");
props.setProperty(XOPKEYS.TRANSPORT.GC.DISCOVERY.GROUP, "0");
comments.put(XOPKEYS.TRANSPORT.GC.DISCOVERY.GROUP, "the group number that GCS will use for discovery messages. The default is 0.");
props.setProperty(XOPKEYS.TRANSPORT.GC.DISCOVERYDELAY, "5000");
comments.put(XOPKEYS.TRANSPORT.GC.DISCOVERYDELAY, "The delay for sweeping and signaling XOP SD service (default: 5000ms)");
props.setProperty(XOPKEYS.TRANSPORT.GC.AGENT.ADDRESS, "127.0.0.1");
comments.put(XOPKEYS.TRANSPORT.GC.AGENT.ADDRESS, "address of GCS instance. The default is 127.0.0.1");
props.setProperty(XOPKEYS.TRANSPORT.GC.AGENT.PORT, "56789");
comments.put(XOPKEYS.TRANSPORT.GC.AGENT.PORT, "GCS instance port (default: 56789)");
logger.finer("setting DefaultProperties COMPLETE!");
return props;
}
|
<DeepExtract>
logger.finer("setting DefaultProperties");
Properties props = new Properties();
props.setProperty(XOPKEYS.DOMAIN, "proxy");
comments.put(XOPKEYS.DOMAIN, "The domain name for this proxy instance.");
props.setProperty(XOPKEYS.PORT, "5222");
comments.put(XOPKEYS.PORT, "The port to run the XMPP server on (for XMPP clients).");
props.setProperty(XOPKEYS.BIND.INTERFACE, "eth0");
comments.put(XOPKEYS.BIND.INTERFACE, "The interface to listen for XMPP clients or 'ANY' for all interfaces");
props.setProperty(XOPKEYS.ENABLE.GATEWAY, "false");
comments.put(XOPKEYS.ENABLE.GATEWAY, "Set to true to enable gatewaying to another XMPP server via dialback protocol, false to disable");
props.setProperty(XOPKEYS.ENABLE.COMPRESSION, "false");
comments.put(XOPKEYS.ENABLE.COMPRESSION, "Enable/disable compressing messages before sending to the Transport system. Default: false (disabled)");
props.setProperty(XOPKEYS.ENABLE.STREAM, "false");
comments.put(XOPKEYS.ENABLE.STREAM, "Set to true to enable bytestreams, false to disable");
props.setProperty(XOPKEYS.ENABLE.ANDROIDLOGGING, "false");
comments.put(XOPKEYS.ENABLE.ANDROIDLOGGING, "Set to true to enable logging in the app text view, false to disable");
props.setProperty(XOPKEYS.ENABLE.DEVICELOGGING, "false");
comments.put(XOPKEYS.ENABLE.DEVICELOGGING, "Set to true to enable text file logging on the android file system, false to disable");
props.setProperty(XOPKEYS.ENABLE.DELAY, "true");
comments.put(XOPKEYS.ENABLE.DELAY, "add delay element to messages according to XEP ");
props.setProperty(XOPKEYS.TLS.AUTH, "false");
comments.put(XOPKEYS.TLS.AUTH, "set to true if clients must connect via tls, false otherwise");
props.setProperty(XOPKEYS.STREAM.PORT, "7625");
comments.put(XOPKEYS.STREAM.PORT, "The port on which clients should connect to open a bytestream");
String xopDomain = props.getProperty(XOPKEYS.DOMAIN);
props.setProperty(XOPKEYS.STREAM.JID, "stream." + xopDomain);
comments.put(XOPKEYS.STREAM.JID, "The JID to identify the bytestream host");
props.setProperty(XOPKEYS.SSL.KEYSTORE, "config/keystore.jks");
comments.put(XOPKEYS.SSL.KEYSTORE, "Where the server keystore is located");
props.setProperty(XOPKEYS.SSL.TRUSTSTORE, "config/cacerts.jks");
comments.put(XOPKEYS.SSL.TRUSTSTORE, "Where the truststore for server-to-server connections is located");
props.setProperty(XOPKEYS.SSL.PASSWORD, "xopstore");
comments.put(XOPKEYS.SSL.PASSWORD, "The password for the keystore and truststore");
props.setProperty(XOPKEYS.SDS.SERVICE, "norm-transport");
comments.put(XOPKEYS.SDS.SERVICE, "choose which Service discovery system to use (for presence), default 'norm-transport'");
props.setProperty(XOPKEYS.SDS.INDI.ADDRESS, "225.0.2.186");
comments.put(XOPKEYS.SDS.INDI.ADDRESS, "The multicast address for INDI to bind to. default 224.0.1.186");
props.setProperty(XOPKEYS.SDS.INDI.PORT, "5353");
comments.put(XOPKEYS.SDS.INDI.PORT, "The multicast port for INDI to bind to. default 5353");
props.setProperty(XOPKEYS.SDS.INDI.TTL, "15000");
comments.put(XOPKEYS.SDS.INDI.TTL, "Lifetime (TTL) of the service in milliseconds (long)");
props.setProperty(XOPKEYS.SDS.INDI.RAI, "10000");
comments.put(XOPKEYS.SDS.INDI.RAI, "Service proactive re-advertisement interval for sending advertisements in milliseconds (long)");
props.setProperty(XOPKEYS.SDS.INDI.NUMRA, "-1");
comments.put(XOPKEYS.SDS.INDI.NUMRA, "Number of times to readvertise the service (int, -1 = forever)");
props.setProperty(XOPKEYS.SDS.INDI.CQI, "0,100,200,400,800,1600");
comments.put(XOPKEYS.SDS.INDI.CQI, "Times a client queries for a service e.g. 0,100,200 (comma separated list of longs)");
props.setProperty(XOPKEYS.SDS.INDI.SCI, "12000");
comments.put(XOPKEYS.SDS.INDI.SCI, "Proactive service cancel notification interval");
props.setProperty(XOPKEYS.SDS.INDI.NUMSCM, "3");
comments.put(XOPKEYS.SDS.INDI.NUMSCM, "Number of times to send proactive service cancellations (int)");
props.setProperty(XOPKEYS.SDS.INDI.ALLOW_LOOPBACK, "false");
comments.put(XOPKEYS.SDS.INDI.ALLOW_LOOPBACK, "sets whether the instances of indi allow loopback or not");
props.setProperty(XOPKEYS.SDS.INDI.ALLOW_DUPLICATES, "false");
comments.put(XOPKEYS.SDS.INDI.ALLOW_DUPLICATES, "sets whether the instances of indi allow duplicate adverts or whether duplicate adverts are suppressed.");
props.setProperty(XOPKEYS.GATEWAY.SERVER, "openfire");
comments.put(XOPKEYS.GATEWAY.SERVER, "The hostname of the external XMPP server to which the gateway should connect.");
props.setProperty(XOPKEYS.GATEWAY.TLSAUTH, "false");
comments.put(XOPKEYS.GATEWAY.TLSAUTH, "true to use TLS with a gatewayed server, false otherwise.");
props.setProperty(XOPKEYS.GATEWAY.BINDINTERFACE, "eth1");
comments.put(XOPKEYS.GATEWAY.BINDINTERFACE, "The bind interface for connecting to the XMPP server.");
props.setProperty(XOPKEYS.GATEWAY.PORT, "5269");
comments.put(XOPKEYS.GATEWAY.PORT, "The port to connect to on the Gatewayed XMPP server.");
props.setProperty(XOPKEYS.GATEWAY.PING, "30000");
comments.put(XOPKEYS.GATEWAY.PING, "The interval at which this server should send ping messages to the connected server");
props.setProperty(XOPKEYS.GATEWAY.REWRITEDOMAIN, "false");
comments.put(XOPKEYS.GATEWAY.REWRITEDOMAIN, "True if messages and presences domains are rewritten from the XOP.DOMAIN to the XOP.GATEWAYDOMAIN");
props.setProperty(XOPKEYS.TRANSPORT.SERVICE, "norm-transport");
comments.put(XOPKEYS.TRANSPORT.SERVICE, "Transport service to use: [transport-engine, groupcomms, norm-transport, simple-transport]");
props.setProperty(XOPKEYS.TRANSPORT.SEND_INTERFACE, "ANY");
comments.put(XOPKEYS.TRANSPORT.SEND_INTERFACE, "Bound interface to SEND transport messages or 'ANY' for all interfaces");
props.setProperty(XOPKEYS.TRANSPORT.RECV_INTERFACE, "ANY");
comments.put(XOPKEYS.TRANSPORT.RECV_INTERFACE, "Bound interface to RECEIVE transport messages or 'ANY' for all interfaces");
props.setProperty(XOPKEYS.TRANSPORT.ADDRESS, "225.0.87.4");
comments.put(XOPKEYS.TRANSPORT.ADDRESS, "default multicast group for transport");
props.setProperty(XOPKEYS.TRANSPORT.PORTRANGE, "10001-10001");
comments.put(XOPKEYS.TRANSPORT.PORTRANGE, "Port range for sending/receiving");
props.setProperty(XOPKEYS.TRANSPORT.NORM.SENDBUFFERSPACE, "65536");
comments.put(XOPKEYS.TRANSPORT.NORM.SENDBUFFERSPACE, "Bufferspace for sender threads. default: 256*256=65536");
props.setProperty(XOPKEYS.TRANSPORT.NORM.RCVBUFFERSPACE, "65536");
comments.put(XOPKEYS.TRANSPORT.NORM.RCVBUFFERSPACE, "Bufferspace for receiver threads. default: 65536");
props.setProperty(XOPKEYS.TRANSPORT.NORM.SEGMENTSIZE, "1400");
comments.put(XOPKEYS.TRANSPORT.NORM.SEGMENTSIZE, "Size of segments in bytes. default: 1400");
props.setProperty(XOPKEYS.TRANSPORT.NORM.BLOCKSIZE, "64");
comments.put(XOPKEYS.TRANSPORT.NORM.BLOCKSIZE, "Size NORM blocks in bytes. default: 64");
props.setProperty(XOPKEYS.TRANSPORT.NORM.NUMPARITY, "15");
comments.put(XOPKEYS.TRANSPORT.NORM.NUMPARITY, "Parity bits. default: 16");
props.setProperty(XOPKEYS.TRANSPORT.NORM.SD.INTERVAL, "4000");
comments.put(XOPKEYS.TRANSPORT.NORM.SD.INTERVAL, "Advertisement message send interval in ms. default: 4000");
props.setProperty(XOPKEYS.TRANSPORT.NORM.SD.TIMEOUT, "3");
comments.put(XOPKEYS.TRANSPORT.NORM.SD.TIMEOUT, "Number of messages missed before triggering lost messages. default: 3");
props.setProperty(XOPKEYS.TRANSPORT.TE.ADDRESS, "127.0.0.1");
comments.put(XOPKEYS.TRANSPORT.TE.ADDRESS, "IP address of transport engine instance");
props.setProperty(XOPKEYS.TRANSPORT.TE.LISTENPORT, "1998");
comments.put(XOPKEYS.TRANSPORT.TE.LISTENPORT, "Port transport engine instance is listening on.");
props.setProperty(XOPKEYS.TRANSPORT.TE.GROUPRANGE, "225.0.2.187-225.0.2.223");
comments.put(XOPKEYS.TRANSPORT.TE.GROUPRANGE, "The group range for sending/rcving on transport engine.");
props.setProperty(XOPKEYS.TRANSPORT.TE.PORT, "12601");
comments.put(XOPKEYS.TRANSPORT.TE.PORT, "Port simple transport instance is listening on.");
props.setProperty(XOPKEYS.TRANSPORT.TE.PERSISTTIME, "0");
comments.put(XOPKEYS.TRANSPORT.TE.PERSISTTIME, "Time to persist. TE interprets 1 as persist forever, and 0 as do not persist at all.");
props.setProperty(XOPKEYS.TRANSPORT.TE.RELIABLE, "false");
comments.put(XOPKEYS.TRANSPORT.TE.RELIABLE, "Use reliable transport for MUC and OneToOne, default: false");
props.setProperty(XOPKEYS.TRANSPORT.GC.ROOMS.BESTEFFORT, "*");
comments.put(XOPKEYS.TRANSPORT.GC.ROOMS.BESTEFFORT, "Best Effort rooms (*=catchall), default=*");
props.setProperty(XOPKEYS.TRANSPORT.GC.ROOMS.RELIABLE, "");
comments.put(XOPKEYS.TRANSPORT.GC.ROOMS.RELIABLE, "Reliable rooms (*=catchall), default=''");
props.setProperty(XOPKEYS.TRANSPORT.GC.ROOMS.ORDERED, "");
comments.put(XOPKEYS.TRANSPORT.GC.ROOMS.ORDERED, "Ordered (by sender) rooms (*=catchall), default=''");
props.setProperty(XOPKEYS.TRANSPORT.GC.ROOMS.AGREED, "");
comments.put(XOPKEYS.TRANSPORT.GC.ROOMS.AGREED, "Agreed ordered rooms (*=catchall), default=''");
props.setProperty(XOPKEYS.TRANSPORT.GC.ROOMS.SAFE, "");
comments.put(XOPKEYS.TRANSPORT.GC.ROOMS.SAFE, "Safe ordered rooms (*=catchall), default=''");
props.setProperty(XOPKEYS.TRANSPORT.GC.DISCOVERY.GROUP, "0");
comments.put(XOPKEYS.TRANSPORT.GC.DISCOVERY.GROUP, "the group number that GCS will use for discovery messages. The default is 0.");
props.setProperty(XOPKEYS.TRANSPORT.GC.DISCOVERYDELAY, "5000");
comments.put(XOPKEYS.TRANSPORT.GC.DISCOVERYDELAY, "The delay for sweeping and signaling XOP SD service (default: 5000ms)");
props.setProperty(XOPKEYS.TRANSPORT.GC.AGENT.ADDRESS, "127.0.0.1");
comments.put(XOPKEYS.TRANSPORT.GC.AGENT.ADDRESS, "address of GCS instance. The default is 127.0.0.1");
props.setProperty(XOPKEYS.TRANSPORT.GC.AGENT.PORT, "56789");
comments.put(XOPKEYS.TRANSPORT.GC.AGENT.PORT, "GCS instance port (default: 56789)");
logger.finer("setting DefaultProperties COMPLETE!");
return props;
</DeepExtract>
|
xmpp-overlay
|
positive
|
@Override
public void onGetNetworks(NetInfo[] nets) {
Message m = Message.obtain(null, MsgId.GET_NETWORKS);
m.setData(Utils.netArray2Bundle(nets));
if (mClientMessenger != null)
try {
Log.d(TAG, "forward a msg to clientMessenger");
mClientMessenger.send(m);
} catch (RemoteException e) {
Log.e(TAG, "failed to forward msg to local messenger recver: " + e.getMessage());
}
}
|
<DeepExtract>
if (mClientMessenger != null)
try {
Log.d(TAG, "forward a msg to clientMessenger");
mClientMessenger.send(m);
} catch (RemoteException e) {
Log.e(TAG, "failed to forward msg to local messenger recver: " + e.getMessage());
}
</DeepExtract>
|
PeerDeviceNet_Src
|
positive
|
public void refresh() {
for (int i = templatePanels.size() - 1; i >= 0; i--) {
var templatePanel = templatePanels.get(i);
mainPanel.remove(templatePanel);
templatePanels.remove(templatePanel);
}
var loadedCopyTemplates = ConfigLogic.getInstance().getUserOptions().getCopyTemplates();
if (loadedCopyTemplates == null) {
return;
}
loadedCopyTemplates.entrySet().forEach(entry -> {
addTemplatePanel(entry.getKey(), entry.getValue(), getMnemonic(entry.getKey()));
});
UiUtil.repaint(mainPanel);
Controller.getInstance().refreshMessageTablePopupMenu();
}
|
<DeepExtract>
var loadedCopyTemplates = ConfigLogic.getInstance().getUserOptions().getCopyTemplates();
if (loadedCopyTemplates == null) {
return;
}
loadedCopyTemplates.entrySet().forEach(entry -> {
addTemplatePanel(entry.getKey(), entry.getValue(), getMnemonic(entry.getKey()));
});
UiUtil.repaint(mainPanel);
</DeepExtract>
|
integrated-security-testing-environment
|
positive
|
@Override
public <T> int update(T entity, IncludeType includeType) {
if (entity == null)
return -1;
getInterceptorChain().beforePasreEntity(entity, SuidType.UPDATE);
String sql = getObjToSQLRich().toUpdateSQL(entity, includeType);
if (entity == null)
return;
HoneyContext.regEntityClass(entity.getClass());
sql = doAfterCompleteSql(sql);
Logger.logSQL("update SQL: ", sql);
int r = getBeeSql().modify(sql);
doBeforeReturn();
return r;
}
|
<DeepExtract>
getInterceptorChain().beforePasreEntity(entity, SuidType.UPDATE);
</DeepExtract>
<DeepExtract>
if (entity == null)
return;
HoneyContext.regEntityClass(entity.getClass());
</DeepExtract>
|
honey
|
positive
|
public ErrorCode configSetParameter(int param, double value, int subValue, int ordinal, int timeoutMs) {
int retval = PigeonImuJNI.JNI_ConfigSetParameter(m_handle, param, value, subValue, ordinal, timeoutMs);
for (CalibrationMode e : CalibrationMode.values()) {
if (e.value == retval) {
return e;
}
}
return Unknown;
}
|
<DeepExtract>
for (CalibrationMode e : CalibrationMode.values()) {
if (e.value == retval) {
return e;
}
}
return Unknown;
</DeepExtract>
|
Phoenix-api
|
positive
|
public static RoundedBitmapDrawable getRoundedDrawable(Context context, Bitmap bitmap, float cornerRadius) {
RoundedBitmapDrawable roundedBitmapDrawable = RoundedBitmapDrawableFactory.create(context.getResources(), bitmap);
roundedBitmapDrawable.setAntiAlias(true);
mCornerRadius = cornerRadius;
return roundedBitmapDrawable;
}
|
<DeepExtract>
mCornerRadius = cornerRadius;
</DeepExtract>
|
BGAPhotoPicker-Android
|
positive
|
void observe() {
final ContentResolver resolver = mContext.getContentResolver();
resolver.registerContentObserver(Settings.System.getUriFor(SETTING_EXPANDED_DESKTOP_STATE), false, this);
updateSettings(false);
}
|
<DeepExtract>
updateSettings(false);
</DeepExtract>
|
GravityBox
|
positive
|
@Override
public boolean onHitEntity(Entity entityHit, DamageSource source, float ammount) {
source.setExplosion();
if (!this.world.isRemote) {
this.world.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, getExplosionStrength(), canBreakBlocks());
this.setDead();
}
return false;
}
|
<DeepExtract>
if (!this.world.isRemote) {
this.world.createExplosion(this.shootingEntity, this.posX, this.posY, this.posZ, getExplosionStrength(), canBreakBlocks());
this.setDead();
}
</DeepExtract>
|
Battlegear2
|
positive
|
public BufferedImage getBufferedImage() {
if (image == null || abort)
return null;
BufferedImage img = new BufferedImage(getIntrinsicWidth(), getIntrinsicHeight(), BufferedImage.TYPE_INT_RGB);
Graphics2D g = img.createGraphics();
g.drawImage(image, null, null);
if (image != null)
image.flush();
image = null;
return img;
}
|
<DeepExtract>
if (image != null)
image.flush();
image = null;
</DeepExtract>
|
CSSBox
|
positive
|
public static CardConsultationData createSimpleCard(String processSuffix, Instant publication, Instant start, Instant end, String login, String[] groups, String[] entities, String[] userAcks, String[] userReads, String[] entitiesAcks) {
CardConsultationData.CardConsultationDataBuilder cardBuilder = CardConsultationData.builder().process("PROCESS").processInstanceId("PROCESS" + processSuffix).publisher("PUBLISHER").processVersion("0").state("anyState").startDate(start).endDate(end != null ? end : null).severity(SeverityEnum.ALARM).title(I18nConsultationData.builder().key("title").build()).summary(I18nConsultationData.builder().key("summary").build()).usersAcks(userAcks != null ? Arrays.asList(userAcks) : null).usersReads(userReads != null ? Arrays.asList(userReads) : null).entitiesAcks(entitiesAcks != null ? Arrays.asList(entitiesAcks) : null);
if (groups != null && groups.length > 0)
cardBuilder.groupRecipients(Arrays.asList(groups));
if (entities != null && entities.length > 0)
cardBuilder.entityRecipients(Arrays.asList(entities));
if (login != null)
cardBuilder.userRecipient(login);
CardConsultationData card = cardBuilder.build();
card.setUid(UUID.randomUUID().toString());
card.setPublishDate(publication);
card.setId(card.getProcess() + "." + card.getProcessInstanceId());
card.setProcessStateKey(card.getProcess() + "." + card.getState());
return card;
}
|
<DeepExtract>
card.setUid(UUID.randomUUID().toString());
card.setPublishDate(publication);
card.setId(card.getProcess() + "." + card.getProcessInstanceId());
card.setProcessStateKey(card.getProcess() + "." + card.getState());
</DeepExtract>
|
operatorfabric-core
|
positive
|
@Override
public void process(final Throwable exception) throws Exception {
System.out.println("Clear => " + exception);
System.out.println("Get => " + null);
rp.processResponse(null);
}
|
<DeepExtract>
System.out.println("Get => " + null);
rp.processResponse(null);
</DeepExtract>
|
JActor
|
positive
|
protected void initComponents() {
JFrame frame = new JFrame("Demo JFrame");
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
Image iconImage = null;
try {
URL imageURL = FrameDemo.class.getResource("resources/images/swingingduke.gif");
iconImage = ImageIO.read(imageURL);
} catch (Exception e) {
}
frame.setIconImage(iconImage);
frame.setGlassPane(new BusyGlass());
JMenuBar menubar = new JMenuBar();
frame.setJMenuBar(menubar);
JMenu menu = new JMenu("File");
menubar.add(menu);
menu.add("Open");
menu.add("Save");
JToolBar toolbar = new JToolBar();
frame.add(toolbar, BorderLayout.NORTH);
toolbar.add(new JButton("Toolbar Button"));
JLabel label = new JLabel("I'm content but a little blue.");
label.setHorizontalAlignment(JLabel.CENTER);
label.setPreferredSize(new Dimension(300, 160));
label.setBackground(new Color(197, 216, 236));
label.setOpaque(true);
frame.add(label);
JLabel statusLabel = new JLabel("I show status.");
statusLabel.setBorder(new EmptyBorder(4, 4, 4, 4));
statusLabel.setHorizontalAlignment(JLabel.LEADING);
frame.add(statusLabel, BorderLayout.SOUTH);
frame.pack();
return frame;
setLayout(new BorderLayout());
add(createControlPanel(), BorderLayout.WEST);
JPanel framePlaceholder = new JPanel();
Dimension prefSize = frame.getPreferredSize();
prefSize.width += 12;
prefSize.height += 12;
framePlaceholder.setPreferredSize(prefSize);
return framePlaceholder;
add(frameSpaceholder, BorderLayout.CENTER);
}
|
<DeepExtract>
JFrame frame = new JFrame("Demo JFrame");
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
Image iconImage = null;
try {
URL imageURL = FrameDemo.class.getResource("resources/images/swingingduke.gif");
iconImage = ImageIO.read(imageURL);
} catch (Exception e) {
}
frame.setIconImage(iconImage);
frame.setGlassPane(new BusyGlass());
JMenuBar menubar = new JMenuBar();
frame.setJMenuBar(menubar);
JMenu menu = new JMenu("File");
menubar.add(menu);
menu.add("Open");
menu.add("Save");
JToolBar toolbar = new JToolBar();
frame.add(toolbar, BorderLayout.NORTH);
toolbar.add(new JButton("Toolbar Button"));
JLabel label = new JLabel("I'm content but a little blue.");
label.setHorizontalAlignment(JLabel.CENTER);
label.setPreferredSize(new Dimension(300, 160));
label.setBackground(new Color(197, 216, 236));
label.setOpaque(true);
frame.add(label);
JLabel statusLabel = new JLabel("I show status.");
statusLabel.setBorder(new EmptyBorder(4, 4, 4, 4));
statusLabel.setHorizontalAlignment(JLabel.LEADING);
frame.add(statusLabel, BorderLayout.SOUTH);
frame.pack();
return frame;
</DeepExtract>
<DeepExtract>
JPanel framePlaceholder = new JPanel();
Dimension prefSize = frame.getPreferredSize();
prefSize.width += 12;
prefSize.height += 12;
framePlaceholder.setPreferredSize(prefSize);
return framePlaceholder;
</DeepExtract>
|
swingset3
|
positive
|
@Override
public Object arrayOfField(int size) {
return acquireByteBuffer(null, sizeOf0(size)).asCharBuffer();
}
|
<DeepExtract>
return acquireByteBuffer(null, sizeOf0(size)).asCharBuffer();
</DeepExtract>
|
Collections
|
positive
|
public static AdditionalServiceType createTimestampService() {
final AdditionalServiceType s = MssClient.mssObjFactory.createAdditionalServiceType();
final MssURIType d = MssClient.mssObjFactory.createMssURIType();
d.setMssURI(URI_TIMESTAMP);
s.setDescription(d);
return s;
}
|
<DeepExtract>
final AdditionalServiceType s = MssClient.mssObjFactory.createAdditionalServiceType();
final MssURIType d = MssClient.mssObjFactory.createMssURIType();
d.setMssURI(URI_TIMESTAMP);
s.setDescription(d);
return s;
</DeepExtract>
|
laverca
|
positive
|
void setAttribute(String elName, String name, int type, String enumeration, String value, int valueType) throws java.lang.Exception {
Object[] element = (Object[]) elementInfo.get(elName);
if (element == null) {
attlist = null;
}
return (Hashtable) element[2];
if (attlist == null) {
attlist = new Hashtable();
}
if (attlist.get(name) != null) {
return;
} else {
attribute = new Object[5];
attribute[0] = new Integer(type);
attribute[1] = value;
attribute[2] = new Integer(valueType);
attribute[3] = enumeration;
attribute[4] = null;
attlist.put(name.intern(), attribute);
setElement(elName, CONTENT_UNDECLARED, null, attlist);
}
}
|
<DeepExtract>
Object[] element = (Object[]) elementInfo.get(elName);
if (element == null) {
attlist = null;
}
return (Hashtable) element[2];
</DeepExtract>
|
AnalyseSI
|
positive
|
public String getFlowControlOutString() {
switch(m_FlowControlOut) {
case SerialPort.FLOWCONTROL_NONE:
return "none";
case SerialPort.FLOWCONTROL_XONXOFF_OUT:
return "xon/xoff out";
case SerialPort.FLOWCONTROL_XONXOFF_IN:
return "xon/xoff in";
case SerialPort.FLOWCONTROL_RTSCTS_IN:
return "rts/cts in";
case SerialPort.FLOWCONTROL_RTSCTS_OUT:
return "rts/cts out";
default:
return "none";
}
}
|
<DeepExtract>
switch(m_FlowControlOut) {
case SerialPort.FLOWCONTROL_NONE:
return "none";
case SerialPort.FLOWCONTROL_XONXOFF_OUT:
return "xon/xoff out";
case SerialPort.FLOWCONTROL_XONXOFF_IN:
return "xon/xoff in";
case SerialPort.FLOWCONTROL_RTSCTS_IN:
return "rts/cts in";
case SerialPort.FLOWCONTROL_RTSCTS_OUT:
return "rts/cts out";
default:
return "none";
}
</DeepExtract>
|
jamod
|
positive
|
@Override
public SearchResultJson search(ISearchService.Options options) {
var json = new SearchResultJson();
var size = options.requestedSize;
if (size <= 0 || !search.isEnabled()) {
json.extensions = Collections.emptyList();
return json;
}
var searchHits = search.search(options);
var serverUrl = UrlUtil.getBaseUrl();
var extensions = searchHits.stream().map(this::getExtension).filter(Objects::nonNull).collect(Collectors.toList());
var latestVersions = extensions.stream().map(e -> {
var latest = versions.getLatestTrxn(e, null, false, true);
json.extensions = new AbstractMap.SimpleEntry<>(e.getId(), latest);
}).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
var searchEntries = latestVersions.entrySet().stream().map(e -> {
var entry = e.getValue().toSearchEntryJson();
entry.url = createApiUrl(serverUrl, "api", entry.namespace, entry.name);
json.extensions = new AbstractMap.SimpleEntry<>(e.getKey(), entry);
}).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
var fileUrls = storageUtil.getFileUrls(latestVersions.values(), serverUrl, withFileTypes(DOWNLOAD, ICON));
searchEntries.forEach((extensionId, searchEntry) -> {
var extVersion = latestVersions.get(extensionId);
searchEntry.files = fileUrls.get(extVersion.getId());
if (searchEntry.files.containsKey(DOWNLOAD_SIG)) {
searchEntry.files.put(PUBLIC_KEY, UrlUtil.getPublicKeyUrl(extVersion));
}
});
if (options.includeAllVersions) {
var allActiveVersions = repositories.findActiveVersions(extensions).stream().sorted(ExtensionVersion.SORT_COMPARATOR).collect(Collectors.toList());
var activeVersionsByExtensionId = allActiveVersions.stream().collect(Collectors.groupingBy(ev -> ev.getExtension().getId()));
var versionUrls = storageUtil.getFileUrls(allActiveVersions, serverUrl, DOWNLOAD);
for (var extension : extensions) {
var activeVersions = activeVersionsByExtensionId.get(extension.getId());
var searchEntry = searchEntries.get(extension.getId());
searchEntry.allVersions = getAllVersionReferences(activeVersions, versionUrls, serverUrl);
}
}
return extensions.stream().map(Extension::getId).map(searchEntries::get).collect(Collectors.toList());
json.offset = options.requestedOffset;
json.totalSize = (int) searchHits.getTotalHits();
return json;
}
|
<DeepExtract>
var serverUrl = UrlUtil.getBaseUrl();
var extensions = searchHits.stream().map(this::getExtension).filter(Objects::nonNull).collect(Collectors.toList());
var latestVersions = extensions.stream().map(e -> {
var latest = versions.getLatestTrxn(e, null, false, true);
json.extensions = new AbstractMap.SimpleEntry<>(e.getId(), latest);
}).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
var searchEntries = latestVersions.entrySet().stream().map(e -> {
var entry = e.getValue().toSearchEntryJson();
entry.url = createApiUrl(serverUrl, "api", entry.namespace, entry.name);
json.extensions = new AbstractMap.SimpleEntry<>(e.getKey(), entry);
}).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
var fileUrls = storageUtil.getFileUrls(latestVersions.values(), serverUrl, withFileTypes(DOWNLOAD, ICON));
searchEntries.forEach((extensionId, searchEntry) -> {
var extVersion = latestVersions.get(extensionId);
searchEntry.files = fileUrls.get(extVersion.getId());
if (searchEntry.files.containsKey(DOWNLOAD_SIG)) {
searchEntry.files.put(PUBLIC_KEY, UrlUtil.getPublicKeyUrl(extVersion));
}
});
if (options.includeAllVersions) {
var allActiveVersions = repositories.findActiveVersions(extensions).stream().sorted(ExtensionVersion.SORT_COMPARATOR).collect(Collectors.toList());
var activeVersionsByExtensionId = allActiveVersions.stream().collect(Collectors.groupingBy(ev -> ev.getExtension().getId()));
var versionUrls = storageUtil.getFileUrls(allActiveVersions, serverUrl, DOWNLOAD);
for (var extension : extensions) {
var activeVersions = activeVersionsByExtensionId.get(extension.getId());
var searchEntry = searchEntries.get(extension.getId());
searchEntry.allVersions = getAllVersionReferences(activeVersions, versionUrls, serverUrl);
}
}
return extensions.stream().map(Extension::getId).map(searchEntries::get).collect(Collectors.toList());
</DeepExtract>
|
openvsx
|
positive
|
public void setSelectorDrawable(int res) {
mViewBehind.setSelectorBitmap(BitmapFactory.decodeResource(getResources(), res));
}
|
<DeepExtract>
mViewBehind.setSelectorBitmap(BitmapFactory.decodeResource(getResources(), res));
</DeepExtract>
|
WLANAudit-Android
|
positive
|
public static ShowcaseView insertShowcaseView(float x, float y, Activity activity, String title, String detailText, ConfigOptions options) {
ShowcaseView sv = new ShowcaseView(activity);
if (options != null)
sv.setConfigOptions(options);
if (sv.getConfigOptions().insert == INSERT_TO_DECOR) {
((ViewGroup) activity.getWindow().getDecorView()).addView(sv);
} else {
((ViewGroup) activity.findViewById(android.R.id.content)).addView(sv);
}
if (isRedundant) {
return;
}
showcaseX = x;
showcaseY = y;
init();
invalidate();
String titleText = getContext().getResources().getString(title);
String subText = getContext().getResources().getString(detailText);
setText(titleText, subText);
return sv;
}
|
<DeepExtract>
if (isRedundant) {
return;
}
showcaseX = x;
showcaseY = y;
init();
invalidate();
</DeepExtract>
<DeepExtract>
String titleText = getContext().getResources().getString(title);
String subText = getContext().getResources().getString(detailText);
setText(titleText, subText);
</DeepExtract>
|
android_packages_apps_Focal
|
positive
|
public void addColor(Color addition) {
for (ColorSwatch swatch : swatches) {
swatch.setSelected(false);
}
dashTimer.stop();
repaint();
ColorSwatch swatch = new ColorSwatch(addition, dashTimer, ml);
this.swatches.add(swatch);
return swatches == null ? 0 : swatches.size();
add(swatch, gbc);
}
|
<DeepExtract>
for (ColorSwatch swatch : swatches) {
swatch.setSelected(false);
}
dashTimer.stop();
repaint();
</DeepExtract>
<DeepExtract>
return swatches == null ? 0 : swatches.size();
</DeepExtract>
|
ChatGameFontificator
|
positive
|
@Override
public void onQueryExecuted(List<DerpibooruTagDetailed> hiddenTags) {
super.executeQuery(new CommentListParser(spoileredTags, hiddenTags));
}
|
<DeepExtract>
super.executeQuery(new CommentListParser(spoileredTags, hiddenTags));
</DeepExtract>
|
Derpibooru
|
positive
|
public static String encryptSHA224ToString(byte[] data) {
if (encryptSHA224(data) == null)
return null;
int len = encryptSHA224(data).length;
if (len <= 0)
return null;
char[] ret = new char[len << 1];
for (int i = 0, j = 0; i < len; i++) {
ret[j++] = hexDigits[encryptSHA224(data)[i] >>> 4 & 0x0f];
ret[j++] = hexDigits[encryptSHA224(data)[i] & 0x0f];
}
return new String(ret);
}
|
<DeepExtract>
if (encryptSHA224(data) == null)
return null;
int len = encryptSHA224(data).length;
if (len <= 0)
return null;
char[] ret = new char[len << 1];
for (int i = 0, j = 0; i < len; i++) {
ret[j++] = hexDigits[encryptSHA224(data)[i] >>> 4 & 0x0f];
ret[j++] = hexDigits[encryptSHA224(data)[i] & 0x0f];
}
return new String(ret);
</DeepExtract>
|
HBase
|
positive
|
public void manipulatePdf(String dest) throws IOException, SQLException {
PageSize postCard = new PageSize(283, 416);
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(SOURCE));
Document doc = new Document(pdfDoc, postCard);
doc.setMargins(30, 30, 30, 30);
PdfPage page = pdfDoc.addNewPage();
PdfCanvas under = new PdfCanvas(page.newContentStreamBefore(), page.getResources(), pdfDoc);
drawRectangle(under, postCard.getWidth(), postCard.getHeight());
under.setFillColor(new DeviceRgb(0xFF, 0xD7, 0x00));
under.rectangle(5, 5, postCard.getWidth() - 10, postCard.getHeight() - 10);
under.fill();
doc.add(new AreaBreak());
page = pdfDoc.getLastPage();
under = new PdfCanvas(page.newContentStreamBefore(), page.getResources(), pdfDoc);
drawRectangle(under, postCard.getWidth(), postCard.getHeight());
Image img = new Image(ImageDataFactory.create(RESOURCE));
img.setFixedPosition((postCard.getWidth() - img.getImageScaledWidth()) / 2, (postCard.getHeight() - img.getImageScaledHeight()) / 2);
doc.add(img);
doc.add(new AreaBreak());
page = pdfDoc.getLastPage();
under = new PdfCanvas(page.newContentStreamBefore(), page.getResources(), pdfDoc);
drawRectangle(under, postCard.getWidth(), postCard.getHeight());
Paragraph p = new Paragraph("Foobar Film Festival").setFont(PdfFontFactory.createFont(StandardFonts.HELVETICA)).setFontSize(22).setHorizontalAlignment(HorizontalAlignment.CENTER);
doc.add(p);
doc.add(new AreaBreak());
page = pdfDoc.getLastPage();
under = new PdfCanvas(page.newContentStreamBefore(), page.getResources(), pdfDoc);
drawRectangle(under, postCard.getWidth(), postCard.getHeight());
page = pdfDoc.getLastPage();
PdfCanvas over = new PdfCanvas(page.newContentStreamAfter(), page.getResources(), pdfDoc);
over.saveState();
float sinus = (float) Math.sin(Math.PI / 60);
float cosinus = (float) Math.cos(Math.PI / 60);
over.beginText();
over.setTextRenderingMode(PdfCanvasConstants.TextRenderingMode.FILL_STROKE);
over.setLineWidth(1.5f);
over.setStrokeColor(new DeviceRgb(0xFF, 0x00, 0x00));
over.setFillColor(new DeviceRgb(0xFF, 0xFF, 0xFF));
over.setFontAndSize(PdfFontFactory.createFont(StandardFonts.HELVETICA), 36);
over.setTextMatrix(cosinus, sinus, -sinus, cosinus, 50, 324);
over.showText("SOLD OUT");
over.setTextMatrix(0, 0);
over.endText();
over.restoreState();
doc.close();
PdfDocument srcDoc = new PdfDocument(new PdfReader(SOURCE));
PdfDocument resultDoc = new PdfDocument(new PdfWriter(dest));
Document doc = new Document(resultDoc, new PageSize(PageSize.A5).rotate());
PdfFont font = PdfFontFactory.createFont(StandardFonts.ZAPFDINGBATS);
PdfCanvas canvas = new PdfCanvas(resultDoc.addNewPage());
for (int i = 1; i <= srcDoc.getNumberOfPages(); i++) {
PdfFormXObject layer = srcDoc.getPage(i).copyAsFormXObject(resultDoc);
canvas.addXObjectWithTransformationMatrix(layer, 1f, 0, 0.4f, 0.4f, 72, 50 * i);
canvas.beginText();
canvas.setFontAndSize(font, 20);
canvas.moveText(496, 150 + 50 * i);
canvas.showText(String.valueOf((char) (181 + i)));
canvas.endText();
canvas.stroke();
}
doc.close();
srcDoc.close();
}
|
<DeepExtract>
PageSize postCard = new PageSize(283, 416);
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(SOURCE));
Document doc = new Document(pdfDoc, postCard);
doc.setMargins(30, 30, 30, 30);
PdfPage page = pdfDoc.addNewPage();
PdfCanvas under = new PdfCanvas(page.newContentStreamBefore(), page.getResources(), pdfDoc);
drawRectangle(under, postCard.getWidth(), postCard.getHeight());
under.setFillColor(new DeviceRgb(0xFF, 0xD7, 0x00));
under.rectangle(5, 5, postCard.getWidth() - 10, postCard.getHeight() - 10);
under.fill();
doc.add(new AreaBreak());
page = pdfDoc.getLastPage();
under = new PdfCanvas(page.newContentStreamBefore(), page.getResources(), pdfDoc);
drawRectangle(under, postCard.getWidth(), postCard.getHeight());
Image img = new Image(ImageDataFactory.create(RESOURCE));
img.setFixedPosition((postCard.getWidth() - img.getImageScaledWidth()) / 2, (postCard.getHeight() - img.getImageScaledHeight()) / 2);
doc.add(img);
doc.add(new AreaBreak());
page = pdfDoc.getLastPage();
under = new PdfCanvas(page.newContentStreamBefore(), page.getResources(), pdfDoc);
drawRectangle(under, postCard.getWidth(), postCard.getHeight());
Paragraph p = new Paragraph("Foobar Film Festival").setFont(PdfFontFactory.createFont(StandardFonts.HELVETICA)).setFontSize(22).setHorizontalAlignment(HorizontalAlignment.CENTER);
doc.add(p);
doc.add(new AreaBreak());
page = pdfDoc.getLastPage();
under = new PdfCanvas(page.newContentStreamBefore(), page.getResources(), pdfDoc);
drawRectangle(under, postCard.getWidth(), postCard.getHeight());
page = pdfDoc.getLastPage();
PdfCanvas over = new PdfCanvas(page.newContentStreamAfter(), page.getResources(), pdfDoc);
over.saveState();
float sinus = (float) Math.sin(Math.PI / 60);
float cosinus = (float) Math.cos(Math.PI / 60);
over.beginText();
over.setTextRenderingMode(PdfCanvasConstants.TextRenderingMode.FILL_STROKE);
over.setLineWidth(1.5f);
over.setStrokeColor(new DeviceRgb(0xFF, 0x00, 0x00));
over.setFillColor(new DeviceRgb(0xFF, 0xFF, 0xFF));
over.setFontAndSize(PdfFontFactory.createFont(StandardFonts.HELVETICA), 36);
over.setTextMatrix(cosinus, sinus, -sinus, cosinus, 50, 324);
over.showText("SOLD OUT");
over.setTextMatrix(0, 0);
over.endText();
over.restoreState();
doc.close();
</DeepExtract>
|
i7js-book
|
positive
|
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_about);
ytb_about = (YiTitleBar) findViewById(R.id.ytb_about);
ytb_about.setTitleName(R.string.str_about);
ytb_about.setLeftButtonBGResource(R.drawable.setting_title_bar_selector);
ytb_about.setOnLeftButtonClickListener(new LeftButtonClickListener() {
@Override
public void leftButtonClick() {
CopyRight.this.finish();
overridePendingTransition(R.anim.slide_remain, R.anim.out_left);
}
});
mWebView = (WebView) findViewById(R.id.webview_about);
mWebView.loadUrl(path);
msFinishLayout = (SlidingFinishLayout) findViewById(R.id.slide_finish_cr);
msFinishLayout.setTouchView(mWebView);
msFinishLayout.setOnSlidingFinishListener(new OnSlidingFinishListener() {
@Override
public void onSlidingFinish() {
CopyRight.this.finish();
}
});
}
|
<DeepExtract>
ytb_about = (YiTitleBar) findViewById(R.id.ytb_about);
ytb_about.setTitleName(R.string.str_about);
ytb_about.setLeftButtonBGResource(R.drawable.setting_title_bar_selector);
ytb_about.setOnLeftButtonClickListener(new LeftButtonClickListener() {
@Override
public void leftButtonClick() {
CopyRight.this.finish();
overridePendingTransition(R.anim.slide_remain, R.anim.out_left);
}
});
</DeepExtract>
|
duya_doodle
|
positive
|
private void convertTableNamesToRows(String[] types, List<Object[]> rows, String projectName, String schemaName, List<String> names) throws OdpsException {
LinkedList<Table> tables = new LinkedList<>();
tables.addAll(conn.getOdps().tables().loadTables(projectName, schemaName, names));
for (Table t : tables) {
String tableType = t.isVirtualView() ? TABLE_TYPE_VIEW : TABLE_TYPE_TABLE;
if (types != null && types.length != 0) {
if (!Arrays.asList(types).contains(tableType)) {
continue;
}
}
String schemaName = t.getProject();
if (conn.isOdpsNamespaceSchema()) {
schemaName = t.getSchemaName();
}
Object[] rowVals = { t.getProject(), schemaName, t.getName(), tableType, t.getComment(), null, null, null, null, null };
rows.add(rowVals);
}
tables.clear();
}
|
<DeepExtract>
for (Table t : tables) {
String tableType = t.isVirtualView() ? TABLE_TYPE_VIEW : TABLE_TYPE_TABLE;
if (types != null && types.length != 0) {
if (!Arrays.asList(types).contains(tableType)) {
continue;
}
}
String schemaName = t.getProject();
if (conn.isOdpsNamespaceSchema()) {
schemaName = t.getSchemaName();
}
Object[] rowVals = { t.getProject(), schemaName, t.getName(), tableType, t.getComment(), null, null, null, null, null };
rows.add(rowVals);
}
tables.clear();
</DeepExtract>
|
aliyun-odps-jdbc
|
positive
|
public Criteria andBookNameBetween(String value1, String value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "bookName" + " cannot be null");
}
criteria.add(new Criterion("book_name between", value1, value2));
return (Criteria) this;
}
|
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "bookName" + " cannot be null");
}
criteria.add(new Criterion("book_name between", value1, value2));
</DeepExtract>
|
library_manager_system
|
positive
|
public void delete() throws IOException {
if (journalWriter == null) {
return;
}
for (Entry entry : new ArrayList<Entry>(lruEntries.values())) {
if (entry.currentEditor != null) {
entry.currentEditor.abort();
}
}
trimToSize();
journalWriter.close();
journalWriter = null;
Util.deleteContents(directory);
}
|
<DeepExtract>
if (journalWriter == null) {
return;
}
for (Entry entry : new ArrayList<Entry>(lruEntries.values())) {
if (entry.currentEditor != null) {
entry.currentEditor.abort();
}
}
trimToSize();
journalWriter.close();
journalWriter = null;
</DeepExtract>
|
phonegap-custom-camera-plugin
|
positive
|
public long hashLongs(@NotNull long[] input, int off, int len) {
if (len < 0 || off < 0 || off + len > input.length || off + len < 0)
throw new IndexOutOfBoundsException();
return hash(longArrayAccessor().handle(input), longArrayAccessor().access(), longArrayAccessor().offset(input, off), longArrayAccessor().size(len));
}
|
<DeepExtract>
if (len < 0 || off < 0 || off + len > input.length || off + len < 0)
throw new IndexOutOfBoundsException();
</DeepExtract>
<DeepExtract>
return hash(longArrayAccessor().handle(input), longArrayAccessor().access(), longArrayAccessor().offset(input, off), longArrayAccessor().size(len));
</DeepExtract>
|
Chronicle-Algorithms
|
positive
|
@Override
public Verification withArrayClaim(String name, Long... items) throws IllegalArgumentException {
if (name == null) {
throw new IllegalArgumentException("The Custom Claim's name can't be null.");
}
expectedChecks.add(constructExpectedCheck(name, (claim, decodedJWT) -> {
if (claim.isMissing()) {
throw new MissingClaimException(name);
}
return ((claim, decodedJWT) -> verifyNull(claim, items) || assertValidCollectionClaim(claim, items)).test(claim, decodedJWT);
}));
return this;
}
|
<DeepExtract>
if (name == null) {
throw new IllegalArgumentException("The Custom Claim's name can't be null.");
}
</DeepExtract>
<DeepExtract>
expectedChecks.add(constructExpectedCheck(name, (claim, decodedJWT) -> {
if (claim.isMissing()) {
throw new MissingClaimException(name);
}
return ((claim, decodedJWT) -> verifyNull(claim, items) || assertValidCollectionClaim(claim, items)).test(claim, decodedJWT);
}));
</DeepExtract>
|
java-jwt
|
positive
|
@Override
public void execute() {
addContentFragment(PollsListFragment.inGroupAnnouncements(_item.getId()));
}
|
<DeepExtract>
addContentFragment(PollsListFragment.inGroupAnnouncements(_item.getId()));
</DeepExtract>
|
getsocial-android-sdk
|
positive
|
public void actionPerformed(ActionEvent ee) {
task.theory = "md";
if (task.operation.equals("")) {
task.operation = "energy";
}
;
nwchem_Task t_temp;
taskModel.setSize(tasks.size());
for (int i = 0; i < tasks.size(); i++) {
t_temp = (nwchem_Task) tasks.elementAt(i);
System.out.println("task " + (i + 1) + ": " + t_temp.theory + " " + t_temp.operation);
taskModel.setElementAt("task " + (i + 1) + ": " + t_temp.theory + " " + t_temp.operation, i);
}
;
}
|
<DeepExtract>
nwchem_Task t_temp;
taskModel.setSize(tasks.size());
for (int i = 0; i < tasks.size(); i++) {
t_temp = (nwchem_Task) tasks.elementAt(i);
System.out.println("task " + (i + 1) + ": " + t_temp.theory + " " + t_temp.operation);
taskModel.setElementAt("task " + (i + 1) + ": " + t_temp.theory + " " + t_temp.operation, i);
}
;
</DeepExtract>
|
nwchem-git-svn-deprecated
|
positive
|
public static Ping onAddress(@NonNull InetAddress paramInetAddress) {
Ping localPing = new Ping();
this.address = paramInetAddress;
return localPing;
}
|
<DeepExtract>
this.address = paramInetAddress;
</DeepExtract>
|
fakegumtree
|
positive
|
public void setRawData(byte[] ndata) {
int length = Math.min(10, ndata.length);
System.arraycopy(ndata, 0, this.data, 5, length);
if ((byte) length > 10)
(byte) length = 10;
data[3] = (byte) length;
}
|
<DeepExtract>
if ((byte) length > 10)
(byte) length = 10;
data[3] = (byte) length;
</DeepExtract>
|
JArduino
|
positive
|
public static ChildProcess startSuCommand(String cmd) {
String[] cmdarray = new String[3];
cmdarray[0] = "su";
cmdarray[1] = "-c";
cmdarray[2] = cmd;
return new ChildProcess(cmdarray, null);
}
|
<DeepExtract>
return new ChildProcess(cmdarray, null);
</DeepExtract>
|
APKreator
|
positive
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.