id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
44,801
public int read() throws IOException { return inputStream.read(); } }); } <BUG>} protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {</BUG> DbUser user; Query query = getPersistenceManager().newQuery("select from " + persistenceHelper.getDbUserClass().getName() + " where openid == :myopenid");
@SuppressWarnings({"unchecked"}) protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {
44,802
eval.setComment("my comment"); eval.setDesignation("MUST_FIX"); eval.setIssue(issue); eval.setWhen(when); eval.setWho(user.createKeyObject()); <BUG>eval.setEmail(who); return eval;</BUG> } protected PersistenceManager getPersistenceManager() { return testHelper.getPersistenceManager();
issue.addEvaluation(eval); return eval;
44,803
package com.cronutils.model.time.generator; import java.util.Collections; <BUG>import java.util.List; import org.apache.commons.lang3.Validate;</BUG> import com.cronutils.model.field.CronField; import com.cronutils.model.field.expression.FieldExpression; public abstract class FieldValueGenerator {
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
44,804
import java.util.ResourceBundle; import java.util.function.Function;</BUG> class DescriptionStrategyFactory { private DescriptionStrategyFactory() {} public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression) { <BUG>final Function<Integer, String> nominal = integer -> new DateTime().withDayOfWeek(integer).dayOfWeek().getAsText(bundle.getLocale()); </BUG> NominalDescriptionStrategy dow = new NominalDescriptionStrategy(bundle, nominal, expression); dow.addDescription(fieldExpression -> { if (fieldExpression instanceof On) {
import java.util.function.Function; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; final Function<Integer, String> nominal = integer -> DayOfWeek.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale());
44,805
return dom; } public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) { return new NominalDescriptionStrategy( bundle, <BUG>integer -> new DateTime().withMonthOfYear(integer).monthOfYear().getAsText(bundle.getLocale()), expression</BUG> ); } public static DescriptionStrategy plainInstance(ResourceBundle bundle, final FieldExpression expression) {
integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()), expression
44,806
<BUG>package com.cronutils.model.time.generator; import com.cronutils.mapper.WeekDay;</BUG> import com.cronutils.model.field.CronField; import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.constraint.FieldConstraintsBuilder;
import java.time.LocalDate; import java.util.Collections; import java.util.List; import java.util.Set; import org.apache.commons.lang3.Validate; import com.cronutils.mapper.WeekDay;
44,807
import com.cronutils.model.field.expression.Between; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.parser.CronParserField; import com.google.common.collect.Lists; import com.google.common.collect.Sets; <BUG>import org.apache.commons.lang3.Validate; import org.joda.time.DateTime; import java.util.Collections; import java.util.List; import java.util.Set;</BUG> class BetweenDayOfWeekValueGenerator extends FieldValueGenerator {
[DELETED]
44,808
<BUG>package com.cronutils.model.time.generator; import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On;
import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import org.apache.commons.lang3.Validate; import com.cronutils.model.field.CronField;
44,809
import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; import com.google.common.collect.Lists; <BUG>import org.apache.commons.lang3.Validate; import org.joda.time.DateTime; import java.util.List;</BUG> class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year;
package com.cronutils.model.time.generator; import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import com.cronutils.model.field.CronField;
44,810
class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year; private int month; public OnDayOfMonthValueGenerator(CronField cronField, int year, int month) { super(cronField); <BUG>Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of month"); this.year = year;</BUG> this.month = month; }
Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" + " month"); this.year = year;
44,811
package com.cronutils.mapper; public class ConstantsMapper { private ConstantsMapper() {} public static final WeekDay QUARTZ_WEEK_DAY = new WeekDay(2, false); <BUG>public static final WeekDay JODATIME_WEEK_DAY = new WeekDay(1, false); </BUG> public static final WeekDay CRONTAB_WEEK_DAY = new WeekDay(1, true); public static int weekDayMapping(WeekDay source, WeekDay target, int weekday){ return source.mapTo(weekday, target);
public static final WeekDay JAVA8 = new WeekDay(1, false);
44,812
return nextMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } <BUG>DateTime nextClosestMatch(DateTime date) throws NoSuchValueException { </BUG> List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear()); TimeNode days = null; int lowestMonth = months.getValues().get(0);
ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException {
44,813
boolean questionMarkSupported = cronDefinition.getFieldDefinition(DAY_OF_WEEK).getConstraints().getSpecialChars().contains(QUESTION_MARK); if(questionMarkSupported){ return new TimeNode( generateDayCandidatesQuestionMarkSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
44,814
) ); }else{ return new TimeNode( generateDayCandidatesQuestionMarkNotSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
44,815
} public DateTime lastExecution(DateTime date){ </BUG> Validate.notNull(date); try { <BUG>DateTime previousMatch = previousClosestMatch(date); </BUG> if(previousMatch.equals(date)){ previousMatch = previousClosestMatch(date.minusSeconds(1)); }
public java.time.Duration timeToNextExecution(ZonedDateTime date){ return java.time.Duration.between(date, nextExecution(date)); public ZonedDateTime lastExecution(ZonedDateTime date){ ZonedDateTime previousMatch = previousClosestMatch(date);
44,816
return previousMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } <BUG>public Duration timeFromLastExecution(DateTime date){ return new Interval(lastExecution(date), date).toDuration(); } public boolean isMatch(DateTime date){ </BUG> return nextExecution(lastExecution(date)).equals(date);
[DELETED]
44,817
<BUG>package com.cronutils.model.time.generator; import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting;
import java.time.ZonedDateTime; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.cronutils.model.field.CronField;
44,818
import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; <BUG>import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List;</BUG> class EveryFieldValueGenerator extends FieldValueGenerator {
package com.cronutils.model.time.generator; import java.time.ZonedDateTime; import java.util.List; import com.cronutils.model.field.CronField;
44,819
private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class); public EveryFieldValueGenerator(CronField cronField) { super(cronField); log.trace(String.format( "processing \"%s\" at %s", <BUG>cronField.getExpression().asString(), DateTime.now() </BUG> )); } @Override
cronField.getExpression().asString(), ZonedDateTime.now()
44,820
import javax.swing.ListModel; import javax.swing.SwingUtilities; import javax.swing.event.ListDataEvent; import javax.swing.event.ListDataListener; import javax.swing.event.ListSelectionEvent; <BUG>import javax.swing.event.ListSelectionListener; import comeon.ui.UI;</BUG> import comeon.ui.preferences.BaseListCellRenderer; import comeon.ui.preferences.Model; import comeon.ui.preferences.SubController;
import org.netbeans.validation.api.ui.swing.ValidationPanel; import comeon.ui.UI;
44,821
layout.setAutoCreateContainerGaps(true); layout.setAutoCreateGaps(true); layout.setHorizontalGroup(layout.createSequentialGroup() .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE) .addComponent(toolboxPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)); <BUG>layout.setVerticalGroup(layout.createParallelGroup(Alignment.LEADING).addComponent(scrollPane).addComponent(toolboxPanel)); }</BUG> private List<JButton> buildButtons() { return new LinkedList<>(Arrays.asList(new JButton(addAction), new JButton(changeAction), new JButton(removeAction))); }
this.validationPanel = new ValidationPanel(); this.validationPanel.setInnerComponent(subPanel); this.subPanel.attach(validationPanel.getValidationGroup());
44,822
public void actionPerformed(final ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { subController.switchToBlankModel(); <BUG>final int result = JOptionPane.showOptionDialog(SwingUtilities.getWindowAncestor((Component) e.getSource()), subPanel, UI.BUNDLE.getString(titleKey), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null); if (JOptionPane.OK_OPTION == result) { subController.addCurrentModel();</BUG> } else { subController.rollback();
final boolean result = validationPanel.showOkCancelDialog(UI.BUNDLE.getString(titleKey)); if (result) { subController.addCurrentModel();
44,823
@Override public void actionPerformed(final ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { <BUG>final int result = JOptionPane.showOptionDialog(SwingUtilities.getWindowAncestor((Component) e.getSource()), subPanel, UI.BUNDLE.getString(titleKey), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null); if (result == JOptionPane.OK_OPTION) { subController.commit(list.getSelectedIndex());</BUG> } else { subController.rollback();
subController.switchToBlankModel(); final boolean result = validationPanel.showOkCancelDialog(UI.BUNDLE.getString(titleKey)); if (result) { subController.addCurrentModel();
44,824
package comeon.ui.preferences; import javax.swing.GroupLayout; import javax.swing.JComponent; import javax.swing.JLabel; <BUG>import javax.swing.JPanel; import comeon.ui.UI; import comeon.ui.preferences.input.NotBlankInputVerifier;</BUG> public abstract class SubPanel<M> extends JPanel { private static final long serialVersionUID = 1L;
import org.netbeans.validation.api.ui.ValidationGroup;
44,825
this.setLayout(layout); } protected final void layoutComponents() { this.doLayoutComponents(layout); } <BUG>protected abstract void doLayoutComponents(final GroupLayout layout); protected static final class AssociatedLabel extends JLabel {</BUG> private static final long serialVersionUID = 1L; public AssociatedLabel(final String key, final JComponent component) { super(UI.BUNDLE.getString(key));
public final void attach(final ValidationGroup validationGroup) { this.doAttach(validationGroup); protected abstract void doAttach(final ValidationGroup validationGroup); protected static final class AssociatedLabel extends JLabel {
44,826
import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; <BUG>import javax.swing.SwingUtilities; import com.google.inject.Inject;</BUG> import com.google.inject.Singleton; import comeon.model.TemplateKind; import comeon.templates.Templates;
import org.netbeans.validation.api.builtin.stringvalidation.StringValidators; import org.netbeans.validation.api.ui.ValidationGroup; import com.google.inject.Inject;
44,827
this.fileField.setEditable(false); this.fileField.setInputVerifier(NOT_BLANK_INPUT_VERIFIER);</BUG> this.fileButton = new JButton(UI.BUNDLE.getString("prefs.templates.path.pick")); <BUG>this.charsetField = new JComboBox<>(templates.getSupportedCharsets()); this.kindField = new JComboBox<>(templates.getTemplateKinds().toArray(new TemplateKind[0])); this.fileChooser = new JFileChooser();</BUG> this.fileChooser.setMultiSelectionEnabled(false); this.fileButton.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) {
this.charsetField.setName(UI.BUNDLE.getString("prefs.templates.charset")); this.kindField.setName(UI.BUNDLE.getString("prefs.templates.kind")); this.fileChooser = new JFileChooser();
44,828
public class SelectTransit extends AppCompatActivity implements NavigationDrawerFragment.BusListCallbacks, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, OnMapReadyCallback, LocationListener, <BUG>SelectionFragment.BusSelectionInteraction {</BUG> private static final String LINES_LAST_UPDATED = "lines_last_updated"; private final static String LAST_LATITUDE = "lastLatitude";
SelectionFragment.BusSelectionInteraction {
44,829
transitStop, this).execute(); } else if(!polylines.get(0).isVisible()) { </BUG> setVisiblePolylines(polylines, true); <BUG>transitStop.updateAddRoutes(route, zoom, Float.parseFloat(getString(R.string.zoom_level))); </BUG> } } private void deselectFromList(Route route) { removeBuses();
} else if (!polylines.get(0).isVisible()) { transitStop.updateAddRoutes(route, zoom, R.integer.zoom_level);
44,830
deselectPolyline(route.getRoute()); stopTimer(); } private void deselectPolyline(String route) { List<Polyline> polylines = routeLines.get(route); <BUG>if(polylines != null) { if(!polylines.isEmpty() && polylines.get(0).isVisible()) { </BUG> setVisiblePolylines(polylines, false);
if (polylines != null) { if (!polylines.isEmpty() && polylines.get(0).isVisible()) {
44,831
longitude = currentLocation.getLongitude(); zoom = 15.0f; Timber.d("location_changed", "current location set in centerMap()"); } Timber.d("savedInstance", "saved? " + inSavedState); <BUG>Timber.d("savedInstance", "lat="+latitude); </BUG> Timber.d("savedInstance", "long=" + longitude); Timber.d("savedInstance", "zoom=" + zoom); mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude), zoom));
Timber.d("savedInstance", "lat=" + latitude);
44,832
</BUG> } }; } <BUG>if(mMapMarkerClickListener == null) { </BUG> mMapMarkerClickListener = marker -> { if (marker != null) { mMap.animateCamera(CameraUpdateFactory.newLatLng(marker.getPosition()), 400, null); new RequestPredictions(getApplicationContext(), marker, mNavigationDrawerFragment.getSelectedRoutes()).execute(marker.getTitle());
inSavedState = true; latitude = cameraPosition.target.latitude; longitude = cameraPosition.target.longitude; if (zoom != cameraPosition.zoom) { zoom = cameraPosition.zoom; transitStop.checkAllVisibility(zoom, R.integer.zoom_level); if (mMapMarkerClickListener == null) {
44,833
mMap.setOnMarkerClickListener(mMapMarkerClickListener); } } protected void restorePolylines() { Route currentRoute; <BUG>for(String route : mNavigationDrawerFragment.getSelectedRoutes()) { </BUG> currentRoute = mNavigationDrawerFragment.getSelectedRoute(route); selectPolyline(currentRoute); }
for (String route : mNavigationDrawerFragment.getSelectedRoutes()) {
44,834
public void onError(Throwable e) { if (e.getMessage() != null && e.getLocalizedMessage() != null && !showedErrors) { showedErrors = true; if (e instanceof IOException) { showToast(getString(R.string.retrofit_network_error), Toast.LENGTH_SHORT); <BUG>} else if (e instanceof HttpException) { </BUG> HttpException http = (HttpException) e; showToast(http.code() + " " + http.message() + ": "
} else if (e instanceof HttpException) {
44,835
else if (e instanceof HttpException) { </BUG> HttpException http = (HttpException) e; showToast(http.code() + " " + http.message() + ": " + getString(R.string.retrofit_http_error), Toast.LENGTH_SHORT); <BUG>} else { </BUG> showToast(getString(R.string.retrofit_conversion_error), Toast.LENGTH_SHORT); }
public void onError(Throwable e) { if (e.getMessage() != null && e.getLocalizedMessage() != null && !showedErrors) { showedErrors = true; if (e instanceof IOException) { showToast(getString(R.string.retrofit_network_error), Toast.LENGTH_SHORT); } else if (e instanceof HttpException) { } else {
44,836
Timber.e("vehicle_error_errs", e.getLocalizedMessage()); Timber.e("vehicle_error_errs", Log.getStackTraceString(e)); } @Override public void onNext(ErrorMessage errorMessage) { <BUG>if(errorMessage != null && errorMessage.getMessage() != null) { </BUG> showToast(errorMessage.getMessage() + (errorMessage.getParameters() != null ? ": " + errorMessage.getParameters() : ""), Toast.LENGTH_SHORT);
if (errorMessage != null && errorMessage.getMessage() != null) {
44,837
return new Func1<Vehicle, VehicleBitmap>() { private HashMap<String, Bitmap> busIconCache = new HashMap<>(mNavigationDrawerFragment.getAmountSelected()); @Override public VehicleBitmap call(Vehicle vehicle) { String routeName = vehicle.getRt(); <BUG>if(busIconCache.containsKey(routeName)) { </BUG> return new VehicleBitmap(vehicle, busIconCache.get(routeName)); } else { Bitmap icon = makeBitmap(mNavigationDrawerFragment.getSelectedRoute(routeName));
if (busIconCache.containsKey(routeName)) {
44,838
if(vid != null) { </BUG> Marker marker = busMarkers.remove(vid); <BUG>if(marker != null) { </BUG> Timber.d("remove_buses", Integer.toString(vid) + " removed"); marker.remove(); } }
.subscribe(vehicleBusUpdateObservable()); vehicleErrorSubscription = vehicleErrorObservable.subscribe(vehicleErrorObserver()); private void removeBuses(Set<Integer> routesOnMap) { Timber.d("remove_buses", "removing buses"); if (routesOnMap != null) { for (Integer vid : routesOnMap) { if (vid != null) { if (marker != null) {
44,839
buf.append(','); } return buf.toString(); } private void makeSnackbar(String string, int showLength) { <BUG>if(string != null && string.length() > 0) { </BUG> Snackbar.make(mainLayout, string, showLength ).show();
if (string != null && string.length() > 0) {
44,840
); } private void requestLocation() { LocationRequest gLocationRequest = LocationRequest.create(); gLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); <BUG>gLocationRequest.setInterval(1000); currentLocation = LocationServices.FusedLocationApi.getLastLocation(googleAPIClient);</BUG> if (currentLocation == null) { Timber.d("location_changed", "current location is null"); LocationServices.FusedLocationApi.requestLocationUpdates(googleAPIClient, gLocationRequest, this);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { return; currentLocation = LocationServices.FusedLocationApi.getLastLocation(googleAPIClient);
44,841
new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude()), 15.0f)); } } else if (!inSavedState) { if (mMap != null) { Timber.d("location_changed", "current location is not null"); <BUG>if(isInPittsburgh(currentLocation)) { </BUG> mMap.moveCamera(CameraUpdateFactory.newLatLngZoom( new LatLng( currentLocation.getLatitude(),
if (isInPittsburgh(currentLocation)) {
44,842
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == LOCATION_REQUEST_CODE) { if (permissions.length == 1 && permissions[0].equals(Manifest.permission.ACCESS_FINE_LOCATION) && grantResults[0] == PackageManager.PERMISSION_GRANTED && <BUG>mMap != null) { mMap.setMyLocationEnabled(true);</BUG> } } }
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { return; mMap.setMyLocationEnabled(true);
44,843
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.List; <BUG>import java.util.Optional; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class CommandDelete extends FCCommandBase { private static final FlagMapper MAPPER = map -> key -> value -> { map.put(key, value);
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
44,844
.append(Text.of(TextColors.GREEN, "Usage: ")) .append(getUsage(source)) .build()); return CommandResult.empty(); } else if (isIn(REGIONS_ALIASES, parse.args[0])) { <BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); IRegion region = FGManager.getInstance().getRegion(parse.args[1]); </BUG> boolean isWorldRegion = false; if (region == null) {
String regionName = parse.args[1]; IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
44,845
</BUG> isWorldRegion = true; } if (region == null) <BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!")); if (region instanceof GlobalWorldRegion) { </BUG> throw new CommandException(Text.of("You may not delete the global region!")); }
if (world == null) throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!")); if (world == null) throw new CommandException(Text.of("Must specify a world!")); region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null); throw new CommandException(Text.of("No region exists with the name \"" + regionName + "\"!")); if (region instanceof IGlobal) {
44,846
source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region" ); return CommandResult.success(); } else if (isIn(HANDLERS_ALIASES, parse.args[0])) { if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); <BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[1]); if (handler == null) throw new ArgumentParseException(Text.of("No handler exists with that name!"), parse.args[1], 1); if (handler instanceof GlobalHandler)</BUG> throw new CommandException(Text.of("You may not delete the global handler!"));
Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]); if (!handlerOpt.isPresent()) IHandler handler = handlerOpt.get(); if (handler instanceof GlobalHandler)
44,847
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix + args) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index == 1) {
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
44,848
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix + args) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index == 1) {
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
44,849
@Dependency(id = "foxcore") }, description = "A world protection plugin built for SpongeAPI. Requires FoxCore.", authors = {"gravityfox"}, url = "https://github.com/FoxDenStudio/FoxGuard") <BUG>public final class FoxGuardMain { public final Cause pluginCause = Cause.builder().named("plugin", this).build(); private static FoxGuardMain instanceField;</BUG> @Inject private Logger logger;
private static FoxGuardMain instanceField;
44,850
private UserStorageService userStorage; private EconomyService economyService = null; private boolean loaded = false; private FCCommandDispatcher fgDispatcher; public static FoxGuardMain instance() { <BUG>return instanceField; }</BUG> @Listener public void construct(GameConstructionEvent event) { instanceField = this;
} public static Cause getCause() { return instance().pluginCause; }
44,851
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
44,852
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.*; <BUG>import java.util.stream.Collectors; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class CommandHere extends FCCommandBase { private static final String[] PRIORITY_ALIASES = {"priority", "prio", "p"}; private static final FlagMapper MAPPER = map -> key -> value -> {
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
44,853
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix + args) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index > 0) {
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
44,854
private static FGStorageManager instance; private final Logger logger = FoxGuardMain.instance().getLogger();</BUG> private final Set<LoadEntry> loaded = new HashSet<>(); private final Path directory = getDirectory(); private final Map<String, Path> worldDirectories; <BUG>private FGStorageManager() { defaultModifiedMap = new CacheMap<>((k, m) -> {</BUG> if (k instanceof IFGObject) { m.put((IFGObject) k, true); return true;
public final HashMap<IFGObject, Boolean> defaultModifiedMap; private final UserStorageService userStorageService; private final Logger logger = FoxGuardMain.instance().getLogger(); userStorageService = FoxGuardMain.instance().getUserStorage(); defaultModifiedMap = new CacheMap<>((k, m) -> {
44,855
String name = fgObject.getName(); Path singleDir = dir.resolve(name.toLowerCase()); </BUG> boolean shouldSave = fgObject.shouldSave(); if (force || shouldSave) { <BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir); </BUG> constructDirectory(singleDir); try { fgObject.save(singleDir);
UUID owner = fgObject.getOwner(); boolean isOwned = !owner.equals(SERVER_UUID); Optional<User> userOwner = userStorageService.get(owner); String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name; if (fgObject.autoSave()) { Path singleDir = serverDir.resolve(name.toLowerCase()); logger.info((shouldSave ? "S" : "Force s") + "aving handler " + logName + " in directory: " + singleDir);
44,856
if (fgObject.autoSave()) { Path singleDir = dir.resolve(name.toLowerCase()); </BUG> boolean shouldSave = fgObject.shouldSave(); if (force || shouldSave) { <BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir); </BUG> constructDirectory(singleDir); try { fgObject.save(singleDir);
Path singleDir = serverDir.resolve(name.toLowerCase()); logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
44,857
public synchronized void loadRegionLinks() { logger.info("Loading region links"); try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) { Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen(); linksMap.entrySet().forEach(entry -> { <BUG>IRegion region = FGManager.getInstance().getRegion(entry.getKey()); if (region != null) { logger.info("Loading links for region \"" + region.getName() + "\"");</BUG> String handlersString = entry.getValue();
Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey()); if (regionOpt.isPresent()) { IRegion region = regionOpt.get(); logger.info("Loading links for region \"" + region.getName() + "\"");
44,858
public synchronized void loadWorldRegionLinks(World world) { logger.info("Loading world region links for world \"" + world.getName() + "\""); try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) { Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen(); linksMap.entrySet().forEach(entry -> { <BUG>IRegion region = FGManager.getInstance().getWorldRegion(world, entry.getKey()); if (region != null) { logger.info("Loading links for world region \"" + region.getName() + "\"");</BUG> String handlersString = entry.getValue();
Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey()); if (regionOpt.isPresent()) { IWorldRegion region = regionOpt.get(); logger.info("Loading links for world region \"" + region.getName() + "\"");
44,859
StringBuilder builder = new StringBuilder(); for (Iterator<IHandler> it = handlers.iterator(); it.hasNext(); ) { builder.append(it.next().getName()); if (it.hasNext()) builder.append(","); } <BUG>return builder.toString(); }</BUG> private final class LoadEntry { public final String name; public final Type type;
public enum Type { REGION, WREGION, HANDLER
44,860
.autoCloseQuotes(true) .leaveFinalAsIs(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream() </BUG> .filter(new StartsWithPredicate(parse.current.token)) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index == 1) {
return Stream.of("region", "worldregion", "handler", "controller")
44,861
import com.intellij.codeInspection.ProblemsHolder; import com.intellij.lang.ASTNode; import com.intellij.lang.xml.XMLLanguage; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement; <BUG>import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.xml.XmlAttribute;</BUG> import org.concordion.plugin.idea.ConcordionCommand; import org.concordion.plugin.idea.lang.ConcordionElementFactory; import org.concordion.plugin.idea.lang.ConcordionLanguage;
import com.intellij.psi.PsiFile; import com.intellij.psi.xml.XmlAttribute;
44,862
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Map; import java.util.Set; import static java.util.stream.Collectors.toSet; <BUG>import static org.concordion.plugin.idea.ConcordionCommand.*; import static org.concordion.plugin.idea.ConcordionPsiUtils.*;</BUG> import static org.concordion.plugin.idea.ConcordionSpecType.*; import static org.concordion.plugin.idea.patterns.ConcordionPatterns.concordionElement; public class WrongCommandCaseUsed extends LocalInspectionTool implements ConcordionSettingsListener {
import static org.concordion.plugin.idea.ConcordionInjectionUtils.*; import static org.concordion.plugin.idea.ConcordionPsiUtils.*;
44,863
public String getFamilyName() { return ACTION_NAME; } @Override public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor problemDescriptor) { <BUG>PsiElement element = problemDescriptor.getPsiElement(); String prefix = prefixInFile(element.getContainingFile()); </BUG> String text = commandTextOf(element); String newText = CASE_FIXER.get(text).prefixedText(nullToEmpty(prefix));
PsiFile containingFile = getContainingFile(element); if (containingFile == null) { return; String prefix = prefixInFile(containingFile);
44,864
import org.apache.commons.lang3.math.NumberUtils; import org.json.JSONException; import org.mariotaku.microblog.library.MicroBlog; import org.mariotaku.microblog.library.MicroBlogException; import org.mariotaku.microblog.library.twitter.model.RateLimitStatus; <BUG>import org.mariotaku.microblog.library.twitter.model.Status; import org.mariotaku.sqliteqb.library.AllColumns;</BUG> import org.mariotaku.sqliteqb.library.Columns; import org.mariotaku.sqliteqb.library.Columns.Column; import org.mariotaku.sqliteqb.library.Expression;
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
44,865
context.getApplicationContext().sendBroadcast(intent); } } @Nullable public static Location getCachedLocation(Context context) { <BUG>if (BuildConfig.DEBUG) { Log.v(LOGTAG, "Fetching cached location", new Exception()); }</BUG> Location location = null;
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
44,866
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBannerImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
if (deleteImage) { Utils.deleteMedia(context, imageUri);
44,867
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBackgroundImage(fileBody, tile); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
44,868
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); return twitter.updateProfileImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
44,869
import org.mariotaku.twidere.receiver.NotificationReceiver; import org.mariotaku.twidere.service.LengthyOperationsService; import org.mariotaku.twidere.util.ActivityTracker; import org.mariotaku.twidere.util.AsyncTwitterWrapper; import org.mariotaku.twidere.util.DataStoreFunctionsKt; <BUG>import org.mariotaku.twidere.util.DataStoreUtils; import org.mariotaku.twidere.util.ImagePreloader;</BUG> import org.mariotaku.twidere.util.InternalTwitterContentUtils; import org.mariotaku.twidere.util.JsonSerializer; import org.mariotaku.twidere.util.NotificationManagerWrapper;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.ImagePreloader;
44,870
final List<InetAddress> addresses = mDns.lookup(host); for (InetAddress address : addresses) { c.addRow(new String[]{host, address.getHostAddress()}); } } catch (final IOException ignore) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, ignore); }</BUG> }
DebugLog.w(LOGTAG, null, ignore);
44,871
for (Location location : twitter.getAvailableTrends()) { map.put(location); } return map.pack(); } catch (final MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
44,872
import android.content.Context; import android.content.SharedPreferences; import android.location.Location; import android.os.AsyncTask; import android.support.annotation.NonNull; <BUG>import android.util.Log; import org.mariotaku.twidere.BuildConfig; import org.mariotaku.twidere.Constants; import org.mariotaku.twidere.util.JsonSerializer;</BUG> import org.mariotaku.twidere.util.Utils;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.JsonSerializer;
44,873
} public static LatLng getCachedLatLng(@NonNull final Context context) { final Context appContext = context.getApplicationContext(); final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences(); if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null; <BUG>if (BuildConfig.DEBUG) { Log.d(HotMobiLogger.LOGTAG, "getting cached location"); }</BUG> final Location location = Utils.getCachedLocation(appContext);
DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
44,874
public int destroySavedSearchAsync(final UserKey accountKey, final long searchId) { final DestroySavedSearchTask task = new DestroySavedSearchTask(accountKey, searchId); return asyncTaskManager.add(task, true); } public int destroyStatusAsync(final UserKey accountKey, final String statusId) { <BUG>final DestroyStatusTask task = new DestroyStatusTask(context,accountKey, statusId); </BUG> return asyncTaskManager.add(task, true); } public int destroyUserListAsync(final UserKey accountKey, final String listId) {
final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
44,875
@Override public void afterExecute(Bus handler, SingleResponse<Relationship> result) { if (result.hasData()) { handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData())); } else if (result.hasException()) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, "Unable to update friendship", result.getException()); }</BUG> }
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
44,876
MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId); if (!Utils.isOfficialCredentials(context, accountId)) continue; try { microBlog.setActivitiesAboutMeUnread(cursor); } catch (MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
44,877
.addComponent(hashLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(presentColorHex, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(presentColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addComponent(editorAntialiasBox) <BUG>.addComponent(inputMethodBox) .addComponent(errorCheckerBox) .addComponent(warningsCheckerBox) </BUG> .addComponent(codeCompletionBox)
.addGroup(layout.createSequentialGroup() .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(warningsCheckerBox))
44,878
.addComponent(presentColor)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(editorAntialiasBox) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(inputMethodBox) <BUG>.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(errorCheckerBox) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(warningsCheckerBox) </BUG> .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup() .addComponent(warningsCheckerBox))
44,879
import java.util.Locale; import java.util.Map; import java.util.TreeMap; public class DependencyConvergenceReport extends AbstractProjectInfoReport <BUG>{ private List reactorProjects; private static final int PERCENTAGE = 100;</BUG> public String getOutputName() {
private static final int PERCENTAGE = 100; private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment .getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
44,880
sink.section1(); sink.sectionTitle1(); sink.text( getI18nString( locale, "title" ) ); sink.sectionTitle1_(); Map dependencyMap = getDependencyMap(); <BUG>generateLegend( locale, sink ); generateStats( locale, sink, dependencyMap ); generateConvergence( locale, sink, dependencyMap ); sink.section1_();</BUG> sink.body_();
sink.lineBreak(); sink.section1_();
44,881
Iterator it = artifactMap.keySet().iterator(); while ( it.hasNext() ) { String version = (String) it.next(); sink.tableRow(); <BUG>sink.tableCell(); sink.text( version );</BUG> sink.tableCell_(); sink.tableCell(); generateVersionDetails( sink, artifactMap, version );
sink.tableCell( String.valueOf( cellWidth ) + "px" ); sink.text( version );
44,882
sink.tableCell(); sink.text( getI18nString( locale, "legend.shared" ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableCell(); iconError( sink );</BUG> sink.tableCell_(); sink.tableCell(); sink.text( getI18nString( locale, "legend.different" ) );
sink.tableCell( "15px" ); // according /images/icon_error_sml.gif iconError( sink );
44,883
sink.tableCaption(); sink.text( getI18nString( locale, "stats.caption" ) ); sink.tableCaption_();</BUG> sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.subprojects" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_();
sink.bold(); sink.bold_(); sink.tableCaption_(); sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.subprojects" ) ); sink.tableHeaderCell_();
44,884
sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.dependencies" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( depCount ) );
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.dependencies" ) ); sink.tableHeaderCell_();
44,885
sink.text( String.valueOf( convergence ) + "%" ); sink.bold_(); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.readyrelease" ) ); sink.tableHeaderCell_();
44,886
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
44,887
mData.add(new MainItem("二维码与条形码的扫描与生成", R.drawable.scan_barcode, ActivityScanerCode.class)); mData.add(new MainItem("WebView的封装可播放视频", R.drawable.webpage, com.vondear.vontools.activity.ActivityWebView.class)); mData.add(new MainItem("常用的Dialog展示", R.drawable.dialog, ActivityDialog.class)); mData.add(new MainItem("VonTextUtils操作Demo", R.drawable.text_editor, ActivityTextUtils.class)); mData.add(new MainItem("进度条的艺术", R.drawable.signal_wifi, ActivityProgressBar.class)); <BUG>mData.add(new MainItem("横向滑动选择日期", R.drawable.bookshelf, ActivityWheelHorizontal.class)); mData.add(new MainItem("SlidingDrawerSingle使用", R.drawable.sliding_drawer, ActivitySlidingDrawerSingle.class)); mData.add(new MainItem("app的检测更新与安装", R.mipmap.ic_launcher, ActivitySplash.class)); }</BUG> private void initView() {
mData.add(new MainItem("横向左右自动滚动的ImageView", R.drawable.picture, ActivityAutoImageView.class)); mData.add(new MainItem("app检测更新与安装", R.mipmap.ic_launcher, ActivitySplash.class)); }
44,888
tv_time_second = (TextView) findViewById(R.id.tv_time_second); ll_back = (LinearLayout) findViewById(R.id.ll_back); ll_back.setVisibility(View.VISIBLE); ll_back.setOnClickListener(this); tv_title = (TextView) findViewById(R.id.tv_title); <BUG>tv_title.setText("会员码"); </BUG> ll_menu = (LinearLayout) findViewById(R.id.ll_menu); ll_menu.setVisibility(View.VISIBLE); iv_code = (ImageView) findViewById(R.id.iv_code);
tv_title.setText("动态生成码");
44,889
import android.content.Context; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.text.method.ScrollingMovementMethod; import android.view.View; <BUG>import android.widget.Button; import com.vondear.tools.R; import com.vondear.vontools.view.DialogEditTextSureCancle;</BUG> import com.vondear.vontools.view.DialogLoadingProgressAcfunVideo; import com.vondear.vontools.view.DialogSure;
import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.vondear.vontools.VonBarUtils; import com.vondear.vontools.view.DialogEditTextSureCancle;
44,890
import com.vondear.vontools.view.dialogShapeLoadingView.ShapeLoadingDialog; import com.vondear.vontools.view.dialogWheel.DialogWheelYearMonthDay; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; <BUG>public class ActivityDialog extends AppCompatActivity { @BindView(R.id.button_DialogSure)</BUG> Button buttonDialogSure; @BindView(R.id.button_DialogSureCancle) Button buttonDialogSureCancle;
public class ActivityDialog extends Activity { @BindView(R.id.button_DialogSure)
44,891
package com.projecttango.examples.java.augmentedreality; import com.google.atap.tangoservice.Tango; import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoCameraIntrinsics; import com.google.atap.tangoservice.TangoConfig; <BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoEvent;</BUG> import com.google.atap.tangoservice.TangoOutOfDateException; import com.google.atap.tangoservice.TangoPoseData; import com.google.atap.tangoservice.TangoXyzIjData;
import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
44,892
super.onResume(); if (!mIsConnected) { mTango = new Tango(AugmentedRealityActivity.this, new Runnable() { @Override public void run() { <BUG>try { connectTango();</BUG> setupRenderer(); mIsConnected = true; } catch (TangoOutOfDateException e) {
TangoSupport.initialize(); connectTango();
44,893
if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) { mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics); mCameraPoseTimestamp = lastFramePose.timestamp;</BUG> } else { <BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread); }</BUG> } } } @Override
mRenderer.updateRenderCameraPose(lastFramePose); mCameraPoseTimestamp = lastFramePose.timestamp; Log.w(TAG, "Can't get device pose at time: " +
44,894
import org.rajawali3d.materials.Material; import org.rajawali3d.materials.methods.DiffuseMethod; import org.rajawali3d.materials.textures.ATexture; import org.rajawali3d.materials.textures.StreamingTexture; import org.rajawali3d.materials.textures.Texture; <BUG>import org.rajawali3d.math.Matrix4; import org.rajawali3d.math.vector.Vector3;</BUG> import org.rajawali3d.primitives.ScreenQuad; import org.rajawali3d.primitives.Sphere; import org.rajawali3d.renderer.RajawaliRenderer;
import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3;
44,895
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) { Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics); getCurrentCamera().setRotation(cameraPose.getOrientation()); getCurrentCamera().setPosition(cameraPose.getPosition()); }</BUG> public int getTextureId() {
public void updateRenderCameraPose(TangoPoseData cameraPose) { float[] rotation = cameraPose.getRotationAsFloats(); float[] translation = cameraPose.getTranslationAsFloats(); Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]); getCurrentCamera().setRotation(quaternion.conjugate()); getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
44,896
package com.projecttango.examples.java.helloareadescription; import com.google.atap.tangoservice.Tango; <BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoConfig;</BUG> import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig;
44,897
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; <BUG>import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.List;</BUG> public final class PatchUtils {
import java.text.DateFormat; import java.util.Date; import java.util.List;
44,898
package org.jboss.as.patching.runner; <BUG>import org.jboss.as.boot.DirectoryStructure; import org.jboss.as.patching.LocalPatchInfo;</BUG> import org.jboss.as.patching.PatchInfo; import org.jboss.as.patching.PatchLogger; import org.jboss.as.patching.PatchMessages;
import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp; import org.jboss.as.patching.CommonAttributes; import org.jboss.as.patching.LocalPatchInfo;
44,899
private static final String PATH_DELIMITER = "/"; public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT; enum Element { ADDED_BUNDLE("added-bundle"), ADDED_MISC_CONTENT("added-misc-content"), <BUG>ADDED_MODULE("added-module"), BUNDLES("bundles"),</BUG> CUMULATIVE("cumulative"), DESCRIPTION("description"), MISC_FILES("misc-files"),
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
44,900
final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { <BUG>case APPLIES_TO_VERSION: builder.addAppliesTo(value); break;</BUG> case RESULTING_VERSION: if(type == Patch.PatchType.CUMULATIVE) {
[DELETED]