buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
protected java.net.URL getURL(com.beimin.eveapi.parser.ApiRequest request) throws com.beimin.eveapi.exception.ApiException {
try {
java.lang.StringBuilder result = new java.lang.StringBuilder(getBaseUrl());
result.append(request.getPath().getPath());
result.append("/").append(request.getPage... | protected java.net.URL getURL(com.beimin.eveapi.parser.ApiRequest request) throws com.beimin.eveapi.exception.ApiException {
try {
java.lang.StringBuilder result = new java.lang.StringBuilder(getBaseUrl());
result.append(request.getPath().getPath()).append("/").append(request.getPage().getPage()).ap... |
protected void beforeHookedMethod(mobi.acpm.inspeckage.hooks.MethodHookParam param) throws java.lang.Throwable {
android.content.Intent intent = ((android.content.Intent) (param.args[0]));
if (!(intent.getAction().contains("mobi.acpm.inspeckage"))) {
de.robv.android.xposed.XposedBridge.log((((mobi.acpm.... | protected void beforeHookedMethod(mobi.acpm.inspeckage.hooks.MethodHookParam param) throws java.lang.Throwable {
android.content.Intent intent = ((android.content.Intent) (param.args[0]));
if ((intent != null) && (!(intent.getAction().contains("mobi.acpm.inspeckage")))) {
de.robv.android.xposed.XposedBr... |
public void addLast(Item item) {
if (item == null) {
throw new java.lang.NullPointerException();
}
Deque<Item>.Container old = last;
if ((size) == 0) {
first = last;
}
last = new Container(item);
last.prev = old;
old.next = last;
(size)++;
} | public void addLast(Item item) {
if (item == null) {
throw new java.lang.NullPointerException();
}
Deque<Item>.Container old = last;
last = new Container(item);
if ((size) == 0) {
first = last;
}
last.prev = old;
if (old != null) {
old.next = last;
}
(size... |
public void run() {
if (checkUsedAndLock()) {
boolean lastSession = unlockSession();
boolean keepChangedFlag = !lastSession;
boolean commitAttributes = lastSession || (forceCommit);
if (lastSession && (invalidateOnCommit)) {
invalidationOnCommit();
}else {
... | public void run() {
if (checkUsedAndLock()) {
boolean lastSession = unlockSession();
boolean keepChangedFlag = !lastSession;
boolean commitAttributes = lastSession || (forceCommit);
if (lastSession && (invalidateOnCommit)) {
invalidationOnCommit();
}else {
... |
public void onSizeChanged(int placeHoderHeight, int stickHeight) {
this.placeHoderHeight = placeHoderHeight;
for (int i = 0; i < (placeHoderHeaderLayoutList.size()); i++) {
placeHoderHeaderLayoutList.get(i).updatePlaceHeight(placeHoderHeight, this, placeHoderHeaderLayoutList.indexOfValue(placeHoderHeade... | public void onSizeChanged(int placeHoderHeight, int stickHeight) {
this.placeHoderHeight = placeHoderHeight;
for (int i = 0; i < (placeHoderHeaderLayoutList.size()); i++) {
if ((placeHoderHeaderLayoutList.get(i)) != null) {
placeHoderHeaderLayoutList.get(i).updatePlaceHeight(placeHoderHeight... |
public double getAvregeUphillDegree() {
double result;
double sum = 0;
int num = 0;
for (double slop : degreesArray) {
if (slop != 0) {
num++;
sum += slop;
}
}
result = sum / num;
return result;
} | public double getAvregeUphillDegree() {
double result;
double sum = 0;
int num = 0;
for (double slop : degreesArray) {
if (slop != 0) {
num++;
sum += slop;
}
}
if (num == 0) {
return 0;
}
result = sum / num;
return result;
} |
public void onTimeSet(android.widget.TimePicker timePicker, int hourOfDay, int minute) {
mSelectedTime.setText(((hourOfDay + ":") + minute));
com.transitangel.transitangel.schedule.FilterDialogFragment.calendar.set(java.util.Calendar.HOUR_OF_DAY, hourOfDay);
com.transitangel.transitangel.schedule.FilterDial... | public void onTimeSet(android.widget.TimePicker timePicker, int hourOfDay, int minute) {
com.transitangel.transitangel.schedule.FilterDialogFragment.calendar.set(java.util.Calendar.HOUR_OF_DAY, hourOfDay);
com.transitangel.transitangel.schedule.FilterDialogFragment.calendar.set(java.util.Calendar.MINUTE, minute... |
public void onBlockAdded(final net.minecraft.world.World world, final net.minecraft.util.BlockPos coord, final net.minecraft.block.state.IBlockState state) {
this.setDefaultFacing(world, coord, state);
cyano.poweradvantage.conduitnetwork.ConduitRegistry.getInstance().conduitBlockPlacedEvent(world, world.provide... | public void onBlockAdded(final net.minecraft.world.World world, final net.minecraft.util.BlockPos coord, final net.minecraft.block.state.IBlockState state) {
super.onBlockAdded(world, coord, state);
cyano.poweradvantage.conduitnetwork.ConduitRegistry.getInstance().conduitBlockPlacedEvent(world, world.provider.g... |
public Player.Choice makeChoice() {
java.util.Scanner keyboard = new java.util.Scanner(java.lang.System.in);
Player.Choice userChoice;
java.lang.System.out.print("Would you like to \"hit\" or \"stay?\": ");
userInput = keyboard.next().trim().toUpperCase();
java.lang.System.out.println((("\"" + (user... | public Player.Choice makeChoice() {
java.util.Scanner keyboard = new java.util.Scanner(java.lang.System.in);
Player.Choice userChoice;
java.lang.System.out.print("Would you like to \"hit\" or \"stay?\": ");
userInput = keyboard.next().trim().toUpperCase();
switch (userInput) {
case "HIT" :
... |
public void onClick(android.view.View view) {
if ((position) < (list.size())) {
com.adm.dictionary.entity.QuestionBean bean = list.get(position);
modifyReciteRecord(userId, token, bean.getId(), "0");
(position)++;
}else {
showToast("本次复习结束,继续努力");
finish();
}
} | public void onClick(android.view.View view) {
if ((position) < (list.size())) {
com.adm.dictionary.entity.QuestionBean bean = list.get(position);
(position)++;
modifyReciteRecord(userId, token, bean.getId(), "0");
}else {
showToast("本次复习结束,继续努力");
finish();
}
} |
public void stopOnce() {
org.sonar.api.utils.TimeProfiler profiler = new org.sonar.api.utils.TimeProfiler(logger);
profiler.start("Cycle analysis");
profiler.stop();
profiler.stop();
profiler.stop();
verify(logger, times(1)).info(anyString());
verify(logger, times(1)).info(anyString(), anySt... | public void stopOnce() {
org.sonar.api.utils.TimeProfiler profiler = new org.sonar.api.utils.TimeProfiler(logger);
profiler.start("Cycle analysis");
profiler.stop();
profiler.stop();
profiler.stop();
verify(logger, times(1)).info(anyString(), anyString());
verify(logger, times(1)).info(anySt... |
public void createColumnInTable(Database.DB db, java.lang.String name, int pos) {
Database.Table t = db.getTables().get(pos);
Database.Column c = DatabaseFactory.eINSTANCE.createColumn();
c.setName(name);
t.getColumns().add(c);
} | public void createColumnInTable(Database.DB db, java.lang.String name, int pos) {
Database.Table t = db.getTables().get(pos);
Database.Column c = DatabaseFactory.eINSTANCE.createColumn();
t.getColumns().add(c);
c.setName(name);
} |
public void stdWeatherDataLine() {
org.agmip.core.types.WeatherDataLine test = new org.agmip.core.types.WeatherDataLine(new java.util.HashMap<java.lang.String, java.lang.Object>() {
{
put("tmax", 12.34);
}
});
assertEquals("Max Temperature", new java.lang.Double(12.34), test.getT... | public void stdWeatherDataLine() {
org.agmip.core.types.WeatherDataLine test = new org.agmip.core.types.WeatherDataLine(new java.util.HashMap<java.lang.String, java.lang.Object>() {
{
put("tmax", 12.34);
}
});
assertEquals("Max Temperature", new java.lang.Double(12.34), test.getT... |
public int scrollVerticallyBy(int dy, android.support.v7.widget.RecyclerView.Recycler recycler, android.support.v7.widget.RecyclerView.State state) {
int scroll = super.scrollVerticallyBy(dy, recycler, state);
if ((java.lang.Math.abs(scroll)) > 0) {
positioner.updateHeaderState(findFirstVisibleItemPosit... | public int scrollVerticallyBy(int dy, android.support.v7.widget.RecyclerView.Recycler recycler, android.support.v7.widget.RecyclerView.State state) {
int scroll = super.scrollVerticallyBy(dy, recycler, state);
if ((java.lang.Math.abs(scroll)) > 0) {
positioner.updateHeaderState(findFirstVisibleItemPosit... |
private void Import_Task() {
new xyz.jaoafa.mymaid.MyMaid.World_saver().runTaskTimer(this, 0L, 36000L);
new xyz.jaoafa.mymaid.MyMaid.Dynmap_Update_Render().runTaskTimer(this, 0L, 36000L);
new xyz.jaoafa.mymaid.MyMaid.AFKChecker(this).runTaskTimer(this, 0L, 1200L);
new xyz.jaoafa.mymaid.MyMaid.AutoMessag... | private void Import_Task() {
new xyz.jaoafa.mymaid.MyMaid.World_saver().runTaskTimer(this, 0L, 36000L);
new xyz.jaoafa.mymaid.MyMaid.Dynmap_Update_Render().runTaskTimer(this, 0L, 36000L);
new xyz.jaoafa.mymaid.MyMaid.AFKChecker(this).runTaskTimer(this, 0L, 1200L);
new xyz.jaoafa.mymaid.MyMaid.AutoMessag... |
public void run() {
BackupProtocol bp = new BackupProtocol(vrs, id, fileID, n, repDegree, buffer);
byte[] buff = bp.request().getBytes();
java.net.DatagramPacket packet = new java.net.DatagramPacket(buff, buff.length, address, data.getLocalPort());
try {
data.send(packet);
java.lang.Syst... | public void run() {
BackupProtocol bp = new BackupProtocol(vrs, id, fileID, n, repDegree, buffer, size);
byte[] buff = bp.request().getBytes();
java.net.DatagramPacket packet = new java.net.DatagramPacket(buff, buff.length, address, data.getLocalPort());
try {
data.send(packet);
java.lan... |
public void requeueErroredIncoming() {
com.nyaruka.androidrelay.data.TextMessageHelper helper = getHelper();
java.util.List<com.nyaruka.androidrelay.data.TextMessage> msgs = helper.withStatus(this.getApplicationContext(), TextMessage.INCOMING, TextMessage.ERRORED);
int count = 0;
for (com.nyaruka.androi... | public void requeueErroredIncoming() {
com.nyaruka.androidrelay.data.TextMessageHelper helper = getHelper();
java.util.List<com.nyaruka.androidrelay.data.TextMessage> msgs = helper.withStatus(this.getApplicationContext(), TextMessage.INCOMING, TextMessage.ERRORED);
int count = 0;
for (com.nyaruka.androi... |
public static int readUnsignedShort(byte[] bytes, int offset) {
int ch1 = bytes[offset];
int ch2 = bytes[(offset + 1)];
if (ch1 < 0)
ch1 += 256;
if (ch2 < 0)
ch1 += 256;
return (ch1 << 8) + (ch2 << 0);
} | public static int readUnsignedShort(byte[] bytes, int offset) {
int ch1 = bytes[offset];
int ch2 = bytes[(offset + 1)];
if (ch1 < 0)
ch1 += 256;
if (ch2 < 0)
ch2 += 256;
return (ch1 << 8) + (ch2 << 0);
} |
public java.lang.reflect.Method parametrizedTestMethod(@ru.yandex.qatools.allure.annotations.Parameter
double doubleParameter, @ru.yandex.qatools.allure.annotations.Parameter(value = "valueFromAnnotation")
java.lang.String stringParameter, java.lang.String notParameter) {
try {
return getClass().getDeclared... | public java.lang.reflect.Method parametrizedTestMethod(@ru.yandex.qatools.allure.annotations.Parameter
double doubleParameter, java.lang.String notParameter, @ru.yandex.qatools.allure.annotations.Parameter(value = "valueFromAnnotation")
java.lang.String stringParameter) {
try {
return getClass().getDeclared... |
public void start(javafx.stage.Stage stage) throws java.lang.Exception {
javafx.fxml.FXMLLoader loader = new javafx.fxml.FXMLLoader(getClass().getResource("excelParser.fxml"));
loader.setController(new LabApplicationController());
javafx.scene.Parent root = loader.load();
stage.setTitle("Vey Lab");
... | public void start(javafx.stage.Stage stage) throws java.lang.Exception {
javafx.fxml.FXMLLoader loader = new javafx.fxml.FXMLLoader(getClass().getResource("excelParser.fxml"));
loader.setController(new LabApplicationController());
javafx.scene.Parent root = loader.load();
stage.setTitle("Vey Lab");
... |
public void AddLetterToGuessedListAfterGuess() {
com.hangman.players.YourPlayer player = new com.hangman.players.YourPlayer();
player.GetGuess(java.util.Arrays.asList('_', '_', '_'));
java.util.List<java.lang.Character> guessedLetters = player.GetGuessedLetters();
java.util.List<java.lang.Character> exp... | public void AddLetterToGuessedListAfterGuess() {
com.hangman.players.YourPlayer player = new com.hangman.players.YourPlayer();
player.GetGuess(java.util.Arrays.asList('_', '_', '_'));
java.util.List<java.lang.Character> guessedLetters = player.GetGuessedLetters();
java.util.List<java.lang.Character> exp... |
public void roll() {
Game.Die.dice1 = ((int) ((java.lang.Math.random()) * 6)) + 1;
Game.Die.dice2 = ((int) ((java.lang.Math.random()) * 6)) + 1;
Game.Die.dice1 = Game.Die.dice2;
Game.Die.sum = (Game.Die.dice1) + (Game.Die.dice2);
} | public void roll() {
Game.Die.dice1 = ((int) ((java.lang.Math.random()) * 6)) + 1;
Game.Die.dice2 = ((int) ((java.lang.Math.random()) * 6)) + 1;
Game.Die.sum = (Game.Die.dice1) + (Game.Die.dice2);
} |
public void verify(com.talvish.tales.auth.jwt.JsonWebToken theToken, com.talvish.tales.auth.accesscontrol.AccessResult theResult) {
com.talvish.tales.auth.capabilities.Capabilities tokenCapabilities = ((com.talvish.tales.auth.capabilities.Capabilities) (theToken.getClaims().get(family)));
if (tokenCapabilities ... | public void verify(com.talvish.tales.auth.jwt.JsonWebToken theToken, com.talvish.tales.auth.accesscontrol.AccessResult theResult) {
com.talvish.tales.auth.capabilities.Capabilities tokenCapabilities = ((com.talvish.tales.auth.capabilities.Capabilities) (theToken.getClaims().get(claim)));
if (tokenCapabilities =... |
public void run() {
java.io.File output = chooseFile(javax.swing.JFileChooser.SAVE_DIALOG, javax.swing.JFileChooser.FILES_ONLY);
if (output == null) {
java.lang.System.out.println("No output file was selected...");
}else {
java.lang.System.out.println(("saving to " + (output.getAbsolutePath(... | public void run() {
java.io.File output = chooseFile(javax.swing.JFileChooser.SAVE_DIALOG, javax.swing.JFileChooser.FILES_ONLY);
if (output == null) {
java.lang.System.out.println("No output file was selected...");
}else {
java.lang.System.out.println(("saving to " + (output.getAbsolutePath(... |
private static java.util.List<com.cliffcrosland.kirkpatrickseidel.Point2> withoutDominated(java.util.List<com.cliffcrosland.kirkpatrickseidel.Point2> points, com.cliffcrosland.kirkpatrickseidel.Point2 maximum) {
java.util.List<com.cliffcrosland.kirkpatrickseidel.Point2> ret = new java.util.ArrayList<com.cliffcrosla... | private static java.util.List<com.cliffcrosland.kirkpatrickseidel.Point2> withoutDominated(java.util.List<com.cliffcrosland.kirkpatrickseidel.Point2> points, com.cliffcrosland.kirkpatrickseidel.Point2 maximum) {
java.util.List<com.cliffcrosland.kirkpatrickseidel.Point2> ret = new java.util.ArrayList<>();
for (c... |
private java.lang.CharSequence generateFixedFlyweightCode(final int size) {
return java.lang.String.format((" private DirectBuffer _buffer;\n" + ((((((((" private int _offset;\n" + " private int _actingVersion;\n\n") + " public void Wrap(DirectBuffer buffer, int offset, int actingVersion... | private java.lang.CharSequence generateFixedFlyweightCode(final int size) {
return java.lang.String.format((" private DirectBuffer _buffer;\n" + ((((((((" private int _offset;\n" + " private int _actingVersion;\n\n") + " public void Wrap(DirectBuffer buffer, int offset, int actingVersion... |
protected void initialize() {
if (((vision.getTimeSinceLastUpdate()) <= (org.usfirst.frc.team1294.robot.commands.TurnTowardsVisionTarget.MAX_AGE_OF_VISION_DATA)) && (vision.isTargetAcquired())) {
double bearing = ((vision.getTargetX()) - ((org.usfirst.frc.team1294.robot.commands.TurnTowardsVisionTarget.WIDT... | protected void initialize() {
if (((vision.getTimeSinceLastUpdate()) <= (org.usfirst.frc.team1294.robot.commands.TurnTowardsVisionTarget.MAX_AGE_OF_VISION_DATA)) && (vision.isTargetAcquired())) {
bearing = ((vision.getTargetX()) - ((org.usfirst.frc.team1294.robot.commands.TurnTowardsVisionTarget.WIDTH) / 2)... |
public V getAndPut(K key, V value) {
V oldValue = kvStore.getAndPut(key, value);
subscriptions.notifyEvent((oldValue == null ? net.openhft.chronicle.engine.map.InsertedEvent.of(asset.fullName(), key, value, false) : net.openhft.chronicle.engine.map.UpdatedEvent.of(asset.fullName(), key, oldValue, value, false, ... | public V getAndPut(K key, V value) {
V oldValue = kvStore.getAndPut(key, value);
subscriptions.notifyEvent((oldValue == null ? net.openhft.chronicle.engine.map.InsertedEvent.of(asset.fullName(), key, value, false) : net.openhft.chronicle.engine.map.UpdatedEvent.of(asset.fullName(), key, oldValue, value, false, ... |
public void onLoad() {
game.stageBackground.addActor(imgWinter);
game.stageBackground.addActor(imgWinter2);
game.stageBackground.addActor(star1);
game.stageBackground.addActor(star2);
addDogs();
net.heinousgames.game.doggoisland.stages.Level002 level002 = new net.heinousgames.game.doggoisland.st... | public void onLoad() {
game.stageBackground.addActor(imgWinter);
game.stageBackground.addActor(imgWinter2);
game.stageBackground.addActor(star1);
game.stageBackground.addActor(star2);
net.heinousgames.game.doggoisland.stages.Level002 level002 = new net.heinousgames.game.doggoisland.stages.Level002(g... |
public void deleteAllUsers() {
java.sql.PreparedStatement stmt = null;
java.sql.ResultSet keyRS = null;
try {
java.lang.String insertQuery = "DELETE FROM User";
stmt = db.getConnect().prepareStatement(insertQuery);
stmt.executeUpdate();
} catch (java.sql.SQLException e) {
... | public void deleteAllUsers() {
java.sql.PreparedStatement stmt = null;
java.sql.ResultSet keyRS = null;
try {
java.lang.String insertQuery = "DELETE FROM User";
stmt = db.getConnect().prepareStatement(insertQuery);
stmt.executeUpdate();
} catch (java.sql.SQLException e) {
... |
public void hookReturn() throws org.squiddev.cobalt.LuaError {
if ((inhook) || ((hookfunc) == null))
return ;
inhook = true;
try {
hookfunc.onReturn(state, this, getStack());
} catch (org.squiddev.cobalt.LuaError e) {
inhook = false;
throw e;
} catch (java.lang.E... | public void hookReturn() throws org.squiddev.cobalt.LuaError {
if ((inhook) || ((hookfunc) == null))
return ;
inhook = true;
try {
hookfunc.onReturn(state, this, getStack());
} catch (org.squiddev.cobalt.LuaError e) {
inhook = false;
throw e;
} catch (java.lang.E... |
private static org.spine3.client.EntityFilters toEntityFilters(org.spine3.server.event.EventStreamQuery query) {
final org.spine3.client.EntityFilters.Builder builder = org.spine3.client.EntityFilters.newBuilder();
if (query.hasAfter()) {
final com.google.protobuf.Timestamp timestamp = query.getAfter();... | private static org.spine3.client.EntityFilters toEntityFilters(org.spine3.server.event.EventStreamQuery query) {
final org.spine3.client.EntityFilters.Builder builder = org.spine3.client.EntityFilters.newBuilder();
if (query.hasAfter()) {
final com.google.protobuf.Timestamp timestamp = query.getAfter();... |
public void startPlay() {
com.ml.yx.comm.BBLog.d("kkkkkkkk", ("startPlay currentUri --> " + (currentUri)));
if (com.ml.yx.comm.StringUtil.isNotBlank(currentUri)) {
videoView.setVideoURI(android.net.Uri.parse(currentUri));
videoView.start();
if ((videoPlayListener) != null) {
... | public void startPlay() {
if (com.ml.yx.comm.StringUtil.isNotBlank(currentUri)) {
videoView.setVideoURI(android.net.Uri.parse(currentUri));
videoView.start();
if ((videoPlayListener) != null) {
videoPlayListener.onPlayStart();
}
}
} |
public void fillRecyclerView(int primaryResource, int emptyResource, java.util.ArrayList<zollie.travelblogger.guidee.models.EventModel> eventModels) {
android.support.v7.widget.RecyclerView rvEvents = ((android.support.v7.widget.RecyclerView) (findViewById(primaryResource)));
rvEvents.setNestedScrollingEnabled(... | public void fillRecyclerView(int primaryResource, int emptyResource, java.util.ArrayList<zollie.travelblogger.guidee.models.EventModel> eventModels) {
android.support.v7.widget.RecyclerView rvEvents = ((android.support.v7.widget.RecyclerView) (findViewById(primaryResource)));
rvEvents.setNestedScrollingEnabled(... |
private static java.lang.String loadScxmlFile(java.lang.String name) throws java.lang.Exception {
java.lang.String filename = cruise.umple.compiler.UmpleImportTest.getFullFilePath(name);
assertEquals(true, new java.io.File(filename).exists());
cruise.umple.compiler.ScxmlImportHandler handler = new cruise.um... | private static java.lang.String loadScxmlFile(final java.lang.String name) throws java.lang.Exception {
assertTrue(new java.io.File(name).exists());
cruise.umple.compiler.ScxmlImportHandler handler = new cruise.umple.compiler.ScxmlImportHandler();
cruise.umple.compiler.UmpleImportModel umple = handler.readD... |
private org.hamcrest.Matcher<de.pdark.decentxml.Element> capability(final java.lang.String id, final java.lang.String version) {
return new org.hamcrest.TypeSafeMatcher<de.pdark.decentxml.Element>() {
@java.lang.Override
public void describeTo(org.hamcrest.Description description) {
desc... | private static org.hamcrest.Matcher<de.pdark.decentxml.Element> capability(final java.lang.String id, final java.lang.String version) {
return new org.hamcrest.TypeSafeMatcher<de.pdark.decentxml.Element>() {
@java.lang.Override
public void describeTo(org.hamcrest.Description description) {
... |
public void enqueue(E newData) {
if (this.isEmpty()) {
head.setData(newData);
}else {
Node<E> newElement = new Node<E>(newData, null);
tail.setNext(newElement);
this.tail = newElement;
}
} | public void enqueue(E newData) {
if (this.isEmpty()) {
head = new Node<E>(newData, tail);
tail = head;
}else {
Node<E> newElement = new Node<E>(newData, null);
tail.setNext(newElement);
this.tail = newElement;
}
} |
public void write(int b) throws java.io.IOException {
if ((buffer) == null) {
buffer = org.wso2.carbon.messaging.BufferFactory.getInstance().getBuffer();
addMessageBody(buffer);
}
if (buffer.hasRemaining()) {
buffer.put(((byte) (b)));
}else {
buffer = org.wso2.carbon.mess... | public void write(int b) throws java.io.IOException {
if ((buffer) == null) {
buffer = org.wso2.carbon.messaging.BufferFactory.getInstance().getBuffer();
}
if (buffer.hasRemaining()) {
buffer.put(((byte) (b)));
}else {
addMessageBody(buffer);
buffer = org.wso2.carbon.mess... |
private seedu.bulletjournal.model.task.Task generatePerson(int seed) throws java.lang.Exception {
return new seedu.bulletjournal.model.task.Task(new seedu.bulletjournal.model.task.TaskName(("Person " + seed)), new seedu.bulletjournal.model.task.DueDate(("" + (java.lang.Math.abs(seed)))), new seedu.bulletjournal.mod... | private seedu.bulletjournal.model.task.Task generatePerson(int seed) throws java.lang.Exception {
return new seedu.bulletjournal.model.task.Task(new seedu.bulletjournal.model.task.TaskName(("Person " + seed)), new seedu.bulletjournal.model.task.DueDate(("" + (java.lang.Math.abs(seed)))), new seedu.bulletjournal.mod... |
public static void main(java.lang.String[] args) throws gate.util.GateException, java.io.IOException, java.net.URISyntaxException, net.asteasolutions.cinusuidi.sluncho.questionparser.exception.QuestionParserException {
net.asteasolutions.cinusuidi.sluncho.BeforeStartConfig.configSystemProperties();
gate.Gate.in... | public static void main(java.lang.String[] args) throws gate.util.GateException, java.io.IOException, java.net.URISyntaxException, net.asteasolutions.cinusuidi.sluncho.questionparser.exception.QuestionParserException {
net.asteasolutions.cinusuidi.sluncho.BeforeStartConfig.configSystemProperties();
gate.Gate.in... |
private void changeStateOfControlModuleGroup(int groupNumber, boolean turnOn) {
byte opCode = (turnOn == true) ? WHCSOpCodes.TURN_ON_MODULE : WHCSOpCodes.TURN_OFF_MODULE;
com.whcs_ucf.whcs_android.DatabaseHandler dbHandler = new com.whcs_ucf.whcs_android.DatabaseHandler(this.getApplicationContext());
java.u... | private void changeStateOfControlModuleGroup(int groupNumber, boolean turnOn) {
byte opCode = (turnOn == true) ? WHCSOpCodes.TURN_ON_MODULE : WHCSOpCodes.TURN_OFF_MODULE;
com.whcs_ucf.whcs_android.DatabaseHandler dbHandler = new com.whcs_ucf.whcs_android.DatabaseHandler(this.getApplicationContext());
java.u... |
public void flyThrough(gov.nasa.arc.dert.scene.tool.Path path, java.awt.Dialog owner) {
if ((flyThroughDialog) != null) {
java.awt.Toolkit.getDefaultToolkit().beep();
return ;
}
flyThroughDialog = new gov.nasa.arc.dert.view.viewpoint.FlyThroughDialog(owner, this);
flyThroughDialog.pack()... | public void flyThrough(gov.nasa.arc.dert.scene.tool.Path path, java.awt.Dialog owner) {
if ((flyThroughDialog) == null) {
flyThroughDialog = new gov.nasa.arc.dert.view.viewpoint.FlyThroughDialog(owner, this);
flyThroughDialog.pack();
flyThroughDialog.setLocationRelativeTo(owner);
fly... |
public static void main(java.lang.String[] args) throws java.lang.Exception {
java.lang.String serializedClassifier = "/home/1546/source/stanford-ner-2015-12-09/classifiers/english.all.3class.distsim.crf.ser.gz";
edu.stanford.nlp.ie.AbstractSequenceClassifier<edu.stanford.nlp.ling.CoreLabel> classifier = CRFCla... | public static void main(java.lang.String[] args) throws java.lang.Exception {
java.lang.String serializedClassifier = "/home/1546/source/stanford-ner-2015-12-09/classifiers/english.all.3class.distsim.crf.ser.gz";
java.lang.String source_dir = args[0];
java.lang.String dest_dir = args[1];
File[] director... |
private java.lang.String buildSortAndClause(java.lang.String sortOrder, java.lang.String limit, java.lang.String offset) {
java.lang.String limitClause = "";
if (!(android.text.TextUtils.isEmpty(limit))) {
limitClause = " LIMIT " + limit;
}
if (!(android.text.TextUtils.isEmpty(offset))) {
... | private java.lang.String buildSortAndClause(java.lang.String sortOrder, java.lang.String limit, java.lang.String offset) {
java.lang.String limitClause = null;
if (!(android.text.TextUtils.isEmpty(limit))) {
limitClause = " LIMIT " + limit;
}
if (!(android.text.TextUtils.isEmpty(offset))) {
... |
public static java.lang.String getEndPath(java.lang.String path) {
com.zuoxiaolong.niubi.job.core.helper.AssertHelper.notNull(path, "path can't be null.");
return (path.indexOf("/")) > 0 ? path.substring(((path.lastIndexOf("/")) + 1)) : path;
} | public static java.lang.String getEndPath(java.lang.String path) {
com.zuoxiaolong.niubi.job.core.helper.AssertHelper.notNull(path, "path can't be null.");
return (path.indexOf("/")) >= 0 ? path.substring(((path.lastIndexOf("/")) + 1)) : path;
} |
private void changeTrackingState() {
if (mRequestingLocationUpdates) {
mRequestingLocationUpdates = false;
stopLocationUpdates();
updateUiThread.interrupt();
this.startTrackingButton.setText("START TRACKING");
}else {
mRequestingLocationUpdates = true;
startLocati... | private void changeTrackingState() {
if (mRequestingLocationUpdates) {
mRequestingLocationUpdates = false;
updateUiThread.interrupt();
stopLocationUpdates();
this.startTrackingButton.setText("START TRACKING");
}else {
mRequestingLocationUpdates = true;
startLocati... |
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (android.preference.PreferenceManager.getDefaultSharedPreferences(app).getBoolean(DistanceTracker.PREF_TRACKING, false)) {
android.widget.ToggleButton bTrack... | protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
app = ((com.dtracker.DistanceTracker) (getApplication()));
if (android.preference.PreferenceManager.getDefaultSharedPreferences(app).getBoolean(DistanceTracker.PREF... |
public boolean execute(java.lang.String action, org.json.JSONArray args, org.apache.cordova.CallbackContext callbackContext) throws org.json.JSONException {
try {
if (action.equals("coolMethod")) {
java.lang.String message = args.getString(0);
this.coolMethod(message, callbackContext... | public boolean execute(java.lang.String action, org.json.JSONArray args, org.apache.cordova.CallbackContext callbackContext) throws org.json.JSONException {
if (action.equals("coolMethod")) {
java.lang.String message = args.getString(0);
this.coolMethod(message, callbackContext);
return true... |
protected void onPostExecute(java.lang.Boolean aBoolean) {
if (aBoolean) {
updateJobs(list);
}else {
android.widget.Toast.makeText(this, (((getString(R.string.query_error)) + " -refreshJobs- ") + (ERROR)), Toast.LENGTH_SHORT).show();
}
} | protected void onPostExecute(java.lang.Boolean aBoolean) {
if ((aBoolean != null) && aBoolean) {
updateJobs(list);
}else {
android.widget.Toast.makeText(this, (((getString(R.string.query_error)) + " -refreshJobs- ") + (ERROR)), Toast.LENGTH_SHORT).show();
}
} |
public android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent) {
android.view.LayoutInflater inflater = ((android.view.LayoutInflater) (context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)));
android.view.View rowView = inflater.inflate(R.layout.list_item_layou... | public android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent) {
android.view.LayoutInflater inflater = ((android.view.LayoutInflater) (context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)));
android.view.View rowView = inflater.inflate(R.layout.list_item_layou... |
private boolean permissionCheck() {
while (((cn.tonlyshy.app.fmpet.utility.PermissionCheckerer.checkFloatWindowPermission(this)) != true) || ((cn.tonlyshy.app.fmpet.utility.PermissionCheckerer.checkNotificationListenerPermission(this)) != true)) {
if ((cn.tonlyshy.app.fmpet.utility.PermissionCheckerer.check... | private boolean permissionCheck() {
if (((cn.tonlyshy.app.fmpet.utility.PermissionCheckerer.checkFloatWindowPermission(this)) != true) || ((cn.tonlyshy.app.fmpet.utility.PermissionCheckerer.checkNotificationListenerPermission(this)) != true)) {
if ((cn.tonlyshy.app.fmpet.utility.PermissionCheckerer.checkFlo... |
public void shouldCallToPersistenceDeleteWhenCacheDeleteIsCalled() throws java.lang.Exception {
org.mockito.Mockito.when(persistence.delete(com.mobilejazz.cacheio.CacheManagerTest.FAKE_KEY)).thenReturn(true);
boolean result = cache.delete(com.mobilejazz.cacheio.CacheManagerTest.FAKE_KEY);
org.mockito.Mockit... | public void shouldCallToPersistenceDeleteWhenCacheDeleteIsCalled() throws java.lang.Exception {
when(persistence.delete(com.mobilejazz.cacheio.CacheManagerTest.FAKE_KEY)).thenReturn(true);
boolean result = cache.delete(com.mobilejazz.cacheio.CacheManagerTest.FAKE_KEY);
verify(persistence).delete(com.mobilej... |
private void initDetector() {
moduleFTCAL.initDetector();
moduleFTHODO.initDetector();
this.FTview1.addDetectorLayer(moduleFTCAL.drawDetector((-10.0), 0));
this.FTview2.addDetectorLayer(this.drawDetector((+10.0), 0.0));
this.FTview1.addDetectorListener(this);
this.FTview2.addDetectorListener(thi... | private void initDetector() {
moduleFTCAL.initDetector();
moduleFTHODO.initDetector();
this.FTview1.addDetectorLayer(moduleFTCAL.drawDetector((-10.0), 0));
this.FTview2.addDetectorLayer(moduleFTHODO.drawDetector((+10.0), 0.0));
this.FTview1.addDetectorListener(this);
this.FTview2.addDetectorList... |
private int findTrainOnTrack(int trainID) {
for (int i = 0; i < (trainsOnTrack.size()); ++i) {
java.lang.System.out.println(("train =" + (trainsOnTrack.get(i).trainID)));
if ((trainsOnTrack.get(i).trainID) == trainID)
return i;
}
return -1;
} | private int findTrainOnTrack(int trainID) {
for (int i = 0; i < (trainsOnTrack.size()); ++i) {
if ((trainsOnTrack.get(i).trainID) == trainID)
return i;
}
return -1;
} |
public void prepararPesquisa() {
try {
io.github.samirsales.dao.FabricanteDAO dao = new io.github.samirsales.dao.FabricanteDAO();
java.util.ArrayList<io.github.samirsales.domain.Fabricante> arrayList = dao.listar();
items = new javax.faces.model.ListDataModel<io.github.samirsales.domain.Fabr... | public void prepararPesquisa() {
try {
io.github.samirsales.dao.FabricanteDAO dao = new io.github.samirsales.dao.FabricanteDAO();
items = dao.listar();
} catch (java.sql.SQLException e) {
e.printStackTrace();
io.github.samirsales.util.JSFUtil.adicionarMensagemErro(e.getMessage())... |
public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
if ((keyCode == (android.view.KeyEvent.KEYCODE_BACK)) && (progressParam.cancelable)) {
if (contentView.isEnabled()) {
contentView.setEnabled(false);
onFinish();
}
}
return true;
} | public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
if ((keyCode == (android.view.KeyEvent.KEYCODE_BACK)) && (progressParam.cancelable)) {
if (contentView.isEnabled()) {
contentView.setEnabled(false);
}
onFinish();
}
return true;
} |
private void saveNum1AndUpdateText() {
inputText = inputText.replace(",", ".");
num1 = java.lang.Double.parseDouble(inputText);
inputText = inputText.replace(".", ",");
storedOperands = (((decimalFormat.format(num1)) + " ") + (action)).replace('.', ',');
textFieldInput.setText(storedOperands);
i... | private void saveNum1AndUpdateText() {
if (!(inputText.isEmpty())) {
inputText = inputText.replace(",", ".");
num1 = java.lang.Double.parseDouble(inputText);
inputText = inputText.replace(".", ",");
storedOperands = (((decimalFormat.format(num1)) + " ") + (action)).replace('.', ',');... |
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_simulator);
setSupportActionBar(((android.support.v7.widget.Toolbar) (findViewById(R.id.toolbar))));
android.support.v7.app.ActionBar actionBar = getSupportActionBar();
... | protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_simulator);
setSupportActionBar(((android.support.v7.widget.Toolbar) (findViewById(R.id.toolbar))));
android.support.v7.app.ActionBar actionBar = getSupportActionBar();
... |
public void add(ea.raum.Raum m) {
if (lock) {
ea.internal.util.Logger.error("Knoten", ("Fehler: Der Knoten, an dem ein neues Objekt anzumelden war, " + "ist im Lock-Zustand."));
return ;
}
list.add(m);
java.util.Collections.sort(list);
if ((worldHandler) != null)
m.updateWorl... | public void add(ea.raum.Raum m) {
if (lock) {
ea.internal.util.Logger.error("Knoten", ("Fehler: Der Knoten, an dem ein neues Objekt anzumelden war, " + "ist im Lock-Zustand."));
return ;
}
if ((worldHandler) != null)
m.updateWorld(worldHandler);
list.add(m);
java.util.Co... |
public void interpret() {
this.say("Interpreting...");
while ((location) < (lines.size())) {
java.lang.String s = lines.get(location);
if (s.contains("professor")) {
this.loadProfessor();
}
}
this.say("Done.");
this.say(((this.professors.size()) + " Professors Lo... | public void interpret() {
this.say("Interpreting...");
while ((location) < (lines.size())) {
java.lang.String s = lines.get(location);
if (s.contains("professor")) {
this.loadProfessor();
}
(location)++;
}
this.say("Done.");
this.say(((this.professors.siz... |
public void afterTextChanged(android.text.Editable s) {
java.lang.String str = ("还能输入" + (remainTextLength)) + "个字";
mTextLength.setText(str);
if ((temp.length()) >= 10) {
android.widget.Toast.makeText(mContext, R.string.text_too_long, Toast.LENGTH_SHORT).show();
}
} | public void afterTextChanged(android.text.Editable s) {
java.lang.String str = ("还能输入" + (remainTextLength)) + "个字";
mTextLength.setText(str);
if ((temp.length()) >= 10) {
android.widget.Toast.makeText(mContext, getString(R.string.text_too_long), Toast.LENGTH_SHORT).show();
}
} |
protected java.lang.Void doInBackground(java.lang.Void... params) {
byte[] data = new byte[]{ joyControl , joyState };
java.net.DatagramPacket dp = new java.net.DatagramPacket(data, data.length, mServerAddress, SERVER_PORT);
try {
mSocket.send(dp);
} catch (java.io.IOException e) {
e.pri... | protected java.lang.Boolean doInBackground(java.lang.Void... params) {
byte[] data = new byte[]{ joyControl , joyState };
java.net.DatagramPacket dp = new java.net.DatagramPacket(data, data.length, mServerAddress, SERVER_PORT);
try {
mSocket.send(dp);
} catch (java.io.IOException e) {
e.... |
public static java.lang.String getNameOfBackFacingDevice() {
for (int i = 0; i < (android.hardware.Camera.getNumberOfCameras()); ++i) {
android.hardware.Camera.CameraInfo info = new android.hardware.Camera.CameraInfo();
android.hardware.Camera.getCameraInfo(i, info);
if ((info.facing) == (Ca... | public static java.lang.String getNameOfBackFacingDevice() {
for (int i = 0; i < (android.hardware.Camera.getNumberOfCameras()); ++i) {
android.hardware.Camera.CameraInfo info = new android.hardware.Camera.CameraInfo();
android.hardware.Camera.getCameraInfo(i, info);
if ((info.facing) == (Ca... |
public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mId = getArguments().getInt("mensaId");
position = getArguments().getInt("position");
meals = this.getMeals(position, mId);
this.setListAdapter(new com.pasta.mensadd.util.MealListAdapter(getActivity().ge... | public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mId = getArguments().getInt("mensaId");
position = getArguments().getInt("position");
meals = this.getMeals(position, mId);
if ((meals) == null)
meals = new java.util.ArrayList<>();
this... |
public static boolean isValid(java.lang.String link) {
try {
if (link == null)
return false;
java.net.URI uri = new java.net.URI(link);
return (uri.getScheme().equals("http")) || (uri.getScheme().equals("https"));
} catch (java.net.URISyntaxException e) {
ret... | public static boolean isValid(java.lang.String link) {
try {
if (link == null)
return false;
java.net.URI uri = new java.net.URI(link);
if ((uri.getScheme()) == null)
return false;
return (uri.getScheme().equals("http")) || (uri.getScheme().e... |
protected void onStart() {
super.onStart();
if (!(mLocationClient.isStarted()))
mLocationClient.start();
if (com.avos.avoscloud.AVUser.getCurrentUser().getBoolean("isShareSignInfo")) {
com.wenjiehe.xingji.Activity.NearbyMomentsActivity.arraylistNearbyMoments.clear();
refresh.aut... | protected void onStart() {
super.onStart();
if (!(mLocationClient.isStarted()))
mLocationClient.start();
if (com.avos.avoscloud.AVUser.getCurrentUser().getBoolean("isShareSignInfo")) {
com.wenjiehe.xingji.Activity.NearbyMomentsActivity.arraylistNearbyMoments.clear();
}
} |
void process(long deltaTime, de.pinkproblem.multipong.Ball ball) {
double dst = (ball.getyPosition()) - (getShieldCenter());
double dir;
if (dst >= 0) {
dir = 1;
}else {
dir = -1;
}
double maxDst = java.lang.Math.min(((dir * deltaTime) * (velocity)), dst);
move(maxDst);
} | void process(long deltaTime, de.pinkproblem.multipong.Ball ball) {
double dst = (ball.getyPosition()) - (getShieldCenter());
double dir;
if (dst >= 0) {
dir = 1;
}else {
dir = -1;
}
double maxDst = java.lang.Math.min((deltaTime * (velocity)), java.lang.Math.abs(dst));
move((d... |
private void logProgress(java.lang.Integer offset, java.lang.Integer totalNbOfItems, int lastPercentageOfProcessedItems) {
int percentageOfProcessedItems = (offset * 100) / totalNbOfItems;
if ((percentageOfProcessedItems > (lastPercentageOfProcessedItems + 10)) && (percentageOfProcessedItems < 100)) {
l... | private int logProgress(java.lang.Integer offset, java.lang.Integer totalNbOfItems, int lastPercentageOfProcessedItems) {
int percentageOfProcessedItems = (offset * 100) / totalNbOfItems;
if ((percentageOfProcessedItems > (lastPercentageOfProcessedItems + 10)) && (percentageOfProcessedItems < 100)) {
lo... |
private com.typesafe.config.impl.AbstractConfigValue parseConcatenation(com.typesafe.config.impl.ConfigNodeConcatenation n) {
if ((flavor) == (com.typesafe.config.ConfigSyntax.JSON))
return null;
java.util.List<com.typesafe.config.impl.AbstractConfigValue> values = new java.util.ArrayList<com.types... | private com.typesafe.config.impl.AbstractConfigValue parseConcatenation(com.typesafe.config.impl.ConfigNodeConcatenation n) {
if ((flavor) == (com.typesafe.config.ConfigSyntax.JSON))
return null;
java.util.List<com.typesafe.config.impl.AbstractConfigValue> values = new java.util.ArrayList<com.types... |
public static teamcool.tradego.User fromJSON(org.json.JSONObject object) {
teamcool.tradego.User user = null;
try {
user = new teamcool.tradego.User(object.getString("name"), object.getString("id"), object.getJSONObject("location").getString("name"), object.getString("timezone"), new java.util.ArrayList... | public static teamcool.tradego.User fromJSON(org.json.JSONObject object) {
teamcool.tradego.User user = null;
try {
user = new teamcool.tradego.User(object.getString("name"), object.getString("id"), object.getJSONObject("location").getString("name"), object.getString("timezone"), null, new java.util.Arr... |
public java.lang.Object parseAndClose(java.io.Reader reader, java.lang.reflect.Type dataType) throws java.io.IOException {
try {
final java.lang.Class clazz = java.lang.Class.forName(dataType.getTypeName());
return com.joyent.manta.client.MantaObjectParser.MAPPER.readValue(reader, clazz);
} catc... | public java.lang.Object parseAndClose(final java.io.Reader reader, final java.lang.reflect.Type dataType) throws java.io.IOException {
try {
final java.lang.Class clazz = java.lang.Class.forName(dataType.getTypeName());
return com.joyent.manta.client.MantaObjectParser.MAPPER.readValue(reader, clazz)... |
public int hit(int armor) {
if ((armor > 0) && (armor < 20)) {
int damage = DAMAGE;
}else {
int damage = (DAMAGE) - armor;
}
if ((damage) < 0) {
return 0;
}
return damage;
} | public int hit(int armor) {
int damage;
if ((armor > 0) && (armor < 20)) {
damage = DAMAGE;
}else {
damage = (DAMAGE) - armor;
}
if (damage < 0) {
return 0;
}
return damage;
} |
public void testConvertWhereCondition() {
com.amalto.workbench.webservices.WSWhereCondition wc = new com.amalto.workbench.webservices.WSWhereCondition("Entity/Id", com.amalto.workbench.webservices.WSWhereOperator.CONTAINS, "id1", com.amalto.workbench.webservices.WSStringPredicate.OR, false);
java.lang.String[] ... | public void testConvertWhereCondition() {
com.amalto.workbench.webservices.WSWhereCondition wc = new com.amalto.workbench.webservices.WSWhereCondition("Entity/Id", com.amalto.workbench.webservices.WSWhereOperator.CONTAINS, "id1", false, com.amalto.workbench.webservices.WSStringPredicate.OR);
java.lang.String[] ... |
public void increaseCachedValue(int entry) {
int blocknumber = entry / (dk.egense.math.distributions.WrappedStreamedBlockPacker.BLOCK_SIZE);
int nextCacheEntry = blockCacheCount[blocknumber];
blockCache[blocknumber][nextCacheEntry] = entry;
blockCacheCount[blocknumber] = ++nextCacheEntry;
java.lang.... | public void increaseCachedValue(int entry) {
int blocknumber = entry / (dk.egense.math.distributions.WrappedStreamedBlockPacker.BLOCK_SIZE);
int nextCacheEntry = blockCacheCount[blocknumber];
blockCache[blocknumber][nextCacheEntry] = entry;
blockCacheCount[blocknumber] = ++nextCacheEntry;
if (nextCa... |
public java.math.BigDecimal listCommoditiesAmount(java.lang.String identifier, java.lang.String name, java.lang.String mobile, java.util.List<java.lang.String> cellNames, java.util.List<com.gezipu360.common.entity.sell.store.Store> storeList) {
return commodityDao.listCommoditiesAmount(identifier, name, mobile, cel... | public java.math.BigDecimal listCommoditiesAmount(java.lang.String identifier, java.lang.String name, java.lang.String mobile, java.util.List<java.lang.String> cellNames, java.util.List<com.gezipu360.common.entity.sell.store.Store> storeList) {
java.math.BigDecimal result = commodityDao.listCommoditiesAmount(identi... |
private java.lang.String addStepToRenameVolume(com.emc.storageos.workflow.Workflow workflow, com.emc.storageos.db.client.model.StorageSystem vplexSystem, java.net.URI vplexVolumeURI, java.lang.String newVolumeName, java.lang.String waitFor) {
java.net.URI vplexURI = vplexSystem.getId();
com.emc.storageos.workfl... | private java.lang.String addStepToRenameVolume(com.emc.storageos.workflow.Workflow workflow, com.emc.storageos.db.client.model.StorageSystem vplexSystem, java.net.URI vplexVolumeURI, java.lang.String newVolumeName, java.lang.String waitFor) {
java.net.URI vplexURI = vplexSystem.getId();
com.emc.storageos.workfl... |
private java.net.Socket enableTLSOnSocket(java.net.Socket socket) {
if ((socket != null) && (socket instanceof javax.net.ssl.SSLSocket)) {
if ((android.os.Build.VERSION.SDK_INT) >= (android.os.Build.VERSION_CODES.JELLY_BEAN)) {
((javax.net.ssl.SSLSocket) (socket)).setEnabledProtocols(new java.la... | private java.net.Socket enableTLSOnSocket(java.net.Socket socket) {
if (socket instanceof javax.net.ssl.SSLSocket) {
if ((android.os.Build.VERSION.SDK_INT) >= (android.os.Build.VERSION_CODES.JELLY_BEAN)) {
((javax.net.ssl.SSLSocket) (socket)).setEnabledProtocols(new java.lang.String[]{ "TLSv1.1"... |
public static com.nec.congenio.test.MockPathContext create(@javax.annotation.Nullable
org.w3c.dom.Element root) {
com.nec.congenio.test.MockPathContext path = new com.nec.congenio.test.MockPathContext();
if (root != null) {
for (org.w3c.dom.Element e : com.nec.congenio.xml.XML.getElements(root)) {
... | public static com.nec.congenio.test.MockPathContext create(@javax.annotation.Nullable
org.w3c.dom.Element root) {
com.nec.congenio.test.MockPathContext path = new com.nec.congenio.test.MockPathContext();
if (root != null) {
for (org.w3c.dom.Element e : com.nec.congenio.xml.XML.getElements(root)) {
... |
private void unbindFileView(org.amahi.anywhere.server.model.ServerFile file, android.view.View fileView) {
android.widget.TextView fileTitle = ((android.widget.TextView) (fileView.getTag(org.amahi.anywhere.adapter.ServerFilesMetadataAdapter.Tags.FILE_TITLE)));
android.widget.ImageView fileIcon = ((android.widge... | private void unbindFileView(org.amahi.anywhere.server.model.ServerFile file, android.view.View fileView) {
android.widget.TextView fileTitle = ((android.widget.TextView) (fileView.getTag(org.amahi.anywhere.adapter.ServerFilesMetadataAdapter.Tags.FILE_TITLE)));
android.widget.ImageView fileIcon = ((android.widge... |
public java.lang.String printSplurges() {
java.lang.String expenses = "";
for (java.lang.String key : splurges.keySet()) {
expenses += key + ":\n";
for (Expenses expense : splurges.get(key)) {
expenses += expense + "\n";
}
}
return expenses;
} | public java.lang.String printSplurges() {
java.lang.String expenses = "";
for (java.lang.String key : splurges.keySet()) {
expenses += key + ":\n";
for (Expenses expense : splurges.get(key)) {
expenses += ("\t" + expense) + "\n";
}
}
return expenses;
} |
public static com.google.common.base.Optional<java.lang.annotation.Annotation> findAnyAnnotationAnnotatedWith(java.lang.annotation.Annotation[] annotations, java.lang.Class<? extends java.lang.annotation.Annotation> annotatedWith) {
for (java.lang.annotation.Annotation annotation : annotations) {
if (annota... | public static com.google.common.base.Optional<java.lang.annotation.Annotation> findAnyAnnotationAnnotatedWith(java.lang.annotation.Annotation[] annotations, java.lang.Class<? extends java.lang.annotation.Annotation> annotatedWith) {
for (java.lang.annotation.Annotation annotation : annotations) {
if (annota... |
public void testTransformAttributeForParameters() throws java.lang.Throwable {
class Foo {
@com.orhanobut.tracklytics.TrackEvent(value = "event")
@com.orhanobut.tracklytics.TransformAttributeMap(keys = { 0 , 1 }, values = { "value1" , "value2" })
public void foo(@com.orhanobut.tracklytics.Tr... | public void testTransformAttributeForParameters() throws java.lang.Throwable {
class Foo {
@com.orhanobut.tracklytics.TrackEvent(value = "event")
@com.orhanobut.tracklytics.TransformAttributeMap(keys = { 0 , 1 }, values = { "value1" , "value2" })
public void foo(@com.orhanobut.tracklytics.Tr... |
public java.util.List<com.pm.server.player.Pacman> getAllPlayers() {
if ((pacman) == null) {
com.pm.server.repository.PacmanRepositoryImpl.log.debug("Retrieving Pacman: null");
return null;
}
java.util.List<com.pm.server.player.Pacman> pacmanList = new java.util.ArrayList<com.pm.server.playe... | public java.util.List<com.pm.server.player.Pacman> getAllPlayers() {
java.util.List<com.pm.server.player.Pacman> pacmanList = new java.util.ArrayList<com.pm.server.player.Pacman>();
if ((pacman) == null) {
com.pm.server.repository.PacmanRepositoryImpl.log.debug("Retrieving Pacman: null");
return... |
private java.lang.String getMessageShare() {
if ((fragmentItemTask.getGenreList().get(0).getId()) == 99) {
return getString(R.string.message_share_documental);
}
switch (getMediaType()) {
case Common.TMDB_CODE_MOVIES :
return getString(R.string.message_share_movie);
case ... | private java.lang.String getMessageShare() {
if (((fragmentItemTask.getGenreList()) != null) && ((fragmentItemTask.getGenreList().size()) > 0)) {
if ((fragmentItemTask.getGenreList().get(0).getId()) == 99) {
return getString(R.string.message_share_documental);
}
}
switch (getMedi... |
private static com.gempukku.lang.Variable validateParameter(int line, java.util.Map<java.lang.String, com.gempukku.lang.Variable> parameters, java.lang.String parameterName, java.lang.String functionName, com.gempukku.lang.Variable.Type expectedType) throws com.gempukku.lang.ExecutionException {
com.gempukku.lang.V... | public static com.gempukku.lang.Variable validateParameter(int line, java.util.Map<java.lang.String, com.gempukku.lang.Variable> parameters, java.lang.String parameterName, java.lang.String functionName, com.gempukku.lang.Variable.Type expectedType) throws com.gempukku.lang.ExecutionException {
com.gempukku.lang.Va... |
public void setComment(java.lang.String comment) {
if ((this.comment) == null) {
this.comment = "";
this.comment += comment;
this.comment += "\n";
}else {
this.comment = ((comment + "\n") + (this.comment)) + "\n";
}
notifyListeners();
} | public void setComment(java.lang.String comment) {
if ((this.comment) == null) {
this.comment = "";
this.comment += comment;
this.comment += "\n";
}else {
this.comment = (comment + "\n") + (this.comment);
}
notifyListeners();
} |
private void handleBlobStoreNotifyOptimizations(com.gigaspaces.internal.server.storage.NotifyTemplateHolder template, boolean register) {
if ((!(_cacheManager.isOffHeapCachePolicy())) || (!(template.containsNotifyType(NotifyActionType.NOTIFY_TAKE))))
return ;
if (!register) {
if ((!(anyDura... | private void handleBlobStoreNotifyOptimizations(com.gigaspaces.internal.server.storage.NotifyTemplateHolder template, boolean register) {
if ((!(_cacheManager.isOffHeapCachePolicy())) || (!(template.containsNotifyType(NotifyActionType.NOTIFY_TAKE))))
return ;
if (!register) {
if (!(anyDurab... |
public java.util.List<java.util.List<java.lang.Integer>> move(java.util.List<java.util.List<java.lang.Integer>> firstPlayerPositions, java.util.List<java.util.List<java.lang.Integer>> secondPlayerPositions) throws com.blackship.battlesheep.game.state.exceptions.WrongStateException {
gameState = gameState.changeStat... | public java.util.List<java.util.List<java.lang.Integer>> move(java.util.List<java.util.List<java.lang.Integer>> firstPlayerPositions, java.util.List<java.util.List<java.lang.Integer>> secondPlayerPositions) throws com.blackship.battlesheep.game.state.exceptions.WrongStateException {
gameState = gameState.changeStat... |
private java.lang.Boolean nameMatches(final org.scenarioo.model.design.entities.Issue issue, final java.lang.String objectName, final java.lang.String type) {
if (type == "scenario") {
return ((issue.getScenarioContextLink()) != null) && (issue.getScenarioContextLink().equals(objectName));
}else {
... | private java.lang.Boolean nameMatches(final org.scenarioo.model.design.entities.Issue issue, final java.lang.String objectName, final java.lang.String type) {
if (type.equals("scenario")) {
return ((issue.getScenarioContextLink()) != null) && (issue.getScenarioContextLink().equals(objectName));
}else {
... |
public static jp.hichain.prototype.basic.CompleteBS get(int _player, char _ch) {
for (jp.hichain.prototype.basic.CompleteBS bs : jp.hichain.prototype.ui.SignData.signs) {
if (((bs.getPlayer()) == _player) && ((bs.getChar()) == _ch)) {
return bs;
}
}
return jp.hichain.prototype.ui... | public static jp.hichain.prototype.basic.CompleteBS get(int _player, char _ch) {
for (jp.hichain.prototype.basic.CompleteBS bs : jp.hichain.prototype.ui.SignData.signs) {
if (((bs.getPlayer()) == _player) && ((bs.getChar()) == _ch)) {
return new jp.hichain.prototype.basic.CompleteBS(bs);
... |
private void configuratePath() {
java.util.Calendar now = java.util.Calendar.getInstance();
logPath = ((((((PARENT_FOLDER) + (now.get(java.util.Calendar.YEAR))) + "/") + (now.get(java.util.Calendar.MONTH))) + "/") + (now.get(java.util.Calendar.DAY_OF_MONTH))) + "/";
new java.io.File(logPath).mkdirs();
} | private void configuratePath() {
java.util.Calendar now = java.util.Calendar.getInstance();
logPath = ((((((PARENT_FOLDER) + (now.get(java.util.Calendar.YEAR))) + "/") + (now.get(java.util.Calendar.MONTH))) + "/") + (now.get(java.util.Calendar.DAY_OF_MONTH))) + "/";
new java.io.File(logPath).mkdirs();
j... |
public void test() throws com.mob41.kmbeta.exception.CouldNotLoadDatabaseException, com.mob41.kmbeta.exception.InvalidArrivalTargetException {
final java.lang.String busno = "2A";
final java.lang.String stopcode = "LO02T10000";
final java.lang.String stopname = "LOK WAH BUS TERMINUS";
final int bound = ... | public void test() throws com.mob41.kmbeta.exception.CouldNotLoadDatabaseException, com.mob41.kmbeta.exception.InvalidArrivalTargetException {
final java.lang.String busno = "2A";
final java.lang.String stopcode = "LO02T10000";
final java.lang.String stopname = "LOK WAH BUS TERMINUS";
final int bound = ... |
public io.swagger.models.Swagger parse(java.lang.String swaggerAsString, java.util.List<io.swagger.models.auth.AuthorizationValue> auths) {
io.swagger.models.Swagger output;
try {
output = new io.swagger.parser.Swagger20Parser().parse(swaggerAsString);
if (((output != null) && (auths != null)) &... | public io.swagger.models.Swagger parse(java.lang.String swaggerAsString, java.util.List<io.swagger.models.auth.AuthorizationValue> auths) {
io.swagger.models.Swagger output;
try {
output = new io.swagger.parser.Swagger20Parser().parse(swaggerAsString);
if (output != null) {
return ne... |
public void corrupt(java.util.ArrayList list, int max) {
int size = list.size();
int howmanydeaths = 0;
if (size > max) {
howmanydeaths = size - max;
if ((list.size()) >= howmanydeaths)
for (int i = 0; i < (howmanydeaths - 2); i++)
list.remove(i);
... | public void corrupt(java.util.ArrayList list, int max) {
int size = list.size();
int howmanydeaths = 0;
if (size > max) {
howmanydeaths = (size - max) - 1;
for (int i = 0; i < howmanydeaths; i++) {
list.remove(i);
}
}else
if (size > 2)
list.remove(... |
public static int getTimeBySec(java.lang.String timeText) {
java.lang.String[] splitedTime = timeText.split(":");
int timeBySec = ((java.lang.Integer.parseInt(splitedTime[0])) * 60) + (java.lang.Integer.parseInt(splitedTime[1]));
return timeBySec;
} | public static int getTimeBySec(java.lang.String timeText) {
if (timeText == null) {
return 0;
}
java.lang.String[] splitedTime = timeText.split(":");
int timeBySec = ((java.lang.Integer.parseInt(splitedTime[0])) * 60) + (java.lang.Integer.parseInt(splitedTime[1]));
return timeBySec;
} |
public void run() {
this.init();
int fps = 30;
double timePerTick = 1.0E9 / fps;
double deltaTime = 0;
long lastTimeTicked = java.lang.System.nanoTime();
long now;
while (isRunning) {
now = java.lang.System.nanoTime();
deltaTime += (now - lastTimeTicked) / timePerTick;
... | public void run() {
this.init();
int fps = 30;
double timePerTick = 1.0E9 / fps;
double deltaTime = 0;
long lastTimeTicked = java.lang.System.nanoTime();
long now;
while (isRunning) {
now = java.lang.System.nanoTime();
deltaTime += (now - lastTimeTicked) / timePerTick;
... |
public void reset() {
if ((mLocalBlockWorkerClientPool) != null) {
mLocalBlockWorkerClientPool.close();
}
mLocalBlockWorkerClientPoolInitialized = false;
if (null != (mBlockMasterClientPool)) {
return ;
}
mBlockMasterClientPool = new alluxio.client.block.BlockMasterClientPool(all... | public void reset() {
if ((mBlockMasterClientPool) != null) {
mBlockMasterClientPool.close();
}
if ((mLocalBlockWorkerClientPool) != null) {
mLocalBlockWorkerClientPool.close();
}
mBlockMasterClientPool = new alluxio.client.block.BlockMasterClientPool(alluxio.client.ClientContext.get... |
public void onDrawerOpened(android.view.View drawerView) {
super.onDrawerOpened(drawerView);
if (!(isAdded())) {
return ;
}
if (!(mUserLearnedDrawer)) {
mUserLearnedDrawer = true;
uk.org.crimetalk.utils.PreferenceUtils.setUserLearnedNavigation(getActivity(), true);
}
getA... | public void onDrawerOpened(android.view.View drawerView) {
super.onDrawerOpened(drawerView);
if (!(isAdded())) {
return ;
}
if (!(mUserLearnedDrawer)) {
mUserLearnedDrawer = true;
uk.org.crimetalk.utils.PreferenceUtils.setUserLearnedNavigation(getActivity(), true);
}
} |
ctl.loadProjects();
projectPnls = new java.util.ArrayList<gui.ProjectPanel>();
for (int i = 0; i < (ctl.getProjects().size()); i++) {
gui.ProjectPanel pnl = new gui.ProjectPanel(ctl.getProjects().get(i), this, ctl);
pnl.changeStatus(ctl.getProjects().get(i).getStatus());
projectPnls.... | projectPnls = new java.util.ArrayList<gui.ProjectPanel>();
for (int i = 0; i < (ctl.getProjects().size()); i++) {
gui.ProjectPanel pnl = new gui.ProjectPanel(ctl.getProjects().get(i), this, ctl);
pnl.changeStatus(ctl.getProjects().get(i).getStatus());
projectPnls.add(pnl);
}
} |
private void getFavoriteList() {
java.util.Map<java.lang.String, ?> keys = sharedPreferences.getAll();
for (java.util.Map.Entry<java.lang.String, ?> entry : keys.entrySet()) {
favoriteItemList.clear();
favoriteItemList.add(new in.codehex.shopit.model.FavoriteItem(entry.getValue().toString()));
... | private void getFavoriteList() {
java.util.Map<java.lang.String, ?> keys = sharedPreferences.getAll();
favoriteItemList.clear();
for (java.util.Map.Entry<java.lang.String, ?> entry : keys.entrySet()) {
favoriteItemList.add(new in.codehex.shopit.model.FavoriteItem(entry.getValue().toString()));
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.