id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
46,401
private final ChunkTopographyUpdater topographyUpdater = new ChunkTopographyUpdater(); private final RegionChangeMonitor refresher = new RegionChangeMonitor(this); private int currentDimension = PersistentSettings.getDimension(); protected ChunkSelectionTracker chunkSelection = new ChunkSelectionTracker(); private BooleanProperty highlightEnabled = new SimpleBooleanProperty(false); <BUG>private Block highlightBlock = Block.DIAMONDORE; </BUG> private Color highlightColor = Color.CRIMSON; private volatile ObjectProperty<ChunkView> map = new SimpleObjectProperty<>(ChunkView.EMPTY); private volatile ChunkView minimap = ChunkView.EMPTY;
private Block highlightBlock = Block.get(Block.DIAMONDORE_ID);
46,402
package se.llbit.chunky.map; <BUG>import org.apache.commons.math3.util.FastMath; import se.llbit.chunky.world.Biomes;</BUG> import se.llbit.chunky.world.Block; import se.llbit.chunky.world.Chunk; import se.llbit.chunky.world.ChunkPosition;
import se.llbit.chunky.resources.Texture; import se.llbit.chunky.world.Biomes;
46,403
Block block1 = Block.get(blocksArray[Chunk.chunkIndex(x, y, z)]); if (!block1.isWater()) break; depth += 1; } <BUG>ColorUtil.getRGBAComponents(Block.WATER.getTexture(data).getAvgColor(), blockColor); </BUG> blockColor[3] = QuickMath.max(.5f, 1.f - depth / 32.f); break; default:
ColorUtil.getRGBAComponents(Texture.water.getAvgColor(), blockColor);
46,404
package se.llbit.chunky.model; import java.util.List; import se.llbit.chunky.resources.Texture; import se.llbit.chunky.world.Block; <BUG>import se.llbit.chunky.world.BlockData; import se.llbit.math.DoubleSidedQuad;</BUG> import se.llbit.math.Quad; import se.llbit.math.QuickMath; import se.llbit.math.Ray;
import se.llbit.chunky.world.Material; import se.llbit.math.DoubleSidedQuad;
46,405
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);
VerticalGroup timeGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR);
46,406
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);
VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR);
46,407
headerGroup.addActor(expandIcon); headerGroup.addActor(detachIcon); addActor(headerGroup); expandIcon.setChecked(expanded); } <BUG>public void expand() { </BUG> if (!expandIcon.isChecked()) { expandIcon.setChecked(true); }
public void expandPane() {
46,408
</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() { public void collapsePane() {
46,409
}); playstop.addListener(new TextTooltip(txt("gui.tooltip.playstop"), skin)); TimeComponent timeComponent = new TimeComponent(skin, ui); timeComponent.initialize(); CollapsiblePane time = new CollapsiblePane(ui, txt("gui.time"), timeComponent.getActor(), skin, true, playstop); <BUG>time.align(Align.left); mainActors.add(time);</BUG> panes.put(timeComponent.getClass().getSimpleName(), time); if (Constants.desktop) { recCamera = new OwnImageButton(skin, "rec");
time.align(Align.left).columnAlign(Align.left); mainActors.add(time);
46,410
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();
objects.align(Align.left).columnAlign(Align.left); mainActors.add(objects);
46,411
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");
music.align(Align.left).columnAlign(Align.left); mainActors.add(music);
46,412
CHEVRON_RIGHT ("chevron-right", "png", false, false), CHEVRON_LEFT ("chevron-left", "png", false, false), SEARCH ("search", "png", false, false), CONTROL_SLIDER_BALL ("control-sliderball", "png", false, false), CONTROL_CHECK_ON ("control-check-on", "png", false, false), <BUG>CONTROL_CHECK_OFF ("control-check-off", "png", false, false), ALPHA_MAP ("alpha", "png", false, false);</BUG> private static final byte IMG_PNG = 1, IMG_JPG = 2;
USER ("user", "user%d", "png", false, false), ALPHA_MAP ("alpha", "png", false, false);
46,413
GameImage(String filename, String type, boolean beatmapSkinnable, boolean preload) { this.filename = filename; this.type = getType(type); this.beatmapSkinnable = beatmapSkinnable; this.preload = preload; <BUG>} public boolean isBeatmapSkinnable() { return beatmapSkinnable; }</BUG> public boolean isPreload() { return preload; } public Image getImage() { setDefaultImage();
GameImage(String filename, String filenameFormat, String type, boolean beatmapSkinnable, boolean preload) { this(filename, type, beatmapSkinnable, preload); this.filenameFormat = filenameFormat; public boolean isBeatmapSkinnable() { return beatmapSkinnable; }
46,414
g.drawRect(0, yPos, rectWidth, rectHeight); g.setLineWidth(oldLineWidth); data.drawSymbolString(rankString, rectWidth, yPos, 1.0f, alpha * 0.2f, true); white.a = blue.a = alpha * 0.75f; if (playerName != null) <BUG>Fonts.MEDIUMBOLD.drawString(xPaddingLeft, yPos + yPadding, playerName, white); Fonts.DEFAULT.drawString(</BUG> xPaddingLeft, yPos + rectHeight - Fonts.DEFAULT.getLineHeight() - yPadding, scoreString, white ); Fonts.DEFAULT.drawString(
Fonts.MEDIUM.drawString(xPaddingLeft, yPos + yPadding, playerName, white);
46,415
int objectCount = hit300 + hit100 + hit50 + miss; if (objectCount > 0) percent = (hit300 * 300 + hit100 * 100 + hit50 * 50) / (objectCount * 300f) * 100f; return percent; } <BUG>private float getScorePercent() { </BUG> return getScorePercent( hitResultCount[HIT_300], hitResultCount[HIT_100], hitResultCount[HIT_50], hitResultCount[HIT_MISS]
public float getScorePercent() {
46,416
sd.score = slidingScore ? scoreDisplay : score; sd.combo = comboMax; sd.perfect = (comboMax == fullObjectCount); sd.mods = GameMod.getModState(); sd.replayString = (replay == null) ? null : replay.getReplayFilename(); <BUG>sd.playerName = null; // TODO return sd;</BUG> } public Replay getReplay(ReplayFrame[] frames, Beatmap beatmap) { if (replay != null && frames == null)
sd.playerName = GameMod.AUTO.isActive() ? UserList.AUTO_USER_NAME : UserList.get().getCurrentUser().getName(); return sd;
46,417
return null; replay = new Replay(); replay.mode = Beatmap.MODE_OSU; replay.version = Updater.get().getBuildDate(); replay.beatmapHash = (beatmap == null) ? "" : beatmap.md5Hash; <BUG>replay.playerName = ""; // TODO replay.replayHash = Long.toString(System.currentTimeMillis()); // TODO</BUG> replay.hit300 = (short) hitResultCount[HIT_300]; replay.hit100 = (short) hitResultCount[HIT_100]; replay.hit50 = (short) hitResultCount[HIT_50];
replay.playerName = UserList.get().getCurrentUser().getName(); replay.replayHash = Long.toString(System.currentTimeMillis()); // TODO
46,418
import itdelatrisu.opsu.downloads.Download; import itdelatrisu.opsu.downloads.DownloadNode; import itdelatrisu.opsu.replay.PlaybackSpeed; import itdelatrisu.opsu.ui.Colors; import itdelatrisu.opsu.ui.Fonts; <BUG>import itdelatrisu.opsu.ui.UI; import java.awt.image.BufferedImage;</BUG> import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.File;
import itdelatrisu.opsu.user.UserButton; import itdelatrisu.opsu.user.UserList; import java.awt.image.BufferedImage;
46,419
import com.xpn.xwiki.plugin.XWikiPluginInterface; import com.xpn.xwiki.plugin.mailsender.MailSenderPlugin; import com.xpn.xwiki.plugin.mailsender.MailSenderPluginApi; import com.xpn.xwiki.plugin.scheduler.SchedulerPlugin; import org.apache.commons.logging.Log; <BUG>import org.apache.commons.logging.LogFactory; import org.apache.velocity.VelocityContext;</BUG> import org.joda.time.DateTime; import org.joda.time.Hours; import org.joda.time.Days;
import org.apache.commons.lang.StringUtils; import org.apache.velocity.VelocityContext;
46,420
private boolean inEditMode; private Random mRandom; @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); <BUG>setHasOptionsMenu(true); }</BUG> @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
setRetainInstance(true); }
46,421
<BUG>package com.anarchy.classifyview.sample.ireader; import android.text.TextUtils;</BUG> import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup;
import android.graphics.drawable.Drawable; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.content.ContextCompat; import android.text.TextUtils;
46,422
import android.view.View; import android.view.ViewGroup; import com.anarchy.classify.ClassifyView; import com.anarchy.classify.simple.PrimitiveSimpleAdapter; import com.anarchy.classify.simple.widget.InsertAbleGridView; <BUG>import com.anarchy.classifyview.R; import com.anarchy.classifyview.sample.ireader.model.IReaderMockData;</BUG> import com.anarchy.classifyview.sample.ireader.model.IReaderMockDataGroup; import java.util.ArrayList; import java.util.Arrays;
import com.anarchy.classifyview.databinding.ItemIReaderFolderBinding; import com.anarchy.classifyview.sample.ireader.model.IReaderMockData;
46,423
import java.util.List; public class IReaderAdapter extends PrimitiveSimpleAdapter<IReaderMockDataGroup, IReaderAdapter.ViewHolder> { private List<IReaderMockData> mMockSource; private boolean mMockSourceChanged; private List<IReaderMockDataGroup> mLastMockGroup; <BUG>private boolean mEditMode; public List<IReaderMockData> getMockSource() {</BUG> return mMockSource; } public void setMockSource(List<IReaderMockData> mockSource) {
private int[] mDragPosition = new int[2]; public List<IReaderMockData> getMockSource() {
46,424
IReaderMockDataGroup group = new IReaderMockDataGroup(); List<IReaderMockData> child = new ArrayList<>(); child.add(target); child.add(select); group.setChild(child); <BUG>group.setCategory(generateNewCategoryTag()); mMockSource.remove(targetPosition);</BUG> mMockSource.add(targetPosition,group); } mMockSourceChanged = true;
targetPosition = mMockSource.indexOf(target); mMockSource.remove(targetPosition);
46,425
import com.anarchy.classifyview.sample.normal.NormalFragment; import com.anarchy.classifyview.sample.normalfolder.NormalFolderFragment; import com.anarchy.classifyview.sample.viewpager.ViewPagerFragment; public class ContentActivity extends AppCompatActivity { private Class<? extends Fragment>[] mClasses = new Class[]{NormalFragment.class, <BUG>DemonstrateFragment.class, ViewPagerFragment.class, LayoutManagerFragment.class,NormalFolderFragment.class};//IReaderMockFragment.class, private int position;</BUG> @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState);
DemonstrateFragment.class, ViewPagerFragment.class, LayoutManagerFragment.class, private int position;
46,426
private static final int FOLDER_ID = R.id.i_reader_folder_bg; private static final int TAG_ID = R.id.i_reader_folder_tag; private static final int CONTAINER_GRID_ID = R.id.i_reader_folder_grid; private static final int CHECK_BOX_ID = R.id.i_reader_folder_check_box; private static final int CONTENT_ID = R.id.i_reader_folder_content; <BUG>private SimpleAdapter mSimpleAdapter; </BUG> private GridLayout mGridLayout; private FrameLayout mContent; private TextView mTagView;
private PrimitiveSimpleAdapter mSimpleAdapter;
46,427
private final Ratio failureRatio; private volatile int executions; private volatile int successiveFailures;</BUG> private CircularBitSet bitSet; public ClosedState(CircuitBreaker circuit) { <BUG>this.circuit = circuit; this.failureThresh = circuit.getFailureThreshold(); this.failureRatio = circuit.getFailureThresholdRatio(); if (failureRatio != null) bitSet = new CircularBitSet(failureRatio.denominator);</BUG> }
package net.jodah.failsafe.internal; import net.jodah.failsafe.CircuitBreaker; import net.jodah.failsafe.CircuitBreaker.State; import net.jodah.failsafe.internal.util.CircularBitSet; import net.jodah.failsafe.util.Ratio; public class ClosedState extends CircuitState { private final CircuitBreaker circuit; setThreshold(circuit.getFailureThreshold() != null ? circuit.getFailureThreshold() : ONE_OF_ONE);
46,428
public State getState() { return State.CLOSED; } @Override public synchronized void recordFailure() { <BUG>executions++; successiveFailures++; if (bitSet != null)</BUG> bitSet.setNext(false); checkThreshold();
[DELETED]
46,429
return currentExecutions.get(); } }; private Duration delay = Duration.NONE; private Duration timeout; <BUG>private Integer failureThreshold; private Ratio failureThresholdRatio; private Integer successThreshold; private Ratio successThresholdRatio; private boolean failuresChecked;</BUG> private List<BiPredicate<Object, Throwable>> failureConditions;
private Ratio failureThreshold; private Ratio successThreshold; private boolean failuresChecked;
46,430
private List<BiPredicate<Object, Throwable>> failureConditions; CheckedRunnable onOpen; CheckedRunnable onHalfOpen; CheckedRunnable onClose; public CircuitBreaker() { <BUG>failureConditions = new ArrayList<BiPredicate<Object, Throwable>>(); }</BUG> public enum State { CLOSED, OPEN,
state.set(new ClosedState(this)); }
46,431
for (BiPredicate<Object, Throwable> predicate : failureConditions) { if (predicate.test(result, failure)) return true; } return failure != null && !failuresChecked; <BUG>} public boolean isOpen() {</BUG> return State.OPEN.equals(getState()); } public void onClose(CheckedRunnable runnable) {
public boolean isHalfOpen() { return State.HALF_OPEN.equals(getState()); public boolean isOpen() {
46,432
Assert.isTrue(delay > 0, "delay must be greater than 0"); this.delay = new Duration(delay, timeUnit); return this; } public CircuitBreaker withFailureThreshold(int failureThreshold) { <BUG>Assert.isTrue(failureThreshold >= 1, "failureThreshold must be greater than or equal to 1"); Assert.state(failureThresholdRatio == null, "failure threshold and failure threshold ratio cannot both be configured"); this.failureThreshold = failureThreshold; return this;</BUG> }
return withFailureThreshold(failureThreshold, failureThreshold);
46,433
} public CircuitBreaker withFailureThreshold(int failures, int executions) { Assert.isTrue(failures >= 1, "failures must be greater than or equal to 1"); Assert.isTrue(executions >= 1, "executions must be greater than or equal to 1"); Assert.isTrue(executions >= failures, "executions must be greater than or equal to failures"); <BUG>Assert.state(failureThreshold == null, "failure threshold and failure threshold ratio cannot both be configured"); this.failureThresholdRatio = new Ratio(failures, executions); return this;</BUG> } public CircuitBreaker withSuccessThreshold(int successThreshold) {
@Override public String toString() { return getState().toString();
46,434
public CircuitBreaker withTimeout(long timeout, TimeUnit timeUnit) { Assert.notNull(timeUnit, "timeUnit"); Assert.isTrue(timeout > 0, "timeout must be greater than 0"); this.timeout = new Duration(timeout, timeUnit); return this; <BUG>} synchronized void initialize() { if (state.get() == null) state.set(new ClosedState(this));</BUG> }
void before() { currentExecutions.incrementAndGet();
46,435
else circuitState.recordSuccess(); } finally {</BUG> currentExecutions.decrementAndGet(); } <BUG>} } void before() { currentExecutions.incrementAndGet();</BUG> }
state.get().recordSuccess(); } finally {
46,436
public AsyncFailsafe<R> with(Scheduler scheduler) { return new AsyncFailsafe<R>(this, Assert.notNull(scheduler, "scheduler")); } @SuppressWarnings("unchecked") private <T> T call(Callable<T> callable) { <BUG>if (circuitBreaker != null) circuitBreaker.initialize();</BUG> Execution execution = new Execution(retryPolicy, circuitBreaker, (ListenerConfig<?, Object>) this); if (callable instanceof ContextualCallableWrapper) ((ContextualCallableWrapper<T>) callable).inject(execution);
[DELETED]
46,437
return id; } public void setId(String oid) { id = oid; } <BUG>public boolean equalsId(String oid) { </BUG> return id.equalsIgnoreCase(oid); } public String getName() {
public boolean equalsId(@NonNls String oid) {
46,438
protected String getHeader() { return String.format("[%d][%s]: ", isIterative ? getIterationRuntimeContext().getSuperstepNumber() : 0, prefix != null && !prefix.isEmpty() ? prefix : " "); } <BUG>private Map<GradoopId, PropertyValue> initMapping( List<Tuple2<GradoopId, PropertyValue>> tuples) { Map<GradoopId, PropertyValue> map = Maps.newHashMap(); for (Tuple2<GradoopId, PropertyValue> tuple : tuples) { </BUG> map.put(tuple.f0, tuple.f1);
[DELETED]
46,439
package org.gradoop.flink.model.impl.operators.matching.common.debug; import org.apache.commons.lang3.StringUtils; import org.apache.flink.api.common.functions.IterationRuntimeContext; import org.apache.log4j.Logger; <BUG>import org.gradoop.flink.model.impl.operators.matching.common.tuples .IdWithCandidates; public class PrintIdWithCandidates extends Printer<IdWithCandidates> { private static Logger LOG = Logger.getLogger(PrintIdWithCandidates.class);</BUG> public PrintIdWithCandidates() {
import org.gradoop.flink.model.impl.operators.matching.common.tuples.IdWithCandidates; public class PrintIdWithCandidates<K extends Comparable<K>> extends Printer<IdWithCandidates<K>, K> { private static Logger LOG = Logger.getLogger(PrintIdWithCandidates.class);
46,440
} public PrintIdWithCandidates(boolean isIterative, String prefix) { super(isIterative, prefix); } @Override <BUG>protected String getDebugString(IdWithCandidates t) { </BUG> return String.format("(%s,[%s])", vertexMap.containsKey(t.getId()) ? vertexMap.get(t.getId()) : edgeMap.get(t.getId()),
public PrintIdWithCandidates(String prefix) { this(false, prefix); protected String getDebugString(IdWithCandidates<K> t) {
46,441
package org.gradoop.flink.model.impl.operators.matching.common; <BUG>import org.apache.flink.api.java.DataSet; import org.gradoop.flink.model.impl.LogicalGraph; import org.gradoop.flink.model.impl.operators.matching.common.tuples .IdWithCandidates;</BUG> import org.gradoop.flink.model.impl.operators.matching.common.functions.BuildIdWithCandidates;
import org.gradoop.common.model.impl.id.GradoopId;
46,442
</BUG> PagingMessages pagingMsgs = new PagingMessages(); pagingMsgs.setPageNum(pageNum); pagingMsgs.setSize(size); // 设置返回的 size 为本次返回消息的数量 <BUG>pagingMsgs.setMsgs(systemassages); long count = messageDao.getUserMessagesCount(uid); if ((pageNum + 1) * size >= count) {</BUG> pagingMsgs.setHasMore(false); } else {
@RequestMapping(value = "get/msg", method = GET) public PagingMessages getMessages( @RequestParam Integer uid, @RequestParam Integer pageNum, @RequestParam Integer size) { int offset = pageNum * size; List<Message> messages = messageDao.getMessages(uid, offset, size); pagingMsgs.setMsgs(messages); long count = messageDao.getMessagesCount(uid); if ((pageNum + 1) * size >= count) {
46,443
import wenjing.xdtic.dao.UserDao; import wenjing.xdtic.model.User;</BUG> @Controller public class HomeController { <BUG>@Autowired private UserDao userDao; @RequestMapping({"/", "index", "home", "login"}) </BUG> public String index() {
package wenjing.xdtic.controller; import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @GetMapping({"/", "index", "home", "login"})
46,444
@RequestMapping({"/", "index", "home", "login"}) </BUG> public String index() { return "page/user/login"; } <BUG>@RequestMapping("logout") </BUG> public String logout(HttpSession session) { session.removeAttribute("user"); return "page/user/login";
package wenjing.xdtic.controller; import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @Controller public class HomeController { @GetMapping({"/", "index", "home", "login"}) @GetMapping("logout")
46,445
if (proId == null) {</BUG> proId = id; } Project project = projectDao.getProject(proId); <BUG>boolean isCollected = projectDao.isProjectCollected(user.getId(), proId); project.setIsCollected(isCollected);</BUG> Map<String, Object> attrs = new HashMap<>(4); attrs.put("project", project); User projectCreator = projectDao.getCreator(project);
@RequestMapping("project") public ModelAndView getProjectDetailPage(HttpSession session, @RequestParam(required = false) Integer proId, @RequestParam(required = false) Integer id, @RequestParam(required = false) Integer uid) { User user = (User) session.getAttribute("user"); if (proId == null) { project.setIsCollected(projectDao.isProjectCollected(user.getId(), proId));
46,446
public ModelAndView getPostProjectDetailPage( HttpSession session, @RequestParam Integer proId, @RequestParam(required = false) Integer uid) { Project project = projectDao.getProject(proId); User user = (User) session.getAttribute("user"); <BUG>boolean isCollected = projectDao.isProjectCollected(user.getId(), proId); project.setIsCollected(isCollected);</BUG> return new ModelAndView("page/myProject/myPost/detail", "project", project); }
project.setIsCollected(projectDao.isProjectCollected(user.getId(), proId));
46,447
public void deleteFeed(HttpRequest request, HttpResponder responder, @PathParam("id") String id) { try { NotificationFeed feed; try { feed = NotificationFeed.fromId(id); <BUG>} catch (NotificationFeedException e) { responder.sendString(HttpResponseStatus.BAD_REQUEST, e.getMessage()); return;</BUG> } catch (IllegalArgumentException e) { responder.sendString(HttpResponseStatus.BAD_REQUEST, e.getMessage());
[DELETED]
46,448
public void getFeed(HttpRequest request, HttpResponder responder, @PathParam("id") String id) { try { NotificationFeed feed; try { feed = NotificationFeed.fromId(id); <BUG>} catch (NotificationFeedException e) { responder.sendString(HttpResponseStatus.BAD_REQUEST, e.getMessage()); return;</BUG> } catch (IllegalArgumentException e) { responder.sendString(HttpResponseStatus.BAD_REQUEST, e.getMessage());
[DELETED]
46,449
import com.google.common.collect.Maps; import java.util.List; import java.util.Map; import javax.annotation.Nullable; public class InMemoryNotificationFeedStore implements NotificationFeedStore { <BUG>Map<String, NotificationFeed> feeds = Maps.newHashMap(); </BUG> @Nullable @Override public NotificationFeed createNotificationFeed(NotificationFeed feed) {
private final Map<String, NotificationFeed> feeds = Maps.newHashMap();
46,450
package co.cask.cdap.notifications.feeds.guice; import co.cask.cdap.common.runtime.RuntimeModule; import co.cask.cdap.notifications.feeds.NotificationFeedManager; <BUG>import co.cask.cdap.notifications.feeds.client.NotificationFeedServiceClient; </BUG> import co.cask.cdap.notifications.feeds.service.InMemoryNotificationFeedStore; import co.cask.cdap.notifications.feeds.service.MDSNotificationFeedStore; import co.cask.cdap.notifications.feeds.service.NotificationFeedService;
import co.cask.cdap.notifications.feeds.client.RemoteNotificationFeedManager;
46,451
this.category = category; this.name = name; this.id = String.format("%s.%s.%s", namespace, category, name); this.description = description; } <BUG>private boolean isId(final String name) { return CharMatcher.inRange('A', 'Z')</BUG> .or(CharMatcher.inRange('a', 'z')) .or(CharMatcher.is('-')) .or(CharMatcher.is('_'))
private boolean isId(String name) { return CharMatcher.inRange('A', 'Z')
46,452
import co.cask.cdap.common.discovery.RandomEndpointStrategy; import co.cask.cdap.common.discovery.TimeLimitEndpointStrategy; import co.cask.cdap.explore.service.Explore; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; <BUG>import com.google.inject.Inject; import org.apache.twill.discovery.DiscoveryServiceClient;</BUG> import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.net.InetSocketAddress;
import org.apache.twill.discovery.Discoverable; import org.apache.twill.discovery.DiscoveryServiceClient;
46,453
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AFileSystem extends FileSystem {</BUG> private URI uri; private Path workingDir; private AmazonS3Client s3;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AFileSystem extends FileSystem {
46,454
public void initialize(URI name, Configuration conf) throws IOException { super.initialize(name, conf); uri = URI.create(name.getScheme() + "://" + name.getAuthority()); workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri, this.getWorkingDirectory()); <BUG>String accessKey = conf.get(ACCESS_KEY, null); String secretKey = conf.get(SECRET_KEY, null); </BUG> String userInfo = name.getUserInfo();
String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null)); String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
46,455
} else { accessKey = userInfo; } } AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain( <BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey), new InstanceProfileCredentialsProvider(), new S3AAnonymousAWSCredentialsProvider() );</BUG> bucket = name.getHost();
new BasicAWSCredentialsProvider(accessKey, secretKey), new AnonymousAWSCredentialsProvider()
46,456
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)); </BUG> s3 = new AmazonS3Client(credentials, awsConf); <BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS); partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (partSize < 5 * 1024 * 1024) {
new InstanceProfileCredentialsProvider(), new AnonymousAWSCredentialsProvider() bucket = name.getHost(); ClientConfiguration awsConf = new ClientConfiguration(); awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS))); awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP); awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES))); awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT))); maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS)); partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE)); partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
46,457
cannedACL = null; } if (!s3.doesBucketExist(bucket)) { throw new IOException("Bucket " + bucket + " does not exist"); } <BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART); long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE); </BUG> if (purgeExistingMultipart) {
boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART)); long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE));
46,458
import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AOutputStream extends OutputStream {</BUG> private OutputStream backupStream; private File backupFile; private boolean closed;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AOutputStream extends OutputStream {
46,459
this.client = client; this.progress = progress; this.fs = fs; this.cannedACL = cannedACL; this.statistics = statistics; <BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (conf.get(BUFFER_DIR, null) != null) {
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
46,460
userRepos.addAll(options.getMulti(OptionName.CEYLONREPO)); String systemRepo = getSystemRepoOption(); String cacheRepo = getCacheRepoOption(); String outRepo = getOutputRepoOption(); repoManager = CeylonUtils.repoManager() <BUG>.cwd(new File(getCurrentWorkingDir())) .systemRepo(systemRepo)</BUG> .cacheRepo(cacheRepo) .noDefaultRepos(getNoDefaultRepos()) .userRepos(userRepos)
.cwd(getCurrentWorkingDir()) .systemRepo(systemRepo)
46,461
return outputRepoManager; String outRepo = getOutputRepoOption(); String user = options.get(OptionName.CEYLONUSER); String password = options.get(OptionName.CEYLONPASS); outputRepoManager = CeylonUtils.repoManager() <BUG>.cwd(new File(getCurrentWorkingDir())) .outRepo(outRepo)</BUG> .logger(getLogger()) .user(user) .password(password)
.cwd(getCurrentWorkingDir()) .outRepo(outRepo)
46,462
.password(password) .buildOutputManager(); return outputRepoManager; } protected String getCurrentWorkingDir() { <BUG>return "."; }</BUG> private String getSystemRepoOption() { return options.get(OptionName.CEYLONSYSTEMREPO); }
return options.get(OptionName.CEYLONCWD);
46,463
String destDir = null; List<String> sourceDirs = new LinkedList<String>(); boolean includeNonShared = false; boolean includeSourceCode = false; List<String> modules = new LinkedList<String>(); <BUG>List<String> repositories = new LinkedList<String>(); String systemRepo = null;</BUG> String cacheRepo = null; boolean noDefRepos = false; String user = null, pass = null;
File cwd = new File("."); String systemRepo = null;
46,464
String arg = args[i]; int argsLeft = args.length - 1 - i; if ("-h".equals(arg) || "-help".equals(arg) || "--help".equals(arg)) { <BUG>printUsage(SC_OK, systemRepo, cacheRepo, noDefRepos, repositories, destDir); </BUG> } else if ("-v".equals(arg) || "-version".equals(arg) || "--version".equals(arg)) {
printUsage(SC_OK, cwd, systemRepo, cacheRepo, noDefRepos, repositories, destDir);
46,465
modules.add(arg); } } if(modules.isEmpty()){ System.err.println(CeylondMessages.msg("error.noModulesSpecified")); <BUG>printUsage(SC_ARGS, systemRepo, cacheRepo, noDefRepos, repositories, destDir); </BUG> } if (destDir == null) { destDir = "modules";
printUsage(SC_ARGS, cwd, systemRepo, cacheRepo, noDefRepos, repositories, destDir);
46,466
System.err.println(" "+repo); } System.err.print(CeylondMessages.msg("info.usage2")); exit(statusCode); } <BUG>private static List<String> addDefaultRepositories(String systemRepo, String cacheRepo, boolean noDefRepos, List<String> userRepos, String outputRepo){ RepositoryManagerBuilder builder = CeylonUtils.repoManager() .systemRepo(systemRepo)</BUG> .cacheRepo(cacheRepo)
private static List<String> addDefaultRepositories(File cwd, String systemRepo, String cacheRepo, boolean noDefRepos, List<String> userRepos, String outputRepo){ .cwd(cwd) .systemRepo(systemRepo)
46,467
throw new ImportJarException(keyPrefix + ".isDirectory", new Object[]{f.toString()}, null); if(!f.canRead()) throw new ImportJarException(keyPrefix + ".notReadable", new Object[]{f.toString()}, null); } public void publish() { <BUG>RepositoryManager outputRepository = CeylonUtils.repoManager() .outRepo(this.out)</BUG> .logger(log) .user(user) .password(pass)
.cwd(cwd) .outRepo(this.out)
46,468
else if (t == STRING_LINE) { r = stringLine(b, 0); } else if (t == STRUCT_OPERATION) { r = structOperation(b, 0); <BUG>} else if (t == TUPLE) {</BUG> r = tuple(b, 0); } else if (t == TWO_INFIX_OPERATOR) {
else if (t == THREE_INFIX_OPERATOR) { r = threeInfixOperator(b, 0); else if (t == TUPLE) {
46,469
MATCHED_AT_NON_NUMERIC_OPERATION, MATCHED_AT_UNQUALIFIED_BRACKET_OPERATION, MATCHED_AT_UNQUALIFIED_NO_PARENTHESES_CALL, MATCHED_BRACKET_OPERATION, MATCHED_CAPTURE_NON_NUMERIC_OPERATION, MATCHED_COMPARISON_OPERATION, MATCHED_DOT_CALL, MATCHED_EXPRESSION, MATCHED_IN_MATCH_OPERATION, MATCHED_IN_OPERATION, MATCHED_MATCH_OPERATION, MATCHED_MULTIPLICATION_OPERATION, MATCHED_OR_OPERATION, MATCHED_PIPE_OPERATION, MATCHED_QUALIFIED_ALIAS, MATCHED_QUALIFIED_BRACKET_OPERATION, MATCHED_QUALIFIED_MULTIPLE_ALIASES, MATCHED_QUALIFIED_NO_ARGUMENTS_CALL, MATCHED_QUALIFIED_NO_PARENTHESES_CALL, MATCHED_QUALIFIED_PARENTHESES_CALL, <BUG>MATCHED_RELATIONAL_OPERATION, MATCHED_TWO_OPERATION, MATCHED_TYPE_OPERATION, MATCHED_UNARY_NON_NUMERIC_OPERATION, MATCHED_UNQUALIFIED_BRACKET_OPERATION, MATCHED_UNQUALIFIED_NO_ARGUMENTS_CALL, MATCHED_UNQUALIFIED_NO_PARENTHESES_CALL, MATCHED_UNQUALIFIED_PARENTHESES_CALL, MATCHED_WHEN_OPERATION), create_token_set_(ACCESS_EXPRESSION, UNMATCHED_ADDITION_OPERATION, UNMATCHED_AND_OPERATION, UNMATCHED_ARROW_OPERATION,</BUG> UNMATCHED_AT_NON_NUMERIC_OPERATION, UNMATCHED_AT_UNQUALIFIED_BRACKET_OPERATION, UNMATCHED_AT_UNQUALIFIED_NO_PARENTHESES_CALL, UNMATCHED_BRACKET_OPERATION,
MATCHED_RELATIONAL_OPERATION, MATCHED_THREE_OPERATION, MATCHED_TWO_OPERATION, MATCHED_TYPE_OPERATION, MATCHED_UNARY_NON_NUMERIC_OPERATION, MATCHED_UNQUALIFIED_BRACKET_OPERATION, MATCHED_UNQUALIFIED_NO_ARGUMENTS_CALL, MATCHED_UNQUALIFIED_NO_PARENTHESES_CALL, MATCHED_UNQUALIFIED_PARENTHESES_CALL, MATCHED_WHEN_OPERATION), create_token_set_(ACCESS_EXPRESSION, UNMATCHED_ADDITION_OPERATION, UNMATCHED_AND_OPERATION, UNMATCHED_ARROW_OPERATION,
46,470
UNMATCHED_AT_NON_NUMERIC_OPERATION, UNMATCHED_AT_UNQUALIFIED_BRACKET_OPERATION, UNMATCHED_AT_UNQUALIFIED_NO_PARENTHESES_CALL, UNMATCHED_BRACKET_OPERATION, UNMATCHED_CAPTURE_NON_NUMERIC_OPERATION, UNMATCHED_COMPARISON_OPERATION, UNMATCHED_DOT_CALL, UNMATCHED_EXPRESSION, UNMATCHED_IN_MATCH_OPERATION, UNMATCHED_IN_OPERATION, UNMATCHED_MATCH_OPERATION, UNMATCHED_MULTIPLICATION_OPERATION, UNMATCHED_OR_OPERATION, UNMATCHED_PIPE_OPERATION, UNMATCHED_QUALIFIED_ALIAS, UNMATCHED_QUALIFIED_BRACKET_OPERATION, UNMATCHED_QUALIFIED_MULTIPLE_ALIASES, UNMATCHED_QUALIFIED_NO_ARGUMENTS_CALL, UNMATCHED_QUALIFIED_NO_PARENTHESES_CALL, UNMATCHED_QUALIFIED_PARENTHESES_CALL, <BUG>UNMATCHED_RELATIONAL_OPERATION, UNMATCHED_TWO_OPERATION, UNMATCHED_TYPE_OPERATION, UNMATCHED_UNARY_NON_NUMERIC_OPERATION, UNMATCHED_UNQUALIFIED_BRACKET_OPERATION, UNMATCHED_UNQUALIFIED_NO_ARGUMENTS_CALL, UNMATCHED_UNQUALIFIED_NO_PARENTHESES_CALL, UNMATCHED_UNQUALIFIED_PARENTHESES_CALL, UNMATCHED_WHEN_OPERATION), };</BUG> public static boolean accessExpression(PsiBuilder b, int l) {
UNMATCHED_RELATIONAL_OPERATION, UNMATCHED_THREE_OPERATION, UNMATCHED_TWO_OPERATION, UNMATCHED_TYPE_OPERATION, UNMATCHED_UNARY_NON_NUMERIC_OPERATION, UNMATCHED_UNQUALIFIED_BRACKET_OPERATION, UNMATCHED_UNQUALIFIED_NO_ARGUMENTS_CALL, UNMATCHED_UNQUALIFIED_NO_PARENTHESES_CALL, UNMATCHED_UNQUALIFIED_PARENTHESES_CALL, UNMATCHED_WHEN_OPERATION), };
46,471
if (!r) r = consumeToken(b, OR_OPERATOR); if (!r) r = consumeToken(b, PIPE_OPERATOR); if (!r) r = consumeToken(b, RESCUE); if (!r) r = consumeToken(b, RELATIONAL_OPERATOR); if (!r) r = consumeToken(b, STAB_OPERATOR); <BUG>if (!r) r = consumeToken(b, STRUCT_OPERATOR); if (!r) r = consumeToken(b, TUPLE_OPERATOR);</BUG> if (!r) r = consumeToken(b, TWO_OPERATOR); if (!r) r = consumeToken(b, UNARY_OPERATOR); if (!r) r = consumeToken(b, WHEN_OPERATOR);
if (!r) r = consumeToken(b, THREE_OPERATOR); if (!r) r = consumeToken(b, TUPLE_OPERATOR);
46,472
} private static boolean maxExpression_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "maxExpression_0")) return false; boolean r; Marker m = enter_section_(b); <BUG>r = matchedExpression(b, l + 1, 20); </BUG> r = r && maxDotCall(b, l + 1); exit_section_(b, m, null, r); return r;
static boolean keywordKeyColonEOL(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "keywordKeyColonEOL")) return false; r = keywordKey(b, l + 1); r = r && consumeToken(b, KEYWORD_PAIR_COLON); r = r && keywordKeyColonEOL_2(b, l + 1);
46,473
} private static boolean maxExpression_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "maxExpression_1")) return false; boolean r; Marker m = enter_section_(b); <BUG>r = matchedExpression(b, l + 1, 23); </BUG> r = r && maxExpression_1_1(b, l + 1); exit_section_(b, m, null, r); return r;
static boolean keywordKeyColonEOL(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "keywordKeyColonEOL")) return false; r = keywordKey(b, l + 1); r = r && consumeToken(b, KEYWORD_PAIR_COLON); r = r && keywordKeyColonEOL_2(b, l + 1);
46,474
} private static boolean maxExpression_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "maxExpression_2")) return false; boolean r; Marker m = enter_section_(b); <BUG>r = matchedExpression(b, l + 1, 25); </BUG> r = r && maxQualifiedParenthesesCall(b, l + 1); exit_section_(b, m, null, r); return r;
static boolean keywordKeyColonEOL(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "keywordKeyColonEOL")) return false; r = keywordKey(b, l + 1); r = r && consumeToken(b, KEYWORD_PAIR_COLON); r = r && keywordKeyColonEOL_2(b, l + 1);
46,475
if (!r) r = consumeToken(b, OR_OPERATOR); if (!r) r = consumeToken(b, PIPE_OPERATOR); if (!r) r = consumeToken(b, RELATIONAL_OPERATOR); if (!r) r = consumeToken(b, RESCUE); if (!r) r = consumeToken(b, STAB_OPERATOR); <BUG>if (!r) r = consumeToken(b, STRUCT_OPERATOR); if (!r) r = consumeToken(b, TWO_OPERATOR);</BUG> if (!r) r = consumeToken(b, UNARY_OPERATOR); if (!r) r = consumeToken(b, WHEN_OPERATOR); if (!r) r = atomKeyword(b, l + 1);
if (!r) r = consumeToken(b, THREE_OPERATOR); if (!r) r = consumeToken(b, TWO_OPERATOR);
46,476
exit_section_(b, l, m, MATCHED_ARROW_OPERATION, r, true, null); } else if (g < 12 && inInfixOperator(b, l + 1)) { r = matchedExpression(b, l, 12); exit_section_(b, l, m, MATCHED_IN_OPERATION, r, true, null); <BUG>} else if (g < 13 && twoInfixOperator(b, l + 1)) { r = matchedExpression(b, l, 12); </BUG> exit_section_(b, l, m, MATCHED_TWO_OPERATION, r, true, null);
else if (g < 13 && threeInfixOperator(b, l + 1)) { r = matchedExpression(b, l, 13); exit_section_(b, l, m, MATCHED_THREE_OPERATION, r, true, null); else if (g < 14 && twoInfixOperator(b, l + 1)) { r = matchedExpression(b, l, 13);
46,477
if (!recursion_guard_(b, l, "matchedUnaryNonNumericOperation")) return false; boolean r, p; Marker m = enter_section_(b, l, _NONE_, null); r = matchedUnaryNonNumericOperation_0(b, l + 1); p = r; <BUG>r = p && matchedExpression(b, l, 16); </BUG> exit_section_(b, l, m, MATCHED_UNARY_NON_NUMERIC_OPERATION, r, p, null); return r || p; }
r = p && matchedExpression(b, l, 17);
46,478
exit_section_(b, l, m, UNMATCHED_ARROW_OPERATION, r, true, null); } else if (g < 12 && inInfixOperator(b, l + 1)) { r = unmatchedExpression(b, l, 12); exit_section_(b, l, m, UNMATCHED_IN_OPERATION, r, true, null); <BUG>} else if (g < 13 && twoInfixOperator(b, l + 1)) { r = unmatchedExpression(b, l, 12); </BUG> exit_section_(b, l, m, UNMATCHED_TWO_OPERATION, r, true, null);
else if (g < 13 && threeInfixOperator(b, l + 1)) { r = unmatchedExpression(b, l, 13); exit_section_(b, l, m, UNMATCHED_THREE_OPERATION, r, true, null); else if (g < 14 && twoInfixOperator(b, l + 1)) { r = unmatchedExpression(b, l, 13);
46,479
if (!recursion_guard_(b, l, "unmatchedUnaryNonNumericOperation")) return false; boolean r, p; Marker m = enter_section_(b, l, _NONE_, null); r = unmatchedUnaryNonNumericOperation_0(b, l + 1); p = r; <BUG>r = p && unmatchedExpression(b, l, 16); </BUG> exit_section_(b, l, m, UNMATCHED_UNARY_NON_NUMERIC_OPERATION, r, p, null); return r || p; }
r = p && unmatchedExpression(b, l, 17);
46,480
subscriber.requestMore(Long.MAX_VALUE); // Subsequent requests do not trigger HTTP requests. assertThat(server.getRequestCount()).isEqualTo(1); } @Test public void responseSuccess200() { server.enqueue(new MockResponse().setBody("Hi")); <BUG>BlockingObservable<Response<String>> o = service.response().toBlocking(); Response<String> response = o.first(); assertThat(response.isSuccessful()).isTrue(); assertThat(response.body()).isEqualTo("Hi"); }</BUG> @Test public void responseSuccess404() throws IOException {
TestSubscriber<Response<String>> subscriber = new TestSubscriber<>(); service.response().subscribe(subscriber); Response<String> response = subscriber.getOnNextEvents().get(0); subscriber.assertCompleted();
46,481
assertThat(response.isSuccessful()).isTrue(); assertThat(response.body()).isEqualTo("Hi"); }</BUG> @Test public void responseSuccess404() throws IOException { server.enqueue(new MockResponse().setResponseCode(404).setBody("Hi")); <BUG>BlockingObservable<Response<String>> o = service.response().toBlocking(); Response<String> response = o.first(); assertThat(response.isSuccessful()).isFalse(); assertThat(response.errorBody().string()).isEqualTo("Hi"); }</BUG> @Test public void responseFailure() {
subscriber.assertCompleted(); } TestSubscriber<Response<String>> subscriber = new TestSubscriber<>(); service.response().subscribe(subscriber); Response<String> response = subscriber.getOnNextEvents().get(0); subscriber.assertCompleted(); }
46,482
assertThat(response.isSuccessful()).isFalse(); assertThat(response.errorBody().string()).isEqualTo("Hi"); }</BUG> @Test public void responseFailure() { <BUG>server.enqueue(new MockResponse().setSocketPolicy(DISCONNECT_AFTER_REQUEST)); BlockingObservable<Response<String>> o = service.response().toBlocking(); try { o.first(); fail(); } catch (RuntimeException t) { assertThat(t.getCause()).isInstanceOf(IOException.class); }</BUG> }
subscriber.assertCompleted(); TestSubscriber<Response<String>> subscriber = new TestSubscriber<>(); service.response().subscribe(subscriber); subscriber.assertNoValues(); subscriber.assertError(IOException.class);
46,483
import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;</BUG> import com.watabou.utils.Random; public class AmuletScene extends PixelScene { <BUG>private static final String TXT_EXIT = "Let's call it a day"; private static final String TXT_STAY = "I'm not done yet";</BUG> private static final int WIDTH = 120; private static final int BTN_HEIGHT = 18; private static final float SMALL_GAP = 2;
import com.shatteredpixel.shatteredpixeldungeon.items.Amulet; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline; import com.watabou.noosa.Camera; import com.watabou.noosa.Game; import com.watabou.noosa.Image;
46,484
add( btnStay ); float height; if (noText) { height = amulet.height + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height(); amulet.x = (Camera.main.width - amulet.width) / 2; <BUG>amulet.y = (Camera.main.height - height) / 2; btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, amulet.y + amulet.height + LARGE_GAP );</BUG> btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP ); } else { height = amulet.height + LARGE_GAP + text.height() + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height();
align(amulet); btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, amulet.y + amulet.height + LARGE_GAP );
46,485
btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP ); } else { height = amulet.height + LARGE_GAP + text.height() + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height(); amulet.x = (Camera.main.width - amulet.width) / 2; amulet.y = (Camera.main.height - height) / 2; <BUG>text.x = (Camera.main.width - text.width()) / 2; text.y = amulet.y + amulet.height + LARGE_GAP; btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.y + text.height() + LARGE_GAP ); </BUG> btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
align(amulet); text.setPos((Camera.main.width - text.width()) / 2, amulet.y + amulet.height + LARGE_GAP); align(text); btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.top() + text.height() + LARGE_GAP );
46,486
package com.shatteredpixel.shatteredpixeldungeon.scenes; <BUG>import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.ui.ExitButton; import com.badlogic.gdx.Gdx; import com.watabou.input.NoosaInputProcessor; import com.watabou.noosa.BitmapTextMultiline;</BUG> import com.watabou.noosa.Camera;
import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; import com.shatteredpixel.shatteredpixeldungeon.ui.Archs; import com.shatteredpixel.shatteredpixeldungeon.ui.Icons; import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextMultiline; import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
46,487
final float colWidth = Camera.main.width / (ShatteredPixelDungeon.landscape() ? 2 : 1); final float colTop = (Camera.main.height / 2) - (ShatteredPixelDungeon.landscape() ? 30 : 90); final float wataOffset = ShatteredPixelDungeon.landscape() ? colWidth : 0; Image shpx = Icons.SHPX.get(); shpx.x = (colWidth - shpx.width()) / 2; <BUG>shpx.y = colTop; add( shpx ); new Flare( 7, 64 ).color( 0x225511, true ).show( shpx, 0 ).angularSpeed = +20; BitmapTextMultiline shpxtitle = createMultiline( TTL_SHPX, 8 ); shpxtitle.maxWidth = (int) Math.min( colWidth, 120 ); shpxtitle.measure();</BUG> shpxtitle.hardlight( Window.SHPX_COLOR );
align(shpx); RenderedText shpxtitle = renderText( TTL_SHPX, 8 );
46,488
add( shpxhotArea ); Image wata = Icons.WATA.get(); wata.x = wataOffset + (colWidth - wata.width()) / 2; wata.y = ShatteredPixelDungeon.landscape() ? colTop: <BUG>shpxlink.y + wata.height + 20; add( wata ); new Flare( 7, 64 ).color( 0x112233, true ).show( wata, 0 ).angularSpeed = +20; BitmapTextMultiline wataTitle = createMultiline( TTL_WATA, 8 ); wataTitle.maxWidth = (int) Math.min( colWidth, 120 ); wataTitle.measure();</BUG> wataTitle.hardlight(Window.TITLE_COLOR);
shpxlink.top() + wata.height + 20; align(wata); RenderedText wataTitle = renderText( TTL_WATA, 8 );
46,489
layoutParams.height = height; imageView.setLayoutParams(layoutParams); int width = this.getResources().getDisplayMetrics().widthPixels; Glide.with(this) .load(img_link) <BUG>.override(width, height) .placeholder(R.mipmap.ligtv)</BUG> .error(R.mipmap.ligtv) .into(imageView); new ProgressTask().execute(feed_link);
.fitCenter() .placeholder(R.mipmap.ligtv)
46,490
imageView.setLayoutParams(layoutParams); int width = this.getResources().getDisplayMetrics().widthPixels; Glide.with(this) .load(img_link) .override(width, height) <BUG>.placeholder(R.mipmap.fotomac) .error(R.mipmap.fotomac)</BUG> .into(imageView); new ProgressTask().execute(feed_link); }
.fitCenter() .error(R.mipmap.fotomac)
46,491
layoutParams.height = height; imageView.setLayoutParams(layoutParams); int width = this.getResources().getDisplayMetrics().widthPixels; Glide.with(this) .load(img_link) <BUG>.override(width, height) .placeholder(R.mipmap.haberturk)</BUG> .error(R.mipmap.haberturk) .into(imageView); new ProgressTask().execute(feed_link);
.fitCenter() .placeholder(R.mipmap.haberturk)
46,492
private void decideWhichImageOnListItem(ViewHolder holder, int height, int width, String imgLink, String feedLink) { if (StringUtils.isBlank(imgLink)) { if (StringUtils.containsIgnoreCase(feedLink, "ntv")) { Glide.with(myContext) .load(imgLink) <BUG>.override(width, height) .diskCacheStrategy(DiskCacheStrategy.ALL)</BUG> .placeholder(R.mipmap.ntvspor) .error(R.mipmap.ntvspor) .into(holder.postThumbView);
.fitCenter() .diskCacheStrategy(DiskCacheStrategy.ALL)
46,493
.error(R.mipmap.ntvspor) .into(holder.postThumbView); } else if (StringUtils.containsIgnoreCase(feedLink, "sabah")) { Glide.with(myContext) .load(imgLink) <BUG>.override(width, height) .diskCacheStrategy(DiskCacheStrategy.ALL)</BUG> .placeholder(R.mipmap.sabah) .error(R.mipmap.sabah) .into(holder.postThumbView);
.centerCrop() .diskCacheStrategy(DiskCacheStrategy.ALL)
46,494
.error(R.mipmap.sabah) .into(holder.postThumbView); } else if (StringUtils.containsIgnoreCase(feedLink, "trt")) { Glide.with(myContext) .load(imgLink) <BUG>.override(width, height) .diskCacheStrategy(DiskCacheStrategy.ALL)</BUG> .placeholder(R.mipmap.trtspor) .error(R.mipmap.trtspor) .into(holder.postThumbView);
.fitCenter() .diskCacheStrategy(DiskCacheStrategy.ALL)
46,495
.error(R.mipmap.trtspor) .into(holder.postThumbView); } else if (StringUtils.containsIgnoreCase(feedLink, "haberturk")) { Glide.with(myContext) .load(imgLink) <BUG>.override(width, height) .diskCacheStrategy(DiskCacheStrategy.ALL)</BUG> .placeholder(R.mipmap.haberturk) .error(R.mipmap.haberturk) .into(holder.postThumbView);
.fitCenter() .diskCacheStrategy(DiskCacheStrategy.ALL)
46,496
.error(R.mipmap.haberturk) .into(holder.postThumbView); } else if (StringUtils.containsIgnoreCase(feedLink, "ligtv")) { Glide.with(myContext) .load(imgLink) <BUG>.override(width, height) .diskCacheStrategy(DiskCacheStrategy.ALL)</BUG> .placeholder(R.mipmap.ligtv) .error(R.mipmap.ligtv) .into(holder.postThumbView);
.fitCenter() .diskCacheStrategy(DiskCacheStrategy.ALL)
46,497
.error(R.mipmap.ligtv) .into(holder.postThumbView); } else if (StringUtils.containsIgnoreCase(feedLink, "fotomac")) { Glide.with(myContext) .load(imgLink) <BUG>.override(width, height) .diskCacheStrategy(DiskCacheStrategy.ALL)</BUG> .placeholder(R.mipmap.fotomac) .error(R.mipmap.fotomac) .into(holder.postThumbView);
.fitCenter() .diskCacheStrategy(DiskCacheStrategy.ALL)
46,498
.error(R.mipmap.fotomac) .into(holder.postThumbView); }else if (StringUtils.containsIgnoreCase(feedLink, "sporx")) { Glide.with(myContext) .load(imgLink) <BUG>.override(width, height) .diskCacheStrategy(DiskCacheStrategy.ALL)</BUG> .placeholder(R.mipmap.sporx) .error(R.mipmap.sporx) .into(holder.postThumbView);
.fitCenter() .diskCacheStrategy(DiskCacheStrategy.ALL)
46,499
} } else{ Glide.with(myContext) .load(imgLink) <BUG>.override(width, height) .diskCacheStrategy(DiskCacheStrategy.ALL)</BUG> .placeholder(Color.TRANSPARENT) .error(Color.TRANSPARENT) .into(holder.postThumbView);
.fitCenter() .diskCacheStrategy(DiskCacheStrategy.ALL)
46,500
layoutParams.height = height; imageView.setLayoutParams(layoutParams); int width = this.getResources().getDisplayMetrics().widthPixels; Glide.with(this) .load(img_link) <BUG>.override(width, height) .placeholder(R.mipmap.sabah)</BUG> .error(R.mipmap.sabah) .into(imageView); new ProgressTask().execute(feed_link);
.centerCrop() .placeholder(R.mipmap.sabah)