id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
4,301 | public void setMatches( List<AssociatedPair> matches ) {
this.locationSrc.clear();
this.locationDst.clear();
for( int i = 0; i < matches.size(); i++ ) {
AssociatedPair p = matches.get(i);
<BUG>locationSrc.add( p.p1 );
locationDst.add( p.p2 );
</BUG>
}
| locationSrc.add( p.p1.copy() );
locationDst.add( p.p2.copy() );
|
4,302 | hasRight = true;
grayDst.setTo(image);
ConvertBitmap.grayToBitmap(image,bitmapDst,storage);
}
}
<BUG>public synchronized void render(Canvas canvas, double tranX , double tranY , double scale ) {
this.scale = scale;</BUG>
this.tranX = tranX;
this.tranY = tranY;
int startX = bitmapSrc.getWidth()+SEPARATION;
| public void render(Canvas canvas, double tranX , double tranY , double scale ) {
this.scale = scale;
|
4,303 | package org.netbeans.jpa.modeler.properties.annotation;
<BUG>import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;</BUG>
import static org.apache.commons.lang.StringUtils.EMPTY;
import org.netbeans.jpa.modeler.internal.jpqleditor.ModelerPanel;
import org.netbeans.jpa.modeler.spec.extend.annotation.Annotation;
| import javax.swing.JEditorPane;
import javax.swing.JOptionPane;
|
4,304 | root_jLayeredPane.setLayout(root_jLayeredPaneLayout);
root_jLayeredPaneLayout.setHorizontalGroup(
root_jLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(root_jLayeredPaneLayout.createSequentialGroup()
.addContainerGap()
<BUG>.addComponent(class_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, 335, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(dataType_Action, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);</BUG>
root_jLayeredPaneLayout.setVerticalGroup(
| .addComponent(class_WrapperPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addContainerGap())
|
4,305 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(root_jLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
</BUG>
.addComponent(dataType_Action, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
<BUG>.addComponent(class_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);</BUG>
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
| .addComponent(dataType_Action, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
root_jLayeredPaneLayout.setVerticalGroup(
.addGroup(root_jLayeredPaneLayout.createSequentialGroup()
.addContainerGap()
.addGroup(root_jLayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(class_WrapperPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
4,306 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(root_jLayeredPane)
);
}// </editor-fold>//GEN-END:initComponents
private void dataType_ActionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dataType_ActionActionPerformed
<BUG>String dataType = NBModelerUtil.browseClass(modelerFile, class_TextField.getText());
if(StringUtils.isNotEmpty(dataType)){
class_TextField.setText(dataType);
</BUG>
}
| layout.setVerticalGroup(
String dataType = NBModelerUtil.browseClass(modelerFile, class_EditorPane.getText());
if (StringUtils.isNotEmpty(dataType)) {
class_EditorPane.setText(dataType);
|
4,307 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
4,308 | }
@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);
|
4,309 | 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 != null) {
c.moveToFirst();
}
| MemoEntry.COLUMN_ORDER + " ASC", null);
|
4,310 | 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(
|
4,311 | 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.Adapter<RecyclerView.ViewHolder> implements EditMode {
</BUG>
private List<MemoEntity> memoList;
| import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;
public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
|
4,312 | 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, EditMemoDialogFragment.MemoCallback callback) {
this.mActivity = activity;</BUG>
this.topicId = topicId;
this.memoList = memoList;
| public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {
super(recyclerView);
this.mActivity = activity;
|
4,313 | 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) {
|
4,314 | 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;
|
4,315 | public ReportElement getBase() {
return base;
}
@Override
public float print(PDDocument document, PDPageContentStream stream, int pageNumber, float startX, float startY, float allowedWidth) throws IOException {
<BUG>PDPage currPage = (PDPage) document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, true, false);
</BUG>
base.print(document, pageStream, pageNo, x, y, width);
pageStream.close();
| PDPage currPage = document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, PDPageContentStream.AppendMode.APPEND, false);
|
4,316 | public PdfTextStyle(String config) {
Assert.hasText(config);
String[] split = config.split(",");
Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000");
fontSize = Integer.parseInt(split[0]);
<BUG>font = resolveStandard14Name(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));</BUG>
}
public int getFontSize() {
return fontSize;
| font = getFont(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));
|
4,317 | package cc.catalysts.boot.report.pdf.elements;
import cc.catalysts.boot.report.pdf.config.PdfTextStyle;
import cc.catalysts.boot.report.pdf.utils.ReportAlignType;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
<BUG>import org.apache.pdfbox.pdmodel.font.PDFont;
import org.slf4j.Logger;</BUG>
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
import java.io.IOException;
| import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.apache.pdfbox.util.Matrix;
import org.slf4j.Logger;
|
4,318 | addTextSimple(stream, textConfig, textX, nextLineY, "");
return nextLineY;
}
try {
<BUG>String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, fixedText);
</BUG>
float x = calculateAlignPosition(textX, align, textConfig, allowedWidth, split[0]);
if (!underline) {
addTextSimple(stream, textConfig, x, nextLineY, split[0]);
} else {
| String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, text);
|
4,319 | public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
try {
stream.setFont(textConfig.getFont(), textConfig.getFontSize());
stream.setNonStrokingColor(textConfig.getColor());
stream.beginText();
<BUG>stream.newLineAtOffset(textX, textY);
stream.showText(text);</BUG>
} catch (Exception e) {
LOG.warn("Could not add text: " + e.getClass() + " - " + e.getMessage());
}
| stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY));
stream.showText(text);
|
4,320 | public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
addTextSimple(stream, textConfig, textX, textY, text);
try {
float lineOffset = textConfig.getFontSize() / 8F;
stream.setStrokingColor(textConfig.getColor());
<BUG>stream.setLineWidth(0.5F);
stream.drawLine(textX, textY - lineOffset, textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
</BUG>
stream.stroke();
} catch (IOException e) {
| stream.moveTo(textX, textY - lineOffset);
stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
|
4,321 | list.add(text.length());
return list;
}
public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) {
String endPart = "";
<BUG>String shortenedText = text;
List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {</BUG>
String[] splittedFirst = splitText(font, fontSize, allowedWidth, breakSplitted.get(0));
StringBuilder remaining = new StringBuilder(splittedFirst[1] == null ? "" : splittedFirst[1] + "\n");
| List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {
|
4,322 | package cc.catalysts.boot.report.pdf.elements;
import org.apache.pdfbox.pdmodel.PDDocument;
<BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
import java.io.IOException;</BUG>
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
| import org.apache.pdfbox.pdmodel.PDPageContentStream;
import java.io.IOException;
|
4,323 | import com.intellij.lang.javascript.psi.JSNamedElement;
import com.intellij.lang.javascript.psi.JSVariable;
import com.intellij.lang.javascript.psi.resolve.ImplicitJSVariableImpl;
import com.intellij.lang.javascript.psi.resolve.JSResolveUtil;
import com.intellij.psi.PsiElement;
<BUG>import com.intellij.psi.PsiFile;
import com.intellij.psi.impl.source.resolve.FileContextUtil;</BUG>
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.xml.*;
import com.intellij.util.Consumer;
| import com.intellij.psi.PsiLanguageInjectionHost;
import com.intellij.psi.impl.source.resolve.FileContextUtil;
|
4,324 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.List;
<BUG>import java.util.Optional;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandDelete extends FCCommandBase {
private static final FlagMapper MAPPER = map -> key -> value -> {
map.put(key, value);
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
4,325 | .append(Text.of(TextColors.GREEN, "Usage: "))
.append(getUsage(source))
.build());
return CommandResult.empty();
} else if (isIn(REGIONS_ALIASES, parse.args[0])) {
<BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
IRegion region = FGManager.getInstance().getRegion(parse.args[1]);
</BUG>
boolean isWorldRegion = false;
if (region == null) {
| String regionName = parse.args[1];
IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
|
4,326 | </BUG>
isWorldRegion = true;
}
if (region == null)
<BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!"));
if (region instanceof GlobalWorldRegion) {
</BUG>
throw new CommandException(Text.of("You may not delete the global region!"));
}
| if (world == null)
throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!"));
if (world == null) throw new CommandException(Text.of("Must specify a world!"));
region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null);
throw new CommandException(Text.of("No region exists with the name \"" + regionName + "\"!"));
if (region instanceof IGlobal) {
|
4,327 | source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region"
);
return CommandResult.success();
} else if (isIn(HANDLERS_ALIASES, parse.args[0])) {
if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
<BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[1]);
if (handler == null)
throw new ArgumentParseException(Text.of("No handler exists with that name!"), parse.args[1], 1);
if (handler instanceof GlobalHandler)</BUG>
throw new CommandException(Text.of("You may not delete the global handler!"));
| Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]);
if (!handlerOpt.isPresent())
IHandler handler = handlerOpt.get();
if (handler instanceof GlobalHandler)
|
4,328 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
4,329 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
4,330 | @Dependency(id = "foxcore")
},
description = "A world protection plugin built for SpongeAPI. Requires FoxCore.",
authors = {"gravityfox"},
url = "https://github.com/FoxDenStudio/FoxGuard")
<BUG>public final class FoxGuardMain {
public final Cause pluginCause = Cause.builder().named("plugin", this).build();
private static FoxGuardMain instanceField;</BUG>
@Inject
private Logger logger;
| private static FoxGuardMain instanceField;
|
4,331 | 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;
}
|
4,332 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
4,333 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.*;
<BUG>import java.util.stream.Collectors;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandHere extends FCCommandBase {
private static final String[] PRIORITY_ALIASES = {"priority", "prio", "p"};
private static final FlagMapper MAPPER = map -> key -> value -> {
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
4,334 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index > 0) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
4,335 | private static FGStorageManager instance;
private final Logger logger = FoxGuardMain.instance().getLogger();</BUG>
private final Set<LoadEntry> loaded = new HashSet<>();
private final Path directory = getDirectory();
private final Map<String, Path> worldDirectories;
<BUG>private FGStorageManager() {
defaultModifiedMap = new CacheMap<>((k, m) -> {</BUG>
if (k instanceof IFGObject) {
m.put((IFGObject) k, true);
return true;
| public final HashMap<IFGObject, Boolean> defaultModifiedMap;
private final UserStorageService userStorageService;
private final Logger logger = FoxGuardMain.instance().getLogger();
userStorageService = FoxGuardMain.instance().getUserStorage();
defaultModifiedMap = new CacheMap<>((k, m) -> {
|
4,336 | String name = fgObject.getName();
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| UUID owner = fgObject.getOwner();
boolean isOwned = !owner.equals(SERVER_UUID);
Optional<User> userOwner = userStorageService.get(owner);
String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name;
if (fgObject.autoSave()) {
Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving handler " + logName + " in directory: " + singleDir);
|
4,337 | if (fgObject.autoSave()) {
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
|
4,338 | public synchronized void loadRegionLinks() {
logger.info("Loading region links");
try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getRegion(entry.getKey());
if (region != null) {
logger.info("Loading links for region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());
if (regionOpt.isPresent()) {
IRegion region = regionOpt.get();
logger.info("Loading links for region \"" + region.getName() + "\"");
|
4,339 | public synchronized void loadWorldRegionLinks(World world) {
logger.info("Loading world region links for world \"" + world.getName() + "\"");
try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (region != null) {
logger.info("Loading links for world region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (regionOpt.isPresent()) {
IWorldRegion region = regionOpt.get();
logger.info("Loading links for world region \"" + region.getName() + "\"");
|
4,340 | 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
|
4,341 | .autoCloseQuotes(true)
.leaveFinalAsIs(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream()
</BUG>
.filter(new StartsWithPredicate(parse.current.token))
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "worldregion", "handler", "controller")
|
4,342 | import org.junit.BeforeClass;
import org.junit.Test;
import org.openstreetmap.josm.JOSMFixture;
import org.openstreetmap.josm.data.osm.DataSet;
import org.openstreetmap.josm.data.osm.Node;
<BUG>import org.openstreetmap.josm.data.osm.OsmPrimitive;
import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG>
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.Warning;
public class AddCommandTest {
| import org.openstreetmap.josm.data.osm.User;
import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
4,343 | }
@Test
public void equalsContract() {
EqualsVerifier.forClass(AddCommand.class).usingGetClass()
.withPrefabValues(OsmPrimitive.class,
<BUG>new Node(1), new Node(2))
.withPrefabValues(OsmDataLayer.class,</BUG>
new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
.suppress(Warning.NONFINAL_FIELDS)
.verify();
| .withPrefabValues(DataSet.class,
new DataSet(), new DataSet())
.withPrefabValues(User.class,
User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
.withPrefabValues(OsmDataLayer.class,
|
4,344 | package org.openstreetmap.josm.command;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openstreetmap.josm.JOSMFixture;
<BUG>import org.openstreetmap.josm.data.osm.DataSet;
import org.openstreetmap.josm.data.osm.Way;</BUG>
import org.openstreetmap.josm.gui.layer.OsmDataLayer;
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.Warning;
| import org.openstreetmap.josm.data.osm.User;
import org.openstreetmap.josm.data.osm.Way;
|
4,345 | }
@Test
public void equalsContract() {
EqualsVerifier.forClass(ChangeNodesCommand.class).usingGetClass()
.withPrefabValues(Way.class,
<BUG>new Way(1), new Way(2))
.withPrefabValues(OsmDataLayer.class,</BUG>
new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
.suppress(Warning.NONFINAL_FIELDS)
.verify();
| .withPrefabValues(DataSet.class,
new DataSet(), new DataSet())
.withPrefabValues(User.class,
User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
.withPrefabValues(OsmDataLayer.class,
|
4,346 | import org.junit.BeforeClass;
import org.junit.Test;
import org.openstreetmap.josm.JOSMFixture;
import org.openstreetmap.josm.data.osm.DataSet;
import org.openstreetmap.josm.data.osm.Node;
<BUG>import org.openstreetmap.josm.data.osm.OsmPrimitive;
import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG>
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.Warning;
public class ChangeCommandTest {
| import org.openstreetmap.josm.data.osm.User;
import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
4,347 | public static void setUpBeforeClass() {
JOSMFixture.createUnitTestFixture().init(false);
}
@Test
public void equalsContract() {
<BUG>EqualsVerifier.forClass(ChangeCommand.class).usingGetClass()
.withPrefabValues(OsmPrimitive.class,</BUG>
new Node(1), new Node(2))
.withPrefabValues(OsmDataLayer.class,
new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
| .withPrefabValues(DataSet.class,
new DataSet(), new DataSet())
.withPrefabValues(User.class,
User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
.withPrefabValues(OsmPrimitive.class,
|
4,348 | package org.openstreetmap.josm.command;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openstreetmap.josm.JOSMFixture;
<BUG>import org.openstreetmap.josm.data.osm.DataSet;
import org.openstreetmap.josm.gui.layer.OsmDataLayer;</BUG>
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.Warning;
public class AddPrimitivesCommandTest {
| import org.openstreetmap.josm.data.osm.User;
import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
4,349 | public static void setUpBeforeClass() {
JOSMFixture.createUnitTestFixture().init(false);
}
@Test
public void equalsContract() {
<BUG>EqualsVerifier.forClass(AddPrimitivesCommand.class).usingGetClass()
.withPrefabValues(OsmDataLayer.class,</BUG>
new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
.suppress(Warning.NONFINAL_FIELDS)
.verify();
| .withPrefabValues(DataSet.class,
new DataSet(), new DataSet())
.withPrefabValues(User.class,
User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
.withPrefabValues(OsmDataLayer.class,
|
4,350 | package com.projecttango.examples.java.augmentedreality;
import com.google.atap.tangoservice.Tango;
import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoCameraIntrinsics;
import com.google.atap.tangoservice.TangoConfig;
<BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoEvent;</BUG>
import com.google.atap.tangoservice.TangoOutOfDateException;
import com.google.atap.tangoservice.TangoPoseData;
import com.google.atap.tangoservice.TangoXyzIjData;
| import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
|
4,351 | 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();
|
4,352 | 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: " +
|
4,353 | import org.rajawali3d.materials.Material;
import org.rajawali3d.materials.methods.DiffuseMethod;
import org.rajawali3d.materials.textures.ATexture;
import org.rajawali3d.materials.textures.StreamingTexture;
import org.rajawali3d.materials.textures.Texture;
<BUG>import org.rajawali3d.math.Matrix4;
import org.rajawali3d.math.vector.Vector3;</BUG>
import org.rajawali3d.primitives.ScreenQuad;
import org.rajawali3d.primitives.Sphere;
import org.rajawali3d.renderer.RajawaliRenderer;
| import org.rajawali3d.math.Quaternion;
import org.rajawali3d.math.vector.Vector3;
|
4,354 | translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);
translationMoon.setTransformable3D(moon);
getCurrentScene().registerAnimation(translationMoon);
translationMoon.play();
}
<BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {
Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics);
getCurrentCamera().setRotation(cameraPose.getOrientation());
getCurrentCamera().setPosition(cameraPose.getPosition());
}</BUG>
public int getTextureId() {
| public void updateRenderCameraPose(TangoPoseData cameraPose) {
float[] rotation = cameraPose.getRotationAsFloats();
float[] translation = cameraPose.getTranslationAsFloats();
Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);
getCurrentCamera().setRotation(quaternion.conjugate());
getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
|
4,355 | package com.projecttango.examples.java.helloareadescription;
import com.google.atap.tangoservice.Tango;
<BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoConfig;</BUG>
import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
| import com.google.atap.tangoservice.TangoAreaDescriptionMetaData;
import com.google.atap.tangoservice.TangoConfig;
|
4,356 | import us.ihmc.robotics.robotSide.SideDependentList;
import us.ihmc.wholeBodyController.DRCHandType;
public enum AtlasRobotVersion
{
ATLAS_UNPLUGGED_V5_NO_HANDS,
<BUG>ATLAS_UNPLUGGED_V5_DUAL_ROBOTIQ,
ATLAS_UNPLUGGED_V5_INVISIBLE_CONTACTABLE_PLANE_HANDS,</BUG>
ATLAS_UNPLUGGED_V5_ROBOTIQ_AND_SRI,
ATLAS_UNPLUGGED_V5_TROOPER;
private static String[] resourceDirectories;
| ATLAS_UNPLUGGED_V5_NO_FOREARMS,
ATLAS_UNPLUGGED_V5_INVISIBLE_CONTACTABLE_PLANE_HANDS,
|
4,357 | case ATLAS_UNPLUGGED_V5_DUAL_ROBOTIQ:
case ATLAS_UNPLUGGED_V5_TROOPER:
return DRCHandType.ROBOTIQ;
case ATLAS_UNPLUGGED_V5_ROBOTIQ_AND_SRI:
return DRCHandType.ROBOTIQ_AND_SRI;
<BUG>case ATLAS_UNPLUGGED_V5_NO_HANDS:
case ATLAS_UNPLUGGED_V5_INVISIBLE_CONTACTABLE_PLANE_HANDS:</BUG>
default:
return DRCHandType.NONE;
}
| case ATLAS_UNPLUGGED_V5_NO_FOREARMS:
case ATLAS_UNPLUGGED_V5_INVISIBLE_CONTACTABLE_PLANE_HANDS:
|
4,358 | }
}
public static final String chestName = "utorso";
public static final String pelvisName = "pelvis";
public static final String headName = "head";
<BUG>private final LegJointName[] legJoints = { HIP_YAW, HIP_ROLL, HIP_PITCH, KNEE_PITCH, ANKLE_PITCH, ANKLE_ROLL };
private final ArmJointName[] armJoints = { SHOULDER_YAW, SHOULDER_ROLL, ELBOW_PITCH, ELBOW_ROLL, FIRST_WRIST_PITCH, WRIST_ROLL, SECOND_WRIST_PITCH };
private final SpineJointName[] spineJoints = { SPINE_PITCH, SPINE_ROLL, SPINE_YAW };
private final NeckJointName[] neckJoints = { PROXIMAL_NECK_PITCH };
private final LinkedHashMap<String, JointRole> jointRoles = new LinkedHashMap<String, JointRole>();</BUG>
private final LinkedHashMap<String, ImmutablePair<RobotSide, LimbName>> limbNames = new LinkedHashMap<String, ImmutablePair<RobotSide, LimbName>>();
| private final LegJointName[] legJoints = {HIP_YAW, HIP_ROLL, HIP_PITCH, KNEE_PITCH, ANKLE_PITCH, ANKLE_ROLL};
private final ArmJointName[] armJoints;
private final SpineJointName[] spineJoints = {SPINE_PITCH, SPINE_ROLL, SPINE_YAW};
private final NeckJointName[] neckJoints = {PROXIMAL_NECK_PITCH};
private final LinkedHashMap<String, JointRole> jointRoles = new LinkedHashMap<String, JointRole>();
|
4,359 | jointNamesBeforeFeet[0] = getJointBeforeFootName(RobotSide.LEFT);
jointNamesBeforeFeet[1] = getJointBeforeFootName(RobotSide.RIGHT);
}
@Override
public SideDependentList<String> getNameOfJointBeforeHands()
<BUG>{
return nameOfJointsBeforeHands;
}</BUG>
@Override
public SideDependentList<String> getNameOfJointBeforeThighs()
| if (atlasVersion != AtlasRobotVersion.ATLAS_UNPLUGGED_V5_NO_FOREARMS)
return null;
|
4,360 | }
@Override
public List<ImmutablePair<String, Vector3D>> getJointNameGroundContactPointMap()
{
return contactPointParameters.getJointNameGroundContactPointMap();
<BUG>}
@Override public List<ImmutablePair<String, YoPDGains>> getPassiveJointNameWithGains(YoVariableRegistry registry)
{</BUG>
return null;
}
| jointNamesBeforeFeet[0] = getJointBeforeFootName(RobotSide.LEFT);
jointNamesBeforeFeet[1] = getJointBeforeFootName(RobotSide.RIGHT);
|
4,361 | {
return atlasPhysicalProperties;
}
public String[] getHighInertiaForStableSimulationJoints()
{
<BUG>return new String[] { "hokuyo_joint" };
}</BUG>
}
| return RobotSide.values;
@Override
public Enum<?> getEndEffectorsRobotSegment(String joineNameBeforeEndEffector)
|
4,362 | package com.lenis0012.bukkit.marriage2.internal.data;
import java.io.File;
<BUG>import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;</BUG>
import java.util.*;
| import java.sql.*;
|
4,363 | public void initiate() throws Exception {
Class.forName(className);
}
public void runSetup(Statement statement, String prefix) throws SQLException {
statement.executeUpdate(String.format("CREATE TABLE IF NOT EXISTS %splayers ("
<BUG>+ "unique_user_id VARCHAR(128) NOT NULL UNIQUE,"
+ "gender VARCHAR(32),"</BUG>
+ "priest BIT,"
+ "lastlogin BIGINT);", prefix));
switch(this) {
| + "last_name VARCHAR(16),"
+ "gender VARCHAR(32),"
|
4,364 | package com.lenis0012.bukkit.marriage2.listeners;
import com.lenis0012.bukkit.marriage2.MData;
import com.lenis0012.bukkit.marriage2.MPlayer;
import com.lenis0012.bukkit.marriage2.config.Settings;
import com.lenis0012.bukkit.marriage2.internal.MarriageCore;
<BUG>import com.lenis0012.bukkit.marriage2.misc.Cooldown;
import net.minecraft.server.v1_8_R3.EnumParticle;</BUG>
import net.minecraft.server.v1_8_R3.PacketPlayOutWorldParticles;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
| import com.lenis0012.bukkit.marriage2.misc.reflection.Packets;
import com.lenis0012.bukkit.marriage2.misc.reflection.Reflection;
import net.minecraft.server.v1_8_R3.EnumParticle;
|
4,365 | import static org.assertj.core.api.Assertions.assertThat;
import static org.mockserver.model.HttpRequest.request;
import static org.mockserver.model.HttpResponse.response;
import java.net.InetSocketAddress;
import java.net.Proxy;
<BUG>import javax.net.ssl.HttpsURLConnection;
import org.apache.xmlrpc.client.XmlRpcSun15HttpTransport;</BUG>
import org.apache.xmlrpc.client.XmlRpcSun15HttpTransportFactory;
import org.apache.xmlrpc.client.XmlRpcTransportFactory;
import org.assertj.core.api.SoftAssertions;
| import javax.net.ssl.SSLSocketFactory;
import org.apache.xmlrpc.client.XmlRpcSun15HttpTransport;
|
4,366 | System.clearProperty("https.proxyHost");
}
if (httpsProxyPort != null) {
System.setProperty("https.proxyPort", httpsProxyPort);
} else {
<BUG>System.clearProperty("https.proxyHost");
</BUG>
}
}
private void setHttpProperties(String httpProxyHost, String httpProxyPort) {
| System.clearProperty("https.proxyPort");
|
4,367 | public void should_use_https_proxy_for_https_when_available_http_proxy_otherwise() throws Exception {
saveAndClearProperties();
try {
SoftAssertions softAssertions = new SoftAssertions();
setHttpProperties(MOCK_HTTP_PROXY_HOST, MOCK_HTTP_PROXY_PORT);
<BUG>OdooXmlRpcProxy usingHttpProxy = new OdooXmlRpcProxy(RPCProtocol.RPC_HTTPS, host,
port, service);</BUG>
XmlRpcTransportFactory factory = usingHttpProxy.getTransportFactory();
if (factory != null && factory instanceof XmlRpcSun15HttpTransportFactory) {
| OdooXmlRpcProxy usingHttpProxy = new OdooXmlRpcProxy(RPCProtocol.RPC_HTTPS, host, port, service);
|
4,368 | user.getAuthorities().size(); // eagerly load the association
return user;
}
@Transactional(readOnly = true)
public User getUserWithAuthorities() {
<BUG>User user = userRepository.findOneByLogin(SecurityUtils.getCurrentUserLogin()).get();
user.getAuthorities().size(); // eagerly load the association
return user;</BUG>
}
| Optional<User> optionalUser = userRepository.findOneByLogin(SecurityUtils.getCurrentUserLogin());
User user = null;
if (optionalUser.isPresent()) {
user = optionalUser.get();
|
4,369 | import org.springframework.util.StopWatch;
import io.github.jhipster.sample.config.Constants;
import liquibase.exception.LiquibaseException;
import liquibase.integration.spring.SpringLiquibase;
public class AsyncSpringLiquibase extends SpringLiquibase {
<BUG>private final Logger log = LoggerFactory.getLogger(AsyncSpringLiquibase.class);
</BUG>
@Inject
@Qualifier("taskExecutor")
private TaskExecutor taskExecutor;
| private final Logger logger = LoggerFactory.getLogger(AsyncSpringLiquibase.class);
|
4,370 | package org.jboss.as.patching;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.patching.runner.PatchingException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
<BUG>import org.jboss.logging.annotations.MessageBundle;
import java.io.IOException;</BUG>
import java.util.List;
@MessageBundle(projectCode = "JBAS")
public interface PatchMessages {
| import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
4,371 | package org.voltdb.regressionsuites;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
<BUG>import java.security.SecureRandom;
import junit.framework.TestCase;</BUG>
import org.voltdb.BackendTarget;
import org.voltdb.compiler.VoltProjectBuilder;
public class TestHttpPort extends TestCase {
| import static junit.framework.Assert.assertTrue;
import junit.framework.TestCase;
|
4,372 | PipeToFile pf;
int rport;
public TestHttpPort(String name) {
super(name);
}
<BUG>static VoltProjectBuilder getBuilderForTest() throws IOException {
VoltProjectBuilder builder = new VoltProjectBuilder();
builder.addLiteralSchema("");
return builder;
}</BUG>
@Override
| [DELETED] |
4,373 | package org.voltdb.regressionsuites;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
<BUG>import java.security.SecureRandom;
import junit.framework.TestCase;</BUG>
import org.voltdb.BackendTarget;
import org.voltdb.compiler.VoltProjectBuilder;
public class TestZooKeeperPort extends TestCase {
| import static junit.framework.Assert.assertTrue;
import junit.framework.TestCase;
|
4,374 | PipeToFile pf;
int rport;
public TestZooKeeperPort(String name) {
super(name);
}
<BUG>static VoltProjectBuilder getBuilderForTest() throws IOException {
VoltProjectBuilder builder = new VoltProjectBuilder();
builder.addLiteralSchema("");
return builder;
}</BUG>
@Override
| [DELETED] |
4,375 | public void setUp() throws Exception {
rport = SecureRandom.getInstance("SHA1PRNG").nextInt(2000) + 22000;
System.out.println("Random ZooKeeper port is: " + rport);
ncprocess = new NCProcess(rport, true);
try {
<BUG>VoltProjectBuilder project = getBuilderForTest();
boolean success;
LocalCluster config = new LocalCluster("decimal-default.jar", 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
</BUG>
config.portGenerator.enablePortProvider();
| VoltProjectBuilder builder = new VoltProjectBuilder();
builder.addLiteralSchema("");
String catalogJar = "dummy.jar";
LocalCluster config = new LocalCluster(catalogJar, 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
|
4,376 | package org.voltdb.regressionsuites;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
<BUG>import java.security.SecureRandom;
import junit.framework.TestCase;</BUG>
import org.voltdb.BackendTarget;
import org.voltdb.compiler.VoltProjectBuilder;
public class TestClientPort extends TestCase {
| import static junit.framework.Assert.assertTrue;
import junit.framework.TestCase;
|
4,377 | PipeToFile pf;
int rport;
public TestClientPort(String name) {
super(name);
}
<BUG>static VoltProjectBuilder getBuilderForTest() throws IOException {
VoltProjectBuilder builder = new VoltProjectBuilder();
builder.addLiteralSchema("");
return builder;
}</BUG>
@Override
| [DELETED] |
4,378 | public void setUp() throws Exception {
rport = SecureRandom.getInstance("SHA1PRNG").nextInt(2000) + 22000;
System.out.println("Random Client port is: " + rport);
ncprocess = new NCProcess(rport);
try {
<BUG>VoltProjectBuilder project = getBuilderForTest();
boolean success;
LocalCluster config = new LocalCluster("decimal-default.jar", 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
</BUG>
config.portGenerator.enablePortProvider();
| VoltProjectBuilder builder = new VoltProjectBuilder();
builder.addLiteralSchema("");
String catalogJar = "dummy.jar";
LocalCluster config = new LocalCluster(catalogJar, 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
|
4,379 | package org.voltdb.regressionsuites;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
<BUG>import java.security.SecureRandom;
import junit.framework.TestCase;</BUG>
import org.voltdb.BackendTarget;
import org.voltdb.compiler.VoltProjectBuilder;
public class TestAdminPort extends TestCase {
| import static junit.framework.Assert.fail;
import junit.framework.TestCase;
|
4,380 | PipeToFile pf;
int rport;
public TestAdminPort(String name) {
super(name);
}
<BUG>static VoltProjectBuilder getBuilderForTest() throws IOException {
VoltProjectBuilder builder = new VoltProjectBuilder();
builder.addLiteralSchema("");
return builder;
}</BUG>
@Override
| [DELETED] |
4,381 | public void setUp() throws Exception {
rport = SecureRandom.getInstance("SHA1PRNG").nextInt(2000) + 22000;
System.out.println("Random Admin port is: " + rport);
ncprocess = new NCProcess(rport);
try {
<BUG>VoltProjectBuilder project = getBuilderForTest();
boolean success;
LocalCluster config = new LocalCluster("decimal-default.jar", 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
</BUG>
config.portGenerator.enablePortProvider();
| VoltProjectBuilder builder = new VoltProjectBuilder();
builder.addLiteralSchema("");
String catalogJar = "dummy.jar";
LocalCluster config = new LocalCluster(catalogJar, 2, 1, 0, BackendTarget.NATIVE_EE_JNI);
|
4,382 | }});
}
@Override
protected void onResume() {
super.onResume();
<BUG>Camera.Size size = mCamera.getParameters().getPreviewSize();
visualize.initializeImages( size.width, size.height );</BUG>
}
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int pos, long id ) {
| [DELETED] |
4,383 | paintWideLine.setColor(Color.RED);
paintWideLine.setStrokeWidth(3);
textPaint.setColor(Color.BLUE);
textPaint.setTextSize(60);
}
<BUG>public void initializeImages( int width , int height ) {
graySrc = new ImageFloat32(width,height);</BUG>
grayDst = new ImageFloat32(width,height);
bitmapSrc = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
bitmapDst = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
| if( graySrc != null && graySrc.width == width && graySrc.height == height )
return;
graySrc = new ImageFloat32(width,height);
|
4,384 | public void setMatches( List<AssociatedPair> matches ) {
this.locationSrc.clear();
this.locationDst.clear();
for( int i = 0; i < matches.size(); i++ ) {
AssociatedPair p = matches.get(i);
<BUG>locationSrc.add( p.p1 );
locationDst.add( p.p2 );
</BUG>
}
| locationSrc.add( p.p1.copy() );
locationDst.add( p.p2.copy() );
|
4,385 | hasRight = true;
grayDst.setTo(image);
ConvertBitmap.grayToBitmap(image,bitmapDst,storage);
}
}
<BUG>public synchronized void render(Canvas canvas, double tranX , double tranY , double scale ) {
this.scale = scale;</BUG>
this.tranX = tranX;
this.tranY = tranY;
int startX = bitmapSrc.getWidth()+SEPARATION;
| public void render(Canvas canvas, double tranX , double tranY , double scale ) {
this.scale = scale;
|
4,386 | final Element projectSettings = linkedSettings != null ? linkedSettings.getChild(PROJECT_SETTINGS) : null;
if (projectSettings == null) {
return;
}
final Optional<String> projectPath = Optional.ofNullable(JDOMExternalizerUtil.readField(projectSettings, EXTERNAL_PROJECT_PATH));
<BUG>final Optional<File> pantsExecutable = projectPath.flatMap(path -> PantsUtil.findPantsExecutable(Optional.of(new File(path))));
if (!pantsExecutable.isPresent()) {</BUG>
return;
}
final boolean useIdeaProjectJdk = Boolean.valueOf(JDOMExternalizerUtil.readField(componentTag, ENFORCE_JDK, "false"));
| final Optional<File> pantsExecutable = projectPath.flatMap(path -> PantsUtil.findPantsExecutable(new File(path)));
if (!pantsExecutable.isPresent()) {
|
4,387 | import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.io.FileUtilRt;
<BUG>import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VfsUtil;</BUG>
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
| import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtil;
|
4,388 | pantsExecutable.orElseThrow(
() -> new PantsException("Couldn't find pants executable for: " + project.getProjectFilePath())).getPath()
);
}
public static GeneralCommandLine defaultCommandLine(@NotNull String projectPath) throws PantsException {
<BUG>final Optional<File> pantsExecutable = findPantsExecutable(Optional.of(new File(projectPath)));
return defaultCommandLine(pantsExecutable.orElseThrow(() -> new PantsException("Couldn't find pants executable for: " + projectPath)));</BUG>
}
@NotNull
public static GeneralCommandLine defaultCommandLine(@NotNull File pantsExecutable) {
| final Optional<File> pantsExecutable = findPantsExecutable(new File(projectPath));
return defaultCommandLine(pantsExecutable.orElseThrow(() -> new PantsException("Couldn't find pants executable for: " + projectPath)));
|
4,389 | import com.intellij.ide.util.treeView.AbstractTreeNode;
import com.intellij.ide.util.treeView.AbstractTreeUpdater;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.actionSystem.Presentation;
<BUG>import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.openapi.project.Project;</BUG>
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.JDOMExternalizerUtil;
import com.intellij.openapi.util.WriteExternalException;
| import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
|
4,390 | final Presentation presentation = e.getPresentation();
final ProjectView projectView = ProjectView.getInstance(myProject);
presentation.setEnabledAndVisible(projectView.getCurrentProjectViewPane() == ProjectFilesViewPane.this);
}
}
<BUG>private final class ShowOnlyLoadedFilesAction extends ToggleAction {
</BUG>
private ShowOnlyLoadedFilesAction() {
super(
PantsBundle.message("pants.action.show.only.loaded.files"),
| private final class ShowOnlyLoadedFilesAction extends ToggleAction implements DumbAware {
|
4,391 | startWatch(timers.get(METRIC_INDEXING));
}
public static void markIndexEnd() {
stopWatch(timers.get(METRIC_INDEXING));
}
<BUG>public static void report() {
Map<String, Long> report = getCurrentResult();</BUG>
System.out.println(report);
String reportFilePath = getReportFilePath();
if (reportFilePath == null) {
| if (!isMetricsEnabled()) {
return;
Map<String, Long> report = getCurrentResult();
|
4,392 | import com.intellij.openapi.externalSystem.service.notification.NotificationSource;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
<BUG>import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.twitter.intellij.pants.model.PantsOptions;</BUG>
import com.twitter.intellij.pants.settings.PantsSettings;
| import com.intellij.openapi.util.Pair;
import com.twitter.intellij.pants.PantsBundle;
import com.twitter.intellij.pants.model.PantsOptions;
|
4,393 | import com.twitter.intellij.pants.util.PantsUtil;
import icons.PantsIcons;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.scala.testingSupport.test.AbstractTestRunConfiguration;
<BUG>import javax.swing.Icon;
import java.util.Collections;
import java.util.HashSet;
import java.util.Optional;</BUG>
import java.util.Set;
| import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
|
4,394 | ExternalSystemBeforeRunTask beforeRunTask
) {
Project currentProject = configuration.getProject();
prepareIDE(currentProject);
Set<String> targetAddressesToCompile = PantsUtil.filterGenTargets(getTargetAddressesToCompile(configuration));
<BUG>return executeTask(currentProject, targetAddressesToCompile, false);
}
public boolean executeTask(Project project) {
</BUG>
return executeTask(project, getTargetAddressesToCompile(ModuleManager.getInstance(project).getModules()), false);
| Pair<Boolean, Optional<String>> result = executeTask(currentProject, targetAddressesToCompile, false);
return result.getFirst();
public Pair<Boolean, Optional<String>> executeTask(Project project) {
|
4,395 | try {
commandLine.addParameter(PantsUtil.getJvmDistributionPathParameter(PantsUtil.getJdkPathFromIntelliJCore()));
}
catch (Exception e) {
showPantsMakeTaskMessage(e.getMessage(), NotificationCategory.ERROR, currentProject);
<BUG>return false;
}</BUG>
}
commandLine.addParameters("export-classpath", "compile");
for (String targetAddress : targetAddressesToCompile) {
| return Pair.create(false, Optional.empty());
|
4,396 | Debug.checkNull("mysql_connection", this.mysql_connection);
return this.mysql_connection;
}
@Override
public String toString () {
<BUG>return "MySQLConnection[" + this.dataSource.getUrl() + " : " + this.dataSource.getURL() + "]";
}</BUG>
@Override
protected void finalize () throws Throwable {
super.finalize();
| return "MySQLConnection[" + this.mySQL.getUrl() + "]";
|
4,397 | package com.jfixby.cmns.adopted.gdx.log;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.Gdx;
import com.jfixby.cmns.api.collections.EditableCollection;
<BUG>import com.jfixby.cmns.api.collections.Map;
import com.jfixby.cmns.api.log.LoggerComponent;</BUG>
import com.jfixby.cmns.api.util.JUtils;
public class GdxLogger implements LoggerComponent {
public GdxLogger () {
| import com.jfixby.cmns.api.err.Err;
import com.jfixby.cmns.api.log.LoggerComponent;
|
4,398 | package com.jfixby.red.collections;
<BUG>import com.jfixby.cmns.api.java.IntValue;
import com.jfixby.cmns.api.math.FloatMath;</BUG>
public class RedHistogrammValue {
private RedHistogramm master;
public RedHistogrammValue (RedHistogramm redHistogramm) {
| import com.jfixby.cmns.api.java.Int;
import com.jfixby.cmns.api.math.FloatMath;
|
4,399 | public static final String PackageName = "app.version.package_name";
}
public static final String VERSION_FILE_NAME = "version.json";
private static final long serialVersionUID = 6662721574596241247L;
public String packageName;
<BUG>public int major = -1;
public int minor = -1;
public VERSION_STAGE stage = null;
public int build = -1;
</BUG>
public int versionCode = -1;
| public String major = "";
public String minor = "";
public String build = "";
|
4,400 | <BUG>package com.jfixby.cmns.db.mysql;
import com.jfixby.cmns.api.debug.Debug;</BUG>
import com.jfixby.cmns.api.log.L;
import com.jfixby.cmns.db.api.DBComponent;
import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
| import java.sql.Connection;
import java.sql.SQLException;
import com.jfixby.cmns.api.debug.Debug;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.