id
int64
1
194k
buggy
stringlengths
23
37.5k
fixed
stringlengths
6
37.4k
901
panes.put(visualEffectsComponent.getClass().getSimpleName(), visualEffects); ObjectsComponent objectsComponent = new ObjectsComponent(skin, ui); objectsComponent.setSceneGraph(sg); objectsComponent.initialize(); CollapsiblePane objects = new CollapsiblePane(ui, txt("gui.objects"), objectsComponent.getActor(), skin, false); <BUG>objects.align(Align.left); mainActors.add(objects);</BUG> panes.put(objectsComponent.getClass().getSimpleName(), objects); GaiaComponent gaiaComponent = new GaiaComponent(skin, ui); gaiaComponent.initialize();
panes.put(visualEffectsComponent.getClass().getSimpleName(), visualEffects); ObjectsComponent objectsComponent = new ObjectsComponent(skin, ui); objectsComponent.setSceneGraph(sg); objectsComponent.initialize(); CollapsiblePane objects = new CollapsiblePane(ui, txt("gui.objects"), objectsComponent.getActor(), skin, false); objects.align(Align.left).columnAlign(Align.left); mainActors.add(objects); panes.put(objectsComponent.getClass().getSimpleName(), objects); GaiaComponent gaiaComponent = new GaiaComponent(skin, ui); gaiaComponent.initialize();
902
if (Constants.desktop) { MusicComponent musicComponent = new MusicComponent(skin, ui); musicComponent.initialize(); Actor[] musicActors = MusicActorsManager.getMusicActors() != null ? MusicActorsManager.getMusicActors().getActors(skin) : null; CollapsiblePane music = new CollapsiblePane(ui, txt("gui.music"), musicComponent.getActor(), skin, true, musicActors); <BUG>music.align(Align.left); mainActors.add(music);</BUG> panes.put(musicComponent.getClass().getSimpleName(), music); } Button switchWebgl = new OwnTextButton(txt("gui.webgl.back"), skin, "link");
if (Constants.desktop) { MusicComponent musicComponent = new MusicComponent(skin, ui); musicComponent.initialize(); Actor[] musicActors = MusicActorsManager.getMusicActors() != null ? MusicActorsManager.getMusicActors().getActors(skin) : null; CollapsiblePane music = new CollapsiblePane(ui, txt("gui.music"), musicComponent.getActor(), skin, true, musicActors); music.align(Align.left).columnAlign(Align.left); mainActors.add(music); panes.put(musicComponent.getClass().getSimpleName(), music); } Button switchWebgl = new OwnTextButton(txt("gui.webgl.back"), skin, "link");
903
headerGroup.addActor(expandIcon); headerGroup.addActor(detachIcon); addActor(headerGroup); expandIcon.setChecked(expanded); } <BUG>public void expand() { </BUG> if (!expandIcon.isChecked()) { expandIcon.setChecked(true); }
headerGroup.addActor(expandIcon); headerGroup.addActor(detachIcon); addActor(headerGroup); expandIcon.setChecked(expanded); } public void expandPane() { if (!expandIcon.isChecked()) { expandIcon.setChecked(true);
904
</BUG> if (!expandIcon.isChecked()) { expandIcon.setChecked(true); } } <BUG>public void collapse() { </BUG> if (expandIcon.isChecked()) { expandIcon.setChecked(false); }
headerGroup.addActor(expandIcon); headerGroup.addActor(detachIcon); addActor(headerGroup); expandIcon.setChecked(expanded); } public void expandPane() { if (!expandIcon.isChecked()) { expandIcon.setChecked(true); } } public void collapsePane() { if (expandIcon.isChecked()) { expandIcon.setChecked(false);
905
timeWarp = new OwnLabel(getFormattedTimeWrap(), skin, "warp"); timeWarp.setName("time warp"); Container wrapWrapper = new Container(timeWarp); wrapWrapper.width(60f * GlobalConf.SCALE_FACTOR); wrapWrapper.align(Align.center); <BUG>VerticalGroup timeGroup = new VerticalGroup().align(Align.left).space(3 * GlobalConf.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR); </BUG> HorizontalGroup dateGroup = new HorizontalGroup(); dateGroup.space(4 * GlobalConf.SCALE_FACTOR); dateGroup.addActor(date);
timeWarp = new OwnLabel(getFormattedTimeWrap(), skin, "warp"); timeWarp.setName("time warp"); Container wrapWrapper = new Container(timeWarp); wrapWrapper.width(60f * GlobalConf.SCALE_FACTOR); wrapWrapper.align(Align.center); VerticalGroup timeGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR); HorizontalGroup dateGroup = new HorizontalGroup(); dateGroup.space(4 * GlobalConf.SCALE_FACTOR); dateGroup.addActor(date);
906
focusListScrollPane.setFadeScrollBars(false); focusListScrollPane.setScrollingDisabled(true, false); focusListScrollPane.setHeight(tree ? 200 * GlobalConf.SCALE_FACTOR : 100 * GlobalConf.SCALE_FACTOR); focusListScrollPane.setWidth(160); } <BUG>VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).space(3 * GlobalConf.SCALE_FACTOR); </BUG> objectsGroup.addActor(searchBox); if (focusListScrollPane != null) { objectsGroup.addActor(focusListScrollPane);
focusListScrollPane.setFadeScrollBars(false); focusListScrollPane.setScrollingDisabled(true, false); focusListScrollPane.setHeight(tree ? 200 * GlobalConf.SCALE_FACTOR : 100 * GlobalConf.SCALE_FACTOR); focusListScrollPane.setWidth(160); } VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR); objectsGroup.addActor(searchBox); if (focusListScrollPane != null) { objectsGroup.addActor(focusListScrollPane);
907
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.idea.maven.model.MavenConstants; import org.jetbrains.idea.maven.project.MavenProject; import org.jetbrains.idea.maven.project.MavenProjectsManager; <BUG>import javax.swing.*; public class MavenExecuteGoalDialog extends DialogWrapper { private final Project myProject; private JPanel contentPane; private ComboBox myGoalsComboBox;</BUG> private FixedSizeButton showProjectTreeButton;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.idea.maven.model.MavenConstants; import org.jetbrains.idea.maven.project.MavenProject; import org.jetbrains.idea.maven.project.MavenProjectsManager; import javax.swing.*; import java.util.Collection; public class MavenExecuteGoalDialog extends DialogWrapper { private final Project myProject; @Nullable private final Collection<String> myHistory; private JPanel contentPane;
908
import org.jetbrains.idea.maven.execution.MavenRunner; import org.jetbrains.idea.maven.execution.MavenRunnerParameters; import org.jetbrains.idea.maven.project.MavenProject; import org.jetbrains.idea.maven.project.MavenProjectsManager; import org.jetbrains.idea.maven.utils.MavenLog; <BUG>import javax.swing.*; import java.util.Collection;</BUG> import java.util.Collections; import java.util.List; public class MavenBeforeRunTasksProvider extends BeforeRunTaskProvider<MavenBeforeRunTask> {
import org.jetbrains.idea.maven.execution.MavenRunner; import org.jetbrains.idea.maven.execution.MavenRunnerParameters; import org.jetbrains.idea.maven.project.MavenProject; import org.jetbrains.idea.maven.project.MavenProjectsManager; import org.jetbrains.idea.maven.utils.MavenLog; import javax.swing.*; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; public class MavenBeforeRunTasksProvider extends BeforeRunTaskProvider<MavenBeforeRunTask> {
909
new CoupleResourceFichier(R.raw.arrets_routes, "arrets_routes.txt"), new CoupleResourceFichier( R.raw.calendriers, "calendriers.txt"), new CoupleResourceFichier(R.raw.directions, "directions.txt"), new CoupleResourceFichier(R.raw.lignes, "lignes.txt"), new CoupleResourceFichier(R.raw.trajets, "trajets.txt")); startService(new Intent(UpdateTimeService.ACTION_UPDATE)); <BUG>PackageManager pm = getPackageManager(); pm.setComponentEnabledSetting(new ComponentName("fr.ybo.transportsrennes", ".services.UpdateTimeService"), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); final String dateCourante = new SimpleDateFormat("ddMMyyyy").format(new Date());</BUG> Bounds boundsBdd = getDataBaseHelper().selectSingle(new Bounds());
new CoupleResourceFichier(R.raw.arrets_routes, "arrets_routes.txt"), new CoupleResourceFichier( R.raw.calendriers, "calendriers.txt"), new CoupleResourceFichier(R.raw.directions, "directions.txt"), new CoupleResourceFichier(R.raw.lignes, "lignes.txt"), new CoupleResourceFichier(R.raw.trajets, "trajets.txt")); startService(new Intent(UpdateTimeService.ACTION_UPDATE)); PackageManager pm = getPackageManager(); if (pm != null) { pm.setComponentEnabledSetting(new ComponentName(this, UpdateTimeService.class), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); } final String dateCourante = new SimpleDateFormat("ddMMyyyy").format(new Date()); Bounds boundsBdd = getDataBaseHelper().selectSingle(new Bounds());
910
R.raw.calendriers, "calendriers.txt"), new CoupleResourceFichier(R.raw.calendriers_exceptions, "calendriers_exceptions.txt"), new CoupleResourceFichier(R.raw.directions, "directions.txt"), new CoupleResourceFichier(R.raw.lignes, "lignes.txt"), new CoupleResourceFichier(R.raw.trajets, "trajets.txt")); startService(new Intent(UpdateTimeService.ACTION_UPDATE)); <BUG>PackageManager pm = getPackageManager(); pm.setComponentEnabledSetting(new ComponentName("fr.ybo.transportsbordeaux", ".services.UpdateTimeService"), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); new AsyncTask<Void, Void, Void>() {</BUG> @Override
R.raw.calendriers, "calendriers.txt"), new CoupleResourceFichier(R.raw.calendriers_exceptions, "calendriers_exceptions.txt"), new CoupleResourceFichier(R.raw.directions, "directions.txt"), new CoupleResourceFichier(R.raw.lignes, "lignes.txt"), new CoupleResourceFichier(R.raw.trajets, "trajets.txt")); startService(new Intent(UpdateTimeService.ACTION_UPDATE)); PackageManager pm = getPackageManager(); if (pm != null) { pm.setComponentEnabledSetting(new ComponentName(this, UpdateTimeService.class), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); } new AsyncTask<Void, Void, Void>() { @Override
911
import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.Widget; import com.google.gwt.view.client.MultiSelectionModel; import com.google.gwt.view.client.ProvidesKey; import org.rstudio.core.client.command.KeyboardShortcut; <BUG>import org.rstudio.core.client.dom.DomUtils; public class MultiSelectCellTable<T> extends CellTable<T></BUG> implements HasKeyDownHandlers, HasClickHandlers { public MultiSelectCellTable()
import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.Widget; import com.google.gwt.view.client.MultiSelectionModel; import com.google.gwt.view.client.ProvidesKey; import org.rstudio.core.client.command.KeyboardShortcut; import org.rstudio.core.client.dom.DomUtils; import org.rstudio.core.client.dom.ElementEx; public class MultiSelectCellTable<T> extends CellTable<T> implements HasKeyDownHandlers, HasClickHandlers { public MultiSelectCellTable()
912
if (!canSelectVisibleRow(row)) row = min; if (!extend) clearSelection(); getSelectionModel().setSelected(getVisibleItem(row), true); <BUG>ensureRowVisible(row); </BUG> } else {
if (!canSelectVisibleRow(row)) row = min; if (!extend) clearSelection(); getSelectionModel().setSelected(getVisibleItem(row), true); ensureRowVisible(row, true); } else {
913
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);
return nextMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException { List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear()); TimeNode days = null; int lowestMonth = months.getValues().get(0);
914
int lowestMonth = months.getValues().get(0); int lowestHour = hours.getValues().get(0); int lowestMinute = minutes.getValues().get(0); int lowestSecond = seconds.getValues().get(0); NearestValue nearestValue; <BUG>DateTime newDate; </BUG> if(year.isEmpty()){ int newYear = yearsValueGenerator.generateNextValue(date.getYear()); <BUG>days = generateDays(cronDefinition, new DateTime(newYear, lowestMonth, 1, 0, 0)); </BUG> return initDateTime(yearsValueGenerator.generateNextValue(date.getYear()), lowestMonth, days.getValues().get(0), lowestHour, lowestMinute, lowestSecond, date.getZone());
int lowestMonth = months.getValues().get(0); int lowestHour = hours.getValues().get(0); int lowestMinute = minutes.getValues().get(0); int lowestSecond = seconds.getValues().get(0); NearestValue nearestValue; ZonedDateTime newDate; if(year.isEmpty()){ int newYear = yearsValueGenerator.generateNextValue(date.getYear()); days = generateDays(cronDefinition, ZonedDateTime.of(LocalDateTime.of(newYear, lowestMonth, 1, 0, 0), date.getZone())); return initDateTime(yearsValueGenerator.generateNextValue(date.getYear()), lowestMonth, days.getValues().get(0), lowestHour, lowestMinute, lowestSecond, date.getZone());
915
int newYear = yearsValueGenerator.generateNextValue(date.getYear()); <BUG>days = generateDays(cronDefinition, new DateTime(newYear, lowestMonth, 1, 0, 0)); </BUG> return initDateTime(yearsValueGenerator.generateNextValue(date.getYear()), lowestMonth, days.getValues().get(0), lowestHour, lowestMinute, lowestSecond, date.getZone()); } <BUG>if(!months.getValues().contains(date.getMonthOfYear())) { nearestValue = months.getNextValue(date.getMonthOfYear(), 0); </BUG> int nextMonths = nearestValue.getValue();
int newYear = yearsValueGenerator.generateNextValue(date.getYear()); days = generateDays(cronDefinition, ZonedDateTime.of(LocalDateTime.of(newYear, lowestMonth, 1, 0, 0), date.getZone())); return initDateTime(yearsValueGenerator.generateNextValue(date.getYear()), lowestMonth, days.getValues().get(0), lowestHour, lowestMinute, lowestSecond, date.getZone()); } if(!months.getValues().contains(date.getMonthValue())) { nearestValue = months.getNextValue(date.getMonthValue(), 0); int nextMonths = nearestValue.getValue();
916
nearestValue = months.getNextValue(date.getMonthOfYear(), 0); </BUG> int nextMonths = nearestValue.getValue(); if(nearestValue.getShifts()>0){ newDate = <BUG>new DateTime(date.getYear(), 1, 1, 0, 0, 0, date.getZone()).plusYears(nearestValue.getShifts()); </BUG> return nextClosestMatch(newDate); } <BUG>if (nearestValue.getValue() < date.getMonthOfYear()) { </BUG> date = date.plusYears(1);
int newYear = yearsValueGenerator.generateNextValue(date.getYear()); days = generateDays(cronDefinition, ZonedDateTime.of(LocalDateTime.of(newYear, lowestMonth, 1, 0, 0), date.getZone())); return initDateTime(yearsValueGenerator.generateNextValue(date.getYear()), lowestMonth, days.getValues().get(0), lowestHour, lowestMinute, lowestSecond, date.getZone()); } if(!months.getValues().contains(date.getMonthValue())) { nearestValue = months.getNextValue(date.getMonthValue(), 0); int nextMonths = nearestValue.getValue(); if(nearestValue.getShifts()>0){ newDate = ZonedDateTime.of(LocalDateTime.of(date.getYear(), 1, 1, 0, 0, 0), date.getZone()).plusYears(nearestValue.getShifts()); return nextClosestMatch(newDate);
917
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()
boolean questionMarkSupported = cronDefinition.getFieldDefinition(DAY_OF_WEEK).getConstraints().getSpecialChars().contains(QUESTION_MARK); if(questionMarkSupported){ return new TimeNode( generateDayCandidatesQuestionMarkSupported( date.getYear(), date.getMonthValue(), ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
918
) ); }else{ return new TimeNode( generateDayCandidatesQuestionMarkNotSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
) ); }else{ return new TimeNode( generateDayCandidatesQuestionMarkNotSupported( date.getYear(), date.getMonthValue(), ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
919
} 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){ Validate.notNull(date); try { ZonedDateTime previousMatch = previousClosestMatch(date); if(previousMatch.equals(date)){ previousMatch = previousClosestMatch(date.minusSeconds(1)); }
920
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);
return previousMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e);
921
<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;
package com.cronutils.model.time.generator; import java.time.ZonedDateTime; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.cronutils.model.field.CronField; import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting;
922
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 org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.cronutils.model.field.CronField; 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; class EveryFieldValueGenerator extends FieldValueGenerator {
923
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
private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class); public EveryFieldValueGenerator(CronField cronField) { super(cronField); log.trace(String.format( "processing \"%s\" at %s", cronField.getExpression().asString(), ZonedDateTime.now() )); } @Override
924
<BUG>package com.cronutils.descriptor; import com.cronutils.model.field.expression.FieldExpression;</BUG> import com.cronutils.model.field.expression.On; <BUG>import org.joda.time.DateTime; import java.util.ResourceBundle; import java.util.function.Function;</BUG> class DescriptionStrategyFactory {
package com.cronutils.descriptor; import java.time.DayOfWeek; import java.time.Month; import java.time.format.TextStyle; import java.util.ResourceBundle; import java.util.function.Function; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; class DescriptionStrategyFactory {
925
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.ResourceBundle; import java.util.function.Function; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; class DescriptionStrategyFactory { private DescriptionStrategyFactory() {} public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression) { final Function<Integer, String> nominal = integer -> DayOfWeek.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()); NominalDescriptionStrategy dow = new NominalDescriptionStrategy(bundle, nominal, expression); dow.addDescription(fieldExpression -> { if (fieldExpression instanceof On) {
926
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) {
return dom; } public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) { return new NominalDescriptionStrategy( bundle, integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()), expression ); } public static DescriptionStrategy plainInstance(ResourceBundle bundle, final FieldExpression expression) {
927
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 {
package com.cronutils.model.time.generator; import java.util.Collections; import java.util.List; import org.apache.commons.lang3.Validate; import com.cronutils.model.field.CronField; import com.cronutils.model.field.expression.FieldExpression; import org.apache.commons.lang3.Validate; import com.cronutils.model.field.CronField; import com.cronutils.model.field.expression.FieldExpression; public abstract class FieldValueGenerator {
928
<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;
package com.cronutils.model.time.generator; 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; import com.cronutils.model.field.CronField; import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.constraint.FieldConstraintsBuilder;
929
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 {
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; class BetweenDayOfWeekValueGenerator extends FieldValueGenerator {
930
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);
package com.cronutils.mapper; public class ConstantsMapper { private ConstantsMapper() {} public static final WeekDay QUARTZ_WEEK_DAY = new WeekDay(2, false); public static final WeekDay JAVA8 = new WeekDay(1, false); 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);
931
<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;
package com.cronutils.model.time.generator; import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import org.apache.commons.lang3.Validate; import com.cronutils.model.field.CronField; import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On;
932
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 org.apache.commons.lang3.Validate; import com.cronutils.model.field.CronField; 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; class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year;
933
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; }
class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year; private int month; public OnDayOfMonthValueGenerator(CronField cronField, int year, int month) { super(cronField); Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" + " month"); this.year = year; this.month = month; }
934
} return value; } @Override public int generatePreviousValue(int reference) throws NoSuchValueException { <BUG>On on = ((On)cronField.getExpression()); </BUG> int value = generateValue(on, year, month); <BUG>if(value>=reference){ </BUG> throw new NoSuchValueException();
} @Override public int generateNextValue(int reference) throws NoSuchValueException { On on = ((On) cronField.getExpression()); int value = generateValue(on, year, month); if (value <= reference) {
935
int reference = generateNextValue(start); <BUG>while(reference<end){ </BUG> values.add(reference); <BUG>reference=generateNextValue(reference); </BUG> } <BUG>} catch (NoSuchValueException e) {} return values;</BUG> }
int reference = generateNextValue(start); while (reference < end) { values.add(reference); reference = generateNextValue(reference); } } catch (NoSuchValueException e) { } return values; }
936
import com.liferay.portal.kernel.search.Query; import com.liferay.portal.kernel.search.SearchContext; import com.liferay.portal.kernel.search.SearchEngineUtil; import com.liferay.portal.kernel.search.Summary; import com.liferay.portal.kernel.search.TermQueryFactoryUtil; <BUG>import com.liferay.portal.kernel.util.HtmlUtil; import com.liferay.portal.kernel.util.StringBundler;</BUG> import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringUtil; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.search.Query; import com.liferay.portal.kernel.search.SearchContext; import com.liferay.portal.kernel.search.SearchEngineUtil; import com.liferay.portal.kernel.search.Summary; import com.liferay.portal.kernel.search.TermQueryFactoryUtil; import com.liferay.portal.kernel.util.HtmlUtil; import com.liferay.portal.kernel.util.ListUtil; import com.liferay.portal.kernel.util.StringBundler; import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringUtil; import com.liferay.portal.kernel.util.Validator;
937
document.addText(Field.CONTENT, content); document.addKeyword("moduleId", moduleId);</BUG> document.addKeyword("artifactId", moduleIdObj.getArtifactId()); <BUG>document.addKeyword("version", version); document.addText("author", author); document.addKeyword("type", types.toArray(new String[0])); document.addKeyword("tag", tags.toArray(new String[0])); String[] licenseNames = new String[licenses.size()]; boolean osiLicense = false;</BUG> for (int i = 0; i < licenses.size(); i++) {
List<License> licenses = pluginPackage.getLicenses(); document.addKeyword( "license", StringUtil.split(ListUtil.toString(licenses, "name"))); document.addText("longDescription", longDescription); document.addKeyword("moduleId", pluginPackage.getModuleId()); boolean osiLicense = false; for (int i = 0; i < licenses.size(); i++) {
938
if (license.isOsiApproved()) { <BUG>osiLicense = true; }</BUG> } <BUG>document.addKeyword("license", licenseNames); document.addKeyword("osi-approved-license", String.valueOf(osiLicense)); document.addText("shortDescription", shortDescription); document.addText("longDescription", longDescription); document.addText("changeLog", changeLog); document.addText("pageURL", pageURL); document.addKeyword("repositoryURL", repositoryURL); document.addKeyword(Field.STATUS, status); document.addKeyword("installedVersion", installedVersion);</BUG> return document;
document.addKeyword("tag", tags.toArray(new String[0])); List<String> types = pluginPackage.getTypes(); document.addKeyword("type", types.toArray(new String[0])); document.addKeyword("version", pluginPackage.getVersion()); return document;
939
import com.liferay.portal.kernel.util.StringBundler; import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringUtil; import java.util.regex.Matcher; import java.util.regex.Pattern; <BUG>import net.htmlparser.jericho.Source; public class HtmlImpl implements Html {</BUG> public static final int ESCAPE_MODE_ATTRIBUTE = 1; public static final int ESCAPE_MODE_CSS = 2; public static final int ESCAPE_MODE_JS = 3;
import com.liferay.portal.kernel.util.StringBundler; import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringUtil; import java.util.regex.Matcher; import java.util.regex.Pattern; import net.htmlparser.jericho.Source; import net.htmlparser.jericho.TextExtractor; public class HtmlImpl implements Html { public static final int ESCAPE_MODE_ATTRIBUTE = 1; public static final int ESCAPE_MODE_CSS = 2; public static final int ESCAPE_MODE_JS = 3;
940
import android.os.Message; import android.view.View; import android.view.Window; import android.view.WindowManager; public abstract class EasyAccountAuthenticatorActivity extends AccountAuthenticatorActivity{ <BUG>private boolean haveDestroy; private Injector injector;</BUG> private ActivityPool activityPool; private EasyHandler handler;
import android.os.Message; import android.view.View; import android.view.Window; import android.view.WindowManager; public abstract class EasyAccountAuthenticatorActivity extends AccountAuthenticatorActivity{ private boolean isHaveDestroy; private boolean isInjectContentView; private Injector injector; private ActivityPool activityPool; private EasyHandler handler;
941
InjectContentView injectContentView = getClass().getAnnotation(InjectContentView.class); <BUG>if(injectContentView != null && injectContentView.value() > 0){ setContentView(injectContentView.value()); } injector.injectOtherMembers(); }</BUG> } @Override public void onContentChanged() { super.onContentChanged();
InjectContentView injectContentView = getClass().getAnnotation(InjectContentView.class); if(injectContentView != null && injectContentView.value() > 0){ isInjectContentView = true; setContentView(injectContentView.value()); } if(!isInjectContentView){ injector.injectOtherMembers(); } } } @Override public void onContentChanged() { super.onContentChanged();
942
super.onBackPressed(); } } @Override protected Dialog onCreateDialog(int id, Bundle args) { <BUG>if(!haveDestroy){ </BUG> Dialog dialog = null; switch(id){ case Constant.DIALOG_MESSAGE :
super.onBackPressed(); } } @Override protected Dialog onCreateDialog(int id, Bundle args) { if(!isHaveDestroy){ Dialog dialog = null; switch(id){ case Constant.DIALOG_MESSAGE :
943
import android.support.v7.app.ActionBarActivity; import android.view.View; import android.view.Window; import android.view.WindowManager; public abstract class EasyActionBarActivity extends ActionBarActivity{ <BUG>private boolean haveDestroy; private Injector injector;</BUG> private ActivityPool activityPool; private EasyHandler handler;
import android.support.v7.app.ActionBarActivity; import android.view.View; import android.view.Window; import android.view.WindowManager; public abstract class EasyActionBarActivity extends ActionBarActivity{ private boolean isHaveDestroy; private boolean isInjectContentView; private Injector injector; private ActivityPool activityPool; private EasyHandler handler;
944
InjectContentView injectContentView = getClass().getAnnotation(InjectContentView.class); <BUG>if(injectContentView != null && injectContentView.value() > 0){ setContentView(injectContentView.value()); } injector.injectOtherMembers(); }</BUG> } @Override public void onSupportContentChanged() { super.onContentChanged();
InjectContentView injectContentView = getClass().getAnnotation(InjectContentView.class); if(injectContentView != null && injectContentView.value() > 0){ isInjectContentView = true; setContentView(injectContentView.value()); } if(!isInjectContentView){ injector.injectOtherMembers(); } } } @Override public void onSupportContentChanged() { super.onContentChanged();
945
super.onBackPressed(); } } @Override protected Dialog onCreateDialog(int id, Bundle args) { <BUG>if(!haveDestroy){ </BUG> Dialog dialog = null; switch(id){ case Constant.DIALOG_MESSAGE :
super.onBackPressed(); } } @Override protected Dialog onCreateDialog(int id, Bundle args) { if(!isHaveDestroy){ Dialog dialog = null; switch(id){ case Constant.DIALOG_MESSAGE :
946
import edu.umd.cs.findbugs.io.IO; public class NestedZipFileCodeBase extends AbstractScannableCodeBase implements IScannableCodeBase { private ICodeBase parentCodeBase; private String resourceName; private File tempFile; <BUG>private ZipFileCodeBase delegateCodeBase; </BUG> public NestedZipFileCodeBase(NestedZipFileCodeBaseLocator codeBaseLocator) throws ResourceNotFoundException, IOException { super(codeBaseLocator);
import edu.umd.cs.findbugs.io.IO; public class NestedZipFileCodeBase extends AbstractScannableCodeBase implements IScannableCodeBase { private ICodeBase parentCodeBase; private String resourceName; private File tempFile; private AbstractScannableCodeBase delegateCodeBase; public NestedZipFileCodeBase(NestedZipFileCodeBaseLocator codeBaseLocator) throws ResourceNotFoundException, IOException { super(codeBaseLocator);
947
tempFile.deleteOnExit(); // just in case we crash before the codebase is closed inputStream = parentCodeBase.lookupResource(resourceName).openResource(); outputStream = new BufferedOutputStream(new FileOutputStream(tempFile)); IO.copy(inputStream, outputStream); outputStream.flush(); <BUG>delegateCodeBase = new ZipFileCodeBase(codeBaseLocator, tempFile); </BUG> } finally { if (inputStream != null) { IO.close(inputStream);
tempFile.deleteOnExit(); // just in case we crash before the codebase is closed inputStream = parentCodeBase.lookupResource(resourceName).openResource(); outputStream = new BufferedOutputStream(new FileOutputStream(tempFile)); IO.copy(inputStream, outputStream); outputStream.flush(); delegateCodeBase = ZipCodeBaseFactory.makeZipCodeBase(codeBaseLocator, tempFile); } finally { if (inputStream != null) { IO.close(inputStream);
948
if (file.isDirectory()) { return new DirectoryCodeBase(codeBaseLocator, file); } else if (fileName.endsWith(".class")) { return new SingleFileCodeBase(codeBaseLocator, fileName); } else { <BUG>return new ZipInputStreamCodeBase(codeBaseLocator, file); }</BUG> } static IScannableCodeBase createNestedZipFileCodeBase( NestedZipFileCodeBaseLocator codeBaseLocator)
if (file.isDirectory()) { return new DirectoryCodeBase(codeBaseLocator, file); } else if (fileName.endsWith(".class")) { return new SingleFileCodeBase(codeBaseLocator, fileName); } else { return ZipCodeBaseFactory.makeZipCodeBase(codeBaseLocator, file); } } static IScannableCodeBase createNestedZipFileCodeBase( NestedZipFileCodeBaseLocator codeBaseLocator)
949
package edu.umd.cs.findbugs.classfile.impl; import java.io.ByteArrayOutputStream; import java.io.File; <BUG>import java.io.FileInputStream; import java.io.IOException; import java.util.HashMap; import java.util.Map;</BUG> import java.util.zip.ZipEntry;
package edu.umd.cs.findbugs.classfile.impl; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Collections; import java.util.HashSet; import java.util.zip.ZipEntry;
950
public class ZipInputStreamCodeBase extends AbstractScannableCodeBase { final static boolean DEBUG = false; </BUG> final File file; <BUG>final Map<String, ZipInputStreamCodeBaseEntry> map = new HashMap<String, ZipInputStreamCodeBaseEntry>(); public ZipInputStreamCodeBase(ICodeBaseLocator codeBaseLocator, File file) throws IOException {</BUG> super(codeBaseLocator); this.file = file; setLastModifiedTime(file.lastModified());
public class ZipInputStreamCodeBase extends AbstractScannableCodeBase { final static boolean DEBUG = true; final File file; final MapCache<String, ZipInputStreamCodeBaseEntry> map = new MapCache<String, ZipInputStreamCodeBaseEntry>(10000); final HashSet<String> entries = new HashSet<String>(); public ZipInputStreamCodeBase(ICodeBaseLocator codeBaseLocator, File file) throws IOException { super(codeBaseLocator); this.file = file; setLastModifiedTime(file.lastModified());
951
package org.neo4j.kernel.ha; <BUG>import java.util.List;</BUG> import org.neo4j.graphdb.config.Setting; import org.neo4j.graphdb.factory.Description; import org.neo4j.helpers.HostnamePort; import org.neo4j.helpers.Settings; import org.neo4j.kernel.configuration.ConfigurationMigrator; import org.neo4j.kernel.configuration.Migrator; import static org.neo4j.helpers.Settings.BOOLEAN; import static org.neo4j.helpers.Settings.BYTES; import static org.neo4j.helpers.Settings.DURATION; import static org.neo4j.helpers.Settings.HOSTNAME_PORT; import static org.neo4j.helpers.Settings.INTEGER; <BUG>import static org.neo4j.helpers.Settings.list;</BUG> import static org.neo4j.helpers.Settings.min;
package org.neo4j.kernel.ha; import org.neo4j.graphdb.config.Setting; import org.neo4j.graphdb.factory.Description; import org.neo4j.helpers.HostnamePort; import org.neo4j.helpers.Settings; import org.neo4j.kernel.configuration.ConfigurationMigrator; import org.neo4j.kernel.configuration.Migrator; import static org.neo4j.helpers.Settings.BOOLEAN; import static org.neo4j.helpers.Settings.BYTES; import static org.neo4j.helpers.Settings.DURATION; import static org.neo4j.helpers.Settings.HOSTNAME_PORT; import static org.neo4j.helpers.Settings.INTEGER; import static org.neo4j.helpers.Settings.min;
952
@Description("Whether this instance should only participate as slave in cluster. If set to true, it will never be elected as master.") public static final Setting<Boolean> slave_only = setting( "ha.slave_only", BOOLEAN, Settings.FALSE ); @Description( "Policy for how to handle branched data." ) public static final Setting<BranchedDataPolicy> branched_data_policy = setting( "ha.branched_data_policy", options( BranchedDataPolicy.class ), "keep_all" ); <BUG>@Description( "List of ZooKeeper coordinators. Only needed for rolling upgrade from 1.8 to 1.9." ) @Deprecated public static final Setting<List<HostnamePort>> coordinators = setting( "ha.upgrade_coordinators", list( ",", HOSTNAME_PORT ), "" ); @Description( "ZooKeeper session timeout. Only needed for rolling upgrade from 1.8 to 1.9." ) @Deprecated public static final Setting<Long> zk_session_timeout = setting( "ha.zk_session_timeout", DURATION, "5s");</BUG> @Description( "Max size of the data chunks that flows between master and slaves in HA. Bigger size may increase " +
@Description("Whether this instance should only participate as slave in cluster. If set to true, it will never be elected as master.") public static final Setting<Boolean> slave_only = setting( "ha.slave_only", BOOLEAN, Settings.FALSE ); @Description( "Policy for how to handle branched data." ) public static final Setting<BranchedDataPolicy> branched_data_policy = setting( "ha.branched_data_policy", options( BranchedDataPolicy.class ), "keep_all" ); @Description( "Max size of the data chunks that flows between master and slaves in HA. Bigger size may increase " +
953
package org.jboss.as.connector.subsystems.resourceadapters; import java.util.HashMap; import java.util.Map; public enum AS7ResourceAdapterTags { <BUG>UNKNOWN(null), CONFIG_PROPERTY("config-property"),</BUG> ARCHIVE("archive"), MODULE("module"), BEAN_VALIDATION_GROUPS("bean-validation-groups"),
package org.jboss.as.connector.subsystems.resourceadapters; import java.util.HashMap; import java.util.Map; public enum AS7ResourceAdapterTags { UNKNOWN(null), ID("id"), CONFIG_PROPERTY("config-property"), ARCHIVE("archive"), MODULE("module"), BEAN_VALIDATION_GROUPS("bean-validation-groups"),
954
} } context.removeResource(PathAddress.EMPTY_ADDRESS); context.addStep(new OperationStepHandler() { public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { <BUG>final boolean wasActive = RaOperationUtil.deactivateIfActive(context, archiveOrModuleName); ServiceName raServiceName = ServiceName.of(ConnectorServices.RA_SERVICE, archiveOrModuleName); </BUG> ServiceController<?> serviceController = context.getServiceRegistry(false).getService(raServiceName);
} final ModelNode compensating = Util.getEmptyOperation(ADD, opAddr); if (model.hasDefined(RESOURCEADAPTERS_NAME)) { for (ModelNode raNode : model.get(RESOURCEADAPTERS_NAME).asList()) { ModelNode raCompensatingNode = raNode.clone(); compensating.get(RESOURCEADAPTERS_NAME).add(raCompensatingNode); } } context.removeResource(PathAddress.EMPTY_ADDRESS); context.addStep(new OperationStepHandler() { public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final boolean wasActive = RaOperationUtil.deactivateIfActive(context, name); ServiceName raServiceName = ServiceName.of(ConnectorServices.RA_SERVICE, name); ServiceController<?> serviceController = context.getServiceRegistry(false).getService(raServiceName);
955
if (raServiceName.isParentOf(name)) { context.removeService(name); } } if (model.get(MODULE.getName()).isDefined()) { <BUG>ServiceName deployerServiceName = ConnectorServices.RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX.append(model.get(MODULE.getName()).asString()); context.removeService(deployerServiceName); }</BUG> context.removeService(raServiceName);
if (raServiceName.isParentOf(name)) { context.removeService(name); } } if (model.get(MODULE.getName()).isDefined()) { ServiceName deployerServiceName = ConnectorServices.RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX.append(name); context.removeService(deployerServiceName); ServiceName inactiveServiceName = ConnectorServices.INACTIVE_RESOURCE_ADAPTER_SERVICE.append(name); context.removeService(inactiveServiceName); } context.removeService(raServiceName);
956
final MountHandle mountHandle = new MountHandle(closable); final ResourceRoot resourceRoot = new ResourceRoot(child, mountHandle); final VirtualFile deploymentRoot = resourceRoot.getRoot(); if (deploymentRoot == null || !deploymentRoot.exists()) return; <BUG>ConnectorXmlDescriptor connectorXmlDescriptor = RaDeploymentParsingProcessor.process(resolveProperties, deploymentRoot, null, deploymentName); IronJacamarXmlDescriptor ironJacamarXmlDescriptor = IronJacamarDeploymentParsingProcessor.process(deploymentRoot, resolveProperties);</BUG> RaNativeProcessor.process(deploymentRoot); Map<ResourceRoot, Index> annotationIndexes = new HashMap<ResourceRoot, Index>(); ResourceRootIndexer.indexResourceRoot(resourceRoot);
final MountHandle mountHandle = new MountHandle(closable); final ResourceRoot resourceRoot = new ResourceRoot(child, mountHandle); final VirtualFile deploymentRoot = resourceRoot.getRoot(); if (deploymentRoot == null || !deploymentRoot.exists()) return; ConnectorXmlDescriptor connectorXmlDescriptor = RaDeploymentParsingProcessor.process(resolveProperties, deploymentRoot, null, name); IronJacamarXmlDescriptor ironJacamarXmlDescriptor = IronJacamarDeploymentParsingProcessor.process(deploymentRoot, resolveProperties); RaNativeProcessor.process(deploymentRoot); Map<ResourceRoot, Index> annotationIndexes = new HashMap<ResourceRoot, Index>(); ResourceRootIndexer.indexResourceRoot(resourceRoot);
957
package org.jboss.as.connector.subsystems.resourceadapters; import java.util.HashMap; import java.util.Map; public enum Namespace { UNKNOWN(null), <BUG>RESOURCEADAPTERS_1_0("urn:jboss:domain:resource-adapters:1.0"); public static final Namespace CURRENT = RESOURCEADAPTERS_1_0; </BUG> private final String name;
package org.jboss.as.connector.subsystems.resourceadapters; import java.util.HashMap; import java.util.Map; public enum Namespace { UNKNOWN(null), RESOURCEADAPTERS_1_0("urn:jboss:domain:resource-adapters:1.0"), RESOURCEADAPTERS_1_1("urn:jboss:domain:resource-adapters:1.1"); public static final Namespace CURRENT = RESOURCEADAPTERS_1_1; private final String name;
958
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.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; import org.rajawali3d.math.Matrix4; import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3; import org.rajawali3d.primitives.ScreenQuad; import org.rajawali3d.primitives.Sphere; import org.rajawali3d.renderer.RajawaliRenderer;
959
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() {
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } 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]); } public int getTextureId() {
960
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;
package com.projecttango.examples.java.helloareadescription; import com.google.atap.tangoservice.Tango; import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig; import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
961
Toast.makeText(this, R.string.tango_not_ready, Toast.LENGTH_SHORT).show(); return; } Bundle bundle = new Bundle(); TangoAreaDescriptionMetaData metaData = mTango.loadAreaDescriptionMetaData(mCurrentUuid); <BUG>byte[] adfNameBytes = metaData.get("name"); if (adfNameBytes != null) {</BUG> String fillDialogName = new String(adfNameBytes); <BUG>bundle.putString("name", fillDialogName); } bundle.putString("id", mCurrentUuid); FragmentManager manager = getFragmentManager();</BUG> SetAdfNameDialog setAdfNameDialog = new SetAdfNameDialog();
Toast.makeText(this, R.string.tango_not_ready, Toast.LENGTH_SHORT).show(); return; } Bundle bundle = new Bundle(); TangoAreaDescriptionMetaData metaData = mTango.loadAreaDescriptionMetaData(mCurrentUuid); byte[] adfNameBytes = metaData.get(TangoAreaDescriptionMetaData.KEY_NAME); if (adfNameBytes != null) { String fillDialogName = new String(adfNameBytes); bundle.putString(TangoAreaDescriptionMetaData.KEY_NAME, fillDialogName); } bundle.putString(TangoAreaDescriptionMetaData.KEY_UUID, mCurrentUuid); FragmentManager manager = getFragmentManager(); SetAdfNameDialog setAdfNameDialog = new SetAdfNameDialog();
962
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;
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; import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent; import com.google.atap.tangoservice.TangoOutOfDateException; import com.google.atap.tangoservice.TangoPoseData; import com.google.atap.tangoservice.TangoXyzIjData;
963
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) {
super.onResume(); if (!mIsConnected) { mTango = new Tango(AugmentedRealityActivity.this, new Runnable() { @Override public void run() { try { TangoSupport.initialize(); connectTango(); setupRenderer(); mIsConnected = true; } catch (TangoOutOfDateException e) {
964
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
if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) { mRenderer.updateRenderCameraPose(lastFramePose); mCameraPoseTimestamp = lastFramePose.timestamp; } else { Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread); } } } } @Override
965
package com.continuuity.explore.executor; import com.continuuity.common.conf.Constants; import com.continuuity.http.AbstractHttpHandler; <BUG>import com.continuuity.http.HttpResponder; import org.jboss.netty.handler.codec.http.HttpRequest;</BUG> import org.jboss.netty.handler.codec.http.HttpResponseStatus; import javax.ws.rs.GET; import javax.ws.rs.Path;
package com.continuuity.explore.executor; import com.continuuity.common.conf.Constants; import com.continuuity.http.AbstractHttpHandler; import com.continuuity.http.HttpResponder; import com.google.gson.JsonObject; import org.jboss.netty.handler.codec.http.HttpRequest; import org.jboss.netty.handler.codec.http.HttpResponseStatus; import javax.ws.rs.GET; import javax.ws.rs.Path;
966
ReactorServiceManager reactorServiceManager = reactorServiceManagementMap.get(serviceName); if (!reactorServiceManager.isServiceEnabled()) { responder.sendString(HttpResponseStatus.FORBIDDEN, String.format("Service %s is not enabled", serviceName)); return; } <BUG>if (reactorServiceManager.canCheckStatus() && reactorServiceManager.isServiceAvailable()) { responder.sendString(HttpResponseStatus.OK, STATUSOK); } else if (reactorServiceManager.canCheckStatus()) { responder.sendString(HttpResponseStatus.OK, STATUSNOTOK); </BUG> } else {
ReactorServiceManager reactorServiceManager = reactorServiceManagementMap.get(serviceName); if (!reactorServiceManager.isServiceEnabled()) { responder.sendString(HttpResponseStatus.FORBIDDEN, String.format("Service %s is not enabled", serviceName)); return; } if (reactorServiceManager.canCheckStatus() && reactorServiceManager.isServiceAvailable()) { JsonObject json = new JsonObject(); json.addProperty("status", STATUSOK); responder.sendJson(HttpResponseStatus.OK, json); } else if (reactorServiceManager.canCheckStatus()) { JsonObject json = new JsonObject(); json.addProperty("status", STATUSNOTOK); responder.sendJson(HttpResponseStatus.OK, json); } else {
967
private Cipher cipher = null; public static boolean networkEnabled = true; protected KKImageRequestListener imageRequestListener = new KKImageRequestListener() { @Override public void onComplete(KKImageRequest request, Bitmap bitmap) { <BUG>if (request.getActionType() == ActionType.CALL_LISTENER) { if (request.getImageCacheListener() != null) { request.getImageCacheListener().onReceiveBitmap(bitmap); } } else if (request.getActionType() == ActionType.UPDATE_VIEW_BACKGROUND) { View view = request.getView();</BUG> view.setBackgroundDrawable(new BitmapDrawable(context.getResources(), bitmap));
private Cipher cipher = null; public static boolean networkEnabled = true; protected KKImageRequestListener imageRequestListener = new KKImageRequestListener() { @Override public void onComplete(KKImageRequest request, Bitmap bitmap) { if (request.getActionType() == ActionType.UPDATE_VIEW_BACKGROUND) { View view = request.getView(); view.setBackgroundDrawable(new BitmapDrawable(context.getResources(), bitmap));
968
if (Build.VERSION.SDK_INT >= 9 && context.getCacheDir().getFreeSpace() < FATAL_STORAGE_SIZE) { clearCacheFiles(context); } gc(); } <BUG>public void downloadBitmap(String url, String localPath, KKImageOnReceiveHttpHeaderListener onReceiveHttpHeaderListener) { KKImageRequest request = new KKImageRequest(context, url, localPath, onReceiveHttpHeaderListener, cipher); </BUG> workingList.add(request); <BUG>startFetch(); } public KKImageRequest loadBitmap(KKImageListener listener, String url, String localPath) { KKImageRequest request = new KKImageRequest(context, url, localPath, listener, cipher); </BUG> workingList.add(request);
if (Build.VERSION.SDK_INT >= 9 && context.getCacheDir().getFreeSpace() < FATAL_STORAGE_SIZE) { clearCacheFiles(context); } gc(); } public KKImageRequest downloadBitmap(String url, String localPath, OnImageDownloadedListener listener) { KKImageRequest request = new KKImageRequest(context, url, localPath, cipher, listener); workingList.add(request);
969
if (cacheFile.exists()) { return BitmapFactory.decodeFile(cachePath); } return null; } <BUG>private void updateView(View view, String url, String localPath, int defaultResourceId, boolean updateBackground, boolean saveToLocal, KKImageOnReceiveHttpHeaderListener onReceiveHttpHeaderListener) { KKImageRequest request = fetchList.get(view);</BUG> if (request != null) {
if (cacheFile.exists()) { return BitmapFactory.decodeFile(cachePath); } return null; } private KKImageRequest updateView(View view, String url, String localPath, int defaultResourceId, boolean updateBackground, boolean saveToLocal, OnImageDownloadedListener listener) { KKImageRequest request = fetchList.get(view); if (request != null) {
970
KKImageOnReceiveHttpHeaderListener onReceiveHttpHeaderListener) { KKImageRequest request = fetchList.get(view);</BUG> if (request != null) { if (request.getUrl().equals(url)) { <BUG>return; </BUG> } else { if (request.getStatus() == UserTask.Status.RUNNING) { request.cancel();
if (cacheFile.exists()) { return BitmapFactory.decodeFile(cachePath); } return null; } private KKImageRequest updateView(View view, String url, String localPath, int defaultResourceId, boolean updateBackground, boolean saveToLocal, OnImageDownloadedListener listener) { KKImageRequest request = fetchList.get(view); if (request != null) { if (request.getUrl().equals(url)) { return null; } else { if (request.getStatus() == UserTask.Status.RUNNING) { request.cancel();
971
package com.kkbox.toolkit.example.image; <BUG>import android.graphics.Bitmap; import android.os.Bundle;</BUG> import android.view.View; import android.view.ViewGroup; import android.widget.Button;
package com.kkbox.toolkit.example.image; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.widget.Button;
972
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_image); mLinearLayout = (LinearLayout) findViewById(R.id.weather_table); mAuto = (Button) findViewById(R.id.update_view); <BUG>mManual = (Button) findViewById(R.id.load_image); mClear = (Button) findViewById(R.id.clear_cache); mStatus = (TextView) findViewById(R.id.image_status);</BUG> mImageManager = new KKImageManager(this, null); mWeatherIcon = new ImageView[5];
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_image); mLinearLayout = (LinearLayout) findViewById(R.id.weather_table); mAuto = (Button) findViewById(R.id.update_view); mManual = (Button) findViewById(R.id.load_image); mDownload = (Button) findViewById(R.id.download_image); mClear = (Button) findViewById(R.id.clear_cache); mImageManager = new KKImageManager(this, null); mWeatherIcon = new ImageView[5];
973
mLinearLayout.addView(mWeatherIcon[i]); } mAuto.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { <BUG>int size = SampleUtil.pic_url.length;</BUG> resetIcon(); <BUG>for (int i = 0; i < size; i++) { mImageManager.updateViewSource(mWeatherIcon[i], SampleUtil.pic_url[i], null, R.drawable.ic_launcher);</BUG> }
mLinearLayout.addView(mWeatherIcon[i]); } mAuto.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { resetIcon(); for (int i = 0; i < SampleUtil.pic_url.length; i++) { mImageManager.updateViewSource(mWeatherIcon[i], SampleUtil.pic_url[i], null, R.drawable.ic_launcher);
974
{ System.out.printf("粗分词网:\n%s\n", wordNetAll); } List<Vertex> vertexList = viterbi(wordNetAll); if (config.useCustomDictionary) <BUG>{ combineByCustomDictionary(vertexList); </BUG> } if (HanLP.Config.DEBUG)
{ @Override protected List<Term> segSentence(char[] sentence) { WordNet wordNetAll = new WordNet(sentence); GenerateWordNet(wordNetAll); if (HanLP.Config.DEBUG)
975
{ System.out.printf("粗分词图:%s\n", graph.printByTo()); } List<Vertex> vertexList = dijkstra(graph); if (config.useCustomDictionary) <BUG>{ combineByCustomDictionary(vertexList); </BUG> } if (HanLP.Config.DEBUG)
{ @Override public List<Term> segSentence(char[] sentence) { WordNet wordNetOptimum = new WordNet(sentence); WordNet wordNetAll = new WordNet(wordNetOptimum.charArray); GenerateWordNet(wordNetAll); Graph graph = GenerateBiGraph(wordNetAll); if (HanLP.Config.DEBUG)
976
if (config.speechTagging) { speechTagging(vertexList); } if (config.useCustomDictionary) <BUG>{ combineByCustomDictionary(vertexList); </BUG> } return convert(vertexList, config.offset);
if (config.speechTagging) { speechTagging(vertexList); } if (config.useCustomDictionary) { if (config.indexMode) combineByCustomDictionary(vertexList, wordNetAll); else combineByCustomDictionary(vertexList); } return convert(vertexList, config.offset);
977
result_ = multiline_value_assignment(builder_, level_ + 1); } else if (root_ == OBJECT_PATH) { result_ = object_path(builder_, level_ + 1); } <BUG>else if (root_ == ONE_LINE_COMMENT_ELEMENT) { result_ = one_line_comment_element(builder_, level_ + 1); }</BUG> else if (root_ == UNSETTING) { result_ = unsetting(builder_, level_ + 1);
result_ = multiline_value_assignment(builder_, level_ + 1); } else if (root_ == OBJECT_PATH) { result_ = object_path(builder_, level_ + 1); } else if (root_ == UNSETTING) { result_ = unsetting(builder_, level_ + 1);
978
else if (root_ == VALUE_MODIFICATION) { result_ = value_modification(builder_, level_ + 1); } else { Marker marker_ = builder_.mark(); <BUG>result_ = c_style_comment_element(builder_, level_ + 1); while (builder_.getTokenType() != null) {</BUG> builder_.advanceLexer(); } marker_.done(root_);
else if (root_ == VALUE_MODIFICATION) { result_ = value_modification(builder_, level_ + 1); } else { Marker marker_ = builder_.mark(); result_ = parse_root_(root_, builder_, level_); while (builder_.getTokenType() != null) { builder_.advanceLexer(); } marker_.done(root_);
979
result_ = assignment(builder_, level_ + 1); if (!result_) result_ = value_modification(builder_, level_ + 1); if (!result_) result_ = multiline_value_assignment(builder_, level_ + 1); if (!result_) result_ = copying(builder_, level_ + 1); if (!result_) result_ = unsetting(builder_, level_ + 1); <BUG>if (!result_) result_ = code_block(builder_, level_ + 1); if (!result_) {</BUG> marker_.rollbackTo(); } else {
result_ = assignment(builder_, level_ + 1); if (!result_) result_ = value_modification(builder_, level_ + 1); if (!result_) result_ = multiline_value_assignment(builder_, level_ + 1); if (!result_) result_ = copying(builder_, level_ + 1); if (!result_) result_ = unsetting(builder_, level_ + 1); if (!result_) result_ = code_block(builder_, level_ + 1); if (!result_) result_ = condition_element(builder_, level_ + 1); if (!result_) result_ = include_statement_element(builder_, level_ + 1); if (!result_) { marker_.rollbackTo(); } else {
980
while (true) { <BUG>if (!multiline_value_assignment_2_0(builder_, level_ + 1)) break; </BUG> int next_offset_ = builder_.getCurrentOffset(); if (offset_ == next_offset_) { <BUG>empty_element_parsed_guard_(builder_, offset_, "multiline_value_assignment_2"); </BUG> break; } offset_ = next_offset_;
while (true) { if (!multiline_value_assignment_3_0(builder_, level_ + 1)) break; int next_offset_ = builder_.getCurrentOffset(); if (offset_ == next_offset_) { empty_element_parsed_guard_(builder_, offset_, "multiline_value_assignment_3"); break; } offset_ = next_offset_;
981
else { marker_.drop(); } return result_; } <BUG>private static boolean multiline_value_assignment_4(PsiBuilder builder_, int level_) { if (!recursion_guard_(builder_, level_, "multiline_value_assignment_4")) return false; </BUG> consumeToken(builder_, IGNORED_TEXT);
else { marker_.rollbackTo(); } result_ = exitErrorRecordingSection(builder_, result_, level_, pinned_, _SECTION_GENERAL_, null); return result_ || pinned_; } private static boolean multiline_value_assignment_2(PsiBuilder builder_, int level_) { if (!recursion_guard_(builder_, level_, "multiline_value_assignment_2")) return false; consumeToken(builder_, IGNORED_TEXT);
982
if (!recursion_guard_(builder_, level_, "one_line_comment_element")) return false; if (!nextTokenIs(builder_, ONE_LINE_COMMENT)) return false;</BUG> boolean result_ = false; <BUG>final Marker marker_ = builder_.mark(); result_ = consumeToken(builder_, ONE_LINE_COMMENT); if (result_) { marker_.done(ONE_LINE_COMMENT_ELEMENT); } else {</BUG> marker_.rollbackTo();
if (!recursion_guard_(builder_, level_, "object_path_1_0")) return false; return object_path_1_0_0(builder_, level_ + 1); } private static boolean object_path_1_0_0(PsiBuilder builder_, int level_) { if (!recursion_guard_(builder_, level_, "object_path_1_0_0")) return false; boolean result_ = false; boolean pinned_ = false; final Marker marker_ = builder_.mark(); enterErrorRecordingSection(builder_, level_, _SECTION_GENERAL_); result_ = consumeToken(builder_, OBJECT_PATH_ENTITY); result_ = result_ && consumeToken(builder_, OBJECT_PATH_SEPARATOR); pinned_ = result_; // pin = 2 if (!result_ && !pinned_) {
983
import org.jetbrains.mps.openapi.language.SAbstractConcept; import org.jetbrains.mps.openapi.language.SConcept; import org.jetbrains.mps.openapi.language.SContainmentLink; import org.jetbrains.mps.openapi.language.SLanguage; import org.jetbrains.mps.openapi.language.SProperty; <BUG>import org.jetbrains.mps.openapi.language.SReferenceLink; import org.jetbrains.mps.openapi.model.SNode;</BUG> import org.jetbrains.mps.openapi.model.SNodeAccessUtil; public class MetaAdapterByDeclaration { private static final Logger LOG = Logger.wrap(LogManager.getLogger(MetaAdapterByDeclaration.class));
import org.jetbrains.mps.openapi.language.SAbstractConcept; import org.jetbrains.mps.openapi.language.SConcept; import org.jetbrains.mps.openapi.language.SContainmentLink; import org.jetbrains.mps.openapi.language.SLanguage; import org.jetbrains.mps.openapi.language.SProperty; import org.jetbrains.mps.openapi.language.SReferenceLink; import org.jetbrains.mps.openapi.model.SModel; import org.jetbrains.mps.openapi.model.SNode; import org.jetbrains.mps.openapi.model.SNodeAccessUtil; public class MetaAdapterByDeclaration { private static final Logger LOG = Logger.wrap(LogManager.getLogger(MetaAdapterByDeclaration.class));
984
} public static SAbstractConcept getConcept(SNode node) { SConcept concept = node.getConcept(); boolean cd = concept.equals(SNodeUtil.concept_ConceptDeclaration); boolean icd = concept.equals(SNodeUtil.concept_InterfaceConceptDeclaration); <BUG>if (cd || icd) { String name = NameUtil.getModelLongName(node.getModel()) + "." + getNormalizedName(node); </BUG> if (cd) { return MetaAdapterFactory.getConcept(MetaIdByDeclaration.getConceptId(node), name);
} public static SAbstractConcept getConcept(SNode node) { SConcept concept = node.getConcept(); boolean cd = concept.equals(SNodeUtil.concept_ConceptDeclaration); boolean icd = concept.equals(SNodeUtil.concept_InterfaceConceptDeclaration); if (!cd && !icd) return null; SModel model = node.getModel(); if (model == null) return null; if (!(model.getModule() instanceof Language)) return null; String name = NameUtil.getModelLongName(model) + "." + getNormalizedName(node); if (cd) { return MetaAdapterFactory.getConcept(MetaIdByDeclaration.getConceptId(node), name);
985
if (cd) { return MetaAdapterFactory.getConcept(MetaIdByDeclaration.getConceptId(node), name); } else { return MetaAdapterFactory.getInterfaceConcept(MetaIdByDeclaration.getConceptId(node), name); } <BUG>} return null;</BUG> } public static SConcept getInstanceConcept(SNode c) { return asInstanceConcept(getConcept(c));
if (cd) { return MetaAdapterFactory.getConcept(MetaIdByDeclaration.getConceptId(node), name); } else { return MetaAdapterFactory.getInterfaceConcept(MetaIdByDeclaration.getConceptId(node), name); } } public static SConcept getInstanceConcept(SNode c) { return asInstanceConcept(getConcept(c));
986
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.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; import org.rajawali3d.math.Matrix4; import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3; import org.rajawali3d.primitives.ScreenQuad; import org.rajawali3d.primitives.Sphere; import org.rajawali3d.renderer.RajawaliRenderer;
987
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() {
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } 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]); } public int getTextureId() {
988
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;
package com.projecttango.examples.java.helloareadescription; import com.google.atap.tangoservice.Tango; import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig; import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
989
Toast.makeText(this, R.string.tango_not_ready, Toast.LENGTH_SHORT).show(); return; } Bundle bundle = new Bundle(); TangoAreaDescriptionMetaData metaData = mTango.loadAreaDescriptionMetaData(mCurrentUuid); <BUG>byte[] adfNameBytes = metaData.get("name"); if (adfNameBytes != null) {</BUG> String fillDialogName = new String(adfNameBytes); <BUG>bundle.putString("name", fillDialogName); } bundle.putString("id", mCurrentUuid); FragmentManager manager = getFragmentManager();</BUG> SetAdfNameDialog setAdfNameDialog = new SetAdfNameDialog();
Toast.makeText(this, R.string.tango_not_ready, Toast.LENGTH_SHORT).show(); return; } Bundle bundle = new Bundle(); TangoAreaDescriptionMetaData metaData = mTango.loadAreaDescriptionMetaData(mCurrentUuid); byte[] adfNameBytes = metaData.get(TangoAreaDescriptionMetaData.KEY_NAME); if (adfNameBytes != null) { String fillDialogName = new String(adfNameBytes); bundle.putString(TangoAreaDescriptionMetaData.KEY_NAME, fillDialogName); } bundle.putString(TangoAreaDescriptionMetaData.KEY_UUID, mCurrentUuid); FragmentManager manager = getFragmentManager(); SetAdfNameDialog setAdfNameDialog = new SetAdfNameDialog();
990
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;
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; import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent; import com.google.atap.tangoservice.TangoOutOfDateException; import com.google.atap.tangoservice.TangoPoseData; import com.google.atap.tangoservice.TangoXyzIjData;
991
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) {
super.onResume(); if (!mIsConnected) { mTango = new Tango(AugmentedRealityActivity.this, new Runnable() { @Override public void run() { try { TangoSupport.initialize(); connectTango(); setupRenderer(); mIsConnected = true; } catch (TangoOutOfDateException e) {
992
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
if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) { mRenderer.updateRenderCameraPose(lastFramePose); mCameraPoseTimestamp = lastFramePose.timestamp; } else { Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread); } } } } @Override
993
public MongoCommit execute() throws Exception { DBCollection commitCollection = nodeStore.getCommitCollection(); DBObject query = QueryBuilder.start(MongoCommit.KEY_FAILED).notEquals(Boolean.TRUE) .and(MongoCommit.KEY_REVISION_ID).is(revisionId) .get(); <BUG>LOG.debug(String.format("Executing query: %s", query)); </BUG> DBObject dbObject = commitCollection.findOne(query); if (dbObject == null) { throw new Exception(String.format("Commit with revision %d could not be found", revisionId));
public MongoCommit execute() throws Exception { DBCollection commitCollection = nodeStore.getCommitCollection(); DBObject query = QueryBuilder.start(MongoCommit.KEY_FAILED).notEquals(Boolean.TRUE) .and(MongoCommit.KEY_REVISION_ID).is(revisionId) .get(); LOG.debug("Executing query: {}", query); DBObject dbObject = commitCollection.findOne(query); if (dbObject == null) { throw new Exception(String.format("Commit with revision %d could not be found", revisionId));
994
super(nodeStore); this.commit = (MongoCommit)commit; } @Override public Long execute() throws Exception { <BUG>logger.debug(String.format("Trying to commit: %s", commit.getDiff())); </BUG> boolean success = false; do { mongoSync = new ReadAndIncHeadRevisionAction(nodeStore).execute();
super(nodeStore); this.commit = (MongoCommit)commit; } @Override public Long execute() throws Exception { logger.debug("Trying to commit: {}", commit.getDiff()); boolean success = false; do { mongoSync = new ReadAndIncHeadRevisionAction(nodeStore).execute();
995
existingNodes = action.execute(); } private void mergeNodes() { for (MongoNode existingNode : existingNodes) { for (MongoNode committingNode : nodes) { <BUG>if (existingNode.getPath().equals(committingNode.getPath())) { logger.debug(String.format("Found existing node to merge: %s", existingNode.getPath())); logger.debug(String.format("Existing node: %s", existingNode)); logger.debug(String.format("Committing node: %s", committingNode)); Map<String, Object> existingProperties = existingNode.getProperties();</BUG> if (!existingProperties.isEmpty()) {
existingNodes = action.execute(); } private void mergeNodes() { for (MongoNode existingNode : existingNodes) { for (MongoNode committingNode : nodes) { if (existingNode.getPath().equals(committingNode.getPath())) { if(logger.isDebugEnabled()){ logger.debug("Found existing node to merge: {}", existingNode.getPath()); logger.debug("Existing node: {}", existingNode); logger.debug("Committing node: {}", committingNode); } Map<String, Object> existingProperties = existingNode.getProperties(); if (!existingProperties.isEmpty()) {
996
Map<String, MongoNode> nodeMongos = new HashMap<String, MongoNode>(); while (dbCursor.hasNext()) { MongoNode nodeMongo = (MongoNode) dbCursor.next(); String path = nodeMongo.getPath(); long revisionId = nodeMongo.getRevisionId(); <BUG>LOG.debug(String.format("Converting node %s (%d)", path, revisionId)); </BUG> if (!validRevisions.contains(revisionId)) { <BUG>LOG.debug(String.format("Node will not be converted as it is not a valid commit %s (%d)", path, revisionId)); continue;</BUG> }
Map<String, MongoNode> nodeMongos = new HashMap<String, MongoNode>(); while (dbCursor.hasNext()) { MongoNode nodeMongo = (MongoNode) dbCursor.next(); String path = nodeMongo.getPath(); long revisionId = nodeMongo.getRevisionId(); LOG.debug("Converting node {} ({})", path, revisionId); if (!validRevisions.contains(revisionId)) { LOG.debug("Node will not be converted as it is not a valid commit {} ({})", path, revisionId); continue; }
997
MongoNode existingNodeMongo = nodeMongos.get(path); if (existingNodeMongo != null) { long existingRevId = existingNodeMongo.getRevisionId(); if (revisionId > existingRevId) { nodeMongos.put(path, nodeMongo); <BUG>LOG.debug(String.format("Converted nodes was put into map and replaced %s (%d)", path, revisionId)); </BUG> } else { <BUG>LOG.debug(String.format("Converted nodes was not put into map because a newer version" + " is available %s (%d)", path, revisionId)); </BUG> }
MongoNode existingNodeMongo = nodeMongos.get(path); if (existingNodeMongo != null) { long existingRevId = existingNodeMongo.getRevisionId(); if (revisionId > existingRevId) { nodeMongos.put(path, nodeMongo); LOG.debug("Converted nodes was put into map and replaced {} ({})", path, revisionId);
998
if (!includeBranchCommits) { queryBuilder = queryBuilder.and(new BasicDBObject(MongoNode.KEY_BRANCH_ID, new BasicDBObject("$exists", false))); } DBObject query = queryBuilder.get(); <BUG>LOG.debug(String.format("Executing query: %s", query)); </BUG> return maxEntries > 0? commitCollection.find(query).limit(maxEntries) : commitCollection.find(query); } private List<MongoCommit> convertToCommits(DBCursor dbCursor) {
if (!includeBranchCommits) { queryBuilder = queryBuilder.and(new BasicDBObject(MongoNode.KEY_BRANCH_ID, new BasicDBObject("$exists", false))); } DBObject query = queryBuilder.get(); LOG.debug("Executing query: {}", query); return maxEntries > 0? commitCollection.find(query).limit(maxEntries) : commitCollection.find(query); } private List<MongoCommit> convertToCommits(DBCursor dbCursor) {
999
SNode method = _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.cast(SNodeOperations.getParent(_context.getNode()), "jetbrains.mps.lang.quotation.structure.Quotation"), "quotationStaticMethod"); SNode varDeclStmt = SNodeOperations.cast(ListSequence.fromList(SLinkOperations.getTargets(SLinkOperations.getTarget(method, "body", true), "statement", true)).first(), "jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement"); return SLinkOperations.getTarget(varDeclStmt, "localVariableDeclaration", true); } public static Object referenceMacro_GetReferent_1196351887115(final IOperationContext operationContext, final ReferenceMacroContext _context) { <BUG>return SNodeOperations.cast(_context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getParent(_context.getNode()), "nodeVariable"), "jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration"); }</BUG> public static Object referenceMacro_GetReferent_1201868923347(final IOperationContext operationContext, final ReferenceMacroContext _context) { <BUG>return SNodeOperations.cast(_context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "nodeVariable"), "jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration"); }</BUG> public static Object referenceMacro_GetReferent_1196351887203(final IOperationContext operationContext, final ReferenceMacroContext _context) {
SNode method = _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.cast(SNodeOperations.getParent(_context.getNode()), "jetbrains.mps.lang.quotation.structure.Quotation"), "quotationStaticMethod"); SNode varDeclStmt = SNodeOperations.cast(ListSequence.fromList(SLinkOperations.getTargets(SLinkOperations.getTarget(method, "body", true), "statement", true)).first(), "jetbrains.mps.baseLanguage.structure.LocalVariableDeclarationStatement"); return SLinkOperations.getTarget(varDeclStmt, "localVariableDeclaration", true); } public static Object referenceMacro_GetReferent_1196351887115(final IOperationContext operationContext, final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getParent(_context.getNode()), "nodeVariable"); } public static Object referenceMacro_GetReferent_1201868923347(final IOperationContext operationContext, final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "nodeVariable"); } public static Object referenceMacro_GetReferent_1196351887203(final IOperationContext operationContext, final ReferenceMacroContext _context) {
1,000
public static Object referenceMacro_GetReferent_1525847198352096750(final IOperationContext operationContext, final ReferenceMacroContext _context) { <BUG>return SNodeOperations.cast(_context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.quotation.structure.Quotation", false, false), "map"), "jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration"); }</BUG> public static Object referenceMacro_GetReferent_1525847198352015013(final IOperationContext operationContext, final ReferenceMacroContext _context) { <BUG>return SNodeOperations.cast(_context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "nodeVariable"), "jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration"); }</BUG> public static Object referenceMacro_GetReferent_1525847198352015051(final IOperationContext operationContext, final ReferenceMacroContext _context) { <BUG>return SNodeOperations.cast(_context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "nodeVariable"), "jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration"); }</BUG> public static Object referenceMacro_GetReferent_1196860200838(final IOperationContext operationContext, final ReferenceMacroContext _context) {
public static Object referenceMacro_GetReferent_1525847198352096750(final IOperationContext operationContext, final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.quotation.structure.Quotation", false, false), "map"); } public static Object referenceMacro_GetReferent_1525847198352015013(final IOperationContext operationContext, final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "nodeVariable"); } public static Object referenceMacro_GetReferent_1525847198352015051(final IOperationContext operationContext, final ReferenceMacroContext _context) { return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "nodeVariable"); } public static Object referenceMacro_GetReferent_1196860200838(final IOperationContext operationContext, final ReferenceMacroContext _context) {