buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
private int[] loadStyleList(android.content.Context context, int resId) {
android.content.res.TypedArray array = context.getResources().obtainTypedArray(resId);
int[] result = new int[array.length()];
for (int i = 0; i < (result.length); i++)
result[i] = array.getResourceId(i, 0);
array.rec... | private int[] loadStyleList(android.content.Context context, int resId) {
if (context == null)
return null;
android.content.res.TypedArray array = context.getResources().obtainTypedArray(resId);
int[] result = new int[array.length()];
for (int i = 0; i < (result.length); i++)
result... |
public void run(java.lang.String simplifiedCode, java.lang.String standardInput) {
variableInitialization();
code = simplifiedCode;
inputArray = createInputArray(standardInput);
checkForErrors();
decode(codePosition);
appendWarnings();
endTime = java.lang.System.currentTimeMillis();
code... | public void run(java.lang.String simplifiedCode, java.lang.String standardInput) {
code = simplifiedCode;
inputArray = createInputArray(standardInput);
checkForErrors();
startTime = java.lang.System.currentTimeMillis();
decode(codePosition);
appendWarnings();
endTime = java.lang.System.curre... |
public static org.totschnig.myexpenses.model.Transfer getNewInstance(long accountId, java.lang.Long transferAccountId, java.lang.Long parentId) {
org.totschnig.myexpenses.model.Account account = org.totschnig.myexpenses.model.Account.getInstanceFromDbWithFallback(accountId);
if (account == null) {
retur... | public static org.totschnig.myexpenses.model.Transfer getNewInstance(long accountId, java.lang.Long transferAccountId, java.lang.Long parentId) {
org.totschnig.myexpenses.model.Account account = org.totschnig.myexpenses.model.Account.getInstanceFromDbWithFallback(accountId);
if (account == null) {
retur... |
public void onClick(com.google.gwt.event.dom.client.ClickEvent event) {
if (isClicked) {
isClicked = false;
java.util.Map<java.lang.String, java.lang.String> params = new java.util.HashMap<java.lang.String, java.lang.String>();
org.ednovo.gooru.application.client.gin.AppClientFactory.getPlac... | public void onClick(com.google.gwt.event.dom.client.ClickEvent event) {
if (isClicked) {
isClicked = false;
java.util.Map<java.lang.String, java.lang.String> params = new java.util.HashMap<java.lang.String, java.lang.String>();
org.ednovo.gooru.application.client.gin.AppClientFactory.getPlac... |
public void onFinish(java.lang.CharSequence text) {
try {
java.lang.String info = "";
if (mFinder.createFile(text.toString(), ((typeToCreate) == (me.sxwang.afinder.ui.MainActivity.CREATE_FOLDER)))) {
info = "Success";
}else {
info = "Failed";
}
android... | public void onFinish(java.lang.CharSequence text) {
try {
java.lang.String info;
if (mFinder.createFile(text.toString(), ((typeToCreate) == (me.sxwang.afinder.ui.MainActivity.CREATE_FOLDER)))) {
info = "Success";
}else {
info = "Failed";
}
android.widg... |
public Field.control isVictoryAchievied() {
if ((this.isHorizontalMatch()) != (Field.control.NONE))
return this.isHorizontalMatch();
if ((this.isVerticalMatch()) != (Field.control.NONE))
return this.isHorizontalMatch();
return Field.control.NONE;
} | public Field.control isVictoryAchievied() {
if ((this.isHorizontalMatch()) != (Field.control.NONE))
return this.isHorizontalMatch();
if ((this.isVerticalMatch()) != (Field.control.NONE))
return this.isVerticalMatch();
return Field.control.NONE;
} |
public com.SpryngPayments.Java.Models.Transaction get(java.lang.String transactionId) throws com.SpryngPayments.Java.Exceptions.RequestException {
this.http.setRequest(new com.SpryngPayments.Java.Http.Requests.Transaction.GetTransaction(transactionId));
this.http.send();
java.lang.System.out.println(this.ht... | public com.SpryngPayments.Java.Models.Transaction get(java.lang.String transactionId) throws com.SpryngPayments.Java.Exceptions.RequestException {
this.http.setRequest(new com.SpryngPayments.Java.Http.Requests.Transaction.GetTransaction(transactionId));
this.http.send();
com.SpryngPayments.Java.Models.Trans... |
private int pixelsPerRow() {
int defaultPixPerRow = (com.github.sesquipedalian_dev.snes_graphics_edit.ui.TileCharacterCanvasController.TILES_PER_ROW) * (com.github.sesquipedalian_dev.snes_graphics_edit.data.TileCHR.TILE_DIM);
switch (zoomSel.getSelectionModel().getSelectedIndex()) {
case 1 :
... | private int pixelsPerRow() {
int defaultPixPerRow = (com.github.sesquipedalian_dev.snes_graphics_edit.ui.TileCharacterCanvasController.TILES_PER_ROW) * (com.github.sesquipedalian_dev.snes_graphics_edit.data.TileCHR.TILE_DIM);
switch (zoomSel.getSelectionModel().getSelectedIndex()) {
case 1 :
... |
public void deleteDir() throws java.io.IOException {
lshManagerIF = null;
dbManagerIF = null;
mediaIndexer = null;
mediaFileDescriptorBuilder = null;
org.apache.commons.io.FileUtils.deleteDirectory(tmpDir);
try {
org.apache.commons.io.FileUtils.deleteDirectory(new java.io.File("lsh"));
... | public void deleteDir() throws java.io.IOException {
lshManagerIF = null;
dbManagerIF = null;
mediaIndexer = null;
mediaFileDescriptorBuilder = null;
tmpDir.delete();
try {
new java.io.File("lsh").delete();
new java.io.File("lsh.p").delete();
new java.io.File("lsh.t").del... |
public void delete(ComponentManager cm) {
switch (indexOf(cm)) {
case 1 :
Database.DelWallet(cm.getWallet().getID());
break;
case 2 :
Database.DelIncome(cm.getWallet().getID());
break;
case 3 :
Database.DelExpense(cm.getWallet().get... | public void delete(ComponentManager cm) {
switch (indexOf(cm)) {
case 0 :
Database.DelWallet(cm.getWallet().getID());
break;
case 1 :
Database.DelIncome(cm.getWallet().getID());
break;
case 2 :
Database.DelExpense(cm.getWallet().get... |
public void readMainElements() throws java.io.IOException {
workbook = new org.apache.poi.hssf.usermodel.HSSFWorkbook(fileInputStream);
org.apache.poi.hssf.usermodel.HSSFSheet sheet = workbook.getSheetAt(0);
for (org.apache.poi.ss.usermodel.Row row : sheet) {
java.util.Iterator cellIterator = row.ce... | public void readMainElements() throws java.io.IOException {
workbook = new org.apache.poi.hssf.usermodel.HSSFWorkbook(fileInputStream);
org.apache.poi.hssf.usermodel.HSSFSheet sheet = workbook.getSheetAt(0);
for (org.apache.poi.ss.usermodel.Row row : sheet) {
java.util.Iterator cellIterator = row.ce... |
public void mutate() {
for (java.util.Map.Entry<java.lang.String, java.lang.Double> entry : this.getValues().entrySet()) {
if (GeneticMain.r.nextBoolean()) {
entry.setValue(((entry.getValue()) + ((GeneticMain.r.nextDouble()) - (0.5 * (GeneticMain.temp)))));
if ((entry.getValue()) <= ... | public void mutate() {
for (java.util.Map.Entry<java.lang.String, java.lang.Double> entry : this.getValues().entrySet()) {
if (GeneticMain.r.nextBoolean()) {
entry.setValue(((entry.getValue()) + (((GeneticMain.r.nextDouble()) - 0.5) * (GeneticMain.temp))));
if ((entry.getValue()) <= ... |
public com.dtolabs.rundeck.core.execution.ExecutionContextImpl.Builder nodeContextData(com.dtolabs.rundeck.core.common.INodeEntry node) {
ctx.dataContext.merge(new com.dtolabs.rundeck.core.execution.BaseDataContext("node", com.dtolabs.rundeck.core.execution.DataContextUtils.nodeData(node)));
ctx.sharedDataConte... | public com.dtolabs.rundeck.core.execution.ExecutionContextImpl.Builder nodeContextData(com.dtolabs.rundeck.core.common.INodeEntry node) {
ctx.dataContext.remove("node");
ctx.dataContext.merge(new com.dtolabs.rundeck.core.execution.BaseDataContext("node", com.dtolabs.rundeck.core.execution.DataContextUtils.nodeD... |
public synchronized boolean releaseByVAddress(java.lang.String vAddress) {
java.util.Iterator<kostiskag.unitynetwork.tracker.runData.RedNodeEntry> iterator = list.listIterator();
int i = 0;
while (iterator.hasNext()) {
kostiskag.unitynetwork.tracker.runData.RedNodeEntry element = iterator.next();
... | public synchronized boolean releaseByVAddress(java.lang.String vAddress) {
java.util.Iterator<kostiskag.unitynetwork.tracker.runData.RedNodeEntry> iterator = list.listIterator();
while (iterator.hasNext()) {
kostiskag.unitynetwork.tracker.runData.RedNodeEntry element = iterator.next();
if (vAddr... |
public void newWaitingTask() {
setNumberOfPendingTasks(((getNumberOfPendingTasks()) + 1));
setNumberOfRunningTasks(((getNumberOfRunningTasks()) - 1));
if (((getNumberOfRunningTasks()) == 0) && (((getStatus()) != (org.ow2.proactive.scheduler.common.job.JobStatus.PAUSED)) || ((getStatus()) != (org.ow2.proacti... | public void newWaitingTask() {
setNumberOfPendingTasks(((getNumberOfPendingTasks()) + 1));
setNumberOfRunningTasks(((getNumberOfRunningTasks()) - 1));
if (((getNumberOfRunningTasks()) == 0) && (!(((getStatus()) == (org.ow2.proactive.scheduler.common.job.JobStatus.PAUSED)) || ((getStatus()) == (org.ow2.proac... |
public boolean checkStatus(io.zipcoder.zealotscasino.Player player, double bet) {
boolean bust = playerHand.checkIfBust();
boolean blackJack = playerHand.checkIfBlackJack();
if (bust) {
displayLoseGame();
setGameRunning(false);
return false;
}
if (blackJack) {
execute... | public boolean checkStatus(io.zipcoder.zealotscasino.Player player) {
boolean bust = playerHand.checkIfBust();
boolean blackJack = playerHand.checkIfBlackJack();
if (bust) {
displayLoseGame();
setGameRunning(false);
return false;
}
if (blackJack) {
executePlayerWins(p... |
public void ratingDialogIsShown() {
org.junit.Assume.assumeTrue((!(org.totschnig.myexpenses.util.DistribHelper.isGithub())));
PrefKey.NEXT_REMINDER_RATE.remove();
stubExpenseEditIntentWithSequenceCount(((org.totschnig.myexpenses.activity.MyExpenses.TRESHOLD_REMIND_RATE) + 1));
android.support.test.espre... | public void ratingDialogIsShown() {
org.junit.Assume.assumeTrue((!(org.totschnig.myexpenses.util.DistribHelper.isGithub())));
PrefKey.NEXT_REMINDER_RATE.remove();
stubExpenseEditIntentWithSequenceCount(((org.totschnig.myexpenses.activity.MyExpenses.TRESHOLD_REMIND_RATE) + 1));
android.support.test.espre... |
public int executeQuery(java.lang.String query) {
java.sql.Statement st;
int lastID = 0;
try {
st = con.createStatement();
int result = st.executeUpdate(query, java.sql.Statement.RETURN_GENERATED_KEYS);
java.sql.ResultSet rs = st.getGeneratedKeys();
if (rs.next()) {
... | public int executeQuery(java.lang.String query) {
java.sql.Statement st;
int lastID = 0;
try {
st = con.createStatement();
int result = st.executeUpdate(query, java.sql.Statement.RETURN_GENERATED_KEYS);
java.sql.ResultSet rs = st.getGeneratedKeys();
if (rs.next()) {
... |
public void onDataChange(com.google.firebase.database.DataSnapshot _dataSnapshot) {
this.checkViewAttached();
try {
if (_dataSnapshot.exists()) {
android.util.Log.d(com.cremy.shared.ui.presenter.BucketPresenter.TAG, _dataSnapshot.toString());
this.model = _dataSnapshot.getValue(c... | public void onDataChange(com.google.firebase.database.DataSnapshot _dataSnapshot) {
this.checkViewAttached();
try {
android.util.Log.d(com.cremy.shared.ui.presenter.BucketPresenter.TAG, _dataSnapshot.toString());
this.model = _dataSnapshot.getValue(com.cremy.shared.data.model.Bucket.class);
... |
public static boolean isApplicable(org.opends.server.types.AttributeType a, org.opends.server.authorization.dseecompat.TargetAttr targetAttr) {
boolean ret;
if ((targetAttr.isAllUserAttributes()) && (targetAttr.isAllOpAttributes())) {
ret = !(targetAttr.getOperator().equals(EnumTargetOperator.NOT_EQUALI... | public static boolean isApplicable(org.opends.server.types.AttributeType a, org.opends.server.authorization.dseecompat.TargetAttr targetAttr) {
if ((targetAttr.isAllUserAttributes()) && (targetAttr.isAllOpAttributes())) {
return !(targetAttr.getOperator().equals(EnumTargetOperator.NOT_EQUALITY));
}else ... |
public void train(int expected_predict) {
this.expected_error = expected_predict;
for (int i = (weightsCNN.size()) - 1; i >= 0; i--) {
backPropagation(weightsCNN.get(i), layersCNN.get(i));
}
} | public void train(double expected_predict) {
this.expected_error = expected_predict;
for (int i = (weightsCNN.size()) - 1; i >= 0; i--) {
backPropagation(weightsCNN.get(i), layersCNN.get((i + 1)));
}
} |
private boolean checkConnectionException(com.salesforce.dataloader.client.ConnectionException ex, java.lang.String operationName, int retryNum) {
if (!(this.enableRetries))
return false;
final java.lang.String msg = ex.getMessage();
if ((msg != null) && ((msg.toLowerCase().indexOf("connection r... | private boolean checkConnectionException(com.salesforce.dataloader.client.ConnectionException ex, java.lang.String operationName, int retryNum) {
if (!(this.enableRetries))
return false;
final java.lang.String msg = ex.getMessage();
if ((msg != null) && ((msg.toLowerCase().indexOf("connection r... |
private void setupScene(javafx.scene.layout.GridPane pane) {
java.lang.String titleText;
if ((comboBox.current_project) != null) {
titleText = comboBox.current_project.name;
}else {
titleText = "Lemon Notes";
}
scene = new javafx.scene.Scene(pane, 600, 250);
primaryStage.setTitle... | private void setupScene(javafx.scene.layout.GridPane pane) {
java.lang.String titleText = "Lemon Notes";
scene = new javafx.scene.Scene(pane, 600, 250);
primaryStage.setTitle(titleText);
primaryStage.setScene(scene);
primaryStage.setResizable(true);
primaryStage.show();
} |
public static boolean LogError(java.lang.String content) {
if (com.lkworm.miniservice.GPSTrackService.createLogFile()) {
java.io.FileWriter writer;
try {
writer = new java.io.FileWriter(com.lkworm.miniservice.GPSTrackService.getGPSLogPath(), true);
writer.write(content);
... | public boolean LogError(java.lang.String content) {
if (createLogFile()) {
java.io.FileWriter writer;
try {
writer = new java.io.FileWriter(getGPSLogPath(), true);
writer.write(content);
writer.close();
writer = null;
} catch (java.io.IOExcepti... |
public boolean changeMusicState() {
musicON = !(musicON);
if (musicON) {
mute(true);
}else {
for (sound.Playable p : playables) {
if (isMusicClip(p.getClipName())) {
p.restartClip();
}
}
}
return musicON;
} | public boolean changeMusicState() {
musicON = !(musicON);
if (!(musicON)) {
mute(true);
}else {
for (sound.Playable p : playables) {
if (isMusicClip(p.getClipName())) {
p.restartClip();
}
}
}
return musicON;
} |
public org.springframework.web.servlet.ModelAndView finalResults(@org.springframework.web.bind.annotation.ModelAttribute(value = "activityQuery")
com.krho.finalproject.ActivityQuery actQuery, java.util.Map<java.lang.String, java.lang.Object> model) {
com.krho.finalproject.Activity activity = new com.krho.finalproje... | public org.springframework.web.servlet.ModelAndView finalResults(@org.springframework.web.bind.annotation.ModelAttribute(value = "activityQuery")
com.krho.finalproject.ActivityQuery actQuery, java.util.Map<java.lang.String, java.lang.Object> model) {
com.krho.finalproject.Activity activity = new com.krho.finalproje... |
private void addNodeToRootLists(FibonacciHeap.HeapNode node) {
if ((this.min) == null) {
this.min = node;
}else {
node.prev = this.min.prev;
this.min.prev.next = node;
this.min.prev = node;
node.next = this.min;
}
} | private void addNodeToRootLists(FibonacciHeap.HeapNode node) {
if ((this.min) == null) {
this.min = node;
node.next = node;
node.prev = node;
}else {
node.prev = this.min.prev;
this.min.prev.next = node;
this.min.prev = node;
node.next = this.min;
}
} |
public boolean onTouch(android.view.View v, android.view.MotionEvent event) {
if ((event.getAction()) == (android.view.MotionEvent.ACTION_MOVE)) {
fr.esir.fragments.NextProgramming np = new fr.esir.fragments.NextProgramming();
fm.beginTransaction().replace(R.id.containerMain, np).commit();
}
... | public boolean onTouch(android.view.View v, android.view.MotionEvent event) {
if ((event.getAction()) == (android.view.MotionEvent.ACTION_MOVE)) {
fr.esir.fragments.NextProgramming np = new fr.esir.fragments.NextProgramming();
fm.beginTransaction().replace(R.id.containerMain, np).commit();
}
... |
private void createTask(java.lang.String[] words) {
java.lang.String tLabel = wordsToSentence(java.util.Arrays.copyOfRange(words, 2, words.length));
uk.ac.gla.focuswatch.model.Task newT = new uk.ac.gla.focuswatch.model.Task(((tasks.size()) + 1), tLabel);
addToAdapter(newT);
} | public void createTask(java.lang.String[] words) {
java.lang.String tLabel = wordsToSentence(java.util.Arrays.copyOfRange(words, 2, words.length));
uk.ac.gla.focuswatch.model.Task newT = new uk.ac.gla.focuswatch.model.Task(((tasks.size()) + 1), tLabel);
addToAdapter(newT);
} |
private boolean isReportTime() throws com.ch4process.utils.CH4P_Exception {
try {
java.util.Calendar now = java.util.Calendar.getInstance();
if (now.after(reportTime)) {
com.ch4process.utils.CH4P_Functions.Log(this.getClass().getName(), CH4P_Functions.LOG_inConsole, 100, "VigieReport : i... | private boolean isReportTime() throws com.ch4process.utils.CH4P_Exception {
try {
java.util.Calendar now = java.util.Calendar.getInstance();
if (now.after(reportTime)) {
return true;
}
return false;
} catch (java.lang.Exception ex) {
throw new com.ch4process.u... |
private CalcModel.Parser.Result factor() throws java.lang.IllegalArgumentException {
CalcModel.Parser.Result result;
if ((currToken()) == '(') {
result = paren();
}else
if ((java.lang.Character.isDigit(currToken())) || ((currToken()) == '?')) {
result = variable();
}else ... | private CalcModel.Parser.Result factor() throws java.lang.IllegalArgumentException {
CalcModel.Parser.Result result;
if ((currToken()) == '(') {
result = paren();
}else
if (java.lang.Character.isDigit(currToken())) {
result = variable();
}else {
throw new java... |
public void addRendels(model.Rendeles rendeles) throws java.sql.SQLException {
addRendelesStem.setInt(1, rendeles.getOsszeg());
addRendelesStem.setInt(2, rendeles.getDarabszam());
addRendelesStem.setInt(3, rendeles.getRendeloId());
addRendelesStem.setBoolean(4, rendeles.isTeljesitve());
addRendelesS... | public void addRendels(model.Rendeles rendeles) throws java.sql.SQLException {
addRendelesStem.setInt(1, rendeles.getOsszeg());
addRendelesStem.setInt(2, rendeles.getDarabszam());
addRendelesStem.setInt(3, rendeles.getRendeloId());
addRendelesStem.executeUpdate();
} |
public static <T extends org.roda.core.data.v2.index.IsIndexed> java.lang.Long count(org.roda.core.data.v2.user.RodaUser user, java.lang.Class<T> classToReturn, org.roda.core.data.adapter.filter.Filter filter) throws org.roda.core.data.exceptions.AuthorizationDeniedException, org.roda.core.data.exceptions.GenericExcept... | public static <T extends org.roda.core.data.v2.index.IsIndexed> java.lang.Long count(final org.roda.core.data.v2.user.RodaUser user, final java.lang.Class<T> classToReturn, final org.roda.core.data.adapter.filter.Filter filter) throws org.roda.core.data.exceptions.AuthorizationDeniedException, org.roda.core.data.except... |
private void saveRequest(com.losd.reqbot.controller.RequestMethod method, java.lang.String bucket, java.util.Map<java.lang.String, java.lang.String> queryParams, java.util.Map<java.lang.String, java.lang.String> headers, java.lang.String body, java.lang.String path) {
save(new com.losd.reqbot.model.Request(bucket, ... | private void saveRequest(java.lang.String method, java.lang.String bucket, java.util.Map<java.lang.String, java.lang.String> queryParams, java.util.Map<java.lang.String, java.lang.String> headers, java.lang.String body, java.lang.String path) {
save(new com.losd.reqbot.model.Request(bucket, headers, body, queryPara... |
private double calculateClientSellAmount(Client c) {
java.lang.System.out.println(c.getName());
double networth = c.getNetworth();
java.lang.System.out.println(("Clients networth in calculateClientSellAmount: " + networth));
double sellLimit = 0;
switch (mode) {
case AGGRESSIVESELLER :
... | private double calculateClientSellAmount(Client c) {
java.lang.System.out.println(c.getName());
double networth = c.getNetworth();
java.lang.System.out.println(("Clients networth in calculateClientSellAmount: " + networth));
double sellLimit = 0;
switch (mode) {
case AGGRESSIVESELLER :
... |
public boolean isArrayProperty() {
if ((myGetMethod) != null) {
return (myGetMethod.parameters().length) == 1;
}else
if ((mySetMethod) != null) {
return (mySetMethod.parameters().length) == 2;
}
throw new java.lang.IllegalArgumentException("Not setter and getter");
} | public boolean isArrayProperty() {
if ((myGetMethod) != null) {
return (myGetMethod.parameters().length) >= 1;
}else
if ((mySetMethod) != null) {
return (mySetMethod.parameters().length) >= 2;
}
throw new java.lang.IllegalArgumentException("Not setter and getter");
} |
public void testAddUnit() throws java.lang.Exception {
com.team7.objects.Tile t = new com.team7.objects.Tile();
com.team7.objects.Player p = new com.team7.objects.Player();
com.team7.objects.Army a = new com.team7.objects.Army(t, 0, p);
com.team7.objects.unit.combatUnit.MeleeUnit u = new com.team7.objec... | public void testAddUnit() throws java.lang.Exception {
com.team7.objects.Tile t = new com.team7.objects.Tile();
com.team7.objects.Player p = new com.team7.objects.Player();
com.team7.objects.Army a = new com.team7.objects.Army(t, p);
com.team7.objects.unit.combatUnit.MeleeUnit u = new com.team7.objects.... |
public void onBackStackChanged() {
try {
int entrys = getSupportFragmentManager().getBackStackEntryCount();
java.lang.String fragmentName = getSupportFragmentManager().getBackStackEntryAt((entrys - 1)).getName();
com.brainSocket.aswaq.enums.FragmentType backFrag = com.brainSocket.aswaq.enums... | public void onBackStackChanged() {
try {
int entrys = getSupportFragmentManager().getBackStackEntryCount();
if (entrys <= 0) {
updateActionbar(FragmentType.Main);
return ;
}
java.lang.String fragmentName = getSupportFragmentManager().getBackStackEntryAt((entry... |
public void testFilterAlwaysFalse() {
java.lang.Integer[] array = new java.lang.Integer[]{ 8 , 9 , 10 , 11 , 12 };
java.util.List<java.lang.Integer> filtered = ((java.util.List<java.lang.Integer>) (ru.spbau.mit.Collections.filter(Predicate.ALWAYS_FALSE, java.util.Arrays.asList(array))));
org.junit.Assert.as... | public void testFilterAlwaysFalse() {
java.lang.Integer[] array = new java.lang.Integer[]{ 8 , 9 , 10 , 11 , 12 };
java.util.List<java.lang.Integer> filtered = ((java.util.List<java.lang.Integer>) (ru.spbau.mit.Collections.filter(Predicate.ALWAYS_FALSE, java.util.Arrays.asList(array))));
org.junit.Assert.as... |
public void merge(net.sharkfw.knowledgeBase.STSet toMerge) throws net.sharkfw.knowledgeBase.SharkKBException {
if (toMerge instanceof net.sharkfw.knowledgeBase.inmemory.InMemoTaxonomy) {
net.sharkfw.knowledgeBase.TaxonomyWrapper imt = ((net.sharkfw.knowledgeBase.TaxonomyWrapper) (toMerge));
net.shar... | public void merge(net.sharkfw.knowledgeBase.STSet toMerge) throws net.sharkfw.knowledgeBase.SharkKBException {
if (toMerge instanceof net.sharkfw.knowledgeBase.inmemory.InMemoTaxonomy) {
net.sharkfw.knowledgeBase.TaxonomyWrapper imt = ((net.sharkfw.knowledgeBase.TaxonomyWrapper) (toMerge));
net.shar... |
public void calculate() throws java.lang.Exception, java.sql.SQLException {
org.magic.api.beans.MagicCollection mc = new org.magic.api.beans.MagicCollection();
mc.setName("Library");
for (org.magic.api.beans.MagicEdition me : list) {
mapCount.put(me, ((100 * (dao.getCardsFromCollection(mc, me).size(... | public void calculate() throws java.lang.Exception, java.sql.SQLException {
org.magic.api.beans.MagicCollection mc = new org.magic.api.beans.MagicCollection();
mc.setName("Library");
for (org.magic.api.beans.MagicEdition me : list) {
mapCount.put(me, dao.getCardsFromCollection(mc, me).size());
}... |
public double getStandardDeviationMessagesPerNode(double mean) {
double averageMessagesPerNode = 0.0;
java.util.Set<java.lang.String> keys = nodeTable.keySet();
for (java.lang.String key : keys) {
Node temp = nodeTable.get(key);
averageMessagesPerNode = +(java.lang.Math.pow((((temp.getMessag... | public double getStandardDeviationMessagesPerNode(double mean) {
double averageMessagesPerNode = 0.0;
java.util.Set<java.lang.String> keys = nodeTable.keySet();
for (java.lang.String key : keys) {
Node temp = nodeTable.get(key);
averageMessagesPerNode += java.lang.Math.pow((((temp.getMessage... |
private java.lang.Long getDeviceIdByDeviceTypeId(int deviceTypeId) {
java.lang.String deviceType = null;
switch (deviceTypeId) {
case 1 :
deviceType = "WATER";
break;
case 2 :
deviceType = "THERMAL";
break;
}
return deviceService.getByDevic... | private java.lang.Long getDeviceIdByDeviceTypeId(int deviceTypeId) {
java.lang.String deviceType = null;
switch (deviceTypeId) {
case 0 :
deviceType = "WATER";
break;
case 1 :
deviceType = "WATER";
break;
case 2 :
deviceType = "... |
public boolean[] getScore() {
boolean[] score = new boolean[this.bugs.size()];
for (int i = 0; i < (n); i++) {
for (Vector mark : this.marks) {
if (markConfig.isEncircled(bugs.get(i), mark)) {
score[i] = true;
break;
}
}
}
return sc... | public boolean[] getScore() {
boolean[] score = new boolean[this.bugs.size()];
for (int i = 0; i < (this.bugs.size()); i++) {
for (java.util.Vector mark : this.marks) {
if (markConfig.isEncircled(bugs.get(i), mark)) {
score[i] = true;
break;
}
... |
private boolean isValidBugReportData(java.lang.String email, java.lang.String description) {
if ((email == null) || (email == "")) {
javax.swing.JOptionPane.showMessageDialog(this, "Email is required.");
return false;
}
if ((description == null) || (description == "")) {
javax.swing.... | private boolean isValidBugReportData(java.lang.String email, java.lang.String description) {
if ((email == null) || (email.isEmpty())) {
javax.swing.JOptionPane.showMessageDialog(this, "Email is required.");
return false;
}
if ((description == null) || (description.isEmpty())) {
java... |
private java.lang.String getRelativeUrlPath(org.hippoecm.hst.core.request.HstRequestContext requestContext, java.lang.String relativeUrlform) {
java.lang.String result = relativeUrlform;
java.lang.String defaultContextPath = mount.getVirtualHost().getVirtualHosts().getDefaultContextPath();
if ((relativeUrlf... | private java.lang.String getRelativeUrlPath(org.hippoecm.hst.core.request.HstRequestContext requestContext, java.lang.String relativeUrlform) {
java.lang.String result = relativeUrlform;
java.lang.String defaultContextPath = mount.getVirtualHost().getVirtualHosts().getDefaultContextPath();
if ((relativeUrlf... |
protected void onActivityResult(int requestCode, int resultCode, android.content.Intent data) {
android.util.Log.i("MakeMachine", ("resultCode: " + resultCode));
switch (resultCode) {
case 0 :
android.util.Log.i("MakeMachine", "User cancelled");
break;
case -1 :
... | protected void onActivityResult(int requestCode, int resultCode, android.content.Intent data) {
switch (resultCode) {
case 0 :
break;
case -1 :
try {
onPhotoTaken();
break;
} catch (java.lang.Exception e) {
e.printSt... |
public void onDateSet(com.fourmob.datetimepicker.date.DatePickerDialog datePickerDialog, int year, int month, int day) {
month = month - 1;
java.lang.String abc = ((((+year) + "-") + month) + "-") + day;
android.widget.Toast.makeText(this, abc, Toast.LENGTH_LONG).show();
editDate0.setText(abc);
} | public void onDateSet(com.fourmob.datetimepicker.date.DatePickerDialog datePickerDialog, int year, int month, int day) {
month = month + 1;
java.lang.String abc = ((((+year) + "-") + month) + "-") + day;
android.widget.Toast.makeText(this, abc, Toast.LENGTH_LONG).show();
editDate0.setText(abc);
} |
public void onClick(android.view.View v) {
switch (v.getId()) {
case R.id.button :
android.util.Log.d(com.example.huang.sudoku.MainActivity.TAG, "DOES NOT WORK");
break;
case R.id.button2 :
openNewGameDialog();
break;
case R.id.button3 :
... | public void onClick(android.view.View v) {
switch (v.getId()) {
case R.id.button :
android.util.Log.d(com.example.huang.sudoku.MainActivity.TAG, "DOES NOT WORK");
break;
case R.id.button2 :
openNewGameDialog();
break;
case R.id.button3 :
... |
public void testRemoveHitBox() throws java.lang.Exception {
bbox.addHitBox(new com.almasb.fxgl.physics.HitBox("ARM", com.almasb.fxgl.physics.BoundingShape.box(40, 40)));
org.junit.Assert.assertEquals(1, bbox.hitBoxesProperty().size());
bbox.removeHitBox("arm");
org.junit.Assert.assertEquals(1, bbox.hitB... | public void testRemoveHitBox() throws java.lang.Exception {
bbox.addHitBox(new com.almasb.fxgl.physics.HitBox("ARM", com.almasb.fxgl.physics.BoundingShape.box(40, 40)));
assertEquals(1, bbox.hitBoxesProperty().size());
bbox.removeHitBox("arm");
assertEquals(1, bbox.hitBoxesProperty().size());
bbox.r... |
protected void onDraw(android.graphics.Canvas canvas) {
int min = java.lang.Math.min(super.getWidth(), super.getHeight());
int offs = min / (com.gmail.wazappdotgithub.ships.common.Constants.DEFAULT_BOARD_SIZE);
drawWater(canvas, offs);
if (!(isInEditMode()))
drawSpecial(canvas, offs);
d... | protected void onDraw(android.graphics.Canvas canvas) {
int min = java.lang.Math.min(this.getWidth(), this.getHeight());
float offs = min / ((float) (com.gmail.wazappdotgithub.ships.common.Constants.DEFAULT_BOARD_SIZE));
drawWater(canvas, offs);
drawGrid(canvas, offs, min);
if (!(isInEditMode()))
... |
private void updateLocation(java.util.List<mysql.result.Location> list) {
java.lang.System.out.println("update location");
javafx.scene.control.TreeItem<mysql.result.Location> rootItem = new javafx.scene.control.TreeItem<mysql.result.Location>(new mysql.result.Location(0, "Welt", "0000", null));
rootItem.se... | private void updateLocation(java.util.List<mysql.result.Location> list) {
javafx.scene.control.TreeItem<mysql.result.Location> rootItem = new javafx.scene.control.TreeItem<mysql.result.Location>(new mysql.result.Location(0, "Welt", "0000", null));
rootItem.setExpanded(true);
for (mysql.result.Location locat... |
public void onLoadFinished(android.support.v4.content.Loader<android.database.Cursor> loader, android.database.Cursor data) {
swipeRefreshLayout.setRefreshing(false);
adapter.setCursor(data);
updateEmptyView();
if ((data.getCount()) == 0)
supportStartPostponedEnterTransition();
else
... | public void onLoadFinished(android.support.v4.content.Loader<android.database.Cursor> loader, android.database.Cursor data) {
adapter.setCursor(data);
swipeRefreshLayout.setRefreshing(false);
updateEmptyView();
if ((data.getCount()) == 0) {
supportStartPostponedEnterTransition();
}else {
... |
private void editItem(ru.napadovskiu.tracker.Item editItem) {
ru.napadovskiu.tracker.Item newEditItem = new ru.napadovskiu.tracker.Item(this.input.ask("please enter the name of item"), this.input.ask("please enter the description of item"));
if (editItem != null) {
newEditItem.setId(editItem.getId());
... | private void editItem(ru.napadovskiu.tracker.Item editItem) {
ru.napadovskiu.tracker.Item newEditItem = new ru.napadovskiu.tracker.Item(this.input.ask("please enter the name of item"), this.input.ask("please enter the description of item"));
if (editItem != null) {
newEditItem.setId(editItem.getId());
... |
public void onValueSelected(com.github.mikephil.charting.data.Entry e, int dataSetIndex, com.github.mikephil.charting.highlight.Highlight h) {
com.github.mikephil.charting.data.BarEntry entry = ((com.github.mikephil.charting.data.BarEntry) (e));
if (entry.isStacked())
android.util.Log.i("VAL SELECTED", ... | public void onValueSelected(com.github.mikephil.charting.data.Entry e, int dataSetIndex, com.github.mikephil.charting.highlight.Highlight h) {
com.github.mikephil.charting.data.BarEntry entry = ((com.github.mikephil.charting.data.BarEntry) (e));
if ((entry.getVals()) != null)
android.util.Log.i("VAL SEL... |
private static void clearQueue(java.util.Collection<org.threadly.concurrent.PriorityScheduler.TaskWrapper> queue, java.util.List<java.lang.Runnable> resultList) {
java.util.Iterator<org.threadly.concurrent.PriorityScheduler.TaskWrapper> it = queue.iterator();
while (it.hasNext()) {
org.threadly.concurre... | private void clearQueue(java.util.Collection<? extends org.threadly.concurrent.PriorityScheduler.TaskWrapper> queue, java.util.List<java.lang.Runnable> resultList) {
java.util.Iterator<? extends org.threadly.concurrent.PriorityScheduler.TaskWrapper> it = queue.iterator();
while (it.hasNext()) {
org.thre... |
private org.eclipse.uml2.uml.ActivityNode execute(final org.workflowlite.core.ExecutionContext context, final java.lang.Object source, final org.eclipse.uml2.uml.OpaqueAction umlAction) {
final org.workflowlite.core.Action<org.workflowlite.core.ExecutionContext, java.lang.Object> actionImplementation = this.beanIns... | private org.eclipse.uml2.uml.ActivityNode execute(final org.workflowlite.core.ExecutionContext context, final java.lang.Object source, final org.eclipse.uml2.uml.OpaqueAction umlAction) {
final org.workflowlite.core.Action<org.workflowlite.core.ExecutionContext, java.lang.Object> actionImplementation = beanInstanti... |
public void deleteArchivedProcessInstance_by_id_should_throw_exception_when_deleteParentArchivedProcessInstanceAndElements_throws_exception() throws java.lang.Exception {
final long archivedProcessInstanceId = 42L;
doReturn(java.util.Collections.singletonList(mock(org.bonitasoft.engine.core.process.instance.mod... | public void deleteArchivedProcessInstance_by_id_should_throw_exception_when_deleteParentArchivedProcessInstanceAndElements_throws_exception() throws java.lang.Exception {
final long archivedProcessInstanceId = 42L;
doReturn(java.util.Collections.singletonList(mock(org.bonitasoft.engine.core.process.instance.mod... |
public void annuler() {
java.lang.System.out.println(("Debut annuler " + (map)));
this.map = annuler_refaire.undo();
if ((joueurCourant) instanceof engine.HumanPlayer)
((engine.HumanPlayer) (joueurCourant)).setCaseJouee(new java.awt.Point(0, 0));
if ((joueurCourant) == (J2))
joueurC... | public void annuler() {
this.map = annuler_refaire.undo();
if ((joueurCourant) instanceof engine.HumanPlayer)
((engine.HumanPlayer) (joueurCourant)).setCaseJouee(new java.awt.Point(0, 0));
if ((joueurCourant) == (J2))
joueurCourant = J1;
else
joueurCourant = J2;
(nu... |
public void endVisit(org.eclipse.jdt.core.dom.Assignment node) {
java.lang.System.out.println(node.toString());
org.eclipse.jdt.core.dom.Expression expressionLeft = node.getLeftHandSide();
org.eclipse.jdt.core.dom.Expression expressionRight = node.getRightHandSide();
metrics22.Assign assign = new metric... | public void endVisit(org.eclipse.jdt.core.dom.Assignment node) {
org.eclipse.jdt.core.dom.Expression expressionLeft = node.getLeftHandSide();
org.eclipse.jdt.core.dom.Expression expressionRight = node.getRightHandSide();
metrics22.Assign assign = new metrics22.Assign(node.getStartPosition(), node.getLength(... |
public deadlybanquet.ai.Whereabouts copy() {
deadlybanquet.model.TimeStamp t = time;
if (t != null)
t = t.copy();
deadlybanquet.ai.PAD p = opinion;
if (p != null)
p = p.copy();
return new deadlybanquet.ai.Whereabouts(room, character, p, certainty, t, null);
} | public deadlybanquet.ai.Whereabouts copy() {
deadlybanquet.model.TimeStamp t = time;
if (t != null)
t = t.copy();
deadlybanquet.ai.PAD p = opinion;
if (p != null)
p = p.copy();
return new deadlybanquet.ai.Whereabouts(character, room, p, certainty, t, null);
} |
protected void service(org.eclipse.equinox.http.servlet.internal.servlet.HttpServletRequest request, org.eclipse.equinox.http.servlet.internal.servlet.HttpServletResponse response) throws java.io.IOException, org.eclipse.equinox.http.servlet.internal.servlet.ServletException {
checkRuntime();
java.lang.String a... | protected void service(org.eclipse.equinox.http.servlet.internal.servlet.HttpServletRequest request, org.eclipse.equinox.http.servlet.internal.servlet.HttpServletResponse response) throws java.io.IOException, org.eclipse.equinox.http.servlet.internal.servlet.ServletException {
checkRuntime();
java.lang.String a... |
public boolean hasNext() {
if ((iterators.size()) == 0)
return false;
boolean res = iterators.get(index).hasNext();
if ((!res) && ((index) < ((iterators.size()) - 1)))
res = iterators.get((++(index))).hasNext();
return res;
} | public boolean hasNext() {
while (true) {
if ((index) > ((iterators.size()) - 1)) {
return false;
}else
if (iterators.get(index).hasNext()) {
return true;
}else {
++(index);
}
}
} |
public static java.lang.Boolean isPositive(java.lang.String value) {
return (((((value.equals("true")) || (value.equals("TRUE"))) || (value.equals("yes"))) || (value.equals("YES"))) || (value.equals("enabled"))) || (value.equals("ENABLED"));
} | public static java.lang.Boolean isPositive(java.lang.String value) {
if (value == null) {
return false;
}
return (((((value.equals("true")) || (value.equals("TRUE"))) || (value.equals("yes"))) || (value.equals("YES"))) || (value.equals("enabled"))) || (value.equals("ENABLED"));
} |
public android.support.v4.app.Fragment getVisibleFragment() {
android.support.v4.app.FragmentManager fragmentManager = mFragmentManager;
java.util.List<android.support.v4.app.Fragment> fragments = fragmentManager.getFragments();
for (android.support.v4.app.Fragment fragment : fragments) {
if ((fragm... | public android.support.v4.app.Fragment getVisibleFragment() {
android.support.v4.app.FragmentManager fragmentManager = mFragmentManager;
java.util.List<android.support.v4.app.Fragment> fragments = fragmentManager.getFragments();
for (int i = (fragments.size()) - 1; i > (-1); i--) {
android.support.v... |
public T extract() {
T data = heapArr[1];
heapArr[1] = heapArr[size()];
heapArr[size()] = null;
indexesMap.remove(heapArr[1]);
(size)--;
heapify(1);
return data;
} | public T extract() {
T data = heapArr[1];
indexesMap.remove(heapArr[1]);
indexesMap.put(heapArr[size()], 1);
heapArr[1] = heapArr[size()];
heapArr[size()] = null;
(size)--;
heapify(1);
return data;
} |
public static java.lang.String capitalize(java.lang.String str) {
if ((str.length()) == 0) {
return str;
}
return (str.substring(0, 1).toUpperCase()) + (str.substring(1).toLowerCase());
} | public static java.lang.String capitalize(java.lang.String str) {
if (str.trim().isEmpty()) {
return str;
}
return (str.substring(0, 1).toUpperCase()) + (str.substring(1).toLowerCase());
} |
public void onClick(android.view.View view) {
for (android.view.View v : views) {
v.setBackgroundColor(Color.TRANSPARENT);
}
if (view instanceof android.widget.TextView) {
android.animation.ObjectAnimator animBgFadeIn = android.animation.ObjectAnimator.ofObject(view, "backgroundColor", new a... | public void onClick(android.view.View view) {
for (android.view.View v : views) {
v.setBackgroundColor(Color.TRANSPARENT);
}
android.animation.ObjectAnimator animBgFadeIn = android.animation.ObjectAnimator.ofObject(view, "backgroundColor", new android.animation.ArgbEvaluator(), android.graphics.Colo... |
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) {
if ((counter) == 1) {
try {
r.addSample(currentSample);
} catch (org.xml.sax.SAXException e) {
e.printStackTrace();
}
}
(counter)--;
} | public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) {
if ((counter) == 1) {
try {
r.addSample(currentSample);
} catch (org.xml.sax.SAXException e) {
e.printStackTrace();
}
(counter)--;
}
} |
private void doHabPosition(org.thehellnet.shab.protocol.line.HabPositionLine line) {
android.content.Intent intent = new android.content.Intent(org.thehellnet.shab.mobile.config.I.COMMAND_HAB_POSITION);
org.thehellnet.shab.protocol.helper.Position position = new org.thehellnet.shab.protocol.helper.Position(line... | private void doHabPosition(org.thehellnet.shab.protocol.line.HabPositionLine line) {
org.thehellnet.shab.protocol.helper.Position position = new org.thehellnet.shab.protocol.helper.Position(line.getLatitude(), line.getLongitude(), line.getAltitude());
shabContext.getHab().setPosition(position);
shabContext.... |
private void decrementIndices(int index) {
for (int i = index; i < (objectCount); i++) {
list[(i - 1)] = list[i];
}
list[size()] = null;
} | private void decrementIndices(int index) {
for (int i = index; i < (size()); i++) {
list[(i - 1)] = list[i];
}
list[size()] = null;
} |
public java.lang.Void visitFunction(io.crate.analyze.symbol.Function symbol, io.crate.analyze.validator.HavingSymbolValidator.HavingContext context) {
if (symbol.info().type().equals(FunctionInfo.Type.AGGREGATE)) {
context.insideAggregation = true;
}
for (io.crate.analyze.symbol.Symbol argument : sy... | public java.lang.Void visitFunction(io.crate.analyze.symbol.Function symbol, io.crate.analyze.validator.HavingSymbolValidator.HavingContext context) {
if ((symbol.info().type()) == (FunctionInfo.Type.AGGREGATE)) {
context.insideAggregation = true;
}
for (io.crate.analyze.symbol.Symbol argument : sym... |
public void questionsFromServerTest() {
nl.han.oose.myenergyprofile.domain.Questions vragen = createQuestionsObject();
org.junit.Assert.assertEquals(new nl.han.oose.myenergyprofile.domain.Hash("808561730").toString(), questionDAO.getQuestionsFromServer().getHash().toString());
org.junit.Assert.assertEquals(... | public void questionsFromServerTest() {
nl.han.oose.myenergyprofile.domain.Questions vragen = createQuestionsObject();
org.junit.Assert.assertEquals(questionDAO.getQuestionsFromServer().getHash().toString(), questionDAO.getQuestionsFromServer().getHash().toString());
org.junit.Assert.assertEquals(vragen.get... |
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
view = ((com.example.robin.test.NineMensMorrisView) (findViewById(R.id.nineMensMorrisView)));
game = new com.example.robin.controller.NineMensMorrisGame(view, ((and... | protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
info = ((android.widget.TextView) (findViewById(R.id.textView)));
view = ((com.example.robin.test.NineMensMorrisView) (findViewById(R.id.nineMensMorrisView)));
... |
public void stopReplication() {
if ((tw.com.inx.ipm.data.IpmDataStoreManager.Pull) != null) {
if ((mListener) != null)
tw.com.inx.ipm.data.IpmDataStoreManager.Pull.removeChangeListener(mListener);
else
tw.com.inx.ipm.data.IpmDataStoreManager.Pull.removeChangeListener(this);
... | public void stopReplication() {
if ((tw.com.inx.ipm.data.IpmDataStoreManager.Pull) != null) {
if ((mListener) != null)
tw.com.inx.ipm.data.IpmDataStoreManager.Pull.removeChangeListener(mListener);
else
tw.com.inx.ipm.data.IpmDataStoreManager.Pull.removeChangeListener(this);
... |
public void audit(io.apiman.manager.api.beans.audit.AuditEntryBean entry) {
try {
logger.info(((Messages.i18n.format("StorageImportDispatcher.ImportingAuditEntry")) + entry));
entry.setId(null);
storage.createAuditEntry(entry);
} catch (io.apiman.manager.api.core.exceptions.StorageExcept... | public void audit(io.apiman.manager.api.beans.audit.AuditEntryBean entry) {
try {
logger.info(((Messages.i18n.format("StorageImportDispatcher.ImportingAuditEntry")) + (entry.getId())));
entry.setId(null);
storage.createAuditEntry(entry);
} catch (io.apiman.manager.api.core.exceptions.Sto... |
public int runAll() {
int sum = 0;
for (int i = 0; i < (((coreSize) - (p1size)) - (p2size)); i++) {
sum += (run(i)) - 1;
}
if (sum > 0) {
return 1;
}
if (sum < 0) {
return -1;
}
return 0;
} | public int runAll() {
int sum = 0;
for (int i = 0; i < (((coreSize) - (p1size)) - (p2size)); i++) {
sum += (run(i)) - 1;
}
return sum;
} |
public static void test_031() {
framework.common.GalleryCommon.deleteMoreGallery();
framework.common.GalleryCommon.clickGallery();
excute(testcase.Object_Description, testcase.Operation_ClickWait, "更多选项");
excute(testcase.Object_Text, testcase.Operation_ClickWait, "删除");
check(testcase.Object_Text, ... | public static void test_031() {
framework.common.GalleryCommon.deleteMoreGallery();
framework.common.GalleryCommon.clickGallery();
excute(testcase.Object_Description, testcase.Operation_ClickWait, "更多选项");
excute(testcase.Object_Text, testcase.Operation_ClickWait, "删除");
excute(testcase.Object_Text,... |
private void writeResult(java.lang.String result) {
java.io.File f = new java.io.File(LOGFILEPATH);
try {
java.io.FileWriter writer = new java.io.FileWriter(f);
writer.write(result);
writer.flush();
writer.close();
} catch (java.lang.Exception e) {
e.printStackTrace()... | public void writeResult(java.lang.String result) {
java.io.File f = new java.io.File(LOGFILEPATH);
try {
java.io.FileWriter writer = new java.io.FileWriter(f);
writer.write(result);
writer.flush();
writer.close();
} catch (java.lang.Exception e) {
e.printStackTrace();... |
public void execute(org.openpixi.pixi.physics.grid.Grid grid, int[] coor) {
org.openpixi.pixi.physics.grid.LinkMatrix V;
for (int k = 0; k < (coor.length); k++) {
V = grid.getE(coor, k).mult((-(at))).getLinkExact();
grid.setUnext(coor, k, V.mult(grid.getU(coor, k)));
}
} | public void execute(org.openpixi.pixi.physics.grid.Grid grid, int[] coor) {
org.openpixi.pixi.physics.grid.LinkMatrix V;
for (int k = 0; k < (coor.length); k++) {
V = grid.getE(coor, k).mult(at).getLinkExact();
grid.setUnext(coor, k, grid.getU(coor, k).mult(V));
}
} |
private void initRadioButtonsState() {
java.lang.String currentAcceptedConnectivity = com.example.blanche.projetfinal.DatabaseManager.getPreferencesManager().getNetworkConnectivity();
if (currentAcceptedConnectivity == null) {
com.example.blanche.projetfinal.DatabaseManager.getPreferencesManager().updat... | private void initRadioButtonsState() {
java.lang.String currentAcceptedConnectivity = com.example.blanche.projetfinal.DatabaseManager.getPreferencesManager().getNetworkConnectivity();
if (currentAcceptedConnectivity == null) {
com.example.blanche.projetfinal.DatabaseManager.getPreferencesManager().updat... |
public void onClick11(android.view.View v) {
android.widget.TextView tag = ((android.widget.TextView) (findViewById(R.id.tagudt)));
if (tags.equalsIgnoreCase("")) {
tags += "vegi";
tag.setText(tags);
}else {
if (!(deleteDucplicate("vegi"))) {
tags += ",vegi";
... | public void onClick11(android.view.View v) {
android.widget.TextView tag = ((android.widget.TextView) (findViewById(R.id.tagudt)));
if (tags.equalsIgnoreCase("")) {
tags += "vegi";
tag.setText(tags);
}else {
if (!(deleteDucplicate("vegi"))) {
tags += ",vegi";
}
... |
public static long transfer(java.io.File source, java.io.File target) throws java.io.IOException {
java.io.FileInputStream in = null;
java.io.FileOutputStream out = null;
try {
in = new java.io.FileInputStream(source);
out = new java.io.FileOutputStream(target);
return org.qfox.jestf... | public static long transfer(java.io.File source, java.io.File target) throws java.io.IOException {
java.io.FileInputStream in = null;
java.io.FileOutputStream out = null;
try {
in = new java.io.FileInputStream(source);
out = new java.io.FileOutputStream(target);
return org.qfox.jestf... |
public org.opendaylight.ovsdb.lib.notation.Column<org.opendaylight.ovsdb.lib.schema.GenericTableSchema, java.util.Set<java.lang.Integer>> getOpenFlowPortColumn() {
java.util.Set<java.lang.Integer> portSet = openFlowPort;
if (portSet != null) {
if (portSet.contains(java.lang.Integer.valueOf(0))) {
... | public org.opendaylight.ovsdb.lib.notation.Column<org.opendaylight.ovsdb.lib.schema.GenericTableSchema, java.util.Set<java.lang.Long>> getOpenFlowPortColumn() {
java.util.Set<java.lang.Long> portSet = openFlowPort;
if (portSet != null) {
if (portSet.contains(java.lang.Long.valueOf(0))) {
por... |
public static function.external.subrvis.SubRvisGene getExonDomain(java.lang.String geneName, java.lang.String chr, int pos) {
java.util.ArrayList<function.external.subrvis.SubRvisGene> exonMap = function.external.subrvis.SubRvisManager.geneExonMap.get(geneName);
for (function.external.subrvis.SubRvisGene exon :... | public static function.external.subrvis.SubRvisGene getExonDomain(java.lang.String geneName, java.lang.String chr, int pos) {
java.util.ArrayList<function.external.subrvis.SubRvisGene> exonMap = function.external.subrvis.SubRvisManager.geneExonMap.get(geneName);
if (exonMap != null) {
for (function.exte... |
public void onClick(android.view.View v) {
switch (v.getId()) {
case R.id.imageButton :
mCheckedContacts = null;
android.content.Intent intent = new android.content.Intent(getApplicationContext(), com.byteshatf.callrecorder.contactpicker.ContactsPicker.class);
intent.putE... | public void onClick(android.view.View v) {
switch (v.getId()) {
case R.id.imageButton :
android.content.Intent intent = new android.content.Intent(getApplicationContext(), com.byteshatf.callrecorder.contactpicker.ContactsPicker.class);
intent.putExtra("pre_checked", mCheckedContacts)... |
public it.soprasteria.pianificazione.v2.bean.UserBean getUserFromUserPrincipal(java.lang.String userPrincipal) {
it.soprasteria.pianificazione.v2.bean.UserBean userBean = dao.findByUsername(userPrincipal);
java.util.List<java.lang.String> buList = new java.util.ArrayList<>();
java.lang.String divisione = us... | public it.soprasteria.pianificazione.v2.bean.UserBean getUserFromUserPrincipal(java.lang.String userPrincipal) {
it.soprasteria.pianificazione.v2.bean.UserBean userBean = dao.findByUsername(userPrincipal);
if (userBean != null) {
java.util.List<java.lang.String> buList = new java.util.ArrayList<>();
... |
private void switchView() {
stopCamera();
if (this.isBackCamera) {
this.startCamera(1, false);
setFlashButtons(false, false);
}else {
this.startCamera(0, false);
setFlashButtons(true, false);
}
this.isBackCamera = !(this.isBackCamera);
startPreview(surfaceView.get... | private void switchView() {
stopCamera();
if (this.isBackCamera) {
this.isBackCamera = !(this.isBackCamera);
this.startCamera(1, false);
setFlashButtons(false, false);
}else {
this.isBackCamera = !(this.isBackCamera);
this.startCamera(0, false);
setFlashButton... |
public void attend(java.util.concurrent.locks.Lock lock) {
try {
rai.leaveRai(this);
lock.unlock();
java.lang.Thread.sleep(2000);
java.lang.System.out.println(((this) + " has left the rai"));
} catch (java.lang.InterruptedException e) {
e.printStackTrace();
}
} | public void attend(java.util.concurrent.locks.Lock lock) {
try {
lock.unlock();
java.lang.Thread.sleep(2000);
rai.leaveRai(this);
java.lang.System.out.println(((this) + " has left the rai"));
} catch (java.lang.InterruptedException e) {
e.printStackTrace();
}
} |
public void write(io.netty.buffer.ByteBuf buf) throws java.lang.Exception {
buf.writeInt(seed);
buf.writeByte(dimension);
buf.writeInt(generator);
buf.writeInt(gamemode);
buf.writeLong(entityId);
buf.writeInt(spawnX);
buf.writeInt(spawnY);
buf.writeInt(spawnZ);
buf.writeFloat(x);
... | public void write(io.netty.buffer.ByteBuf buf) throws java.lang.Exception {
buf.writeInt(seed);
buf.writeByte(dimension);
buf.writeInt(generator);
buf.writeInt(gamemode);
buf.writeLong(entityId);
buf.writeInt(spawnX);
buf.writeInt(spawnY);
buf.writeInt(spawnZ);
buf.writeFloat(x);
... |
private fitnesse.http.Response createChildPageAndMakeResponse(fitnesse.FitNesseContext context) {
createChildPage();
fitnesse.http.SimpleResponse response = new fitnesse.http.SimpleResponse();
fitnesse.responders.editing.WikiPagePath fullPathOfCurrentPage = currentPage.getPageCrawler().getFullPath();
re... | private fitnesse.http.Response createChildPageAndMakeResponse(fitnesse.FitNesseContext context) {
createChildPage(context);
fitnesse.http.SimpleResponse response = new fitnesse.http.SimpleResponse();
fitnesse.responders.editing.WikiPagePath fullPathOfCurrentPage = currentPage.getPageCrawler().getFullPath();... |
public static void handle(final java.lang.String info, final java.lang.Exception e, final boolean printTrace, java.lang.Class<?> derivedClass, java.lang.Class<?> baseClass, java.lang.Class<?> subClass) {
ExceptionHandler.handle(info, e, true, derivedClass, baseClass, subClass, true);
} | public static void handle(final java.lang.String info, final java.lang.Throwable e, final boolean printTrace, java.lang.Class<?> derivedClass, java.lang.Class<?> baseClass, java.lang.Class<?> subClass) {
ExceptionHandler.handle(info, e, true, derivedClass, baseClass, subClass, true);
} |
public java.lang.String toString() {
java.lang.String s = "";
for (int h = 0; h < (height); h++) {
s += "[";
for (int w = 0; w < (width); w++) {
s += (values[h][w]) + "\t\t";
}
s += "]\n";
}
return s;
} | public java.lang.String toString() {
java.lang.String s = "";
for (int h = 0; h < (height); h++) {
s += "[";
for (int w = 0; w < (width); w++) {
s += (values[h][w]) + "\t";
}
s += "]\n";
}
return s;
} |
public void onReceive(android.content.Context context, android.content.Intent intent) {
if (intent.getAction().matches("android.location.PROVIDERS_CHANGED")) {
if (!(((android.location.LocationManager) (context.getSystemService(Context.LOCATION_SERVICE))).isProviderEnabled(LocationManager.GPS_PROVIDER))) {
... | public void onReceive(android.content.Context context, android.content.Intent intent) {
if (intent.getAction().matches("android.location.PROVIDERS_CHANGED")) {
if (!(((android.location.LocationManager) (context.getSystemService(Context.LOCATION_SERVICE))).isProviderEnabled(LocationManager.GPS_PROVIDER))) {
... |
private void setDate(final java.lang.String date) {
java.lang.String[] dateVec = date.split("-");
time = new java.util.GregorianCalendar(java.lang.Integer.parseInt(dateVec[0]), java.lang.Integer.parseInt(dateVec[1]), java.lang.Integer.parseInt(dateVec[2]));
} | private void setDate(final java.lang.String date) {
java.lang.String[] dateVec = date.split("-");
time = new java.util.GregorianCalendar(java.lang.Integer.parseInt(dateVec[0]), ((java.lang.Integer.parseInt(dateVec[1])) - 1), java.lang.Integer.parseInt(dateVec[2]));
} |
public static void spawnAlgae() {
for (int i = 0; i < (Params.refresh_algae_count); i++) {
try {
assignment4.Critter.makeCritter("Algae");
} catch (assignment4.InvalidCritterException e) {
e.printStackTrace();
}
assignment4.CritterWorld.getWorld()[java.lang.Ma... | public static void spawnAlgae() {
for (int i = 0; i < (Params.refresh_algae_count); i++) {
try {
assignment4.Critter.makeCritter("Algae");
} catch (assignment4.InvalidCritterException e) {
e.printStackTrace();
}
assignment4.CritterWorld.getWorld()[java.lang.Ma... |
private double calcColor(Pixel center, Image image) {
java.util.List<Pixel> omega = getPixelsInWindow(center, image);
double normal = calcSum(center, omega, 1, image);
double summation = calcSum(center, omega, image.getColor(center), image);
return summation / normal;
} | private double calcColor(Pixel center, Image image) {
java.util.List<Pixel> omega = getPixelsInWindow(center, image);
double normal = calcSum(image, center, omega, false);
double summation = calcSum(image, center, omega, true);
return summation / normal;
} |
public void put(minijava.node.TId id, minijava.node.PType retType, java.util.LinkedList<minijava.node.PFormal> formals, java.util.LinkedList<minijava.node.PVarDecl> locals) throws java.lang.Exception {
java.lang.String name = id.getText();
if (table.containsKey(name)) {
java.lang.String msg = (name + " ... | public void put(minijava.node.TId id, minijava.node.PType retType, java.util.LinkedList<minijava.node.PFormal> formals, java.util.LinkedList<minijava.node.PVarDecl> locals) throws java.lang.Exception {
java.lang.String name = id.getText();
if (table.containsKey(name)) {
java.lang.String msg = (name + " ... |
public boolean checkSat(jbse.bc.ClassHierarchy hier, boolean value) throws java.io.IOException, jbse.dec.exc.ExternalProtocolInterfaceException {
if (!(this.hasCurrentClause)) {
throw new jbse.dec.exc.ExternalProtocolInterfaceException("Attempted to check satisfiability with no current clause.");
}
... | public boolean checkSat(jbse.bc.ClassHierarchy hier, boolean value) throws java.io.IOException, jbse.dec.exc.ExternalProtocolInterfaceException {
if (!(this.hasCurrentClause)) {
throw new jbse.dec.exc.ExternalProtocolInterfaceException("Attempted to check satisfiability with no current clause.");
}
... |
public void testInsertionSort() {
int[] arr = new int[]{ 4 , 2 , 5 , 1 , 0 , 9 , 123 };
com.naptex.study.dsa.sort.MergeSort sorter = new com.naptex.study.dsa.sort.MergeSort();
sorter.insertionSort(arr);
int[] sortedArr = new int[]{ 0 , 1 , 2 , 4 , 5 , 9 , 123 };
org.junit.Assert.assertTrue(java.util... | public void testInsertionSort() {
int[] arr = new int[]{ 4 , 2 , 5 , 1 , 0 , 9 , 123 };
com.naptex.study.dsa.sort.MergeSort sorter = new com.naptex.study.dsa.sort.MergeSort();
sorter.insertionSort(arr, 0, ((arr.length) - 1));
int[] sortedArr = new int[]{ 0 , 1 , 2 , 4 , 5 , 9 , 123 };
org.junit.Asse... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.