buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public static byte[] bufferedImageToByteArray(java.awt.image.BufferedImage data) {
byte[] bytes = null;
try {
java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
javax.imageio.ImageIO.write(data, "jpg", baos);
bytes = baos.toByteArray();
return bytes;
} ... | public static byte[] bufferedImageToByteArray(java.awt.image.BufferedImage data, java.lang.String format) {
byte[] bytes = null;
try {
java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
javax.imageio.ImageIO.write(data, format, baos);
bytes = baos.toByteArray();
... |
private java.lang.String processJson(java.lang.String json) {
java.lang.String client = "";
if ((client = retrieveClientId(json)) != null) {
clientId = client;
activate();
}
if ((retrieveConnAndLikes(json)) != null) {
status = ServerConstants.STATUS_ONLINE;
return ServerC... | private java.lang.String processJson(java.lang.String json) {
java.lang.String client = "";
if ((client = retrieveClientId(json)) != null) {
status = ServerConstants.STATUS_ONLINE;
clientId = client;
activate();
}
if ((retrieveConnAndLikes(json)) != null) {
status = Serve... |
public void startEffect() {
oldBehaviours = new java.util.HashMap<>();
for (com.github.fishio.Entity e : getPField().getEntities()) {
if (e instanceof com.github.fishio.EnemyFish) {
com.github.fishio.EnemyFish fish = ((com.github.fishio.EnemyFish) (e));
oldBehaviours.put(fish, fi... | public void startEffect() {
for (com.github.fishio.Entity e : getPField().getEntities()) {
if (e instanceof com.github.fishio.EnemyFish) {
com.github.fishio.EnemyFish fish = ((com.github.fishio.EnemyFish) (e));
oldBehaviours.put(fish, fish.getBehaviour());
fish.setBehavio... |
public boolean alreadyExist(com.softserve.if072.common.model.Store store, com.softserve.if072.common.model.User user) {
com.softserve.if072.common.model.Store existStore = getStoreByNameAndUserId(store, user);
if ((existStore != null) && (existStore.isEnabled())) {
return (store.getId()) != (existStore.... | public boolean alreadyExist(com.softserve.if072.common.model.Store store, com.softserve.if072.common.model.User user) {
com.softserve.if072.common.model.Store existStore = getStoreByNameAndUserId(store, user);
if ((existStore != null) && (existStore.isEnabled())) {
return (store.getId()) != (existStore.... |
public void deleteNutzer(java.lang.String eMail) {
try {
open();
preparedStatement = connect.prepareStatement("DELETE FROM Nutzer WHERE eMail = ?");
preparedStatement.setString(1, eMail);
preparedStatement.executeUpdate();
} catch (java.sql.SQLException e) {
java.lang.Sys... | public void deleteNutzer(final java.lang.String eMail) {
try {
open();
this.preparedStatement = this.connect.prepareStatement("DELETE FROM Nutzer WHERE eMail = ?");
this.preparedStatement.setString(1, eMail);
this.preparedStatement.executeUpdate();
} catch (final java.sql.SQLExce... |
public void run() {
if (!(mcMMO.getPlaceStore().isTrue(movedBlock))) {
return ;
}
if (!(com.gmail.nossr50.util.BlockUtils.isPistonPiece(movedBlock.getState()))) {
return ;
}
mcMMO.getPlaceStore().setFalse(movedBlock);
mcMMO.getPlaceStore().setTrue(movedBlock.getRelative(direction... | public void run() {
if (!(mcMMO.getPlaceStore().isTrue(movedBlock.getRelative(direction)))) {
return ;
}
if (!(com.gmail.nossr50.util.BlockUtils.isPistonPiece(movedBlock.getState()))) {
return ;
}
mcMMO.getPlaceStore().setFalse(movedBlock.getRelative(direction));
mcMMO.getPlaceSt... |
public void uitstappen(int t) {
moetUitstappen = false;
if ((aantalGenomenOverstappen) == (reis.getAantalOverstappen())) {
reis.addTijd(treinsimulator.Klok.decrementeer(treinsimulator.Klok.getTijd(), beginTijd));
}else {
juisteTrein = zoekTrein();
vtijd = juisteTrein.getVtijd();
... | public void uitstappen(int t) {
if ((vtijd) == t) {
moetUitstappen = false;
if ((aantalGenomenOverstappen) == (reis.getAantalOverstappen())) {
reis.addTijd(treinsimulator.Klok.decrementeer(treinsimulator.Klok.getTijd(), beginTijd));
}else {
juisteTrein = zoekTrein();
... |
private boolean etesVousPlacer() {
int nombreJoueur = listeJoueur.size();
int nbCaseA1 = 0;
for (new_idea.Case bouton : listeComposantPlateau) {
if ((bouton.getValue()) == '1') {
nbCaseA1++;
}
}
java.lang.System.out.println((nombreJoueur == (nbCaseA1 + 1)));
return no... | private boolean etesVousPlacer() {
int nombreJoueur = listeJoueur.size();
int nbCaseA1 = 0;
for (new_idea.Case bouton : listeComposantPlateau) {
if ((bouton.getValue()) == '1') {
nbCaseA1++;
}
}
return nombreJoueur == (nbCaseA1 + 1);
} |
public void setPosition() {
lastx = px;
lasty = py;
java.lang.System.out.println((((((direction) + ", ") + (px)) + ", ") + (py)));
switch (direction) {
case "u" :
py -= speed;
case "d" :
py += speed;
case "l" :
px -= speed;
case "r" :
... | public void setPosition() {
lastx = px;
lasty = py;
switch (direction) {
case "u" :
py -= speed;
break;
case "d" :
py += speed;
break;
case "l" :
px -= speed;
break;
case "r" :
px += speed;
... |
private java.util.List<java.lang.String> getConsumesList(com.apporiented.rest.apidoc.factory.impl.RequestMapping classMapping, com.apporiented.rest.apidoc.factory.impl.RequestMapping methodMapping) {
java.util.List<java.lang.String> consumes;
if ((methodMapping.produces().length) > 0) {
consumes = java.... | private java.util.List<java.lang.String> getConsumesList(com.apporiented.rest.apidoc.factory.impl.RequestMapping classMapping, com.apporiented.rest.apidoc.factory.impl.RequestMapping methodMapping) {
java.util.List<java.lang.String> consumes;
if ((methodMapping.consumes().length) > 0) {
consumes = java.... |
public void testClickNssfButton() throws java.lang.InterruptedException {
driver = generic.LoginGeneral.callClerkLoginAction();
java.lang.Thread.sleep(2000);
java.lang.System.out.println("about to click the NHIF Card link\n");
pages.MenuBarToggle clicknhif = org.openqa.selenium.support.PageFactory.initE... | public void testClickNssfButton() throws java.lang.InterruptedException {
driver = generic.LoginGeneral.callClerkLoginAction();
java.lang.Thread.sleep(2000);
java.lang.System.out.println("about to click the NHIF Card link\n");
pages.MenuBarToggle clicknhif = org.openqa.selenium.support.PageFactory.initE... |
private synchronized void occupyFork(com.epam.lab.philosophers.synch.Fork fork) {
synchronized(fork) {
while (fork.isOccupied()) {
java.lang.System.out.println((("Philosopher (" + (this.id)) + ") is thinking"));
try {
this.wait(com.epam.lab.philosophers.synch.Philosop... | private void occupyFork(com.epam.lab.philosophers.synch.Fork fork) {
synchronized(fork) {
while (fork.isOccupied()) {
java.lang.System.out.println((("Philosopher (" + (this.id)) + ") is thinking"));
try {
fork.wait(com.epam.lab.philosophers.synch.Philosopher.TIMEOUT);... |
public void calcMiddle() {
double sum = 0;
for (double i = ((minInt) + (getIncrement())) / 2.0; (roundNumber(i)) < (maxInt); i += getIncrement()) {
sum += (getIncrement()) * (calcEquation(i));
addTextToSpreadsheet(roundNumber(i), calcEquation(i));
}
setAnswer(sum);
} | public void calcMiddle() {
double sum = 0;
for (double i = ((minInt) + (getIncrement())) / 2.0; (roundNumber(i)) < (maxInt); i += getIncrement()) {
sum += (getIncrement()) * (calcEquation(i));
addTextToSpreadsheet(i, calcEquation(i));
}
setAnswer(sum);
} |
public static void main(java.lang.String[] args) {
edu.ksu.operatingsystems.javaos.driver.DriverType driverType = edu.ksu.operatingsystems.javaos.driver.DriverType.FIFO;
edu.ksu.operatingsystems.javaos.driver.OSDriver driver = new edu.ksu.operatingsystems.javaos.driver.OSDriver(driverType);
edu.ksu.operatin... | public static void main(java.lang.String[] args) {
edu.ksu.operatingsystems.javaos.driver.DriverType driverType = edu.ksu.operatingsystems.javaos.driver.DriverType.FIFO;
edu.ksu.operatingsystems.javaos.driver.OSDriver driver = new edu.ksu.operatingsystems.javaos.driver.OSDriver(driverType);
edu.ksu.operatin... |
public boolean login(com.univ.alma.middleware.ChatClientInterface a, java.lang.String topic) throws java.rmi.RemoteException {
java.lang.System.out.println(((a.getName()) + " s'est connecté...."));
a.tell("Tu t\'es connect\u00e9 avec succ\u00e8s.\n");
publish(((a.getName()) + " vient de ce connecté."));
... | public boolean login(com.univ.alma.middleware.ChatClientInterface a) throws java.rmi.RemoteException {
java.lang.System.out.println(((a.getName()) + " s'est connecté...."));
a.tell("Tu t\'es connect\u00e9 avec succ\u00e8s.\n");
publish(((a.getName()) + " vient de ce connecté."));
v.add(a);
return t... |
public void testGamePlayMovesFromStart() {
java.lang.String expectedState = "0|2|2|1|11|10|10|3|8|8|7|7|1|0|2";
kalaha.makeMove(0).makeMove(1).makeMove(4).makeMove(2).makeMove(5);
java.lang.System.out.println(kalaha.getBoardState());
org.junit.Assert.assertEquals(expectedState, kalaha.getBoardState());
... | public void testGamePlayMovesFromStart() {
java.lang.String expectedState = "0|2|2|1|11|10|10|3|8|8|7|7|1|0|2";
kalaha.makeMove(0).makeMove(1).makeMove(4).makeMove(2).makeMove(5);
java.lang.System.out.println(kalaha.getBoardState());
org.junit.Assert.assertEquals(expectedState, kalaha.getBoardState());
... |
public java.util.ArrayList getNodeArrayList() {
javax.swing.tree.TreeModel treeModel = tree.getModel();
nodeArrayList = new java.util.ArrayList();
nodeArrayList.add(treeModel.getRoot());
for (int i = 0; i < (treeModel.getChildCount(rootNode)); i++) {
nodeArrayList.add(treeModel.getChild(rootNode... | public java.util.ArrayList getNodeArrayList() {
javax.swing.tree.TreeModel treeModel = tree.getModel();
nodeArrayList = new java.util.ArrayList();
for (int i = 0; i < (treeModel.getChildCount(rootNode)); i++) {
nodeArrayList.add(treeModel.getChild(rootNode, i));
}
return nodeArrayList;
} |
public void getInstanceInfo(java.lang.String id) {
if (!(isConnected))
return ;
it.polimi.modaclouds.scalingrules.utils.CloudMLNew.logger.debug("Retrieving the information about the instance {}...", id);
org.cloudml.facade.commands.CloudMlCommand cmd = fcommand.snapshot((("/componentInstances[i... | private void getInstanceInfo(java.lang.String id) {
if ((id == null) || (!(isConnected)))
return ;
it.polimi.modaclouds.scalingrules.utils.CloudMLNew.logger.debug("Retrieving the information about the instance {}...", id);
org.cloudml.facade.commands.CloudMlCommand cmd = fcommand.snapshot((("/c... |
public int getIndexOfCurrentMonthInSemester() {
java.util.Calendar current = java.util.Calendar.getInstance();
int currentMonthOfYear = current.get(java.util.Calendar.MONTH);
int index = ((11 - 7) + currentMonthOfYear) + 1;
index = (index > 10) ? index - 12 : index;
if (index <= 10) {
return... | public int getIndexOfCurrentMonthInSemester() {
java.util.Calendar current = java.util.Calendar.getInstance();
int currentMonthOfYear = current.get(java.util.Calendar.MONTH);
int index = ((11 - 7) + currentMonthOfYear) + 1;
index = (index > 10) ? index - 12 : index;
if (index <= 10) {
return... |
public void onItemSelected(android.widget.AdapterView<?> parent, android.view.View view, int position, long id) {
switch (parent.getId()) {
case R.id.spinnerKontotyp :
java.lang.String klartext = ((java.lang.String) (parent.getItemAtPosition(position)));
kt = de.aw.enums.Kontotyp.con... | public void onItemSelected(android.widget.AdapterView<?> parent, android.view.View view, int position, long id) {
switch (parent.getId()) {
case R.id.spinnerKontotyp :
java.lang.String klartext = ((java.lang.String) (parent.getItemAtPosition(position)));
kt = de.aw.enums.Kontotyp.con... |
public void test_move_piece_updates_piece_and_board() {
com.ciaran.upskill.chessgame.domain.BoardCell finish = new com.ciaran.upskill.chessgame.domain.BoardCell(2, 3);
try {
chessPiece.move(chessBoard, finish);
} catch (com.ciaran.upskill.chessgame.exceptions.IllegalMoveException e) {
e.prin... | public void test_move_piece_updates_piece_and_board() {
com.ciaran.upskill.chessgame.domain.BoardCell finish = new com.ciaran.upskill.chessgame.domain.BoardCell(2, 3);
try {
chessPiece.move(chessBoard, finish);
} catch (com.ciaran.upskill.chessgame.exceptions.IllegalMoveException e) {
e.prin... |
public void onLoad(javassist.ClassPool pool, java.lang.String ctClass) throws javassist.CannotCompileException, javassist.NotFoundException {
javassist.CtClass cc = pool.get(ctClass);
cc.setModifiers(java.lang.reflect.Modifier.PUBLIC);
boolean javassist = ctClass.contains("javassist");
boolean profiler ... | public void onLoad(javassist.ClassPool pool, java.lang.String ctClass) throws javassist.CannotCompileException, javassist.NotFoundException {
javassist.CtClass cc = pool.get(ctClass);
cc.setModifiers(java.lang.reflect.Modifier.PUBLIC);
boolean javassist = ctClass.contains("javassist");
boolean profiler ... |
public void addTask(utils.Event event) {
int slot;
int range;
int i;
if (checkTimeSlot(event)) {
(numOfSlot)++;
slot = convertIndex(convertTime(event.getStartDateTime()));
range = convertIndex(convertTime(event.getEndDateTime()));
for (i = slot; i < range; i++) {
... | public void addTask(utils.Event event) {
int slot;
int range;
int i;
(numOfSlot)++;
slot = convertIndex(convertTime(event.getStartDateTime()));
range = convertIndex(convertTime(event.getEndDateTime()));
for (i = slot; i < (range + 1); i++) {
timeSlot.get(i).setTime(true, event);
... |
public void visitBinaryNode(nez.ast.jcode.JCodeTree node) {
nez.ast.jcode.JCodeTree left = node.get(0);
nez.ast.jcode.JCodeTree right = node.get(1);
node.setType(typeInfferBinary(left, right));
this.visit(left);
this.visit(right);
this.mBuilder.callStaticMethod(nez.ast.jcode.JCodeOperator.class,... | public void visitBinaryNode(nez.ast.jcode.JCodeTree node) {
nez.ast.jcode.JCodeTree left = node.get(0);
nez.ast.jcode.JCodeTree right = node.get(1);
this.visit(left);
this.visit(right);
node.setType(typeInfferBinary(node, left, right));
this.mBuilder.callStaticMethod(nez.ast.jcode.JCodeOperator.... |
public static long fib(long n) {
long result = 0;
long prev = 0;
long next = 1;
for (long i = 1; i < n; ++i) {
result = prev + next;
prev = next;
next = result;
}
return result;
} | public static long fib(long n) {
if (n < 0)
n = -n;
if (n == 0) {
return 0;
}
if (n == 1) {
return 1;
}
long result = 1;
long prev = 0;
long next = 1;
for (long i = 1; i < n; ++i) {
result = prev + next;
prev = next;
next = result;... |
public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException {
javax.servlet.http.HttpServletRequest request = ((javax.servlet.http.HttpServletRequest) (req));
javax.servlet.http.HttpSession... | public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException {
javax.servlet.http.HttpServletRequest request = ((javax.servlet.http.HttpServletRequest) (req));
javax.servlet.http.HttpSession... |
public java.lang.String get_identity(java.lang.String authtoken, java.lang.String authurl) throws org.json.simple.parser.ParseException {
java.lang.String newurl1 = authurl.replace("tokens", "users");
java.lang.String newurl = newurl1.replace("5000", "35357");
java.lang.String jsonout;
jsonout = rest_co... | public java.lang.String get_identity(java.lang.String authtoken, java.lang.String authurl) throws org.json.simple.parser.ParseException {
java.lang.String newurl1 = authurl.replace("tokens", "users");
java.lang.String newurl = newurl1.replace("5000", "35357");
java.lang.String jsonout;
jsonout = rest_co... |
public static Controller.Player getBestPlayer(java.util.ArrayList<Controller.Player> list) {
Controller.Player res = list.get(0);
double score = Controller.CreateSelection.getPlayerScore(res);
for (int i = 0; i < (list.size()); i++) {
if ((Controller.CreateSelection.getPlayerScore(list.get(i))) > sc... | private static Controller.Player getBestPlayer(java.util.ArrayList<Controller.Player> list) {
Controller.Player res = list.get(0);
double score = Controller.CreateSelection.getPlayerScore(res);
for (int i = 0; i < (list.size()); i++) {
if ((Controller.CreateSelection.getPlayerScore(list.get(i))) > s... |
public edu.hawaii.its.holiday.controller.WsSubject[] getMembers(@org.springframework.web.bind.annotation.RequestParam
java.lang.String grouping, @org.springframework.web.bind.annotation.RequestParam
java.lang.String username) {
edu.hawaii.its.holiday.controller.WsSubjectLookup wsSubjectLookup = new edu.hawaii.its.h... | public edu.hawaii.its.holiday.controller.WsSubject[] getMembers(@org.springframework.web.bind.annotation.RequestParam
java.lang.String grouping, @org.springframework.web.bind.annotation.RequestParam
java.lang.String username) {
edu.hawaii.its.holiday.controller.WsSubjectLookup wsSubjectLookup = new edu.hawaii.its.h... |
private void newLevel() {
data.Data.fileChanged = false;
pekkakana.PK2Sprite psprite = new pekkakana.PK2Sprite("rooster.spr");
data.Data.map = new pekkakana.PK2Map();
Data.map.addSprite(psprite, psprite.filename);
sp.setList();
data.Data.currentFile = null;
data.Data.selectedTile = 0;
ms... | private void newLevel() {
data.Data.fileChanged = false;
pekkakana.PK2Sprite psprite = new pekkakana.PK2Sprite("rooster.spr");
data.Data.map = new pekkakana.PK2Map();
Data.map.addSprite(psprite, psprite.filename);
sp.setList();
data.Data.currentFile = null;
data.Data.selectedTile = 0;
ms... |
private void setPrefferedWindowSize() {
if ((env.containsProperty(Constants.DEFAULT_WINDOW_HEIGHT)) && (env.containsProperty(Constants.DEFAULT_WINDOW_WIDTH))) {
int height = env.getProperty(Constants.DEFAULT_WINDOW_HEIGHT, java.lang.Integer.class).intValue();
int width = env.getProperty(Constants.DE... | private void setPrefferedWindowSize() {
if ((env.containsProperty(Constants.DEFAULT_WINDOW_HEIGHT)) && (env.containsProperty(Constants.DEFAULT_WINDOW_WIDTH))) {
java.lang.Integer height = env.getProperty(Constants.DEFAULT_WINDOW_HEIGHT, java.lang.Integer.class);
java.lang.Integer width = env.getProp... |
private java.util.ArrayList<com.bam.GESTIBANKBAM.model.Employe> populateDummyConseillers(java.util.List<com.bam.GESTIBANKBAM.model.Personne> personnes, int count) {
java.util.ArrayList<com.bam.GESTIBANKBAM.model.Employe> agts = new java.util.ArrayList<com.bam.GESTIBANKBAM.model.Employe>();
int idx = 0;
fina... | private java.util.ArrayList<com.bam.GESTIBANKBAM.model.Employe> populateDummyConseillers(java.util.List<com.bam.GESTIBANKBAM.model.Personne> personnes, int count) {
java.util.ArrayList<com.bam.GESTIBANKBAM.model.Employe> agts = new java.util.ArrayList<com.bam.GESTIBANKBAM.model.Employe>();
final int len = perso... |
public static com.yarolegovich.wellsql.WellCursor<org.wordpress.android.fluxc.model.MediaModel> getImagesWithStates(org.wordpress.android.fluxc.model.SiteModel site, java.util.List<java.lang.String> uploadStates) {
return com.yarolegovich.wellsql.WellSql.select(org.wordpress.android.fluxc.model.MediaModel.class).wh... | public static com.yarolegovich.wellsql.WellCursor<org.wordpress.android.fluxc.model.MediaModel> getImagesWithStates(org.wordpress.android.fluxc.model.SiteModel site, java.util.List<java.lang.String> uploadStates) {
return com.yarolegovich.wellsql.WellSql.select(org.wordpress.android.fluxc.model.MediaModel.class).wh... |
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... |
protected seedu.taskmanager.commons.core.Config initConfig(java.lang.String configFilePath) {
seedu.taskmanager.commons.core.Config config = super.initConfig(configFilePath);
config.setAppTitle(seedu.taskmanager.TestApp.APP_TITLE);
try {
config.setTaskManagerFilePath(saveFileLocation);
} catch (... | protected seedu.taskmanager.commons.core.Config initConfig(java.lang.String configFilePath) {
seedu.taskmanager.commons.core.Config config = super.initConfig(configFilePath);
config.setAppTitle(seedu.taskmanager.TestApp.APP_TITLE);
config.setTaskManagerFilePath(saveFileLocation);
config.setUserPrefsFile... |
public void addSN(com.babyandi.stephnoutsa.babyandi.SpecialNeed specialNeed) {
android.content.ContentValues values = new android.content.ContentValues();
values.put(com.babyandi.stephnoutsa.babyandi.MyDBHandler.SN_COLUMN_HIV, java.lang.String.valueOf(specialNeed.getHiv()));
values.put(com.babyandi.stephnou... | public void addSN(com.babyandi.stephnoutsa.babyandi.SpecialNeed specialNeed) {
android.content.ContentValues values = new android.content.ContentValues();
values.put(com.babyandi.stephnoutsa.babyandi.MyDBHandler.SN_COLUMN_HIV, java.lang.String.valueOf(specialNeed.getHiv()));
values.put(com.babyandi.stephnou... |
public void setUp() {
mockModel = org.mockito.Mockito.mock(ch.imedias.rsccfx.model.Rscc.class);
supporterHelper = new ch.imedias.rsccfx.model.xml.SupporterHelper(mockModel);
java.lang.String pathToDefaultSupporters = Rscc.REMOVE_FILE_IN_PATH.apply(getClass().getClassLoader().getResource(Rscc.DEFAULT_SUPPORT... | public void setUp() {
mockModel = org.mockito.Mockito.mock(ch.imedias.rsccfx.model.Rscc.class);
supporterHelper = new ch.imedias.rsccfx.model.xml.SupporterHelper(mockModel);
java.lang.String pathToDefaultSupporters = Rscc.REMOVE_FILE_IN_PATH.apply(getClass().getClassLoader().getResource(Rscc.DEFAULT_SUPPORT... |
public void showNewTweetPopup() {
android.view.View activityViewRoot = ((android.view.ViewGroup) (this.getView().findViewById(R.id.listView)));
if (!(popupWindow.isShowing())) {
android.view.View v = mListView.getChildAt(0);
int top = (v == null) ? 0 : v.getTop();
popupWindow.showAtLocat... | public void showNewTweetPopup() {
android.view.View view = this.getView();
if (view != null) {
android.view.View activityViewRoot = view.findViewById(R.id.listView);
if (!(popupWindow.isShowing())) {
android.view.View v = mListView.getChildAt(0);
int top = (v == null) ? 0... |
public void update(float delta) {
if (!(player.isAlive())) {
setCurrentState(new com.ecam.tatchi.state.GameOverState(((playerScore) / 100)));
}
playerScore += 1;
if ((((playerScore) % 500) == 0) && ((enemySpeed) < 1000)) {
enemySpeed *= 1.5;
shootSpeed = (enemySpeed) * 2;
... | public void update(float delta) {
if (!(player.isAlive())) {
setCurrentState(new com.ecam.tatchi.state.GameOverState(((playerScore) / 100)));
}
playerScore += 1;
if ((((playerScore) % 500) == 0) && ((enemySpeed) < 1000)) {
enemySpeed *= 1.5;
shootSpeed = (enemySpeed) * 2;
... |
public synchronized void setNewData(DATA newData, melnorme.lang.utils.concurrency.ConcurrentlyDerivedData.DataUpdateTask<DATA> updateTask) {
if ((latestUpdateTask) != updateTask) {
melnorme.lang.utils.concurrency.ConcurrentlyDerivedData.assertTrue(updateTask.isCancelled());
}else {
latestUpdateT... | public synchronized void setNewData(DATA newData, melnorme.lang.utils.concurrency.ConcurrentlyDerivedData.DataUpdateTask<DATA> updateTask) {
if ((latestUpdateTask) != updateTask) {
melnorme.lang.utils.concurrency.ConcurrentlyDerivedData.assertTrue(updateTask.isCancelled());
}else {
try {
... |
protected static void replaceDistinctWithGroupBy(java.lang.StringBuilder sql) {
int distinctIndex = sql.indexOf(org.hibernate.dialect.SQLServer2005Dialect.DISTINCT);
int selectEndIndex = sql.indexOf(org.hibernate.dialect.SQLServer2005Dialect.FROM);
if ((distinctIndex > 0) && (distinctIndex < selectEndIndex)... | protected void replaceDistinctWithGroupBy(java.lang.StringBuilder sql) {
int distinctIndex = sql.indexOf(org.hibernate.dialect.SQLServer2005Dialect.DISTINCT);
int selectEndIndex = sql.indexOf(org.hibernate.dialect.SQLServer2005Dialect.FROM);
if ((distinctIndex > 0) && (distinctIndex < selectEndIndex)) {
... |
private float calcX(int i) {
return (((((getWidth()) - (getPaddingRight())) - (getPaddingLeft())) / ((mDataSet.size()) - 1)) * i) + (getPaddingLeft());
} | private float calcX(int i) {
return (((((getWidth()) - (getPaddingRight())) - (getPaddingLeft())) / ((mDataSet.size()) - 1.0F)) * i) + (getPaddingLeft());
} |
public void addTaskToGeofenceList(de.unima.pc2016.taskloc.application.database.TaskDataObject tdo) {
for (de.unima.pc2016.taskloc.application.database.LocationDataObject locationDataObject : tdo.getLocations()) {
mGeofenceList.add(new com.google.android.gms.location.Geofence.Builder().setRequestId(java.lang... | public void addTaskToGeofenceList(de.unima.pc2016.taskloc.application.database.TaskDataObject tdo) {
if ((tdo.getLocations()) == null)
return ;
for (de.unima.pc2016.taskloc.application.database.LocationDataObject locationDataObject : tdo.getLocations()) {
mGeofenceList.add(new com.google.an... |
private void pickUpList() {
solitaire.Solitaire.tmpList.clear();
solitaire.Card tmpCard;
for (int j = 0; j < (solitaire.Solitaire.numOfChosenCard); j++) {
tmpCard = solitaire.Solitaire.allPiles[solitaire.Solitaire.choosenDeck].pop();
solitaire.Solitaire.tmpList.add(tmpCard);
java.lan... | private void pickUpList() {
solitaire.Solitaire.tmpList.clear();
solitaire.Card tmpCard;
for (int j = 0; j < (solitaire.Solitaire.numOfChosenCard); j++) {
tmpCard = solitaire.Solitaire.allPiles[solitaire.Solitaire.choosenDeck].pop();
solitaire.Solitaire.tmpList.add(tmpCard);
}
} |
private java.lang.String getMemoryCacheKey() {
return new java.lang.StringBuilder().append("#w").append(minWidth).append("#h").append(minHeight).append("#W").append(maxWidth).append("#H").append(maxHeight).append("#S").append(scaleType.ordinal()).append(url).toString();
} | public java.lang.String getMemoryCacheKey() {
return new java.lang.StringBuilder().append("#w").append(minWidth).append("#h").append(minHeight).append("#W").append(maxWidth).append("#H").append(maxHeight).append("#S").append(scaleType.ordinal()).append(url).toString();
} |
public static void waitForPageToLoad(final org.openqa.selenium.WebDriver webDriver2) {
try {
final int halfASecond = 500;
java.lang.Thread.sleep((10 * halfASecond));
if (!(com.leonarduk.web.SeleniumUtils.isInternetAvailable())) {
com.leonarduk.web.BaseSeleniumPage.LOGGER.warn(("n... | public static void waitForPageToLoad(final org.openqa.selenium.WebDriver webDriver2) {
try {
final int halfASecond = 500;
java.lang.Thread.sleep((10 * halfASecond));
if (!(com.leonarduk.web.SeleniumUtils.isInternetAvailable())) {
com.leonarduk.web.BaseSeleniumPage.LOGGER.warn(("n... |
public void run() {
try {
javax.swing.UIManager.setLookAndFeel(new org.pushingpixels.substance.api.skin.SubstanceGraphiteGlassLookAndFeel());
} catch (java.lang.Exception e) {
java.lang.System.out.println("Substance Graphite failed to initialize");
}
try {
javax.swing.UIManager.s... | public void run() {
try {
javax.swing.UIManager.setLookAndFeel(new org.pushingpixels.substance.api.skin.SubstanceGraphiteGlassLookAndFeel());
} catch (java.lang.Exception e) {
java.lang.System.out.println("Substance Graphite failed to initialize");
}
try {
javax.swing.UIManager.s... |
public void checkoutFiles(java.util.List<java.nio.file.Path> filePaths) throws org.eclipse.jgit.api.errors.GitAPIException {
elegit.Git git = new elegit.Git(this.repo);
elegit.CheckoutCommand checkout = git.checkout().setStartPoint("HEAD");
for (java.nio.file.Path filePath : filePaths)
checkout.addP... | public void checkoutFiles(java.util.List<java.nio.file.Path> filePaths) throws org.eclipse.jgit.api.errors.GitAPIException {
elegit.Git git = new elegit.Git(this.repo);
elegit.CheckoutCommand checkout = git.checkout();
for (java.nio.file.Path filePath : filePaths)
checkout.addPath(filePath.toString(... |
public org.support.project.web.entity.GroupsEntity getGroup(java.lang.Integer groupId, org.support.project.web.bean.LoginedUser loginedUser) {
org.support.project.web.dao.GroupsDao groupsDao = org.support.project.web.dao.GroupsDao.get();
org.support.project.web.entity.GroupsEntity group;
if (loginedUser.isA... | public org.support.project.web.entity.GroupsEntity getGroup(java.lang.Integer groupId, org.support.project.web.bean.LoginedUser loginedUser) {
org.support.project.web.dao.GroupsDao groupsDao = org.support.project.web.dao.GroupsDao.get();
org.support.project.web.entity.GroupsEntity group;
if (loginedUser.isA... |
private int calculateDiscardNum() {
if ((model) == null)
return 0;
java.util.ArrayList<model.Player> players = model.getPlayers();
int halfcards = (thisplayer.getResources().getSize()) / 2;
java.lang.System.out.println(("DISCARD:max discard num= " + halfcards));
return halfcards;
} | private int calculateDiscardNum() {
if ((model) == null)
return 0;
java.util.ArrayList<model.Player> players = model.getPlayers();
int halfcards = (thisplayer.getResources().getSize()) / 2;
return halfcards;
} |
public java.util.List<java.lang.Object[]> getTransactionsReport(statistics.model.Account account, java.util.Date startDate, java.util.Date endDate, statistics.model.enums.TransactionType[] transactionTypes, statistics.model.enums.PlanFactType... planFactTypes) {
return transactionManager.getTransactionsReport(accou... | public java.util.List<java.lang.Object[]> getTransactionsReport(statistics.model.Account account, java.util.Date startDate, java.util.Date endDate, statistics.model.enums.TransactionType[] transactionTypes, statistics.model.enums.PlanFactType... planFactTypes) {
return transactionManager.getTransactionsReport(accou... |
public void editRecipe2() {
coffeeMaker.addRecipe(coffee);
edu.pjatk.inn.coffeemaker.impl.Recipe newCoffee = new edu.pjatk.inn.coffeemaker.impl.Recipe();
newCoffee.setName("Coffee");
newCoffee.setPrice(50);
newCoffee.setAmtCoffee(3);
newCoffee.setAmtMilk(1);
newCoffee.setAmtSugar(1);
new... | public void editRecipe2() {
coffeeMaker.addRecipe(coffee);
edu.pjatk.inn.coffeemaker.impl.Recipe newCoffee = new edu.pjatk.inn.coffeemaker.impl.Recipe();
newCoffee.setName("Coffee");
newCoffee.setPrice(50);
newCoffee.setAmtCoffee(3);
newCoffee.setAmtMilk(1);
newCoffee.setAmtSugar(1);
new... |
private server.JSONObject register_user(server.JSONObject data, server.Session session) {
if ((data.has("name")) && (data.has("password"))) {
server.User user = new server.User(session, data.getString("name"), data.getString("password"));
server.SocketLogic.registered_users.add(user);
return... | private server.JSONObject register_user(server.JSONObject data, server.Session session) {
if ((data.has("name")) && (data.has("password"))) {
server.User user = new server.User(session, data.getString("name"), data.getString("password"));
server.SocketLogic.registered_users.add(user);
return... |
public java.util.List<com.beehyv.nmsreporting.model.FlwImportRejection> getAllRejectedFlwImportRecords(java.util.Date toDate) {
org.hibernate.Criteria criteria = createEntityCriteria();
criteria.add(org.hibernate.criterion.Restrictions.lt("modificationDate", toDate)).add(org.hibernate.criterion.Restrictions.eq(... | public java.util.List<com.beehyv.nmsreporting.model.FlwImportRejection> getAllRejectedFlwImportRecords(java.util.Date toDate) {
org.hibernate.Criteria criteria = createEntityCriteria();
criteria.add(org.hibernate.criterion.Restrictions.lt("modificationDate", toDate)).add(org.hibernate.criterion.Restrictions.eq(... |
public void returnsTheInputStreamOfTheSocket() throws java.lang.Exception {
inputStream = new java.io.ByteArrayInputStream("GET / HTTP/1.1".getBytes());
byteArrayOutputStream = new java.io.ByteArrayOutputStream();
byteArrayOutputStream.write("HTTP/1.1 200 OK".getBytes());
mocks.MockSocket mockSocket = n... | public void returnsTheInputStreamOfTheSocket() throws java.lang.Exception {
inputStream = new java.io.ByteArrayInputStream("GET / HTTP/1.1".getBytes());
byteArrayOutputStream = new java.io.ByteArrayOutputStream();
mocks.MockSocket mockSocket = new mocks.MockSocket(inputStream, byteArrayOutputStream);
Re... |
public void showSelection() {
if ((this.sourceFigure) == null) {
this.sourceFigure = getHostFigure();
this.sourceFigure.addFigureListener(this.figureListener);
}
org.talend.core.model.process.INodeConnector connector = new org.talend.designer.core.ui.editor.connections.NodeConnectorTool(node... | public void showSelection() {
if ((this.sourceFigure) == null) {
this.sourceFigure = getHostFigure();
this.sourceFigure.addFigureListener(this.figureListener);
}
org.talend.core.model.process.INodeConnector connector = new org.talend.designer.core.ui.editor.connections.NodeConnectorTool(node... |
public void onContext(@javax.annotation.Nonnull
final android.content.Context context) {
super.onContext(context);
try {
mRoutine = com.gh.bmd.jrt.android.routine.JRoutine.on(mFactoryConstructor.newInstance(mArgs).create(context)).withShareGroup(mShareGroup).boundMethod(mBindingName);
} catch (final... | public void onContext(@javax.annotation.Nonnull
final android.content.Context context) {
super.onContext(context);
try {
mRoutine = com.gh.bmd.jrt.android.routine.JRoutine.on(mFactoryConstructor.newInstance(mArgs).create(context)).withShareGroup(mShareGroup).boundMethod(mBindingName);
} catch (final... |
public void safeRun() {
com.dava.framework.JNITextField.TextField text = com.dava.framework.JNITextField.GetTextField(id);
int autoCorrectionFlag = text.getInputType();
switch (autoCorrectionType) {
case 0 :
case 2 :
autoCorrectionFlag |= android.text.InputType.TYPE_TEXT_FLAG_AUT... | public void safeRun() {
int autoCorrectionFlag = text.getInputType();
switch (autoCorrectionType) {
case 0 :
case 2 :
autoCorrectionFlag |= android.text.InputType.TYPE_TEXT_FLAG_AUTO_CORRECT;
break;
case 1 :
default :
autoCorrectionFlag &= ~(an... |
public java.lang.Object getNameProperty(final T pojo) {
final java.util.Set<?> properties = org.wirez.core.definition.adapter.binding.AbstractBindableDefinitionAdapter.getProperties(pojo);
if ((null != properties) && (!(properties.isEmpty()))) {
for (final java.lang.Object property : properties) {
... | public java.lang.Object getNameProperty(final T pojo) {
final java.util.Set<?> properties = getProperties(pojo);
if ((null != properties) && (!(properties.isEmpty()))) {
for (final java.lang.Object property : properties) {
if (getNamePropertyClass().equals(property.getClass())) {
... |
public static java.lang.String getIcon(long goodsId) {
java.util.List<models.GoodsIcon> icons = dao.GoodsIconDao.getByGoods(goodsId);
if (org.apache.commons.collections.CollectionUtils.isEmpty(icons)) {
return "";
}
java.lang.StringBuilder sb = new java.lang.StringBuilder();
java.lang.String... | public static java.lang.String getIcon(long goodsId) {
java.util.List<models.GoodsIcon> icons = dao.GoodsIconDao.getByGoods(goodsId);
if (org.apache.commons.collections.CollectionUtils.isEmpty(icons)) {
return "";
}
java.lang.StringBuilder sb = new java.lang.StringBuilder();
java.lang.String... |
public static void main(java.lang.String[] args) throws java.io.IOException {
node.Node.log.info("Starting node");
node.PropertyLoader propertyLoader = new node.PropertyLoader();
propertyLoader.init();
node.CLIListner cliListner = CLIListner.INSTANCE;
cliListner.start();
node.BSCommunicator bsCo... | public static void main(java.lang.String[] args) throws java.io.IOException {
node.Node.log.info("Starting node");
node.PropertyLoader propertyLoader = new node.PropertyLoader();
propertyLoader.init();
node.NodeListner nodeListner = NodeListner.INSTANCE;
nodeListner.start();
node.BSCommunicator ... |
public void actionPerformed(java.awt.event.ActionEvent ae) {
if (("root".equals(jpfPassword.getPassword())) && ("root".equals(jtfUsername.getText()))) {
user.User user = new user.UserSearch("root").getUsers().get(0);
updateBar(ae, user);
}else {
statusLabel.setText("Invalid username or p... | public void actionPerformed(java.awt.event.ActionEvent ae) {
if (("root".equals(jpfPassword.getText())) && ("root".equals(jtfUsername.getText()))) {
user.User user = new user.UserSearch("root").getUsers().get(0);
updateBar(ae, user);
}else {
statusLabel.setText("Invalid username or passw... |
public long getLatestModificationTime(@javax.jws.WebParam(name = "collectionPid", targetNamespace = "")
java.lang.String collectionPid, @javax.jws.WebParam(name = "viewAngle", targetNamespace = "")
java.lang.String viewAngle, @javax.jws.WebParam(name = "state", targetNamespace = "")
java.lang.String state) throws dk.st... | public long getLatestModificationTime(@javax.jws.WebParam(name = "collectionPid", targetNamespace = "")
java.lang.String collectionPid, @javax.jws.WebParam(name = "viewAngle", targetNamespace = "")
java.lang.String viewAngle, @javax.jws.WebParam(name = "state", targetNamespace = "")
java.lang.String state) throws dk.st... |
private void handleImageOrGif(android.net.Uri uri) {
getContentResolver().getType(uri);
java.lang.String extension = getContentResolver().getType(uri).substring(((getContentResolver().getType(uri).lastIndexOf("/")) + 1));
android.util.Log.d("extension", extension);
if (extension.equals("gif")) {
... | private void handleImageOrGif(android.net.Uri uri) {
getContentResolver().getType(uri);
java.lang.String extension = getContentResolver().getType(uri).substring(((getContentResolver().getType(uri).lastIndexOf("/")) + 1));
android.util.Log.d("extension", extension);
if (extension.equals("gif")) {
... |
public ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation getCommandlineInstallation(java.lang.String name) {
java.util.List<ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation> installations = ru.yandex.qatools.allure.jenkins.utils.BuildUtils.getAllureInstallations();
ru.yand... | public ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation getCommandlineInstallation(java.lang.String name) {
java.util.List<ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation> installations = ru.yandex.qatools.allure.jenkins.utils.BuildUtils.getAllureInstallations();
ru.yand... |
private void registerEvents(org.spongepowered.api.service.event.EventManager mn) {
if (!(MainType.MCHAT_API_ONLY.getBoolean())) {
mn.register(new ca.q0r.sponge.mchat.events.sponge.ChatListener(), this);
mn.register(new ca.q0r.sponge.mchat.events.sponge.CommandListener(), this);
mn.register(n... | private void registerEvents(org.spongepowered.api.service.event.EventManager mn) {
if (!(MainType.MCHAT_API_ONLY.getBoolean())) {
mn.register(this, new ca.q0r.sponge.mchat.events.sponge.ChatListener());
mn.register(this, new ca.q0r.sponge.mchat.events.sponge.CommandListener());
mn.register(t... |
private static seedu.task.model.task.Task createEditedTask(seedu.task.model.task.ReadOnlyTask taskToEdit, seedu.task.logic.commands.EditCommand.EditTaskDescriptor editTaskDescriptor) {
assert taskToEdit != null;
seedu.task.model.task.Description updatedDescription = editTaskDescriptor.getDescription().orElseGet... | private static seedu.task.model.task.Task createEditedTask(seedu.task.model.task.ReadOnlyTask taskToEdit, seedu.task.logic.commands.EditCommand.EditTaskDescriptor editTaskDescriptor) {
assert taskToEdit != null;
seedu.task.model.task.Description updatedDescription = editTaskDescriptor.getDescription().orElseGet... |
public void onActivityCreated(android.os.Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
android.util.Log.d(MovieApplication.TAG, ((com.example.vit.popularmovies.ui.fragment.MoviesGridFragment.CLASS) + "onActivityCreated()"));
if (savedInstanceState != null) {
if (savedInst... | public void onActivityCreated(android.os.Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
if (savedInstanceState != null) {
if (savedInstanceState.containsKey(com.example.vit.popularmovies.ui.fragment.MoviesGridFragment.KEY_MOVIES_LIST)) {
moviesList = org.parceler.P... |
private java.lang.String checkWeightAgainstImage(int[] featureImage) {
int sum = 0;
for (int i = 1; i < (featureImage.length); i++) {
sum += (featureImage[i]) * (weights[i]);
}
return sum < 1 ? "Yes" : "other";
} | private java.lang.String checkWeightAgainstImage(int[] featureImage) {
double sum = 0;
for (int i = 0; i < (featureImage.length); i++) {
sum += (featureImage[i]) * (weights[i]);
}
return sum > 1 ? "Yes" : "other";
} |
public void setBot(int player, int difficulty) {
botPlaying = true;
botMove = new int[2];
botMoved = false;
botPlayerDesignation = java.lang.Math.abs((player % 2));
if ((botPlayerDesignation) == 1) {
botMoved = true;
botPlayerDesignationBOOL = true;
myTurn(true);
}else {
... | public void setBot(int player, int difficulty) {
botPlaying = true;
botMove = new int[2];
botMoved = false;
botPlayerDesignation = java.lang.Math.abs((player % 2));
if ((botPlayerDesignation) == 1) {
botMoved = true;
botPlayerDesignationBOOL = true;
myTurn(true);
}else {
... |
public void run() {
java.lang.String isOpenTrack = xApplication.getIsOpenTrack(orderInfo.getOrderNo());
if ((null != isOpenTrack) && (isOpenTrack.equals(orderInfo.getOrderNo()))) {
xApplication.isOpenTrackRemove(orderInfo.getOrderNo());
com.ybg.rp.vmbase.utils.LogUtil.e("----------线上支付--------PU... | public void run() {
java.lang.String isOpenTrack = xApplication.getIsOpenTrack(orderInfo.getOrderNo());
if ((null != isOpenTrack) && (isOpenTrack.equals(orderInfo.getOrderNo()))) {
xApplication.isOpenTrackRemove(orderInfo.getOrderNo());
com.ybg.rp.vmbase.utils.LogUtil.e("----------线上支付--------PU... |
public void testAddDuplicatedTemplate() {
org.keycloak.representations.idm.ClientTemplateRepresentation templateRep = new org.keycloak.representations.idm.ClientTemplateRepresentation();
templateRep.setName("template1");
java.lang.String templateId = createTemplate(templateRep);
templateRep = new org.ke... | public void testAddDuplicatedTemplate() {
org.keycloak.representations.idm.ClientTemplateRepresentation templateRep = new org.keycloak.representations.idm.ClientTemplateRepresentation();
templateRep.setName("template1");
java.lang.String templateId = createTemplate(templateRep);
templateRep = new org.ke... |
public javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue) throws javax.jms.JMSException {
checkClosed();
org.apache.qpid.jms.JmsSession.checkDestination(queue);
org.apache.qpid.jms.JmsDestination dest = org.apache.qpid.jms.message.JmsMessageTransformation.transformDestination(connection, queue);
... | public javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue) throws javax.jms.JMSException {
checkClosed();
org.apache.qpid.jms.JmsSession.checkDestination(queue);
org.apache.qpid.jms.JmsDestination dest = org.apache.qpid.jms.message.JmsMessageTransformation.transformDestination(connection, queue);
... |
private teammates.ui.template.FeedbackResultsQuestionDetails createQuestionDetails(int questionIndex, teammates.common.datatransfer.FeedbackQuestionAttributes question, teammates.common.datatransfer.FeedbackQuestionDetails questionDetailsBundle, java.util.List<teammates.common.datatransfer.FeedbackResponseAttributes> r... | private teammates.ui.template.FeedbackResultsQuestionDetails createQuestionDetails(int questionIndex, teammates.common.datatransfer.FeedbackQuestionAttributes question, teammates.common.datatransfer.FeedbackQuestionDetails questionDetailsBundle, java.util.List<teammates.common.datatransfer.FeedbackResponseAttributes> r... |
private void saveList() {
java.util.ArrayList<dragon.tamu.playphrase.Category> temp = new java.util.ArrayList<>();
for (int i = 0; i < (mCategoryList.size()); i++) {
temp.add(((dragon.tamu.playphrase.Category) (mCategoryList.get(i))));
}
fileSystem.saveInfoToFile(temp);
} | public void saveList() {
java.util.ArrayList<dragon.tamu.playphrase.Category> temp = new java.util.ArrayList<>();
for (int i = 0; i < (mCategoryList.size()); i++) {
temp.add(((dragon.tamu.playphrase.Category) (mCategoryList.get(i))));
}
fileSystem.saveInfoToFile(temp);
} |
public void entityLostSightNotice(com.esbjon.mapobjects.VicinityReference sightedEntity) {
if (sightedEntity instanceof com.esbjon.entities.Substance) {
if ((sightedEntity == (watchObject)) && ((state) != (com.esbjon.entities.SteeringEntity.behaviorState.CHASE))) {
com.esbjon.mapobjects.Tile sig... | public void entityLostSightNotice(com.esbjon.mapobjects.VicinityReference sightedEntity) {
if (sightedEntity instanceof com.esbjon.entities.Substance) {
if ((sightedEntity == (watchObject)) && ((state) != (com.esbjon.entities.SteeringEntity.behaviorState.CHASE))) {
com.esbjon.mapobjects.Tile sig... |
protected void drawLine(com.aventura.model.world.Line l) {
if (com.aventura.tools.tracing.Tracer.function)
com.aventura.tools.tracing.Tracer.traceFunction(this.getClass(), "drawLine(l)");
if (com.aventura.tools.tracing.Tracer.info)
com.aventura.tools.tracing.Tracer.traceInfo(this.getClass()... | protected void drawLine(com.aventura.model.world.Line l) {
if (com.aventura.tools.tracing.Tracer.function)
com.aventura.tools.tracing.Tracer.traceFunction(this.getClass(), "drawLine(l)");
if (com.aventura.tools.tracing.Tracer.info)
com.aventura.tools.tracing.Tracer.traceInfo(this.getClass()... |
public com.iri.training.model.User addUser(final com.iri.training.model.User user) throws java.sql.SQLException {
logger.debug(("ENTERED addUser for user: " + user));
java.lang.String sql = property.getString("CREATE_USER");
jdbcTemplate = new org.springframework.jdbc.core.JdbcTemplate(dataSource);
jdbc... | public com.iri.training.model.User addUser(final com.iri.training.model.User user) throws java.sql.SQLException {
logger.debug(("ENTERED addUser for user: " + user));
java.lang.String sql = property.getString("CREATE_USER");
jdbcTemplate = new org.springframework.jdbc.core.JdbcTemplate(dataSource);
jdbc... |
if ((detailsFile) != null) {
java.io.FileOutputStream out = null;
try {
out = new java.io.FileOutputStream(detailsFile);
details.store(out, null);
} catch (final java.io.IOException e) {
com.puppycrawl.tools.checkstyle.Utils.getExceptionLogger().debug("Una... | if ((detailsFile) != null) {
java.io.FileOutputStream out = null;
try {
out = new java.io.FileOutputStream(detailsFile);
details.store(out, null);
} catch (final java.io.IOException e) {
com.puppycrawl.tools.checkstyle.Utils.getExceptionLogger().debug("Una... |
public static java.lang.String cleanRomName(java.lang.String rom, boolean hard) {
java.lang.String cleanRom = rom;
cleanRom = cleanRom.replaceAll("\\([^\\)]*\\)", "");
cleanRom = cleanRom.replaceAll("\\[[^\\]]*\\]", "");
cleanRom = daaa.qdscraper.utils.RomCleaner.removeExtension(rom);
if (hard) {
... | public static java.lang.String cleanRomName(java.lang.String rom, boolean hard) {
java.lang.String cleanRom = rom;
cleanRom = cleanRom.replaceAll("\\([^\\)]*\\)", "");
cleanRom = cleanRom.replaceAll("\\[[^\\]]*\\]", "");
cleanRom = daaa.qdscraper.utils.RomCleaner.removeExtension(cleanRom);
if (hard)... |
public java.util.List<com.uber.hoodie.common.model.HoodieRecord> generateUpdates(java.lang.String commitTime, java.util.List<com.uber.hoodie.common.model.HoodieRecord> baseRecords) throws java.io.IOException {
java.util.List<com.uber.hoodie.common.model.HoodieRecord> updates = new java.util.ArrayList<>();
for (... | public java.util.List<com.uber.hoodie.common.model.HoodieRecord> generateUpdates(java.lang.String commitTime, java.util.List<com.uber.hoodie.common.model.HoodieRecord> baseRecords) throws java.io.IOException {
java.util.List<com.uber.hoodie.common.model.HoodieRecord> updates = new java.util.ArrayList<>();
for (... |
public void testShouldReturnMethodValueRetrieverWhenMethodPassedWithArgs() throws java.lang.Exception {
givenCommandLineArguments("test(1, \"test\")");
org.junit.Assert.assertEquals(java.util.Collections.singletonList(new uk.co.harrymartland.multijmx.domain.valueretriver.SpelMethodValueRetriever("test", new uk.... | public void testShouldReturnMethodValueRetrieverWhenMethodPassedWithArgs() throws java.lang.Exception {
givenCommandLineArguments("test(1, \"test\")");
org.junit.Assert.assertEquals(java.util.Collections.singletonList(new uk.co.harrymartland.multijmx.domain.valueretriver.SpelMethodValueRetriever("test", java.ut... |
protected void onResume() {
super.onResume();
android.util.Log.d(com.mutisya.numbersone.MainActivity.LIFECYCLE, "onResume()");
loadGameInfo();
android.util.Log.d(com.mutisya.numbersone.MainActivity.TAG, "---------resume done; loading state");
reloadGame(gameSize);
android.util.Log.d(HelpScreen.T... | protected void onResume() {
super.onResume();
android.util.Log.d(com.mutisya.numbersone.MainActivity.LIFECYCLE, "onResume()");
loadGameInfo();
android.util.Log.d(com.mutisya.numbersone.MainActivity.TAG, "---------resume done; loading state");
reloadGame(gameSize);
android.util.Log.d(HelpScreen.T... |
public static void greaterThan(java.lang.String message, float lhs, float rhs, float margin) {
com.johnuckele.vtest.Tester.checkScope();
java.lang.System.out.println(((((((("\t\t" + message) + ": ") + lhs) + " > ") + rhs) + " ± ") + margin));
double difference = lhs - rhs;
com.johnuckele.vtest.Tester.te... | public static void greaterThan(java.lang.String message, float lhs, float rhs, float margin) {
com.johnuckele.vtest.Tester.checkScope();
java.lang.System.out.println(((((((("\t\t" + message) + ": ") + lhs) + " > ") + rhs) + " ± ") + margin));
com.johnuckele.vtest.Tester.test((lhs > (rhs + (java.lang.Math.ab... |
public void onActivityCreated(android.os.Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setHasOptionsMenu(true);
setRetainInstance(true);
db = new com.commonsware.android.constants.DatabaseHelper(getActivity());
task = new com.commonsware.android.constants.ConstantsFragmen... | public void onActivityCreated(android.os.Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setHasOptionsMenu(true);
setRetainInstance(true);
db = new com.commonsware.android.constants.DatabaseHelper(getActivity());
task = new com.commonsware.android.constants.ConstantsFragmen... |
public boolean apply(final org.eclipse.xtext.resource.IResourceDescription input) {
if (matchReferences) {
for (org.eclipse.xtext.resource.IReferenceDescription ref : input.getReferenceDescriptions()) {
if (targetUris.contains(ref.getTargetEObjectUri().trimFragment())) {
return t... | public boolean apply(final org.eclipse.xtext.resource.IResourceDescription input) {
if (matchReferences) {
for (org.eclipse.xtext.resource.IReferenceDescription ref : input.getReferenceDescriptions()) {
if (targetUris.contains(ref.getTargetEObjectUri().trimFragment())) {
return t... |
public ftb.lib.mod.net.IMessage onMessage(ftb.lib.mod.net.MessageContext ctx) {
ftb.lib.mod.net.MessageReload.readSyncedConfig(io);
boolean hasFTBU = io.readBoolean();
boolean first = (FTBWorld.client) == null;
if (first)
FTBWorld.client = new ftb.lib.mod.net.FTBWorld(cpw.mods.fml.relauncher.Sid... | public ftb.lib.mod.net.IMessage onMessage(ftb.lib.mod.net.MessageContext ctx) {
ftb.lib.mod.net.MessageReload.readSyncedConfig(io);
boolean hasFTBU = io.readBoolean();
boolean first = (FTBWorld.client) == null;
if (first)
FTBWorld.client = new ftb.lib.mod.net.FTBWorld(cpw.mods.fml.relauncher.Sid... |
protected ua.goit.java5.group62.model.Company createEntry(java.sql.ResultSet resultSet) {
ua.goit.java5.group62.model.Company company = new ua.goit.java5.group62.model.Company();
try {
company.setComment(resultSet.getString("comment"));
company.setAddress(resultSet.getString("address"));
... | protected ua.goit.java5.group62.model.Company createEntry(java.sql.ResultSet resultSet) {
ua.goit.java5.group62.model.Company company = new ua.goit.java5.group62.model.Company();
try {
company.setId(resultSet.getLong(1));
company.setName(resultSet.getString("name"));
company.setAddress(r... |
public org.eclipse.titan.runtime.core.TitanHexString add(final org.eclipse.titan.runtime.core.TitanHexString_Element otherValue) {
mustBound("Unbound left operand of hexstring concatenation.");
otherValue.mustBound("Unbound right operand of hexstring element concatenation.");
org.eclipse.titan.runtime.core.... | public org.eclipse.titan.runtime.core.TitanHexString append(final org.eclipse.titan.runtime.core.TitanHexString_Element otherValue) {
mustBound("Unbound left operand of hexstring concatenation.");
otherValue.mustBound("Unbound right operand of hexstring element concatenation.");
org.eclipse.titan.runtime.co... |
public final boolean setStatus(jasl.counters.States state) {
if (!(status().contains(state))) {
_status ^= state.value();
if (state == (States.DESPERATE))
setStatus(States.BROKEN);
return true;
}
return false;
} | public final boolean setStatus(jasl.counters.States state) {
if (0 == ((_status) & (state.value()))) {
_status ^= state.value();
if ((States.DESPERATE) == state)
setStatus(States.BROKEN);
return true;
}
return false;
} |
public java.util.List<oracle.academy.model.User> getAll() {
java.util.List<oracle.academy.model.User> users = new java.util.ArrayList<>();
for (int i = 0; i < (oracle.academy.UserDaoImpl.usersMap.size()); i++) {
users.add(oracle.academy.UserDaoImpl.usersMap.get(i));
}
return users;
} | public java.util.List<oracle.academy.model.User> getAll() {
java.util.List<oracle.academy.model.User> users = new java.util.ArrayList<>();
for (java.lang.Long i = 0L; i < (oracle.academy.UserDaoImpl.usersMap.size()); i++) {
users.add(oracle.academy.UserDaoImpl.usersMap.get(i));
}
return users;
} |
public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
v = new android.widget.ImageButton(this);
v.setOnClickListener(this);
v.setScaleType(ScaleType.FIT_XY);
try {
java.lang.String pth = "/sdcard/gifs/piggy.gif";
final java.io.InputStream st... | public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
v = new android.widget.ImageButton(this);
v.setOnClickListener(this);
v.setScaleType(ScaleType.FIT_XY);
try {
java.lang.String pth = "/sdcard/gifs/piggy.gif";
final java.io.InputStream st... |
public void actionPerformed(java.awt.event.ActionEvent e) {
conn = new com.eca.assignment.game.BJDatabaseConn();
conn.refreshPlayerData(player);
panelGame.getJb_hit().setEnabled(true);
panelGame.getJb_stand().setEnabled(true);
panelGame.remove(panelGame.getOverlayPanel());
initGame();
panelG... | public void actionPerformed(java.awt.event.ActionEvent e) {
conn = new com.eca.assignment.game.BJDatabaseConn();
conn.refreshPlayerData(player);
panelGame.getJb_hit().setEnabled(true);
panelGame.getJb_stand().setEnabled(true);
panelGame.remove(panelGame.getOverlayPanel());
initGame();
panelG... |
assert (state) == (jsettlers.logic.movable.Movable.EMovableState.DOING_NOTHING) : "can't do goToPos() if state isn't DOING_NOTHING. curr state: " + (state);
jsettlers.algorithms.path.Path path = grid.calculatePathTo(this, targetPos);
if (path == null) {
return false;
}else {
followPath(p... | assert (state) == (jsettlers.logic.movable.Movable.EMovableState.DOING_NOTHING) : "can't do goToPos() if state isn't DOING_NOTHING. curr state: " + (state);
jsettlers.algorithms.path.Path path = grid.calculatePathTo(this, targetPos);
if (path == null) {
return false;
}else {
followPath(p... |
public void sendGoHome() {
if (gc.isConnected()) {
try {
if (((gameMode) == 2) && (!(gameOver))) {
gc.sendObject("##GO##HOME##");
}
} catch (java.io.IOException ex) {
java.util.logging.Logger.getLogger(games.tictactoe.gui.TicTacToePanel.class.getNa... | public void sendGoHome() {
if (gc.isConnected()) {
try {
if ((gameMode) == 2) {
gc.sendObject("##GO##HOME##");
}
} catch (java.io.IOException ex) {
java.util.logging.Logger.getLogger(games.tictactoe.gui.TicTacToePanel.class.getName()).log(java.util... |
public java.util.List<stilkin.GoCoord> getSortedMoveList() {
final java.util.ArrayList<stilkin.GoCoord> moveList = new java.util.ArrayList<stilkin.GoCoord>();
for (int y = 0; y < (stilkin.GoField.MAX_HEIGHT); y++) {
for (int x = 0; x < (stilkin.GoField.MAX_WIDTH); x++) {
if (isEmptyCell(x, y... | public java.util.List<stilkin.GoCoord> getSortedMoveList() {
final java.util.ArrayList<stilkin.GoCoord> moveList = new java.util.ArrayList<stilkin.GoCoord>();
for (int y = 0; y < (stilkin.GoField.MAX_HEIGHT); y++) {
for (int x = 0; x < (stilkin.GoField.MAX_WIDTH); x++) {
if (!(isEmptyCell(x,... |
public static byte[] toBigEndian(byte[] value) {
for (int i = 0, length = (value.length) >> 2; i <= length; i++) {
final int j = ((value.length) - 1) - i;
final byte t = value[i];
value[i] = value[j];
value[j] = t;
}
return value;
} | public static byte[] toBigEndian(byte[] value) {
for (int i = 0, length = (value.length) >> 1; i < length; i++) {
final int j = ((value.length) - 1) - i;
final byte t = value[i];
value[i] = value[j];
value[j] = t;
}
return value;
} |
public static void horiGroupHp(javax.swing.GroupLayout.ParallelGroup hp, javax.swing.JScrollPane jScrollPane2, javax.swing.JScrollPane jScrollPane1, javax.swing.JLabel status) {
hp.addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 600, java.lang.Short.MAX_VA... | private static void horiGroupHp(javax.swing.GroupLayout.ParallelGroup hp, javax.swing.JScrollPane jScrollPane2, javax.swing.JScrollPane jScrollPane1, javax.swing.JLabel status) {
hp.addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 600, java.lang.Short.MAX_V... |
public java.util.List<java.lang.String> loadFacultyNames() {
final java.util.TreeSet<java.lang.String> faculties = new java.util.TreeSet<>();
facultyList.forEach(new java.util.function.Consumer<upandgo.shared.entities.Faculty>() {
@java.lang.Override
public void accept(upandgo.shared.entities.Fa... | public java.util.List<java.lang.String> loadFacultyNames() {
final java.util.List<java.lang.String> faculties = new java.util.ArrayList<>();
facultyList.forEach(new java.util.function.Consumer<upandgo.shared.entities.Faculty>() {
@java.lang.Override
public void accept(upandgo.shared.entities.Fac... |
private void removeGhostCards() {
for (int i = (this.cards.size()) - 1; i >= 0; i--) {
if ((this.cards.get(i)) instanceof io.github.zachohara.percussionpacker.card.GhostCard) {
this.remove(i);
}
}
} | private void removeGhostCards() {
for (int i = (this.cards.size()) - 1; i >= 0; i--) {
if ((this.cards.get(i)) instanceof io.github.zachohara.percussionpacker.card.GhostCard) {
this.remove(this.cards.get(i));
}
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.