id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
3,801 |
restTemplate.postForLocation(DRIVE_FILES_URL + id + "/trash", null);
</BUG>
}
@Override
<BUG>public void untrash(String id) {
restTemplate.postForLocation(DRIVE_FILES_URL + id + "/untrash", null);
</BUG>
}
| return driveFileQuery()
.parentIs(parent)
.fromPage(pageToken)
.trashed(false)
.hidden(false)
.getPage();
|
3,802 |
restTemplate.postForLocation(DRIVE_FILES_URL + id + "/untrash", null);
</BUG>
}
@Override
<BUG>public void star(String id) {
patch(DRIVE_FILES_URL + id, new PatchBuilder().set("labels.starred", true).getMap());
</BUG>
}
| return driveFileQuery()
.parentIs(parent)
.fromPage(pageToken)
.trashed(false)
.hidden(false)
.getPage();
|
3,803 |
patch(DRIVE_FILES_URL + id, new PatchBuilder().set("labels.starred", true).getMap());
</BUG>
}
@Override
<BUG>public void unstar(String id) {
patch(DRIVE_FILES_URL + id, new PatchBuilder().set("labels.starred", false).getMap());
</BUG>
}
| return driveFileQuery()
.parentIs(parent)
.fromPage(pageToken)
.trashed(false)
.hidden(false)
.getPage();
|
3,804 |
patch(DRIVE_FILES_URL + id, new PatchBuilder().set("labels.starred", false).getMap());
</BUG>
}
@Override
<BUG>public void hide(String id) {
patch(DRIVE_FILES_URL + id, new PatchBuilder().set("labels.hidden", true).getMap());
</BUG>
}
| return driveFileQuery()
.parentIs(parent)
.fromPage(pageToken)
.trashed(false)
.hidden(false)
.getPage();
|
3,805 |
patch(DRIVE_FILES_URL + id, new PatchBuilder().set("labels.hidden", true).getMap());
</BUG>
}
@Override
<BUG>public void unhide(String id) {
patch(DRIVE_FILES_URL + id, new PatchBuilder().set("labels.hidden", false).getMap());
</BUG>
}
| return driveFileQuery()
.parentIs(parent)
.fromPage(pageToken)
.trashed(false)
.hidden(false)
.getPage();
|
3,806 | e.printStackTrace();
}
filePlayback=null;
}
@Override
<BUG>public void stop() { if ( filePlayback!=null ) filePlayback.stop(); }
void initFiles() throws FileNotFoundException {</BUG>
if ((dataDir.length() != 0) && !dataDir.endsWith("/")) { dataDir = dataDir + "/"; } // guard path if needed
String samples_str = dataDir + "samples";
String events_str = dataDir + "events";
| @Override public boolean isrunning(){ if ( filePlayback!=null ) return filePlayback.isrunning(); return false; }
void initFiles() throws FileNotFoundException {
|
3,807 | public class BufferMonitor extends Thread implements FieldtripBufferMonitor {
public static final String TAG = BufferMonitor.class.toString();
private final Context context;
private final SparseArray<BufferConnectionInfo> clients = new SparseArray<BufferConnectionInfo>();
private final BufferInfo info;
<BUG>private final BroadcastReceiver mMessageReceiver = new BroadcastReceiver() {
@Override
public void onReceive(final Context context, final Intent intent) {
if (intent.getIntExtra(C.MESSAGE_TYPE, -1) == C.UPDATE_REQUEST) {
Log.i(TAG, "Received update request.");
sendAllInfo();
}
}
};</BUG>
private boolean run = true;
| [DELETED] |
3,808 | public static final String CLIENT_INFO_TIME = "c_time";
public static final String CLIENT_INFO_WAITTIMEOUT = "c_waitTimeout";
public static final String CLIENT_INFO_CONNECTED = "c_connected";
public static final String CLIENT_INFO_CHANGED = "c_changed";
public static final String CLIENT_INFO_DIFF = "c_diff";
<BUG>public static final int UPDATE_REQUEST = 0;
</BUG>
public static final int UPDATE = 1;
public static final int REQUEST_PUT_HEADER = 2;
public static final int REQUEST_FLUSH_HEADER = 3;
| public static final int THREAD_INFO_TYPE = 0;
|
3,809 | package nl.dcc.buffer_bci.bufferclientsservice;
import android.os.Parcel;
import android.os.Parcelable;
<BUG>import nl.dcc.buffer_bci.bufferservicecontroller.C;
public class ThreadInfo implements Parcelable {</BUG>
public static final Creator<ThreadInfo> CREATOR = new Creator<ThreadInfo>() {
@Override
public ThreadInfo createFromParcel(final Parcel in) {
| import nl.dcc.buffer_bci.C;
public class ThreadInfo implements Parcelable {
|
3,810 | throw new SyntaxError( "No more tokens. Expecting " + this.terminals.get(expecting) );
}
if (current.getId() != expecting) {
Formatter formatter = new Formatter(new StringBuilder(), Locale.US);
StackTraceElement[] stack = Thread.currentThread().getStackTrace();
<BUG>formatter.format("Unexpected symbol when parsing %s. Expected %s, got %s.", stack[2].getMethodName(), this.terminals.get(expecting), current != null ? current.getTerminalStr() : "<end of stream>");
throw new SyntaxError(formatter.toString());</BUG>
}
Terminal next = advance();
if ( next != null && !this.terminals.isValid(next.getId()) ) {
| formatter.format("Unexpected symbol when parsing %s. Expected %s, got %s.", stack[2].getMethodName(), this.terminals.get(expecting), current != null ? current : "<end of stream>");
throw new SyntaxError(formatter.toString());
|
3,811 | regex.add( new TokenLexer(Pattern.compile("^;"), WdlParser.TerminalId.TERMINAL_SEMI) );
regex.add( new TokenLexer(Pattern.compile("^\\{"), WdlParser.TerminalId.TERMINAL_LBRACE) );
regex.add( new TokenLexer(Pattern.compile("^="), WdlParser.TerminalId.TERMINAL_EQUALS) );</BUG>
regex.add( new TokenLexer(Pattern.compile("^\\("), WdlParser.TerminalId.TERMINAL_LPAREN) );
regex.add( new TokenLexer(Pattern.compile("^\\)"), WdlParser.TerminalId.TERMINAL_RPAREN) );
<BUG>regex.add( new TokenLexer(Pattern.compile("^\"([^\\\\\"\\n]|\\[\\\"'nrbtfav\\?]|\\[0-7]{1,3}|\\\\x[0-9a-fA-F]+|\\\\[uU]([0-9a-fA-F]{4})([0-9a-fA-F]{4})?)*\""), WdlParser.TerminalId.TERMINAL_STRING_LITERAL) );
regex.add( new TokenLexer(Pattern.compile("^([a-zA-Z_]|\\\\[uU]([0-9a-fA-F]{4})([0-9a-fA-F]{4})?)([a-zA-Z_0-9]|\\\\[uU]([0-9a-fA-F]{4})([0-9a-fA-F]{4})?)*"), WdlParser.TerminalId.TERMINAL_IDENTIFIER) );
regex.add( new TokenLexer(Pattern.compile("^\\s+"), null) );</BUG>
if ( args.length < 1 ) {
System.err.println("Usage: Lexer <input file>");
| regex.add( new TokenLexer(Pattern.compile("^="), WdlParser.TerminalId.TERMINAL_ASSIGN) );
regex.add( new TokenLexer(Pattern.compile("^\\["), WdlParser.TerminalId.TERMINAL_LSQUARE) );
regex.add( new TokenLexer(Pattern.compile("^\\]"), WdlParser.TerminalId.TERMINAL_RSQUARE) );
regex.add( new TokenLexer(Pattern.compile("^\\}"), WdlParser.TerminalId.TERMINAL_RBRACE) );
regex.add( new TokenLexer(Pattern.compile("^\"([^\\\\\"\\n]|\\[\\\"'nrbtfav\\?]|\\[0-7]{1,3}|\\\\x[0-9a-fA-F]+|\\\\[uU]([0-9a-fA-F]{4})([0-9a-fA-F]{4})?)*\""), WdlParser.TerminalId.TERMINAL_STRING) );
regex.add( new TokenLexer(Pattern.compile("^[-]?(\\.[0-9]+|[0-9]+(\\.[0-9]*)?)"), WdlParser.TerminalId.TERMINAL_NUMBER) );
regex.add( new TokenLexer(Pattern.compile("^\\s+"), null) );
|
3,812 | for(FileEntry entry : this.fileChecker.outdatedList)
{
File f = new File(this.modPackDir, entry.getPath());
if(f.delete())
{
<BUG>System.out.println(String.format(LANG.getTranslation("file.removed.md5.success"), f.getPath(), entry.getMd5()));
}</BUG>
else
{
this.installFrame.dispose();
| Logger.info(String.format("%1$s was removed. Its md5 was : %2$s", f.getPath(), entry.getMd5()));
}
|
3,813 | if(f.getParentFile() != null && !f.getParentFile().isDirectory())
{
f.getParentFile().mkdirs();
}
this.changeCurrentDownloadText(entry.getPath());
<BUG>System.out.println(String.format(LANG.getTranslation("proc.downloadingfile"), entry.getUrl().toString(), f.getPath(), entry.getMd5()));
if(!DownloadUtils.downloadFile(entry.getUrl(), f, this.installFrame))</BUG>
{
this.installFrame.dispose();
JOptionPane.showMessageDialog(null, LANG.getTranslation("err.cannotdownload") + " : " + entry.getUrl().toString(), LANG.getTranslation("misc.error"), JOptionPane.ERROR_MESSAGE);
| Logger.info(String.format("Downloading file %1$s to %2$s (its md5 is %3$s)", entry.getUrl().toString(), f.getPath(), entry.getMd5()));
if(!DownloadUtils.downloadFile(entry.getUrl(), f, this.installFrame))
|
3,814 | import utybo.minkj.locale.MinkJ;
public class Localization
{
public static final MinkJ LANG = new MinkJ();
public static void init()
<BUG>{
try</BUG>
{
LANG.loadTranslationsFromFile(Locale.FRENCH, Localization.class.getResourceAsStream("/langs/FR.lang"));
LANG.loadTranslationsFromFile(Locale.ENGLISH, Localization.class.getResourceAsStream("/langs/EN.lang"));
| if(!Logger.DEBUG)
LANG.mute();
}
try
|
3,815 | import argo.jdom.JdomParser;
import argo.jdom.JsonRootNode;
import argo.saj.InvalidSyntaxException;
import fr.minecraftforgefrance.common.FileChecker;
import fr.minecraftforgefrance.common.IInstallRunner;
<BUG>import fr.minecraftforgefrance.common.Localization;
import fr.minecraftforgefrance.common.ProcessInstall;</BUG>
import fr.minecraftforgefrance.common.RemoteInfoReader;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
| import fr.minecraftforgefrance.common.Logger;
import fr.minecraftforgefrance.common.ProcessInstall;
|
3,816 | new Updater(args);
}
public Updater(String[] args)
{
long start = System.currentTimeMillis();
<BUG>System.out.println("Starting updater !");
final OptionParser parser = new OptionParser();</BUG>
parser.allowsUnrecognizedOptions();
final OptionSpec<File> gameDirOption = parser.accepts("gameDir", "The game directory").withRequiredArg().ofType(File.class);
final OptionSpec<String> modpackOption = parser.accepts("version", "The version used").withRequiredArg();
| Logger.info("Starting updater !");
final OptionParser parser = new OptionParser();
|
3,817 | {
runMinecraft(args);
}
FileChecker checker = new FileChecker(mcDir);
if(!shouldUpdate(jsonProfileData.getStringValue("forge"), checker))
<BUG>{
System.out.println(LANG.getTranslation("no.update.found"));
long end = System.currentTimeMillis();
System.out.println(String.format(LANG.getTranslation("update.checked.in"), (end - start)));</BUG>
runMinecraft(args);
| final private String[] arguments;
private boolean forgeUpdate;
public static void main(String[] args)
Localization.init();
new Updater(args);
|
3,818 | return true;
}
return !checker.missingList.isEmpty() || !checker.outdatedList.isEmpty();
}
public void runMinecraft(String[] args)
<BUG>{
Launch.main(args);</BUG>
}
@Override
public void onFinish()
| Logger.info("Lauching Minecraft ...");
Launch.main(args);
|
3,819 | System.out.println(" " + lineInfo[j]);
}
}
}
public boolean start() {
<BUG>AudioFormat fmt = new AudioFormat(44100.0f, 16, 2, true, false);
</BUG>
try {
lineIn = AudioSystem.getTargetDataLine(fmt);
lineIn.open(fmt);
| AudioFormat fmt = new AudioFormat(fSample, 16, 2, true, false);
|
3,820 | } else {
System.out.println("Usage: java AudioToBuffer hostname:port");
return;</BUG>
}
<BUG>a2b.listDevices();
System.out.println("Trying to open default AUDIO IN device...\n");
if (!a2b.start()) return;
System.out.println("Now streaming audio. Press q and <enter> to quit.\n");
while (true) {
a2b.tick();</BUG>
try {
| Thread.sleep((long)(blockSize*1000.0/fSample));
} catch (InterruptedException e){
System.out.println(e);
t = System.currentTimeMillis() - t0; // current time since start
if (t >= printTime) {
System.out.print(nBlk + " " + nSample + " 0 " + (t/1000) + " (blk,samp,event,sec)\r");
printTime = t + 5000; // 5s between prints
|
3,821 | import android.content.ServiceConnection;
import android.database.Cursor;
import android.os.Bundle;
import android.os.IBinder;
import android.text.Editable;
<BUG>import android.text.TextWatcher;
import android.view.View;</BUG>
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
| import android.view.MenuItem;
import android.view.View;
|
3,822 | private ContactCursorAdapter adapter;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getListView().addHeaderView(getHeaderView());
adapter = new ContactCursorAdapter(this, null, 0);
<BUG>setListAdapter(adapter);
getLoaderManager().initLoader(0, null, this);</BUG>
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
| getActionBar().setDisplayHomeAsUpEnabled(true);
getLoaderManager().initLoader(0, null, this);
|
3,823 | searchView.setOnQueryTextListener(this);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
<BUG>switch (item.getItemId()) {
case R.id.action_add:</BUG>
startActivity(new Intent(this, SearchUserActivity.class));
return true;
case R.id.action_search:
| case android.R.id.home:
finish();
case R.id.action_add:
|
3,824 | statusText = (TextView)findViewById(R.id.tv_status);
progressBar = (ProgressBar)findViewById(R.id.get_status_progress);
listView = (ListView)findViewById(R.id.status_list);
adapter = new StatusListAdapter(this, getStatusOptions());
listView.setAdapter(adapter);
<BUG>adapter.setSelection(1);
new GetStatusTask(getStatusListener, this).execute();</BUG>
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
| listView.setOnItemClickListener(this);
getActionBar().setDisplayHomeAsUpEnabled(true);
new GetStatusTask(getStatusListener, this).execute();
|
3,825 | soi.getSharedObject().sendMessage("userJoin", list);
}
}
public void left(String room, Integer participant){
log.debug("Participant $user leaving");
<BUG>SharedObjectInfo soi = voiceRooms.get(room);
</BUG>
if (soi != null) {
List<String> list = new ArrayList<String>();
list.add(participant.toString());
| RoomInfo soi = voiceRooms.get(room);
|
3,826 | soi.getSharedObject().sendMessage("userLeft", list);
}
}
public void muted(String room, Integer participant, Boolean muted){
log.debug("Participant $user mute $muted");
<BUG>SharedObjectInfo soi = voiceRooms.get(room);
</BUG>
if (soi != null) {
List<String> list = new ArrayList<String>();
list.add(participant.toString());
| RoomInfo soi = voiceRooms.get(room);
|
3,827 | soi.getSharedObject().sendMessage("userMute", list);
}
}
public void talking(String room, Integer participant, Boolean talking){
log.debug("Participant $user talk $talking");
<BUG>SharedObjectInfo soi = voiceRooms.get(room);
</BUG>
if (soi != null) {
List<String> list = new ArrayList<String>();
list.add(participant.toString());
| RoomInfo soi = voiceRooms.get(room);
|
3,828 | package org.bigbluebutton.webconference.voice.asterisk.konference;
<BUG>import org.bigbluebutton.webconference.voice.ConferenceListener;
</BUG>
import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceJoinEvent;
import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceLeaveEvent;
import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceMemberMuteEvent;
| import org.bigbluebutton.webconference.voice.ConferenceServerListener;
|
3,829 | import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceMemberMuteEvent;
import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceMemberUnmuteEvent;
import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceStateEvent;
import org.bigbluebutton.webconference.voice.asterisk.konference.events.KonferenceEvent;
public class KonferenceEventHandler {
<BUG>private ConferenceListener listener;
</BUG>
public void handleKonferenceEvent(KonferenceEvent event) {
if (event instanceof ConferenceJoinEvent) {
ConferenceJoinEvent cj = (ConferenceJoinEvent) event;
| private ConferenceServerListener listener;
|
3,830 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
<BUG>import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;</BUG>
public final class PatchUtils {
| import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
3,831 | package org.jboss.as.patching.runner;
<BUG>import org.jboss.as.boot.DirectoryStructure;
import org.jboss.as.patching.LocalPatchInfo;</BUG>
import org.jboss.as.patching.PatchInfo;
import org.jboss.as.patching.PatchLogger;
import org.jboss.as.patching.PatchMessages;
| import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp;
import org.jboss.as.patching.CommonAttributes;
import org.jboss.as.patching.LocalPatchInfo;
|
3,832 | private static final String PATH_DELIMITER = "/";
public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;
enum Element {
ADDED_BUNDLE("added-bundle"),
ADDED_MISC_CONTENT("added-misc-content"),
<BUG>ADDED_MODULE("added-module"),
BUNDLES("bundles"),</BUG>
CUMULATIVE("cumulative"),
DESCRIPTION("description"),
MISC_FILES("misc-files"),
| APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
3,833 | final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
<BUG>case APPLIES_TO_VERSION:
builder.addAppliesTo(value);
break;</BUG>
case RESULTING_VERSION:
if(type == Patch.PatchType.CUMULATIVE) {
| [DELETED] |
3,834 | final StringBuilder path = new StringBuilder();
for(final String p : item.getPath()) {
path.append(p).append(PATH_DELIMITER);
}
path.append(item.getName());
<BUG>writer.writeAttribute(Attribute.PATH.name, path.toString());
if(type != ModificationType.REMOVE) {</BUG>
writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash()));
}
if(type != ModificationType.ADD) {
| if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
3,835 | 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;
|
3,836 | package com.google.jstestdriver.idea.coverage;
import com.google.jstestdriver.idea.execution.JstdRunConfiguration;
<BUG>import com.google.jstestdriver.idea.execution.JstdRunConfigurationVerifier;
import com.intellij.coverage.CoverageExecutor;</BUG>
import com.intellij.coverage.CoverageHelper;
import com.intellij.coverage.CoverageRunnerData;
| import com.google.jstestdriver.idea.execution.JstdRunProfileState;
import com.google.jstestdriver.idea.execution.NopProcessHandler;
import com.google.jstestdriver.idea.server.JstdBrowserInfo;
import com.google.jstestdriver.idea.server.JstdServer;
import com.google.jstestdriver.idea.server.JstdServerLifeCycleAdapter;
import com.google.jstestdriver.idea.server.JstdServerRegistry;
import com.google.jstestdriver.idea.server.ui.JstdToolWindowManager;
import com.google.jstestdriver.idea.util.JstdUtil;
import com.intellij.coverage.CoverageExecutor;
|
3,837 | package com.google.jstestdriver.idea.execution;
import com.google.jstestdriver.idea.assertFramework.JstdTestMethodNameRefiner;
import com.google.jstestdriver.idea.execution.settings.JstdRunSettings;
import com.google.jstestdriver.idea.execution.settings.ServerType;
import com.google.jstestdriver.idea.execution.settings.TestType;
<BUG>import com.google.jstestdriver.idea.server.JstdBrowserInfo;
import com.google.jstestdriver.idea.server.JstdServer;
import com.google.jstestdriver.idea.server.JstdServerRegistry;
import com.google.jstestdriver.idea.server.ui.JstdToolWindowManager;
import com.intellij.execution.ExecutionException;</BUG>
import com.intellij.execution.configurations.RuntimeConfigurationError;
| [DELETED] |
3,838 | import com.intellij.execution.configurations.RuntimeConfigurationException;
import com.intellij.execution.configurations.RuntimeConfigurationWarning;
import com.intellij.javascript.testFramework.TestFileStructureManager;
import com.intellij.javascript.testFramework.TestFileStructurePack;
import com.intellij.lang.javascript.psi.JSFile;
<BUG>import com.intellij.notification.Notification;
import com.intellij.notification.NotificationListener;</BUG>
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
| [DELETED] |
3,839 | float r = (float)(f * theta);
return project(r, place);</BUG>
}
public Point2 equisolidAngle(Vector3 v)
{
<BUG>Vector3 place = cameraRotationMatrix.multiply(Vector3.sub(v, position));
Vector3 d = Vector3.sub(place, opticalAxis);
double theta = (float)Math.atan2(d.length(), opticalAxis.z);
float r = 2f * (float)(f * Math.sin(theta / 2.0));
return project(r, place);</BUG>
}
| if (exp != 1.0) { r = (float)Math.pow(r, exp); }
return project(r, place);
double theta = computeLinCorrectedTheta(v, place);
if (exp != 1.0) { r = (float)Math.pow(r, exp); }
return project(r, place);
|
3,840 | float r = 2f * (float)(f * Math.sin(theta / 2.0));
return project(r, place);</BUG>
}
public Point2 orthographic(Vector3 v)
{
<BUG>Vector3 place = cameraRotationMatrix.multiply(Vector3.sub(v, position));
Vector3 d = Vector3.sub(place, opticalAxis);
double theta = (float)Math.atan2(d.length(), opticalAxis.z);
float r = 2f * (float)(f * Math.sin(theta));
return project(r, place);</BUG>
}
| if (exp != 1.0) { r = (float)Math.pow(r, exp); }
return project(r, place);
double theta = computeLinCorrectedTheta(v, place);
if (exp != 1.0) { r = (float)Math.pow(r, exp); }
return project(r, place);
|
3,841 | import gov.loc.repository.bagger.Contact;
import org.springframework.core.closure.Constraint;
import org.springframework.rules.Rules;
import org.springframework.rules.support.DefaultRulesSource;
public class BaggerValidationRulesSource extends DefaultRulesSource {
<BUG>boolean isCopyright = false;
boolean isNdnp = false;
boolean isWdl = false;</BUG>
boolean isLcProject = false;
boolean isHoley = false;
| [DELETED] |
3,842 | boolean isLcProject = false;
boolean isHoley = false;
public BaggerValidationRulesSource() {
super();
}
<BUG>public void init(boolean isCopyright, boolean isNdnp, boolean isWdl, boolean isLcProject, boolean isHoley) {
clear();
this.isCopyright = isCopyright;
this.isNdnp = isNdnp;
this.isWdl = isWdl;</BUG>
this.isLcProject = isLcProject;
| public void init(boolean isLcProject, boolean isHoley) {
|
3,843 | add("bagName", required());
add("externalDescription", required());
add("baggingDate", getDateConstraint());
add("externalIdentifier", required());
add("bagSize", required());
<BUG>if (isCopyright) {
add("publisher", required());
}
if (isNdnp) {
add("awardeePhase", required());
}</BUG>
if (isLcProject) {
| [DELETED] |
3,844 | profileForm.getControl().setToolTipText("Profile Form");
addTab(bagView.getPropertyMessage("infoInputPane.tab.profile"), profileForm.getControl());
}
public String verifyForms(DefaultBag bag) {
String messages = "";
<BUG>Project project = bagView.getBag().getProject();
</BUG>
if (!profileForm.hasErrors()) {
profileForm.commit();
}
| Profile project = bagView.getBag().getProfile();
|
3,845 | if (!profileForm.hasErrors()) {
profileForm.commit();
}
BaggerProfile bprofile = (BaggerProfile) profileForm.getFormObject();
BaggerOrganization baggerOrg = bprofile.getOrganization();
<BUG>Person userPerson = bprofile.getToContact().getPerson();
userPerson.parse(bprofile.getToContact().getContactName());
bprofile.getToContact().setPerson(userPerson);</BUG>
Contact orgContact = bprofile.getSourceContact();
| Contact userPerson = bprofile.getToContact();
|
3,846 | field.setComponentType(BagInfoField.TEXTFIELD_COMPONENT);
} else if (projectProfile.getFieldType().equalsIgnoreCase(BagInfoField.TEXTAREA_CODE)) {
field.setComponentType(BagInfoField.TEXTAREA_COMPONENT);
} else if (projectProfile.getFieldType().equalsIgnoreCase(BagInfoField.LIST_CODE)) {
field.setComponentType(BagInfoField.LIST_COMPONENT);
<BUG>}
currentMap.put(field.getLabel(), field);</BUG>
}
}
}
| field.isEnabled(false);
field.isEditable(false);
field.isRequiredvalue(true);
field.isRequired(true);
field.setValue(profile.getName());
currentMap.put(field.getLabel(), field);
|
3,847 | );
glfwMakeContextCurrent(window);
GL.createCapabilities();
glfwSwapInterval(1);
glfwSetKeyCallback(window, keyCallback);
<BUG>IntBuffer width = BufferUtils.createIntBuffer(1);
IntBuffer height = BufferUtils.createIntBuffer(1);
while (!glfwWindowShouldClose(window)) {</BUG>
float ratio;
glfwGetFramebufferSize(window, width, height);
| IntBuffer width = MemoryUtil.memAllocInt(1);
IntBuffer height = MemoryUtil.memAllocInt(1);
while (!glfwWindowShouldClose(window)) {
|
3,848 | glEnd();
glfwSwapBuffers(window);
glfwPollEvents();
width.flip();
height.flip();
<BUG>}
glfwDestroyWindow(window);</BUG>
keyCallback.free();
glfwTerminate();
errorCallback.free();
| MemoryUtil.memFree(width);
MemoryUtil.memFree(height);
glfwDestroyWindow(window);
|
3,849 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
3,850 | }
@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);
|
3,851 | 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);
|
3,852 | 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(
|
3,853 | 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 {
|
3,854 | 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;
|
3,855 | 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) {
|
3,856 | 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;
|
3,857 | import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.support.ByteArrayMultipartFileEditor;
import org.springframework.web.multipart.support.StringMultipartFileEditor;
import org.springframework.web.servlet.support.RequestContextUtils;
@SuppressWarnings("rawtypes")
<BUG>public class GrailsDataBinder extends ServletRequestDataBinder {
private static final Log LOG = LogFactory.getLog(GrailsDataBinder.class);</BUG>
private static final String JSON_DATE_FORMAT = "yyyy-MM-dd'T'hh:mm:ss'Z'";
protected BeanWrapper bean;
public static final String[] GROOVY_DISALLOWED = new String[] { "metaClass", "properties" };
| private static final String BIND_EVENT_LISTENERS = "org.codehaus.groovy.grails.BIND_EVENT_LISTENERS";
private static final String PROPERTY_EDITOR_REGISTRARS = "org.codehaus.groovy.grails.PROPERTY_EDITOR_REGISTRARS";
private static final Log LOG = LogFactory.getLog(GrailsDataBinder.class);
|
3,858 | }
private void bindWithRequestAndPropertyValues(ServletRequest request, MutablePropertyValues mpvs) {
GrailsWebRequest webRequest = GrailsWebRequest.lookup((HttpServletRequest) request);
if (webRequest != null) {
final ApplicationContext applicationContext = webRequest.getApplicationContext();
<BUG>if (applicationContext != null) {
final Map<String, BindEventListener> bindEventListenerMap = applicationContext.getBeansOfType(BindEventListener.class);
for (BindEventListener bindEventListener : bindEventListenerMap.values()) {</BUG>
bindEventListener.doBind(getTarget(), mpvs, getTypeConverter());
}
| setDisallowedFields(GROOVY_DISALLOWED);
setAllowedFields(ALL_OTHER_FIELDS_ALLOWED_BY_DEFAULT);
setIgnoreInvalidFields(true);
|
3,859 | 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;
|
3,860 | 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();
|
3,861 | 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: " +
|
3,862 | 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;
|
3,863 | 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]);
|
3,864 | 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;
|
3,865 | FilenameFilter filenameFilter = new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.toLowerCase().endsWith(fileExtension);
}
};
<BUG>File[] listFiles = configDir.listFiles( filenameFilter );
if ( listFiles == null )
{</BUG>
listFiles = new File[0];
| [DELETED] |
3,866 | 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;
|
3,867 | 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();
|
3,868 | 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: " +
|
3,869 | 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;
|
3,870 | 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]);
|
3,871 | 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;
|
3,872 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
3,873 | }
@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);
|
3,874 | 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);
|
3,875 | 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(
|
3,876 | 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 {
|
3,877 | 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;
|
3,878 | 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) {
|
3,879 | 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;
|
3,880 | package org.jnosql.diana.api.document;
import org.jnosql.diana.api.CloseResource;
import org.jnosql.diana.api.ExecuteAsyncQueryException;
import org.jnosql.diana.api.TTL;
import java.util.List;
<BUG>import java.util.function.Consumer;
import java.util.stream.StreamSupport;</BUG>
public interface DocumentCollectionManager extends CloseResource {
DocumentCollectionEntity save(DocumentCollectionEntity entity) throws NullPointerException;
void saveAsync(DocumentCollectionEntity entity) throws ExecuteAsyncQueryException, UnsupportedOperationException;
| import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
|
3,881 | public interface DocumentCollectionManager extends CloseResource {
DocumentCollectionEntity save(DocumentCollectionEntity entity) throws NullPointerException;
void saveAsync(DocumentCollectionEntity entity) throws ExecuteAsyncQueryException, UnsupportedOperationException;
DocumentCollectionEntity save(DocumentCollectionEntity entity, TTL ttl);
void saveAsync(DocumentCollectionEntity entity, TTL ttl) throws ExecuteAsyncQueryException, UnsupportedOperationException;
<BUG>default void save(Iterable<DocumentCollectionEntity> entities) throws NullPointerException {
StreamSupport.stream(entities.spliterator(), false).forEach(this::save);
</BUG>
}
| default Iterable<DocumentCollectionEntity> save(Iterable<DocumentCollectionEntity> entities) throws NullPointerException {
return StreamSupport.stream(entities.spliterator(), false).map(this::save).collect(Collectors.toList());
|
3,882 | </BUG>
}
default void saveAsync(Iterable<DocumentCollectionEntity> entities) throws ExecuteAsyncQueryException, UnsupportedOperationException {
StreamSupport.stream(entities.spliterator(), false).forEach(this::saveAsync);
}
<BUG>default void save(Iterable<DocumentCollectionEntity> entities, TTL ttl) throws NullPointerException {
StreamSupport.stream(entities.spliterator(), false).forEach(d -> save(d, ttl));
</BUG>
}
| public interface DocumentCollectionManager extends CloseResource {
DocumentCollectionEntity save(DocumentCollectionEntity entity) throws NullPointerException;
void saveAsync(DocumentCollectionEntity entity) throws ExecuteAsyncQueryException, UnsupportedOperationException;
DocumentCollectionEntity save(DocumentCollectionEntity entity, TTL ttl);
void saveAsync(DocumentCollectionEntity entity, TTL ttl) throws ExecuteAsyncQueryException, UnsupportedOperationException;
default Iterable<DocumentCollectionEntity> save(Iterable<DocumentCollectionEntity> entities) throws NullPointerException {
return StreamSupport.stream(entities.spliterator(), false).map(this::save).collect(Collectors.toList());
default Iterable<DocumentCollectionEntity> save(Iterable<DocumentCollectionEntity> entities, TTL ttl) throws NullPointerException {
return StreamSupport.stream(entities.spliterator(), false).map(d -> save(d, ttl)).collect(Collectors.toList());
|
3,883 | import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
<BUG>import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.languagetool.tools.StringTools;</BUG>
public class RuleMatch implements Comparable<RuleMatch> {
private static final Pattern SUGGESTION_PATTERN = Pattern.compile("<suggestion>(.*?)</suggestion>");
| [DELETED] |
3,884 | }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
<BUG>TaggedWord that = (TaggedWord) o;
if (lemma != null ? !lemma.equals(that.lemma) : that.lemma != null) return false;
if (posTag != null ? !posTag.equals(that.posTag) : that.posTag != null) return false;
return true;</BUG>
}
| public String getLemma() {
return lemma;
public String getPosTag() {
return posTag;
|
3,885 | if (lemma != null ? !lemma.equals(that.lemma) : that.lemma != null) return false;
if (posTag != null ? !posTag.equals(that.posTag) : that.posTag != null) return false;
return true;</BUG>
}
@Override
<BUG>public int hashCode() {
int result = lemma != null ? lemma.hashCode() : 0;
result = 31 * result + (posTag != null ? posTag.hashCode() : 0);
return result;</BUG>
}
| public String getLemma() {
return lemma;
public String getPosTag() {
return posTag;
public String toString() {
return lemma + "/" + posTag;
|
3,886 | @Override
public int hashCode() {
return Objects.hash(feature, type);
}
@Override
<BUG>public boolean equals(final Object obj) {
if (this == obj) { return true; }
if (obj == null) { return false; }
if (getClass() != obj.getClass()) {
return false;</BUG>
}
| [DELETED] |
3,887 |
return false;
return true;</BUG>
}
@Override
<BUG>public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + Arrays.hashCode(nonBlankTokens);
result = prime * result + Arrays.hashCode(tokens);
result = prime * result + Arrays.hashCode(whPositions);
return result;</BUG>
}
| public Set<String> getLemmaSet() {
return lemmaSet;
@SuppressWarnings("ControlFlowStatementWithoutBraces")
public boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
if (getClass() != o.getClass()) return false;
AnalyzedSentence other = (AnalyzedSentence) o;
return Arrays.equals(nonBlankTokens, other.nonBlankTokens)
&& Arrays.equals(tokens, other.tokens)
&& Arrays.equals(whPositions, other.whPositions);
|
3,888 | package org.languagetool;
import java.util.Objects;
<BUG>import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.jetbrains.annotations.Nullable;</BUG>
public final class AnalyzedToken {
private final String token;
| import org.jetbrains.annotations.Nullable;
|
3,889 | }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
<BUG>ConfusionString that = (ConfusionString) o;
if (!str.equals(that.str)) return false;
if (description != null ? !description.equals(that.description) : that.description != null) return false;
return true;</BUG>
}
| public String getString() {
return str;
@Nullable
public String getDescription() {
return description;
|
3,890 | if (!str.equals(that.str)) return false;
if (description != null ? !description.equals(that.description) : that.description != null) return false;
return true;</BUG>
}
@Override
<BUG>public int hashCode() {
int result = str.hashCode();
result = 31 * result + (description != null ? description.hashCode() : 0);
return result;</BUG>
}
| public String getString() {
return str;
@Nullable
public String getDescription() {
return description;
public String toString() {
return str;
|
3,891 | }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
<BUG>MatchPosition position = (MatchPosition) o;
if (end != position.end) return false;
if (start != position.start) return false;
return true;</BUG>
}
| int getStart() {
return start;
int getEnd() {
return end;
|
3,892 | if (end != position.end) return false;
if (start != position.start) return false;
return true;</BUG>
}
@Override
<BUG>public int hashCode() {
int result = start;
result = 31 * result + end;
return result;</BUG>
}
| int getStart() {
return start;
int getEnd() {
return end;
public String toString() {
return start + "-" + end;
|
3,893 | import com.intellij.ide.IdeBundle;
import com.intellij.ide.highlighter.ProjectFileType;
import com.intellij.ide.highlighter.ModuleFileType;
import com.intellij.openapi.application.ApplicationInfo;
import com.intellij.openapi.application.ApplicationManager;
<BUG>import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.ui.Messages;</BUG>
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
| import com.intellij.openapi.project.ProjectUtil;
import com.intellij.openapi.ui.Messages;
|
3,894 | import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.NonNls;
import javax.swing.*;
import java.awt.*;
import java.io.File;
<BUG>import java.util.List;
public class ProjectNameStep extends ModuleWizardStep {</BUG>
private static final Icon NEW_PROJECT_ICON = IconLoader.getIcon("/newprojectwizard.png");
private final NamePathComponent myNamePathComponent;
private final JPanel myPanel;
| import static com.intellij.openapi.components.StorageScheme.DIRECTORY_BASED;
public class ProjectNameStep extends ModuleWizardStep {
|
3,895 | public JComponent getComponent() {
return myPanel;
}
public void updateStep() {
super.updateStep();
<BUG>myNamePathComponent.setPath(myWizardContext.getProjectFileDirectory());
</BUG>
String name = myWizardContext.getProjectName();
if (name == null) {
List<String> components = StringUtil.split(FileUtil.toSystemIndependentName(myWizardContext.getProjectFileDirectory()), "/");
| myNamePathComponent.setPath(FileUtil.toSystemDependentName(myWizardContext.getProjectFileDirectory()));
|
3,896 | public String getProjectFilePath() {
return getProjectFileDirectory() + "/" + myNamePathComponent.getNameValue()/*myTfProjectName.getText().trim()*/ +
(myWizardContext.getProject() == null ? ProjectFileType.DOT_DEFAULT_EXTENSION : ModuleFileType.DOT_DEFAULT_EXTENSION);
}
public String getProjectFileDirectory() {
<BUG>return myNamePathComponent.getPath();
}</BUG>
public String getProjectName() {
return myNamePathComponent.getNameValue();
}
| return FileUtil.toSystemIndependentName(myNamePathComponent.getPath());
|
3,897 | e.printStackTrace();
}
filePlayback=null;
}
@Override
<BUG>public void stop() { if ( filePlayback!=null ) filePlayback.stop(); }
void initFiles() throws FileNotFoundException {</BUG>
if ((dataDir.length() != 0) && !dataDir.endsWith("/")) { dataDir = dataDir + "/"; } // guard path if needed
String samples_str = dataDir + "samples";
String events_str = dataDir + "events";
| @Override public boolean isrunning(){ if ( filePlayback!=null ) return filePlayback.isrunning(); return false; }
void initFiles() throws FileNotFoundException {
|
3,898 | public class BufferMonitor extends Thread implements FieldtripBufferMonitor {
public static final String TAG = BufferMonitor.class.toString();
private final Context context;
private final SparseArray<BufferConnectionInfo> clients = new SparseArray<BufferConnectionInfo>();
private final BufferInfo info;
<BUG>private final BroadcastReceiver mMessageReceiver = new BroadcastReceiver() {
@Override
public void onReceive(final Context context, final Intent intent) {
if (intent.getIntExtra(C.MESSAGE_TYPE, -1) == C.UPDATE_REQUEST) {
Log.i(TAG, "Received update request.");
sendAllInfo();
}
}
};</BUG>
private boolean run = true;
| [DELETED] |
3,899 | public static final String CLIENT_INFO_TIME = "c_time";
public static final String CLIENT_INFO_WAITTIMEOUT = "c_waitTimeout";
public static final String CLIENT_INFO_CONNECTED = "c_connected";
public static final String CLIENT_INFO_CHANGED = "c_changed";
public static final String CLIENT_INFO_DIFF = "c_diff";
<BUG>public static final int UPDATE_REQUEST = 0;
</BUG>
public static final int UPDATE = 1;
public static final int REQUEST_PUT_HEADER = 2;
public static final int REQUEST_FLUSH_HEADER = 3;
| public static final int THREAD_INFO_TYPE = 0;
|
3,900 | package nl.dcc.buffer_bci.bufferclientsservice;
import android.os.Parcel;
import android.os.Parcelable;
<BUG>import nl.dcc.buffer_bci.bufferservicecontroller.C;
public class ThreadInfo implements Parcelable {</BUG>
public static final Creator<ThreadInfo> CREATOR = new Creator<ThreadInfo>() {
@Override
public ThreadInfo createFromParcel(final Parcel in) {
| import nl.dcc.buffer_bci.C;
public class ThreadInfo implements Parcelable {
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.