buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public void warpHorizontally(nl.tudelft.scrumbledore.LevelElement element) {
double offset = (element.width()) / 2;
if ((element.posX()) < (-offset)) {
element.getPosition().setX(((Constants.LEVELX) + offset));
}else
if ((element.posX()) > ((Constants.LEVELX) + offset)) {
element... | public void warpHorizontally(nl.tudelft.scrumbledore.LevelElement element) {
double offset = 0;
if ((element.posX()) <= (-offset)) {
element.getPosition().setX(((Constants.LEVELX) - 1));
}else
if ((element.posX()) >= ((Constants.LEVELX) + offset)) {
element.getPosition().setX(1);... |
private java.lang.String Post(java.lang.String content) throws java.io.IOException {
org.apache.http.impl.client.CloseableHttpClient httpclient = org.apache.http.impl.client.HttpClients.createDefault();
org.apache.http.client.methods.HttpUriRequest login = org.apache.http.client.methods.RequestBuilder.post().se... | private java.lang.String Post(java.lang.String content) throws java.io.IOException {
org.apache.http.impl.client.CloseableHttpClient httpclient = org.apache.http.impl.client.HttpClients.createDefault();
org.apache.http.client.methods.HttpUriRequest login = org.apache.http.client.methods.RequestBuilder.post().se... |
public BitSequence allButFirstNBits(int N) {
if (N > (numBits)) {
throw new java.lang.IllegalArgumentException((((("Requested allButFirstNBits, where N is equal to " + N) + ", but have ") + (numBits)) + "."));
}
BitSequence allButFirstN = new BitSequence();
allButFirstN.bits = this.bits;
all... | public BitSequence allButFirstNBits(int N) {
if (N > (numBits)) {
throw new java.lang.IllegalArgumentException((((("Requested allButFirstNBits, where N is equal to " + N) + ", but have ") + (numBits)) + "."));
}
BitSequence allButFirstN = new BitSequence();
allButFirstN.bits = this.bits;
all... |
public void onAutoFocus(boolean success, android.hardware.Camera camera) {
try {
if (!(mbTakePictureAfterFocus)) {
mCamera.autoFocus(null);
return ;
}
mbTakePictureAfterFocus = false;
if (mbSupportJpeg)
mCamera.takePicture(camShutterCallback, null,... | public void onAutoFocus(boolean success, android.hardware.Camera camera) {
try {
if (!(mbTakePictureAfterFocus)) {
mCamera.autoFocus(null);
return ;
}
mbTakePictureAfterFocus = false;
if (mbSupportJpeg)
mCamera.takePicture(camShutterCallback, null,... |
private float generateHorizontalPivot() {
switch (getViewPosition()) {
case Transformer.LEFT :
return getMarginLeft();
case Transformer.CENTER :
return (getView().getWidth()) / 2;
case Transformer.RIGHT :
return (getView().getWidth()) - (getMarginRight());... | private float generateHorizontalPivot() {
switch (getViewPosition()) {
case Transformer.LEFT :
return getMarginLeft();
case Transformer.CENTER :
return (getView().getWidth()) / 2;
case Transformer.RIGHT :
default :
return (getView().getWidth()) - (... |
private void mineResource(Game.Resource resource) {
if (((resource.getAmount()) - (mineAmount)) > 0) {
resource.setAmount(((resource.getAmount()) - (mineAmount)));
amountResource = (amountResource) + (mineAmount);
}else
if ((resource.getAmount()) > 0) {
amountResource = (amou... | private void mineResource(Game.Resource resource) {
if (((resource.getAmount()) - (mineAmount)) > 0) {
resource.setAmount(((resource.getAmount()) - (mineAmount)));
amountResource = (amountResource) + (mineAmount);
}else
if ((resource.getAmount()) > 0) {
amountResource = (amou... |
public java.lang.Boolean checkForm() {
java.lang.Boolean goodEmail;
java.lang.Boolean goodPassword;
java.lang.Boolean completeForm;
goodEmail = checkMatchGeneric(R.id.email, R.id.email2, R.id.tv_email, R.id.tv_email2);
goodPassword = checkMatchGeneric(R.id.password, R.id.password2, R.id.tv_password,... | public java.lang.Boolean checkForm() {
java.lang.Boolean goodEmail;
java.lang.Boolean goodPassword;
java.lang.Boolean completeForm;
completeForm = checkEmptyFields();
goodEmail = checkMatchGeneric(R.id.email, R.id.email2, R.id.tv_email, R.id.tv_email2);
goodPassword = checkMatchGeneric(R.id.pass... |
public void updateUI() {
super.updateUI();
javax.swing.UIManager.put("ComboBox.squareButton", java.lang.Boolean.FALSE);
setUI(new javax.swing.plaf.basic.BasicComboBoxUI() {
@java.lang.Override
protected javax.swing.JButton createArrowButton() {
javax.swing.JButton b = new javax.s... | public void updateUI() {
super.updateUI();
javax.swing.UIManager.put("ComboBox.squareButton", java.lang.Boolean.FALSE);
setUI(new javax.swing.plaf.basic.BasicComboBoxUI() {
@java.lang.Override
protected javax.swing.JButton createArrowButton() {
javax.swing.JButton b = super.creat... |
protected void onCreate(@android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_inside_library);
butterknife.ButterKnife.bind(this);
intentFlag = getIntent();
inLibrary = intentFlag.getExtras().getBoolean("IN_L... | protected void onCreate(@android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_inside_library);
butterknife.ButterKnife.bind(this);
intentFlag = getIntent().getExtras();
if ((intentFlag) != null) {
inL... |
public boolean offer(java.lang.Integer integer) {
if ((last) == null) {
last = new ch1.point3.QueueViaCircularLL.Node(integer);
last.next = last;
}else {
ch1.point3.QueueViaCircularLL.Node first = last.next;
last.next = new ch1.point3.QueueViaCircularLL.Node(integer);
las... | public boolean offer(java.lang.Integer integer) {
(size)++;
if ((last) == null) {
last = new ch1.point3.QueueViaCircularLL.Node(integer);
last.next = last;
}else {
ch1.point3.QueueViaCircularLL.Node first = last.next;
last.next = new ch1.point3.QueueViaCircularLL.Node(integer... |
private void showCorrectImage(int correctButton) {
isOnTouchKeyOn = false;
imgExOneQuestion.startAnimation(animScaleOut);
if (correctButton == (ua.com.spasetv.testintuitions.FragExerciseOne.MOON_BUTTON)) {
imgExOneQuestion.setImageResource(R.drawable.ic_brightness_2_black_48dp);
}else
if... | private void showCorrectImage(int correctButton) {
isOnTouchKeyOn = false;
imgExOneQuestion.startAnimation(animScaleOut);
if (correctButton == (ua.com.spasetv.testintuitions.FragExerciseOne.MOON_BUTTON)) {
imgExOneQuestion.setImageResource(R.drawable.ic_brightness_2_black_48dp);
}else
if... |
public void setupTerrain(net.minecraft.entity.Entity viewEntity, double ticks, net.minecraft.client.renderer.culling.ICamera camera, int frameCount, boolean spectator) {
if (((me.dags.daflight.DaFlight.get().DFController.noClipOn) && (me.dags.daflight.DaFlight.get().DFController.flyModOn)) && (me.dags.daflight.DaFl... | public void setupTerrain(net.minecraft.entity.Entity viewEntity, double ticks, net.minecraft.client.renderer.culling.ICamera camera, int frameCount, boolean spectator) {
if (me.dags.daflight.DaFlight.get().DFController.noClipOn) {
spectator = true;
}
super.setupTerrain(viewEntity, ticks, camera, fra... |
public static final void remove(final java.lang.String topic) {
boolean result = org.eclipse.moquette.spi.impl.thinkjoy.TopicRouterRepository.redisRepository.sIsMember(topic, org.eclipse.moquette.spi.impl.thinkjoy.TopicRouterRepository.NODE_ID);
if (!result) {
org.eclipse.moquette.spi.impl.thinkjoy.Topi... | public static final void remove(final java.lang.String topic) {
boolean result = org.eclipse.moquette.spi.impl.thinkjoy.TopicRouterRepository.redisRepository.sIsMember(topic, org.eclipse.moquette.spi.impl.thinkjoy.TopicRouterRepository.NODE_ID);
if (!result) {
org.eclipse.moquette.spi.impl.thinkjoy.Topi... |
public android.graphics.drawable.Drawable getDrawableForDensity(int resId, int density) throws carbon.NotFoundException {
if (getResourceTypeName(resId).equals("raw")) {
return new carbon.drawable.VectorDrawable(this, resId);
}else {
return super.getDrawableForDensity(resId, density);
}
} | public android.graphics.drawable.Drawable getDrawableForDensity(int resId, int density) throws carbon.NotFoundException {
if ((resId != 0) && (getResourceTypeName(resId).equals("raw"))) {
return new carbon.drawable.VectorDrawable(this, resId);
}else {
return super.getDrawableForDensity(resId, de... |
private void setDefaultCopyFromVersion() {
java.util.List<org.zanata.action.VersionHome.VersionItem> otherVersions = getOtherVersions();
if ((!(otherVersions.isEmpty())) && (org.apache.commons.lang.StringUtils.isEmpty(copyFromVersionSlug))) {
this.copyFromVersionSlug = otherVersions.get(0).getVersion().... | private void setDefaultCopyFromVersion() {
java.util.List<org.zanata.action.VersionHome.VersionItem> otherVersions = getOtherVersions();
if ((!(otherVersions.isEmpty())) && (org.apache.commons.lang.StringUtils.isEmpty(copyFromVersionSlug))) {
this.copyFromVersionSlug = otherVersions.get(0).getVersion().... |
public net.minecraft.item.ItemStack decrStackSize(int slot, int amount) {
net.minecraft.item.ItemStack stack = getStackInSlot(slot);
if (stack != null) {
if ((stack.getCount()) > amount) {
stack = stack.splitStack(amount);
markDirty();
}else {
setInventorySlot... | public net.minecraft.item.ItemStack decrStackSize(int slot, int amount) {
net.minecraft.item.ItemStack stack = getStackInSlot(slot);
if (!(stack.isEmpty())) {
if ((stack.getCount()) > amount) {
stack = stack.splitStack(amount);
markDirty();
}else {
setInventor... |
private int[] getIndegree() {
if ((this.indegree) == null) {
indegree = new int[this.getVertexCount()];
for (java.util.LinkedList<java.lang.Integer> vertices : neighbours) {
for (int neighbour : vertices) {
(this.indegree[neighbour])++;
}
}
}
r... | public int[] getIndegree() {
if ((this.indegree) == null) {
indegree = new int[this.getVertexCount()];
for (java.util.LinkedList<java.lang.Integer> vertices : neighbours) {
for (int neighbour : vertices) {
(this.indegree[neighbour])++;
}
}
}
re... |
public void shouldFindBirthdays() {
eu.waldonia.ipl.domain.DOB dob = new eu.waldonia.ipl.domain.DOB(26, 11, 1987);
dobRepository.save(dob);
eu.waldonia.ipl.domain.DOB dbD = dobRepository.findOne(dob.id);
dbD = dobRepository.getBirthday(26, 11, 1987);
org.junit.Assert.assertNotNull(dbD);
org.juni... | public void shouldFindBirthdays() {
eu.waldonia.ipl.domain.DOB dob = new eu.waldonia.ipl.domain.DOB(26, 11, 1987);
dobRepository.save(dob);
eu.waldonia.ipl.domain.DOB dbD = dobRepository.findOne(dob.id);
dbD = dobRepository.getBirthday(26, 11, 1987);
assertNotNull(dbD);
assertEquals(dob, dbD);
... |
public void setConnectionTimeout(long connectionTimeoutInMilliseconds) {
if ((mConnectionTimeoutInMilliseconds) != connectionTimeoutInMilliseconds) {
android.util.Log.v(org.thaliproject.p2p.btconnectorlib.internal.bluetooth.BluetoothConnector.TAG, ((("setConnectionTimeout: " + (mConnectionTimeoutInMilliseco... | public void setConnectionTimeout(long connectionTimeoutInMilliseconds) {
if ((mConnectionTimeoutInMilliseconds) != connectionTimeoutInMilliseconds) {
android.util.Log.v(org.thaliproject.p2p.btconnectorlib.internal.bluetooth.BluetoothConnector.TAG, ((("setConnectionTimeout: " + (mConnectionTimeoutInMilliseco... |
public void writeObject(java.lang.String fileName, java.io.Serializable obj) {
java.io.File myFile = new java.io.File(context.getFilesDir(), fileName);
try {
if (myFile.createNewFile())
return ;
java.io.ObjectOutputStream oos = new java.io.ObjectOutputStream(new java.io.File... | public void writeObject(java.lang.String fileName, java.io.Serializable obj) {
java.io.File myFile = new java.io.File(context.getFilesDir(), fileName);
try {
myFile.createNewFile();
java.io.ObjectOutputStream oos = new java.io.ObjectOutputStream(new java.io.FileOutputStream(myFile));
oos... |
public void setStartNode(int node) throws java.lang.IllegalArgumentException {
if (((this.graph) == null) || ((this.graph.getLength()) <= node)) {
throw new java.lang.IllegalArgumentException("Dieser Punkt existiert nicht");
}
if ((this.startNode) != node) {
this.startNode = node;
st... | public void setStartNode(int node) throws java.lang.IllegalArgumentException {
if (((this.graph) == null) || ((this.graph.getLength()) <= node)) {
throw new java.lang.IllegalArgumentException("Dieser Punkt existiert nicht");
}
if ((this.startNode) != node) {
this.startNode = node;
th... |
public java.net.URI[] getJobs() {
java.util.List<java.net.URI> uris = new java.util.LinkedList<java.net.URI>();
javax.ws.rs.core.UriBuilder builder = uriInfo.getAbsolutePathBuilder().path("{jobidentifier}");
for (nl.esciencecenter.osmium.api.SandboxedJob job : xenonmanager.getJobs()) {
uris.add(buil... | public java.net.URI[] getJobs() {
java.util.List<java.net.URI> uris = new java.util.ArrayList(xenonmanager.getJobs().size());
javax.ws.rs.core.UriBuilder builder = uriInfo.getAbsolutePathBuilder().path("{jobidentifier}");
for (nl.esciencecenter.osmium.api.SandboxedJob job : xenonmanager.getJobs()) {
... |
protected void mapAndProcess(java.lang.Object eventObject, org.wso2.siddhi.core.stream.input.InputEventHandler inputEventHandler) throws java.lang.InterruptedException {
synchronized(this) {
java.lang.Object convertedEvent;
convertedEvent = convertToEvent(eventObject);
if (convertedEvent != ... | protected void mapAndProcess(java.lang.Object eventObject, org.wso2.siddhi.core.stream.input.InputEventHandler inputEventHandler) throws java.lang.InterruptedException {
java.lang.Object convertedEvent;
convertedEvent = convertToEvent(eventObject);
if (convertedEvent != null) {
if (convertedEvent in... |
private void createFile(java.lang.String fileName) {
java.io.File file = new java.io.File((((settingsPath) + (java.io.File.separator)) + fileName));
if ((file != null) && (!(file.exists()))) {
try {
file.createNewFile();
} catch (java.lang.Exception e) {
e.printStackTrace... | private void createFile(java.lang.String fileName) {
java.io.File file = new java.io.File((((settingsPath) + (java.io.File.separator)) + fileName));
if ((file != null) && (!(file.exists()))) {
try {
if (!(file.createNewFile())) {
throw new java.io.IOException();
}... |
public java.lang.String toString() {
Node currentNode = first;
java.lang.String buffer = "";
do {
buffer += (java.lang.String.valueOf(currentNode.getValue())) + " ";
currentNode = currentNode.getNext();
} while (currentNode != null );
return buffer;
} | public java.lang.String toString() {
Node currentNode = first;
java.lang.String buffer = "";
while (currentNode != null) {
buffer += (java.lang.String.valueOf(currentNode.getValue())) + " ";
currentNode = currentNode.getNext();
}
return buffer;
} |
public static javax.swing.JButton createJButton(java.lang.String label, int fontSize) {
javax.swing.JButton comp = new javax.swing.JButton(label);
com.tri.pgs.client.surface.ui.UISystem.init(comp, true);
comp.setFont(new java.awt.Font(java.awt.Font.SANS_SERIF, java.awt.Font.BOLD, fontSize));
comp.setMar... | public static javax.swing.JButton createJButton(java.lang.String label, int fontSize) {
javax.swing.JButton comp = new javax.swing.JButton(label);
com.tri.pgs.client.surface.ui.UISystem.init(comp, true, true);
comp.setFont(new java.awt.Font(java.awt.Font.SANS_SERIF, java.awt.Font.BOLD, fontSize));
comp.... |
public boolean init(java.lang.String botId, java.util.Map<java.lang.String, java.lang.String> botConfigs, java.lang.String[] channels) {
configs = botConfigs;
try {
bots.TelegramBot.telegramBotsApi.registerBot(this);
} catch (org.telegram.telegrambots.exceptions.TelegramApiRequestException e) {
... | public boolean init(java.lang.String botId, java.util.Map<java.lang.String, java.lang.String> botConfigs, java.lang.String[] channels) {
this.configs = botConfigs;
try {
bots.TelegramBot.telegramBotsApi.registerBot(this);
} catch (org.telegram.telegrambots.exceptions.TelegramApiRequestException e) {... |
public void TestStartBlackout() throws java.lang.Exception {
boolean callSuccessfull = true;
S71200URLCommunicator.Implementations.PneumanBlackoutCommunicator testComm = new S71200URLCommunicator.Implementations.PneumanBlackoutCommunicator();
testComm.configure(S71200URLCommunicatorTests.IntegrationTests.Pn... | public void TestStartBlackout() throws java.lang.Exception {
boolean callSuccessfull = true;
S71200URLCommunicator.Implementations.PneumanBlackoutCommunicator testComm = new S71200URLCommunicator.Implementations.PneumanBlackoutCommunicator();
testComm.configure(S71200URLCommunicatorTests.IntegrationTests.Pn... |
private void read(java.lang.String file_name) throws java.io.IOException {
int lineno = 0;
for (java.lang.String line : new joshua.decoder.ff.lm.LineReader(file_name, false)) {
lineno++;
java.lang.String[] lineComp = line.trim().split("\\s+");
try {
this.classMap.put(joshua.c... | private void read(java.lang.String file_name) throws java.io.IOException {
int lineno = 0;
for (java.lang.String line : new joshua.decoder.ff.lm.LineReader(file_name, false)) {
lineno++;
java.lang.String[] lineComp = line.trim().split("\\s+");
try {
this.classMap.put(joshua.c... |
public void givenServerApp_whenExecutingARequest_thenTheRequestShouldBeInterceptedBeforeCallingTheHandler() throws java.lang.Exception {
serverApp.registerHandler(com.progressoft.brix.domino.api.server.TestRequest.class.getCanonicalName(), new com.progressoft.brix.domino.api.server.TestRequestHandler());
server... | public void givenServerApp_whenExecutingARequest_thenTheRequestShouldBeInterceptedBeforeCallingTheHandler() throws java.lang.Exception {
serverApp.registerHandler(com.progressoft.brix.domino.api.server.TestRequest.class.getCanonicalName(), new com.progressoft.brix.domino.api.server.TestRequestHandler());
server... |
protected void onPostExecute(java.lang.Void aVoid) {
super.onPostExecute(aVoid);
com.cse280.adriansandoval.converit.Currency currency = new com.cse280.adriansandoval.converit.Currency();
currency.eurToUsd = java.lang.Double.parseDouble(eurToUSD);
currency.gbpToUsd = java.lang.Double.parseDouble(gbpToUSD... | protected void onPostExecute(java.lang.Void aVoid) {
super.onPostExecute(aVoid);
currency.eurToUsd = java.lang.Double.parseDouble(eurToUSD);
currency.gbpToUsd = java.lang.Double.parseDouble(gbpToUSD);
currency.eurToGbp = java.lang.Double.parseDouble(eurToGBP);
currency.eurToJpy = java.lang.Double.pa... |
public static java.lang.Boolean isEnchantmentEnabled(java.lang.String ench) {
for (java.lang.String en : me.BadBones69.CrazyEnchantments.ECControl.allEnchantments().keySet()) {
if (me.BadBones69.CrazyEnchantments.Api.getEnchName(en).equalsIgnoreCase(ench)) {
if (Main.settings.getEnchs().getBoole... | public static java.lang.Boolean isEnchantmentEnabled(java.lang.String ench) {
for (java.lang.String en : me.BadBones69.CrazyEnchantments.ECControl.allEnchantments().keySet()) {
if (en.equalsIgnoreCase(ench)) {
if (Main.settings.getEnchs().getBoolean((("Enchantments." + en) + ".Enabled"))) {
... |
private static synchronized java.sql.PreparedStatement buildQuery(java.lang.String sql, java.lang.Object... args) {
com.planb.support.utilities.Log.Q(sql);
java.sql.PreparedStatement statement = null;
try {
statement = com.planb.support.chatting.MySQL_Chat.connection.prepareStatement(sql);
i... | private static synchronized java.sql.PreparedStatement buildQuery(java.lang.String sql, java.lang.Object... args) {
com.planb.support.utilities.Log.query(sql);
java.sql.PreparedStatement statement = null;
try {
statement = com.planb.support.chatting.MySQL_Chat.connection.prepareStatement(sql);
... |
private void initLeft(com.badlogic.gdx.utils.viewport.Viewport viewport, com.badlogic.gdx.physics.box2d.World world) {
com.badlogic.gdx.physics.box2d.BodyDef bodyDefinition = new com.badlogic.gdx.physics.box2d.BodyDef();
bodyDefinition.position.set(0, 0);
com.badlogic.gdx.physics.box2d.Body b2body = world.c... | private void initLeft(com.badlogic.gdx.utils.viewport.Viewport viewport, com.badlogic.gdx.physics.box2d.World world) {
com.badlogic.gdx.physics.box2d.BodyDef bodyDefinition = new com.badlogic.gdx.physics.box2d.BodyDef();
bodyDefinition.position.set(0, 0);
com.badlogic.gdx.physics.box2d.Body b2body = world.c... |
public java.lang.String activate(com.minespaceships.mod.overhead.IMenuInterface terminal, java.lang.String data) {
com.minespaceships.mod.spaceship.Spaceship ship = com.minespaceships.mod.menu.functionalMenus.energyMenus.TerminalUtil.getShip(terminal);
if (ship != null) {
ship.setTarget(ship.getOrigin()... | public java.lang.String activate(com.minespaceships.mod.overhead.IMenuInterface terminal, java.lang.String data) {
com.minespaceships.mod.spaceship.Spaceship ship = com.minespaceships.mod.menu.functionalMenus.energyMenus.TerminalUtil.getShip(terminal);
if (ship != null) {
ship.setTarget(ship.getOrigin()... |
public boolean onPrepareOptionsMenu(android.view.Menu menu) {
if ((menuResId) != 0) {
menu.findItem(R.id.menu_1).setIcon(menuResId);
}else {
if (!(android.text.TextUtils.isEmpty(menuStr))) {
menu.findItem(R.id.menu_1).setTitle(menuStr);
}
}
return super.onPrepareOptio... | public boolean onPrepareOptionsMenu(android.view.Menu menu) {
if ((menuResId) != 0) {
menu.findItem(R.id.menu_1).setIcon(menuResId);
}
if (!(android.text.TextUtils.isEmpty(menuStr))) {
menu.findItem(R.id.menu_1).setTitle(menuStr);
}
return super.onPrepareOptionsMenu(menu);
} |
private void updateShuffleButton() {
boolean shuffle = org.oucho.musicplayer.PlayerService.isShuffleEnabled();
android.util.Log.d("shuffle", ("shuffle " + (java.lang.String.valueOf(shuffle))));
android.widget.ImageView shuffleButton = ((android.widget.ImageView) (findViewById(R.id.shuffle)));
if (shuffl... | private void updateShuffleButton() {
boolean shuffle = org.oucho.musicplayer.PlayerService.isShuffleEnabled();
android.widget.ImageView shuffleButton = ((android.widget.ImageView) (findViewById(R.id.shuffle)));
if (shuffle) {
assert shuffleButton != null;
shuffleButton.setImageResource(R.dra... |
public void showDetails(android.net.wifi.p2p.WifiP2pDevice device) {
android.util.Log.d("details", "details-frag-details");
this.device = device;
this.getView().setVisibility(View.VISIBLE);
android.widget.TextView view = ((android.widget.TextView) (mContentView.findViewById(R.id.device_address)));
v... | public void showDetails(android.net.wifi.p2p.WifiP2pDevice device) {
this.device = device;
this.getView().setVisibility(View.VISIBLE);
android.widget.TextView view = ((android.widget.TextView) (mContentView.findViewById(R.id.device_address)));
view.setText(("Device address: " + (device.deviceAddress)));... |
public void addFolder(java.lang.String name, int parent, java.lang.String description) {
edu.j2ee.das.entity.Items p = getItemByID(java.math.BigDecimal.valueOf(parent));
edu.j2ee.das.entity.Authors a = getAuthorByID(java.math.BigDecimal.ZERO);
edu.j2ee.das.entity.Items f = new edu.j2ee.das.entity.Items(name... | public void addFolder(java.lang.String name, int parent, java.lang.String description) {
edu.j2ee.das.entity.Items p = null;
if (parent > 0) {
p = getItemByID(java.math.BigDecimal.valueOf(parent));
}
edu.j2ee.das.entity.Authors a = getAuthorByID(java.math.BigDecimal.ZERO);
edu.j2ee.das.entit... |
public void handle_option_request(java.io.BufferedReader in, java.lang.String line) throws java.io.IOException {
java.io.BufferedWriter out = new java.io.BufferedWriter(new java.io.OutputStreamWriter(socket.getOutputStream()));
out.write("HTTP/1.1 200 OK\r\n");
out.write("Content-Type: text/html\r\n");
... | public void handle_option_request(java.io.BufferedReader in, java.lang.String line) throws java.io.IOException {
java.io.BufferedWriter out = new java.io.BufferedWriter(new java.io.OutputStreamWriter(socket.getOutputStream()));
out.write("HTTP/1.1 200 OK\r\n");
out.write("Content-Type: text/html\r\n");
... |
public boolean equals(final java.lang.Object o) {
if ((this) == o)
return true;
if ((o == null) || ((getClass()) != (o.getClass())))
return false;
final lab.dynafig.Default.Value that = ((lab.dynafig.Default.Value) (o));
return java.util.Objects.equals(value, that.value);
} | public boolean equals(final java.lang.Object o) {
if ((this) == o)
return true;
if ((null == o) || ((getClass()) != (o.getClass())))
return false;
final lab.dynafig.Default.Value that = ((lab.dynafig.Default.Value) (o));
return java.util.Objects.equals(value, that.value);
} |
private void initView(final android.view.View view) {
final android.widget.Button btnCreatedLeague = ((android.widget.Button) (view.findViewById(R.id.fragment_my_league_btn_created)));
final android.widget.Button btnJoinedLeague = ((android.widget.Button) (view.findViewById(R.id.fragment_my_league_btn_joined)))... | private void initView(final android.view.View view) {
btnCreatedLeague = ((android.widget.Button) (view.findViewById(R.id.fragment_my_league_btn_created)));
btnJoinedLeague = ((android.widget.Button) (view.findViewById(R.id.fragment_my_league_btn_joined)));
btnCreatedLeague.setOnClickListener(this);
btn... |
public static <T> T resolve(java.lang.Class<T> type) {
T result = null;
if (com.mikeliu.common.IoC._objects.containsKey(type)) {
result = ((T) (com.mikeliu.common.IoC._objects.get(type)));
}else {
try {
result = type.newInstance();
com.mikeliu.common.IoC._objects.put(... | public static <T> T resolve(java.lang.Class<T> type) {
T result = null;
if (com.mikeliu.common.IoC._objects.containsKey(type)) {
result = ((T) (com.mikeliu.common.IoC._objects.get(type)));
}else {
try {
result = type.newInstance();
com.mikeliu.common.IoC._objects.put(... |
protected void addProduct(java.lang.String молоко, long checked) {
com.e16din.shoppinglist.model.Product item = new com.e16din.shoppinglist.model.Product(молоко, org.joda.time.DateTime.now().getMillis());
item.setOwnerId(mShoppingList.getId());
if (checked != 0) {
item.setChecked(checked);
}
... | protected void addProduct(java.lang.String name, long checked) {
com.e16din.shoppinglist.model.Product item = new com.e16din.shoppinglist.model.Product(name, org.joda.time.DateTime.now().getMillis());
item.setOwnerId(mShoppingList.getId());
if (checked != 0) {
item.setChecked(checked);
}
mAd... |
public void onClick(android.view.View v) {
switch (v.getId()) {
case R.id.button :
myTimer.start(textView);
break;
case R.id.button2 :
myTimer.pause();
break;
case R.id.button3 :
myTimer.stop(textView);
break;
}
} | public void onClick(android.view.View v) {
switch (v.getId()) {
case R.id.button :
myTimer.start();
break;
case R.id.button2 :
myTimer.pause();
break;
case R.id.button3 :
myTimer.stop();
break;
}
} |
private boolean equal(java.lang.Object[] a, java.lang.Object[] b) {
if ((a.length) != (b.length))
return false;
java.util.List lA = scala.actors.threadpool.Arrays.asList(a);
java.util.List lB = scala.actors.threadpool.Arrays.asList(b);
return lA.containsAll(lB);
} | private boolean equal(java.lang.Object[] a, java.lang.Object[] b) {
if ((a.length) != (b.length))
return false;
java.util.List lA = java.util.Arrays.asList(a);
java.util.List lB = java.util.Arrays.asList(b);
return lA.containsAll(lB);
} |
private void terminateConnection(int id) throws java.io.IOException {
chatroom.ClientHandler client = clients.get(id);
client.sendDisconnectRequest(new chatroom.Disconnect(((getMyIP()) + "has disconnected")));
clients.get(id).closeConnection();
} | private void terminateConnection(int id) throws java.io.IOException {
chatroom.ClientHandler client = clients.get(id);
client.sendDisconnectRequest(new chatroom.Disconnect(((getMyIP()) + "has disconnected")));
clients.get(id).closeConnection();
clients.remove(client);
} |
private void attemptToAddProduct(java.lang.String message) {
try {
currentSlot = productController.getSlot(message);
boolean added = addProductToOrder(currentSlot);
if (added && ((currentState) != (vendingmachine.VendingMachine.MachineState.CUSTOMER))) {
setCurrentState(vendingma... | private void attemptToAddProduct(java.lang.String message) {
try {
currentSlot = productController.getSlot(message);
boolean added = addProductToOrder(currentSlot);
if (added && ((currentState) != (vendingmachine.VendingMachine.MachineState.CUSTOMER)))
setCurrentState(vendingmach... |
public static long fib(int n) {
if (n <= 1) {
(Fibonacci.count)++;
return n;
}else {
(Fibonacci.count)++;
return (Fibonacci.fib((n - 1))) + (Fibonacci.fib((n - 2)));
}
} | public static long fib(int n) {
(Fibonacci.count)++;
if (n <= 1) {
return n;
}else {
return (Fibonacci.fib((n - 1))) + (Fibonacci.fib((n - 2)));
}
} |
public java.lang.Integer getStatValue(java.lang.String Name) {
java.lang.Integer value = 0;
for (com.hazyfutures.spritestable.Stats stat : pvStats) {
if (stat.getStatName().equals(Name)) {
value = stat.getStatValue();
break;
}
}
return value;
} | public java.lang.Integer getStatValue(java.lang.String Name) {
java.lang.Integer value = 0;
for (com.hazyfutures.spritestable.Stats stat : pvStats) {
if (stat.getStatName().toUpperCase().equals(Name.toUpperCase())) {
value = stat.getStatValue();
break;
}
}
return ... |
public java.lang.String searchWord(org.springframework.ui.ModelMap model, javax.servlet.http.HttpServletRequest request) {
java.lang.String word = request.getParameter("word");
if (org.apache.commons.lang.StringUtils.isNotBlank(word)) {
com.ygl.piggynote.controller.dingup.CollinsSearchResult csr = com.y... | public java.lang.String searchWord(org.springframework.ui.ModelMap model, javax.servlet.http.HttpServletRequest request) {
java.lang.String word = request.getParameter("word");
if (org.apache.commons.lang.StringUtils.isNotBlank(word)) {
com.ygl.piggynote.controller.dingup.CollinsSearchResult csr = com.y... |
public static org.sosy_lab.cpachecker.cpa.policyiteration.PolicyAbstractedState of(java.util.Map<org.sosy_lab.cpachecker.util.templates.Template, org.sosy_lab.cpachecker.cpa.policyiteration.PolicyBound> data, org.sosy_lab.cpachecker.cfa.model.CFANode node, int pLocationID, org.sosy_lab.cpachecker.cpa.policyiteration.St... | public static org.sosy_lab.cpachecker.cpa.policyiteration.PolicyAbstractedState of(java.util.Map<org.sosy_lab.cpachecker.util.templates.Template, org.sosy_lab.cpachecker.cpa.policyiteration.PolicyBound> data, org.sosy_lab.cpachecker.cfa.model.CFANode node, int pLocationID, org.sosy_lab.cpachecker.cpa.policyiteration.St... |
protected void onPreExecute() {
super.onPreExecute();
for (java.lang.String name : fileNames) {
java.io.File f = new java.io.File(getContext().getFilesDir(), name);
f.delete();
}
mMainFramentComponentsLayout.setVisibility(View.GONE);
mFetchMessageLayout.setVisibility(View.VISIBLE);
} | protected void onPreExecute() {
super.onPreExecute();
for (java.lang.String name : fileNames) {
java.io.File f = new java.io.File(getContext().getFilesDir(), name);
f.delete();
mFetchMessageLayout.setVisibility(View.VISIBLE);
mMainFramentComponentsLayout.setVisibility(View.GONE);... |
public void defaultType() throws java.lang.Exception {
org.junit.Assert.assertEquals(java.lang.Byte.class, instance.getDefaultType());
org.apache.olingo.commons.api.edm.EdmEnumType instance = new org.apache.olingo.commons.core.edm.EdmEnumTypeImpl(org.mockito.Mockito.mock(org.apache.olingo.commons.api.edm.Edm.cl... | public void defaultType() throws java.lang.Exception {
org.junit.Assert.assertEquals(java.lang.Byte.class, instance.getDefaultType());
org.apache.olingo.commons.api.edm.EdmEnumType instance = new org.apache.olingo.commons.core.edm.EdmEnumTypeImpl(null, new org.apache.olingo.commons.api.edm.FullQualifiedName("te... |
private ar.edu.ungs.persistence.entities.autorizaciones.Autorizacion guardarAutorizacion(ar.edu.ungs.business.dto.AutorizacionDTO autorizacionDto, ar.edu.ungs.persistence.entities.autorizaciones.TipoAutorizacion.TipoAutorizacionEnum tipo) throws ar.edu.ungs.commons.exception.BusinessException {
try {
ar.edu... | private ar.edu.ungs.persistence.entities.autorizaciones.Autorizacion guardarAutorizacion(ar.edu.ungs.business.dto.AutorizacionDTO autorizacionDto, ar.edu.ungs.persistence.entities.autorizaciones.TipoAutorizacion.TipoAutorizacionEnum tipo) throws ar.edu.ungs.commons.exception.BusinessException {
try {
ar.edu... |
public static htsjdk.samtools.SAMFileHeader createOutHeaderForReadGroup(final htsjdk.samtools.SAMReadGroupRecord samReadGroup, final htsjdk.samtools.SAMFileHeader inHeader, final htsjdk.samtools.SAMFileHeader.SortOrder sortOrder, final boolean removeAlignmentInformation) {
final htsjdk.samtools.SAMFileHeader outHea... | static htsjdk.samtools.SAMFileHeader createOutHeaderForReadGroup(final htsjdk.samtools.SAMReadGroupRecord samReadGroup, final htsjdk.samtools.SAMFileHeader inHeader, final htsjdk.samtools.SAMFileHeader.SortOrder sortOrder, final boolean removeAlignmentInformation) {
final htsjdk.samtools.SAMFileHeader outHeader = n... |
public static org.eclipse.kura.linux.bluetooth.util.BluetoothProcess startSession(java.lang.String address, org.eclipse.kura.linux.bluetooth.util.BluetoothProcessListener listener) {
java.lang.String[] command = new java.lang.String[]{ org.eclipse.kura.linux.bluetooth.util.BluetoothUtil.GATTTOOL , "-b" , address , ... | public static org.eclipse.kura.linux.bluetooth.util.BluetoothProcess startSession(java.lang.String address, org.eclipse.kura.linux.bluetooth.util.BluetoothProcessListener listener) {
java.lang.String[] command = new java.lang.String[]{ org.eclipse.kura.linux.bluetooth.util.BluetoothUtil.GATTTOOL , "-b" , address , ... |
private org.talend.core.model.metadata.IMetadataTable mockMetadataTable(java.lang.String label) {
org.talend.core.model.metadata.IMetadataTable table = org.mockito.Mockito.mock(org.talend.core.model.metadata.IMetadataTable.class);
org.mockito.Mockito.when(table.getLabel()).thenReturn(label);
java.util.List<... | private org.talend.core.model.metadata.IMetadataTable mockMetadataTable(java.lang.String label) {
org.talend.core.model.metadata.IMetadataTable table = mock(org.talend.core.model.metadata.IMetadataTable.class);
when(table.getLabel()).thenReturn(label);
java.util.List<org.talend.core.model.metadata.IMetadata... |
private void authenticateUser() {
com.spotify.sdk.android.authentication.AuthenticationRequest.Builder builder = new com.spotify.sdk.android.authentication.AuthenticationRequest.Builder(SpotifyDataManager.CLIENT_ID, com.spotify.sdk.android.authentication.AuthenticationResponse.Type.TOKEN, SpotifyDataManager.REDIREC... | private void authenticateUser() {
com.spotify.sdk.android.authentication.AuthenticationRequest.Builder builder = new com.spotify.sdk.android.authentication.AuthenticationRequest.Builder(SpotifyDataManager.CLIENT_ID, com.spotify.sdk.android.authentication.AuthenticationResponse.Type.TOKEN, SpotifyDataManager.REDIREC... |
private long getGlobalBucketTotalLend(final net.onrc.openvirtex.elements.datapath.scheduler.MarkerScheduler.BucketType type) {
net.onrc.openvirtex.elements.marker.SrtcMarker globalMarker = ((net.onrc.openvirtex.elements.marker.SrtcMarker) (sw.getMarker(OFMarker.OFPM_GLOBAL.getValue())));
if (globalMarker == nul... | private long getGlobalBucketTotalLend(final net.onrc.openvirtex.elements.datapath.scheduler.MarkerScheduler.BucketType type) {
net.onrc.openvirtex.elements.marker.SrtcMarker globalMarker = ((net.onrc.openvirtex.elements.marker.SrtcMarker) (sw.getMarker(OFMarker.OFPM_GLOBAL.getValue())));
if (globalMarker == nul... |
public void onCreate() {
super.onCreate();
agersant.polaris.api.local.OfflineCache.init(this);
agersant.polaris.api.remote.ServerAPI.init(this);
agersant.polaris.api.local.LocalAPI.init();
agersant.polaris.api.API.init(this);
agersant.polaris.api.remote.DownloadQueue.init(this);
initMediaPla... | public void onCreate() {
super.onCreate();
agersant.polaris.PolarisApplication.instance = this;
agersant.polaris.api.local.OfflineCache.init(this);
agersant.polaris.api.remote.ServerAPI.init(this);
agersant.polaris.api.local.LocalAPI.init();
agersant.polaris.api.API.init(this);
agersant.pola... |
private void writeValue(java.lang.String customer, javax.servlet.http.HttpServletResponse response) throws java.io.IOException {
edu.pdx.cs410J.jonerik.PhoneBill bill = this.bills.get(customer);
edu.pdx.cs410J.jonerik.PrettyPrinter prettify = new edu.pdx.cs410J.jonerik.PrettyPrinter(response.getWriter());
p... | private void writeValue(java.lang.String customer, javax.servlet.http.HttpServletResponse response) throws java.io.IOException {
edu.pdx.cs410J.jonerik.PhoneBill bill = bills.get(customer);
edu.pdx.cs410J.jonerik.PrettyPrinter prettify = new edu.pdx.cs410J.jonerik.PrettyPrinter(response.getWriter());
pretti... |
public synchronized com.sun.mail.imap.IMAPStore getIMAPStore(java.lang.String user, java.lang.String oauthToken) {
try {
initialize();
return com.einzig.ipst2.oauth.OAuth2Authenticator.connectToImap("imap.gmail.com", 993, user, oauthToken, true);
} catch (java.lang.Exception e) {
android... | public synchronized com.sun.mail.imap.IMAPStore getIMAPStore(java.lang.String user, java.lang.String oauthToken) {
try {
initialize();
return com.einzig.ipst2.oauth.OAuth2Authenticator.connectToImap("imap.gmail.com", 993, user, oauthToken, false);
} catch (java.lang.Exception e) {
androi... |
protected me.legopal92.gamblr.listeners.Prompt acceptValidatedInput(me.legopal92.gamblr.listeners.ConversationContext conversationContext, boolean b) {
org.bukkit.entity.Player player = ((org.bukkit.entity.Player) (conversationContext.getForWhom()));
me.legopal92.gamblr.npc.NPCDealer dealer = ((me.legopal92.gam... | protected me.legopal92.gamblr.listeners.Prompt acceptValidatedInput(me.legopal92.gamblr.listeners.ConversationContext conversationContext, boolean b) {
org.bukkit.entity.Player player = ((org.bukkit.entity.Player) (conversationContext.getForWhom()));
me.legopal92.gamblr.npc.NPCDealer dealer = ((me.legopal92.gam... |
android.widget.EditText textbox = ((android.widget.EditText) (findViewById(R.id.taskName)));
com.example.ysingh9481.taskmanager.var text = textbox.getText().toString();
items.add(text.getText().toString());
myAdapter.notifyDataSetChanged();
text.setText("");
} | android.widget.EditText textbox = ((android.widget.EditText) (findViewById(R.id.taskName)));
java.lang.String text = textbox.getText().toString();
items.add(text);
myAdapter.notifyDataSetChanged();
textbox.setText("");
} |
public java.util.Map<java.lang.Integer, java.util.List<com.hazelcast.map.impl.mapstore.writebehind.DelayedEntry>> process(java.util.List<com.hazelcast.map.impl.mapstore.writebehind.DelayedEntry> delayedEntries) {
java.util.Map<java.lang.Integer, java.util.List<com.hazelcast.map.impl.mapstore.writebehind.DelayedEntr... | public java.util.Map<java.lang.Integer, java.util.List<com.hazelcast.map.impl.mapstore.writebehind.DelayedEntry>> process(java.util.List<com.hazelcast.map.impl.mapstore.writebehind.DelayedEntry> delayedEntries) {
java.util.Map<java.lang.Integer, java.util.List<com.hazelcast.map.impl.mapstore.writebehind.DelayedEntr... |
private void startEditingNextRow(final javax.swing.JTable statsTable, final int col, final int nextRow, javax.swing.JTextField textField) {
if ((((nextRow >= 0) && (nextRow < (statsTable.getModel().getRowCount()))) && (col >= 0)) && (col < (statsTable.getModel().getColumnCount()))) {
statsTable.editCellAt(n... | private void startEditingNextRow(final javax.swing.JTable statsTable, final int col, final int nextRow, javax.swing.JTextField textField) {
if ((((nextRow >= 0) && (nextRow < (getRowCount()))) && (col >= 0)) && (col < (getColumnCount()))) {
statsTable.editCellAt(nextRow, col);
textField.requestFocus... |
public void submitInfo(android.view.View view) {
java.lang.Boolean isValid = checkValidity();
hideKeyboard();
if (isValid) {
android.widget.Toast submitToast = android.widget.Toast.makeText(getApplicationContext(), "Successfully submitted!", Toast.LENGTH_SHORT);
submitToast.show();
a... | public void submitInfo(android.view.View view) {
java.lang.Boolean isValid = checkValidity();
hideKeyboard();
if (isValid) {
android.widget.Toast submitToast = android.widget.Toast.makeText(getApplicationContext(), "Successfully submitted!", Toast.LENGTH_SHORT);
submitToast.show();
a... |
private java.awt.Color selectColor() {
int red = (java.lang.Math.abs(random.nextInt())) % 255;
int green = (java.lang.Math.abs(random.nextInt())) % 255;
int blue = (java.lang.Math.abs(random.nextInt())) % 255;
return new java.awt.Color(red, blue, blue);
} | private java.awt.Color selectColor() {
int red = (java.lang.Math.abs(random.nextInt())) % 255;
int green = (java.lang.Math.abs(random.nextInt())) % 255;
int blue = (java.lang.Math.abs(random.nextInt())) % 255;
return new java.awt.Color(red, green, blue);
} |
public javax.ws.rs.core.Response putFile(java.lang.String schemaName, java.lang.String path, java.io.InputStream inputStream, java.lang.Long lastModified, java.lang.Integer msTimeout, java.lang.Integer target) {
try {
com.qwazr.store.schema.StoreSchemaDefinition schemaDef = StoreSchemaManager.INSTANCE.getSc... | public javax.ws.rs.core.Response putFile(java.lang.String schemaName, java.lang.String path, java.io.InputStream inputStream, java.lang.Long lastModified, java.lang.Integer msTimeout, java.lang.Integer target) {
try {
com.qwazr.store.schema.StoreSchemaDefinition schemaDef = StoreSchemaManager.INSTANCE.getSc... |
protected org.hamcrest.Matcher<? extends org.apache.maven.artifact.Artifact> initGlobalMatcher() {
return org.hamcrest.CoreMatchers.anyOf(org.hamcrest.CoreMatchers.allOf(net.flexmojos.oss.matcher.artifact.ArtifactMatcher.groupId(net.flexmojos.oss.plugin.AbstractMavenMojo.AIR_GROUP_ID), net.flexmojos.oss.matcher.art... | protected org.hamcrest.Matcher<? extends org.apache.maven.artifact.Artifact> initGlobalMatcher() {
return org.hamcrest.CoreMatchers.anyOf(org.hamcrest.CoreMatchers.allOf(groupId(net.flexmojos.oss.plugin.AbstractMavenMojo.AIR_GROUP_ID), artifactId(net.flexmojos.oss.plugin.AbstractMavenMojo.AIR_GLOBAL), type(net.flex... |
public void addConfiguredSPK(net.filebot.ant.spk.RepositoryTask.SPK spk) {
if ((spk.file) != null) {
if (((spk.url) != null) || (spk.file.exists())) {
spks.add(spk);
}
throw new org.apache.tools.ant.BuildException(("File not found: " + (spk.file)));
}
throw new org.apache... | public void addConfiguredSPK(net.filebot.ant.spk.RepositoryTask.SPK spk) {
if ((((spk.file) != null) && ((spk.url) != null)) || (((spk.file) != null) && (spk.file.exists()))) {
spks.add(spk);
}else {
throw new org.apache.tools.ant.BuildException("Required attributes: [file] or [url, file]");
... |
public synchronized net.viktorc.detroid.framework.uci.SearchResults get(long timeout, java.util.concurrent.TimeUnit unit) {
long timeoutMs = unit.toMillis(timeout);
long start = java.lang.System.currentTimeMillis();
while ((!(isDone)) && (timeoutMs > 0)) {
try {
wait(timeoutMs);
... | public synchronized net.viktorc.detroid.framework.uci.SearchResults get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException {
long timeoutMs = unit.toMillis(timeout);
long start = java.lang.System.currentTimeMillis();
while ((!(isDone)) && (timeoutMs > 0)) {
wait(... |
public org.AD_P1.Interfaces.HAWListElement<E> retrieve(java.lang.Object pos) {
org.AD_P1.DoublyLinkedList.HAWLinkedArrayList.count();
if (pos == null) {
throw new java.lang.IndexOutOfBoundsException();
}
org.AD_P1.DoublyLinkedList.LinkedArrayElement<E> arrayElement = ((org.AD_P1.DoublyLinkedList... | public org.AD_P1.Interfaces.HAWListElement<E> retrieve(java.lang.Object pos) {
org.AD_P1.DoublyLinkedList.HAWLinkedArrayList.count();
if (pos == null) {
return null;
}
org.AD_P1.DoublyLinkedList.LinkedArrayElement<E> arrayElement = ((org.AD_P1.DoublyLinkedList.LinkedArrayElement<E>) (pos));
... |
public static java.lang.String parseCharset(java.lang.String contentType) {
for (java.lang.String part : contentType.split(";")) {
if (part.trim().startsWith("charset=")) {
java.lang.String[] val = part.split("=");
if ((val[1].length) > 1) {
return val[1].trim();
... | public static java.lang.String parseCharset(java.lang.String contentType) {
for (java.lang.String part : contentType.split(";")) {
if (part.trim().startsWith("charset=")) {
java.lang.String[] val = part.split("=");
if ((val.length) > 1) {
return val[1].trim();
... |
private static boolean isHeaderFile(@org.jetbrains.annotations.Nullable
com.intellij.openapi.vfs.VirtualFile[] files) {
boolean result = true;
for (com.intellij.openapi.vfs.VirtualFile file : files) {
result &= (file.exists()) && (file.getName().endsWith(".h"));
}
return result;
} | private static boolean isHeaderFile(@org.jetbrains.annotations.Nullable
com.intellij.openapi.vfs.VirtualFile[] files) {
boolean result = true;
if (files == null) {
return false;
}
for (com.intellij.openapi.vfs.VirtualFile file : files) {
result &= (file.exists()) && (file.getName().endsW... |
public byte getPetIndex(int petId) {
petLock.lock();
try {
for (byte i = 0; i < 3; i++) {
if ((pets[i]) != null) {
if ((pets[i].getUniqueId()) == petId) {
return i;
}
}
}
return -1;
} finally {
petLoc... | public byte getPetIndex(int petId) {
petLock.lock();
try {
for (byte i = 0; i < (pets.length); i++) {
if ((pets[i]) != null) {
if ((pets[i].getUniqueId()) == petId) {
return i;
}
}
}
return -1;
} finally {
... |
public static int getAmtChipsOnField(int chipPosition) {
int amt = 0;
int i = 0;
while (((GameField.field[chipPosition][i]) < 3) && (i < 3)) {
i++;
amt++;
if (i == 2)
break;
}
return amt;
} | public static int getAmtChipsOnField(int chipPosition) {
int amt = 0;
int i = 0;
while ((GameField.field[chipPosition][i]) < 3) {
i++;
amt++;
if (i == 3)
break;
}
return amt;
} |
public void run() {
while (Mazewar.leader.equals(Mazewar.localClient.getName())) {
Mazewar.localClient.sendTick();
try {
java.lang.Thread.sleep(200);
} catch (java.lang.InterruptedException e) {
e.printStackTrace();
}
}
} | public void run() {
while (true) {
if (Mazewar.leader.equals(Mazewar.localClient.getName())) {
Mazewar.localClient.sendTick();
try {
java.lang.Thread.sleep(200);
} catch (java.lang.InterruptedException e) {
e.printStackTrace();
... |
private void removeCharacter(org.json.JSONObject data) {
try {
int id = data.getInt("id");
for (int i = 0; i < (characters.size()); i++) {
if ((characters.get(i).getId()) == id) {
characters.remove(i);
}
}
} catch (org.json.JSONException e) {
... | public void removeCharacter(int id) {
for (int i = 0; i < (characters.size()); i++) {
if ((characters.get(i).getId()) == id) {
characters.remove(i);
}
}
} |
public void update(int index, by.ipps.atts.client.model.AcceptTest object, java.lang.String value) {
java.lang.String key = by.ipps.atts.client.model.AcceptTest.getTestStatusMap().get(value);
statusmap.put(object.getNpk().toString(), key);
by.ipps.atts.client.form.cand.AcceptTestViewGrid.CandidateDB.get().r... | public void update(int index, by.ipps.atts.client.model.AcceptTest object, java.lang.String value) {
java.lang.String key = by.ipps.atts.client.model.AcceptTest.getTestStatusMap().get(value);
statusmap.put(object.getNpk().toString(), key);
by.ipps.atts.client.form.cand.AcceptTestViewGrid.CandidateDB.get().r... |
public static java.lang.String getPersianDate(long timeMillies, boolean isFull) {
java.util.Date date = new java.util.Date(timeMillies);
ir.anamsoftware.persiandateultimate.ManamPDUltimate m = new ir.anamsoftware.persiandateultimate.ManamPDUltimate(((date.getYear()) + 1900), date.getMonth(), date.getDate());
... | public static java.lang.String getPersianDate(long timeMillies, boolean isFull) {
java.util.Date date = new java.util.Date(timeMillies);
ir.anamsoftware.persiandateultimate.ManamPDUltimate m = new ir.anamsoftware.persiandateultimate.ManamPDUltimate(((date.getYear()) + 1900), ((date.getMonth()) + 1), date.getDat... |
public void latestLogFileContainingACheckPointOnly() throws java.lang.Throwable {
org.neo4j.kernel.recovery.LatestCheckPointFinder finder = new org.neo4j.kernel.recovery.LatestCheckPointFinder(logFiles, fs, reader);
org.neo4j.kernel.impl.transaction.log.entry.CheckPoint checkPoint = new org.neo4j.kernel.impl.tr... | public void latestLogFileContainingACheckPointOnly() throws java.lang.Throwable {
org.neo4j.kernel.recovery.LatestCheckPointFinder finder = new org.neo4j.kernel.recovery.LatestCheckPointFinder(logFiles, fs, reader);
org.neo4j.kernel.impl.transaction.log.entry.CheckPoint checkPoint = new org.neo4j.kernel.impl.tr... |
maxInvDice = de.htwg.risiko.turn.InvadeTurn.MAX_RECRUITMENT;
if ((invadingCountry.getSoldiers()) < (de.htwg.risiko.turn.InvadeTurn.MAX_RECRUITMENT)) {
maxInvDice = invadingCountry.getSoldiers();
}
maxDefDice = 2;
if ((defendingCountry.getSoldiers()) < 2) {
maxDefDice = defendingCount... | maxInvDice = de.htwg.risiko.turn.InvadeTurn.MAX_RECRUITMENT;
if ((invadingCountry.getSoldiers()) <= (de.htwg.risiko.turn.InvadeTurn.MAX_RECRUITMENT)) {
maxInvDice = (invadingCountry.getSoldiers()) - 1;
}
maxDefDice = 2;
if ((defendingCountry.getSoldiers()) < 2) {
maxDefDice = defendi... |
public static java.util.List<java.lang.String> retrieveEntities(java.lang.String endpoint, java.lang.String uri, java.lang.String language) {
java.util.List<java.lang.String> entities = new java.util.ArrayList<java.lang.String>();
entities.addAll(de.citec.sc.sentence.preprocessing.sparql.Sparql.getValues(endpoi... | public static java.util.List<java.lang.String> retrieveEntities(java.lang.String endpoint, java.lang.String uri, java.lang.String language) {
java.util.List<java.lang.String> entities = new java.util.ArrayList<java.lang.String>();
entities.addAll(de.citec.sc.sentence.preprocessing.sparql.Sparql.getValues(endpoi... |
public LLNode<E> getNodeFromIndex(int x) {
int index = 0;
LLNode<E> item = first;
while ((item != null) && (index < x)) {
index++;
item = item.getNext();
}
if (item == null)
return null;
else
return item;
} | public LLNode<E> getNodeFromIndex(int x) {
int index = 0;
LLNode<E> item = first;
while (index < x) {
index++;
item = item.getNext();
}
if (item == null)
return null;
else
return item;
} |
public void run() {
try (java.net.Socket s = socket;java.io.InputStream is = socket.getInputStream();java.io.OutputStream os = socket.getOutputStream()) {
for (int i = 0; (i = is.read()) != (-1);) {
os.write(net.util.Magic.doMagic(i));
}
} catch (java.io.IOException e) {
e.pr... | public void run() {
try (java.net.Socket s = socket;java.io.InputStream is = s.getInputStream();java.io.OutputStream os = s.getOutputStream()) {
for (int i = 0; (i = is.read()) != (-1);) {
os.write(net.util.Magic.doMagic(i));
}
} catch (java.io.IOException e) {
e.printStackTr... |
private long testGsonPath() {
long start = java.lang.System.nanoTime();
gsonpath.generated.PersonModelList personModelList = gsonPath.fromJson(new java.io.StringReader(gsonpath.PeopleModelTest.JSON_TEST_STRING), gsonpath.generated.PersonModelList.class);
long duration = ((java.lang.System.nanoTime()) - star... | private long testGsonPath() {
long start = java.lang.System.nanoTime();
gsonpath.generated.PersonModelList personModelList = gsonPath.fromJson(new java.io.StringReader(gsonpath.PeopleModelTest.JSON_TEST_STRING), gsonpath.generated.PersonModelList.class);
long duration = ((java.lang.System.nanoTime()) - star... |
private WeaponType pickToGun(Pickup p) {
PickupType pt = p.getPickupType();
switch (pt) {
case WEAPON_LASER_RIFLE :
return WeaponType.LASER_RIFLE;
case WEAPON_MINI_BLASTER :
return WeaponType.MINI_BLASTER;
case WEAPON_SCATTER_GUN :
return WeaponType.SC... | private WeaponType pickToGun(Pickup p) {
if (p == null) {
return null;
}
PickupType pt = p.getPickupType();
switch (pt) {
case WEAPON_LASER_RIFLE :
return WeaponType.LASER_RIFLE;
case WEAPON_MINI_BLASTER :
return WeaponType.MINI_BLASTER;
case WEAPO... |
public void testSayHelloAFewTimes() {
java.io.OutputStream os = new java.io.ByteArrayOutputStream();
java.io.PrintStream stream = new java.io.PrintStream(os, true);
com.example.javamavenjunithelloworld.Hello hi = new com.example.javamavenjunithelloworld.Hello();
hi.setTimes(3);
hi.sayHello(stream);
... | public void testSayHelloAFewTimes() {
java.io.OutputStream os = new java.io.ByteArrayOutputStream();
java.io.PrintStream stream = new java.io.PrintStream(os, true);
com.example.javamavenjunithelloworld.Hello hi = new com.example.javamavenjunithelloworld.Hello();
hi.setTimes(3);
hi.sayHello(stream);
... |
public static boolean setKeyEntry(java.security.KeyStore keyStore, java.lang.String alias, java.security.PrivateKey privateKey, char[] password, java.security.cert.Certificate certificate) {
boolean success = false;
try {
keyStore.setKeyEntry(alias, privateKey, password, new java.security.cert.Certifica... | public static boolean setKeyEntry(java.security.KeyStore keyStore, java.lang.String alias, java.security.PrivateKey privateKey, char[] password, java.security.cert.Certificate certificate) {
boolean success = false;
try {
keyStore.setKeyEntry(alias, privateKey, password, new java.security.cert.Certifica... |
public void iteratorShouldSupportForEachIteration() throws java.lang.Exception {
int[] expected = new int[]{ 10 , 20 , 30 , 40 };
for (int i : expected) {
list.add(expected[i]);
}
int i = 0;
for (java.lang.Integer value : list) {
assertEquals(new java.lang.Integer(expected[(i++)]), v... | public void iteratorShouldSupportForEachIteration() throws java.lang.Exception {
java.lang.Integer[] expected = new java.lang.Integer[]{ 10 , 20 , 30 , 40 };
for (java.lang.Integer value : expected) {
list.add(value);
}
int i = 0;
for (java.lang.Integer value : list) {
assertEquals(e... |
public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
if (isSent)
return ;
if ((ums) == null)
ums = new com.swifta.mats.web.utils.UserManagementService();
java.lang.String strResponse = null;
try {
strResponse = ums.setParent(tFP.getValue(), tFInitUser.getVal... | public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
if (isSent)
return ;
java.lang.String strResponse = null;
try {
strResponse = com.swifta.mats.web.utils.UserManagementService.setParent(tFP.getValue(), tFInitUser.getValue(), tFU.getValue());
isSent = true;
} c... |
public boolean onException(java.lang.Exception e, java.lang.String model, com.bumptech.glide.request.target.Target<com.bumptech.glide.load.resource.drawable.GlideDrawable> target, boolean isFirstResource) {
if (((e.getMessage()) != null) && (e.getMessage().contains("Request failed"))) {
android.util.Log.d(c... | public boolean onException(java.lang.Exception e, java.lang.String model, com.bumptech.glide.request.target.Target<com.bumptech.glide.load.resource.drawable.GlideDrawable> target, boolean isFirstResource) {
if (((e != null) && ((e.getMessage()) != null)) && (e.getMessage().contains("Request failed"))) {
and... |
protected void onActivityResult(int requestCode, int resultCode, android.content.Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == (RESULT_OK)) {
mSongJson = data.getStringExtra(Constants.EXT_SOUND_DATA);
if (((mSongJson) != null) && ((mSoundPlayer) != null)... | protected void onActivityResult(int requestCode, int resultCode, android.content.Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == (RESULT_OK)) {
mSongJson = data.getStringExtra(Constants.EXT_SOUND_DATA);
if ((mSongJson) != null) {
play();
... |
public void mouseMoved(java.awt.event.MouseEvent me) {
for (java.awt.Point site : this.gameState.getDiagram().getSites()) {
java.awt.Point cursorLocation = me.getPoint();
voronoigame.model.Cell cell = this.gameState.getCell(site);
if ((voronoigame.Util.isInCircle(cursorLocation, site, Cell.N... | public void mouseMoved(java.awt.event.MouseEvent me) {
java.awt.Point cursorLocation = me.getPoint();
for (java.awt.Point site : this.gameState.getDiagram().getSites()) {
voronoigame.model.Cell cell = this.gameState.getCell(site);
if ((voronoigame.Util.isInCircle(cursorLocation, site, Cell.NUCLE... |
public void initializeViews() {
mAnnouncementsList.setLayoutManager(new android.support.v7.widget.LinearLayoutManager(getActivity()));
mAnnouncementsList.setEmptyView(mEmptyView);
mAnnouncementsList.setProgressBar(mProgressBar);
mAdapter = new blueprint.com.sage.announcements.adapters.AnnouncementsListA... | public void initializeViews() {
mAnnouncementsList.setLayoutManager(new android.support.v7.widget.LinearLayoutManager(getActivity()));
mAnnouncementsList.setEmptyView(mEmptyView);
mAnnouncementsList.setProgressBar(mProgressBar);
mAdapter = new blueprint.com.sage.announcements.adapters.AnnouncementsListA... |
public void run() {
Peer.disconnect();
for (PeerInfo peer : Peer.peerList) {
buffer = new byte[256];
buffer = message.getBytes();
leavePacket = new java.net.DatagramPacket(buffer, 0, buffer.length, peer.hostIP, peer.portNum);
try {
dataSocket.send(leavePacket);
... | public void run() {
buffer = new byte[256];
for (PeerInfo peer : Peer.peerList) {
buffer = message.getBytes();
leavePacket = new java.net.DatagramPacket(buffer, 0, buffer.length, peer.hostIP, peer.portNum);
try {
dataSocket.send(leavePacket);
} catch (java.io.IOExcept... |
public void onUpdate(int cnt) {
assert cnt >= 0;
if (!(acceptUpdates))
return ;
java.util.concurrent.CountDownLatch latch0 = internalLatch;
if (latch0 == null) {
org.apache.ignite.internal.util.typedef.internal.U.awaitQuiet(initLatch);
latch0 = initLatch;
}
assert la... | public void onUpdate(int cnt) {
assert cnt >= 0;
if (!(acceptUpdates))
return ;
java.util.concurrent.CountDownLatch latch0 = internalLatch;
if (latch0 == null) {
org.apache.ignite.internal.util.typedef.internal.U.awaitQuiet(initLatch);
latch0 = internalLatch;
}
asser... |
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
android.opengl.GLSurfaceView view = new android.opengl.GLSurfaceView(this);
view.setEGLConfigC... | protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
android.opengl.GLSurfaceView view = new android.opengl.GLSurfaceView(this);
view.setRenderer(n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.