id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
28,801
unmarshaller = new Unmarshaller(ActionUtil.getDefaultMapping()); FileReader reader = new FileReader(file); sTree= (SaveVueJTree) unmarshaller.unmarshal(new InputSource(reader)); reader.close(); } catch (Exception e) { <BUG>e.printStackTrace(); System.err.println("FavoritesWindow.unmarshallFavorites: " + e);</BUG> sTree...
[DELETED]
28,802
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.List; <BUG>import java.util.Optional; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class CommandDel...
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
28,803
.append(Text.of(TextColors.GREEN, "Usage: ")) .append(getUsage(source)) .build()); return CommandResult.empty(); } else if (isIn(REGIONS_ALIASES, parse.args[0])) { <BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); IRegion region = FGManager.getInstance().getRegion(parse.args[1...
String regionName = parse.args[1]; IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
28,804
</BUG> isWorldRegion = true; } if (region == null) <BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!")); if (region instanceof GlobalWorldRegion) { </BUG> throw new CommandException(Text.of("You may not delete the global region!")); }
if (world == null) throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!")); if (world == null) throw new CommandException(Text.of("Must specify a world!")); region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null); throw new CommandException(Text.of("No region exis...
28,805
source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region" ); return CommandResult.success(); } else if (isIn(HANDLERS_ALIASES, parse.args[0])) { if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); <BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[...
Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]); if (!handlerOpt.isPresent()) IHandler handler = handlerOpt.get(); if (handler instanceof GlobalHandler)
28,806
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix...
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
28,807
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix...
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
28,808
@Dependency(id = "foxcore") }, description = "A world protection plugin built for SpongeAPI. Requires FoxCore.", authors = {"gravityfox"}, url = "https://github.com/FoxDenStudio/FoxGuard") <BUG>public final class FoxGuardMain { public final Cause pluginCause = Cause.builder().named("plugin", this).build(); private stat...
private static FoxGuardMain instanceField;
28,809
private UserStorageService userStorage; private EconomyService economyService = null; private boolean loaded = false; private FCCommandDispatcher fgDispatcher; public static FoxGuardMain instance() { <BUG>return instanceField; }</BUG> @Listener public void construct(GameConstructionEvent event) { instanceField = this;
} public static Cause getCause() { return instance().pluginCause; }
28,810
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
28,811
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.*; <BUG>import java.util.stream.Collectors; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class Comm...
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
28,812
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix...
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
28,813
private static FGStorageManager instance; private final Logger logger = FoxGuardMain.instance().getLogger();</BUG> private final Set<LoadEntry> loaded = new HashSet<>(); private final Path directory = getDirectory(); private final Map<String, Path> worldDirectories; <BUG>private FGStorageManager() { defaultModifiedMap ...
public final HashMap<IFGObject, Boolean> defaultModifiedMap; private final UserStorageService userStorageService; private final Logger logger = FoxGuardMain.instance().getLogger(); userStorageService = FoxGuardMain.instance().getUserStorage(); defaultModifiedMap = new CacheMap<>((k, m) -> {
28,814
String name = fgObject.getName(); Path singleDir = dir.resolve(name.toLowerCase()); </BUG> boolean shouldSave = fgObject.shouldSave(); if (force || shouldSave) { <BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir); </BUG> constructDirectory(singleDir); try { fg...
UUID owner = fgObject.getOwner(); boolean isOwned = !owner.equals(SERVER_UUID); Optional<User> userOwner = userStorageService.get(owner); String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name; if (fgObject.autoSave()) { Path singleDir = serverDir.resolve(n...
28,815
if (fgObject.autoSave()) { Path singleDir = dir.resolve(name.toLowerCase()); </BUG> boolean shouldSave = fgObject.shouldSave(); if (force || shouldSave) { <BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir); </BUG> constructDirectory(singleDir); try { fgOb...
Path singleDir = serverDir.resolve(name.toLowerCase()); logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
28,816
public synchronized void loadRegionLinks() { logger.info("Loading region links"); try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) { Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen(); linksMap.entrySet().forEach(...
Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey()); if (regionOpt.isPresent()) { IRegion region = regionOpt.get(); logger.info("Loading links for region \"" + region.getName() + "\"");
28,817
public synchronized void loadWorldRegionLinks(World world) { logger.info("Loading world region links for world \"" + world.getName() + "\""); try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) { Map<String, String> linksMap = mainDB.hashMap("l...
Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey()); if (regionOpt.isPresent()) { IWorldRegion region = regionOpt.get(); logger.info("Loading links for world region \"" + region.getName() + "\"");
28,818
StringBuilder builder = new StringBuilder(); for (Iterator<IHandler> it = handlers.iterator(); it.hasNext(); ) { builder.append(it.next().getName()); if (it.hasNext()) builder.append(","); } <BUG>return builder.toString(); }</BUG> private final class LoadEntry { public final String name; public final Type type;
public enum Type { REGION, WREGION, HANDLER
28,819
.autoCloseQuotes(true) .leaveFinalAsIs(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream() </BUG> .filter(new StartsWithPredicate(parse.current.token)) .co...
return Stream.of("region", "worldregion", "handler", "controller")
28,820
final Float MAX_VALUE = 1e38f; Long currentEid = -1l; public ResultHistogram() { log = LoggerFactory.getLogger(this.getClass()); } <BUG>public void generateHistogram(Long bardExptId) throws SQLException { currentEid = bardExptId;</BUG> Connection conn = CAPUtil.connectToBARD(CAPConstants.getBardDBJDBCUrl()); PreparedSt...
boolean useLog = false; currentEid = bardExptId;
28,821
double[] vals = new double[values.size()]; for (int i = 0; i < values.size(); i++) vals[i] = Math.log10(values.get(i)); double statistic = NormalityTest.anderson_darling_statistic(vals); double pvalue = NormalityTest.anderson_darling_pvalue(statistic, vals.length); if (Double.isNaN(pvalue) || pvalue < 0.05) { // log10...
log.info("BARD experiment id " + bardExptId + "/" + resultType + " is log normal. Histogramming log10 values"); useLog = true; }
28,822
return "Whenever an opponent casts a spell, that player loses 5 life unless he or she discards a card."; } }</BUG> class PainfulQuandryEffect extends OneShotEffect { public PainfulQuandryEffect() { <BUG>super(Outcome.Damage); staticText = "player loses 5 life unless he or she discards a card"; </BUG> }
@Override public PainfulQuandary copy() { return new PainfulQuandary(this); super(Outcome.LoseLife); staticText = "that player loses 5 life unless he or she discards a card";
28,823
public ClusterAllocationExplanation(StreamInput in) throws IOException { this.shard = ShardId.readShardId(in); this.primary = in.readBoolean(); this.assignedNodeId = in.readOptionalString(); this.unassignedInfo = in.readOptionalWriteable(UnassignedInfo::new); <BUG>this.remainingDelayNanos = in.readVLong(); int allocId...
this.remainingDelayMillis = in.readVLong();
28,824
public void writeTo(StreamOutput out) throws IOException { this.getShard().writeTo(out); out.writeBoolean(this.isPrimary()); out.writeOptionalString(this.getAssignedNodeId()); out.writeOptionalWriteable(this.getUnassignedInfo()); <BUG>out.writeVLong(remainingDelayNanos); out.writeVInt(activeAllocationIds.size()); for ...
out.writeVLong(remainingDelayMillis);
28,825
builder.field("assigned_node_id", this.assignedNodeId); } if (unassignedInfo != null) { unassignedInfo.toXContent(builder, params); long delay = unassignedInfo.getLastComputedLeftDelayNanos(); <BUG>builder.field("allocation_delay", TimeValue.timeValueNanos(delay)); builder.field("allocation_delay_ms", TimeValue.timeVa...
builder.timeValueField("allocation_delay_ms", "allocation_delay", TimeValue.timeValueNanos(delay)); builder.timeValueField("remaining_delay_ms", "remaining_delay", TimeValue.timeValueMillis(remainingDelayMillis));
28,826
public enum StoreCopy { NONE((byte) 0), AVAILABLE((byte) 1), CORRUPT((byte) 2), IO_ERROR((byte) 3), <BUG>STALE((byte) 4); private final byte id;</BUG> StoreCopy (byte id) { this.id = id;
STALE((byte) 4), UNKNOWN((byte) 5); private final byte id;
28,827
switch (id) { case 0: return NONE; case 1: return AVAILABLE; case 2: return CORRUPT; case 3: return IO_ERROR; <BUG>case 4: return STALE; default:</BUG> throw new IllegalArgumentException("unknown id for store copy: [" + id + "]"); } }
case 5: return UNKNOWN; default:
28,828
updatedRoots.addAll(roots); } if (updatedRoots.isEmpty()) { Messages.showErrorDialog(myVcs.getProject(), SvnBundle.message("message.text.update.no.directories.found"), SvnBundle.message("messate.text.update.error")); } <BUG>final Collection<String> conflictedFiles = updatedFiles.getGroupById(FileGroup.MERGED_WITH_CONFL...
final FileGroup conflictedGroup = updatedFiles.getGroupById(FileGroup.MERGED_WITH_CONFLICT_ID); final Collection<String> conflictedFiles = conflictedGroup.getFiles(); return new UpdateSessionAdapter(exceptions, false) {
28,829
if (!vfFiles.isEmpty()) { final AbstractVcsHelper vcsHelper = AbstractVcsHelper.getInstance(myVcs.getProject()); List<VirtualFile> mergedFiles = vcsHelper.showMergeDialog(vfFiles, new SvnMergeProvider(myVcs.getProject())); FileGroup mergedGroup = updatedFiles.getGroupById(FileGroup.MERGED_ID); for(VirtualFile mergedFil...
VcsRevisionNumber revision = conflictedGroup.getRevision(myVcs.getProject(), path); conflictedGroup.remove(path); mergedGroup.add(path, myVcs, revision);
28,830
if (myUpdatedFiles.getGroupById(FileGroup.REMOVED_FROM_REPOSITORY_ID).getFiles().contains(path)) { myUpdatedFiles.getGroupById(FileGroup.REMOVED_FROM_REPOSITORY_ID).getFiles().remove(path); if (myUpdatedFiles.getGroupById(SvnStatusEnvironment.REPLACED_ID) == null) { myUpdatedFiles.registerGroup(SvnStatusEnvironment.cre...
addFileToGroup(SvnStatusEnvironment.REPLACED_ID, event); addFileToGroup(FileGroup.CREATED_ID, event);
28,831
else if (event.getContentsStatus() == SVNStatusType.UNCHANGED && event.getPropertiesStatus() == SVNStatusType.UNCHANGED) { text2 = SvnBundle.message("progres.text2.updated", displayPath); } else { text2 = ""; <BUG>myUpdatedFiles.getGroupById(FileGroup.UNKNOWN_ID).add(path); }</BUG> } else if (event.getAction() == SVNEv...
addFileToGroup(FileGroup.UNKNOWN_ID, event);
28,832
text2 = SvnBundle.message("progress.text2.skipped.file", displayPath); if (myUpdatedFiles.getGroupById(SKIP_ID) == null) { myUpdatedFiles.registerGroup(new FileGroup(SvnBundle.message("update.group.name.skipped"), SvnBundle.message("update.group.name.skipped"), false, SKIP_ID, true)); } <BUG>myUpdatedFiles.getGroupById...
addFileToGroup(SKIP_ID, event);
28,833
myProgressIndicator.setText(text); } if (text2 != null) { myProgressIndicator.setText2(text2); } <BUG>} }</BUG> public void checkCancelled() throws SVNCancelException { if (myProgressIndicator != null) { myProgressIndicator.checkCanceled();
private void addFileToGroup(final String id, final SVNEvent event) { myUpdatedFiles.getGroupById(id).add(event.getFile().getAbsolutePath());
28,834
import com.intellij.openapi.vcs.FilePath; import com.intellij.openapi.vcs.VcsException; import com.intellij.openapi.vcs.update.UpdatedFiles; import org.jetbrains.idea.svn.SvnBundle; import org.jetbrains.idea.svn.SvnVcs; <BUG>import org.jetbrains.idea.svn.SvnConfiguration; import org.tmatesoft.svn.core.SVNException;</BU...
import org.jetbrains.idea.svn.SvnRevisionNumber; import org.tmatesoft.svn.core.SVNException;
28,835
import javax.swing.border.AbstractBorder; import javax.swing.border.Border; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import org.fife.ui.rsyntaxtextarea.PopupWindowDecorator; <BUG>class AutoCompleteDescWindow extends JWindow implements HyperlinkListener { private AutoCompleti...
class AutoCompleteDescWindow extends JWindow implements HyperlinkListener, DescWindowCallback { private AutoCompletion ac;
28,836
historyPos = -1; timerAction = new TimerAction(); timer = new Timer(INITIAL_TIMER_DELAY, timerAction); timer.setRepeats(false); } <BUG>private void addToHistory(String html) { history.add(++historyPos, html); </BUG> clearHistoryAfterCurrentPos();
private void addToHistory(HistoryEntry historyItem) { history.add(++historyPos, historyItem);
28,837
log().debug("testLatencyThresholdingSet: run number 5"); triggerEvents = thresholdingSet.applyThresholds("http", attributes); assertTrue(triggerEvents.size() == 1); } List<Event> rearmEvents = null; <BUG>if (thresholdingSet.hasThresholds("http")) { </BUG> attributes.put("http", 40.0); rearmEvents = thresholdingSet.appl...
if (thresholdingSet.hasThresholds(attributes)) {
28,838
int population = 0; int num_edges = 0; for( Pair<Integer,Integer> i : histogram ) { population+=i.getValue(); num_edges+=i.getValue()*i.getKey(); <BUG>} int avgDegreeAt1B = 200;</BUG> int avgDegree = num_edges/population; double aCoeff = Math.log(avgDegreeAt1B) / Math.log(1000000000) ; double bCoeff = (aCoeff - (Math....
num_edges /= 2; int avgDegreeAt1B = 200;
28,839
import org.codehaus.groovy.control.CompilationUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public final class GroovyTreeParser implements TreeParser { private static final Logger logger = LoggerFactory.getLogger(GroovyTreeParser.class); <BUG>private static final String GROOVY_DEFAULT_INTERFACE = "groo...
private Indexer indexer = new Indexer();
28,840
if (scriptClass != null) { sourceUnit.getAST().getStatementBlock().getVariableScope().getDeclaredVariables().values().forEach( variable -> { SymbolInformation symbol = getVariableSymbolInformation(scriptClass.getName(), sourceUri, variable); <BUG>addToValueSet(newTypeReferences, variable.getType().getName(), symbol); s...
newIndexer.addSymbol(sourceUnit.getSource().getURI(), symbol); if (classes.containsKey(variable.getType().getName())) { newIndexer.addReference(classes.get(variable.getType().getName()), GroovyLocations.createLocation(sourceUri, variable.getType()));
28,841
} if (typeReferences.containsKey(foundSymbol.getName())) { foundReferences.addAll(typeReferences.get(foundSymbol.getName()));</BUG> } <BUG>return foundReferences; }</BUG> @Override public Set<SymbolInformation> getFilteredSymbols(String query) { checkNotNull(query, "query must not be null"); Pattern pattern = getQueryP...
}); sourceUnit.getAST().getStatementBlock() .visit(new MethodVisitor(newIndexer, sourceUri, sourceUnit.getAST().getScriptClassDummy(), classes, Maps.newHashMap(), Optional.absent(), workspaceUriSupplier));
28,842
<BUG>package com.palantir.ls.server.api; import io.typefox.lsapi.ReferenceParams;</BUG> import io.typefox.lsapi.SymbolInformation; import java.net.URI; import java.util.Map;
import com.google.common.base.Optional; import io.typefox.lsapi.Location; import io.typefox.lsapi.Position; import io.typefox.lsapi.ReferenceParams;
28,843
import java.util.Map; import java.util.Set; public interface TreeParser { void parseAllSymbols(); Map<URI, Set<SymbolInformation>> getFileSymbols(); <BUG>Map<String, Set<SymbolInformation>> getTypeReferences(); Set<SymbolInformation> findReferences(ReferenceParams params); Set<SymbolInformation> getFilteredSymbols(St...
Map<Location, Set<Location>> getReferences(); Set<Location> findReferences(ReferenceParams params); Optional<Location> gotoDefinition(URI uri, Position position); Set<SymbolInformation> getFilteredSymbols(String query);
28,844
.workspaceSymbolProvider(true) .referencesProvider(true) .completionProvider(new CompletionOptionsBuilder() .resolveProvider(false) .triggerCharacter(".") <BUG>.build()) .build();</BUG> InitializeResult result = new InitializeResultBuilder() .capabilities(capabilities) .build();
.definitionProvider(true)
28,845
package com.palantir.ls.server; import com.palantir.ls.server.api.CompilerWrapper; import com.palantir.ls.server.api.TreeParser; import com.palantir.ls.server.api.WorkspaceCompiler; <BUG>import io.typefox.lsapi.FileEvent; import io.typefox.lsapi.PublishDiagnosticsParams;</BUG> import io.typefox.lsapi.ReferenceParams; i...
import com.google.common.base.Optional; import io.typefox.lsapi.Location; import io.typefox.lsapi.Position; import io.typefox.lsapi.PublishDiagnosticsParams;
28,846
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
28,847
} @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_memo); <BUG>ChinaPhoneHelper.setStatusBar(this,true); </BUG> topicId = getIntent().getLongExtra("topicId", -1); if (topicId == -1) { finish();
ChinaPhoneHelper.setStatusBar(this, true);
28,848
MemoEntry.COLUMN_REF_TOPIC__ID + " = ?" , new String[]{String.valueOf(topicId)}); } public Cursor selectMemo(long topicId) { Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != nu...
MemoEntry.COLUMN_ORDER + " ASC", null);
28,849
MemoEntry._ID + " = ?", new String[]{String.valueOf(memoId)}); } public long updateMemoContent(long memoId, String memoContent) { ContentValues values = new ContentValues(); <BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent); return db.update(</BUG> MemoEntry.TABLE_NAME, values, MemoEntry._ID + " = ?",
return db.update(
28,850
import android.widget.RelativeLayout; import android.widget.TextView; import com.kiminonawa.mydiary.R; import com.kiminonawa.mydiary.db.DBManager; import com.kiminonawa.mydiary.shared.EditMode; <BUG>import com.kiminonawa.mydiary.shared.ThemeManager; import java.util.List; public class MemoAdapter extends RecyclerView.A...
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
28,851
private DBManager dbManager; private boolean isEditMode = false; private EditMemoDialogFragment.MemoCallback callback; private static final int TYPE_HEADER = 0; private static final int TYPE_ITEM = 1; <BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMe...
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
28,852
this.memoList = memoList; this.dbManager = dbManager; this.callback = callback; } @Override <BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { </BUG> View view; if (isEditMode) { if (viewType == TYPE_HEADER) {
public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
28,853
editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment"); } }); } } <BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private View rootView; private TextView TV_memo_item_content;</BUG> private ImageView IV_memo_item_delete;
protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener { private ImageView IV_memo_item_dot; private TextView TV_memo_item_content;
28,854
return showIconsDistance; } public int getSelectedNodeSize() { return selectedNodeSize; } <BUG>public int getJunctionNodeSize() { return junctionNodeSize; </BUG> }
public int getConnectionNodeSize() { return connectionNodeSize;
28,855
import org.openstreetmap.josm.Main; import org.openstreetmap.josm.data.Preferences.ColorKey; public enum PaintColors implements ColorKey { INACTIVE(marktr("inactive"), Color.darkGray), SELECTED(marktr("selected"), Color.red), <BUG>NODE(marktr("node"), Color.yellow), TAGGED(marktr("tagged"), new Color(204, 255, 255)), ...
NODE(marktr("Node: standard"), Color.yellow), CONNECTION(marktr("Node: connection"), Color.yellow), TAGGED(marktr("Node: tagged"), new Color(204, 255, 255)), // light cyan
28,856
protected Color relationColor; protected Color untaggedWayColor; protected Color incompleteColor; protected Color backgroundColor; protected Color highlightColor; <BUG>protected Color taggedColor; protected boolean showDirectionArrow;</BUG> protected boolean showRelevantDirectionsOnly; protected boolean showHeadArrowOn...
protected Color connectionColor; protected Color taggedConnectionColor; protected boolean showDirectionArrow;
28,857
g.fillRect(x-1, y-12, 8*strlen+1, 14); g.setColor(c); g.drawString(on, x, y); } } <BUG>public void drawNode(Node n, Color color, int size, int radius, boolean fill) { if (size > 1) { Point p = nc.getPoint(n);</BUG> if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight()))
public void drawNode(Node n, Color color, int size, boolean fill) { int radius = size / 2; Point p = nc.getPoint(n);
28,858
public class SimpleNodeElemStyle extends ElemStyle { public static final SimpleNodeElemStyle INSTANCE = new SimpleNodeElemStyle(); private SimpleNodeElemStyle() { minScale = 0; maxScale = 1500; <BUG>} @Override</BUG> public void paintPrimitive(OsmPrimitive primitive, MapPaintSettings settings, MapPainter painter, boole...
private static final int max(int a, int b, int c, int d) { return Math.max(Math.max(a, b), Math.max(c, d)); @Override
28,859
if (connect(isProducer)) { break; } } catch (InvalidSelectorException e) { throw new ConnectionException( <BUG>"Connection to JMS failed. Invalid message selector"); } catch (JMSException | NamingException e) { logger.log(LogLevel.ERROR, "RECONNECTION_EXCEPTION", </BUG> new Object[] { e.toString() });
Messages.getString("CONNECTION_TO_JMS_FAILED_INVALID_MSG_SELECTOR")); //$NON-NLS-1$ logger.log(LogLevel.ERROR, "RECONNECTION_EXCEPTION", //$NON-NLS-1$
28,860
private synchronized void createConnectionNoRetry() throws ConnectionException { if (!isConnectValid()) { try { connect(isProducer); } catch (JMSException e) { <BUG>logger.log(LogLevel.ERROR, "Connection to JMS failed", new Object[] { e.toString() }); throw new ConnectionException( "Connection to JMS failed. Did not tr...
logger.log(LogLevel.ERROR, "CONNECTION_TO_JMS_FAILED", new Object[] { e.toString() }); //$NON-NLS-1$ Messages.getString("CONNECTION_TO_JMS_FAILED_NO_RECONNECT_AS_RECONNECT_POLICY_DOES_NOT_APPLY")); //$NON-NLS-1$
28,861
boolean res = false; int count = 0; do { try { if(count > 0) { <BUG>logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count }); </BUG> Thread.sleep(messageRetryDelay); } synchronized (getSession()) {
logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count }); //$NON-NLS-1$
28,862
getProducer().send(message); res = true; } } catch (JMSException e) { <BUG>logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() }); logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT"); </BUG> setConnect(null);
logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() }); //$NON-NLS-1$ logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT"); //$NON-NLS-1$
28,863
import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import com.ibm.streams.operator.Attribute; import com.ibm.streams.operator.StreamSchema; import com.ibm.streams.operator.Type; <BUG>import com.ibm.streams.operator.Type.MetaType; class ConnectionDocumentParser {</BUG> private static final Set<String> support...
import com.ibm.streamsx.messaging.jms.Messages; class ConnectionDocumentParser {
28,864
return msgClass; } private void convertProviderURLPath(File applicationDir) throws ParseConnectionDocumentException { if(!isAMQ()) { if(this.providerURL == null || this.providerURL.trim().length() == 0) { <BUG>throw new ParseConnectionDocumentException("A value must be specified for provider_url attribute in connection...
throw new ParseConnectionDocumentException(Messages.getString("PROVIDER_URL_MUST_BE_SPECIFIED_IN_CONN_DOC")); //$NON-NLS-1$
28,865
URL absProviderURL = new URL(url.getProtocol(), url.getHost(), applicationDir.getAbsolutePath() + File.separator + path); this.providerURL = absProviderURL.toExternalForm(); } } } catch (MalformedURLException e) { <BUG>throw new ParseConnectionDocumentException("Invalid provider_url value detected: " + e.getMessage());...
throw new ParseConnectionDocumentException(Messages.getString("INVALID_PROVIDER_URL", e.getMessage())); //$NON-NLS-1$
28,866
for (int j = 0; j < accessSpecChildNodes.getLength(); j++) { if (accessSpecChildNodes.item(j).getNodeName().equals("destination")) { //$NON-NLS-1$ destIndex = j; } else if (accessSpecChildNodes.item(j).getNodeName().equals("uses_connection")) { //$NON-NLS-1$ if (!connection.equals(accessSpecChildNodes.item(j).getAttrib...
throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_CONNECTION_PARAM_NOT_THE_SAME_AS_CONN_USED_BY_ACCESS_ELEMENT", connection, access )); //$NON-NLS-1$
28,867
nativeSchema = access_specification.item(i).getChildNodes().item(nativeSchemaIndex); } break; } } <BUG>if (!accessFound) { throw new ParseConnectionDocumentException("The value of the access parameter " + access + " is not found in the connections document");</BUG> } return nativeSchema;
throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_ACCESS_PARAM_NOT_FOUND_IN_CONN_DOC", access )); //$NON-NLS-1$
28,868
nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$ .getNodeValue())); } if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22) && ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema <BUG>.getAttribute(nativeAttrName).getType().getMe...
throw new ParseConnectionDocumentException(Messages.getString("BLOB_NOT_SUPPORTED_FOR_MSG_CLASS", msgClass)); //$NON-NLS-1$
28,869
throw new ParseConnectionDocumentException(" Blob data type is not supported for message class " + msgClass);</BUG> } Iterator<NativeSchema> it = nativeSchemaObjects.iterator(); while (it.hasNext()) { <BUG>if (it.next().getName().equals(nativeAttrName)) { throw new ParseConnectionDocumentException("Parameter name: " + ...
nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$ .getNodeValue())); if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22) && ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema .getAttribute(nativeAttrName).getType().getMetaType(...
28,870
if (msgClass == MessageClass.text) { typesWithLength = new HashSet<String>(Arrays.asList("Bytes")); //$NON-NLS-1$ } Set<String> typesWithoutLength = new HashSet<String>(Arrays.asList("Byte", "Short", "Int", "Long", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ "Float", "Double", "Boolean")); //$NON-NLS-1$ //$...
throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
28,871
if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) && (msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22 || msgClass == MessageClass.xml) && (streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.RSTRING) && (streamSc...
throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
28,872
if (streamSchema.getAttribute(nativeAttrName) != null) { MetaType metaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType(); if (metaType == Type.MetaType.DECIMAL32 || metaType == Type.MetaType.DECIMAL64 || metaType == Type.MetaType.DECIMAL128 || metaType == Type.MetaType.TIMESTAMP) { if (nativeAttrL...
Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_WITH_TYPE_IN_NATIVE_SCHEMA", nativeAttrName, metaType )); //$NON-NLS-1$
28,873
nativeAttrLength = -4; } } } if (typesWithLength.contains(nativeAttrType)) { <BUG>if (nativeAttrLength == LENGTH_ABSENT_IN_NATIVE_SCHEMA && msgClass == MessageClass.bytes) { throw new ParseConnectionDocumentException("Length attribute should be present for parameter: " + nativeAttrName + " In native schema file for mes...
throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA_FOR_MSG_CLASS_BYTES", nativeAttrName )); //$NON-NLS-1$
28,874
if (streamSchema.getAttribute(nativeAttrName) != null) { streamAttrName = streamSchema.getAttribute(nativeAttrName).getName(); streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType(); if ((msgClass == MessageClass.stream || msgClass == MessageClass.map) && !mapSPLToNativeSchemaDataTypesFo...
throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
28,875
+ nativeAttrType + " in the native schema cannot be mapped with attribute: " + streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG> } else if (msgClass == MessageClass.bytes && !mapSPLToNativeSchemaDataTypesForBytes.get(streamAttrMetaType.getLanguageType()).equals( <BUG>nativeAttrType)) { thr...
if (streamSchema.getAttribute(nativeAttrName) != null) { streamAttrName = streamSchema.getAttribute(nativeAttrName).getName(); streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType(); if ((msgClass == MessageClass.stream || msgClass == MessageClass.map) && !mapSPLToNativeSchemaDataTypesFo...
28,876
package com.ibm.streamsx.messaging.i18n; import java.text.MessageFormat; import java.util.MissingResourceException; import java.util.ResourceBundle; public class Messages { <BUG>private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.mqtt.MQTTMessages"; //$NON-NLS-1$ </BUG> private static final ResourceBu...
private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.i18n.CommonMessages"; //$NON-NLS-1$
28,877
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.TangoC...
import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
28,878
super.onResume(); if (!mIsConnected) { mTango = new Tango(AugmentedRealityActivity.this, new Runnable() { @Override public void run() { <BUG>try { connectTango();</BUG> setupRenderer(); mIsConnected = true; } catch (TangoOutOfDateException e) {
TangoSupport.initialize(); connectTango();
28,879
if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) { mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics); mCameraPoseTimestamp = lastFramePose.timestamp;</BUG> } else { <BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread); }</BUG> } } } @Override
mRenderer.updateRenderCameraPose(lastFramePose); mCameraPoseTimestamp = lastFramePose.timestamp; Log.w(TAG, "Can't get device pose at time: " +
28,880
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....
import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3;
28,881
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) { Pose cameraPose = ScenePoseCalculator.t...
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()...
28,882
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.tangos...
import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig;
28,883
final PsiClass aClass = classType.resolve(); if (!(aClass instanceof PsiTypeParameter)) { return classType.rawType(); } else { <BUG>return typeParameterErasure((PsiTypeParameter)aClass); </BUG> } } public PsiType visitWildcardType(PsiWildcardType wildcardType) {
return typeParameterErasure((PsiTypeParameter)aClass, beforeSubstitutor);
28,884
portfolio.addPosition(new PortfolioPosition("VMware, Inc.", "VMW", 65.58, 23)); portfolio.addPosition(new PortfolioPosition("Red Hat", "RHT", 48.30, 15)); this.portfolioLookup.put("paulson", portfolio);</BUG> } <BUG>public Portfolio findPortfolio(String username) { Portfolio portfolio = this.portfolioLookup.get(usernam...
package ch.rasc.s4ws.portfolio.service; import ch.rasc.s4ws.portfolio.Portfolio; public interface PortfolioService { Portfolio findPortfolio(String username);
28,885
</BUG> import java.util.List; import java.util.Map; public class Portfolio { <BUG>private final Map<String, PortfolioPosition> positionLookup = new HashMap<>(); </BUG> public List<PortfolioPosition> getPositions() { return new ArrayList<>(positionLookup.values()); } public void addPosition(PortfolioPosition position) {...
package ch.rasc.s4ws.portfolio; import java.util.ArrayList; import java.util.LinkedHashMap; private final Map<String, PortfolioPosition> positionLookup = new LinkedHashMap<>();
28,886
package ch.rasc.s4ws.portfolio.config; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; <...
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.web.header.writers.frameoptions.XFrameOptionsHeaderWriter; @EnableWebSecurity
28,887
int j = 0; for(double d:vals)if(d != 0)nonzeros[nzs++] = j++; Key key = Vec.newKey(); AppendableVec av = new AppendableVec(key); NewChunk nv = new NewChunk(av,0); <BUG>for(double d:vals)nv.addNum(d); nv.close(0,null);</BUG> Vec vec = av.close(new Futures()); return vec.chunkForChunkIdx(0); }
for(double d:vals){ if(Double.isNaN(d))nv.addNA(); else if((long)d == d) nv.addNum((long)d,0); else nv.addNum(d); nv.close(0,null);
28,888
@Override boolean set_impl(int idx, float f ) { return false; } @Override boolean setNA_impl(int idx) { return false; } @Override protected long at8_impl(int idx) { int off = findOffset(idx); if(getId(off) != idx)return 0; <BUG>long v = getIValue(off); if( v== NAS[_valsz_log -1])throw new IllegalArgumentExcepti...
if( v== NAS[_valsz_log]) return v;
28,889
public byte type() { if( _naCnt == -1 ) { // No rollups yet? int nas=0, ss=0, nzs=0; if( _ds != null ) { assert _ls==null && _xs==null; <BUG>for( double d : _ds ) if( Double.isNaN(d) ) nas++; else if( d!=0 ) nzs++; } else {</BUG> assert _ds==null; if( _ls != null ) for( int i=0; i<_len; i++ )
for( int i = 0; i < _len; ++i) if( Double.isNaN(_ds[i]) ) nas++; else if( _ds[i]!=0 ) nzs++; } else {
28,890
System.arraycopy(nc._id,0,_id,_len,nc._len); for(int i = _len; i < _len + nc._len; ++i) _id[i] += _len2; _len += nc._len;</BUG> _len2 += nc._len2; <BUG>nc._ls = null; nc._xs = null; nc._id = null; nc._len = nc._len2 = 0; }</BUG> public void addr( NewChunk nc ) { long [] tmpl = _ls; _ls = nc._ls; nc._ls = tmpl; int ...
} else assert nc._id == null; _len += nc._len; assert _len <= _len2; }
28,891
_ls[_len] = l; _xs[_len] = x; if(_id != null)_id[_len] = _len2; _len++; } <BUG>_len2++; }</BUG> private void append2slowd() { if( _len > Vec.CHUNK_SZ ) throw new ArrayIndexOutOfBoundsException(_len);
assert _len <= _len2;
28,892
int nzs = 0; for(long l:_ls) if(l != 0)++nzs; if((nzs+1)*MIN_SPARSE_RATIO < _len2){ set_sparse(nzs); assert _len == 0 || _len <= _ls.length:"_len = " + _len + ", _ls.length = " + _ls.length + ", nzs = " + nzs + ", len2 = " + _len2; <BUG>assert _id.length == _ls.length; return;</BUG> } } else { if((MIN_SPARSE_RATIO*(_l...
assert _len <= _len2; return;
28,893
_ls = MemoryManager.malloc8(4); _xs = MemoryManager.malloc4(4); _id = _id == null?null:MemoryManager.malloc4(4); } assert _len == 0 || _len < _ls.length:"_len = " + _len + ", _ls.length = " + _ls.length; <BUG>assert _id == null || _id.length == _ls.length; }</BUG> public Chunk new_close() { Chunk chk = compress(); if(_...
assert _len <= _len2;
28,894
_xs = null; _ds = ds; } protected void set_sparse(int nzeros){ if(_len == nzeros)return; <BUG>assert _len == _len2; int zs = 0;</BUG> if(_ds == null){ assert nzeros < _ls.length; _id = MemoryManager.malloc4(_ls.length);
assert _len == _len2:"_len = " + _len + ", _len2 = " + _len2 + ", nzeros = " + nzeros; int zs = 0;
28,895
import de.vanita5.twittnuker.receiver.NotificationReceiver; import de.vanita5.twittnuker.service.LengthyOperationsService; import de.vanita5.twittnuker.util.ActivityTracker; import de.vanita5.twittnuker.util.AsyncTwitterWrapper; import de.vanita5.twittnuker.util.DataStoreFunctionsKt; <BUG>import de.vanita5.twittnuker.u...
import de.vanita5.twittnuker.util.DebugLog; import de.vanita5.twittnuker.util.ImagePreloader;
28,896
final List<InetAddress> addresses = mDns.lookup(host); for (InetAddress address : addresses) { c.addRow(new String[]{host, address.getHostAddress()}); } } catch (final IOException ignore) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, ignore); }</BUG> }
DebugLog.w(LOGTAG, null, ignore);
28,897
@Override public void afterExecute(Bus handler, SingleResponse<Relationship> result) { if (result.hasData()) { handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData())); } else if (result.hasException()) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, "Unable to update friendship", result.getExcepti...
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
28,898
MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId); if (!Utils.isOfficialCredentials(context, accountId)) continue; try { microBlog.setActivitiesAboutMeUnread(cursor); } catch (MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
28,899
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBannerImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.form...
if (deleteImage) { Utils.deleteMedia(context, imageUri);
28,900
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBackgroundImage(fileBody, tile); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, S...
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);