buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
protected final <T extends Capsule> T sup(java.lang.Class<T> caplet) {
if (caplet == (getClass()))
throw new java.lang.IllegalArgumentException((("Called with " + (caplet.getName())) + " on the same class."));
for (Capsule c = this; c != null; c = c.sup) {
if (caplet.isInstance(c))
... | protected final <T extends Capsule> T sup(java.lang.Class<T> caplet) {
for (Capsule c = this; c != null; c = c.sup) {
if (caplet.isInstance(c))
return caplet.cast(c);
}
return null;
} |
protected java.lang.String doInBackground(org.json.JSONObject... params) {
try {
status = Status.running;
token = getAccessToken(activity, chosenEmail, com.flatflatching.flatflatching.helpers.AbstractGetAuthTokenTask.SCOPE);
if (((token) != null) && ((status) != (Status.userRecoverableError)... | protected java.lang.String doInBackground(org.json.JSONObject... params) {
try {
status = Status.running;
token = getAccessToken(activity, chosenEmail, com.flatflatching.flatflatching.helpers.AbstractGetAuthTokenTask.SCOPE);
if (((token) != null) || ((status) != (Status.userRecoverableError)... |
public int onStartCommand(com.github.javaperson.image.Intent intent, int flags, int startId) {
java.lang.String action = intent.getAction();
android.util.Log.v("onStartCommand", action);
if (com.github.javaperson.image.ImageWidget.ACTION_UPDATE.equals(action)) {
update();
}
return super.onSt... | public int onStartCommand(com.github.javaperson.image.Intent intent, int flags, int startId) {
if (intent != null) {
java.lang.String action = intent.getAction();
android.util.Log.v("onStartCommand", action);
if (com.github.javaperson.image.ImageWidget.ACTION_UPDATE.equals(action)) {
... |
public static ly.kite.photopicker.Photo[] getResultPhotos(android.content.Intent data) {
android.os.Parcelable[] parcelables = data.getParcelableArrayExtra(ly.kite.photopicker.PhotoPicker.EXTRA_SELECTED_PHOTOS);
ly.kite.photopicker.Photo[] photos = new ly.kite.photopicker.Photo[parcelables.length];
java.lan... | public static ly.kite.photopicker.Photo[] getResultPhotos(android.content.Intent data) {
android.os.Parcelable[] parcelables = data.getParcelableArrayExtra(ly.kite.photopicker.PhotoPicker.EXTRA_SELECTED_PHOTOS);
ly.kite.photopicker.Photo[] photos = new ly.kite.photopicker.Photo[parcelables.length];
java.lan... |
public void onStartInputView(android.view.inputmethod.EditorInfo attribute, boolean restarting) {
super.onStartInputView(attribute, restarting);
setLatinKeyboard(mCurKeyboard);
mInputView.closing();
final android.view.inputmethod.InputMethodSubtype subtype = mInputMethodManager.getCurrentInputMethodSubt... | public void onStartInputView(android.view.inputmethod.EditorInfo attribute, boolean restarting) {
super.onStartInputView(attribute, restarting);
setLatinKeyboard(mCurKeyboard);
mInputView.closing();
updateShiftKeyState(attribute);
final android.view.inputmethod.InputMethodSubtype subtype = mInputMet... |
public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
android.view.Window w = getWindow();
if ((Build.VERSION.SDK_INT) >= (Build.VERSION_CODES.KITKAT)) {
w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRAN... | public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
android.view.Window w = getWindow();
if ((Build.VERSION.SDK_INT) >= (Build.VERSION_CODES.KITKAT)) {
w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUC... |
public void add(T info) {
if ((root) == null) {
root = new collections.Node<T>(info);
}
collections.Node<T> temp = new collections.Node<T>(info);
collections.Node<T> current = root;
if (current != null) {
while ((current.getNext()) != null) {
current = current.getNext();
... | public void add(T info) {
if ((root) == null) {
root = new collections.Node<T>(info);
}else {
collections.Node<T> temp = new collections.Node<T>(info);
collections.Node<T> current = root;
if (current != null) {
while ((current.getNext()) != null) {
cur... |
public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
db = new sattar.androidnewsapp.DBContext(android.arch.persistence.room.Room.databaseBuilder(getActivity().getApplicationContext(), sattar.androidnewsapp.AppDatabase.class, "news.db").build(), this);
sattar.andro... | public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
data = new java.util.ArrayList<>();
db = new sattar.androidnewsapp.DBContext(android.arch.persistence.room.Room.databaseBuilder(getActivity().getApplicationContext(), sattar.androidnewsapp.AppDatabase.class, "ne... |
public static io.realm.internal.Collection createBacklinksCollection(io.realm.internal.SharedRealm realm, io.realm.internal.UncheckedRow row, io.realm.internal.Table srcTable, java.lang.String srcFieldName) {
long backlinksPtr = io.realm.internal.Collection.nativeCreateResultsFromBacklinks(realm.getNativePtr(), row... | public static io.realm.internal.Collection createBacklinksCollection(io.realm.internal.SharedRealm realm, io.realm.internal.UncheckedRow row, io.realm.internal.Table srcTable, java.lang.String srcFieldName) {
long backlinksPtr = io.realm.internal.Collection.nativeCreateResultsFromBacklinks(realm.getNativePtr(), row... |
protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws java.lang.Exception {
http.formLogin().loginPage("/login").defaultSuccessUrl("/me").permitAll().and().authorizeRequests().antMatchers("/", "/logout").permitAll().and().logout().logoutSuccessUrl("/login?log... | protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws java.lang.Exception {
http.formLogin().loginPage("/login").defaultSuccessUrl("/me").permitAll().and().authorizeRequests().antMatchers("/", "/logout", "/merchant/add").permitAll().and().logout().logoutSucce... |
public boolean guess(java.util.ArrayList<java.lang.Integer> alActionContent) {
this.alGuess = alActionContent;
if ((alActionContent.size()) != (alMapping.size())) {
java.lang.System.out.println("Wrong guess size!");
return false;
}
for (int i = 0; i < (alActionContent.size()); i++) {
... | public boolean guess(java.util.ArrayList<java.lang.Integer> alActionContent) {
this.alGuess = alActionContent;
if ((alActionContent.size()) != (alMapping.size())) {
java.lang.System.out.println("Wrong guess size!");
return false;
}
for (int i = 0; i < (alActionContent.size()); i++) {
... |
private void invalidateVictimPage(int ppn) {
for (int i = 0; i < (nachos.vm.Machine.processor().getTLBSize()); i++) {
nachos.vm.TranslationEntry tlbe = nachos.vm.Machine.processor().readTLBEntry(i);
if (tlbe.ppn = ppn) {
tlbe.valid = false;
pageTable[tlbe.vpn].valid = false;
... | private void invalidateVictimPage(int ppn) {
for (int i = 0; i < (nachos.vm.Machine.processor().getTLBSize()); i++) {
nachos.vm.TranslationEntry tlbe = nachos.vm.Machine.processor().readTLBEntry(i);
if ((tlbe.ppn) == ppn) {
tlbe.valid = false;
pageTable[tlbe.vpn].valid = fals... |
private static java.lang.String trimRHSWS(@javax.annotation.Nonnull
java.lang.String s) {
int i;
for (i = s.length(); i > 0; --i) {
int c = s.codePointAt(i);
if ((c != ' ') && (c != '\t'))
break;
}
return s.substring(0, i);
} | private static java.lang.String trimRHSWS(@javax.annotation.Nonnull
java.lang.String s) {
int i;
for (i = s.length(); i > 0; --i) {
int c = s.codePointAt((i - 1));
if ((c != ' ') && (c != '\t'))
break;
}
return s.substring(0, i);
} |
public int compareTo(barn1474.AStar.Node other) {
f = (g) + (h);
o = (other.g) + (other.h);
if ((f) < (o))
return -1;
if ((f) > (o))
return 1;
return 0;
} | public int compareTo(barn1474.AStar.Node other) {
double f = (g) + (h);
double o = (other.g) + (other.h);
if (f < o)
return -1;
if (f > o)
return 1;
return 0;
} |
public com.arangodb.entity.DefaultEntity executeBatch() throws com.arangodb.ArangoException {
if (!(this.httpManager.isBatchModeActive())) {
throw new com.arangodb.ArangoException("BatchMode is not active.");
}
java.util.List<com.arangodb.http.BatchPart> callStack = this.httpManager.getCallStack();
... | public com.arangodb.entity.DefaultEntity executeBatch() throws com.arangodb.ArangoException {
if (!(this.httpManager.isBatchModeActive())) {
throw new com.arangodb.ArangoException("BatchMode is not active.");
}
java.util.List<com.arangodb.http.BatchPart> callStack = this.httpManager.getCallStack();
... |
public void testParallel() {
java.lang.Comparable[] array = new java.lang.Comparable[]{ 10 , 1 , 9 , 2 , 8 , 3 , 7 , 4 , 6 , 5 };
de.hsMannheim.informatik.tpe.ss17.repo27.uebung4.aufgabe2.QuickSortParallel qsp = new de.hsMannheim.informatik.tpe.ss17.repo27.uebung4.aufgabe2.QuickSortParallel();
qsp.sort(arra... | public void testParallel() {
java.lang.Comparable[] array = new java.lang.Comparable[]{ 10 , 1 , 9 , 2 , 8 , 3 , 7 , 4 , 6 , 5 };
de.hsMannheim.informatik.tpe.ss17.repo27.uebung4.aufgabe2.QuickSortParallel qsp = new de.hsMannheim.informatik.tpe.ss17.repo27.uebung4.aufgabe2.QuickSortParallel();
qsp.sort(arra... |
public boolean isCorrectSimCard() {
if (!(prefs.getString(AppProperties.SIMCARD, "").isEmpty())) {
android.telephony.TelephonyManager tMgr = ((android.telephony.TelephonyManager) (getSystemService(com.labs.dm.auto_tethering.service.TELEPHONY_SERVICE)));
java.lang.String simCard = tMgr.getSimSerialNu... | private boolean isCorrectSimCard() {
if (!(prefs.getString(AppProperties.SIMCARD, "").isEmpty())) {
android.telephony.TelephonyManager tMgr = ((android.telephony.TelephonyManager) (getSystemService(com.labs.dm.auto_tethering.service.TELEPHONY_SERVICE)));
java.lang.String simCard = tMgr.getSimSerialN... |
public void variationForKey(@android.support.annotation.NonNull
java.lang.String key, @javax.annotation.Nullable
com.facebook.react.bridge.Callback callback) {
java.lang.Object retrievedObject = com.vwo.mobile.VWO.getVariationForKey(key);
if (callback != null) {
if (retrievedObject == null) {
... | public void variationForKey(@android.support.annotation.NonNull
java.lang.String key, @javax.annotation.Nullable
com.facebook.react.bridge.Callback callback) {
java.lang.Object retrievedObject = com.vwo.mobile.VWO.getVariationForKey(key);
if (callback != null) {
if (retrievedObject == null) {
... |
public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
android.content.SharedPreferences sp = android.preference.PreferenceManager.getDefaultSharedPreferences(getActivity());
mUserLearnedDrawer = sp.getBoolean(scip.app.NavigationDrawerFragment.PREF_USER_LEARNED_DRAW... | public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
android.content.SharedPreferences sp = android.preference.PreferenceManager.getDefaultSharedPreferences(getActivity());
mUserLearnedDrawer = true;
if (savedInstanceState != null) {
mCurrentSelectedPo... |
private void checkAnswer(boolean userPressedTrue) {
boolean answerIsTrue = mQuestionBank[mCurrentIndex].isTrueQuestion();
int messageResId = 0;
if (userPressedTrue == answerIsTrue) {
messageResId = R.string.correct_toast;
}else {
messageResId = R.string.incorrect_toast;
}
android... | private void checkAnswer(boolean userPressedTrue) {
boolean answerIsTrue = mQuestionBank[mCurrentIndex].isTrueQuestion();
int messageResId;
if (userPressedTrue == answerIsTrue) {
messageResId = R.string.correct_toast;
}else {
messageResId = R.string.incorrect_toast;
}
android.wid... |
public void createDirectory(java.lang.String dirname) throws java.io.IOException {
int createdCount = 0;
for (java.lang.String path : autosaveworld.utils.FileUtils.splitPath(dirname)) {
if (!(exists(path))) {
createDirectory0(path);
}
enterDirectory0(dirname);
created... | public void createDirectory(java.lang.String dirname) throws java.io.IOException {
int createdCount = 0;
for (java.lang.String path : autosaveworld.utils.FileUtils.splitPath(dirname)) {
if (!(exists(path))) {
createDirectory0(path);
}
enterDirectory0(path);
createdCou... |
public void test_132_ACLCreateFields(edu.umass.cs.gnsclient.client.util.GuidEntry westyEntry) {
try {
edu.umass.cs.gnsclient.client.integrationtests.ServerIntegrationTest.client.fieldUpdate(westyEntry.getGuid(), "environment", "work", westyEntry);
edu.umass.cs.gnsclient.client.integrationtests.Serve... | public void test_132_ACLCreateFields(edu.umass.cs.gnsclient.client.util.GuidEntry westyEntry) {
try {
edu.umass.cs.gnsclient.client.integrationtests.ServerIntegrationTest.client.fieldUpdate(westyEntry.getGuid(), "environment", "work", westyEntry);
edu.umass.cs.gnsclient.client.integrationtests.Serve... |
public void renderTiles(Model.Tile[] tiles) {
screen.clear();
int drawn = 0;
for (Model.Tile tile : tiles) {
if ((tile != null) && (screen.isInsideDisplay(tile, tile.getImagePosition(), tile.getImagePosition()))) {
}
}
java.lang.System.out.println(drawn);
panel.repaint();
} | public void renderTiles(Model.Tile[] tiles) {
screen.clear();
int drawn = 0;
for (Model.Tile tile : tiles) {
if ((tile != null) && (screen.isInsideDisplay(tile))) {
}
}
java.lang.System.out.println(drawn);
panel.repaint();
} |
private void onOK() {
try {
if ((com.doos.commons.registry.RegistryManager.isAutoUpdateActive()) != (autoUpdateEnabledCheckBox.isSelected())) {
com.doos.commons.registry.RegistryManager.setAutoUpdateActive(autoUpdateEnabledCheckBox.isSelected());
}
} catch (com.doos.commons.registry.... | private void onOK() {
try {
if ((com.doos.commons.registry.RegistryManager.isAutoUpdateActive()) != (autoUpdateEnabledCheckBox.isSelected())) {
com.doos.commons.registry.RegistryManager.setAutoUpdateActive(autoUpdateEnabledCheckBox.isSelected());
}
} catch (com.doos.commons.registry.... |
public final void removeSplitzeile(de.aw.monma.gv.SplitZeile sz) {
if (((mSplitBuchung) != null) && ((mSplitBuchung.removeSplitZeile(sz)) == 0)) {
setAmount(sz.getAmount());
setMemo(sz.getMemo());
long catID = sz.getCatID();
setCatID(sz.getCatID());
removeSplittBuchung();
... | public final void removeSplitzeile(de.aw.monma.gv.SplitZeile sz) {
if (((mSplitBuchung) != null) && ((mSplitBuchung.removeSplitZeile(sz)) == 0)) {
setAmount(sz.getAmount());
setMemo(sz.getMemo());
setCatID(sz.getCatID());
removeSplittBuchung();
}
} |
protected java.util.List<org.openflexo.foundation.fml.VirtualModel> _getControlledDocumentVirtualModels(org.openflexo.foundation.fml.ViewPoint viewPoint, org.openflexo.foundation.doc.nature.FMLControlledDocumentVirtualModelNature<MS> vmNature) {
java.util.List<org.openflexo.foundation.fml.VirtualModel> returned = n... | protected java.util.List<org.openflexo.foundation.fml.VirtualModel> _getControlledDocumentVirtualModels(org.openflexo.foundation.fml.ViewPoint viewPoint, org.openflexo.foundation.doc.nature.FMLControlledDocumentVirtualModelNature<MS> vmNature) {
java.util.List<org.openflexo.foundation.fml.VirtualModel> returned = n... |
public void paint(java.awt.Graphics g) {
super.paint(g);
personCounter.Log.add(("Draw is " + (draw)));
if (draw) {
for (int i = 0; i < (videos.size()); i++) {
g.drawImage(videos.get(i), 0, (((defaultImageHeight) * i) + (i * 20)), this);
}
videos.clear();
draw = fa... | public void paint(java.awt.Graphics g) {
super.paint(g);
if (draw) {
for (int i = 0; i < (videos.size()); i++) {
g.drawImage(videos.get(i), 0, (((defaultImageHeight) * i) + (i * 20)), this);
}
videos.clear();
draw = false;
}
} |
private java.lang.String publishHTMLType(int contentId, int index) {
java.lang.StringBuilder sb = new java.lang.StringBuilder();
sb.append(net.masterthought.cucumber.json.Embedded.getExpandAnchor(contentId, "HTML text", index));
sb.append(java.lang.String.format("<span id=\"%s\" style=\"max-width:250px; dis... | private java.lang.String publishHTMLType(java.lang.String contentId, int index) {
java.lang.StringBuilder sb = new java.lang.StringBuilder();
sb.append(net.masterthought.cucumber.json.Embedded.getExpandAnchor(contentId, "HTML text", index));
sb.append(java.lang.String.format("<span id=\"%s\" style=\"max-wid... |
public void onCheckedChanged(com.kiddos.buslightyear.bus.RadioGroup group, int checkId) {
switch (group.getCheckedRadioButtonId()) {
case R.id.rbStation1 :
if ((adapter) != null) {
adapter.updateEstimateTime(com.kiddos.buslightyear.bus.BusRouteInfoFragment.GOBACK_FALSE);
... | public void onCheckedChanged(com.kiddos.buslightyear.bus.RadioGroup group, int checkId) {
switch (group.getCheckedRadioButtonId()) {
case R.id.rbStation1 :
if ((adapter) != null) {
adapter.update(com.kiddos.buslightyear.bus.BusRouteInfoFragment.GOBACK_FALSE);
adap... |
public static org.logbuddy.model.Invocation invocation(java.lang.Object instance, java.lang.reflect.Method method, java.util.List<java.lang.Object> arguments) {
org.logbuddy.LogBuddyException.check((instance != null));
org.logbuddy.LogBuddyException.check((method != null));
org.logbuddy.LogBuddyException.ch... | public static org.logbuddy.model.Invocation invocation(java.lang.Object instance, java.lang.reflect.Method method, java.util.List<java.lang.Object> arguments) {
org.logbuddy.LogBuddyException.check((instance != null));
org.logbuddy.LogBuddyException.check((method != null));
org.logbuddy.LogBuddyException.ch... |
public void activate(int whichToActivate) {
if (((state) == 0) && ((leverAngle) == 40)) {
state = 1;
nextState = 2;
com.hurryup.game.network.GameClient.sendMessage(serialize(true));
}else
if (((state) == 2) && ((connection[connectionValue]) != null)) {
connection[0].a... | public void activate(int whichToActivate) {
if (((state) == 0) && ((leverAngle) == 40)) {
state = 1;
nextState = 2;
com.hurryup.game.network.GameClient.sendMessage(serialize(true));
}else
if (((state) == 2) && ((connection[0]) != null)) {
connection[0].activate(connec... |
private void initGL() {
com.nishu.utils.Shader temp = new com.nishu.utils.Shader("/shaders/chunk.vert", "/shaders/chunk.frag");
shader = new com.nishu.utils.ShaderProgram(temp.getvShader(), temp.getfShader());
temp = new com.nishu.utils.Shader("/shaders/clouds.vert", "/shaders/clouds.frag");
cloudShader... | private void initGL() {
com.nishu.utils.Shader temp = new com.nishu.utils.Shader("/shaders/chunk.vert", "/shaders/chunk.frag");
shader = new com.nishu.utils.ShaderProgram(temp.getvShader(), temp.getfShader());
temp = new com.nishu.utils.Shader("/shaders/clouds.vert", "/shaders/clouds.frag");
cloudShader... |
private void logInAt(java.lang.String languageCode) {
boolean success = logIn(new WikiBot.ContentRep.User(botUsername, languageCode), botPassword);
if (success) {
logInfo(("Logged in at: " + languageCode));
javax.swing.table.TableModel model = wikiTable.getModel();
model.setValueAt(true,... | private void logInAt(java.lang.String languageCode) {
boolean success = logIn(new WikiBot.ContentRep.User(languageCode, botUsername), botPassword);
if (success) {
logInfo(("Logged in at: " + languageCode));
javax.swing.table.TableModel model = wikiTable.getModel();
model.setValueAt(true,... |
public static void main(java.lang.String[] args) throws java.io.IOException, org.json.JSONException {
DataProvider.CharacterDataProvider test = new DataProvider.CharacterDataProvider("WTBsurvivability", "hardcore");
java.lang.System.out.println(Parsers.CharacterParser.getAccountNameFromCharacter(test.dataSource... | public static void main(java.lang.String[] args) throws java.io.IOException, org.json.JSONException {
DataProvider.CharacterDataProvider test = new DataProvider.CharacterDataProvider("WTBsurvivability", "hardcore");
java.lang.System.out.println(Parsers.CharacterParser.getAccountNameFromCharacter(test.dataSource... |
public void reduce(Text key, java.util.Iterator<IntWritable> values, OutputCollector<Text, IntWritable> output, Reporter reporter) throws java.io.IOException {
int count = 0;
if (values.hasNext())
count = values.next().get();
output.collect(key, new IntWritable(count));
} | public void reduce(Text key, java.util.Iterator<IntWritable> values, OutputCollector<Text, IntWritable> output, Reporter reporter) throws java.io.IOException {
int count = 0;
while (values.hasNext()) {
values.next();
count++;
}
output.collect(key, new IntWritable(count));
} |
public void init() throws org.apache.nifi.reporting.InitializationException {
runner = org.apache.nifi.util.TestRunners.newTestRunner(org.apache.nifi.processors.lookup.PutLookupTable.class);
final org.apache.nifi.lookup.InMemoryLookupTableService service = new org.apache.nifi.lookup.InMemoryLookupTableService()... | public void init() throws org.apache.nifi.reporting.InitializationException {
runner = org.apache.nifi.util.TestRunners.newTestRunner(org.apache.nifi.processors.lookup.PutLookupTable.class);
service = new org.apache.nifi.lookup.InMemoryLookupTableService();
runner.addControllerService("service id", service)... |
public float getWidthFromFont(int code) throws java.io.IOException {
if (((getStandard14AFM()) != null) && ((getEncoding()) != null)) {
return getStandard14Width(code);
}
int gid = codeToGID(code);
float width = ttf.getAdvanceWidth(gid);
float unitsPerEM = ttf.getUnitsPerEm();
if (unitsP... | public float getWidthFromFont(int code) throws java.io.IOException {
int gid = codeToGID(code);
float width = ttf.getAdvanceWidth(gid);
float unitsPerEM = ttf.getUnitsPerEm();
if (unitsPerEM != 1000) {
width *= 1000.0F / unitsPerEM;
}
return width;
} |
protected javax.persistence.filter.PageFilter<E> doFilter(javax.persistence.filter.Filter<E> filter, int page, int pageSize) {
try {
int initial = (page - 1) * pageSize;
initial = (initial >= 0) ? initial : 0;
return filterService.filter(filter, initial, pageSize);
} catch (javax.persist... | protected javax.persistence.filter.PageFilter<E> doFilter(javax.persistence.filter.Filter<E> filter, int page, int pageSize) {
try {
if ((this.currentPage) < 1) {
this.currentPage = 1;
}
int initial = (page - 1) * pageSize;
initial = (initial >= 0) ? initial : 0;
... |
public static java.util.ArrayList<java.lang.String> getWordLadderDFS(java.lang.String start, java.lang.String end) {
java.util.Set<java.lang.String> dict = assignment3.Main.makeDictionary();
assignment3.Helper test = new assignment3.Helper(dict);
java.util.ArrayList<java.lang.String> ladder = new java.util.... | public static java.util.ArrayList<java.lang.String> getWordLadderDFS(java.lang.String start, java.lang.String end) {
java.util.Set<java.lang.String> dict = assignment3.Main.makeDictionary();
assignment3.Helper test = new assignment3.Helper(dict);
java.util.ArrayList<java.lang.String> ladder = new java.util.... |
public void initialize(java.net.URL location, java.util.ResourceBundle resources) {
clientID = SpecialistDeailsController.clientID;
urgencyCom.setItems(urgencyList);
client.control.Request request = new client.control.Request(Command.GET_EXAMINATION_TYPE, null);
try {
ClientConnectionController.... | public void initialize(java.net.URL location, java.util.ResourceBundle resources) {
urgencyCom.setItems(urgencyList);
client.control.Request request = new client.control.Request(Command.GET_EXAMINATION_TYPE, null);
try {
ClientConnectionController.clientConnect.controller = this;
ClientConne... |
public void send(byte[] o) {
uk.ac.imperial.lsds.seepworker.core.output.OutputBuffer outB = ob;
if (SINGLE_SEND_NOT_DEFINED) {
outB = this.router.route(outputBuffers);
}
boolean completed = outB.write(o);
if (completed) {
eAPI.readyForWrite(outB.id());
}
} | public void send(byte[] o) {
uk.ac.imperial.lsds.seepworker.core.output.OutputBuffer outB = ob;
if (SINGLE_SEND_NOT_DEFINED) {
outB = this.router.route(outputBuffers);
}
boolean completed = true;
while (completed) {
completed = outB.write(o);
if (completed) {
eAPI... |
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_show_edit_place);
com.gabm.fancyplaces.ui.ShowEditPlace.curAppContext = ((com.gabm.fancyplaces.FancyPlacesApplication) (getApplicationContext()));
updateElementIDs();
... | protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_show_edit_place);
com.gabm.fancyplaces.ui.ShowEditPlace.curAppContext = ((com.gabm.fancyplaces.FancyPlacesApplication) (getApplicationContext()));
updateElementIDs();
... |
public void worked(int workIncrement, int remainingWork) {
if (verbose) {
java.lang.String file = (remainingWork == 1) ? "file" : "files";
logger.info((((remainingWork + " ") + file) + " left."));
(count)++;
}
} | public void worked(int workIncrement, int remainingWork) {
if (verbose) {
java.lang.String file = (remainingWork == 1) ? "file" : "files";
logger.info((((remainingWork + " ") + file) + " left."));
count += 1;
}
} |
public void findUsers() {
userIds = new java.util.ArrayList<>();
java.util.List<ba.aljovic.amer.application.database.entities.userratingsjob.ImdbUser> users = repository.findUsersByRange(fromId, toId);
long start = java.lang.System.nanoTime();
userIds.addAll(users.stream().map(ImdbUser::getId).collect(j... | public void findUsers() {
userIds = new java.util.ArrayList<>();
java.util.List<ba.aljovic.amer.application.database.entities.userratingsjob.ImdbUser> users = repository.findUsersByRange(fromId, toId);
userIds.addAll(users.stream().map(ImdbUser::getId).collect(java.util.stream.Collectors.toList()));
} |
public static boolean acknowledgeTransaction(db.DbConnect db, hack.humanAtm.TransactionPOJO transactionPOJO) {
hack.humanAtm.PaymentSuccessMeta psm = db.processTransactionSuccess(transactionPOJO.getTransactionId());
try {
hack.humanAtm.Utils.sendSuccessNotifications(psm.getGcmId(), psm.getAmount());
... | public static boolean acknowledgeTransaction(db.DbConnect db, hack.humanAtm.TransactionPOJO transactionPOJO) {
hack.humanAtm.PaymentSuccessMeta psm = db.processTransactionSuccess(transactionPOJO);
try {
hack.humanAtm.Utils.sendSuccessNotifications(psm.getGcmId(), psm.getAmount());
} catch (java.io.I... |
public void simulate(com.nikonhacker.disassembly.tx.Statement statement, com.nikonhacker.disassembly.tx.StatementContext context) throws com.nikonhacker.emu.EmulationException {
context.memory.store16(((context.cpuState.getReg(TxCPUState.FP)) + (((statement.imm) << 16) >> 15)), ((context.cpuState.getReg(statement.r... | public void simulate(com.nikonhacker.disassembly.tx.Statement statement, com.nikonhacker.disassembly.tx.StatementContext context) throws com.nikonhacker.emu.EmulationException {
context.memory.store16(((context.cpuState.getReg(TxCPUState.FP)) + (((statement.imm) << 16) >> 16)), ((context.cpuState.getReg(statement.r... |
protected io.datakernel.eventloop.SocketConnection createConnection(java.nio.channels.SocketChannel socketChannel) {
assert eventloop.inEventloopThread();
io.datakernel.eventloop.DatakernelSslEngine engine = null;
if ((sslContext) != null) {
javax.net.ssl.SSLEngine ssl = sslContext.createSSLEngine()... | protected io.datakernel.eventloop.SocketConnection createConnection(java.nio.channels.SocketChannel socketChannel) {
assert eventloop.inEventloopThread();
io.datakernel.eventloop.DatakernelSslEngine engine = null;
if ((sslContext) != null) {
javax.net.ssl.SSLEngine ssl = sslContext.createSSLEngine()... |
private void loadPlayers(boundary.SQL sql) throws java.sql.SQLException {
for (int i = 0; i < (sql.countPlayers()); i++) {
players[i] = new entity.Player(sql.getPlayerName((i + 1)), sql.getVehicleColour((i + 1)), sql.getVehicleType((i + 1)), sql);
sql.setBalance(players[i]);
}
} | private void loadPlayers() throws java.sql.SQLException {
players = new entity.Player[sql.countPlayers()];
for (int i = 0; i < (players.length); i++) {
players[i] = new entity.Player(sql.getPlayerName((i + 1)), sql.getVehicleColour((i + 1)), sql.getVehicleType((i + 1)), sql);
sql.setBalance(play... |
public static org.apache.twill.filesystem.Location getLocationFromAbsolutePath(org.apache.twill.filesystem.LocationFactory locationFactory, java.lang.String absolutePath) {
java.net.URI basePathURI = java.net.URI.create(locationFactory.create("").toURI().getPath());
java.net.URI locationURI = java.net.URI.creat... | public static org.apache.twill.filesystem.Location getLocationFromAbsolutePath(org.apache.twill.filesystem.LocationFactory locationFactory, java.lang.String absolutePath) {
java.net.URI basePathURI = java.net.URI.create(locationFactory.create("").toURI().getPath());
java.net.URI locationURI = java.net.URI.creat... |
public boolean checkReadPermission(java.lang.String user, java.lang.String contextName, int securityLevel) {
if (((user.equals(org.opends.server.snmp.SNMPUserAcl.ADMIN_USER)) && (contextName.equals("null"))) && (checkSecurityLevel(securityLevel))) {
return true;
}
if (((checkReadPermission(user)) &&... | public boolean checkReadPermission(java.lang.String user, java.lang.String contextName, int securityLevel) {
if (((user.equals(org.opends.server.snmp.SNMPUserAcl.ADMIN_USER)) && (contextName.equals("null"))) && (checkSecurityLevel(securityLevel))) {
return true;
}
return ((checkReadPermission(user))... |
public neo4j.driver.reactive.interfaces.RecordChangeSetListener registerQuery(java.lang.String queryName, java.lang.String querySpecification) {
if (querySpecifications.containsKey(queryName)) {
throw new java.lang.IllegalStateException((("Query " + queryName) + " is already registered."));
}
queryS... | public neo4j.driver.reactive.interfaces.RecordChangeSetListener registerQuery(java.lang.String queryName, java.lang.String querySpecification) {
if (querySpecifications.containsKey(queryName)) {
throw new java.lang.IllegalStateException((("Query " + queryName) + " is already registered."));
}
queryS... |
public void addButton(java.lang.String buttonText, java.lang.String buttonLabel, java.lang.Runnable task) {
javax.swing.JButton button = new javax.swing.JButton(buttonLabel);
button.addActionListener(( e) -> {
java.util.concurrent.Executors.newSingleThreadExecutor().execute(task);
});
this.addIt... | public javax.swing.JButton addButton(java.lang.String buttonText, java.lang.String buttonLabel, java.lang.Runnable task) {
javax.swing.JButton button = new javax.swing.JButton(buttonLabel);
button.addActionListener(( e) -> {
java.util.concurrent.Executors.newSingleThreadExecutor().execute(task);
});... |
public void onCheckedChanged(android.widget.CompoundButton buttonView, boolean isChecked) {
java.lang.Long itemId = ((java.lang.Long) (viewHolder.itemView.getTag()));
if (itemsToDelete.contains(itemId)) {
itemsToDelete.remove(itemId);
}else {
itemsToDelete.add(itemId);
}
} | public void onCheckedChanged(android.widget.CompoundButton buttonView, boolean isChecked) {
java.lang.Long itemId = ((java.lang.Long) (viewHolder.itemView.getTag()));
if (isChecked) {
if (!(itemsToDelete.contains(itemId))) {
itemsToDelete.add(itemId);
}
}else {
if (itemsT... |
private static boolean promptShutDownInput() {
java.lang.String consoleInput;
java.io.BufferedReader consoleIn = new java.io.BufferedReader(new java.io.InputStreamReader(java.lang.System.in));
boolean isShutDown = false;
try {
java.lang.System.out.println("Please enter Q/q to terminate.");
... | private static boolean promptShutDownInput(java.io.BufferedReader consoleIn) {
java.lang.String consoleInput;
boolean isShutDown = false;
try {
java.lang.System.out.println("Please enter Q/q to terminate.");
consoleInput = consoleIn.readLine();
if ((consoleInput.equals("q")) || (cons... |
public static java.util.LinkedList<utility.Pair> descendingThreshold(java.util.LinkedList<java.lang.Integer> terminalOrder) {
java.util.LinkedList<utility.Pair> order = new java.util.LinkedList<>();
for (int i = 0; i < (terminalOrder.size()); i++) {
order.add(new utility.Pair(terminalOrder.get(i), libra... | public static java.util.LinkedList<utility.Pair> descendingThreshold(java.util.LinkedList<java.lang.Integer> terminalOrder, double b) {
java.util.LinkedList<utility.Pair> order = new java.util.LinkedList<>();
for (int i = 0; i < (terminalOrder.size()); i++) {
order.add(new utility.Pair(terminalOrder.get... |
private void checkTrap(com.jkjk.GameWorld.MMClient client) {
bodyToRemove = trapToRemove.poll();
if ((bodyToRemove) != null) {
trapList.remove(bodyToRemove.getPosition());
bodyToRemove.setActive(false);
bodyToRemove.setTransform(0, 0, 0);
client.removeTrapLocation(bodyToRemove.ge... | private void checkTrap(com.jkjk.GameWorld.MMClient client) {
bodyToRemove = trapToRemove.poll();
if ((bodyToRemove) != null) {
trapList.remove(bodyToRemove.getPosition());
client.removeTrapLocation(bodyToRemove.getPosition().x, bodyToRemove.getPosition().y);
bodyToRemove.setActive(false)... |
protected void registerWidget(org.uva.taxfree.ql.gui.widgets.Widget widget) {
widget.updateStyle(mStyle);
for (org.uva.taxfree.qls.GuiPage page : mPages) {
if (page.contains(widget.getId())) {
java.lang.String sectionName = mStyle.getSectionName(widget.getId());
page.register(sec... | protected void registerWidget(org.uva.taxfree.ql.gui.widgets.Widget widget) {
widget.updateStyle(mStyle);
java.lang.String sectionName = mStyle.getSectionName(widget.getId());
for (org.uva.taxfree.qls.GuiPage page : mPages) {
if (page.contains(sectionName)) {
page.register(sectionName, w... |
private void parseDocument() {
org.jsoup.nodes.Document d = org.jsoup.Jsoup.parse(html);
java.lang.String text = d.body().text();
java.lang.String[] tokens = text.split(" ");
for (java.lang.String t : tokens) {
addToInvertedIndex(t);
}
pushInvertedIndex();
} | public void parseDocument() {
org.jsoup.nodes.Document d = org.jsoup.Jsoup.parse(html);
java.lang.String text = d.body().text();
java.lang.String[] tokens = text.split(" ");
for (java.lang.String t : tokens) {
addToInvertedIndex(t);
}
pushInvertedIndex();
} |
private static com.hartwig.healthchecks.common.report.BaseDataReport proportionOfReadsUsed(@org.jetbrains.annotations.NotNull
final java.lang.String sampleId, final long totalSequences, @org.jetbrains.annotations.NotNull
final java.util.List<com.hartwig.healthchecks.boggs.flagstatreader.FlagStats> passed) {
final c... | private static com.hartwig.healthchecks.common.report.BaseDataReport proportionOfReadsUsed(@org.jetbrains.annotations.NotNull
final java.lang.String sampleId, final long totalSequences, @org.jetbrains.annotations.NotNull
final java.util.List<com.hartwig.healthchecks.boggs.flagstatreader.FlagStats> passed) {
final c... |
public int compare(com.inhavok.fallen.utility.Pathfinder.Node o1, com.inhavok.fallen.utility.Pathfinder.Node o2) {
if ((o1.getF()) < (o2.getF())) {
return 1;
}else
if ((o1.getF()) > (o2.getF())) {
return 2;
}
return 0;
} | public int compare(com.inhavok.fallen.utility.Pathfinder.Node o1, com.inhavok.fallen.utility.Pathfinder.Node o2) {
if ((o1.getF()) < (o2.getF())) {
return -1;
}else
if ((o1.getF()) > (o2.getF())) {
return 1;
}
return 0;
} |
private void get(se.kth.id2203.jbstore.system.network.NetMsg netMsg) {
reader = netMsg.getSource();
rid = (rid) + 1;
acks.put(rid, 0);
readlist.put(rid, new java.util.HashMap<>());
readval.put(rid, ((java.lang.Long) (netMsg.body)));
reading.put(rid, true);
broadcast(NetMsg.READ, rid);
} | private void get(se.kth.id2203.jbstore.system.network.NetMsg netMsg) {
rid = (rid) + 1;
acks.put(rid, 0);
readlist.put(rid, new java.util.HashMap<>());
readval.put(rid, ((java.lang.Long) (netMsg.body)));
reading.put(rid, true);
reader.put(rid, netMsg.getSource());
broadcast(NetMsg.READ, rid)... |
public java.lang.String seekAudio(@org.springframework.web.bind.annotation.RequestBody
java.lang.String searchText, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request) {
if ((searchText != null) && ((searchText.length()) > 0)) {
com.soundconnect.Services.VKAudioService service... | public java.lang.String seekAudio(@org.springframework.web.bind.annotation.RequestBody
java.lang.String searchText, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request) {
if ((searchText != null) && ((searchText.length()) > 0)) {
try {
java.util.List<com.soundconnec... |
public static void testUpdateAccount(postit.server.controller.DatabaseController db, postit.server.controller.AccountHandler ah, java.lang.String username, java.lang.String pwd, java.lang.String email, java.lang.String fName, java.lang.String lName) {
boolean res = ah.updateAccount(db, username, pwd, email, fName, ... | public static void testUpdateAccount(postit.server.controller.AccountHandler ah, java.lang.String username, java.lang.String pwd, java.lang.String email, java.lang.String fName, java.lang.String lName) {
boolean res = ah.updateAccount(username, pwd, email, fName, lName);
java.lang.System.out.printf("Updating ac... |
public java.lang.String computeURL() {
com.google.common.base.Optional<gamercompanion.src.dataObjects.credentials.WebCredentials> credentials = gamercompanion.src.dataOperator.CredentialsOperator.credentialsForWebsite(gamercompanion.src.synchronizer.MetascoreAllGames.WEBSITE);
if (!(credentials.isPresent())) {
... | public java.lang.String computeURL() {
com.google.common.base.Optional<gamercompanion.src.dataObjects.credentials.WebCredentials> credentials = gamercompanion.src.dataOperator.CredentialsOperator.credentialsForWebsite(gamercompanion.src.synchronizer.MetascoreAllGames.WEBSITE);
if (!(credentials.isPresent())) {
... |
public java.lang.String addDev(objects.Device dev) {
java.sql.PreparedStatement stmt = null;
java.sql.Connection conn = null;
java.lang.String sql = "INSERT INTO network " + "VALUES (?, '?', '?')";
try {
conn = dao.DeviceDao.getConnection();
} catch (java.sql.SQLException e) {
return... | public java.lang.String addDev(objects.Device dev) {
java.sql.PreparedStatement stmt = null;
java.sql.Connection conn = null;
java.lang.String sql = "INSERT INTO network " + "VALUES (?, '?', '?')";
try {
conn = getConnection();
} catch (java.sql.SQLException e) {
return message;
... |
public void givenSourceObjectAndDestObject_whenMapsSameNameFieldsCorrectly_thenCorrect() {
com.baeldung.dozer.Source source = new com.baeldung.dozer.Source("Baeldung", 10);
com.baeldung.dozer.Dest dest = new com.baeldung.dozer.Dest();
mapper.map(source, dest);
org.junit.Assert.assertEquals(dest.getName(... | public void givenSourceObjectAndDestObject_whenMapsSameNameFieldsCorrectly_thenCorrect() {
com.baeldung.dozer.Source source = new com.baeldung.dozer.Source("Baeldung", 10);
com.baeldung.dozer.Dest dest = new com.baeldung.dozer.Dest();
mapper.map(source, dest);
assertEquals(dest.getName(), "Baeldung");
... |
protected java.util.HashMap<java.lang.String, com.edsapps.weather.model.ForecastList> doInBackground(java.lang.Void... string) {
java.util.HashMap<java.lang.String, com.edsapps.weather.model.ForecastList> forecastMap = com.edsapps.weather.utility.FeedHelper.getForecastDays();
if (forecastMap == null) {
... | protected java.util.HashMap<java.lang.String, com.edsapps.weather.model.ForecastList> doInBackground(java.lang.Void... string) {
java.util.HashMap<java.lang.String, com.edsapps.weather.model.ForecastList> forecastMap = com.edsapps.weather.utility.FeedHelper.getForecastDays();
if (forecastMap == null) {
... |
public boolean putPiece(int x, int y) {
if (turnPlayer) {
board.setValue(x, y, p1.getBrand());
}else {
board.setValue(x, y, p2.getBrand());
}
board.showBoard();
winner = board.validateGame();
return winner;
} | public boolean putPiece(int x, int y) {
if (turnPlayer) {
board.setValue(x, y, p1.getBrand());
}else {
board.setValue(x, y, p2.getBrand());
}
turnPlayer = !(turnPlayer);
board.showBoard();
winner = board.validateGame();
return winner;
} |
public org.egov.workflow.web.contract.PositionHierarchyResponse getByPositionByComplaintTypeAndFromPosition(final java.lang.Long fromPosition, final java.lang.String serviceCode, final java.lang.String tenantId) {
org.egov.workflow.web.contract.RequestInfoWrapper wrapper = org.egov.workflow.web.contract.RequestInfo... | public org.egov.workflow.web.contract.PositionHierarchyResponse getByPositionByComplaintTypeAndFromPosition(final java.lang.Long fromPosition, final java.lang.String serviceCode, final java.lang.String tenantId) {
org.egov.workflow.web.contract.RequestInfoWrapper wrapper = org.egov.workflow.web.contract.RequestInfo... |
public traveller.subsector.Subsector getJumpWorlds(traveller.subsector.Location worldLoc, int jumpNumber) {
traveller.subsector.Location[] locs = getJumpWorldsLocations(worldLoc, jumpNumber);
traveller.subsector.Subsector worldList = new traveller.subsector.Subsector(("JumpList" + jumpNumber));
for (travell... | public traveller.subsector.Subsector getJumpWorlds(traveller.subsector.Location worldLoc, int jumpNumber) {
traveller.subsector.Location[] locs = getJumpWorldsLocations(worldLoc, jumpNumber);
traveller.subsector.Subsector worldList = new traveller.subsector.Subsector();
for (traveller.subsector.Location loc... |
public void testRemoveEgressInterface() {
testRouteAddToNoVlan();
org.onosproject.net.intent.MultiPointToSinglePointIntent removedIntent = createIntentToThreeSrcOneTwo(org.onosproject.sdnip.SdnIpFibTest.PREFIX1);
org.easymock.EasyMock.reset(intentSynchronizer);
intentSynchronizer.withdraw(org.onosprojec... | public void testRemoveEgressInterface() {
testRouteAddToNoVlan();
org.onosproject.net.intent.MultiPointToSinglePointIntent removedIntent = createIntentToThreeSrcOneTwo(org.onosproject.sdnip.SdnIpFibTest.PREFIX1);
reset(intentSynchronizer);
intentSynchronizer.withdraw(org.onosproject.routing.TestIntentSe... |
public boolean canBlockStay(net.minecraft.world.World worldIn, com.bioxx.tfc2.blocks.BlockPos pos, net.minecraft.block.state.IBlockState state) {
com.bioxx.tfc2.blocks.BlockPos down = pos.down();
net.minecraft.block.state.IBlockState soil = worldIn.getBlockState(down);
if ((state.getBlock()) != (this))
... | public boolean canBlockStay(net.minecraft.world.World worldIn, com.bioxx.tfc2.blocks.BlockPos pos, net.minecraft.block.state.IBlockState state) {
com.bioxx.tfc2.blocks.BlockPos down = pos.down();
net.minecraft.block.state.IBlockState soil = worldIn.getBlockState(down);
if ((state.getBlock()) != (this))
... |
public static java.util.List<java.lang.Object[]> data() {
return java.util.Arrays.asList(new java.lang.Object[][]{ new java.lang.Object[]{ "ba" , "" , "gThreeNodesSixEdges.gv" } , new java.lang.Object[]{ "b" , "" , "gFourNodesEightEdges.gv" } , new java.lang.Object[]{ "ca" , "" , "gFourNodesEightEdgesABC.gv" } , ne... | public static java.util.List<java.lang.Object[]> data() {
return java.util.Arrays.asList(new java.lang.Object[][]{ new java.lang.Object[]{ "" , "gThreeNodesSixEdges.gv" } , new java.lang.Object[]{ "" , "gFourNodesEightEdges.gv" } , new java.lang.Object[]{ "" , "gFourNodesEightEdgesABC.gv" } , new java.lang.Object[]... |
private boolean isDateSearchCriteriaValid() {
java.lang.StringBuffer message = new java.lang.StringBuffer();
boolean isValid = true;
if (((startCreationDate) == null) || ((stopCreationDate) == null)) {
message.append("Earliest Date and Most Recent Date should not be null");
isValid = false;
... | private boolean isDateSearchCriteriaValid() {
java.lang.StringBuffer message = new java.lang.StringBuffer();
boolean isValid = true;
if (((startCreationDate) == null) || ((stopCreationDate) == null)) {
message.append("Earliest Date and Most Recent Date should not be null");
isValid = false;
... |
public java.lang.String getUrlName() {
java.lang.String url = globalConfig.getSlackOutgoingWebhookURL();
if ((url == null) || (url.equals("")))
return java.util.UUID.randomUUID().toString().replaceAll("-", "");
return "/" + url;
} | public java.lang.String getUrlName() {
java.lang.String url = globalConfig.getSlackOutgoingWebhookURL();
if ((url == null) || (url.equals("")))
return java.util.UUID.randomUUID().toString().replaceAll("-", "");
return url;
} |
private void attackPhase() {
attackerDriver.main(attackerList);
playerHealth -= attackerDriver.endPathcheck(attackerList);
if ((millis()) >= (reloadTime)) {
towerDriver.hitDetection(attackerList);
reloadTime = (millis()) + (towerFireDelay);
playerScore += towerDriver.income(attackerL... | private void attackPhase() {
attackerDriver.main(attackerList);
playerHealth -= attackerDriver.endPathcheck(attackerList);
if ((millis()) >= (reloadTime)) {
towerDriver.hitDetection(attackerList);
reloadTime = (millis()) + (towerFireDelay);
playerScore += towerDriver.income(attackerL... |
public void set(boolean val) {
if (val) {
try {
cf.flight.set(true);
} catch (haven.GLSettings e) {
getparent(haven.GameUI.class).error(e.getMessage());
return ;
}
}else {
cf.flight.set(false);
}
a = val;
cf.dirty = true;
} | public void set(boolean val) {
if (val) {
try {
cf.flight.set(true);
} catch (haven.GLSettings e) {
error(e.getMessage());
return ;
}
}else {
cf.flight.set(false);
}
a = val;
cf.dirty = true;
} |
public android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent) {
if ((inflater) == null)
inflater = ((android.view.LayoutInflater) (context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)));
if (convertView == null)
convertView = inflater.infl... | public android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent) {
if ((inflater) == null)
inflater = ((android.view.LayoutInflater) (context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)));
if (convertView == null)
convertView = inflater.infl... |
public static java.lang.String extractPersistentId(java.net.URI objURI) {
java.lang.String URIstr = objURI.toString();
java.util.regex.Pattern r = java.util.regex.Pattern.compile(org.sbolstandard.core2.URIcompliance.genericURIpattern1);
java.util.regex.Matcher m = r.matcher(URIstr);
if (m.matches()) {
... | public static java.lang.String extractPersistentId(java.net.URI objURI) {
java.lang.String URIstr = objURI.toString();
java.util.regex.Pattern r = java.util.regex.Pattern.compile(org.sbolstandard.core2.URIcompliance.genericURIpattern1);
java.util.regex.Matcher m = r.matcher(URIstr);
if (m.matches()) {
... |
public android.support.v4.content.Loader<android.database.Cursor> onCreateLoader(int id, android.os.Bundle args) {
java.lang.String sortOrder = com.udacity.movie.utils.Utility.getPreferredSortOrder(getActivity());
java.lang.String orderKey = com.udacity.movie.utils.Utility.getOrderUrlKey(getActivity());
jav... | public android.support.v4.content.Loader<android.database.Cursor> onCreateLoader(int id, android.os.Bundle args) {
java.lang.String sortOrder = com.udacity.movie.utils.Utility.getPreferredSortOrder(getActivity());
java.lang.String orderKey = com.udacity.movie.utils.Utility.getOrderUrlKey(getActivity());
jav... |
public boolean foundBullet() {
boolean found = false;
if (((getAgentX()) == (edu.cpp.cs.cs141.Project.GameEngine.bldg.getBulletX())) && ((getAgentY()) == (edu.cpp.cs.cs141.Project.GameEngine.bldg.getBulletY())))
found = true;
edu.cpp.cs.cs141.Project.GameEngine.bldg.getGun().reload();
retur... | public boolean foundBullet() {
boolean found = false;
if (((getAgentX()) == (edu.cpp.cs.cs141.Project.GameEngine.bldg.getBulletX())) && ((getAgentY()) == (edu.cpp.cs.cs141.Project.GameEngine.bldg.getBulletY()))) {
found = true;
edu.cpp.cs.cs141.Project.GameEngine.bldg.getGun().reload();
}
... |
public gen.Klass visitParameterList(@org.antlr.v4.runtime.misc.NotNull
gen.MinijavaParser.ParameterListContext ctx) {
java.util.List<gen.Klass> parameterList = new java.util.ArrayList<gen.Klass>();
int paramCount = 0;
for (gen.MinijavaParser.ParameterContext paramCtx : ctx.parameter().subList(1, ctx.paramet... | public gen.Klass visitParameterList(@org.antlr.v4.runtime.misc.NotNull
gen.MinijavaParser.ParameterListContext ctx) {
java.util.List<gen.Klass> parameterList = new java.util.ArrayList<gen.Klass>();
int paramCount = 0;
for (gen.MinijavaParser.ParameterContext paramCtx : ctx.parameter()) {
ctx.setPath... |
public void onComplete(@android.support.annotation.NonNull
com.google.android.gms.tasks.Task<java.lang.Void> task) {
android.util.Log.i("Comp", "Now Completed");
dialog.dismiss();
android.widget.Toast.makeText(getContext(), "Course Added successfully", Toast.LENGTH_SHORT).show();
sendNotification(ce);
... | public void onComplete(@android.support.annotation.NonNull
com.google.android.gms.tasks.Task<java.lang.Void> task) {
android.util.Log.i("Comp", "Now Completed");
dialog.dismiss();
android.widget.Toast.makeText(getContext(), "Course Added successfully", Toast.LENGTH_SHORT).show();
if (com.cs442.team4.tah... |
public static javax.ws.rs.core.Response validationAdmin(java.lang.String sessionId) {
javax.ws.rs.core.Response result = javax.ws.rs.core.Response.status(401).build();
com.baremind.data.User admin = com.baremind.utils.JPAEntry.getLoginUser(sessionId);
if ((admin != null) && (admin.getIsAdministrator())) {
... | public static javax.ws.rs.core.Response validationAdmin(java.lang.String sessionId) {
javax.ws.rs.core.Response result = javax.ws.rs.core.Response.status(401).build();
com.baremind.data.User admin = com.baremind.utils.JPAEntry.getLoginUser(sessionId);
if (((admin != null) && ((admin.getIsAdministrator()) !=... |
public void testBug923882asWriterWithEmptyCharArray() throws java.lang.Exception {
java.io.StringWriter buffer = new java.io.StringWriter();
org.neoxml.io.HTMLWriter writer = new org.neoxml.io.HTMLWriter(buffer, org.neoxml.io.OutputFormat.createPrettyPrint());
writer.characters("wor".toCharArray(), 0, 3);
... | public void testBug923882asWriterWithEmptyCharArray() throws java.lang.Exception {
java.io.StringWriter buffer = new java.io.StringWriter();
try (org.neoxml.io.HTMLWriter writer = new org.neoxml.io.HTMLWriter(buffer, org.neoxml.io.OutputFormat.createPrettyPrint())) {
writer.characters("wor".toCharArray(... |
public void onFocusChange(android.view.View v, boolean hasFocus) {
if ((floatingLabelEnabled) && (highlightFloatingLabel)) {
if (hasFocus) {
if (getLabelFocusAnimator().isStarted()) {
getLabelFocusAnimator().reverse();
}else {
getLabelFocusAnimator().s... | public void onFocusChange(android.view.View v, boolean hasFocus) {
if ((floatingLabelEnabled) && (highlightFloatingLabel)) {
if (hasFocus) {
if (getLabelFocusAnimator().isStarted()) {
getLabelFocusAnimator().reverse();
}else {
getLabelFocusAnimator().s... |
public boolean onQueryTextChange(java.lang.String newText) {
if (android.text.TextUtils.isEmpty(newText)) {
mNoteList = mDbHelper.queryAll();
sortList(mNoteList);
mAdapter.notifyDataSetChanged();
}else {
mNoteList = mDbHelper.queryName(newText);
sortList(mNoteList);
... | public boolean onQueryTextChange(java.lang.String newText) {
if (android.text.TextUtils.isEmpty(newText)) {
mNoteList = mDbHelper.queryAll();
}else {
mNoteList = mDbHelper.queryName(newText);
}
sortList(mNoteList);
mAdapter.notifyDataSetChanged();
return true;
} |
public void runInvokerLoop() {
while (!(stopLoop)) {
java.lang.String userInput = null;
try {
userInput = readUserInput();
} catch (java.io.IOException e) {
e.printStackTrace();
}
if (userInput == null) {
stopLoop = true;
}
... | public void runInvokerLoop() {
while (!(stopLoop)) {
java.lang.String userInput = null;
try {
userInput = readUserInput();
} catch (java.io.IOException e) {
e.printStackTrace();
}
if (userInput == null) {
stopLoop = true;
break;... |
private void popup(java.lang.String name) {
clickFolder("Home");
delay();
clickFolder("repair");
delay();
clickProcessModel("repairExample");
delay();
clickMenuBar("Discover");
delay();
clickMenuItem("Extract Variability Specification");
delay();
assertTrue(isElementPresent(o... | private void popup(java.lang.String name) {
clickFolder("Home");
delay();
clickFolder("repair");
delay();
clickProcessModel(name);
delay();
clickMenuBar("Discover");
delay();
clickMenuItem("Extract Variability Specification");
delay();
assertTrue(isElementPresent(org.apromore... |
public static com.airmap.airmapsdk.networking.services.AirMap init(java.lang.String apiKey, java.lang.String authToken, boolean pinCertificates) {
if (com.google.common.base.Strings.isNullOrEmpty(apiKey)) {
throw new java.lang.IllegalArgumentException("apiKey can't be null or empty");
}
authToken = ... | public static com.airmap.airmapsdk.networking.services.AirMap init(java.lang.String apiKey, java.lang.String authToken, boolean pinCertificates) {
if (com.google.common.base.Strings.isNullOrEmpty(apiKey)) {
throw new java.lang.IllegalArgumentException("apiKey can't be null or empty");
}
authToken = ... |
public static void simplify(wyil.util.type.Automaton automaton) {
boolean changed = true;
while (changed) {
changed = false;
changed |= wyil.util.type.TypeAlgorithms.simplifyContractives(automaton);
for (int i = 0; i != (automaton.size()); ++i) {
changed |= wyil.util.type.Typ... | public static void simplify(wyil.util.type.Automaton automaton) {
boolean changed = true;
while (changed) {
changed = false;
for (int i = 0; i != (automaton.size()); ++i) {
changed |= wyil.util.type.TypeAlgorithms.simplify(i, automaton);
}
}
} |
public java.io.File resolve(java.lang.String location) {
try {
java.net.URL url = new java.net.URL(location);
java.io.File download = download(url);
return extractArchive(download);
} catch (java.net.MalformedURLException e) {
java.io.File file = new java.io.File(location);
... | public java.io.File resolve(java.lang.String location) {
try {
java.net.URL url = new java.net.URL(location);
java.io.File download = download(url);
if (download != null) {
return extractArchive(download);
}
} catch (java.net.MalformedURLException e) {
java.io... |
public org.apache.poi.ss.formula.eval.ValueEval evaluate(int srcRowIndex, int srcColumnIndex, org.apache.poi.ss.formula.eval.ValueEval arg0, org.apache.poi.ss.formula.eval.ValueEval arg1) {
double result;
try {
double d0 = org.apache.poi.ss.formula.functions.NumericFunction.singleOperandEvaluate(arg0, s... | public org.apache.poi.ss.formula.eval.ValueEval evaluate(int srcRowIndex, int srcColumnIndex, org.apache.poi.ss.formula.eval.ValueEval arg0, org.apache.poi.ss.formula.eval.ValueEval arg1) {
try {
double d0 = org.apache.poi.ss.formula.functions.NumericFunction.singleOperandEvaluate(arg0, srcRowIndex, srcColu... |
public void switchState(final boolean showAnimation) {
if (showAnimation) {
final int childCount = getChildCount();
for (int i = 1; i < childCount; i++) {
bindChildAnimation(getChildAt(i));
}
bindCenterViewAnimation(getChildAt(0));
}
mExpanded = !(mExpanded);
} | public void switchState(final boolean showAnimation) {
mExpanded = !(mExpanded);
if (showAnimation) {
final int childCount = getChildCount();
for (int i = 1; i < childCount; i++) {
bindChildAnimation(getChildAt(i));
}
bindCenterViewAnimation(getChildAt(0));
}
} |
public void fail(java.lang.Object messageId) {
final org.apache.storm.kafka.spout.KafkaSpoutMessageId msgId = ((org.apache.storm.kafka.spout.KafkaSpoutMessageId) (messageId));
if (!(emitted.contains(msgId))) {
org.apache.storm.kafka.spout.KafkaSpout.LOG.debug(("Received fail for tuple this spout is no l... | public void fail(java.lang.Object messageId) {
final org.apache.storm.kafka.spout.KafkaSpoutMessageId msgId = ((org.apache.storm.kafka.spout.KafkaSpoutMessageId) (messageId));
if (!(emitted.contains(msgId))) {
org.apache.storm.kafka.spout.KafkaSpout.LOG.debug(("Received fail for tuple this spout is no l... |
public java.lang.String ReaderList(org.springframework.ui.Model model) {
java.util.List<com.softserve.edu.entity.Reader> readers = readerService.findAll();
model.addAttribute("reader", new com.softserve.edu.entity.Reader());
model.addAttribute("readerList", readers);
model.addAttribute("exist", exist);
... | public java.lang.String ReaderList(org.springframework.ui.Model model) {
java.util.List<com.softserve.edu.entity.Reader> readers = readerService.findAll();
model.addAttribute("reader", new com.softserve.edu.entity.Reader());
model.addAttribute("readerList", readers);
model.addAttribute("exist", exist);
... |
public void testSaveDocument() {
for (int i = 0; i < 2; i++) {
javax.ws.rs.core.Response document = subject.saveDocument("valid-id", "tag1,tag2", false, "Hello World");
org.junit.Assert.assertNotNull(document);
org.junit.Assert.assertEquals(301, document.getStatus());
}
} | public void testSaveDocument() {
for (int i = 0; i < 2; i++) {
javax.ws.rs.core.Response document = subject.saveDocument("valid-id", "tag1,tag2", false, "Hello World", null);
org.junit.Assert.assertNotNull(document);
org.junit.Assert.assertEquals(301, document.getStatus());
}
} |
public static Tree.TreeNode findLastChild(Tree.TreeNode t) {
if (!(t.getChildren().get(0).getChildren().isEmpty())) {
SymbolTable.HashMapTable.findLastChild(t.getChildren().get(0));
}else {
java.lang.System.out.println(t.getChildren().get(0).getData());
return t.getChildren().get(0);
... | public static Tree.TreeNode findLastChild(Tree.TreeNode t) {
if (!(t.getChildren().get(0).getChildren().isEmpty())) {
SymbolTable.HashMapTable.findLastChild(t.getChildren().get(0));
}else {
return t.getChildren().get(0);
}
return t;
} |
protected com.smartdevicelink.proxy.RPCMessage createMessage() {
hapticRect = new com.smartdevicelink.proxy.rpc.HapticRect();
hapticRect.setId(Test.GENERAL_INTEGER);
hapticRect.setRect(Test.GENERAL_RECTANGLE);
java.util.ArrayList<com.smartdevicelink.proxy.rpc.HapticRect> hapticArray = new java.util.Arra... | protected com.smartdevicelink.proxy.RPCMessage createMessage() {
hapticRect = new com.smartdevicelink.proxy.rpc.HapticRect();
hapticRect.setId(Test.GENERAL_INTEGER);
hapticRect.setRect(Test.GENERAL_RECTANGLE);
hapticArray = new java.util.ArrayList<com.smartdevicelink.proxy.rpc.HapticRect>();
hapticA... |
public void fetchChunk(long streamId, int chunkIndex, org.apache.spark.network.client.ChunkReceivedCallback callback) {
logger.debug("Sending fetch chunk request {} to {}", chunkIndex, uri);
final org.apache.spark.network.protocol.StreamChunkId streamChunkId = new org.apache.spark.network.protocol.StreamChunkId... | public void fetchChunk(long streamId, int chunkIndex, org.apache.spark.network.client.ChunkReceivedCallback callback) {
logger.debug("Sending fetch chunk request {} to {}", chunkIndex, uri);
final org.apache.spark.network.protocol.StreamChunkId streamChunkId = new org.apache.spark.network.protocol.StreamChunkId... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.