buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public static org.biojava.nbio.structure.Atom[] cyclicSorter(org.biojava.nbio.structure.Structure structure) {
java.util.List<org.biojava.nbio.structure.Atom[]> chainAtoms = new java.util.ArrayList<org.biojava.nbio.structure.Atom[]>();
for (org.biojava.nbio.structure.Chain c : structure.getChains()) {
o... | public static org.biojava.nbio.structure.Atom[] cyclicSorter(org.biojava.nbio.structure.Structure structure) {
java.util.List<org.biojava.nbio.structure.Atom[]> chainAtoms = new java.util.ArrayList<org.biojava.nbio.structure.Atom[]>();
for (org.biojava.nbio.structure.Chain c : structure.getChains()) {
o... |
public boolean check(edu.gemini.spModel.config2.Config config, edu.gemini.p2checker.rules.gmos.ObservationElements elems) {
edu.gemini.p2checker.rules.gmos.GmosCommonType.FPUnit fpu = edu.gemini.p2checker.rules.gmos.GmosRule.getFPU(config);
if (fpu == null)
return false;
if ((elems.getInstrumen... | public boolean check(edu.gemini.spModel.config2.Config config, edu.gemini.p2checker.rules.gmos.ObservationElements elems) {
if ((elems.getInstrument()) instanceof edu.gemini.p2checker.rules.gmos.InstGmosSouth) {
_message = MESSAGE_SOUTH;
}else {
_message = MESSAGE_NORTH;
}
return !(edu.g... |
public void paint(java.awt.Graphics g) {
java.awt.Image offImage = createImage(this.getWidth(), this.getHeight());
java.awt.Graphics buffer = offImage.getGraphics();
world.paintOffScreen(buffer);
g.drawImage(offImage, 3, 37, null);
} | public void paint(java.awt.Graphics g) {
java.awt.Image offImage = createImage(this.getWidth(), this.getHeight());
java.awt.Graphics buffer = offImage.getGraphics();
world.paint(buffer);
g.drawImage(offImage, 3, 37, null);
} |
public java.lang.String duplicateOrder(fr.mgs.model.order.Order order) throws java.sql.SQLException {
newOrder = new fr.mgs.model.order.Order();
if (orderManager.hasNotValidatedOrder(userId)) {
java.util.List<fr.mgs.model.order.Order> orderList = ((java.util.List<fr.mgs.model.order.Order>) (orderManager... | public java.lang.String duplicateOrder(fr.mgs.model.order.Order order) throws java.sql.SQLException {
newOrder = new fr.mgs.model.order.Order();
if (orderManager.hasNotValidatedOrder(userId)) {
java.util.List<fr.mgs.model.order.Order> orderList = ((java.util.List<fr.mgs.model.order.Order>) (orderManager... |
public void setActivePanel(javax.swing.JPanel panel) {
prevPanel = activePanel;
if ((activePanel) != null) {
getContentPane().remove(activePanel);
}
getContentPane().add(panel, java.awt.BorderLayout.CENTER);
activePanel = panel;
pack();
repaint();
} | public void setActivePanel(javax.swing.JPanel panel) {
if (panel != (activePanel)) {
prevPanel = activePanel;
if ((activePanel) != null) {
getContentPane().remove(activePanel);
}
getContentPane().add(panel, java.awt.BorderLayout.CENTER);
activePanel = panel;
... |
protected boolean startNewBlockAnalysis(final org.sosy_lab.cpachecker.cpa.arg.ARGState pState, final org.sosy_lab.cpachecker.cfa.model.CFANode node, final org.sosy_lab.cpachecker.cpa.bam.BAMPrecision prec) {
boolean result = (partitioning.isCallNode(node)) && (!(partitioning.getBlockForCallNode(node).equals((stack.... | protected boolean startNewBlockAnalysis(final org.sosy_lab.cpachecker.cpa.arg.ARGState pState, final org.sosy_lab.cpachecker.cfa.model.CFANode node, final org.sosy_lab.cpachecker.cpa.bam.BAMPrecision prec) {
boolean result = (partitioning.isCallNode(node)) && (!(partitioning.getBlockForCallNode(node).equals((stack.... |
public static void restore(java.lang.String id, models.datatable.BackupDataTable.Type type) {
com.emc.vipr.model.sys.backup.BackupRestoreStatus status = util.BackupUtils.getRestoreStatus(id, (type == (models.datatable.BackupDataTable.Type.LOCAL)));
renderArgs.put("status", status);
renderArgs.put("id", id);... | public static void restore(java.lang.String id, models.datatable.BackupDataTable.Type type) {
if (type == (models.datatable.BackupDataTable.Type.REMOTE)) {
util.BackupUtils.pullBackup(id);
}
com.emc.vipr.model.sys.backup.BackupRestoreStatus status = util.BackupUtils.getRestoreStatus(id, (type == (mo... |
public java.lang.String getContentByCharPos(int docId, java.lang.String fieldName, int startAtChar, int endAtChar) {
if (!(contentStores.exists(fieldName))) {
org.apache.lucene.document.Document d = document(docId);
return d.get(fieldName).substring(startAtChar, endAtChar);
}
return contentS... | public java.lang.String getContentByCharPos(int docId, java.lang.String fieldName, int startAtChar, int endAtChar) {
org.apache.lucene.document.Document d = document(docId);
if (!(contentStores.exists(fieldName))) {
return d.get(fieldName).substring(startAtChar, endAtChar);
}
return contentStore... |
public void onActivityCreated(@android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
setHasOptionsMenu(true);
if ((savedInstanceState != null) && (savedInstanceState.containsKey("key"))) {
movieList = savedInstanceState.getParcelableArrayList("key");
hasData = true;
... | public void onActivityCreated(@android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setHasOptionsMenu(true);
if ((savedInstanceState != null) && (savedInstanceState.containsKey("key"))) {
movieList = savedInstanceState.getParcelable... |
public void run() {
try {
javax.net.ssl.SSLSocket socket = com.booboot.vndbandroid.api.SocketPool.getSocket(socketIndex);
if ((socket != null) && (!(socket.isClosed()))) {
socket.getInputStream().close();
socket.getOutputStream().close();
socket.close();
}... | public static void close(final int socketIndex) {
try {
javax.net.ssl.SSLSocket socket = com.booboot.vndbandroid.api.SocketPool.getSocket(socketIndex);
if ((socket != null) && (!(socket.isClosed()))) {
socket.getInputStream().close();
socket.getOutputStream().close();
... |
protected void onResume() {
savedSearchString = com.logan19gp.flickrviewer.MainApplication.loadFromPrefs(com.logan19gp.flickrviewer.SearchActivity.SEARCH_STR, "");
if ((savedSearchString.length()) > 0) {
pageOnView = com.logan19gp.flickrviewer.MainApplication.loadFromPrefsInt(com.logan19gp.flickrviewer.... | protected void onResume() {
savedSearchString = com.logan19gp.flickrviewer.MainApplication.loadFromPrefs(com.logan19gp.flickrviewer.SearchActivity.SEARCH_STR, "");
if ((savedSearchString.length()) > 0) {
pageOnView = com.logan19gp.flickrviewer.MainApplication.loadFromPrefsInt(com.logan19gp.flickrviewer.... |
public void compareSelectedVersions(java.util.List<java.lang.String> agbversion1, java.util.List<java.lang.String> agbversion2) {
java.lang.System.out.println("Starte AGB-Vergleich: ");
java.lang.System.out.println("Achtung: Folgende Aenderung haben sich ergeben! ");
difflib.Patch patch1 = difflib.DiffUtils... | public void compareSelectedVersions(java.util.List<java.lang.String> agbversion1, java.util.List<java.lang.String> agbversion2) {
java.lang.System.out.println("Starte AGB-Vergleich: ");
java.lang.System.out.println("Achtung: Folgende Aenderung haben sich ergeben! ");
difflib.Patch patch1 = difflib.DiffUtils... |
public void autoIncrementSchoolId() {
tab.School school1 = new tab.School("UMKC", "kangaroos");
tab.School school2 = new tab.School("KU", "jayhawks");
assertEquals(1, school1.getId());
assertEquals(2, school2.getId());
} | public void autoIncrementSchoolId() {
tab.School school1 = new tab.School("UMKC", "kangaroos");
tab.School school2 = new tab.School("KU", "jayhawks");
assertEquals(((school1.getId()) + 1), school2.getId());
} |
public boolean isValid(java.lang.CharSequence charSequence) {
java.util.regex.Matcher m = com.muqdd.iuob2.features.schedule_builder.ScheduleBuilderFragment.pCourse.matcher(charSequence.toString());
if (!(m.find())) {
return false;
}
java.lang.String courseName = m.group(1);
return (java.util... | public boolean isValid(java.lang.CharSequence charSequence) {
java.util.regex.Matcher m = com.muqdd.iuob2.features.schedule_builder.ScheduleBuilderFragment.pCourse.matcher(charSequence.toString().toUpperCase().trim());
if (!(m.find())) {
return false;
}
java.lang.String courseName = m.group(1);
... |
public java.util.List<ru.aviaj.model.Place> handle(java.sql.ResultSet resultSet) throws java.sql.SQLException {
final java.util.List<ru.aviaj.model.Place> bufferPlaceList = new java.util.ArrayList<>();
while (resultSet.next()) {
bufferPlaceList.add(new ru.aviaj.model.Place(resultSet.getLong("id"), resul... | public java.util.List<ru.aviaj.model.Place> handle(java.sql.ResultSet resultSet) throws java.sql.SQLException {
final java.util.List<ru.aviaj.model.Place> bufferPlaceList = new java.util.ArrayList<>();
while (resultSet.next()) {
bufferPlaceList.add(new ru.aviaj.model.Place(resultSet.getLong("id"), resul... |
public static java.lang.String outputHeightOrNA(java.lang.Integer feet, java.lang.Integer inches) {
if ((feet == null) && (inches == null)) {
return "N/A";
}else {
java.lang.String output = "";
if (feet != null) {
output += feet + "'";
}
if (inches != null) {
... | public static java.lang.String outputHeightOrNA(java.lang.Integer feet, java.lang.Integer inches) {
if (((feet == null) && (inches == null)) || ((feet == 0) && (inches == 0))) {
return "N/A";
}else {
java.lang.String output = "";
if (feet != null) {
output += feet + "'";
... |
public void onGameEvent(net.demilich.metastone.game.events.GameEvent event) {
net.demilich.metastone.game.entities.Entity host = event.getGameContext().resolveSingleTarget(getHostReference());
if ((((expirationTrigger) != null) && ((expirationTrigger.interestedIn()) == (event.getEventType()))) && (expirationTri... | public void onGameEvent(net.demilich.metastone.game.events.GameEvent event) {
net.demilich.metastone.game.entities.Entity host = event.getGameContext().resolveSingleTarget(getHostReference());
if ((((expirationTrigger) != null) && (interestedIn(event.getEventType()))) && (expirationTrigger.fires(event, host))) ... |
private void addQueryIntegerListFilter(java.lang.String optionKey, java.lang.String queryKey, org.opencb.opencga.catalog.db.DBObject query, org.opencb.datastore.core.QueryOptions options) {
if (options.containsKey(optionKey)) {
java.util.List<java.lang.Integer> integerList = options.getAsIntegerList(optionK... | private void addQueryIntegerListFilter(java.lang.String optionKey, org.opencb.datastore.core.QueryOptions options, java.lang.String queryKey, org.opencb.opencga.catalog.db.DBObject query) {
if (options.containsKey(optionKey)) {
java.util.List<java.lang.Integer> integerList = options.getAsIntegerList(optionK... |
public void removeTicketLine(int i) {
m_jTableModel.removeRow(i);
if (i >= (m_jTableModel.getRowCount())) {
i = (m_jTableModel.getRowCount()) - 1;
}
if ((i >= 0) && (i < (m_jTableModel.getRowCount()))) {
setSelectedIndex(i);
}
} | public void removeTicketLine(int i) {
i = i - (offset);
m_jTableModel.removeRow(i);
if (i >= (m_jTableModel.getRowCount())) {
i = (m_jTableModel.getRowCount()) - 1;
}
if ((i >= 0) && (i < (m_jTableModel.getRowCount()))) {
setSelectedIndex(i);
}
} |
public void testExpandSkipLimit() {
com.orientechnologies.orient.core.sql.query.OSQLSynchQuery sql = new com.orientechnologies.orient.core.sql.query.OSQLSynchQuery("SELECT expand(linked) from ExpandSkipLimit where parent = true order by nnum skip 1 limit 1");
java.util.List<com.orientechnologies.orient.core.db.... | public void testExpandSkipLimit() {
com.orientechnologies.orient.core.sql.query.OSQLSynchQuery sql = new com.orientechnologies.orient.core.sql.query.OSQLSynchQuery("SELECT expand(linked) from ExpandSkipLimit where parent = true order by nnum skip 1 limit 1");
java.util.List<com.orientechnologies.orient.core.db.... |
public static void semitoneDown(com.kekstudio.musictheory.Note note) {
(note.value)--;
if ((note.name.charAt(((note.name.length()) - 1))) == (Music.SHARP)) {
note.name = note.name.substring(0, ((note.name.length()) - 2));
}else {
note.name += Music.FLAT;
}
} | public static void semitoneDown(com.kekstudio.musictheory.Note note) {
(note.value)--;
if ((note.name.charAt(((note.name.length()) - 1))) == (Music.SHARP)) {
note.name = note.name.substring(0, ((note.name.length()) - 1));
}else {
note.name += Music.FLAT;
}
} |
public void validateSystemTag(java.lang.String resourceUuid, java.lang.String resourceType, java.lang.String tag) {
boolean checked = false;
for (org.zstack.tag.SystemTag stag : systemTags) {
if (stag.isMatch(tag)) {
checked = true;
stag.validate(resourceUuid, resourceTypeClassMa... | public void validateSystemTag(java.lang.String resourceUuid, java.lang.String resourceType, java.lang.String tag) {
boolean checked = false;
for (org.zstack.tag.SystemTag stag : systemTags) {
if (stag.isMatch(tag)) {
checked = true;
stag.validate(resourceUuid, resourceTypeClassMa... |
public void disconnect() {
if ((mSocket) != null) {
mHandler.post(new java.lang.Runnable() {
@java.lang.Override
public void run() {
try {
if ((mSocket) == null)
return ;
mSocket.clos... | public void disconnect() {
if ((mSocket) != null) {
mHandler.post(new java.lang.Runnable() {
@java.lang.Override
public void run() {
try {
if ((mSocket) == null)
return ;
mSocket.clos... |
public void addTo(net.whistlingfish.harmony.HarmonyClient client) {
client.addListener(new net.whistlingfish.harmony.ActivityChangeListener() {
@java.lang.Override
public void activityStarted(net.whistlingfish.harmony.config.Activity activity) {
org.openhab.binding.harmonyhub.internal.Ha... | public void addTo(net.whistlingfish.harmony.HarmonyClient client) {
client.addListener(new net.whistlingfish.harmony.ActivityChangeListener() {
@java.lang.Override
public void activityStarted(net.whistlingfish.harmony.config.Activity activity) {
org.openhab.binding.harmonyhub.internal.Ha... |
private void save(java.lang.String inputText) {
if (!(android.text.TextUtils.isEmpty(inputText))) {
java.io.FileOutputStream out = null;
java.io.BufferedWriter writer = null;
try {
out = openFileOutput("data", Context.MODE_PRIVATE);
writer = new java.io.BufferedWriter... | private void save(java.lang.String inputText) {
java.io.FileOutputStream out = null;
java.io.BufferedWriter writer = null;
try {
out = openFileOutput("data", Context.MODE_PRIVATE);
writer = new java.io.BufferedWriter(new java.io.OutputStreamWriter(out));
writer.write(inputText);
... |
public void shutdown() {
isShutdown = true;
responseThread.interrupt();
java.util.Iterator<com.hazelcast.client.spi.impl.ClientInvocation> iterator = callIdMap.values().iterator();
while (iterator.hasNext()) {
com.hazelcast.client.spi.impl.ClientInvocation invocation = iterator.next();
i... | public void shutdown() {
isShutdown = true;
responseThread.interrupt();
java.util.Iterator<com.hazelcast.client.spi.impl.ClientInvocation> iterator = callIdMap.values().iterator();
while (iterator.hasNext()) {
com.hazelcast.client.spi.impl.ClientInvocation invocation = iterator.next();
i... |
public void initializeCache(entities.Library library, repositories.BookRepository bookRepo) {
log.info("Cache creation initialized");
java.util.List<entities.Book> bookList = dbAccessor.getBooks(library, bookRepo);
dbAccessor.createCache(bookList, library.getName());
log.info("Cache created");
} | public void initializeCache(entities.Library library, repositories.BookRepository bookRepo) {
log.info("Cache creation initialized");
java.util.List<entities.Book> bookList = dbAccessor.getBooks(bookRepo, library);
dbAccessor.createCache(bookList, library.getName());
log.info("Cache created");
} |
public static java.util.Calendar parseDate(java.lang.String dateString) throws java.text.ParseException {
helper.CalendarHelper.FORMAT_DATE.setLenient(false);
dateString = dateString.trim();
java.util.Calendar date = java.util.Calendar.getInstance();
date.setTime(helper.CalendarHelper.FORMAT_DATE.parse(... | public static java.util.Calendar parseDate(java.lang.String dateString) throws java.text.ParseException {
helper.CalendarHelper.FORMAT_DATE.setLenient(false);
dateString = dateString.trim();
java.util.Calendar date = java.util.Calendar.getInstance();
date.setTime(helper.CalendarHelper.FORMAT_DATE.parse(... |
public org.easybatch.core.job.JobReportFormatter<java.lang.String> getFormatter() {
if ((this.formatter) == null) {
synchronized(formatter) {
if ((this.formatter) == null) {
this.formatter = new org.easybatch.core.job.DefaultJobReportFormatter();
}
}
}
... | public org.easybatch.core.job.JobReportFormatter<java.lang.String> getFormatter() {
if ((this.formatter) == null) {
synchronized(this) {
if ((this.formatter) == null) {
this.formatter = new org.easybatch.core.job.DefaultJobReportFormatter();
}
}
}
retu... |
public java.util.Map<java.lang.String, java.lang.String> getVariable() {
java.util.Map<java.lang.String, java.lang.String> value = null;
if ((this.variable) != null) {
value = this.variable;
}
if (value == null) {
if ((this.category) != null) {
value = this.category.getVariab... | public java.util.Map<java.lang.String, java.lang.String> getVariable() {
if ((this.variable) != null) {
return this.variable;
}
if ((this.category) != null) {
return this.category.getVariable();
}
return getParent().getVariable();
} |
public static boolean canStacksMerge(net.minecraft.item.ItemStack stack1, net.minecraft.item.ItemStack stack2) {
if ((stack1 == (net.minecraft.item.ItemStack.EMPTY)) || (stack2 == (net.minecraft.item.ItemStack.EMPTY))) {
return false;
}
if (!(stack1.isItemEqual(stack2))) {
return false;
... | public static boolean canStacksMerge(net.minecraft.item.ItemStack stack1, net.minecraft.item.ItemStack stack2) {
if ((stack1.isEmpty()) || (stack2.isEmpty())) {
return false;
}
if (!(stack1.isItemEqual(stack2))) {
return false;
}
if (!(net.minecraft.item.ItemStack.areItemStackTagsEqu... |
private void setCoords() {
java.security.SecureRandom rdmgen = new java.security.SecureRandom();
int random = (rdmgen.nextInt(11)) + 1;
leftX = (HomeList.maxWidth) / random;
topY = (HomeList.maxHeight) / random;
rightX = (leftX) + (2 * (radius));
bottomY = (topY) + (2 * (radius));
findCentre... | private void setCoords() {
leftX = (HomeList.maxWidth) / 2;
topY = (HomeList.maxHeight) / 2;
rightX = (leftX) + (2 * (radius));
bottomY = (topY) + (2 * (radius));
findCentre();
} |
public static java.util.List<com.aimluck.eip.cayenne.om.portlet.VEipTScheduleList> getScheduleList(int userId, java.util.Date viewStart, java.util.Date viewEnd, java.util.List<java.lang.Integer> users, java.util.List<java.lang.Integer> facilities, boolean isDetail) {
return com.aimluck.eip.schedule.util.ScheduleUti... | public static java.util.List<com.aimluck.eip.cayenne.om.portlet.VEipTScheduleList> getScheduleList(int userId, java.util.Date viewStart, java.util.Date viewEnd, java.util.List<java.lang.Integer> users, java.util.List<java.lang.Integer> facilities, boolean isDetail) {
return com.aimluck.eip.schedule.util.ScheduleUti... |
public dataAcces.entity.User searchByUsername(java.lang.String username) {
javax.persistence.EntityManager em = emf.createEntityManager();
dataAcces.entity.User user = null;
try {
user = em.find(dataAcces.entity.User.class, username);
} catch (java.lang.Exception e) {
e.printStackTrace()... | public dataAcces.entity.User searchByUsername(java.lang.String username) {
javax.persistence.EntityManager em = emf.createEntityManager();
dataAcces.entity.User user = null;
try {
user = em.find(dataAcces.entity.User.class, username);
} catch (java.lang.Exception e) {
e.printStackTrace()... |
public void putIndexValue(int indexId, java.lang.Object key, java.lang.Object value) {
if ((transaction.get()) != null)
doPutIndexValue(indexId, key, value);
checkOpeness();
stateLock.acquireReadLock();
try {
checkOpeness();
checkLowDiskSpaceAndFullCheckpointRequests();
... | public void putIndexValue(int indexId, java.lang.Object key, java.lang.Object value) {
if ((transaction.get()) != null) {
doPutIndexValue(indexId, key, value);
return ;
}
checkOpeness();
stateLock.acquireReadLock();
try {
checkOpeness();
checkLowDiskSpaceAndFullCheckp... |
public static void ListContacts(Messenger esql, java.lang.String authorisedUser) {
try {
java.lang.String query = "SELECT ULC.list_member " + ((("FROM USR U, USER_LIST UL, USER_LIST_CONTAINS ULC " + "WHERE U.login = login ") + "AND UL.list_id = U.contact_list ") + "AND ULC.list_id = UL.list_id ");
j... | public static void ListContacts(Messenger esql, java.lang.String authorisedUser) {
try {
java.lang.String query = "SELECT ULC.list_member " + ("FROM USR U, USER_LIST UL, USER_LIST_CONTAINS ULC " + "WHERE U.login = authorisedUser AND UL.list_id = U.contact_list AND ULC.list_id = UL.list_id ");
int ro... |
public void close() {
if ((this.state) != (com.microsoft.azure.iothub.transport.State.CLOSED)) {
this.state = com.microsoft.azure.iothub.transport.State.CLOSED;
this.sender.close();
this.receiver.close();
this.session.close();
this.connection.close();
this.reactorFutu... | public void close() {
this.state = com.microsoft.azure.iothub.transport.State.CLOSED;
this.sender.close();
this.receiver.close();
this.session.close();
this.connection.close();
this.reactorFuture.cancel(true);
this.executorService.shutdown();
} |
public int handleVerticalCollisionResponse(entities.Entity obj) {
int result = 0;
if (isColliding(obj)) {
boolean above = (y) > (obj.y);
if (above) {
result = 1;
y = (obj.y) + (obj.height);
}else {
result = -1;
y = (obj.y) - (height);
... | public int handleVerticalCollisionResponse(entities.Entity obj) {
int result = 0;
if (isColliding(obj)) {
boolean above = (y) >= (obj.y);
if (above) {
result = 1;
y = (obj.y) + (obj.height);
}else {
result = -1;
y = (obj.y) - (height);
... |
public void div(final int... params) {
int divResult = params[0];
for (int i = 1; i < ((params.length) - 1); i++) {
divResult /= params[i];
}
result += divResult;
} | public void div(final int... params) {
int divResult = params[0];
for (int i = 1; i < (params.length); i++) {
divResult /= params[i];
}
result += divResult;
} |
public <T> T create(java.lang.Class<T> service) {
return ((T) (java.lang.reflect.Proxy.newProxyInstance(service.getClassLoader(), new java.lang.Class<?>[]{ service }, new spwrap.proxy.CallerInvocationHandler(this.dataSource))));
} | public <T> T create(java.lang.Class<T> service) {
return ((T) (java.lang.reflect.Proxy.newProxyInstance(service.getClassLoader(), new java.lang.Class<?>[]{ service }, new spwrap.proxy.CallerInvocationHandler(this))));
} |
public void clearBoard() {
for (int i = 0; i < (sizeX); i++) {
for (int j = 0; j < (sizeY); j++) {
board.getCellAt(i, j).setCurrentState(CellState.DEAD);
}
}
updateBoard();
} | public void clearBoard() {
for (int i = 0; i < (this.sizeX); i++) {
for (int j = 0; j < (this.sizeY); j++) {
this.board.getCellAt(i, j).setCurrentState(CellState.DEAD);
}
}
updateBoard();
} |
private static void updateFeedSourceDB(java.lang.String source_name, java.lang.String channel, java.lang.String last_update_time, java.lang.String previous_last_update) throws java.io.IOException, java.sql.SQLException {
java.net.URL url = new java.net.URL(com.davidwang.feed.utils.Const.UPDATE_SOURCE);
java.uti... | private static void updateFeedSourceDB(java.lang.String source_name, java.lang.String channel, java.lang.String last_update_time, java.lang.String previous_last_update) throws java.io.IOException, java.sql.SQLException {
java.net.URL url = new java.net.URL(com.davidwang.feed.utils.Const.UPDATE_SOURCE);
java.uti... |
public double getMountedYOffset() {
if (((this.missileFlightTime) <= 0) && ((this.missileType) == (defense.common.entity.EntityMissile.MissileType.MISSILE))) {
return height;
}else
if ((this.missileType) == (defense.common.entity.EntityMissile.MissileType.CruiseMissile)) {
return (he... | public double getMountedYOffset() {
if (((missileFlightTime) <= 0) && ((missileType) == (defense.common.entity.EntityMissile.MissileType.MISSILE))) {
return height;
}else
if ((missileType) == (defense.common.entity.EntityMissile.MissileType.CruiseMissile)) {
return (height) / 10;
... |
public static synchronized boolean isCameraUseable(int cameraID) {
boolean canUse = true;
android.hardware.Camera mCamera = null;
try {
mCamera = android.hardware.Camera.open(cameraID);
android.hardware.Camera.Parameters mParameters = mCamera.getParameters();
mCamera.setParameters(mP... | public static synchronized boolean isCameraUseable(int cameraID) {
boolean canUse = true;
android.hardware.Camera mCamera = null;
try {
mCamera = android.hardware.Camera.open(cameraID);
android.hardware.Camera.Parameters mParameters = mCamera.getParameters();
mCamera.setParameters(mP... |
public com.computing.pervasive.myapplication.Building getBuilding(int id) {
com.computing.pervasive.myapplication.Building building = null;
android.database.sqlite.SQLiteDatabase db = this.getReadableDatabase();
android.database.Cursor cursor = db.query(com.computing.pervasive.myapplication.MyDBHandler.TABL... | public com.computing.pervasive.myapplication.Building getBuilding(int id) {
com.computing.pervasive.myapplication.Building building = null;
android.database.sqlite.SQLiteDatabase db = this.getReadableDatabase();
android.database.Cursor cursor = db.query(com.computing.pervasive.myapplication.MyDBHandler.TABL... |
public static <T extends aurelienribon.texturepackergui.AppEvents.BaseAppEventListener> void fireEventToListeners(java.lang.Class<T> listenersClass) {
java.lang.Object[] listeners = aurelienribon.texturepackergui.AppEvents.listenerList.getListenerList();
for (int i = (listeners.length) - 2; i >= 0; i -= 2)
... | public static <T extends aurelienribon.texturepackergui.AppEvents.BaseAppEventListener> void fireEventToListeners(java.lang.Class<T> listenersClass, java.lang.Object... args) {
java.lang.Object[] listeners = aurelienribon.texturepackergui.AppEvents.listenerList.getListenerList();
for (int i = (listeners.length)... |
private void doBushGrowth(org.terasology.simpleFarming.components.BushDefinitionComponent bushComponent, int direction) {
bushComponent.currentStage += direction;
worldProvider.setBlock(bushComponent.position, bushComponent.stages[bushComponent.currentStage].block);
org.terasology.entitySystem.entity.Entity... | private org.terasology.entitySystem.entity.EntityRef doBushGrowth(org.terasology.simpleFarming.components.BushDefinitionComponent bushComponent, int direction) {
bushComponent.currentStage += direction;
worldProvider.setBlock(bushComponent.position, bushComponent.stages[bushComponent.currentStage].block);
o... |
public java.lang.String[] getNames() {
java.lang.String[] names = new java.lang.String[agents.size()];
int i = 0;
for (java.util.Map.Entry<java.lang.String, java.lang.Object> entry : agents.entrySet()) {
names[i] = entry.getKey();
java.lang.System.out.println(("names: " + (names[i])));
... | public java.lang.String[] getNames() {
java.lang.String[] names = new java.lang.String[agents.size()];
int i = 0;
for (java.util.Map.Entry<java.lang.String, java.lang.Object> entry : agents.entrySet()) {
names[i] = entry.getKey();
i++;
}
return names;
} |
public org.pac4j.core.credentials.TokenCredentials extract(org.pac4j.core.context.WebContext context) throws org.pac4j.core.exception.HttpAction {
final java.lang.String ip;
if ((alternateIpHeaders.length) == 0) {
ip = context.getRemoteAddr();
}else {
ip = ipFromHeaders(context);
}
i... | public org.pac4j.core.credentials.TokenCredentials extract(org.pac4j.core.context.WebContext context) throws org.pac4j.core.exception.HttpAction {
final java.lang.String ip;
if (alternateIpHeaders.isEmpty()) {
ip = context.getRemoteAddr();
}else {
ip = ipFromHeaders(context);
}
if (i... |
private void notificationNetServiceDeviceRemoved(javax.jmdns.ServiceEvent serviceEvent) {
com.parrot.arsdk.arsal.ARSALPrint.d(com.parrot.arsdk.ardiscovery.ARDiscoveryJmdnsDiscovery.TAG, "notificationServiceDeviceRemoved");
com.parrot.arsdk.ardiscovery.ARDiscoveryDeviceService deviceServiceRemoved = netDeviceSer... | private void notificationNetServiceDeviceRemoved(javax.jmdns.ServiceEvent serviceEvent) {
com.parrot.arsdk.arsal.ARSALPrint.d(com.parrot.arsdk.ardiscovery.ARDiscoveryJmdnsDiscovery.TAG, "notificationServiceDeviceRemoved");
com.parrot.arsdk.ardiscovery.ARDiscoveryDeviceService deviceServiceRemoved = netDeviceSer... |
public synchronized void enable(android.os.Handler locationHandler) {
buildGoogleApiClient();
if ((!(mGoogleApiClient.isConnected())) && (!(mGoogleApiClient.isConnecting()))) {
mGoogleApiClient.connect();
}
if (!(isEnabled)) {
mLocationHandler = locationHandler;
mLocationRequest ... | public synchronized void enable(android.os.Handler locationHandler) {
buildGoogleApiClient();
if ((!(mGoogleApiClient.isConnected())) && (!(mGoogleApiClient.isConnecting()))) {
mGoogleApiClient.connect();
}
if (!(isEnabled)) {
mLocationRequest = new com.google.android.gms.location.Locati... |
public final hu.akarnokd.rxjava2.basetypes.Solo<T> doOnRequest(hu.akarnokd.rxjava2.basetypes.LongConsumer onRequest) {
hu.akarnokd.rxjava2.basetypes.ObjectHelper.requireNonNull(onRequest, "onRequest is null");
return hu.akarnokd.rxjava2.basetypes.Solo.onAssembly(new hu.akarnokd.rxjava2.basetypes.SoloDoOnLifecyc... | public final hu.akarnokd.rxjava2.basetypes.Solo<T> doOnRequest(hu.akarnokd.rxjava2.basetypes.LongConsumer onRequest) {
hu.akarnokd.rxjava2.basetypes.ObjectHelper.requireNonNull(onRequest, "onRequest is null");
return hu.akarnokd.rxjava2.basetypes.Solo.onAssembly(new hu.akarnokd.rxjava2.basetypes.SoloDoOnLifecyc... |
private int measurementSeeBluetooth(uni.miskolc.ips.ilona.measurement.model.measurement.Measurement meas, java.lang.String bluetooth) {
java.lang.String hardwareAddress = getBluetoothHardwareAddress(bluetooth);
java.util.Set<java.lang.String> measurementBluetoothTags = meas.getBluetoothTags().getTags();
for... | private int measurementSeeBluetooth(uni.miskolc.ips.ilona.measurement.model.measurement.Measurement meas, java.lang.String bluetooth) {
java.lang.String hardwareAddress = getBluetoothHardwareAddress(bluetooth);
if ((meas.getBluetoothTags()) != null) {
java.util.Set<java.lang.String> measurementBluetooth... |
public void onActivityResult(int requestCode, int resultCode, android.content.Intent intent) {
switch (requestCode) {
case com.matburt.mobileorg.Gui.OutlineActivity.RUNFOR_EXPAND :
if (resultCode != (com.matburt.mobileorg.Gui.OutlineActivity.RESULT_DONTPOP))
this.appInst.popNodes... | public void onActivityResult(int requestCode, int resultCode, android.content.Intent intent) {
switch (requestCode) {
case com.matburt.mobileorg.Gui.OutlineActivity.RUNFOR_EXPAND :
if (resultCode != (com.matburt.mobileorg.Gui.OutlineActivity.RESULT_DONTPOP))
this.appInst.popNodes... |
private void updateView(int setViewResult, boolean isreset) {
if (setViewResult == 0) {
if ((mView.getParent()) != null) {
if (isreset) {
mManager.removeViewImmediate(mView);
mManager.addView(mView, mParams);
}else {
mView.invalidate();... | private void updateView(int setViewResult, boolean isreset) {
if (((mManager) != null) && (setViewResult == 0)) {
if ((mView.getParent()) != null) {
if (isreset) {
mManager.removeViewImmediate(mView);
mManager.addView(mView, mParams);
}else {
... |
private java.util.ArrayList<calendear.action.Task> filterWithCompleteness(boolean isDone, java.util.ArrayList<calendear.action.Task> dataToFilter) {
java.util.ArrayList<calendear.action.Task> toDisplay = new java.util.ArrayList<calendear.action.Task>();
toDisplay.addAll(dataToFilter);
for (int i = 0; i < (t... | private java.util.ArrayList<calendear.action.Task> filterWithCompleteness(boolean isDone, java.util.ArrayList<calendear.action.Task> dataToFilter) {
java.util.ArrayList<calendear.action.Task> toDisplay = new java.util.ArrayList<calendear.action.Task>();
toDisplay.addAll(dataToFilter);
for (int i = 0; i < (t... |
public int getPartition(hbase.query3.ArticleIDTimestampWritable key, org.apache.hadoop.io.LongWritable value, int numOfPartitions) {
try {
hbase.query3.HBaseCompositeKeyPartitioner.fillFirstAndLastID();
} catch (java.io.IOException e) {
e.printStackTrace();
}
long intervalLength = ((hbas... | public int getPartition(hbase.query3.ArticleIDTimestampWritable key, org.apache.hadoop.io.LongWritable value, int numOfPartitions) {
try {
hbase.query3.HBaseCompositeKeyPartitioner.fillFirstAndLastID();
} catch (java.io.IOException e) {
e.printStackTrace();
}
long intervalLength = ((hbas... |
public boolean onInterceptTouchEvent(android.support.v7.widget.RecyclerView rv, android.view.MotionEvent e) {
android.view.View childView = rv.findChildViewUnder(e.getX(), e.getY());
if (((childView != null) && ((mListener) != null)) && (mGestureDetector.onTouchEvent(e))) {
mListener.onItemClick(childVi... | public boolean onInterceptTouchEvent(android.support.v7.widget.RecyclerView rv, android.view.MotionEvent e) {
android.view.View childView = rv.findChildViewUnder(e.getX(), e.getY());
if (((childView != null) && ((mListener) != null)) && (mGestureDetector.onTouchEvent(e))) {
mListener.onItemClick(childVi... |
private boolean executeAllTasks() {
boolean result = true;
for (matrixstudio.model.Task task : orderedTasks) {
result &= enqueueTask(task);
}
try {
int error = org.jocl.CL.clWaitForEvents(allEvents.length, allEvents);
if (error != 0) {
log.error((("Error waiting for t... | private boolean executeAllTasks() {
boolean result = true;
for (matrixstudio.model.Task task : orderedTasks) {
result &= enqueueTask(task);
}
try {
int error = 0;
if (error != 0) {
log.error((("Error waiting for tasks to complete: " + error) + "."));
retur... |
public boolean showDialog() {
ij.gui.GenericDialog gd = new ij.gui.GenericDialog("De-Interleaver");
gd.addNumericField("How many channels?", nChannels, 0);
gd.addCheckbox("Keep source stack", keep);
gd.showDialog();
if (gd.wasCanceled())
return false;
nChannels = ((int) (gd.getNextN... | public boolean showDialog() {
ij.gui.GenericDialog gd = new ij.gui.GenericDialog("De-Interleaver");
gd.addNumericField("How many channels?", nChannels, 0);
gd.showDialog();
if (gd.wasCanceled())
return false;
nChannels = ((int) (gd.getNextNumber()));
keep = false;
ij.Prefs.set("... |
public void run() {
try {
java.lang.System.out.println("Bin jetzt vorm stream");
inputStream = clientSocket.getInputStream();
inputStreamReader = new java.io.InputStreamReader(inputStream, java.nio.charset.StandardCharsets.UTF_8);
bufferedReader = new java.io.BufferedReader(inputStre... | public void run() {
try {
inputStream = clientSocket.getInputStream();
inputStreamReader = new java.io.InputStreamReader(inputStream, java.nio.charset.StandardCharsets.UTF_8);
bufferedReader = new java.io.BufferedReader(inputStreamReader);
outputStream = clientSocket.getOutputStream(... |
private static void init() {
java.lang.ref.WeakReference<grimhaus.com.G2Dj.Type.Engine.Scene> mainScene = grimhaus.com.G2Dj.Engine.createScene("Main");
Adhoc.Main.createPlayerCamera(mainScene);
Adhoc.Main.createMapCamera(mainScene);
Adhoc.Main.createVisibleGeometry(mainScene);
Adhoc.Main.createColli... | private static void init() {
java.lang.ref.WeakReference<grimhaus.com.G2Dj.Type.Engine.Scene> mainScene = grimhaus.com.G2Dj.Engine.createScene("Main");
Adhoc.Main.createVisibleGeometry(mainScene);
Adhoc.Main.createCollisionGeometry(mainScene);
Adhoc.Main.createTextMeshTest(mainScene);
Adhoc.Main.cre... |
public void removeMasterHost(java.lang.String host, boolean closeGently) throws java.sql.SQLException {
if (this.masterHostList.remove(host)) {
}
for (com.mysql.jdbc.ReplicationConnection c : this.replicationConnections.values()) {
c.removeMasterHost(host, closeGently);
}
} | public void removeMasterHost(java.lang.String host, boolean closeGently) throws java.sql.SQLException {
if (this.masterHostList.remove(host)) {
for (com.mysql.jdbc.ReplicationConnection c : this.replicationConnections.values()) {
c.removeMasterHost(host, closeGently);
}
}
} |
public java.util.List<eu.europeana.uim.store.Collection<java.lang.String>> getCollections(eu.europeana.uim.store.Provider<java.lang.String> provider) {
provider = ((eu.europeana.uim.store.Provider<java.lang.String>) (ensureConsistency(provider)));
java.util.List<eu.europeana.uim.store.Collection<java.lang.Strin... | public java.util.List<java.util.Collection<java.lang.String>> getCollections(eu.europeana.uim.store.Provider<java.lang.String> provider) {
provider = ((eu.europeana.uim.store.Provider<java.lang.String>) (ensureConsistency(provider)));
java.util.List<java.util.Collection<java.lang.String>> res = new java.util.Ar... |
public void success(com.mapzen.pelias.gson.Result result, retrofit.client.Response response) {
java.util.List<com.mapzen.pelias.gson.Feature> features = result.getFeatures();
result.getType();
if ((features == null) && ((features.size()) < 1)) {
android.widget.Toast.makeText(this, "No lat, lng found... | public void success(com.mapzen.pelias.gson.Result result, retrofit.client.Response response) {
java.util.List<com.mapzen.pelias.gson.Feature> features = result.getFeatures();
if ((features == null) || ((features.size()) < 1)) {
android.widget.Toast.makeText(this, "No lat, lng found for address", Toast.L... |
public io.anuke.aabb.Manifold set(io.anuke.aabb.Collider a, io.anuke.aabb.Collider b) {
this.a = a;
this.b = b;
this.e = java.lang.Math.min(a.restitution, b.restitution);
this.sf = 0;
this.df = 0;
this.normal.set(0, 0);
this.penetration = 0;
return this;
} | public io.anuke.aabb.Manifold set(io.anuke.aabb.Collider a, io.anuke.aabb.Collider b) {
this.a = a;
this.b = b;
e = java.lang.Math.min(a.restitution, b.restitution);
sf = 0;
df = 0;
normal.set(0, 0);
penetration = 0;
return this;
} |
private boolean hasValidPageNumbersOnly() {
boolean correct = true;
for (java.lang.String page : pages) {
correct = ((page.matches("[0-9]+")) && ((page.length()) >= 5)) ? true : false;
}
return correct;
} | private boolean hasValidPageNumbersOnly() {
boolean correct = true;
for (java.lang.String page : pages) {
correct = (correct && ((page.matches("[0-9]+")) && ((page.length()) >= 5))) ? true : false;
}
return correct;
} |
public void updateTextView() {
int volume = soundDb();
if (volume > (highestVolume)) {
highValueTextView.setText((volume + " dB"));
highestVolume = volume;
}
if ((volume < (lowestVolume)) || ((lowestVolume) < 0)) {
lowValueTextView.setText((volume + " dB"));
lowestVolume ... | public void updateTextView() {
int volume = soundDb();
if (volume < 0)
return ;
if (volume > (highestVolume)) {
highValueTextView.setText((volume + " dB"));
highestVolume = volume;
}
if (volume < (lowestVolume)) {
lowValueTextView.setText((volume + " dB"));
... |
public final void mount(final java.io.File mountPoint, final boolean blocking) throws java.lang.UnsatisfiedLinkError, net.fusejna.FuseException {
mountLock.lock();
if (isMounted()) {
throw new java.lang.IllegalStateException((((getFuseName()) + " is already mounted at ") + (this.mountPoint)));
}
... | public final void mount(final java.io.File mountPoint, final boolean blocking) throws java.lang.UnsatisfiedLinkError, net.fusejna.FuseException {
mountLock.lock();
if (isMounted()) {
throw new java.lang.IllegalStateException((((getFuseName()) + " is already mounted at ") + (this.mountPoint)));
}
... |
public void test_144_ACLCreateFields(edu.umass.cs.gnsclient.client.util.GuidEntry barneyEntry) {
try {
edu.umass.cs.gnsclient.client.integrationtests.ServerIntegrationTest.client.fieldUpdate(barneyEntry.getGuid(), "cell", "413-555-1234", barneyEntry);
edu.umass.cs.gnsclient.client.integrationtests.S... | public void test_144_ACLCreateFields(edu.umass.cs.gnsclient.client.util.GuidEntry barneyEntry) {
try {
edu.umass.cs.gnsclient.client.integrationtests.ServerIntegrationTest.client.fieldUpdate(barneyEntry.getGuid(), "cell", "413-555-1234", barneyEntry);
edu.umass.cs.gnsclient.client.integrationtests.S... |
public void callApi(java.lang.String toBeSearchedWord) {
com.example.ripu.mydictionary.URLRetriever urlRetriever = new com.example.ripu.mydictionary.URLRetriever();
com.example.ripu.mydictionary.JsonUtil util = new com.example.ripu.mydictionary.JsonUtil();
java.lang.String app_id = APIConstants.app_id;
... | public void callApi(java.lang.String toBeSearchedWord) {
com.example.ripu.mydictionary.URLRetriever urlRetriever = new com.example.ripu.mydictionary.URLRetriever();
com.example.ripu.mydictionary.JsonUtil util = new com.example.ripu.mydictionary.JsonUtil();
java.lang.String app_id = APIConstants.app_id;
... |
public java.util.List<org.eclipse.osee.framework.core.data.ApplicabilityToken> getViewApplicabilityTokens(org.eclipse.osee.framework.core.data.ArtifactId artId, org.eclipse.osee.framework.core.data.BranchId branch) {
java.util.List<org.eclipse.osee.framework.core.data.ApplicabilityToken> result = new java.util.Arra... | public java.util.List<org.eclipse.osee.framework.core.data.ApplicabilityToken> getViewApplicabilityTokens(org.eclipse.osee.framework.core.data.ArtifactId artId, org.eclipse.osee.framework.core.data.BranchId branch) {
java.util.List<org.eclipse.osee.framework.core.data.ApplicabilityToken> result = new java.util.Arra... |
private com.fwgg8547.opentest.Item createItem() {
com.fwgg8547.opentest.Sprite s = new com.fwgg8547.opentest.Sprite(mIdOffset);
com.fwgg8547.opentest.Item it = new com.fwgg8547.opentest.Item();
it.mId = mIdOffset;
it.mGroupId = 1;
it.setSprite(s);
it.setPosition(110.0F, 200.0F, 0.0F, 0.0F);
... | private com.fwgg8547.opentest.Item createItem() {
com.fwgg8547.opentest.Sprite s = new com.fwgg8547.opentest.Sprite(mIdOffset);
com.fwgg8547.opentest.Item it = new com.fwgg8547.opentest.Item();
it.mId = mIdOffset;
it.mGroupId = 1;
it.setSprite(s);
it.setPosition(110.0F, 200.0F, 0.0F, 0.0F);
... |
protected void initiateBackground() {
try {
com.timsu.astrid.C2DMReceiver.register();
java.lang.String authToken = actFmPreferenceService.getToken();
invoker = new com.todoroo.astrid.actfm.sync.ActFmInvoker(authToken);
if (authToken != null) {
performSync();
}
... | protected void initiateBackground() {
try {
com.timsu.astrid.C2DMReceiver.register();
java.lang.String authToken = actFmPreferenceService.getToken();
invoker = new com.todoroo.astrid.actfm.sync.ActFmInvoker(authToken);
if (authToken != null) {
performSync();
}
... |
private void trimHorizVert(int horizLimit, int vertLimit) {
int i = 0;
classifier.CrossSectionPoint p;
while (i < (_points.size())) {
p = _points.get(i);
if (!(isWithinLimits(p))) {
_points.remove(p);
}else {
i++;
}
}
} | private void trimHorizVert(int horizLimit, int vertLimit) {
int i = 0;
classifier.CrossSectionPoint p;
while (i < (_points.size())) {
p = _points.get(i);
if (!(isWithinLimits(p, horizLimit, vertLimit))) {
_points.remove(p);
}else {
i++;
}
}
} |
private void searchTree(java.io.File file, int depth) {
java.io.File[] files = file.listFiles();
java.lang.String _depth = new java.lang.String(new char[depth]).replace(' ', '-');
for (java.io.File _file : files) {
if ((_file.isDirectory()) && (_file != null)) {
java.lang.System.out.prin... | private void searchTree(java.io.File file, int depth) {
java.io.File[] files = file.listFiles();
java.lang.String _depth = new java.lang.String(new char[depth]).replace(' ', '-');
if (files != null) {
for (java.io.File _file : files) {
if (_file.isDirectory()) {
java.lang... |
private final void doMoveOutOfBounds(int[] diff) {
com.google.android.maps.GeoPoint cen = mv.getMapCenter();
android.graphics.Point cenPx = mv.getProjection().toPixels(cen, null);
cenPx.x += diff[0];
cen = mv.getProjection().fromPixels(cenPx.x, cenPx.y);
if (autoBoundSnap) {
aml.snapTo(cen);... | private final void doMoveOutOfBounds(int[] diff) {
com.google.android.maps.GeoPoint cen = mv.getMapCenter();
final android.graphics.Point cenPx = mv.getProjection().toPixels(cen, null);
cenPx.x += diff[0];
cenPx.y += diff[1];
cen = mv.getProjection().fromPixels(cenPx.x, cenPx.y);
if (autoBoundSn... |
public void run() {
int count = 0;
while (count < 100) {
try {
hudson.model.FreeStyleProject project = hudson.plugins.disk_usage.integration.DiskUsageTestUtil.getProject(jenkins, "job");
project.updateNextBuildNumber((107 + count));
project = hudson.plugins.disk_usage... | public void run() {
int count = 0;
while (count < 100) {
try {
hudson.model.FreeStyleProject project = hudson.plugins.disk_usage.integration.DiskUsageTestUtil.prepareProjet(jenkins, "job");
project.updateNextBuildNumber((107 + count));
} catch (java.lang.Exception e) {
... |
public void onOpen(com.google.appinventor.client.explorer.OpenEvent<com.google.appinventor.client.explorer.TreeItem> event) {
com.google.appinventor.client.explorer.TreeItem treeItem = event.getTarget();
if (treeItem != null) {
box.flyoutOpen(true);
java.lang.Object userObject = treeItem.getUser... | public void onOpen(com.google.appinventor.client.explorer.OpenEvent<com.google.appinventor.client.explorer.TreeItem> event) {
com.google.appinventor.client.explorer.TreeItem treeItem = event.getTarget();
if (treeItem != null) {
java.lang.Object userObject = treeItem.getUserObject();
if (userObje... |
public void writeTo(java.io.Writer writer) throws java.io.IOException {
for (java.util.Map.Entry<java.lang.String, java.lang.Object> pref : allPrefs.entrySet()) {
writer.append("user_pref(\"").append(pref.getKey()).append("\", ");
writer.append(valueAsPreference(pref.getValue()).replaceAll("\\\\", "... | public void writeTo(java.io.Writer writer) throws java.io.IOException {
for (java.util.Map.Entry<java.lang.String, java.lang.Object> pref : allPrefs.entrySet()) {
writer.append("user_pref(\"").append(pref.getKey()).append("\", ");
writer.append(valueAsPreference(pref.getValue()));
writer.app... |
public boolean update(java.lang.String id, com.ai.paas.ipaas.search.common.JsonBuilder jsonBuilder) {
if ((com.ai.paas.ipaas.util.StringUtil.isBlank(id)) || (null == jsonBuilder))
return false;
org.elasticsearch.action.update.UpdateResponse response = client.prepareUpdate(indexName, indexName, id).... | public boolean update(java.lang.String id, com.ai.paas.ipaas.search.common.JsonBuilder jsonBuilder) {
if ((com.ai.paas.ipaas.util.StringUtil.isBlank(id)) || (null == jsonBuilder))
return false;
org.elasticsearch.action.update.UpdateResponse response = client.prepareUpdate(indexName, indexName, id).... |
public int getSinkIndex(pb.sim.Asteroid[] asteroids, pb.sim.Asteroid sink) {
for (int i = 0; i < (asteroids.length); i++) {
if ((asteroids[i].id) == (sink.id))
return i;
}
return -1;
} | public int getSinkIndex(pb.sim.Asteroid[] asteroids, long sink) {
for (int i = 0; i < (asteroids.length); i++) {
if ((asteroids[i].id) == sink)
return i;
}
return -1;
} |
public void setParallaxHeader(android.view.View header) {
mHeader = new com.marshalchen.ultimaterecyclerview.UltimateRecyclerView.CustomRelativeWrapper(header.getContext());
mHeader.setLayoutParams(new android.view.ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT))... | public void setParallaxHeader(android.view.View header) {
mHeader = new com.marshalchen.ultimaterecyclerview.UltimateRecyclerView.CustomRelativeWrapper(header.getContext());
mHeader.setLayoutParams(new android.view.ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT))... |
public long getOrgIdByPartyId(long partyId) {
org.shaolin.vogerp.commonmodel.be.PersonalInfoImpl condition = new org.shaolin.vogerp.commonmodel.be.PersonalInfoImpl();
condition.setId(partyId);
java.util.List<org.shaolin.vogerp.commonmodel.be.IPersonalInfo> result = CommonModel.INSTANCE.searchPersonInfo(cond... | public long getOrgIdByPartyId(long partyId) {
if (partyId <= 0) {
throw new java.lang.IllegalArgumentException(("User id isn't correct: " + partyId));
}
org.shaolin.vogerp.commonmodel.be.PersonalInfoImpl condition = new org.shaolin.vogerp.commonmodel.be.PersonalInfoImpl();
condition.setId(partyI... |
public void validate() {
if ((start_time) < 0)
edu.berkeley.path.beats.simulator.utils.BeatsErrorLog.addError("start_time<0 in a time profile");
if ((step_initial_abs) < 0)
edu.berkeley.path.beats.simulator.utils.BeatsErrorLog.addError("step_initial_abs<0 in a time profile");
if ((... | public void validate() {
if ((dtinseconds) <= 0)
edu.berkeley.path.beats.simulator.utils.BeatsErrorLog.addError("dt<=0 in a time profile");
if ((!(java.lang.Double.isInfinite(dtinseconds))) && ((samplesteps) <= 0))
edu.berkeley.path.beats.simulator.utils.BeatsErrorLog.addError("samplesteps<... |
public java.util.List<org.latinolib.eval.CrossValidator.FoldData<T, U>> getFolds() {
return com.google.common.collect.Lists.newArrayList(new java.util.Iterator<org.latinolib.eval.CrossValidator.FoldData<T, U>>() {
private int current = 0;
@java.lang.Override
public boolean hasNext() {
... | public java.util.List<org.latinolib.eval.CrossValidator.FoldData<T, U>> getFolds() {
return com.google.common.collect.Lists.newArrayList(new java.util.Iterator<org.latinolib.eval.CrossValidator.FoldData<T, U>>() {
private int current = 1;
@java.lang.Override
public boolean hasNext() {
... |
public void onCheckedChanged(android.widget.RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.nodown :
mDownIntercept = 0;
break;
case R.id.vgdown1 :
mDownIntercept = 1;
break;
case R.id.vgdown2 :
mDownIntercept = 2;... | public void onCheckedChanged(android.widget.RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.nodown :
mDownIntercept = 0;
break;
case R.id.vgdown1 :
mDownIntercept = 1;
break;
case R.id.vgdown2 :
mDownIntercept = 2;... |
public static void playClipWithVolume(java.lang.String fileName, double volume) {
try {
javafx.scene.media.AudioClip clip = new javafx.scene.media.AudioClip("file:Resources/Sound/");
clip.setVolume(volume);
clip.play();
} catch (java.lang.Exception e) {
java.lang.System.out.print... | public static void playClipWithVolume(java.lang.String fileName, double volume) {
try {
javafx.scene.media.AudioClip clip = new javafx.scene.media.AudioClip(("file:Resources/Sound/" + fileName));
clip.setVolume(volume);
clip.play();
} catch (java.lang.Exception e) {
java.lang.Sys... |
public void testIsTableNewWhenTableNotNew() throws java.lang.Exception {
final inputer.Scanner scanner = new inputer.Scanner();
final engine.models.Table table = new engine.models.Table("005D0A28", 10, 6);
Game.tables.add(table);
final java.lang.String tempString = "Game #142837817463 005D0A28";
fin... | public void testIsTableNewWhenTableNotNew() throws java.lang.Exception {
final inputer.Scanner scanner = new inputer.Scanner();
final engine.models.Table table = new engine.models.Table("005D0A28", 10, 6, null);
Game.tables.add(table);
final java.lang.String tempString = "Game #142837817463 005D0A28";
... |
public void onClick(android.view.View v) {
android.content.Intent sharingIntent = new android.content.Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
java.lang.String shareBody = ((scriptureData.getText()) + " ") + (scriptureData.getCitation());
java.lang.String shareLin... | public void onClick(android.view.View v) {
android.content.Intent sharingIntent = new android.content.Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
java.lang.String shareLink = scriptureData.getLink();
sharingIntent.putExtra(Intent.EXTRA_TEXT, shareLink);
startActi... |
public void setCurrentForm(final com.codename1.impl.android.Form f) {
if ((getCurrentForm()) == null) {
flushGraphics();
}
if (com.codename1.impl.android.InPlaceEditView.isKeyboardShowing()) {
com.codename1.impl.android.AndroidImplementation.stopEditing();
}
super.setCurrentForm(f);
... | public void setCurrentForm(final com.codename1.impl.android.Form f) {
if ((getCurrentForm()) == null) {
flushGraphics();
}
if (com.codename1.impl.android.InPlaceEditView.isKeyboardShowing()) {
com.codename1.impl.android.AndroidImplementation.stopEditing(true);
}
super.setCurrentForm(... |
public Utente getUser(int id) throws UserException {
Utente u = null;
boolean already_in = this.persone.containsKey(id);
if (already_in) {
u = this.persone.get(id);
java.lang.System.out.println(u);
}else {
throw new UserException((("id " + id) + " non presente nella rete sociale"... | public Utente getUser(int id) throws UserException {
Utente u = null;
boolean already_in = this.persone.containsKey(id);
if (already_in) {
u = this.persone.get(id);
}else {
throw new UserException((("id " + id) + " non presente nella rete sociale"));
}
return u;
} |
protected void executeProgram() throws java.lang.Exception {
int numTries = 0;
int maxRetries = 5;
while (true) {
try {
org.broadinstitute.gatk.engine.CommandLineGATK.start(new org.broadinstitute.gatk.engine.CommandLineGATK(), this.programArgs.toArray(new java.lang.String[0]));
}... | protected void executeProgram() throws java.lang.Exception {
int numTries = 0;
int maxRetries = 5;
while (true) {
try {
org.broadinstitute.gatk.engine.CommandLineGATK.start(new org.broadinstitute.gatk.engine.CommandLineGATK(), this.programArgs.toArray(new java.lang.String[0]));
... |
public void testNullNonEmpty() throws java.lang.Throwable {
final java.lang.String SCRIPT_TEXT = (("set hive.support.concurrency = false;\n" + "!set nullemptystring false\n select null from ") + (org.apache.hive.beeline.TestBeeLineWithArgs.tableName)) + " limit 1 ;\n";
final java.lang.String EXPECTED_PATTERN = ... | public void testNullNonEmpty() throws java.lang.Throwable {
final java.lang.String SCRIPT_TEXT = (("set hive.support.concurrency = false;\n" + "!set nullemptystring false\n select null from ") + (org.apache.hive.beeline.TestBeeLineWithArgs.tableName)) + " limit 1 ;\n";
final java.lang.String EXPECTED_PATTERN = ... |
protected java.lang.Void doInBackground(com.cawlfield.topher.servicemusicplayer.PlayListItemBase... pli) {
do {
publishProgress(pli[0].getProgress());
try {
java.lang.Thread.sleep(500);
} catch (java.lang.InterruptedException e) {
}
} while (!(isCancelled()) );
re... | protected java.lang.Void doInBackground(com.cawlfield.topher.servicemusicplayer.PlayListItemBase... pli) {
this.pli = pli[0];
do {
publishProgress();
try {
java.lang.Thread.sleep(500);
} catch (java.lang.InterruptedException e) {
}
} while (!(isCancelled()) );
... |
public boolean addPlayer(com.feed_the_beast.ftbl.api.IForgePlayer player) {
if ((!(hasStatus(player, EnumTeamStatus.MEMBER))) && (hasStatus(player, EnumTeamStatus.INVITED))) {
player.setTeamID(getName());
MinecraftForge.EVENT_BUS.post(new com.feed_the_beast.ftbl.api.events.team.ForgeTeamPlayerJoined... | public boolean addPlayer(com.feed_the_beast.ftbl.api.IForgePlayer player) {
if (hasStatus(player, EnumTeamStatus.INVITED)) {
player.setTeamID(getName());
if (!(hasStatus(player, EnumTeamStatus.MEMBER))) {
MinecraftForge.EVENT_BUS.post(new com.feed_the_beast.ftbl.api.events.team.ForgeTeam... |
public boolean onPreferenceChange(android.preference.Preference preference, java.lang.Object value) {
java.lang.String stringValue = value.toString();
if (preference instanceof android.preference.ListPreference) {
android.preference.ListPreference listPreference = ((android.preference.ListPreference) (p... | public boolean onPreferenceChange(android.preference.Preference preference, java.lang.Object value) {
java.lang.String stringValue = value.toString();
if (preference instanceof android.preference.ListPreference) {
android.preference.ListPreference listPreference = ((android.preference.ListPreference) (p... |
public double[] eval(double[] input, double drop_out_ratio, int maxOutk) {
double[] output = super.eval(input, drop_out_ratio, maxOutk);
hex.genmodel.algos.deeplearning.ActivationUtils.applyDropout(output, drop_out_ratio, input.length);
return output;
} | public double[] eval(double[] input, double drop_out_ratio, int maxOutk) {
double[] output = super.eval(input, drop_out_ratio, maxOutk);
hex.genmodel.algos.deeplearning.ActivationUtils.applyDropout(output, drop_out_ratio, output.length);
return output;
} |
public void run() {
listItem = new java.util.ArrayList<>();
com.poc.evault.utils.DocumentDataSource documentDataSource = new com.poc.evault.utils.DocumentDataSource(this);
documentDataSource.open();
listItem = documentDataSource.getAllDocuments();
documentDataSource.close();
if ((listItem.size()... | public void run() {
listItem = new java.util.ArrayList<>();
com.poc.evault.utils.DocumentDataSource documentDataSource = new com.poc.evault.utils.DocumentDataSource(this);
documentDataSource.open();
listItem = documentDataSource.getAllDocuments();
documentDataSource.close();
if ((listItem.size()... |
public void setValue(double aVal) {
super.setValue(aVal);
if (null != (iSeries)) {
final java.lang.Double newY = com.ivli.roim.controls.XYSeriesUtilities.getNearestY(aVal, iSeries);
if (null != (iLink)) {
iLink.setValue(newY);
iLink.setLabel(java.lang.String.format(com.iv... | public void setValue(double aVal) {
super.setValue(aVal);
if (null != (iSeries)) {
final java.lang.Double newY = com.ivli.roim.controls.XYSeriesUtilities.getNearestY(iSeries, aVal);
if (null != (iLink)) {
iLink.setValue(newY);
iLink.setLabel(java.lang.String.format(com.iv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.