id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
10,701 | import java.sql.SQLException;
import java.sql.Statement;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
<BUG>import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;</BUG>
import java.util.concurrent.locks.Lock;
| import java.util.HashMap;
import java.util.Map;
import java.util.Set;
|
10,702 | if (msgin != null) {
try {
msgin.close();
} catch (IOException e) {
}
<BUG>}
}
}
protected void updateSourceSequence(SourceSequence seq)
</BUG>
throws SQLException {
| releaseResources(stmt, null);
protected void storeMessage(Identifier sid, RMMessage msg, boolean outbound)
throws IOException, SQLException {
storeMessage(connection, sid, msg, outbound);
protected void updateSourceSequence(Connection con, SourceSequence seq)
|
10,703 | } catch (SQLException ex) {
if (!isTableExistsError(ex)) {
throw ex;
} else {
LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists.");
<BUG>verifyTable(SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
</BUG>
}
} finally {
stmt.close();
| verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
|
10,704 | } catch (SQLException ex) {
if (!isTableExistsError(ex)) {
throw ex;
} else {
LOG.fine("Table CXF_RM_DEST_SEQUENCES already exists.");
<BUG>verifyTable(DEST_SEQUENCES_TABLE_NAME, DEST_SEQUENCES_TABLE_COLS);
</BUG>
}
} finally {
stmt.close();
| LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists.");
verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
|
10,705 | }
} finally {
stmt.close();
}
for (String tableName : new String[] {OUTBOUND_MSGS_TABLE_NAME, INBOUND_MSGS_TABLE_NAME}) {
<BUG>stmt = connection.createStatement();
try {</BUG>
stmt.executeUpdate(MessageFormat.format(CREATE_MESSAGES_TABLE_STMT, tableName));
} catch (SQLException ex) {
if (!isTableExistsError(ex)) {
| stmt = con.createStatement();
try {
stmt.executeUpdate(CREATE_DEST_SEQUENCES_TABLE_STMT);
|
10,706 | throw ex;
} else {
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Table " + tableName + " already exists.");
}
<BUG>verifyTable(tableName, MESSAGES_TABLE_COLS);
</BUG>
}
} finally {
stmt.close();
| LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists.");
verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
|
10,707 | if (newCols.size() > 0) {
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "Table " + tableName + " needs additional columns");
}
for (String[] newCol : newCols) {
<BUG>Statement st = connection.createStatement();
try {</BUG>
st.executeUpdate(MessageFormat.format(ALTER_TABLE_STMT_STR,
tableName, newCol[0], newCol[1]));
if (LOG.isLoggable(Level.FINE)) {
| Statement st = con.createStatement();
try {
|
10,708 | if (nextReconnectAttempt < System.currentTimeMillis()) {
nextReconnectAttempt = System.currentTimeMillis() + reconnectDelay;
reconnectDelay = reconnectDelay * useExponentialBackOff;
}
}
<BUG>}
public static void deleteDatabaseFiles() {</BUG>
deleteDatabaseFiles(DEFAULT_DATABASE_NAME, true);
}
public static void deleteDatabaseFiles(String dbName, boolean now) {
| public static void deleteDatabaseFiles() {
|
10,709 | 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;
|
10,710 | 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();
|
10,711 | 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: " +
|
10,712 | 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;
|
10,713 | 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]);
|
10,714 | 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;
|
10,715 | this.delayedReferences = new HashMap<String, List<String>>();
this.delayedBundles = new LinkedList<Bundle>();
importProviders = new LinkedHashMap<String, ImportProvider>();
importProviders.put(EXT_JCR_XML, null);
importProviders.put(EXT_JSON, JsonReader.PROVIDER);
<BUG>importProviders.put(EXT_XJSON, XJsonReader.PROVIDER);
importProviders.put(EXT_XML, XmlReader.PROVIDER);</BUG>
}
public void dispose() {
this.delayedReferences = null;
| importProviders.put(EXT_XJSON, JsonReader.PROVIDER);
importProviders.put(EXT_XML, XmlReader.PROVIDER);
|
10,716 | package org.apache.sling.jcr.resource.internal.loader;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
<BUG>import java.io.InputStream;
import java.util.Iterator;
</BUG>
import javax.jcr.PropertyType;
import org.apache.sling.commons.json.JSONArray;
| import java.util.HashSet;
import java.util.Set;
|
10,717 | value = null;
}
} else {
property.setValue(String.valueOf(value));
}
<BUG>property.setType((type != null) ? type : this.getType(value));
return property;</BUG>
}
protected String getType(Object object) {
if (object instanceof Double || object instanceof Float) {
| property.setType(getType(value));
return property;
|
10,718 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
10,719 | }
@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);
|
10,720 | 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);
|
10,721 | 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(
|
10,722 | 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 {
|
10,723 | 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;
|
10,724 | 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) {
|
10,725 | 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;
|
10,726 | JsonObject mc = new JsonObject();
mc.put("received", new JsonObject().put("$date", ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)));
mc.put("reqId", mcMessage.getID());
mc.put("sesId", mcMessage.getSetSesID().toString());
mc.put("rptId", mcMessage.getRptID());
<BUG>ZonedDateTime txnTmInFrankfurtZone = ZonedDateTime.ofInstant(mcMessage.getTxnTm().toGregorianCalendar().toInstant(), ZoneId.of("Europe/Paris"));
mc.put("txnTm", new JsonObject().put("$date", txnTmInFrankfurtZone.withZoneSameInstant(ZoneOffset.UTC).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)));
</BUG>
mc.put("bizDt", mcMessage.getBizDt().toGregorianCalendar().toZonedDateTime().format(DateTimeFormatter.ISO_LOCAL_DATE));
mc.put("clss", mcMessage.getClss());
| GregorianCalendar txnTmInFrankfurtZone = mcMessage.getTxnTm().toGregorianCalendar();
txnTmInFrankfurtZone.setTimeZone(TimeZone.getTimeZone("Europe/Paris"));
mc.put("txnTm", new JsonObject().put("$date", txnTmInFrankfurtZone.toZonedDateTime().withZoneSameInstant(ZoneOffset.UTC).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)));
|
10,727 | @For(View.AsynchPeople.class)
public class AsynchPeopleTest {
@Rule public JenkinsRule j = new JenkinsRule();
@Bug(18641)
@Test public void display() throws Exception {
<BUG>User.get("bob");
HtmlPage page = j.createWebClient().goTo("asynchPeople");
assertEquals("display: none;", page.getElementById("status").getAttribute("style"));</BUG>
assertNotNull(page.getElementById("person-bob"));
| JenkinsRule.WebClient wc = j.createWebClient();
HtmlPage page = wc.goTo("asynchPeople");
assertEquals(0, wc.waitForBackgroundJavaScript(120000));
assertEquals("display: none;", page.getElementById("status").getAttribute("style"));
|
10,728 | import java.net.URI;
import java.util.Calendar;
import java.util.Date;
import java.util.Formatter;
import java.util.List;
<BUG>import javax.ws.rs.core.UriBuilder;
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.util.URIUtil;</BUG>
import org.suigeneris.jrcs.rcs.Version;
import org.xwiki.rest.Relations;
| [DELETED] |
10,729 | if (home != null) {
space.setHome(home.getPrefixedFullName());
space.setXwikiRelativeUrl(home.getURL("view"));
space.setXwikiAbsoluteUrl(home.getExternalURL("view"));
}
<BUG>String pagesUri = UriBuilder.fromUri(baseUri).path(PagesResource.class).build(wikiName, spaceName).toString();
</BUG>
Link pagesLink = objectFactory.createLink();
pagesLink.setHref(pagesUri);
pagesLink.setRel(Relations.PAGES);
| String pagesUri = uri(baseUri, PagesResource.class, wikiName, spaceName);
|
10,730 | Link pagesLink = objectFactory.createLink();
pagesLink.setHref(pagesUri);
pagesLink.setRel(Relations.PAGES);
space.getLinks().add(pagesLink);
if (home != null) {
<BUG>String homeUri =
UriBuilder.fromUri(baseUri).path(PageResource.class).build(wikiName, spaceName, home.getName())
.toString();</BUG>
Link homeLink = objectFactory.createLink();
| String homeUri = uri(baseUri, PageResource.class, wikiName, spaceName, home.getName());
|
10,731 | .toString();</BUG>
Link homeLink = objectFactory.createLink();
homeLink.setHref(homeUri);
homeLink.setRel(Relations.HOME);
space.getLinks().add(homeLink);
<BUG>}
String searchUri =
UriBuilder.fromUri(baseUri).path(SpaceSearchResource.class).build(wikiName, spaceName).toString();</BUG>
Link searchLink = objectFactory.createLink();
searchLink.setHref(searchUri);
| Link pagesLink = objectFactory.createLink();
pagesLink.setHref(pagesUri);
pagesLink.setRel(Relations.PAGES);
space.getLinks().add(pagesLink);
if (home != null) {
String homeUri = uri(baseUri, PageResource.class, wikiName, spaceName, home.getName());
String searchUri = uri(baseUri, SpaceSearchResource.class, wikiName, spaceName);
|
10,732 | if (!languages.isEmpty()) {
if (!doc.getDefaultLanguage().equals("")) {
translations.setDefault(doc.getDefaultLanguage());
Translation translation = objectFactory.createTranslation();
translation.setLanguage(doc.getDefaultLanguage());
<BUG>String pageTranslationUri =
UriBuilder.fromUri(baseUri).path(PageResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName()).toString();</BUG>
Link pageTranslationLink = objectFactory.createLink();
pageTranslationLink.setHref(pageTranslationUri);
| uri(baseUri, PageResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
10,733 | }
}
for (String language : languages) {
Translation translation = objectFactory.createTranslation();
translation.setLanguage(language);
<BUG>String pageTranslationUri =
UriBuilder.fromUri(baseUri).path(PageTranslationResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), language).toString();</BUG>
Link pageTranslationLink = objectFactory.createLink();
pageTranslationLink.setHref(pageTranslationUri);
| uri(baseUri, PageTranslationResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), language);
|
10,734 | Link pageTranslationLink = objectFactory.createLink();
pageTranslationLink.setHref(pageTranslationUri);
pageTranslationLink.setRel(Relations.PAGE);
translation.getLinks().add(pageTranslationLink);
String historyUri =
<BUG>UriBuilder.fromUri(baseUri).path(PageTranslationHistoryResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), language).toString();
Link historyLink = objectFactory.createLink();</BUG>
historyLink.setHref(historyUri);
historyLink.setRel(Relations.HISTORY);
| uri(baseUri, PageTranslationHistoryResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
language);
Link historyLink = objectFactory.createLink();
|
10,735 | pageSummary.setParent(doc.getParent());
if (parent != null && !parent.isNew()) {
pageSummary.setParentId(parent.getPrefixedFullName());
} else {
pageSummary.setParentId("");
<BUG>}
String spaceUri =
UriBuilder.fromUri(baseUri).path(SpaceResource.class).build(doc.getWiki(), doc.getSpace()).toString();</BUG>
Link spaceLink = objectFactory.createLink();
spaceLink.setHref(spaceUri);
| String spaceUri = uri(baseUri, SpaceResource.class, doc.getWiki(), doc.getSpace());
|
10,736 | UriBuilder.fromUri(baseUri).path(SpaceResource.class).build(doc.getWiki(), doc.getSpace()).toString();</BUG>
Link spaceLink = objectFactory.createLink();
spaceLink.setHref(spaceUri);
spaceLink.setRel(Relations.SPACE);
pageSummary.getLinks().add(spaceLink);
<BUG>if (parent != null) {
String parentUri =
UriBuilder.fromUri(baseUri).path(PageResource.class)
.build(parent.getWiki(), parent.getSpace(), parent.getName()).toString();</BUG>
Link parentLink = objectFactory.createLink();
| pageSummary.setParent(doc.getParent());
if (parent != null && !parent.isNew()) {
pageSummary.setParentId(parent.getPrefixedFullName());
} else {
pageSummary.setParentId("");
}
String spaceUri = uri(baseUri, SpaceResource.class, doc.getWiki(), doc.getSpace());
String parentUri = uri(baseUri, PageResource.class, parent.getWiki(), parent.getSpace(), parent.getName());
|
10,737 | Link historyLink = objectFactory.createLink();
historyLink.setHref(historyUri);
historyLink.setRel(Relations.HISTORY);
pageSummary.getLinks().add(historyLink);
if (!doc.getChildren().isEmpty()) {
<BUG>String pageChildrenUri =
UriBuilder.fromUri(baseUri).path(PageChildrenResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName()).toString();</BUG>
Link pageChildrenLink = objectFactory.createLink();
pageChildrenLink.setHref(pageChildrenUri);
| uri(baseUri, PageChildrenResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
10,738 | objectsLink.setRel(Relations.OBJECTS);
pageSummary.getLinks().add(objectsLink);
}
com.xpn.xwiki.api.Object tagsObject = doc.getObject("XWiki.TagClass", 0);
if (tagsObject != null) {
<BUG>if (tagsObject.getProperty("tags") != null) {
String tagsUri =
UriBuilder.fromUri(baseUri).path(PageTagsResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName()).toString();</BUG>
Link tagsLink = objectFactory.createLink();
| String tagsUri = uri(baseUri, PageTagsResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
10,739 | tagsLink.setHref(tagsUri);
tagsLink.setRel(Relations.TAGS);
pageSummary.getLinks().add(tagsLink);
}
}
<BUG>String syntaxesUri = UriBuilder.fromUri(baseUri).path(SyntaxesResource.class).build().toString();
Link syntaxesLink = objectFactory.createLink();</BUG>
syntaxesLink.setHref(syntaxesUri);
syntaxesLink.setRel(Relations.SYNTAXES);
pageSummary.getLinks().add(syntaxesLink);
| String syntaxesUri = uri(baseUri, SyntaxesResource.class);
Link syntaxesLink = objectFactory.createLink();
|
10,740 | }
return historySummary;
}
private static void fillAttachment(Attachment attachment, ObjectFactory objectFactory, URI baseUri,
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,
XWiki xwikiApi, Boolean withPrettyNames)
{</BUG>
Document doc = xwikiAttachment.getDocument();
attachment.setId(String.format("%s@%s", doc.getPrefixedFullName(), xwikiAttachment.getFilename()));
| com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,
{
|
10,741 | Calendar calendar = Calendar.getInstance();
calendar.setTime(xwikiAttachment.getDate());
attachment.setDate(calendar);
attachment.setXwikiRelativeUrl(xwikiRelativeUrl);
attachment.setXwikiAbsoluteUrl(xwikiAbsoluteUrl);
<BUG>String pageUri =
UriBuilder.fromUri(baseUri).path(PageResource.class).build(doc.getWiki(), doc.getSpace(), doc.getName())
.toString();</BUG>
Link pageLink = objectFactory.createLink();
| String pageUri = uri(baseUri, PageResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
10,742 | }
return attachmentUri;
}</BUG>
public static Attachment createAttachment(ObjectFactory objectFactory, URI baseUri,
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,
XWiki xwikiApi, Boolean withPrettyNames)
{</BUG>
Attachment attachment = objectFactory.createAttachment();
fillAttachment(attachment, objectFactory, baseUri, xwikiAttachment, xwikiRelativeUrl, xwikiAbsoluteUrl,
| com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,
{
|
10,743 | attachmentLink.setRel(Relations.ATTACHMENT_DATA);
attachment.getLinks().add(attachmentLink);
return attachment;
}
public static Attachment createAttachmentAtVersion(ObjectFactory objectFactory, URI baseUri,
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,
XWiki xwikiApi, Boolean withPrettyNames)
{</BUG>
Attachment attachment = new Attachment();
| com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,
{
|
10,744 | .build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(),
xwikiObject.getClassName(),
xwikiObject.getNumber()).toString();</BUG>
} else {
<BUG>propertiesUri =
UriBuilder
.fromUri(baseUri)
.path(ObjectPropertiesResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(),
xwikiObject.getNumber()).toString();</BUG>
}
| fillObjectSummary(objectSummary, objectFactory, baseUri, doc, xwikiObject, xwikiApi, withPrettyNames);
Link objectLink = getObjectLink(objectFactory, baseUri, doc, xwikiObject, useVersion, Relations.OBJECT);
objectSummary.getLinks().add(objectLink);
String propertiesUri;
if (useVersion) {
uri(baseUri, ObjectPropertiesAtPageVersionResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber());
uri(baseUri, ObjectPropertiesResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
xwikiObject.getClassName(), xwikiObject.getNumber());
|
10,745 | .build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(),
xwikiObject.getClassName(), xwikiObject.getNumber(), propertyClass.getName())
.toString();</BUG>
} else {
<BUG>propertyUri =
UriBuilder
.fromUri(baseUri)
.path(ObjectPropertyResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(),
xwikiObject.getNumber(), propertyClass.getName()).toString();</BUG>
}
| propertiesUri =
uri(baseUri, ObjectPropertiesResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
xwikiObject.getClassName(), xwikiObject.getNumber());
|
10,746 | .build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(),
xwikiObject.getClassName(),
xwikiObject.getNumber()).toString();</BUG>
} else {
<BUG>objectUri =
UriBuilder
.fromUri(baseUri)
.path(ObjectResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(),
xwikiObject.getNumber()).toString();</BUG>
}
| private static Link getObjectLink(ObjectFactory objectFactory, URI baseUri, Document doc, BaseObject xwikiObject,
boolean useVersion, String relation)
String objectUri;
if (useVersion) {
uri(baseUri, ObjectAtPageVersionResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber());
uri(baseUri, ObjectResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
xwikiObject.getClassName(), xwikiObject.getNumber());
|
10,747 | Link propertyLink = objectFactory.createLink();
propertyLink.setHref(propertyUri);
propertyLink.setRel(Relations.SELF);
property.getLinks().add(propertyLink);
clazz.getProperties().add(property);
<BUG>}
String classUri =
UriBuilder.fromUri(baseUri).path(ClassResource.class).build(wikiName, xwikiClass.getName()).toString();</BUG>
Link classLink = objectFactory.createLink();
classLink.setHref(classUri);
| String classUri = uri(baseUri, ClassResource.class, wikiName, xwikiClass.getName());
|
10,748 | String classUri =
UriBuilder.fromUri(baseUri).path(ClassResource.class).build(wikiName, xwikiClass.getName()).toString();</BUG>
Link classLink = objectFactory.createLink();
classLink.setHref(classUri);
classLink.setRel(Relations.SELF);
<BUG>clazz.getLinks().add(classLink);
String propertiesUri =
UriBuilder.fromUri(baseUri).path(ClassPropertiesResource.class).build(wikiName, xwikiClass.getName())
.toString();</BUG>
Link propertyLink = objectFactory.createLink();
| propertyLink.setHref(propertyUri);
propertyLink.setRel(Relations.SELF);
property.getLinks().add(propertyLink);
clazz.getProperties().add(property);
}
String classUri = uri(baseUri, ClassResource.class, wikiName, xwikiClass.getName());
String propertiesUri = uri(baseUri, ClassPropertiesResource.class, wikiName, xwikiClass.getName());
|
10,749 | <BUG>package org.xwiki.rest.internal;
import org.apache.commons.lang3.StringUtils;</BUG>
import org.xwiki.component.manager.ComponentManager;
import org.xwiki.context.Execution;
import org.xwiki.model.reference.EntityReferenceSerializer;
| import java.net.URI;
import javax.ws.rs.core.UriBuilder;
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.util.URIUtil;
import org.apache.commons.lang3.StringUtils;
|
10,750 | customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString());
customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName);
customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString());
customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName);
customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString());
<BUG>customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName);
}</BUG>
public void init() {
try {
LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
| customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName);
customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName);
}
|
10,751 | Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.tab_qibla, container, false);
final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass);
qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north),
((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla));
<BUG>sOrientationListener = new SensorListener() {
</BUG>
public void onSensorChanged(int s, float v[]) {
float northDirection = v[SensorManager.DATA_X];
qiblaCompassView.setDirections(northDirection, sQiblaDirection);
| sOrientationListener = new android.hardware.SensorListener() {
|
10,752 | public String apply(@Nonnull ComponentDto input) {
return input.key();
}
});
ValidateProjectsVisitor visitor = new ValidateProjectsVisitor(session, dbClient.componentDao(), settings.getBoolean(CoreProperties.CORE_PREVENT_AUTOMATIC_PROJECT_CREATION), modulesByKey);
<BUG>visitor.visit(context.getRoot());
</BUG>
if (!visitor.validationMessages.isEmpty()) {
throw new IllegalArgumentException("Validation of project failed:\n o " + MESSAGES_JOINER.join(visitor.validationMessages));
}
| visitor.visit(treeRootHolder.getRoot());
|
10,753 | import java.util.Arrays;
import java.util.List;
import org.sonar.server.computation.container.ComputeEngineContainer;
public class ComputationSteps {
public List<Class<? extends ComputationStep>> orderedStepClasses() {
<BUG>return Arrays.asList(
BuildComponentTreeStep.class,</BUG>
PopulateComponentsUuidAndKeyStep.class,
ValidateProjectStep.class,
ParseReportStep.class,
| ReportExtractionStep.class,
BuildComponentTreeStep.class,
|
10,754 | import org.sonar.api.utils.log.Profiler;
import org.sonar.core.issue.db.UpdateConflictResolver;
import org.sonar.core.platform.ComponentContainer;
import org.sonar.server.computation.ComputationService;
import org.sonar.server.computation.ReportQueue;
<BUG>import org.sonar.server.computation.activity.ActivityManager;
import org.sonar.server.computation.batch.BatchReportReaderImpl;
import org.sonar.server.computation.batch.ReportExtractor;</BUG>
import org.sonar.server.computation.component.DbComponentsRefCache;
import org.sonar.server.computation.component.TreeRootHolderImpl;
| import org.sonar.server.computation.batch.BatchReportDirectoryHolderImpl;
|
10,755 | return new DefaultPicoContainer(new OptInCaching(), lifecycleStrategy, parent.getPicoContainer());
}
private static List componentClasses() {
return Arrays.asList(
ActivityManager.class,
<BUG>ReportExtractor.class,
BatchReportReaderImpl.class,
TreeRootHolderImpl.class,
PlatformLanguageRepository.class,</BUG>
MeasureRepositoryImpl.class,
| BatchReportDirectoryHolderImpl.class,
PlatformLanguageRepository.class,
|
10,756 | 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;
|
10,757 | 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();
|
10,758 | 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: " +
|
10,759 | 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;
|
10,760 | 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]);
|
10,761 | 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;
|
10,762 | import java.util.*;
public class VCFHeader {
public enum HEADER_FIELDS {
CHROM, POS, ID, REF, ALT, QUAL, FILTER, INFO
}
<BUG>private final Set<VCFHeaderLine> mMetaData;
private final Set<String> mGenotypeSampleNames = new LinkedHashSet<String>();</BUG>
public static final String METADATA_INDICATOR = "##";
public static final String HEADER_INDICATOR = "#";
private boolean hasGenotypingData = false;
| private final Map<String, VCFInfoHeaderLine> mInfoMetaData = new HashMap<String, VCFInfoHeaderLine>();
private final Map<String, VCFFormatHeaderLine> mFormatMetaData = new HashMap<String, VCFFormatHeaderLine>();
private final Set<String> mGenotypeSampleNames = new LinkedHashSet<String>();
|
10,763 | public static final String METADATA_INDICATOR = "##";
public static final String HEADER_INDICATOR = "#";
private boolean hasGenotypingData = false;
public VCFHeader(Set<VCFHeaderLine> metaData) {
mMetaData = new TreeSet<VCFHeaderLine>(metaData);
<BUG>loadVCFVersion();
}</BUG>
public VCFHeader(Set<VCFHeaderLine> metaData, Set<String> genotypeSampleNames) {
mMetaData = new TreeSet<VCFHeaderLine>(metaData);
for (String col : genotypeSampleNames) {
| loadMetaDataMaps();
}
|
10,764 | for (String col : genotypeSampleNames) {
if (!col.equals("FORMAT"))
mGenotypeSampleNames.add(col);
}
if (genotypeSampleNames.size() > 0) hasGenotypingData = true;
<BUG>loadVCFVersion();
}</BUG>
public void loadVCFVersion() {
List<VCFHeaderLine> toRemove = new ArrayList<VCFHeaderLine>();
for ( VCFHeaderLine line : mMetaData )
| loadMetaDataMaps();
|
10,765 | hInfo.add(new VCFHeaderLine("ValidationMetrics_NoCallViolations", String.format("\"%d (%d%%)\"", numNoCallViolations, 100*numNoCallViolations/numRecords)));
System.out.println(String.format("Number of homozygous variant violations:\t\t%d (%d%%)", numHomVarViolations, 100*numHomVarViolations/numRecords));
hInfo.add(new VCFHeaderLine("ValidationMetrics_HomVarViolations", String.format("\"%d (%d%%)\"", numHomVarViolations, 100*numHomVarViolations/numRecords)));
int goodRecords = numRecords - numHWViolations - numNoCallViolations - numHomVarViolations;
System.out.println(String.format("Number of records passing all filters:\t\t\t%d (%d%%)", goodRecords, 100*goodRecords/numRecords));
<BUG>hInfo.add(new VCFHeaderLine("ValidationMetrics_RecordsPassingFilters", String.format("\"%d (%d%%)\"", goodRecords, 100*goodRecords/numRecords)));
System.out.println(String.format("Number of passing records that are polymorphic:\t\t%d (%d%%)", numTrueVariants, 100*numTrueVariants/goodRecords));
hInfo.add(new VCFHeaderLine("ValidationMetrics_PolymorphicPassingRecords", String.format("\"%d (%d%%)\"", numTrueVariants, 100*numTrueVariants/goodRecords)));
}</BUG>
VCFHeader header = new VCFHeader(hInfo, sampleNames);
| if ( goodRecords > 0 ) {
}
}
|
10,766 | ((VCFGenotypeWriter)writer).writeHeader(sampleNames,headerInfo);
}
public void addRecord(VCFRecord vcfRecord) {
((VCFGenotypeWriter)writer).addRecord(vcfRecord);
}
<BUG>public void setValidationStringency(VALIDATION_STRINGENCY value) {
((VCFGenotypeWriter)writer).setValidationStringency(value);
}</BUG>
public void mergeInto(VCFGenotypeWriter target) {
VCFReader reader = new VCFReader(file,false);
| [DELETED] |
10,767 | public static final String VALIDATED_KEY = "VALIDATED";
public static final String FORMAT_FIELD_SEPARATOR = ":";
public static final String GENOTYPE_FIELD_SEPARATOR = ":";
public static final String FIELD_SEPARATOR = "\t";
public static final String FILTER_CODE_SEPARATOR = ";";
<BUG>public static final String INFO_FIELD_SEPARATOR = ";";
public static final String UNFILTERED = ".";</BUG>
public static final String PASSES_FILTERS_v3 = "0";
public static final String PASSES_FILTERS_v4 = "PASS";
public static final String EMPTY_ID_FIELD = ".";
| public static final String UNPHASED = "/";
public static final String PHASED = "|";
public static final String PHASED_SWITCH_PROB_v3 = "\\";
public static final String UNFILTERED = ".";
|
10,768 | namespaces.removeProperty(prefix);
} else {</BUG>
throw new NamespaceException(
"Namespace mapping from " + prefix + " to "
+ getURI(prefix) + " can not be unregistered");
<BUG>}
root.commit(DefaultConflictHandler.OURS);</BUG>
refresh();
} catch (NamespaceValidatorException e) {
throw e.getNamespaceException();
| root.commit(DefaultConflictHandler.OURS);
|
10,769 | import static javax.jcr.version.OnParentVersionAction.ACTIONNAME_IGNORE;
import static javax.jcr.version.OnParentVersionAction.ACTIONNAME_INITIALIZE;
import static javax.jcr.version.OnParentVersionAction.ACTIONNAME_VERSION;</BUG>
import javax.jcr.nodetype.ItemDefinition;
import javax.jcr.nodetype.NodeType;
<BUG>import javax.jcr.version.OnParentVersionAction;
class ItemDefinitionImpl implements ItemDefinition {
private final NodeType type;</BUG>
protected final NodeUtil node;
protected ItemDefinitionImpl(NodeType type, NodeUtil node) {
| package org.apache.jackrabbit.oak.plugins.type;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger log =
LoggerFactory.getLogger(ItemDefinitionImpl.class);
private final NodeType type;
|
10,770 | public static double betterRound(double numIn, int decPlac){
double opOn = Math.round(numIn * Math.pow(10, decPlac)) / Math.pow(10D, decPlac);
return opOn;
}
public static double centerCeil(double numIn, int tiers){
<BUG>return ((numIn > 0) ? Math.ceil(numIn * tiers) : Math.floor(numIn * tiers)) / tiers;
</BUG>
}
public static double findEfficiency(double speedIn, double lowerLimit, double upperLimit){
speedIn = Math.abs(speedIn);
| return ((numIn > 0) ? Math.ceil(numIn * (double) tiers) : Math.floor(numIn * (double) tiers)) / (double) tiers;
|
10,771 | package com.Da_Technomancer.crossroads.API;
import com.Da_Technomancer.crossroads.API.DefaultStorageHelper.DefaultStorage;
import com.Da_Technomancer.crossroads.API.heat.DefaultHeatHandler;
import com.Da_Technomancer.crossroads.API.heat.IHeatHandler;
import com.Da_Technomancer.crossroads.API.magic.DefaultMagicHandler;
<BUG>import com.Da_Technomancer.crossroads.API.magic.IMagicHandler;
import com.Da_Technomancer.crossroads.API.rotary.DefaultRotaryHandler;
import com.Da_Technomancer.crossroads.API.rotary.IRotaryHandler;
</BUG>
import net.minecraftforge.common.capabilities.Capability;
| import com.Da_Technomancer.crossroads.API.rotary.DefaultAxleHandler;
import com.Da_Technomancer.crossroads.API.rotary.DefaultCogHandler;
import com.Da_Technomancer.crossroads.API.rotary.IAxleHandler;
import com.Da_Technomancer.crossroads.API.rotary.ICogHandler;
|
10,772 | import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraftforge.common.capabilities.CapabilityManager;
public class Capabilities{
@CapabilityInject(IHeatHandler.class)
<BUG>public static Capability<IHeatHandler> HEAT_HANDLER_CAPABILITY = null;
@CapabilityInject(IRotaryHandler.class)
public static Capability<IRotaryHandler> ROTARY_HANDLER_CAPABILITY = null;
</BUG>
@CapabilityInject(IMagicHandler.class)
| @CapabilityInject(IAxleHandler.class)
public static Capability<IAxleHandler> AXLE_HANDLER_CAPABILITY = null;
@CapabilityInject(ICogHandler.class)
public static Capability<ICogHandler> COG_HANDLER_CAPABILITY = null;
|
10,773 | <BUG>package org.opencms.importexport;
import org.opencms.i18n.CmsLocaleManager;</BUG>
import org.opencms.main.CmsException;
import org.opencms.main.I_CmsConstants;
import org.opencms.main.OpenCms;
| import org.opencms.file.CmsGroup;
import org.opencms.file.CmsObject;
import org.opencms.file.CmsResource;
import org.opencms.file.CmsResourceTypePointer;
import org.opencms.i18n.CmsLocaleManager;
|
10,774 | import org.opencms.main.I_CmsConstants;
import org.opencms.main.OpenCms;
import org.opencms.report.I_CmsReport;
import org.opencms.security.CmsAccessControlEntry;
import org.opencms.util.CmsUUID;
<BUG>import org.opencms.file.CmsGroup;
import org.opencms.file.CmsObject;
import org.opencms.file.CmsResource;
import org.opencms.file.CmsResourceTypePointer;</BUG>
import java.io.File;
| [DELETED] |
10,775 | import java.util.Map;
import java.util.Stack;
import java.util.Vector;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
<BUG>import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;</BUG>
public abstract class A_CmsImport implements I_CmsImport {
| import org.dom4j.Document;
import org.dom4j.Element;
|
10,776 | properties.put(name, value);
createPropertydefinition(name, resType);
}
}
return properties;
<BUG>}
protected String getTextNodeValue(Element elem, String tag) {
try {
return elem.getElementsByTagName(tag).item(0).getFirstChild().getNodeValue();
} catch (Exception exc) {
return null;
}</BUG>
}
| [DELETED] |
10,777 | package org.opencms.importexport;
import org.opencms.file.CmsResourceTypeFolder;
import org.opencms.file.CmsResourceTypePlain;
import org.opencms.main.I_CmsConstants;
import org.opencms.workplace.I_CmsWpConstants;
<BUG>import com.opencms.template.A_CmsXmlContent;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;</BUG>
public class CmsCompatibleCheck {
| import java.util.List;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.Node;
|
10,778 | if (name.startsWith(I_CmsWpConstants.C_VFS_PATH_BODIES)) {
if (!CmsResourceTypePlain.C_RESOURCE_TYPE_NAME.equals(type)) {
return false;
}
try {
<BUG>org.w3c.dom.Document xmlDoc = A_CmsXmlContent.getXmlParser().parse(new java.io.StringReader(new String(content)));
for (Node n = xmlDoc.getFirstChild(); n != null; n = treeWalker(xmlDoc, n)) {
</BUG>
short ntype = n.getNodeType();
if (((ntype > Node.CDATA_SECTION_NODE) && ntype < Node.DOCUMENT_TYPE_NODE) || (ntype == Node.ATTRIBUTE_NODE)) {
| Document xmlDoc = DocumentHelper.parseText(new String(content));
for (Node n = (Node) xmlDoc.content().get(0); n != null; n = treeWalker(xmlDoc, n)) {
|
10,779 | short ntype = n.getNodeType();
if (((ntype > Node.CDATA_SECTION_NODE) && ntype < Node.DOCUMENT_TYPE_NODE) || (ntype == Node.ATTRIBUTE_NODE)) {
return false;
}
if (n.getNodeType() == Node.ELEMENT_NODE) {
<BUG>String tagName = n.getNodeName();
if (!("template".equalsIgnoreCase(tagName) || "xmltemplate".equalsIgnoreCase(tagName))) {</BUG>
return false;
}
}
| [DELETED] |
10,780 | counterTeplate++;
} else {
return false;
}
} else if (nodeType == Node.TEXT_NODE) {
<BUG>String nodeValue = n.getNodeValue();
</BUG>
if ((nodeValue != null) && (nodeValue.trim().length() > 0)) {
return false;
}
| String nodeValue = n.getText();
|
10,781 | setOffset(offsetMs, false);
}
public synchronized void setOffset(long offsetMs, boolean force) {
long delta = offsetMs - _offset;
if (!force) {
<BUG>if ((offsetMs > MAX_OFFSET) || (offsetMs < 0 - MAX_OFFSET)) {
getLog().error("Maximum offset shift exceeded [" + offsetMs + "], NOT HONORING IT");
</BUG>
return;
}
| Log log = getLog();
if (log.shouldLog(Log.WARN))
log.warn("Maximum offset shift exceeded [" + offsetMs + "], NOT HONORING IT");
|
10,782 | if (!_statCreated) {
_context.statManager().createRequiredRateStat("clock.skew", "Clock step adjustment (ms)", "Clock", new long[] { 10*60*1000, 3*60*60*1000, 24*60*60*1000 });
_statCreated = true;
}
_context.statManager().addRateData("clock.skew", delta, 0);
<BUG>} else {
getLog().log(Log.INFO, "Initializing clock offset to " + offsetMs + "ms from " + _offset + "ms");
</BUG>
}
_alreadyChanged = true;
| Log log = getLog();
if (log.shouldLog(Log.INFO))
log.info("Initializing clock offset to " + offsetMs + "ms from " + _offset + "ms");
|
10,783 | setOffset(offsetMs, false, stratum);
}
private synchronized void setOffset(long offsetMs, boolean force, int stratum) {
long delta = offsetMs - _offset;
if (!force) {
<BUG>if ((offsetMs > MAX_OFFSET) || (offsetMs < 0 - MAX_OFFSET)) {
getLog().error("Maximum offset shift exceeded [" + offsetMs + "], NOT HONORING IT");
</BUG>
return;
}
| Log log = getLog();
if (log.shouldLog(Log.WARN))
log.warn("Maximum offset shift exceeded [" + offsetMs + "], NOT HONORING IT");
|
10,784 | getLog().debug("Not changing offset, delta=0");
_alreadyChanged = true;
return;
}
if (_alreadyChanged && stratum > _lastStratum &&
<BUG>System.currentTimeMillis() - _lastChanged < MIN_DELAY_FOR_WORSE_STRATUM) {
getLog().debug("Ignoring update from a stratum " + stratum +
</BUG>
" clock, we recently had an update from a stratum " + _lastStratum + " clock");
return;
| [DELETED] |
10,785 | (Math.abs(predictedPeerClockSkew) > 20*1000)) {
getLog().error("Ignoring clock offset " + offsetMs + "ms (current " + _offset +
"ms) since it would increase peer clock skew from " + currentPeerClockSkew +
"ms to " + predictedPeerClockSkew + "ms. Bad time server?");
return;
<BUG>} else {
getLog().debug("Approving clock offset " + offsetMs + "ms (current " + _offset +
</BUG>
"ms) since it would decrease peer clock skew from " + currentPeerClockSkew +
"ms to " + predictedPeerClockSkew + "ms.");
| Log log = getLog();
if (log.shouldLog(Log.DEBUG))
log.debug("Approving clock offset " + offsetMs + "ms (current " + _offset +
|
10,786 | _context.statManager().createRequiredRateStat("clock.skew", "Clock step adjustment (ms)", "Clock", new long[] { 10*60*1000, 3*60*60*1000, 24*60*60*1000 });
_statCreated = true;
}
_context.statManager().addRateData("clock.skew", delta);
_desiredOffset = offsetMs;
<BUG>} else {
getLog().log(Log.INFO, "Initializing clock offset to " + offsetMs + "ms, Stratum " + stratum);
</BUG>
_alreadyChanged = true;
_offset = offsetMs;
| Log log = getLog();
if (log.shouldLog(Log.INFO))
log.info("Initializing clock offset to " + offsetMs + "ms, Stratum " + stratum);
|
10,787 | public final List<Error> errors;
private Showcase(Builder builder) {
title = checkNotNull(builder.title, "title");
form = builder.form;
hiddenFields = Collections.unmodifiableMap(builder.hiddenFields);
<BUG>moneySources = Collections.unmodifiableSet(builder.moneySources);
</BUG>
errors = Collections.unmodifiableList(builder.errors);
}
public Map<String, String> getPaymentParameters() {
| moneySources = Collections.unmodifiableList(builder.moneySources);
|
10,788 | Group group = builder.create();
return new Showcase.Builder().setTitle("foo")
.setErrors(Collections.<Showcase.Error>emptyList())
.setForm(group)
.setHiddenFields(Collections.<String, String>emptyMap())
<BUG>.setMoneySources(Collections.<AllowedMoneySource>emptySet())
</BUG>
.create();
}
private static Showcase loadFromResource() throws Exception {
| .setMoneySources(Collections.<AllowedMoneySource>emptyList())
|
10,789 | import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.entity.StringEntity;
<BUG>import org.apache.http.localserver.LocalTestServer;
import org.apache.http.localserver.RequestBasicAuth;</BUG>
import org.apache.http.localserver.ResponseBasicUnauthorized;
import org.apache.http.message.BasicHeader;
import org.apache.http.protocol.BasicHttpProcessor;
| import org.apache.http.impl.bootstrap.HttpServer;
import org.apache.http.impl.bootstrap.ServerBootstrap;
import org.apache.http.localserver.RequestBasicAuth;
|
10,790 | import org.testng.annotations.Test;
import brooklyn.util.stream.Streams;
import brooklyn.util.text.Strings;
public class ResourceUtilsHttpTest {
private ResourceUtils utils;
<BUG>private LocalTestServer server;
</BUG>
private String baseUrl;
@BeforeClass(alwaysRun=true)
public void setUp() throws Exception {
| private HttpServer server;
|
10,791 | public boolean isDumbAware() {
return true;
}
@Override
public boolean isApplicable(AnActionEvent event, final Map<String, Object> _params) {
<BUG>return SNodeOperations.isInstanceOf(((SNode) MapSequence.fromMap(_params).get("selectedNode")), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept")) && ListSequence.fromList(((List<SNode>) BHReflection.invoke(SNodeOperations.cast(((SNode) MapSequence.fromMap(_params).get("selectedNode")), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept")), SMethodTrimmedId.create("getMethodsToOverride", null, "4GM03FJm3zL")))).isNotEmpty();
</BUG>
}
@Override
public void doUpdate(@NotNull AnActionEvent event, final Map<String, Object> _params) {
| return SNodeOperations.isInstanceOf(event.getData(MPSCommonDataKeys.NODE), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept")) && ListSequence.fromList(((List<SNode>) BHReflection.invoke(SNodeOperations.cast(event.getData(MPSCommonDataKeys.NODE), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept")), SMethodTrimmedId.create("getMethodsToOverride", null, "4GM03FJm3zL")))).isNotEmpty();
|
10,792 | }
}
return true;
}
@Override
<BUG>public void doExecute(@NotNull final AnActionEvent event, final Map<String, Object> _params) {
final Project project = ((IOperationContext) MapSequence.fromMap(_params).get("operationContext")).getProject();
new OverrideImplementMethodAction(project, ((SNode) MapSequence.fromMap(_params).get("selectedNode")), ((EditorContext) MapSequence.fromMap(_params).get("editorContext")), true).run();</BUG>
}
}
| public void doUpdate(@NotNull AnActionEvent event, final Map<String, Object> _params) {
this.setEnabledState(event.getPresentation(), this.isApplicable(event, _params));
|
10,793 | import jetbrains.mps.smodel.behaviour.BHReflection;
import jetbrains.mps.core.aspects.behaviour.SMethodTrimmedId;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.ide.actions.MPSCommonDataKeys;
import jetbrains.mps.ide.editor.MPSEditorDataKeys;
<BUG>import jetbrains.mps.smodel.IOperationContext;
import jetbrains.mps.project.Project;
import jetbrains.mps.smodel.ModelAccess;
</BUG>
import jetbrains.mps.util.Computable;
| import jetbrains.mps.project.MPSProject;
import jetbrains.mps.smodel.ModelAccessHelper;
|
10,794 | import jetbrains.mps.smodel.behaviour.BHReflection;
import jetbrains.mps.core.aspects.behaviour.SMethodTrimmedId;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.ide.actions.MPSCommonDataKeys;
import jetbrains.mps.ide.editor.MPSEditorDataKeys;
<BUG>import jetbrains.mps.smodel.IOperationContext;
import jetbrains.mps.project.Project;
import jetbrains.mps.smodel.ModelAccess;
</BUG>
import jetbrains.mps.util.Computable;
| import jetbrains.mps.project.MPSProject;
import jetbrains.mps.smodel.ModelAccessHelper;
|
10,795 | import jetbrains.mps.smodel.behaviour.BHReflection;
import jetbrains.mps.core.aspects.behaviour.SMethodTrimmedId;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.ide.actions.MPSCommonDataKeys;
import jetbrains.mps.ide.editor.MPSEditorDataKeys;
<BUG>import jetbrains.mps.smodel.IOperationContext;
import jetbrains.mps.project.Project;
import jetbrains.mps.smodel.ModelAccess;
</BUG>
import jetbrains.mps.util.Computable;
| import jetbrains.mps.project.MPSProject;
import jetbrains.mps.smodel.ModelAccessHelper;
|
10,796 | final Tuple2<Stream<T>, Stream<T>> tuple = Streams.duplicate(unwrapStream());
return tuple.map1(s -> createSeq(s, reversible.map(r -> r.copy())))
.map2(s -> createSeq(s, reversible.map(r -> r.copy())));
}
@Override
<BUG>public final Tuple2<ReactiveSeq<T>, ReactiveSeq<T>> duplicate(Supplier<List<T>> bufferFactory) {
</BUG>
final Tuple2<Stream<T>, Stream<T>> tuple = Streams.duplicate(unwrapStream(),bufferFactory);
return tuple.map1(s -> createSeq(s, reversible.map(r -> r.copy())))
.map2(s -> createSeq(s, reversible.map(r -> r.copy())));
| [DELETED] |
10,797 | package com.aol.cyclops2.internal.stream.spliterators;
<BUG>import com.aol.cyclops2.types.stream.reactive.SeqSubscriber;
import org.reactivestreams.Publisher;</BUG>
import java.util.Iterator;
import java.util.Spliterator;
import java.util.Spliterators;
| import cyclops.stream.Spouts;
import org.reactivestreams.Publisher;
|
10,798 | public void forEachRemaining(Consumer<? super R> action) {
if(active!=null){
active.forEachRemaining(action);
}
source.forEachRemaining(t->{
<BUG>Publisher<R> flatten = (Publisher<R>)mapper.apply(t);
SeqSubscriber<R> sub = SeqSubscriber.subscriber(); //use sequential reactiveSubscriber for iterable sequences, in future switch to pushsubscriber where appropriate
flatten.subscribe(sub);
sub.spliterator().forEachRemaining(action);</BUG>
});
| [DELETED] |
10,799 | else
active = null;
}
boolean advance = source.tryAdvance(t -> {
if (active == null || !active.hasNext()) {
<BUG>Publisher<R> flatten = (Publisher<R>)mapper.apply(t);
SeqSubscriber<R> sub = SeqSubscriber.subscriber();
flatten.subscribe(sub);
active = (Iterator<R>)sub.iterator();</BUG>
}
| active = Spouts.from(flatten).iterator();
|
10,800 | ListX<Iterable<T>> copy = Streams.toBufferingCopier(() -> Spliterators.iterator(copy()), 2);
return Tuple.tuple(createSeq(new IteratableSpliterator<>(copy.get(0))),
createSeq(new IteratableSpliterator<>(copy.get(1))));
}
@Override
<BUG>public Tuple2<ReactiveSeq<T>, ReactiveSeq<T>> duplicate(Supplier<List<T>> bufferFactory) {
Tuple2<Iterable<T>, Iterable<T>> copy = Streams.toBufferingDuplicator(() -> Spliterators.iterator(copy()),bufferFactory);
return copy.map((a,b)->Tuple.tuple(createSeq(new IteratableSpliterator<>(a)),createSeq(new IteratableSpliterator<>(b))));
}</BUG>
@Override
| public Tuple2<ReactiveSeq<T>, ReactiveSeq<T>> duplicate(Supplier<Deque<T>> bufferFactory) {
ListX<Iterable<T>> copy = Streams.toBufferingCopier(() -> Spliterators.iterator(copy()), 2,bufferFactory);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.