buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public java.lang.String stockNames() {
java.lang.String[] names = m.getNames();
javax.json.JsonArrayBuilder createArrayBuilder = javax.json.Json.createArrayBuilder();
for (java.lang.String s : names) {
javax.json.JsonObjectBuilder add = javax.json.Json.createObjectBuilder().add("name", s);
c... | public java.lang.String stockNames() {
java.lang.String[] names = m.getNames();
javax.json.JsonArrayBuilder createArrayBuilder = javax.json.Json.createArrayBuilder();
for (java.lang.String s : names) {
createArrayBuilder.add(javax.json.Json.createObjectBuilder().add("name", s));
}
return jav... |
public void whenUserResetsPasswordPasswordInvalid_verifyInvalidPasswordException() throws java.lang.Exception {
com.e451.rest.domains.user.User user = users.get(0);
user.setResetPasswordGuid("1234");
user.setResetPasswordSentDate(new java.util.Date());
org.mockito.Mockito.when(userRepository.findByReset... | public void whenUserResetsPasswordPasswordInvalid_verifyInvalidPasswordException() throws java.lang.Exception {
com.e451.rest.domains.user.User user = users.get(0);
user.setResetPasswordGuid("1234");
user.setResetPasswordSentDate(new java.util.Date());
org.mockito.Mockito.when(userRepository.findByReset... |
public org.neo4j.driver.internal.packstream.PackOutput writeBytes(byte[] data, int offset, int length) throws java.io.IOException {
int index = 0;
while (index < length) {
ensure(1);
int amountToWrite = java.lang.Math.min(buffer.remaining(), (length - index));
buffer.put(data, offset, am... | public org.neo4j.driver.internal.packstream.PackOutput writeBytes(byte[] data, int offset, int length) throws java.io.IOException {
while (offset < length) {
ensure(1);
int amountToWrite = java.lang.Math.min(buffer.remaining(), (length - offset));
buffer.put(data, offset, amountToWrite);
... |
public static int sendEnergyTo(net.minecraft.world.IBlockAccess world, net.minecraft.util.math.BlockPos pos, int maxSend, net.minecraft.util.EnumFacing side) {
net.minecraft.tileentity.TileEntity tile = world.getTileEntity(pos.add(side.getFrontOffsetX(), side.getFrontOffsetY(), side.getFrontOffsetZ()));
if ((ti... | public static int sendEnergyTo(net.minecraft.world.IBlockAccess world, net.minecraft.util.math.BlockPos pos, int maxSend, net.minecraft.util.EnumFacing side) {
net.minecraft.tileentity.TileEntity tile = world.getTileEntity(pos.offset(side));
if ((tile != null) && (com.brandon3055.brandonscore.lib.EnergyHelper.c... |
private java.lang.String isAppRunning(android.content.Context context) {
android.app.ActivityManager activityManager = ((android.app.ActivityManager) (context.getSystemService(Context.ACTIVITY_SERVICE)));
java.lang.String res = new java.lang.String();
java.util.List<android.app.ActivityManager.RunningAppPro... | private java.lang.String isAppRunning(android.content.Context context) {
android.app.ActivityManager activityManager = ((android.app.ActivityManager) (context.getSystemService(Context.ACTIVITY_SERVICE)));
java.lang.String res = new java.lang.String();
java.util.List<android.app.ActivityManager.RunningAppPro... |
public void onEntityDeath(org.bukkit.event.entity.EntityDeathEvent event) {
if (!((event.getEntity()) instanceof org.bukkit.entity.Player))
return ;
for (de.beimax.simplespleef.game.Game game : games) {
game.onPlayerDeath(((org.bukkit.entity.Player) (event.getEntity())));
}
} | public void onEntityDeath(org.bukkit.event.entity.EntityDeathEvent event) {
if (!((event.getEntity()) instanceof org.bukkit.entity.Player))
return ;
for (de.beimax.simplespleef.game.Game game : games) {
if (game.onPlayerDeath(((org.bukkit.entity.Player) (event.getEntity()))))
re... |
public java.util.List<net.osmand.data.LatLon> getIntermediatePointsLatLonNavigation() {
java.util.List<net.osmand.data.LatLon> intermediatePointsLatLon = new java.util.ArrayList<net.osmand.data.LatLon>();
if (settings.USE_INTERMEDIATE_POINTS_NAVIGATION.get()) {
for (net.osmand.plus.TargetPointsHelper.Ta... | public java.util.List<net.osmand.data.LatLon> getIntermediatePointsLatLonNavigation() {
java.util.List<net.osmand.data.LatLon> intermediatePointsLatLon = new java.util.ArrayList<net.osmand.data.LatLon>();
if (settings.USE_INTERMEDIATE_POINTS_NAVIGATION.get()) {
for (net.osmand.plus.TargetPointsHelper.Ta... |
public java.lang.String editRequest() {
if ((selectedRequest.isExecuted()) == true) {
selectedRequest.setFinished(new java.util.Date());
}else {
selectedRequest.setFinished(null);
selectedRequest.setAssignee(null);
}
requestService.updateRequest(selectedRequest);
return (java... | public java.lang.String editRequest() {
if ((selectedRequest.isExecuted()) == true) {
selectedRequest.setFinished(new java.util.Date());
}else {
selectedRequest.setFinished(null);
}
requestService.updateRequest(selectedRequest);
return (javax.faces.context.FacesContext.getCurrentInst... |
public com.dd.Player getActivePlayer() {
if ((playerType) == (PlayerType.FIGHTER)) {
return ((com.dd.Fighter) (activeFighter));
}else
if ((playerType) == (PlayerType.WIZARD)) {
return ((com.dd.Wizard) (activeWizard));
}else {
return null;
}
} | public com.dd.Player getActivePlayer() {
if ((playerType) == (PlayerType.FIGHTER)) {
return ((com.dd.Fighter) (activeFighter));
}else
if ((playerType) == (PlayerType.WIZARD)) {
return ((com.dd.Wizard) (activeWizard));
}else {
return new com.dd.Player();
}
... |
protected java.util.Collection<java.lang.String> getWwnsInZone(com.emc.storageos.networkcontroller.impl.mds.Zone zone) {
java.util.Set<java.lang.String> col = com.google.common.collect.Sets.newHashSet();
if ((zone.getMembers()) != null) {
for (com.emc.storageos.networkcontroller.impl.mds.ZoneMember memb... | protected java.util.Collection<java.lang.String> getWwnsInZone(com.emc.storageos.networkcontroller.impl.mds.Zone zone) {
java.util.Set<java.lang.String> col = com.google.common.collect.Sets.newHashSet();
if ((zone.getMembers()) != null) {
for (com.emc.storageos.networkcontroller.impl.mds.ZoneMember memb... |
public ATMServer.Server handleData() throws java.io.IOException {
java.net.Socket clientConnection;
int i = 0;
int maxConnections = 200;
while ((i++) < maxConnections) {
clientConnection = s.accept();
ATMServer.Worker worker = new ATMServer.Worker(clientConnection, functions, clientData)... | public ATMServer.Server handleData() throws java.io.IOException {
int i = 0;
int maxConnections = 200;
while ((i++) < maxConnections) {
java.net.Socket clientConnection = s.accept();
ATMServer.Worker worker = new ATMServer.Worker(clientConnection, functions, clientData);
java.lang.Th... |
public void onBackPressed() {
super.onBackPressed();
android.content.Intent intent = new android.content.Intent();
intent.putExtra(de.hft.stuttgart.strawberry.activities.BluetoothSearchActivity.EXTRA_DEVICE_SELECTED, deviceSelected);
if ((mBTAdapter) != null) {
mBTAdapter.cancelDiscovery();
... | public void onBackPressed() {
super.onBackPressed();
android.content.Intent intent = new android.content.Intent();
intent.putExtra(de.hft.stuttgart.strawberry.activities.BluetoothSearchActivity.EXTRA_DEVICE_SELECTED, deviceSelected);
if ((mBTAdapter) != null) {
mBTAdapter.cancelDiscovery();
... |
public void onItemClick(android.widget.AdapterView<?> parent, android.view.View view, int position, long id) {
android.widget.Toast.makeText(getApplication(), ((com.socks.selectcitymodule.view.CitySortModel) (adapter.getItem(position))).getName(), Toast.LENGTH_SHORT).show();
} | public void onItemClick(android.widget.AdapterView<?> parent, android.view.View view, int position, long id) {
android.widget.Toast.makeText(getApplication(), ((com.socks.selectcitymodule.view.CitySortModel) (adapter.getItem((position - 1)))).getName(), Toast.LENGTH_SHORT).show();
} |
protected void onCreate(final android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.activity_pets);
new com.example.patitas.pets.PetsPresenter(com.example.patitas.util.Injection.providePetsRepository(), this.petsFragment);
butterknife.ButterKnife.bind(t... | protected void onCreate(final android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.activity_pets);
new com.example.patitas.pets.PetsPresenter(com.example.patitas.util.Injection.providePetsRepository(), this.petsFragment);
butterknife.ButterKnife.bind(t... |
protected void onPostCreate(android.os.Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
android.view.View karbo = findViewById(R.id.karbo);
karbo.setNextFocusDownId(R.id.blodsugar);
android.view.View bs = findViewById(R.id.blodsugar);
bs.setNextFocusDownId(R.id.calcButton);
k... | protected void onPostCreate(android.os.Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
android.view.View bs = findViewById(R.id.blodsugar);
bs.setNextFocusDownId(R.id.calcButton);
android.view.inputmethod.InputMethodManager imm = ((android.view.inputmethod.InputMethodManager) (getSy... |
public static final java.lang.String padLeftEvenly(final java.lang.String s, final char c) {
java.lang.StringBuilder sb = new java.lang.StringBuilder();
if (s != null) {
if (s.isEmpty()) {
sb.append(c);
sb.append(c);
}else {
if (api.util.Mathematics.isOdd(s.le... | public static final java.lang.String padLeftEvenly(final java.lang.String s, final char c) {
java.lang.String result = s;
if ((result != null) && (api.util.Mathematics.isOdd(result.length()))) {
java.lang.StringBuilder sb = new java.lang.StringBuilder();
sb.append(c);
sb.append(result);
... |
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mAdapter = new com.alphabet.alphabetsdklib.uitls.CommonBaseAdapter<com.alphabet.alphabetsdk.MainActivity.ActivityBean>(this, com.alphabet.alphabetsdk.MainActivity.sActi... | protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mAdapter = new com.alphabet.alphabetsdklib.uitls.CommonBaseAdapter<com.alphabet.alphabetsdk.MainActivity.ActivityBean>(this, com.alphabet.alphabetsdk.MainActivity.sActi... |
private java.io.File createTempFile(java.lang.String body) {
java.io.File temp = null;
if (!(body.contains("definitions"))) {
java.lang.System.out.println("WSDL definition not found");
return null;
}
try {
temp = java.io.File.createTempFile("temp", ".wsdl");
java.io.Buffe... | private java.io.File createTempFile(java.lang.String body) {
java.io.File temp = null;
if (!(body.contains("definitions"))) {
return null;
}
try {
temp = java.io.File.createTempFile("temp", ".wsdl");
java.io.BufferedWriter bw = new java.io.BufferedWriter(new java.io.FileWriter(te... |
protected void checkError(com.google.gson.JsonObject resultMessage) throws org.rapla.framework.RaplaException {
com.google.gson.JsonElement errorElement = resultMessage.get("error");
if (errorElement != null) {
org.rapla.framework.RaplaException ex = deserializeExceptionObject(resultMessage);
ja... | protected void checkError(com.google.gson.JsonObject resultMessage) throws org.rapla.framework.RaplaException {
com.google.gson.JsonElement errorElement = resultMessage.get("error");
if (errorElement != null) {
org.rapla.framework.RaplaException ex = deserializeExceptionObject(resultMessage);
ja... |
public rx.Observable<java.util.List<com.akobylianskiy.movies.data.entity.GenreEntity>> genres() {
return db.createQuery(GenreDb.TABLE_NAME, GenreDb.SELECT_ALL).mapToList(new rx.functions.Func1<android.database.Cursor, com.akobylianskiy.movies.data.entity.GenreEntity>() {
@java.lang.Override
public c... | public rx.Observable<java.util.List<com.akobylianskiy.movies.data.entity.GenreEntity>> genres() {
return db.createQuery(GenreDb.TABLE_NAME, GenreDb.SELECT_ALL).mapToList(new rx.functions.Func1<android.database.Cursor, com.akobylianskiy.movies.data.entity.GenreEntity>() {
@java.lang.Override
public c... |
public void updateLocation(android.location.Location location) {
if ((startLocation) == null) {
startLocation = location;
currentLocation = location;
currentDistance = new com.illotus.dgd.Drive(0.0);
}else {
currentLocation = location;
currentDistance.update(startLocation... | public void updateLocation(android.location.Location location) {
if ((startLocation) == null) {
startLocation = location;
currentLocation = location;
currentDistance = new com.illotus.dgd.Drive(0);
}else {
currentLocation = location;
currentDistance.update(startLocation, ... |
public void onEditButtons(android.view.MenuItem item) {
android.widget.TextView textView;
textView = ((android.widget.TextView) (findViewById(R.id.text_mode)));
if (editing) {
item.setIcon(R.drawable.ic_menu_play_clip);
textView.setText(R.string.play_mode);
editing = false;
}else... | public void onEditButtons(android.view.MenuItem item) {
android.widget.TextView textView;
textView = ((android.widget.TextView) (findViewById(R.id.text_mode)));
if (editing) {
item.setIcon(R.drawable.ic_menu_edit);
textView.setText(R.string.play_mode);
editing = false;
}else {
... |
private void updatePhysics() {
final double PFPS = 60;
final long nsBetweenFrames = ((long) ((java.lang.Math.pow(10, 9)) / PFPS));
final long now = java.lang.System.nanoTime();
while ((now - (lastPhysicsTime)) > nsBetweenFrames) {
p.update();
lastPhysicsTime += nsBetweenFrames;
}
} | private void updatePhysics() {
final double PFPS = 60;
final long nsBetweenFrames = ((long) ((java.lang.Math.pow(10, 9)) / PFPS));
final long now = java.lang.System.nanoTime();
while ((now - (lastPhysicsTime)) > nsBetweenFrames) {
p.update(PFPS);
lastPhysicsTime += nsBetweenFrames;
}... |
private java.util.List<java.lang.String> getFileList(java.util.List<java.io.File> files) {
java.util.List<java.lang.String> lines = new java.util.ArrayList<>();
for (java.io.File f : files) {
if (!(fileProgressPanel.contains(f)))
continue;
lines.add(java.lang.String.format("... | private java.util.List<java.lang.String> getFileList(java.util.List<java.io.File> files) {
java.util.List<java.lang.String> lines = new java.util.ArrayList<>();
for (java.io.File f : files) {
lines.add(java.lang.String.format("file '%s'", f.getAbsolutePath()));
}
return lines;
} |
public void run() {
try {
android.util.Log.v(tag, "serverThread run ");
android.bluetooth.BluetoothServerSocket server_bt_socket = myBtAdapter.listenUsingRfcommWithServiceRecord("myServerSocket", java.util.UUID.fromString(string_uuid));
android.util.Log.v(tag, "wait client request");
... | public void run() {
try {
android.util.Log.v(tag, "serverThread run ");
server_bt_socket = myBtAdapter.listenUsingRfcommWithServiceRecord("myServerSocket", java.util.UUID.fromString(string_uuid));
android.util.Log.v(tag, "wait client request");
server_socket = server_bt_socket.accept... |
public void listLoaded(java.util.List<com.amlcurran.messages.core.conversationlist.Conversation> conversations) {
java.util.Collections.sort(conversations, preferenceStore.getConversationSortComparator());
source.replace(conversations);
conversationListView.hideLoadingUi();
if ((conversations.size()) ==... | public void listLoaded(java.util.List<com.amlcurran.messages.core.conversationlist.Conversation> conversations) {
source.replace(conversations);
conversationListView.hideLoadingUi();
if ((conversations.size()) == 0) {
conversationListView.showEmptyUi();
}else {
conversationListView.hideE... |
public void setupUI(java.util.ArrayList<com.ludoscity.findmybikes.StationItem> stationsNetwork, boolean lookingForBike, java.lang.String stringIfEmpty) {
if (stationsNetwork != null) {
if (!(stationsNetwork.isEmpty())) {
mStationRecyclerView.setVisibility(View.VISIBLE);
mEmptyListTex... | public void setupUI(java.util.ArrayList<com.ludoscity.findmybikes.StationItem> stationsNetwork, boolean lookingForBike, java.lang.String stringIfEmpty) {
if (stationsNetwork != null) {
if (!(stationsNetwork.isEmpty())) {
mStationRecyclerView.setVisibility(View.VISIBLE);
mEmptyListTex... |
private int countWhiteSpace(java.lang.CharSequence org) {
int whiteSpace = 0;
for (int i = 0; i < (org.length()); ++i) {
if ((org.charAt(i)) == ' ')
whiteSpace++;
}
return whiteSpace;
} | private int countWhiteSpace(java.lang.CharSequence org) {
int whiteSpace = 0;
int length = org.length();
for (int i = 0; i < length; ++i) {
if ((org.charAt(i)) == ' ')
whiteSpace++;
}
return whiteSpace;
} |
public void run() {
try {
isom3320.Main.clip = javax.sound.sampled.AudioSystem.getClip();
javax.sound.sampled.AudioInputStream inputStream = javax.sound.sampled.AudioSystem.getAudioInputStream(isom3320.Main.class.getResourceAsStream(("/res/" + url)));
isom3320.Main.clip.open(inputStream);
... | public void run() {
try {
isom3320.Main.clip = javax.sound.sampled.AudioSystem.getClip();
javax.sound.sampled.AudioInputStream inputStream = javax.sound.sampled.AudioSystem.getAudioInputStream(isom3320.Main.class.getResourceAsStream(("/res/" + url)));
isom3320.Main.clip.open(inputStream);
... |
private void getLastLocation() {
mFusedLocationClient.getLastLocation().addOnSuccessListener(this, new com.google.android.gms.tasks.OnSuccessListener<android.location.Location>() {
@java.lang.Override
public void onSuccess(android.location.Location location) {
if (location != null) {
... | private void getLastLocation() {
mFusedLocationClient.getLastLocation().addOnSuccessListener(this, new com.google.android.gms.tasks.OnSuccessListener<android.location.Location>() {
@java.lang.Override
public void onSuccess(android.location.Location location) {
if (location != null) {
... |
protected void onReceivingData() {
podcasts = ((java.util.List) (receiveDataService.getData()));
context.stopService(intentService);
if (((podcasts) == null) || ((podcasts.size()) < (com.readyo.app.fragments.navigation.FragmentShowDetails.limit))) {
thereIsMoreData = false;
}
updatePodcastsU... | protected void onReceivingData() {
podcasts = ((java.util.List) (receiveDataService.getData()));
if (((podcasts) == null) || ((podcasts.size()) < (com.readyo.app.fragments.navigation.FragmentShowDetails.limit))) {
thereIsMoreData = false;
}
updatePodcastsUI();
requestSent = false;
offset... |
public java.lang.Object instantiateItem(android.view.ViewGroup collection, int position) {
T currentView;
if ((mViews.length) > position) {
currentView = getViewForPosition(position);
}else {
return null;
}
collection.addView(currentView);
return currentView;
} | public java.lang.Object instantiateItem(android.view.ViewGroup collection, int position) {
T currentView;
if (((mViews.length) > position) && (position >= 0)) {
currentView = getViewForPosition(position);
}else {
return null;
}
collection.addView(currentView);
return currentView;... |
public void onDataChange(com.google.firebase.database.DataSnapshot dataSnapshot) {
com.example.pc.flickr.models.FavoriteModel favoriteModel = dataSnapshot.getValue(com.example.pc.flickr.models.FavoriteModel.class);
if (favoriteModel != null) {
button.setBackgroundColor(android.support.v4.content.Context... | public void onDataChange(com.google.firebase.database.DataSnapshot dataSnapshot) {
com.example.pc.flickr.models.FavoriteModel favoriteModel = dataSnapshot.getValue(com.example.pc.flickr.models.FavoriteModel.class);
if (favoriteModel != null) {
button.setBackgroundColor(android.support.v4.content.Context... |
public void calculateITScore(java.util.List<edu.virginia.cs.solr.model.Topic> topics, int tagSize, edu.virginia.cs.solr.repository.QuestionRepository repository) {
double[] topic_pro_arr = getTopKTopicProbArr(topics, tagSize, repository);
this.score = ((tagDistinctCount) * (java.lang.Math.log(((tagRawCount) + 1... | public void calculateITScore(java.util.Set<edu.virginia.cs.solr.model.Topic> topics, int tagSize, edu.virginia.cs.solr.repository.QuestionRepository repository) {
double[] topic_pro_arr = getTopKTopicProbArr(topics, tagSize, repository);
this.score = ((tagDistinctCount) * (java.lang.Math.log(((tagRawCount) + 1)... |
private java.util.List<java.lang.String> parsePathsProperty(java.lang.String commaSeparatedPaths) {
java.util.List<java.lang.String> paths = new java.util.ArrayList<java.lang.String>();
for (java.lang.String path : commaSeparatedPaths.split(",")) {
path = cleanupPath(path);
if (!(path.equals("")... | private java.util.List<java.lang.String> parsePathsProperty(java.lang.String commaSeparatedPaths) {
java.util.List<java.lang.String> paths = new java.util.ArrayList<java.lang.String>();
if (commaSeparatedPaths != null) {
for (java.lang.String path : commaSeparatedPaths.split(",")) {
path = c... |
public static void addFeed(java.lang.String feed) {
try {
java.util.Set<java.lang.String> feeds = feedblender.utils.FeedStorage.getFeeds();
feeds.add(feed);
feedblender.utils.FeedStorage.prefs.put(feedblender.utils.FeedStorage.PREFS_FEED_URL, feedblender.utils.FeedStorage.gson.toJson(feeds))... | public static java.lang.String addFeed(java.lang.String feed) {
try {
java.util.Set<java.lang.String> feeds = feedblender.utils.FeedStorage.getFeeds();
feeds.add(feed);
feedblender.utils.FeedStorage.prefs.put(feedblender.utils.FeedStorage.PREFS_FEED_URL, feedblender.utils.FeedStorage.gson.to... |
private static java.lang.String getDaysInMonthBound(int year, int month) {
java.util.Calendar cal = java.util.Calendar.getInstance(java.util.TimeZone.getTimeZone("GMT"));
cal.set(java.util.Calendar.YEAR, year);
cal.set(java.util.Calendar.MONTH, month);
return new java.lang.Integer(cal.getActualMaximum(j... | private static java.lang.String getDaysInMonthBound(int year, int month) {
java.util.Calendar cal = java.util.Calendar.getInstance(java.util.TimeZone.getTimeZone("GMT"));
cal.set(java.util.Calendar.YEAR, year);
cal.set(java.util.Calendar.MONTH, month);
cal.set(java.util.Calendar.DAY_OF_MONTH, 1);
re... |
public void onPrivateMessage(net.blay09.mods.eirairc.api.event.IRCPrivateChatEvent event) {
if ((event.sender) == null) {
return ;
}
mnm.mods.tabbychat.api.Channel channel = mnm.mods.tabbychat.api.TabbyAPI.getAPI().getChat().getChannel(event.sender.getName());
channel.setPrefixHidden(true);
... | public void onPrivateMessage(net.blay09.mods.eirairc.api.event.IRCPrivateChatEvent event) {
if ((event.sender) == null) {
return ;
}
mnm.mods.tabbychat.api.Channel channel = mnm.mods.tabbychat.api.TabbyAPI.getAPI().getChat().getChannel(event.sender.getName(), true);
channel.setPrefixHidden(true)... |
protected void onSizeChanged(int xNew, int yNew, int xOld, int yOld) {
super.onSizeChanged(xNew, yNew, xOld, yOld);
if (!(mLockSelectionOnResize)) {
if (yNew < yOld) {
this.postDelayed(new java.lang.Runnable() {
@java.lang.Override
public void run() {
... | protected void onSizeChanged(int xNew, int yNew, int xOld, int yOld) {
super.onSizeChanged(xNew, yNew, xOld, yOld);
if (!(mLockSelectionOnResize)) {
if (yNew < yOld) {
this.postDelayed(new java.lang.Runnable() {
@java.lang.Override
public void run() {
... |
private static java.lang.StringBuilder run(java.io.BufferedReader br) throws java.io.IOException, java.lang.InterruptedException {
java.lang.StringBuilder msg = new java.lang.StringBuilder();
while ((events.commands.LinuxCommand.line = br.readLine()) != null) {
msg.append(events.commands.LinuxCommand.li... | private static java.lang.StringBuilder run(java.io.BufferedReader br) throws java.io.IOException, java.lang.InterruptedException {
java.lang.StringBuilder msg = new java.lang.StringBuilder();
while ((events.commands.LinuxCommand.line = br.readLine()) != null) {
msg.append(events.commands.LinuxCommand.li... |
public void invoke() {
if ((result != null) && (!(result.isEmpty()))) {
view.setEmptyVisible(false);
view.setMarkdown(result);
loadTableSorters();
loadMath(wikiKey, isPreview);
loadWidgets(wikiKey, isPreview);
}
} | public void invoke() {
if ((result != null) && (!(result.isEmpty()))) {
view.setEmptyVisible(false);
view.setMarkdown(result);
loadTableSorters();
loadMath(wikiKey, isPreview);
loadWidgets(wikiKey, isPreview);
}else {
view.setEmptyVisible(true);
}
} |
public nigel.footballprofile.entity.TeamPlayer findByPlayer(java.lang.String playerId, java.lang.String teamType) {
for (nigel.footballprofile.entity.TeamPlayer tp : teamPlayerDAO.getByPlayer(playerId)) {
if (tp.getTeam().getTeamType().equals(teamType)) {
return tp;
}
}
return nu... | public nigel.footballprofile.entity.TeamPlayer findByPlayer(java.lang.String playerId, java.lang.String teamType) {
java.util.List<nigel.footballprofile.entity.TeamPlayer> list = teamPlayerDAO.getByPlayer(playerId);
for (nigel.footballprofile.entity.TeamPlayer tp : list) {
if (tp.getTeam().getTeamType()... |
protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws java.lang.Exception {
http.authorizeRequests().antMatchers("/", "/index", "/register").permitAll().anyRequest().authenticated().and().csrf().disable().formLogin().permitAll().and().logout().permitAll();
} | protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws java.lang.Exception {
http.authorizeRequests().antMatchers("/", "/index", "/register").permitAll().anyRequest().authenticated().and().formLogin().permitAll().and().logout().permitAll();
} |
public void loadSounds(java.lang.String[] name, java.lang.String[] location) {
if ((name.length) == (location.length)) {
for (int i = 0; 0 < (name.length); i++) {
com.jme3.audio.AudioNode audioNode = new com.jme3.audio.AudioNode(mainApp.getAssetManager(), location[i], AudioData.DataType.Buffer);... | public void loadSounds(java.lang.String[] name, java.lang.String[] location) {
if ((name.length) == (location.length)) {
for (int i = 0; i < (name.length); i++) {
com.jme3.audio.AudioNode audioNode = new com.jme3.audio.AudioNode(mainApp.getAssetManager(), location[i], AudioData.DataType.Buffer);... |
public java.lang.String Advisor() {
java.lang.String returnMessage = SUCCESS_MESSAGE;
uta.cse4361.businessobjects.AdvisorAccount AA = new uta.cse4361.businessobjects.AdvisorAccount();
boolean a = AA.initialize(this.name, this.email, this.department, this.tempPassword, this.rank, this.logNum);
if (a == f... | public java.lang.String Advisor() {
uta.cse4361.businessobjects.AdvisorAccount AA = new uta.cse4361.businessobjects.AdvisorAccount();
boolean a = AA.initialize(this.name, this.email, this.department, this.tempPassword, this.rank, this.logNum);
if (a == false)
return this.CREATE_ADVISOR_FAIL;
... |
public static boolean canAbsorb(com.game.junglelaw.AbstractCircle largeCircle, com.game.junglelaw.AbstractCircle smallCircle) {
if (!(com.game.junglelaw.Utility.isAbsorbableLarger(largeCircle, smallCircle))) {
return false;
}
return ((com.game.junglelaw.Utility.pointsDistance(largeCircle.getmCenter(... | public static boolean canAbsorb(com.game.junglelaw.AbstractCircle largeCircle, com.game.junglelaw.AbstractCircle smallCircle) {
if (!(com.game.junglelaw.Utility.isAbsorbableLarger(largeCircle, smallCircle))) {
return false;
}
return (com.game.junglelaw.Utility.pointsDistance(largeCircle.getmCenter()... |
public void isTakenJumpLeftTest() {
currentPieces.getPiece(10).setColumn(3);
currentPieces.getPiece(10).setRow(4);
changedPieces3.getPiece(14).setRow(3);
changedPieces3.getPiece(14).setColumn(2);
assertTrue(logic.takenJumpLeft(currentPieces, changedPieces3));
} | public void isTakenJumpLeftTest() {
currentPieces.getPiece(10).setColumn(3);
currentPieces.getPiece(10).setRow(4);
changedPieces3.getPiece(10).setColumn(3);
changedPieces3.getPiece(10).setRow(4);
changedPieces3.getPiece(14).setRow(3);
changedPieces3.getPiece(14).setColumn(2);
assertTrue(logi... |
public void inlet(float f) {
int inletIdx;
inletIdx = getInlet();
if (inletIdx == 1) {
fTorsoZAxis = f;
}else
if (inletIdx == 2) {
fLeftHandYAxis = f;
}else
if (inletIdx == 3) {
fRightHandXAxis = f;
}
java.lang... | public void inlet(float f) {
int inletIdx;
inletIdx = getInlet();
if (inletIdx == 3) {
fTorsoZAxis = f;
}else
if (inletIdx == 1) {
fLeftHandYAxis = f;
}else
if (inletIdx == 2) {
fRightHandXAxis = f;
}
java.lang... |
public com.pratilipi.data.transfer.Language getLanguage(java.lang.Long id) {
com.pratilipi.data.transfer.Language language = memcache.get(((com.pratilipi.data.access.DataAccessorWithMemcache.PREFIX_LANGUAGE) + id));
if (language == null) {
language = dataAccessor.getLanguage(id);
if (language !=... | public com.pratilipi.data.transfer.Language getLanguage(java.lang.Long id) {
if (id == null)
return null;
com.pratilipi.data.transfer.Language language = memcache.get(((com.pratilipi.data.access.DataAccessorWithMemcache.PREFIX_LANGUAGE) + id));
if (language == null) {
language = dataAcc... |
private void setUserNameMailView() {
android.widget.TextView textViewName = ((android.widget.TextView) (findViewById(R.id.user_name_header)));
android.widget.TextView textViewMail = ((android.widget.TextView) (findViewById(R.id.user_mail_header)));
textViewName.setText(currentRegisteredUser.getDisplayName()... | private void setUserNameMailView() {
android.widget.TextView textViewName = ((android.widget.TextView) (findViewById(R.id.user_name_header)));
android.widget.TextView textViewMail = ((android.widget.TextView) (findViewById(R.id.user_mail_header)));
textViewName.setText(currentRegisteredUser.getDisplayName()... |
public void unpause() {
timer.setPaused(false);
questionLabel.setText(currentQuestion.getQuestion());
a.setVisible(true);
b.setVisible(true);
c.setVisible(true);
if (!(atQuestionStage))
d.setVisible(true);
repaint();
revalidate();
} | public void unpause() {
timer.setPaused(false);
questionLabel.setText(currentQuestion.getQuestion());
a.setVisible(true);
b.setVisible(true);
c.setVisible(true);
if (atQuestionStage)
d.setVisible(true);
repaint();
revalidate();
} |
public void refresh() {
final org.openthinclient.common.model.Realm realm = ((org.openthinclient.common.model.Realm) (getLookup().lookup(org.openthinclient.common.model.Realm.class)));
try {
for (final org.openide.nodes.Node node : getChildren().getNodes())
if (node instanceof org.openthincl... | public void refresh() {
final org.openthinclient.common.model.Realm realm = ((org.openthinclient.common.model.Realm) (getLookup().lookup(org.openthinclient.common.model.Realm.class)));
try {
realm.refresh();
for (final org.openide.nodes.Node node : getChildren().getNodes())
if (node ... |
public static org.bukkit.entity.Player getRandomPlayer() {
int random = new java.util.Random().nextInt(org.bukkit.Bukkit.getOnlinePlayers().size());
return ((org.bukkit.entity.Player) (org.bukkit.Bukkit.getServer().getOnlinePlayers().toArray()[random]));
} | public static org.bukkit.entity.Player getRandomPlayer() {
if (!(org.bukkit.Bukkit.getServer().getOnlinePlayers().isEmpty())) {
int random = new java.util.Random().nextInt(org.bukkit.Bukkit.getOnlinePlayers().size());
return ((org.bukkit.entity.Player) (org.bukkit.Bukkit.getServer().getOnlinePlayers... |
public com.inva.hipstertest.service.dto.LessonDTO save(com.inva.hipstertest.service.dto.LessonDTO lessonDTO) {
log.debug("Request to save Lesson : {}", lessonDTO);
java.lang.System.out.println("2");
com.inva.hipstertest.domain.Lesson lesson = lessonMapper.lessonDTOToLesson(lessonDTO);
java.lang.System.o... | public com.inva.hipstertest.service.dto.LessonDTO save(com.inva.hipstertest.service.dto.LessonDTO lessonDTO) {
log.debug("Request to save Lesson : {}", lessonDTO);
com.inva.hipstertest.domain.Lesson lesson = lessonMapper.lessonDTOToLesson(lessonDTO);
lesson = lessonRepository.save(lesson);
com.inva.hips... |
public final <ParamsT, ProgressT, ResultT> void runTask(final android.os.AsyncTask<ParamsT, ProgressT, ResultT> asyncTask, final ParamsT... params) {
android.os.Handler mainHandler = new android.os.Handler(android.os.Looper.getMainLooper());
mainHandler.post(new java.lang.Runnable() {
@java.lang.Overrid... | public final <ParamsT, ProgressT, ResultT> void runTask(final android.os.AsyncTask<ParamsT, ProgressT, ResultT> asyncTask, final ParamsT... params) {
mainHandler.post(new java.lang.Runnable() {
@java.lang.Override
public void run() {
asyncTask.execute(params);
}
});
} |
public boolean isPermissionSet(java.lang.String permission) {
ru.tehkode.permissions.PermissionUser user = ru.tehkode.permissions.bukkit.PermissionsEx.getUser(this.player);
if ((user != null) && ((user.getMatchingExpression(permission, this.player.getWorld().getName())) != null)) {
return true;
}
... | public boolean isPermissionSet(java.lang.String permission) {
ru.tehkode.permissions.PermissionUser user = ru.tehkode.permissions.bukkit.PermissionsEx.getUser(this.player);
if ((user != null) && ((user.getMatchingExpression(permission, this.player.getWorld().getName())) != null)) {
return true;
}
... |
public void onResponse(retrofit2.Call<java.lang.Void> call, retrofit2.Response<java.lang.Void> response) {
if ((response.code()) == 200) {
android.util.Log.e("log", "post movie score ==== success");
android.widget.Toast.makeText(mContext, "점수가 입력되었습니다.", Toast.LENGTH_SHORT).show();
mRandomMo... | public void onResponse(retrofit2.Call<java.lang.Void> call, retrofit2.Response<java.lang.Void> response) {
if ((response.code()) == 200) {
android.widget.Toast.makeText(mContext, "점수가 입력되었습니다.", Toast.LENGTH_SHORT).show();
mRandomMovies.get(position).setScore(score);
}
} |
public java.lang.Object invoke(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, java.lang.Object instance, java.lang.Object[] arguments) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException {
shouldBePostMethod(req);
returnsInstanceIdentityIfLocalU... | public java.lang.Object invoke(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, java.lang.Object instance, java.lang.Object[] arguments) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException {
shouldBePostMethod(req);
returnsInstanceIdentityIfLocalU... |
public void preInflationStartup() {
super.preInflationStartup();
mPartnerBrowserRefreshNeeded = !(org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations.isInitialized());
org.chromium.chrome.browser.ApplicationInitialization.enableFullscreenFlags(getResources(), this, getControlConta... | public void preInflationStartup() {
super.preInflationStartup();
mPartnerBrowserRefreshNeeded = !(org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations.isInitialized());
org.chromium.chrome.browser.ApplicationInitialization.enableFullscreenFlags(getResources(), this, getControlConta... |
public void nullInput() {
com.yahoo.sketches.frequencies.ItemsSketch<java.lang.String> sketch = new com.yahoo.sketches.frequencies.ItemsSketch<java.lang.String>((1 << (com.yahoo.sketches.frequencies.Util.LG_MIN_MAP_SIZE)));
sketch.update(null);
org.testng.Assert.assertTrue(sketch.isEmpty());
org.testng.... | public void nullInput() {
com.yahoo.sketches.frequencies.ItemsSketch<java.lang.String> sketch = new com.yahoo.sketches.frequencies.ItemsSketch((1 << (com.yahoo.sketches.frequencies.Util.LG_MIN_MAP_SIZE)));
sketch.update(null);
org.testng.Assert.assertTrue(sketch.isEmpty());
org.testng.Assert.assertEqual... |
public boolean isParallel(edu.kit.joana.ifc.sdg.graph.SDGNode m, int mThread, int region) {
edu.kit.joana.ifc.sdg.graph.slicer.graph.threads.ThreadRegion mRegion = regions.getThreadRegion(m, mThread);
if ((mThread == (mRegion.getThread())) && (!(isDynamic(mThread)))) {
return false;
}else {
... | public boolean isParallel(edu.kit.joana.ifc.sdg.graph.SDGNode m, int mThread, int region) {
edu.kit.joana.ifc.sdg.graph.slicer.graph.threads.ThreadRegion mRegion = regions.getThreadRegion(m, mThread);
if ((mThread == (regions.getThreadRegion(region).getThread())) && (!(isDynamic(mThread)))) {
return fal... |
public void deleteRecord(com.jaitlapps.bestadvice.domain.RecordEntry recordEntry) {
com.jaitlapps.bestadvice.domain.RecordEntry findRecord = null;
for (com.jaitlapps.bestadvice.domain.RecordEntry entry : recordEntries) {
if (entry.getId().equals(recordEntry.getId())) {
findRecord = entry;
... | public void deleteRecord(com.jaitlapps.bestadvice.domain.RecordEntry recordEntry) {
com.jaitlapps.bestadvice.domain.RecordEntry findRecord = null;
for (com.jaitlapps.bestadvice.domain.RecordEntry entry : recordEntries) {
if (entry.getId().equals(recordEntry.getId())) {
findRecord = entry;
... |
private static void test(java.lang.reflect.Method t) {
try {
t.invoke(null);
java.lang.System.out.println(("PASS:" + (t.getName())));
} catch (java.lang.Exception e) {
java.lang.System.out.println(((("FAIL:" + (t.getName())) + ": ") + (e.getCause().getMessage())));
}
} | private static void test(java.lang.reflect.Method t) {
try {
t.invoke(null);
java.lang.System.out.println(("PASS:" + (t.getName())));
} catch (java.lang.Exception e) {
java.lang.System.out.println(((("FAIL:" + (t.getName())) + ": ") + ((e.getCause().getMessage()) != null ? e.getCause().g... |
public static <D extends javafx.scene.Node & org.eclipse.fx.ui.controls.tabpane.DndTabPaneFactory.DragSetup> javafx.scene.layout.Pane setup(org.eclipse.fx.ui.controls.tabpane.DndTabPaneFactory.FeedbackType feedbackType, D dragSetup, java.util.function.Consumer<org.eclipse.fx.ui.controls.tabpane.GenericTab> detachHandle... | public static <D extends javafx.scene.Node & org.eclipse.fx.ui.controls.tabpane.DndTabPaneFactory.DragSetup> javafx.scene.layout.Pane setup(org.eclipse.fx.ui.controls.tabpane.DndTabPaneFactory.FeedbackType feedbackType, D dragSetup, java.util.function.Consumer<org.eclipse.fx.ui.controls.tabpane.GenericTab> detachHandle... |
public void setScreenshotDirectory(java.lang.String screenshotDirectory) throws java.io.IOException {
if ((this.screenshotDirectory) == null) {
java.io.File file = new java.io.File(screenshotDirectory);
if (file.exists()) {
org.apache.commons.io.FileUtils.cleanDirectory(file);
... | public void setScreenshotDirectory(java.lang.String screenshotDirectory) throws java.io.IOException {
if ((this.screenshotDirectory) == null) {
java.io.File file = new java.io.File(screenshotDirectory);
if (!(file.exists())) {
file.mkdir();
}
}
this.screenshotDirectory = ... |
public void onCompleted(java.lang.Exception e, com.google.gson.JsonObject result) {
try {
com.zandyl.slidepuzzle.RedditResponse response = new com.google.gson.Gson().fromJson(result, com.zandyl.slidepuzzle.RedditResponse.class);
java.lang.String url = response.data.children[3].data.preview.images[0]... | public void onCompleted(java.lang.Exception e, com.google.gson.JsonObject result) {
try {
com.zandyl.slidepuzzle.RedditResponse response = new com.google.gson.Gson().fromJson(result, com.zandyl.slidepuzzle.RedditResponse.class);
java.lang.String url = response.data.children[3].data.preview.images[0]... |
private void nextKeyboard(android.view.inputmethod.EditorInfo currentEditorInfo, com.anysoftkeyboard.keyboards.KeyboardSwitcher.NextKeyboardType type) {
com.anysoftkeyboard.utils.Log.d(com.anysoftkeyboard.AnySoftKeyboard.TAG, ((("nextKeyboard: currentEditorInfo.inputType=" + (currentEditorInfo.inputType)) + " type:... | private void nextKeyboard(android.view.inputmethod.EditorInfo currentEditorInfo, com.anysoftkeyboard.keyboards.KeyboardSwitcher.NextKeyboardType type) {
com.anysoftkeyboard.utils.Log.d(com.anysoftkeyboard.AnySoftKeyboard.TAG, ((("nextKeyboard: currentEditorInfo.inputType=" + (currentEditorInfo.inputType)) + " type:... |
private void resize(int newSize) {
Item[] newItems = ((Item[]) (new java.lang.Object[newSize]));
for (int i = 0; i < (items.length); i++) {
newItems[i] = items[i];
}
items = newItems;
} | private void resize(int newSize) {
Item[] newItems = ((Item[]) (new java.lang.Object[newSize]));
for (int i = 0; i < (size); i++) {
newItems[i] = items[i];
}
items = newItems;
} |
private boolean isVersionGreaterOrEquals_1_2_0() {
java.lang.String[] versionSplit = testEditorVersion.split("\\.");
int major = java.lang.Integer.parseInt(versionSplit[0]);
int minor = java.lang.Integer.parseInt(versionSplit[1]);
return ((major == 1) && (minor > 2)) || (major > 1);
} | private boolean isVersionGreaterOrEquals_1_2_0() {
java.lang.String[] versionSplit = testEditorVersion.split("\\.");
int major = java.lang.Integer.parseInt(versionSplit[0]);
int minor = java.lang.Integer.parseInt(versionSplit[1]);
return ((major == 1) && (minor >= 2)) || (major > 1);
} |
public void testBeelineHiveVariable() throws java.lang.Throwable {
java.util.List<java.lang.String> argList = getBaseArgs(org.apache.hive.beeline.TestBeeLineWithArgs.miniHS2.getBaseJdbcURL());
argList.add("--hivevar");
argList.add("DUMMY_TBL=dummy");
final java.lang.String SCRIPT_TEXT = "create table ${... | public void testBeelineHiveVariable() throws java.lang.Throwable {
java.util.List<java.lang.String> argList = getBaseArgs(org.apache.hive.beeline.TestBeeLineWithArgs.miniHS2.getBaseJdbcURL());
argList.add("--hivevar");
argList.add("DUMMY_TBL=dummy");
final java.lang.String SCRIPT_TEXT = "create table ${... |
public static void checkForGCByteArrays() {
if (eta.runtime.io.IO.byteArrayFreeLock.compareAndSet(false, true)) {
try {
java.lang.ref.PhantomReference<eta.runtime.io.ByteArray> ref;
while ((ref = ((java.lang.ref.PhantomReference<eta.runtime.io.ByteArray>) (eta.runtime.io.IO.byteArray... | public static void checkForGCByteArrays() {
if (eta.runtime.io.IO.byteArrayFreeLock.compareAndSet(false, true)) {
try {
java.lang.ref.PhantomReference<eta.runtime.io.ByteArray> ref;
while ((ref = ((java.lang.ref.PhantomReference<eta.runtime.io.ByteArray>) (eta.runtime.io.IO.byteArray... |
private static java.lang.String userNameValidation(java.lang.String userName) {
if (((userName == null) || (!(userName.matches("[0-9a-zA-Z_-]+")))) || ((userName.length()) <= 2)) {
return "Usernames must be at least 3 characters long and can only contain alpha numeric characters, -, and _";
}
if (us... | private static java.lang.String userNameValidation(java.lang.String userName) {
if (((userName == null) || (!(userName.matches("[0-9a-zA-Z_-]+")))) || ((userName.length()) <= 2)) {
return "Usernames must be at least 3 characters long and can only contain alpha numeric characters, -, and _";
}
if (us... |
public static boolean[] allTests(long[] statistics, int r, double z) {
return new boolean[]{ Test.equalProbabilityTest(statistics, z) , Test.elementIndependenceTest(statistics, z) , Test.sequenceHomogeneityTest(statistics, r, z) };
} | private static boolean[] allTests(long[] statistics, int r, double z) {
return new boolean[]{ Test.equalProbabilityTest(statistics, z) , Test.elementIndependenceTest(statistics, z) , Test.sequenceHomogeneityTest(statistics, r, z) };
} |
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
if (savedInstanceState == null) {
app.com.example.android.bulletpoints.ui.DetailActivityFragment fragment = new app.com.example.android.bulletpoints.ui.Detail... | protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
if (savedInstanceState == null) {
app.com.example.android.bulletpoints.ui.DetailActivityFragment fragment = new app.com.example.android.bulletpoints.ui.Detail... |
public void equals() {
org.expath.ns.GeoTest.run(("geo:equals(<gml:LinearRing><gml:coordinates>1,1 2,1 5,3 1,1" + ((("</gml:coordinates></gml:LinearRing>, " + "<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing>") + "<gml:coordinates>1,1 2,1 5,3 1,1</gml:coordinates></gml:LinearRing>") + "</gml:outerBoundaryIs></gml... | public void equals() {
org.expath.ns.GeoTest.run(("geo:equals(<gml:LinearRing><gml:coordinates>1,1 2,1 5,3 1,1" + ((("</gml:coordinates></gml:LinearRing>, " + "<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing>") + "<gml:coordinates>1,1 2,1 5,3 1,1</gml:coordinates></gml:LinearRing>") + "</gml:outerBoundaryIs></gml... |
private void warnOrError(java.lang.String message, java.lang.Exception e) {
if (e == null) {
org.apache.nifi.processors.kafka.pubsub.KafkaPublisher.logger.warn(message);
if ((this.processLog) != null) {
this.processLog.warn(message);
}
}else {
org.apache.nifi.processo... | private void warnOrError(java.lang.String message, java.lang.Exception e) {
if (e == null) {
if ((this.processLog) != null) {
this.processLog.warn(message);
}
}else {
if ((this.processLog) != null) {
this.processLog.error(message, e);
}
}
} |
private com.bio.pojo.Cell populateCell(int diagScore, int horScore, int verScore) {
int maxScore = 0;
com.bio.pojo.Direction dir = null;
if (maxScore < diagScore) {
maxScore = diagScore;
dir = com.bio.pojo.Direction.DIAGONAL;
}
if (maxScore < verScore) {
maxScore = verScore;
... | private com.bio.pojo.Cell populateCell(int diagScore, int horScore, int verScore) {
int maxScore = 0;
com.bio.pojo.Direction dir = null;
if (maxScore <= diagScore) {
maxScore = diagScore;
dir = com.bio.pojo.Direction.DIAGONAL;
}
if (maxScore <= verScore) {
maxScore = verScore... |
public void dispatchDraw(@org.jetbrains.annotations.NotNull
android.graphics.Canvas canvas) {
if (pullEnabled) {
canvas.save();
canvas.translate(0, ((pullProgress) - (pullView.getMeasuredHeight())));
super.dispatchDraw(canvas);
canvas.restore();
}else {
super.dispatchDraw... | public void dispatchDraw(@org.jetbrains.annotations.NotNull
android.graphics.Canvas canvas) {
if ((pullView) != null) {
canvas.save();
canvas.translate(0, ((pullProgress) - (pullView.getMeasuredHeight())));
super.dispatchDraw(canvas);
canvas.restore();
}else {
super.dispa... |
public void run() {
mRequest = null;
final org.quantumbadger.redreader.activities.LinearLayout layout = new org.quantumbadger.redreader.activities.LinearLayout(context);
final org.quantumbadger.redreader.views.liststatus.ErrorView errorView = new org.quantumbadger.redreader.views.liststatus.ErrorView(this, ... | public void run() {
mRequest = null;
final android.widget.LinearLayout layout = new android.widget.LinearLayout(context);
final org.quantumbadger.redreader.views.liststatus.ErrorView errorView = new org.quantumbadger.redreader.views.liststatus.ErrorView(this, error);
layout.addView(errorView);
error... |
private void checkLocationOn() {
android.location.LocationManager locationManager = ((android.location.LocationManager) (getSystemService(Context.LOCATION_SERVICE)));
if ((!(locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER))) && (!(locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER... | private boolean checkLocationOn() {
android.location.LocationManager locationManager = ((android.location.LocationManager) (getSystemService(Context.LOCATION_SERVICE)));
if ((!(locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER))) && (!(locationManager.isProviderEnabled(LocationManager.NETWORK_PROVI... |
protected void onReceiveResult(int resultCode, android.os.Bundle resultData) {
final java.lang.String message = resultData.getString(Constants.RESULT_DATA_KEY);
if (resultCode == (me.dcii.flowmap.util.Constants.SUCCESS_RESULT)) {
mCurrentLocation = resultData.getParcelable(Constants.LOCATION_DATA_EXTRA)... | protected void onReceiveResult(int resultCode, android.os.Bundle resultData) {
if (resultCode == (me.dcii.flowmap.util.Constants.SUCCESS_RESULT)) {
mCurrentLocation = resultData.getParcelable(Constants.LOCATION_DATA_EXTRA);
if ((mCurrentLocation) != null) {
updateLocation();
}
... |
private void SQLModifizieren(java.lang.String sql) {
try {
java.sql.Statement query = mconCon.createStatement();
query.executeUpdate(sql);
} catch (java.sql.SQLException ex) {
javax.swing.JOptionPane.showMessageDialog(null, ex.getMessage(), "Fail", javax.swing.JOptionPane.OK_CANCEL_OPTIO... | private void SQLModifizieren(java.lang.String sql) {
try {
java.lang.System.out.println(sql);
java.sql.Statement query = mconCon.createStatement();
query.executeUpdate(sql);
} catch (java.sql.SQLException ex) {
javax.swing.JOptionPane.showMessageDialog(null, ex.getMessage(), "Fai... |
public void refreshPlayers() {
for (int k = 0; k < (players.size()); k++) {
Player person = players.get(k);
for (Unit unit : person.getUnitList()) {
unit.refreshAction();
}
}
} | public void refreshPlayers() {
for (int k = 0; k < (players.size()); k++) {
Player person = players.get(k);
if (person != null) {
for (Unit unit : person.getUnitList()) {
unit.refreshAction();
}
}
}
} |
public void onData(com.corundumstudio.socketio.SocketIOClient client, java.lang.String data, com.corundumstudio.socketio.AckRequest ackRequest) {
if (data.equals("restart")) {
java.lang.System.out.println("Restarting game\n");
}else
if (data.equals("menu")) {
java.lang.System.out.pri... | public void onData(com.corundumstudio.socketio.SocketIOClient client, java.lang.String data, com.corundumstudio.socketio.AckRequest ackRequest) {
if (data.equals("restart")) {
java.lang.System.out.println("Restarting game\n");
}else
if (data.equals("menu")) {
java.lang.System.out.pri... |
private javax.swing.JLabel createLabel(java.beans.PropertyDescriptor desc) {
java.lang.String text = desc.getDisplayName();
if (!("".equals(text))) {
text = propertyFieldLabelMessage.format(new java.lang.Object[]{ desc.getDisplayName() });
}
javax.swing.JLabel label = new javax.swing.JLabel(text... | private javax.swing.JLabel createLabel(java.beans.PropertyDescriptor desc) {
java.lang.String text = desc.getDisplayName();
if (!("".equals(text))) {
text = propertyFieldLabelMessage.format(new java.lang.Object[]{ desc.getDisplayName() });
}
javax.swing.JLabel label = new javax.swing.JLabel(text... |
public java.util.List<de.btu.openinfra.backend.db.pojos.TopicGeomzPojo> read(de.btu.openinfra.backend.db.rbac.OpenInfraHttpMethod httpMethod, javax.ws.rs.core.UriInfo uriInfo, java.util.Locale locale, java.util.UUID topicCharacteristicId, int offset, int size) {
new de.btu.openinfra.backend.db.rbac.TopicInstanceRba... | public java.util.List<de.btu.openinfra.backend.db.pojos.TopicGeomzPojo> read(de.btu.openinfra.backend.db.rbac.OpenInfraHttpMethod httpMethod, javax.ws.rs.core.UriInfo uriInfo, java.util.Locale locale, java.util.UUID topicCharacteristicId, int offset, int size) {
new de.btu.openinfra.backend.db.rbac.TopicInstanceRba... |
public void testOutOfHoursPartDay() {
double charge = bcccp.carpark.ChargeCalculator.calcDayCharge(java.time.LocalTime.of(1, 10, 27), java.time.LocalTime.of(19, 15, 17), java.time.DayOfWeek.SATURDAY);
double minutesExpected = (18 * 60) + 5;
assertEquals((minutesExpected * 2), charge, test.bcccp.carpark.Char... | public void testOutOfHoursPartDay() {
double charge = bcccp.carpark.ChargeCalculator.calcDayCharge(java.time.LocalTime.of(1, 10, 27), java.time.LocalTime.of(19, 15, 17), java.time.DayOfWeek.SATURDAY);
double minutesExpected = (18 * 60) + 5;
assertEquals(((minutesExpected * 2) / 60), charge, test.bcccp.carpa... |
public int getImpact3(int level) {
if ((((this.impact3) == null) || (level < 0)) || (level >= (this.impact3.length))) {
return 0;
}
return this.impact3[level];
} | public int getImpact3(int level) {
if (((this.impact3) == null) || (level < 0)) {
return 0;
}
if (level >= (this.impact3.length)) {
return this.impact3[this.impact3.length];
}
return this.impact3[level];
} |
private void addBalls(int numberOfBallsAdded) {
for (int i = 0; i < numberOfBallsAdded; i++) {
int randX = ((int) ((java.lang.Math.random()) * 800));
int randSpeedX = ((int) ((java.lang.Math.random()) * 20));
com.jamesku.sample.Ball newBall = new com.jamesku.sample.Ball(randX, 0, 35, android... | private void addBalls(int numberOfBallsAdded) {
for (int i = 0; i < numberOfBallsAdded; i++) {
int randX = ((int) ((java.lang.Math.random()) * 800));
int randSpeedX = ((int) ((java.lang.Math.random()) * 20));
com.jamesku.sample.Ball newBall = new com.jamesku.sample.Ball(randX, 0, 35, android... |
public void onCreate(@android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.step_activity);
android.content.Intent intentThatStartedThisActivity = getIntent();
if (intentThatStartedThisActivity != null) {
if (inten... | protected void onCreate(@android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.step_activity);
android.content.Intent intentThatStartedThisActivity = getIntent();
if (intentThatStartedThisActivity != null) {
if (in... |
public void updateHighlight(android.view.View view) {
initHighlight();
highlightView.put(view, true);
for (int i = 0; i < (highlightView.size()); i++) {
if (highlightView.get(viewList.get(i))) {
viewList.get(i).setBackgroundResource(android.R.color.holo_blue_light);
}else {
... | public void updateHighlight() {
for (int i = 0; i < (highlightView.size()); i++) {
if (highlightView.get(viewList.get(i))) {
viewList.get(i).setBackgroundResource(android.R.color.holo_blue_light);
}else {
viewList.get(i).setBackgroundResource(android.R.color.transparent);
... |
public int compare(com.model.TrainingCommentPostingModel tFirst, com.model.TrainingCommentPostingModel tSecond) {
if ((tFirst.getDate()) > (tSecond.getDate()))
return 1;
else
if ((tFirst.getDate()) < (tSecond.getDate()))
return -1;
else
return 0;
} | public int compare(com.model.TrainingCommentPostingModel tFirst, com.model.TrainingCommentPostingModel tSecond) {
if ((tFirst.getDate()) > (tSecond.getDate()))
return -1;
else
if ((tFirst.getDate()) < (tSecond.getDate()))
return 1;
else
return 0;
} |
public static java.lang.Object execute(java.lang.String methodName, java.lang.String parameter, main.java.HashTable instance) throws test.java.HashTableTests.HashTableUtilException {
try {
java.lang.reflect.Method method = test.java.HashTableTests.HashTableTestUtilities.getReflectedMethod(methodName, instan... | public static java.lang.Object execute(java.lang.String methodName, java.lang.String parameter, main.java.HashTable instance) throws test.java.HashTableTests.HashTableUtilException {
try {
java.lang.reflect.Method method = test.java.HashTableTests.HashTableTestUtilities.getReflectedMethod(methodName, instan... |
public void deleteFavorite(android.database.Cursor cursor) {
int id = cursor.getInt(0);
java.lang.String stringId = java.lang.Integer.toString(id);
android.net.Uri uri = MovieContract.FavoriteEntry.CONTENT_URI;
uri = uri.buildUpon().appendPath(stringId).build();
getContentResolver().delete(uri, null... | public void deleteFavorite(android.database.Cursor cursor) {
int id = cursor.getInt(0);
java.lang.String stringId = java.lang.Integer.toString(id);
android.net.Uri uri = MovieContract.FavoriteEntry.CONTENT_URI;
uri = uri.buildUpon().appendPath(stringId).build();
getContentResolver().delete(uri, null... |
public static void main(java.lang.String[] args) {
java.lang.String pattern = "^a$";
regexcompiler.MyPattern.Tokeniser t = new regexcompiler.MyPattern.Tokeniser(pattern);
java.util.List<regexcompiler.RegexToken> tokenList = t.tokenise();
regexcompiler.MyPattern.Parser p = new regexcompiler.MyPattern.Par... | public static void main(java.lang.String[] args) {
java.lang.String pattern = "^a$";
regexcompiler.MyPattern.Tokeniser t = new regexcompiler.MyPattern.Tokeniser(pattern);
java.util.List<regexcompiler.RegexToken> tokenList = t.tokenise();
regexcompiler.MyPattern.Parser p = new regexcompiler.MyPattern.Par... |
public static void test_045() {
framework.common.GalleryCommon.deleteMoreGallery();
framework.common.GalleryCommon.clickGallery();
check(testcase.Object_ResourceId, testcase.Operation_WaitForExists, "android:id/image", "20000");
excute(testcase.Object_ResourceId, testcase.Operation_ClickWait, "android:i... | public static void test_045() {
framework.common.GalleryCommon.deleteMoreGallery();
framework.common.GalleryCommon.clickGallery();
excute(testcase.Object_ResourceId, testcase.Operation_WaitForExists, "android:id/image", "20000");
excute(testcase.Object_ResourceId, testcase.Operation_ClickWait, "android:... |
public boolean handleMessage(android.os.Message msg) {
switch (msg.what) {
case br.com.carlosrafaelgn.fplay.ActivitySettings.MSG_REFRESH_BLUETOOTH :
refreshBluetoothStatus(true);
break;
case br.com.carlosrafaelgn.fplay.ActivitySettings.MSG_SAVE_CONFIG :
if ((br.co... | public boolean handleMessage(android.os.Message msg) {
switch (msg.what) {
case br.com.carlosrafaelgn.fplay.ActivitySettings.MSG_REFRESH_BLUETOOTH :
refreshBluetoothStatus(true, false);
break;
case br.com.carlosrafaelgn.fplay.ActivitySettings.MSG_SAVE_CONFIG :
if ... |
public void activate(nl.tudelft.model.Player player) {
if (!(isActive())) {
setActive(true);
this.player = player;
if (player.hasPowerup(Powerup.SHOPSHIELD)) {
return ;
}
if (player.hasPowerup(Powerup.SHIELD)) {
player.removePowerup(Powerup.SHIELD).toR... | public void activate(nl.tudelft.model.Player player) {
if (!(isActive())) {
setActive(true);
this.player = player;
if (player.hasPowerup(Powerup.SHOPSHIELD)) {
toRemove();
return ;
}
if (player.hasPowerup(Powerup.SHIELD)) {
player.removePow... |
public void handleResult(com.google.zxing.Result result) {
java.lang.String resultCode = result.getText();
android.widget.Toast.makeText(this, ("ScanQRActivity:" + resultCode), Toast.LENGTH_SHORT).show();
scannerView.stopCamera();
android.content.Intent intent = new android.content.Intent(this, com.cash... | public void handleResult(com.google.zxing.Result result) {
java.lang.String resultCode = result.getText();
android.widget.Toast.makeText(this, ("ScanQRActivity:" + resultCode), Toast.LENGTH_SHORT).show();
scannerView.stopCamera();
android.content.Intent intent = new android.content.Intent(this, com.cash... |
public void onResume() {
super.onResume();
new jp.hazuki.yuzubrowser.settings.activity.ImportExportFragment.PermissionDialog().show(getChildFragmentManager(), "permission");
if (!(jp.hazuki.yuzubrowser.utils.PermissionUtils.checkWriteStorage(getActivity()))) {
if (android.support.v4.app.ActivityComp... | public void onResume() {
super.onResume();
if (!(jp.hazuki.yuzubrowser.utils.PermissionUtils.checkWriteStorage(getActivity()))) {
if (android.support.v4.app.ActivityCompat.shouldShowRequestPermissionRationale(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
new jp.hazuki.yuzubro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.