buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
private void visitChildren(final java.util.List<org.apache.parquet.format.SchemaElement> result, org.apache.parquet.schema.GroupType groupType, org.apache.parquet.format.SchemaElement element) {
element.setNum_children(groupType.getFieldCount());
result.add(element);
for (org.apache.parquet.format.Type fiel... | private void visitChildren(final java.util.List<org.apache.parquet.format.SchemaElement> result, org.apache.parquet.schema.GroupType groupType, org.apache.parquet.format.SchemaElement element) {
element.setNum_children(groupType.getFieldCount());
result.add(element);
for (org.apache.parquet.format.Type fiel... |
public void onClick(android.view.View view) {
android.widget.Button b = ((android.widget.Button) (findViewById(R.id.btn_1)));
boolean flag = calculator.insert(((java.lang.String) (b.getText())));
if (flag) {
android.widget.TextView txt_result1 = ((android.widget.TextView) (findViewById(R.id.txt_resu... | public void onClick(android.view.View view) {
boolean flag = calculator.insert("0");
if (flag) {
android.widget.TextView txt_result1 = ((android.widget.TextView) (findViewById(R.id.txt_result1)));
txt_result1.setText(calculator.toString());
}
} |
public void sendRTPPacket(byte[] data, java.net.InetAddress dstAddress, int dstPort) throws java.io.IOException {
RTPPacket sendPacket;
RTPHeader sendHeader = new RTPHeader(srcPort, dstPort, sequenceNumber);
sendPacket = new RTPPacket(sendHeader, data);
sendPacket.updateChecksum();
data = sendPacket... | public void sendRTPPacket(byte[] data) throws java.io.IOException {
RTPPacket sendPacket;
RTPHeader sendHeader = new RTPHeader(srcPort, dstPort, sequenceNumber);
sendPacket = new RTPPacket(sendHeader, data);
sendPacket.updateChecksum();
data = sendPacket.getPacketByteArray();
socket.send(new jav... |
public static org.bukkit.block.Block getSourceBlock(org.bukkit.entity.Player player, double range, com.projectkorra.projectkorra.util.BlockSource.BlockSourceType sourceType, com.projectkorra.projectkorra.util.ClickType clickType) {
com.projectkorra.projectkorra.util.BlockSourceInformation info = com.projectkorra.pr... | public static org.bukkit.block.Block getSourceBlock(org.bukkit.entity.Player player, double range, com.projectkorra.projectkorra.util.BlockSource.BlockSourceType sourceType, com.projectkorra.projectkorra.util.ClickType clickType) {
com.projectkorra.projectkorra.util.BlockSourceInformation info = com.projectkorra.pr... |
public static void mainLoop(com.andrewsoutar.cmp128.Utilities.GenericScanner kbdScanner, com.andrewsoutar.cmp128.Utilities.Function header, com.andrewsoutar.cmp128.Utilities.MenuAction[] choices) {
java.util.HashMap<java.lang.String, com.andrewsoutar.cmp128.Utilities.MenuAction> choicesMap = new java.util.LinkedHas... | public static void mainLoop(com.andrewsoutar.cmp128.Utilities.GenericScanner kbdScanner, com.andrewsoutar.cmp128.Utilities.Function header, com.andrewsoutar.cmp128.Utilities.MenuAction[] choices) {
java.util.HashMap<java.lang.String, com.andrewsoutar.cmp128.Utilities.MenuAction> choicesMap = new java.util.LinkedHas... |
public void testGetCashWithZeroMoneyOnAccount() {
double moneyOnAccount = 0;
double ammount = 10;
ua.yandex.atmtest.Account account = mock(ua.yandex.atmtest.Account.class);
when(account.getBalance()).thenReturn(moneyOnAccount);
ua.yandex.atmtest.MyATM atm = new ua.yandex.atmtest.MyATM(account);
... | public void testGetCashWithZeroMoneyOnAccount() {
double moneyOnAccount = 0;
double ammount = 10;
ua.yandex.atmtest.Account account = mock(ua.yandex.atmtest.Account.class);
when(account.getBalance()).thenReturn(moneyOnAccount);
ua.yandex.atmtest.MyATM atm = new ua.yandex.atmtest.MyATM(account);
... |
public static void main(java.lang.String[] args) {
try {
mmtweet.dao.AccessDB db = new mmtweet.dao.AccessDB();
mmtweet.pojos.Location loc1 = new mmtweet.pojos.Location(12.123456, 24.123456);
db.init();
db.getCommentedMessagesByUserId("vivek");
db.destroy();
} catch (java.... | public static void main(java.lang.String[] args) {
try {
mmtweet.dao.AccessDB db = new mmtweet.dao.AccessDB();
mmtweet.pojos.Location loc1 = new mmtweet.pojos.Location(12.123456, 24.123456);
db.init();
db.destroy();
} catch (java.lang.Exception e) {
java.lang.System.out.p... |
public com.erbis.java.courses.algorithms.sort.SortStat sort(int[] array) {
com.erbis.java.courses.algorithms.sort.SortStat sortStat = new com.erbis.java.courses.algorithms.sort.SortStat();
sortStat.setSize(array.length);
long startTime = java.lang.System.currentTimeMillis();
sort(array, sortStat);
s... | public com.erbis.java.courses.algorithms.sort.SortStat sort(int[] array) {
com.erbis.java.courses.algorithms.sort.SortStat sortStat = new com.erbis.java.courses.algorithms.sort.SortStat(array.length);
long startTime = java.lang.System.currentTimeMillis();
sort(array, sortStat);
sortStat.setTime(((java.l... |
public void instanceAutobindForPhysical8SocketNotEnoughUneven() {
java.util.List<org.candlepin.model.Pool> pools = createInstanceBasedPool();
pools.get(0).setQuantity(7L);
setupConsumer("8", false);
assertEquals(null, autobindRules.selectBestPools(consumer, new java.lang.String[]{ productId }, pools, co... | public void instanceAutobindForPhysical8SocketNotEnoughUneven() {
java.util.List<org.candlepin.model.Pool> pools = createInstanceBasedPool();
pools.get(0).setQuantity(7L);
setupConsumer("8", false);
assertEquals(0, autobindRules.selectBestPools(consumer, new java.lang.String[]{ productId }, pools, compl... |
private boolean isPrePreviousLineEmpty(com.puppycrawl.tools.checkstyle.api.DetailAST token) {
final int lineNo = token.getLineNo();
final int number = 3;
final java.lang.String prePreviousLine = getLines()[(lineNo - number)];
return prePreviousLine.trim().isEmpty();
} | private boolean isPrePreviousLineEmpty(com.puppycrawl.tools.checkstyle.api.DetailAST token) {
boolean result = false;
final int lineNo = token.getLineNo();
final int number = 3;
if (lineNo >= number) {
final java.lang.String prePreviousLine = getLines()[(lineNo - number)];
result = prePr... |
private void setTv(com.connectsdk.device.ConnectableDevice tv) {
if (tv == null) {
stopTvApplication();
}else {
mTV = tv;
mMediaPlayer = mTV.getCapability(com.connectsdk.service.capability.MediaPlayer.class);
mMediaControl = mTV.getCapability(com.connectsdk.service.capability.Med... | private void setTv(com.connectsdk.device.ConnectableDevice tv) {
if (tv == null) {
stopTvApplication();
}else {
mTV = tv;
mMediaPlayer = mTV.getCapability(com.connectsdk.service.capability.MediaPlayer.class);
mMediaControl = mTV.getCapability(com.connectsdk.service.capability.Med... |
public void clearSelection() {
for (int i = 0; i < (selectedItems.size()); i++) {
if (selectedItems.get(i)) {
selectedItems.put(i, false);
notifyItemChanged(i);
}
}
} | public void clearSelection() {
for (int i = 0; i <= (selectedItems.size()); i++) {
if (selectedItems.get(i)) {
selectedItems.put(i, false);
notifyItemChanged(i);
}
}
} |
public synchronized void serialEvent(SerialPortEvent oEvent) {
if ((oEvent.getEventType()) == (SerialPortEvent.DATA_AVAILABLE)) {
try {
java.lang.String inputLine = in.readLine();
input = new java.lang.String(inputLine);
java.lang.System.out.println(input);
} catc... | public synchronized void serialEvent(SerialPortEvent oEvent) {
if ((oEvent.getEventType()) == (SerialPortEvent.DATA_AVAILABLE)) {
try {
java.lang.String inputLine = in.readLine();
input = new java.lang.String(inputLine);
java.lang.System.out.println(input);
} catc... |
public com.couchbase.cbforest.QueryIterator query(long skip, long limit, boolean descending, boolean inclusiveStart, boolean inclusiveEnd, java.lang.Object[] keys) throws com.couchbase.cbforest.ForestException {
long[] keyHandles = new long[keys.length];
int i = 0;
for (java.lang.Object key : keys) {
... | public com.couchbase.cbforest.QueryIterator query(long skip, long limit, boolean descending, boolean inclusiveStart, boolean inclusiveEnd, java.lang.Object[] keys) throws com.couchbase.cbforest.ForestException {
long[] keyHandles = new long[keys.length];
int i = 0;
for (java.lang.Object key : keys) {
... |
private void initLifts(final boolean isTrainingMaxes) {
lifts = new java.util.ArrayList<>();
lifts.add(new com.habna.dev.fivethreeone.Models.Lift(Lift.BODY_TYPE.CHEST, weekType, trainingMaxes.get(Lift.BODY_TYPE.CHEST)));
lifts.add(new com.habna.dev.fivethreeone.Models.Lift(Lift.BODY_TYPE.BACK, weekType, tra... | private void initLifts() {
lifts = new java.util.ArrayList<>();
lifts.add(new com.habna.dev.fivethreeone.Models.Lift(Lift.BODY_TYPE.CHEST, weekType, trainingMaxes.get(Lift.BODY_TYPE.CHEST)));
lifts.add(new com.habna.dev.fivethreeone.Models.Lift(Lift.BODY_TYPE.BACK, weekType, trainingMaxes.get(Lift.BODY_TYPE... |
public void validate() {
super.validate();
if (((this.getStrutsAction()) == (com.agiletec.apsadmin.system.ApsAdminSystemConstants.ADD)) || ((this.getStrutsAction()) == (com.agiletec.apsadmin.system.ApsAdminSystemConstants.PASTE))) {
this.checkParentNode(this.getParentCategoryCode());
}
this.chec... | public void validate() {
super.validate();
if (((this.getStrutsAction()) == (com.agiletec.apsadmin.system.ApsAdminSystemConstants.ADD)) || ((this.getStrutsAction()) == (com.agiletec.apsadmin.system.ApsAdminSystemConstants.PASTE))) {
this.checkParentNode(this.getParentCategoryCode());
}
this.chec... |
public static byte[] mappedIPv4ToRealIPv4(byte[] addr) {
if (org.ice4j.ice.NetworkUtils.isMappedIPv4Addr(addr)) {
byte[] newAddr = new byte[org.ice4j.ice.NetworkUtils.IN4_ADDR_SIZE];
java.lang.System.arraycopy(addr, 12, newAddr, 0, org.ice4j.ice.NetworkUtils.IN6_ADDR_SIZE);
return newAddr;
... | public static byte[] mappedIPv4ToRealIPv4(byte[] addr) {
if (org.ice4j.ice.NetworkUtils.isMappedIPv4Addr(addr)) {
byte[] newAddr = new byte[org.ice4j.ice.NetworkUtils.IN4_ADDR_SIZE];
java.lang.System.arraycopy(addr, 12, newAddr, 0, org.ice4j.ice.NetworkUtils.IN4_ADDR_SIZE);
return newAddr;
... |
public void initialize(org.openpixi.pixi.physics.Simulation s) {
this.stepInterval = ((int) ((timeInterval) / (s.getTimeStep())));
if (computeEnergyDensity) {
energyDensityComputation.initialize(s.grid, direction);
}
if (computePoyntingVector) {
poyntingComputation.initialize(s.grid, dir... | public void initialize(org.openpixi.pixi.physics.Simulation s) {
this.stepInterval = ((int) (java.lang.Math.round(((timeInterval) / (s.getTimeStep())))));
if (computeEnergyDensity) {
energyDensityComputation.initialize(s.grid, direction);
}
if (computePoyntingVector) {
poyntingComputatio... |
public void register(android.content.Context mContext) {
this.mContext = mContext;
android.content.IntentFilter intentFilter = new android.content.IntentFilter();
intentFilter.addAction(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION);
intentFilter.addAction(WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION);
... | public void register(android.content.Context mContext) {
this.mContext = mContext;
android.content.IntentFilter intentFilter = new android.content.IntentFilter();
intentFilter.addAction(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION);
intentFilter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTIO... |
private void populateDataForList() {
pbList.setVisibility(View.VISIBLE);
lvTasks.setEmptyView(txtEmptyList);
final com.training.tiennguyen.todoappproject.databases.TaskDBHelper dbHelper = new com.training.tiennguyen.todoappproject.databases.TaskDBHelper(this);
final java.util.List<com.training.tiennguye... | private void populateDataForList() {
pbList.setVisibility(View.VISIBLE);
final com.training.tiennguyen.todoappproject.databases.TaskDBHelper dbHelper = new com.training.tiennguyen.todoappproject.databases.TaskDBHelper(this);
final java.util.List<com.training.tiennguyen.todoappproject.models.TaskModel> list ... |
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (((!hasFocus) && (!(titleEdit.isFocused()))) && (!(bodyEdit.isFocused())))
imm.hideSoftInputFromWindow(titleEdit.getWindowToken(), 0);
} | public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (!hasFocus)
if (((imm) != null) && ((titleEdit) != null))
imm.hideSoftInputFromWindow(titleEdit.getWindowToken(), 0);
} |
public void visitMainTask_OneGlobalDefinedVariable_CorrectPythonScript() throws java.lang.Exception {
java.lang.String a = (((((((((("" + (de.fhg.iais.roberta.syntax.codegen.AstToEv3PythonVisitorTest.IMPORTS)) + (de.fhg.iais.roberta.syntax.codegen.AstToEv3PythonVisitorTest.GLOBALS)) + "\nElement = 0\n") + "Element2... | public void visitMainTask_OneGlobalDefinedVariable_CorrectPythonScript() throws java.lang.Exception {
java.lang.String a = ((((((((((("" + (de.fhg.iais.roberta.syntax.codegen.AstToEv3PythonVisitorTest.IMPORTS)) + (de.fhg.iais.roberta.syntax.codegen.AstToEv3PythonVisitorTest.GLOBALS)) + "\nElement = 0\n") + "Element... |
public void addRobot(final org.jointheleague.graphical.robot.Robot r) {
javax.swing.SwingUtilities.invokeLater(new java.lang.Runnable() {
public void run() {
robotList.add(r);
}
});
if ((ticker) == null) {
ticker = new javax.swing.Timer((1000 / 30), r);
ticker.sta... | public void run() {
robotList.add(r);
if ((ticker) == null) {
ticker = new javax.swing.Timer((1000 / 30), r);
ticker.start();
}else {
ticker.addActionListener(r);
}
} |
private void updateSelectedTab(int newPosition) {
int newTabId = getTabAtPosition(newPosition).getId();
if ((newPosition != (currentTabPosition)) && ((onTabSelectListener) != null)) {
currentTabPosition = newPosition;
onTabSelectListener.onTabSelected(newTabId);
}else
if (((onTabRese... | private void updateSelectedTab(int newPosition) {
int newTabId = getTabAtPosition(newPosition).getId();
if (newPosition != (currentTabPosition)) {
if ((onTabSelectListener) != null) {
onTabSelectListener.onTabSelected(newTabId);
}
}else
if (((onTabReselectListener) != nul... |
protected java.io.File persistentPath(build.pluto.buildjava.JavaBuilder.Input input) {
if ((input.inputFiles.length) == 1) {
return correspondingBinPath(org.sugarj.common.FileCommands.replaceExtension(input.inputFiles[0], "dep"), input);
}
int hash = java.util.Arrays.hashCode(input.inputFiles);
... | protected java.io.File persistentPath(build.pluto.buildjava.JavaBuilder.Input input) {
if ((input.inputFiles.size()) == 1) {
return correspondingBinPath(org.sugarj.common.FileCommands.replaceExtension(input.inputFiles.get(0), "dep"), input);
}
int hash = input.inputFiles.hashCode();
return new j... |
public java.util.List<com.uf.nomad.mobitrace.database.ActivityTuple> getActivityList(java.lang.String dev_id) {
android.database.Cursor c = getAllActivityNotSent();
java.util.List<com.uf.nomad.mobitrace.database.ActivityTuple> actList = new java.util.ArrayList<com.uf.nomad.mobitrace.database.ActivityTuple>();
... | public java.util.List<com.uf.nomad.mobitrace.database.ActivityTuple> getActivityList() {
android.database.Cursor c = getAllActivityNotSent();
java.util.List<com.uf.nomad.mobitrace.database.ActivityTuple> actList = new java.util.ArrayList<>();
c.moveToFirst();
while (!(c.isAfterLast())) {
com.uf.... |
public static android.graphics.drawable.Drawable decodeFileOrThrow(@android.support.annotation.Nullable
final android.content.res.Resources res, final java.lang.String filePath, @android.support.annotation.Nullable
final android.graphics.BitmapFactory.Options options) throws java.io.IOException {
if (filePath == nu... | public static android.graphics.drawable.Drawable decodeFileOrThrow(@android.support.annotation.Nullable
final android.content.res.Resources res, final java.lang.String filePath, @android.support.annotation.Nullable
final android.graphics.BitmapFactory.Options options) throws java.io.IOException {
if (filePath == nu... |
public void onAttach(android.app.Activity activity) {
android.util.Log.i(com.example.oce.langlock.QuestionsFragment.TAG, ((getClass().getSimpleName()) + ":entered onAttach()"));
super.onAttach(activity);
try {
mListener = ((com.example.oce.langlock.QuestionsFragment.ListSelectionListener) (activity)... | public void onAttach(android.app.Activity activity) {
super.onAttach(activity);
try {
mListener = ((com.example.oce.langlock.QuestionsFragment.ListSelectionListener) (activity));
} catch (java.lang.ClassCastException e) {
throw new java.lang.ClassCastException(((activity.toString()) + " must... |
public void release() {
if ((rendererBuilder) != null) {
rendererBuilder.cancel();
}
if ((audioCapabilitiesReceiver) != null) {
audioCapabilitiesReceiver.unregister();
}
rendererBuildingState = com.devbrackets.android.exomedia.core.exoplayer.EMExoPlayer.RenderBuildingState.IDLE;
... | public void release() {
if ((rendererBuilder) != null) {
rendererBuilder.cancel();
}
if ((audioCapabilitiesReceiver) != null) {
audioCapabilitiesReceiver.unregister();
audioCapabilitiesReceiver = null;
}
rendererBuildingState = com.devbrackets.android.exomedia.core.exoplayer.... |
private boolean isObjectAttributeEquals(java.lang.Object o, java.lang.String attribute, java.lang.Object value) throws org.openflexo.model.factory.ModelDefinitionException {
org.openflexo.model.factory.ProxyMethodHandler<?> handler = getModelFactory().getHandler(object);
if (handler != null) {
java.lang... | private boolean isObjectAttributeEquals(java.lang.Object o, java.lang.String attribute, java.lang.Object value) throws org.openflexo.model.factory.ModelDefinitionException {
org.openflexo.model.factory.ProxyMethodHandler<?> handler = getModelFactory().getHandler(o);
if (handler != null) {
java.lang.Obje... |
public static int generateRandomNonce(final byte[] nonceBuffer, final int offset, final int size) {
final java.security.SecureRandom rng = new java.security.SecureRandom();
final byte[] nonce = new byte[size];
rng.nextBytes(nonce);
java.lang.System.arraycopy(nonce, 0, nonceBuffer, offset, size);
ret... | private static int generateRandomNonce(final byte[] nonceBuffer, final int offset, final int size) {
final java.security.SecureRandom rng = new java.security.SecureRandom();
final byte[] nonce = new byte[size];
rng.nextBytes(nonce);
java.lang.System.arraycopy(nonce, 0, nonceBuffer, offset, size);
re... |
public Chromosome tournament() {
Chromosome parent;
parent = chromePop.get(random.nextInt(chromePop.size()));
for (int j = 0; j < (tournamentSize); j++) {
int point = random.nextInt(chromePop.size());
if ((chromePop.get(point).compareTo(parent)) < 0) {
parent = chromePop.get(poin... | public Chromosome tournament() {
Chromosome parent;
parent = chromePop.get(random.nextInt(chromePop.size()));
for (int j = 0; j < (tournamentSize); j++) {
int point = random.nextInt(chromePop.size());
if ((chromePop.get(point).compareTo(parent)) > 0) {
parent = chromePop.get(poin... |
private addMin(int e) {
int place = (heap.size()) + 1;
while ((place != 1) && (e < (heap.get((place / 2))))) {
heap.set(place, heap.get((place / 2)));
place /= 2;
}
heap.set(place, e);
} | private void addMin(int e) {
int place = (heap.size()) + 1;
while ((place != 1) && (e < (heap.get((place / 2))))) {
heap.set(place, heap.get((place / 2)));
place /= 2;
}
heap.set(place, e);
} |
public static void init() {
com.ckurtz22.uhctracking.init.InitItems.registerItems(com.ckurtz22.uhctracking.init.InitItems.writeJson);
com.ckurtz22.uhctracking.init.InitItems.registerItems(com.ckurtz22.uhctracking.init.InitItems.markPoint);
com.ckurtz22.uhctracking.init.InitItems.registerItems(com.ckurtz22.u... | public static void init() {
com.ckurtz22.uhctracking.init.InitItems.registerItems(com.ckurtz22.uhctracking.init.InitItems.writeJson);
com.ckurtz22.uhctracking.init.InitItems.registerItems(com.ckurtz22.uhctracking.init.InitItems.markPoint);
com.ckurtz22.uhctracking.init.InitItems.registerItems(com.ckurtz22.u... |
public void reduce(org.apache.hadoop.io.Text date, java.util.Iterator<org.apache.hadoop.io.IntWritable> values, org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text, org.apache.hadoop.io.IntWritable> output, org.apache.hadoop.mapred.Reporter reporter) throws java.io.IOException {
int sum = 0;
whil... | public void reduce(org.apache.hadoop.io.Text date, java.util.Iterator<org.apache.hadoop.io.IntWritable> values, org.apache.hadoop.mapred.OutputCollector<org.apache.hadoop.io.Text, org.apache.hadoop.io.IntWritable> output, org.apache.hadoop.mapred.Reporter reporter) throws java.io.IOException {
int sum = 0;
whil... |
public void setUpdateAction(java.util.function.Consumer<java.lang.Void> action) {
synchronized(model) {
while ((updateAction) != null) {
try {
model.wait();
} catch (java.lang.InterruptedException e) {
e.printStackTrace();
java.lang.Sys... | protected void setUpdateAction(java.util.function.Consumer<java.lang.Void> action) {
synchronized(this) {
while ((updateAction) != null) {
try {
this.wait();
} catch (java.lang.InterruptedException e) {
e.printStackTrace();
java.lang.Sy... |
public static void checkFibo(long input) {
if ((input == 0) || (input == 1))
java.lang.System.out.println("IsFibo");
long currentFibo = 0;
long previousFibo = 1;
long newFibo = 0;
while (true) {
newFibo = algorithms.IsFibo.nextFibo(previousFibo, currentFibo);
if (newFibo... | public static void checkFibo(long input) {
if ((input == 0) || (input == 1))
java.lang.System.out.println("IsFibo");
long currentFibo = 0;
long previousFibo = 1;
long newFibo = 0;
while (true) {
if (newFibo > input) {
java.lang.System.out.println("IsNotFibo");
... |
private void updateExactMatchOptions() {
org.eclipse.swt.widgets.Button caseBtn = optionsButtons.get(org.eclipse.osee.framework.ui.skynet.search.QuickSearchOptionComposite.SearchOption.Case_Sensitive.asLabel());
org.eclipse.swt.widgets.Button mwoBtn = optionsButtons.get(org.eclipse.osee.framework.ui.skynet.sear... | private void updateExactMatchOptions() {
org.eclipse.swt.widgets.Button caseBtn = optionsButtons.get(org.eclipse.osee.framework.ui.skynet.search.QuickSearchOptionComposite.SearchOption.Case_Sensitive);
org.eclipse.swt.widgets.Button mwoBtn = optionsButtons.get(org.eclipse.osee.framework.ui.skynet.search.QuickSe... |
protected net.minecraft.item.ItemStack getProjectileStack(net.minecraft.item.ItemStack itemStack, net.minecraft.world.World world, net.minecraft.entity.player.EntityPlayer player, boolean usedAmmo) {
net.minecraft.item.ItemStack reference = itemStack.copy();
reference.setCount(1);
setAmmo(1, reference);
... | protected net.minecraft.item.ItemStack getProjectileStack(net.minecraft.item.ItemStack itemStack, net.minecraft.world.World world, net.minecraft.entity.player.EntityPlayer player, boolean usedAmmo) {
net.minecraft.item.ItemStack reference = itemStack.copy();
reference.setCount(1);
setAmmo(1, reference);
... |
public org.apache.flink.graph.Edge<java.lang.Long, org.apache.flink.types.NullValue> map(java.lang.String s) throws java.lang.Exception {
java.lang.String[] args = s.split(",");
long src = java.lang.Long.parseLong(args[0]);
long trg = (java.lang.Long.parseLong(args[1])) + 1000000;
return new org.apache.... | public org.apache.flink.graph.Edge<java.lang.Long, org.apache.flink.types.NullValue> map(java.lang.String s) throws java.lang.Exception {
java.lang.String[] args = s.split("\t");
long src = java.lang.Long.parseLong(args[0]);
long trg = (java.lang.Long.parseLong(args[1])) + 1000000;
return new org.apache... |
private void constructLabels() {
roboticonPurchaseAmountLabel = new com.badlogic.gdx.scenes.scene2d.ui.Label((((roboticonPurchaseAmount.toString()) + "/") + (game.market.getResource(ResourceType.ROBOTICON))), game.skin);
roboticonPurchaseAmountLabel.setAlignment(Align.center);
selectedRoboticonIDLabel = new... | private void constructLabels() {
roboticonPurchaseAmountLabel = new com.badlogic.gdx.scenes.scene2d.ui.Label((((roboticonPurchaseAmount) + "/") + (game.market.getResource(ResourceType.ROBOTICON))), game.skin);
roboticonPurchaseAmountLabel.setAlignment(Align.center);
selectedRoboticonIDLabel = new com.badlog... |
public void setSpeed(double speed) {
if ((media.getMediaType()) == (de.danoeh.antennapod.feed.MediaType.AUDIO)) {
de.danoeh.antennapod.util.playback.AudioPlayer audioPlayer = ((de.danoeh.antennapod.util.playback.AudioPlayer) (player));
if (audioPlayer.canSetSpeed()) {
audioPlayer.setPlay... | public void setSpeed(double speed) {
if (((media) != null) && ((media.getMediaType()) == (de.danoeh.antennapod.feed.MediaType.AUDIO))) {
de.danoeh.antennapod.util.playback.AudioPlayer audioPlayer = ((de.danoeh.antennapod.util.playback.AudioPlayer) (player));
if (audioPlayer.canSetSpeed()) {
... |
public int ComputeFac(int num) {
int num;
int num_aux;
num_aux = 5;
num2 = 2;
if ((num2) < 1)
num_aux = 1;
else
num_aux = (num2) * (this.ComputeFac(((num2) - 1)));
return num_aux;
} | public int ComputeFac(int num) {
int num2;
int num_aux;
num_aux = 5;
num2 = 2;
if (num2 < 1)
num_aux = 1;
else
num_aux = num2 * (this.ComputeFac((num2 - 1)));
return num_aux;
} |
private void updateProgressTextToThread() {
javafx.application.Platform.runLater(new java.lang.Runnable() {
@java.lang.Override
public void run() {
backupProgressText.setText(backupToRunningBackupThreadMap.get(backupFileName.getText()).getMessage());
backupProgressText.textPr... | private void updateProgressTextToThread() {
javafx.application.Platform.runLater(new java.lang.Runnable() {
@java.lang.Override
public void run() {
backupProgressText.textProperty().unbind();
backupProgressText.setText(backupToRunningBackupThreadMap.get(backupFileName.getText... |
public static boolean updateStudent(student.Student theStudent, java.lang.String theColumn, java.lang.Object theData) {
if ((student.StudentCollection.mStudentDB) == null) {
student.StudentCollection.mStudentDB = new data.StudentDB();
}
java.lang.String message = student.StudentCollection.mStudentDB... | public static boolean updateStudent(student.Student theStudent, java.lang.String theColumn, java.lang.Object theData) {
if ((student.StudentCollection.mStudentDB) == null) {
student.StudentCollection.mStudentDB = new data.StudentDB();
}
java.lang.String message = student.StudentCollection.mStudentDB... |
public void takePicture() {
android.content.Intent takePictureIntent = new android.content.Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
if ((takePictureIntent.resolveActivity(getPackageManager())) != null) {
java.io.File photoFile = null;
try {
photoFile = createImageFil... | public void takePicture() {
android.content.Intent takePictureIntent = new android.content.Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
if ((takePictureIntent.resolveActivity(getPackageManager())) != null) {
java.io.File photoFile = null;
try {
photoFile = createImageFil... |
public void handle(javafx.scene.input.MouseEvent e) {
for (javafx.scene.Node node : grid.getChildren()) {
if (node.getBoundsInParent().contains(e.getSceneX(), e.getSceneY())) {
rectangleClicked(javafx.scene.layout.GridPane.getRowIndex(node), javafx.scene.layout.GridPane.getColumnIndex(node));
... | public void handle(javafx.scene.input.MouseEvent e) {
for (javafx.scene.Node node : grid.getChildren()) {
if (node.getBoundsInParent().contains(e.getSceneX(), e.getSceneY())) {
rectangleClicked(javafx.scene.layout.GridPane.getColumnIndex(node), javafx.scene.layout.GridPane.getRowIndex(node));
... |
public LoopController.Command doLoopControl(skadistats.clarity.processor.runner.Context ctx, int upcomingTick) {
if (upcomingTick != (java.lang.Integer.MAX_VALUE)) {
endTicksUntil(ctx, (upcomingTick - 1));
startNewTick(ctx);
}else {
endTicksUntil(ctx, tick);
}
return LoopControll... | public LoopController.Command doLoopControl(skadistats.clarity.processor.runner.Context ctx, int upcomingTick) {
if (upcomingTick != (tick)) {
if (upcomingTick != (java.lang.Integer.MAX_VALUE)) {
endTicksUntil(ctx, (upcomingTick - 1));
startNewTick(ctx, upcomingTick);
}else {... |
public void setId(java.lang.Object id) {
org.springframework.util.Assert.notNull(id);
if (id instanceof java.lang.Long) {
this.id = ((java.lang.Long) (id));
}else
if (id instanceof java.lang.Integer) {
this.id = ((java.lang.Integer) (id)).longValue();
}
org.junit... | public void setId(java.lang.Object id) {
org.springframework.util.Assert.notNull(id);
if (id instanceof java.lang.Long) {
this.id = ((java.lang.Long) (id));
}else
if (id instanceof java.lang.Integer) {
this.id = ((java.lang.Integer) (id)).longValue();
}else {
... |
public void run() {
if ((liveOkeUDPClient) != null) {
if (liveOkeUDPClient.doneGettingSongList) {
toggleOff();
java.lang.String ip = com.vnguyen.liveokeremote.helper.PreferencesHelper.getInstance(this).getPreference("ipAddress");
if (((liveOkeUDPClient.pingCount) > 5) && ... | public void run() {
if ((liveOkeUDPClient) != null) {
if (liveOkeUDPClient.doneGettingSongList) {
toggleOff();
java.lang.String ip = com.vnguyen.liveokeremote.helper.PreferencesHelper.getInstance(this).getPreference("ipAddress");
if ((liveOkeUDPClient.pingCount) > 0) {
... |
public static java.lang.String[] queryWhere(java.lang.String theQuery) {
theQuery = theQuery.toLowerCase();
int i = theQuery.indexOf(';');
theQuery = theQuery.substring(((theQuery.indexOf("where")) + 5), i);
java.lang.String delims = "\\s+|;\\s*|(?<=[a-z])(?=[<>=])|(?<=[<>=])(?=(?:\"|\\d))|(?=&&)|(?=\\|... | public static java.lang.String[] queryWhere(java.lang.String theQuery) {
theQuery = theQuery.toLowerCase();
int i = theQuery.indexOf(';');
if ((theQuery.indexOf("where")) != (-1))
theQuery = theQuery.substring(((theQuery.indexOf("where")) + 5), i);
else
return new java.lang.String[0];
... |
public void setup() {
images = new java.util.ArrayList<processing.core.PImage>();
java.io.File file = new java.io.File("images");
for (java.io.File f : file.listFiles()) {
if (f.getName().endsWith(".png"))
images.add(loadImage(f.getPath()));
}
g = new Game(this);
} | public void setup() {
images = new java.util.ArrayList<>();
java.io.File file = new java.io.File("images");
for (java.io.File f : file.listFiles()) {
if (f.getName().endsWith(".png"))
images.add(loadImage(f.getPath()));
}
g = new Game(this, images);
} |
public void onClick(android.content.DialogInterface dialog, int whichButton) {
java.lang.String name = "/" + (newDirectoryNameInput.getText().toString());
java.io.File folder = new java.io.File(((currentDirectory.getEntry().getAbsolutePath()) + name));
if (!(folder.exists())) {
folder.mkdir();
}... | public void onClick(android.content.DialogInterface dialog, int whichButton) {
java.lang.String name = "/" + (newDirectoryNameInput.getText().toString());
java.io.File folder = new java.io.File(((currentDirectory.getAbsolutePath()) + name));
if (!(folder.exists())) {
folder.mkdir();
}
showDi... |
protected java.lang.Void doInBackground() {
try {
timeConsumingSetupScheme(taskFile);
} catch (final edu.brandeis.cs.nlp.mae.MaeException e) {
javax.swing.SwingUtilities.invokeLater(new java.lang.Runnable() {
@java.lang.Override
public void run() {
cancel(... | protected java.lang.Boolean doInBackground() {
try {
timeConsumingSetupScheme(taskFile);
return true;
} catch (final edu.brandeis.cs.nlp.mae.MaeException e) {
javax.swing.SwingUtilities.invokeLater(new java.lang.Runnable() {
@java.lang.Override
public void run() {... |
public void exceptionInResolvingArg() throws java.lang.Exception {
org.springframework.web.method.support.HandlerMethodArgumentResolverComposite composite = new org.springframework.web.method.support.HandlerMethodArgumentResolverComposite();
composite.addResolver(new org.springframework.web.method.support.Invoc... | public void exceptionInResolvingArg() throws java.lang.Exception {
org.springframework.web.method.support.HandlerMethodArgumentResolverComposite composite = new org.springframework.web.method.support.HandlerMethodArgumentResolverComposite();
composite.addResolver(new org.springframework.web.method.support.Invoc... |
public void addMonths(int months) {
if (months < 0) {
subtractMonths((-months));
}
year += ((month) + months) / 12;
month = ((month) + months) % 12;
if ((month) == 0) {
month = 1;
}
} | public void addMonths(int months) {
if (months < 0) {
subtractMonths((-months));
}
year += ((month) + months) / 12;
month = ((month) + months) % 12;
if ((month) == 0) {
month = 12;
}
} |
public static java.lang.String toJSONString(java.lang.Object object, com.alibaba.fastjson.serializer.SerializeFilter[] filters, com.alibaba.fastjson.serializer.SerializerFeature... features) {
com.alibaba.fastjson.serializer.SerializeWriter out = new com.alibaba.fastjson.serializer.SerializeWriter();
try {
... | public static java.lang.String toJSONString(java.lang.Object object, com.alibaba.fastjson.serializer.SerializeFilter[] filters, com.alibaba.fastjson.serializer.SerializerFeature... features) {
com.alibaba.fastjson.serializer.SerializeWriter out = new com.alibaba.fastjson.serializer.SerializeWriter();
try {
... |
public void addExp(int expToAdd) {
experience += expToAdd;
if ((experience) < 0) {
experience = 0;
}
if ((experience) >= 100) {
while (((experience) - 100) >= 100) {
levelUp();
experience -= 100;
}
}
} | public void addExp(int expToAdd) {
experience += expToAdd;
if ((experience) < 0) {
experience = 0;
}
if ((experience) >= 100) {
while ((experience) >= 100) {
levelUp();
experience -= 100;
}
}
} |
private static void displayUsage(java.lang.String errorMessage) {
if (!(errorMessage.isEmpty())) {
java.lang.System.out.println(errorMessage);
}
java.lang.System.out.println("usage: search [-x] -f <filename> [-p <text>] <directory>");
java.lang.System.out.println("-f <fileName> Name of the fil... | private static void displayUsage(java.lang.String errorMessage) {
if ((errorMessage != null) && (!(errorMessage.isEmpty()))) {
java.lang.System.out.println(errorMessage);
}
java.lang.System.out.println("usage: search [-x] -f <filename> [-p <text>] <directory>");
java.lang.System.out.println();
... |
public boolean collideFromLeft(edu.virginia.engine.display.DisplayObject other) {
if (collidesWith(other)) {
java.awt.Rectangle myRectangle = this.getHitbox();
java.awt.Rectangle otherRectangle = other.getHitbox();
return ((myRectangle.x) + (myRectangle.getWidth())) > (otherRectangle.x);
... | public boolean collideFromLeft(edu.virginia.engine.display.DisplayObject other) {
if (collidesWith(other)) {
java.awt.Rectangle myRectangle = this.getHitbox();
java.awt.Rectangle otherRectangle = other.getHitbox();
return (((myRectangle.x) + (myRectangle.getWidth())) > (otherRectangle.x)) &&... |
protected void init() {
com.orange.datashare.client.ServerConfig targetConfig = com.orange.datashare.client.ServerConfig.valueOf(prefs.targetDSInstance().get());
timber.log.Timber.d("Initializing DatashareClient for server %s", targetConfig.baseUrl());
client = com.orange.datashare.client.DatashareClient.bu... | protected void init() {
targetConfig = com.orange.datashare.client.ServerConfig.valueOf(prefs.targetDSInstance().get());
timber.log.Timber.d("Initializing DatashareClient for server %s", targetConfig.baseUrl());
client = com.orange.datashare.client.DatashareClient.builder().baseUrl(targetConfig.baseUrl()).l... |
public com.theoryinpractise.halbuilder.api.ReadableRepresentation readFrom(java.lang.Class<com.theoryinpractise.halbuilder.api.ReadableRepresentation> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.... | public com.theoryinpractise.halbuilder.api.ReadableRepresentation readFrom(java.lang.Class<com.theoryinpractise.halbuilder.api.ReadableRepresentation> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.... |
public static void main(java.lang.String[] args) {
java.lang.String ip = "";
if ((args.length) >= 1) {
gomoku.Gomoku.IPaddress = ip;
ip = args[0];
}else {
gomoku.Gomoku.IPaddress = ip;
ip = "152.117.243.155";
}
gomoku.TitleViewController vc = new gomoku.TitleViewContr... | public static void main(java.lang.String[] args) {
java.lang.String ip = "";
if ((args.length) >= 1) {
ip = args[0];
}else {
ip = "152.117.243.155";
}
gomoku.TitleViewController vc = new gomoku.TitleViewController(ip);
gomoku.Gomoku.IPaddress = ip;
vc.showView();
} |
protected byte get(int pos) {
int currentPos = 0;
for (java.nio.ByteBuffer bb : this.availableBuffers) {
if ((bb.remaining()) > (pos - currentPos)) {
return bb.get((pos - currentPos));
}else {
currentPos += bb.remaining();
}
}
return 0;
} | protected byte get(int pos) {
int currentPos = 0;
for (java.nio.ByteBuffer bb : this.availableBuffers) {
if ((bb.remaining()) > (pos - currentPos)) {
return bb.get((((bb.position()) + pos) - currentPos));
}else {
currentPos += bb.remaining();
}
}
return 0;... |
public java.lang.String generateTransform(@org.springframework.web.bind.annotation.RequestParam(value = "project")
java.lang.String project, @org.springframework.web.bind.annotation.RequestParam(value = "transformation")
java.lang.String transformationIds, @org.springframework.web.bind.annotation.RequestParam(value = "... | public java.lang.String generateTransform(@org.springframework.web.bind.annotation.RequestParam(value = "transformation")
java.lang.String transformationIds, @org.springframework.web.bind.annotation.RequestParam(value = "sanitized_network_id")
java.lang.String networkIds, org.springframework.ui.Model model) throws edu.... |
private void refreshCheckStatus(canreg.common.database.DatabaseRecord record) {
if ((checkVariableListElement) != null) {
java.lang.Object checkStatus = record.getVariable(checkVariableListElement.getDatabaseVariableName());
if (checkStatus != null) {
java.lang.String checkStatusString =... | private void refreshCheckStatus(canreg.common.database.DatabaseRecord record) {
if ((checkVariableListElement) != null) {
java.lang.Object checkStatus = record.getVariable(checkVariableListElement.getDatabaseVariableName());
if (checkStatus != null) {
java.lang.String checkStatusString =... |
private void handleUserInput() {
java.lang.String inputString = userInput.getText();
if (containsEditAll(inputString)) {
java.util.ArrayList<java.time.LocalDate> exceptionDates = extractExceptionDates(inputString);
if ((exceptionDates != null) && ((exceptionDates.size()) > 0)) {
inpu... | private void handleUserInput() {
java.lang.String inputString = userInput.getText();
if (containsEditAll(inputString)) {
java.util.ArrayList<java.time.LocalDate> exceptionDates = extractExceptionDates(inputString);
if ((exceptionDates != null) && ((exceptionDates.size()) > 0)) {
inpu... |
public de.fuberlin.winfo.project.model.network.solution.Solution search(de.fuberlin.winfo.project.model.network.solution.Solution solution, de.fuberlin.winfo.project.algorithm.impl.sven.vns.CostFunction f) {
this.initialSol = solution;
this.incumbentSol = solution;
init();
while (hasNext()) {
de... | public de.fuberlin.winfo.project.model.network.solution.Solution search(de.fuberlin.winfo.project.model.network.solution.Solution solution, de.fuberlin.winfo.project.algorithm.impl.sven.vns.CostFunction f) {
this.initialSol = solution;
this.incumbentSol = solution;
init();
while (hasNext()) {
de... |
public void onSelectedCardChange(com.ten.hanabi.ui.play.Player player, int pos) {
if ((cardSelectedHere) >= 0) {
int previousSelectedCard = cardSelectedHere;
cardSelectedHere = -1;
cardBorder(previousSelectedCard);
}
if (player == (this.player)) {
this.cardSelectedHere = pos;... | public void onSelectedCardChange(com.ten.hanabi.ui.play.Player player, int pos) {
if ((cardSelectedHere) >= 0) {
int previousSelectedCard = cardSelectedHere;
cardSelectedHere = -1;
cardBorder(previousSelectedCard);
}
if ((player != null) && (player == (this.player))) {
this.c... |
public void result(com.hpe.alm.octane.Result result) {
if (result == (Result.UNDEFINED)) {
return ;
}
if ((_currentStep) != null) {
_currentStep.setStatus(result.getStatus());
_currentStep.setDuration(result.getDuration());
if ((result.getErrorMessage()) != null) {
... | public void result(com.hpe.alm.octane.Result result) {
if ((_currentStep) != null) {
_currentStep.setStatus(result.getStatus());
_currentStep.setDuration(result.getDuration());
if ((result.getErrorMessage()) != null) {
_currentStep.setErrorMessage(result.getErrorMessage());
... |
private void restoreSelection(int location, int oldLenght, boolean moveCursor) {
int newLength = textInputField.getText().length();
int deltaLength = newLength - oldLenght;
if (moveCursor) {
location = location + deltaLength;
}
location = java.lang.Math.min(location, (newLength - 1));
lo... | private void restoreSelection(int location, int oldLenght, boolean moveCursor) {
int newLength = textInputField.getText().length();
int deltaLength = newLength - oldLenght;
if (moveCursor) {
location = location + deltaLength;
}
location = java.lang.Math.min(location, newLength);
location... |
protected void onPostExecute(java.lang.String result) {
if (result.equals("success")) {
java.lang.String id = userID;
redirect(id);
}else
if (result.equals("failed")) {
showAlert("Login fail");
}else {
showAlert("Connection problem");
}
su... | protected void onPostExecute(java.lang.String result) {
if (result.equals("success")) {
showAlert(result);
}else
if (result.equals("failed")) {
showAlert("Login fail");
}else {
showAlert("Connection problem");
}
super.onPostExecute(result);
} |
private void customizeStyleSheet(javax.swing.text.html.StyleSheet style, java.awt.Color fg) {
final int fontSize = getMainWindow().getWizardFontSize();
org.miradi.utils.HtmlUtilities.addRuleFontSize(style, getFont().getSize(), fontSize);
org.miradi.utils.HtmlUtilities.addRuleFontFamily(style, getMainWindow(... | protected void customizeStyleSheet(javax.swing.text.html.StyleSheet style, java.awt.Color fg) {
final int fontSize = getMainWindow().getWizardFontSize();
org.miradi.utils.HtmlUtilities.addRuleFontSize(style, getFont().getSize(), fontSize);
org.miradi.utils.HtmlUtilities.addRuleFontFamily(style, getMainWindo... |
public com.delect.motiver.shared.ExerciseModel updateExercise(com.delect.motiver.shared.ExerciseModel exercise) throws com.delect.motiver.shared.exception.ConnectionException {
com.delect.motiver.shared.ExerciseModel m = null;
final com.delect.motiver.server.jdo.UserOpenid user = userManager.getUser(this.perThr... | public com.delect.motiver.shared.ExerciseModel updateExercise(com.delect.motiver.shared.ExerciseModel exercise) throws com.delect.motiver.shared.exception.ConnectionException {
com.delect.motiver.shared.ExerciseModel m = null;
final com.delect.motiver.server.jdo.UserOpenid user = userManager.getUser(this.perThr... |
public void onClick(android.view.View v) {
mCurrentIndex = ((mCurrentIndex) - 1) % (mQuestionBank.length);
mCurrentIndex = ((mCurrentIndex) < 0) ? (mQuestionBank.length) + (mCurrentIndex) : mCurrentIndex;
updateQuestion();
} | public void onClick(android.view.View v) {
mCurrentIndex = ((mCurrentIndex) - 1) % (mQuestionBank.length);
mCurrentIndex = ((mCurrentIndex) < 0) ? (mQuestionBank.length) + (mCurrentIndex) : mCurrentIndex;
updateQuestion(false);
} |
public static <T, E extends java.lang.Enum<E>> java.util.Map<E, T> convertToSimpleEnumMap(final java.util.Map<T, E> map) {
com.ikueb.revemap.EnumMapUtils.validateArguments(map);
return new java.util.EnumMap(com.ikueb.revemap.EnumMapUtils.doMap(map.entrySet(), java.util.Map.Entry::getValue, java.util.Map.Entry::... | public static <T, E extends java.lang.Enum<E>> java.util.Map<E, T> convertToSimpleEnumMap(final java.util.Map<T, E> map) {
com.ikueb.revemap.EnumMapUtils.validateArguments(map);
return new java.util.EnumMap<E, T>(com.ikueb.revemap.EnumMapUtils.doMap(map.entrySet(), java.util.Map.Entry::getValue, java.util.Map.E... |
private com.excilys.burleon.computerdatabase.webapp.controller.util.ProcessResult removeComputersProcess(final com.excilys.burleon.computerdatabase.webapp.controller.ComputerManageController.ProcessVariables processVariables) {
try {
com.excilys.burleon.computerdatabase.webapp.controller.ComputerManageContr... | private com.excilys.burleon.computerdatabase.webapp.controller.util.ProcessResult removeComputersProcess(final com.excilys.burleon.computerdatabase.webapp.controller.ComputerManageController.ProcessVariables processVariables) {
try {
com.excilys.burleon.computerdatabase.webapp.controller.ComputerManageContr... |
static double average(java.util.Collection<java.lang.Double> numbers) {
if ((numbers.size()) == 0) {
throw new java.lang.IllegalArgumentException("Must get at least one number to compute average");
}
double sum = 0.0;
for (double number : numbers) {
sum += number;
}
return sum / ... | @org.jetbrains.annotations.Nullable
static java.lang.Double average(java.util.Collection<java.lang.Double> numbers) {
if ((numbers.size()) == 0) {
return null;
}
double sum = 0.0;
for (double number : numbers) {
sum += number;
}
return sum / (numbers.size());
} |
public boolean onFling(android.view.MotionEvent e1, android.view.MotionEvent e2, float velocityX, final float velocityY) {
if ((java.lang.Math.abs(velocityX)) > (java.lang.Math.abs(velocityY))) {
return false;
}
if ((isFloat()) && (velocityY > 0)) {
return false;
}
fling(velocityY);
... | public boolean onFling(android.view.MotionEvent e1, android.view.MotionEvent e2, float velocityX, final float velocityY) {
if ((java.lang.Math.abs(velocityX)) > (java.lang.Math.abs(velocityY))) {
return false;
}
if (isFloat()) {
return false;
}
fling(velocityY);
return true;
} |
public void AddUnitGroup(Units.UnitGroup group) {
java.lang.System.out.println("BEGIN PlayerData.AddUnitGroup");
if ((group_count) >= (max_group_count)) {
Units.UnitGroup[] temp = groups;
max_group_count *= 2;
groups = new Units.UnitGroup[max_group_count];
for (int i = 0; i < (gr... | public void AddUnitGroup(Units.UnitGroup group) {
java.lang.System.out.println("BEGIN PlayerData.AddUnitGroup");
if ((group_count) >= (max_group_count)) {
Units.UnitGroup[] temp = groups;
max_group_count *= 2;
groups = new Units.UnitGroup[max_group_count];
for (int i = 0; i < (gr... |
public static void main(java.lang.String[] args) {
d.datalog.XSBSubprocessEngine engine = new d.datalog.XSBSubprocessEngine("D:\\XSB\\bin\\xsb64.bat");
if (engine.deterministicGoal("javaMessage('java.lang.System'-out,println(string('Hello from Prolog, Java world!')))"))
java.lang.System.out.println("Thi... | public static void main(java.lang.String[] args) {
d.datalog.XSBSubprocessEngine engine = new d.datalog.XSBSubprocessEngine("D:\\XSB\\bin\\xsb64.bat");
if (engine.deterministicGoal("javaMessage('java.lang.System'-out,println(string('Hello from Prolog, Java world!')))"))
java.lang.System.out.println("Thi... |
public void setDate(java.time.LocalDate date) {
if ((dateTime.get()) == null) {
java.time.LocalDateTime temp = java.time.LocalDateTime.of(date, dateTime.get().toLocalTime());
this.dateTime = new javafx.beans.property.SimpleObjectProperty<java.time.LocalDateTime>(temp);
}
} | public void setDate(java.time.LocalDate date) {
if ((dateTime.get()) != null) {
java.time.LocalDateTime temp = java.time.LocalDateTime.of(date, dateTime.get().toLocalTime());
this.dateTime = new javafx.beans.property.SimpleObjectProperty<java.time.LocalDateTime>(temp);
}
} |
protected org.kohsuke.github.GHUser getUser(org.kohsuke.github.GHUser orig) throws java.io.IOException {
org.kohsuke.github.GHUser u = users.get(orig.getLogin());
if (u == null) {
orig.root = this;
users.put(login, orig);
return orig;
}
return u;
} | protected org.kohsuke.github.GHUser getUser(org.kohsuke.github.GHUser orig) throws java.io.IOException {
org.kohsuke.github.GHUser u = users.get(orig.getLogin());
if (u == null) {
orig.root = this;
users.put(orig.getLogin(), orig);
return orig;
}
return u;
} |
@org.semanticweb.owlapi.profiles.test.Tests(method = "public Object visit(OWLDisjointClassesAxiom axiom)")
public void shouldCreateViolationForOWLDisjointClassesAxiomInOWL2RLProfile() throws java.lang.Exception {
org.semanticweb.owlapi.profiles.test.OWLOntology o = org.semanticweb.owlapi.profiles.test.OWLProfileTes... | @org.semanticweb.owlapi.profiles.test.Tests(method = "public Object visit(OWLDisjointClassesAxiom axiom)")
public void shouldCreateViolationForOWLDisjointClassesAxiomInOWL2RLProfile() throws java.lang.Exception {
org.semanticweb.owlapi.profiles.test.OWLOntology o = org.semanticweb.owlapi.profiles.test.OWLProfileTes... |
public void validate(org.restfulwhois.rdap.common.support.QueryParam queryParam, org.restfulwhois.rdap.common.validation.ValidationResult validationResult) {
java.lang.String q = queryParam.getQ();
java.lang.String[] splits = org.apache.commons.lang.StringUtils.split(q, ".");
for (java.lang.String split : s... | public void validate(org.restfulwhois.rdap.common.support.QueryParam queryParam, org.restfulwhois.rdap.common.validation.ValidationResult validationResult) {
java.lang.String q = queryParam.getQ();
java.lang.String[] splits = org.apache.commons.lang.StringUtils.split(q, ".");
for (java.lang.String split : s... |
public void addUsers(java.util.ArrayList<android.util.Pair<com.iskrembilen.quasseldroid.IrcUser, java.lang.String>> usersWithModes) {
for (android.util.Pair<com.iskrembilen.quasseldroid.IrcUser, java.lang.String> user : usersWithModes) {
for (com.iskrembilen.quasseldroid.IrcMode mode : com.iskrembilen.quass... | public void addUsers(java.util.ArrayList<android.util.Pair<com.iskrembilen.quasseldroid.IrcUser, java.lang.String>> usersWithModes) {
for (android.util.Pair<com.iskrembilen.quasseldroid.IrcUser, java.lang.String> user : usersWithModes) {
for (com.iskrembilen.quasseldroid.IrcMode mode : com.iskrembilen.quass... |
private void updateScaling(int height, int dataMax, int dataMin) {
if ((dataMax - dataMin) == 0)
return ;
mScaling = ((float) (height)) / (dataMax - dataMin);
clearWaveform();
if (org.lunci.waveform_viewer.BuildConfig.DEBUG) {
android.util.Log.d(org.lunci.waveform.ui.WaveformPlotThr... | private void updateScaling(int height, int dataMax, int dataMin) {
if ((dataMax - dataMin) == 0)
return ;
mScaling = ((float) (height)) / (dataMax - dataMin);
if (org.lunci.waveform_viewer.BuildConfig.DEBUG) {
android.util.Log.d(org.lunci.waveform.ui.WaveformPlotThread.TAG, ((("updating... |
public void applyWeight() {
double threshold = (numberOfPeers) * 0.66;
mQueueElementList.get(((mQueueElementList.size()) - 1)).weight = threshold;
double test = mQueueElementList.get(((mQueueElementList.size()) - 1)).weight;
} | public void applyWeight() {
mQueueElementList.get(((mQueueElementList.size()) - 1)).weight = threshold;
double test = mQueueElementList.get(((mQueueElementList.size()) - 1)).weight;
} |
public void onDayBoxClicked(android.widget.TextView v) {
int backgroundColor = ((android.graphics.drawable.ColorDrawable) (v.getBackground())).getColor();
if (backgroundColor == (colorNotSelected)) {
v.setBackgroundColor(colorSelected);
}else {
v.setBackgroundColor(colorNotSelected);
}
} | public void onDayBoxClicked(android.widget.TextView v) {
v.setEnabled(false);
int backgroundColor = ((android.graphics.drawable.ColorDrawable) (v.getBackground())).getColor();
if (backgroundColor == (colorNotSelected)) {
v.setBackgroundColor(colorSelected);
}else {
v.setBackgroundColor(c... |
public void handleFree(final jd.plugins.DownloadLink downloadLink) throws java.lang.Exception, jd.plugins.PluginException {
requestFileInformation(downloadLink);
if ((jd.plugins.hoster.FilesUploadOrg.AVAILABLE_CHECK_OVER_INFO_PAGE) && (!(isNewLinkType(downloadLink)))) {
br.getPage(downloadLink.getDownlo... | public void handleFree(final jd.plugins.DownloadLink downloadLink) throws java.lang.Exception, jd.plugins.PluginException {
requestFileInformation(downloadLink);
if ((jd.plugins.hoster.FilesUploadOrg.AVAILABLE_CHECK_OVER_INFO_PAGE) && (!(isNewLinkType(downloadLink)))) {
getPage(downloadLink.getDownloadU... |
public void onRefresh() {
cd = new com.rsproject.utils.ConnectionDetector(this);
isInternetActive = cd.isConnectingToInternet();
if (isInternetActive) {
new com.rsproject.main.MainActivity.getListAll().execute();
}else {
android.widget.Toast.makeText(this, "Periksa Koneksi Internet Anda.... | public void onRefresh() {
cd = new com.rsproject.utils.ConnectionDetector(this);
isInternetActive = cd.isConnectingToInternet();
if (isInternetActive) {
list = new java.util.ArrayList<>();
new com.rsproject.main.MainActivity.getListAll().execute();
}else {
android.widget.Toast.ma... |
public static boolean editMessage(content.Forum forum, content.SubForum subForum, users.User user, content.Message msg, java.lang.String content) throws controllers.UserNotAuthorizedException {
if (policy.PolicyHandler.canUserEditComment(forum, subForum, user, msg)) {
if (controllers.ContentController.editP... | public static boolean editMessage(content.Forum forum, content.SubForum subForum, users.User user, content.Message msg, java.lang.String content) throws controllers.UserNotAuthorizedException {
if (policy.PolicyHandler.canUserEditComment(forum, subForum, user, msg)) {
if (controllers.ContentController.editP... |
public com.is0967.menutri.dtos.DishDTO getDishById(java.lang.Long dishId) {
com.is0967.menutri.dtos.DishDTO dto = null;
try {
com.is0967.menutri.services.Dish dish = dishRepo.findOne(dishId);
dto = com.is0967.menutri.dtos.DishDTO.convertFromEntity(dish);
java.util.List<com.is0967.menutri... | public com.is0967.menutri.dtos.DishDTO getDishById(java.lang.Long dishId) {
com.is0967.menutri.dtos.DishDTO dto = null;
try {
com.is0967.menutri.services.Dish dish = dishRepo.findOne(dishId);
dto = com.is0967.menutri.dtos.DishDTO.convertFromEntity(dish);
java.util.List<com.is0967.menutri... |
private java.util.List<hillbillies.model.Material> getMaterialsAt(hillbillies.model.Cube cube) {
java.util.List<hillbillies.model.Material> foundMaterials = new java.util.ArrayList<>();
for (hillbillies.model.Material material : materials) {
if (hillbillies.model.Vector.equals(material.getPosition().get... | private java.util.List<hillbillies.model.Material> getMaterialsAt(hillbillies.model.Cube cube) {
java.util.List<hillbillies.model.Material> foundMaterials = new java.util.ArrayList<>();
for (hillbillies.model.Material material : materials) {
if (material.getPosition().getEnclosingCube(this).equals(cube)... |
public void render(de.bitbrain.braingdx.world.GameObject object, com.badlogic.gdx.graphics.g2d.Batch batch, float delta) {
if ((texture) == null) {
buildTextureBuffer(batch);
}
sprite.setFlip(true, false);
sprite.setPosition(object.getLeft(), ((object.getTop()) - ((cellOffset) * 2)));
sprite... | public void render(de.bitbrain.braingdx.world.GameObject object, com.badlogic.gdx.graphics.g2d.Batch batch, float delta) {
if ((texture) == null) {
buildTextureBuffer(batch);
}
sprite.setFlip(false, true);
sprite.setPosition(object.getLeft(), ((object.getTop()) - ((cellOffset) * 2)));
sprite... |
protected void requestStateRefresh() {
setTextColor(getContext().getResources().getColor(android.R.color.white));
setTypeface(Typeface.DEFAULT_BOLD);
setTextSize(bootstrapHeading.getTextSize(getContext()));
android.graphics.drawable.Drawable bg = com.beardedhen.androidbootstrap.support.BootstrapDrawable... | private void requestStateRefresh() {
setTextColor(getContext().getResources().getColor(android.R.color.white));
setTypeface(Typeface.DEFAULT_BOLD);
setTextSize(bootstrapHeading.getTextSize(getContext()));
android.graphics.drawable.Drawable bg = com.beardedhen.androidbootstrap.support.BootstrapDrawableFa... |
public void stateChanged(javax.swing.event.ChangeEvent evt) {
try {
allocatableEdit.mapToObjects();
java.util.List<org.rapla.entities.domain.Allocatable> objects = allocatableEdit.getObjects();
toStore.addAll(objects);
getLogger().info(("Content changed" + objects));
} catch (org... | public void stateChanged(javax.swing.event.ChangeEvent evt) {
try {
allocatableEdit.mapToObjects();
java.util.List<org.rapla.entities.domain.Allocatable> objects = allocatableEdit.getObjects();
toStore.addAll(objects);
} catch (org.rapla.framework.RaplaException e) {
getLogger().... |
public void checkDateIsRequired() throws java.lang.Exception {
int databaseSizeBeforeTest = pointsRepository.findAll().size();
points.setDate(null);
restPointsMockMvc.perform(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post("/api/points").contentType(TestUtil.APPLICATION_JSON_UTF8).c... | public void checkDateIsRequired() throws java.lang.Exception {
int databaseSizeBeforeTest = pointsRepository.findAll().size();
points.setDate(null);
restPointsMockMvc.perform(post("/api/points").contentType(TestUtil.APPLICATION_JSON_UTF8).content(org.daniels.jhipster.myhealth.web.rest.TestUtil.convertObject... |
public net.eithon.plugin.cop.logic.Profanity add(java.lang.String word) {
java.lang.String normalized = net.eithon.plugin.cop.logic.Profanity.normalize(word);
if (isWhitelisted(normalized))
return null;
net.eithon.plugin.cop.logic.Profanity profanity = this._blacklist.getProfanity(normalized, B... | public net.eithon.plugin.cop.logic.Profanity add(java.lang.String word) {
java.lang.String normalized = net.eithon.plugin.cop.logic.Profanity.normalize(word);
if (isWhitelisted(normalized))
return null;
net.eithon.plugin.cop.logic.Profanity profanity = this._blacklist.getProfanity(normalized);
... |
public java.lang.String stringWord() {
java.lang.String returnWord = "";
for (int i = 0; i < (word.size()); i++) {
returnWord += this.word.get(i).getKey();
}
return returnWord;
} | public java.lang.String toString() {
java.lang.String returnWord = "";
for (int i = 0; i < (word.size()); i++) {
returnWord += this.word.get(i).getKey();
}
return returnWord;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.