id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
2,001
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();
2,002
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: " +
2,003
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;
2,004
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]);
2,005
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;
2,006
protected boolean isCaseSensitive() { return true; } @NotNull public String getNamespace() { <BUG>String namespace = myNamespace; if (namespace == null) { myNamespace = namespace = getNamespaceByPrefix(getNamespacePrefix()); } return namespace;</BUG> }
[DELETED]
2,007
package com.rackspace.papi.filter; import javax.servlet.Filter; <BUG>public class FilterContext { private final ClassLoader filterClassLoader;</BUG> private final Filter filter; public FilterContext(Filter filter, ClassLoader filterClassLoader) { this.filter = filter;
import com.rackspace.papi.commons.util.Destroyable; public class FilterContext implements Destroyable { private final ClassLoader filterClassLoader;
2,008
import com.rackspace.papi.commons.util.http.CommonHttpHeader; import com.rackspace.papi.commons.util.http.HttpStatusCode; import com.rackspace.papi.commons.util.servlet.filter.ApplicationContextAwareFilter; import com.rackspace.papi.commons.util.servlet.http.HttpServletHelper; import com.rackspace.papi.commons.util.servlet.http.MutableHttpServletRequest; <BUG>import com.rackspace.papi.commons.util.servlet.http.MutableHttpServletResponse; import com.rackspace.papi.commons.util.thread.KeyedStackLock; import com.rackspace.papi.model.PowerProxy;</BUG> import com.rackspace.papi.service.context.jndi.ContextAdapter; import com.rackspace.papi.service.context.jndi.ServletContextHelper;
import com.rackspace.papi.commons.util.thread.DestroyableThreadWrapper; import com.rackspace.papi.filter.resource.PowerFilterChainReclaimer; import com.rackspace.papi.filter.resource.PowerFilterChainGarbageCollector; import com.rackspace.papi.model.PowerProxy;
2,009
import javax.servlet.ServletResponse; public class PowerFilter extends ApplicationContextAwareFilter { private static final Logger LOG = LoggerFactory.getLogger(PowerFilter.class); private final EventListener<ApplicationDeploymentEvent, String> applicationDeploymentListener; private final UpdateListener<PowerProxy> systemModelConfigurationListener; <BUG>private boolean firstInitialization; private List<FilterContext> filterChain;</BUG> private ContextAdapter papiContext; private PowerProxy currentSystemModel; private FilterConfig filterConfig;
private PowerFilterChainBuilder powerFilterChainBuilder; private PowerFilterChainGarbageCollector filterChainGarbageCollector; private DestroyableThreadWrapper filterChainGarbageCollectorThread; private List<FilterContext> filterChain;
2,010
applicationDeploymentListener = new EventListener<ApplicationDeploymentEvent, String>() { @Override public void onEvent(Event<ApplicationDeploymentEvent, String> e) { LOG.info("Application collection has been modified. Application that changed: " + e.payload()); if (currentSystemModel != null) { <BUG>final List<FilterContext> newFilterChain = new PowerFilterChainBuilder(filterConfig).build(papiContext.classLoader(), currentSystemModel); updateFilterList(newFilterChain); </BUG> }
final List<FilterContext> newFilterChain = new FilterContextInitializer(filterConfig).buildFilterContexts(papiContext.classLoader(), currentSystemModel); updateFilterChainBuilder(newFilterChain);
2,011
final byte[] expectedBytes = new byte[16]; for (int i = 0; i < expectedBytes.length; i++) { expectedBytes[i] = 1; } final UUID uuid = UUIDHelper.bytesToUUID(expectedBytes); <BUG>System.out.println(uuid.toString());</BUG> final byte[] actualBytes = UUIDHelper.stringToUUIDBytes(uuid.toString()); assertTrue(new ByteArrayComparator(expectedBytes, actualBytes).arraysAreEqual()); } } }
[DELETED]
2,012
new InetSocketAddress(InetAddress.getLocalHost(), 2103), new InetSocketAddress(InetAddress.getLocalHost(), 2104)}); final String myKey = "mykey"; final int finishTotal = 9700, sleep1 = 1000, <BUG>sleep2 = 100000, sleep3 = 200000, sleep4 = 100250; </BUG> total = 0;
sleep2 = 2000, sleep3 = 1200, sleep4 = 3000;
2,013
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.servlet.FilterConfig; import java.util.Collection; public class FilterContextManagerImpl implements FilterContextManager { <BUG>private static final Logger LOG = LoggerFactory.getLogger(PowerFilterChainBuilder.class); </BUG> private final FilterConfig filterConfig; public FilterContextManagerImpl(FilterConfig filterConfig) { this.filterConfig = filterConfig;
private static final Logger LOG = LoggerFactory.getLogger(FilterContextInitializer.class);
2,014
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AFileSystem extends FileSystem {</BUG> private URI uri; private Path workingDir; private AmazonS3Client s3;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AFileSystem extends FileSystem {
2,015
public void initialize(URI name, Configuration conf) throws IOException { super.initialize(name, conf); uri = URI.create(name.getScheme() + "://" + name.getAuthority()); workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri, this.getWorkingDirectory()); <BUG>String accessKey = conf.get(ACCESS_KEY, null); String secretKey = conf.get(SECRET_KEY, null); </BUG> String userInfo = name.getUserInfo();
String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null)); String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
2,016
} else { accessKey = userInfo; } } AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain( <BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey), new InstanceProfileCredentialsProvider(), new S3AAnonymousAWSCredentialsProvider() );</BUG> bucket = name.getHost();
new BasicAWSCredentialsProvider(accessKey, secretKey), new AnonymousAWSCredentialsProvider()
2,017
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)); </BUG> s3 = new AmazonS3Client(credentials, awsConf); <BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS); partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (partSize < 5 * 1024 * 1024) {
new InstanceProfileCredentialsProvider(), new AnonymousAWSCredentialsProvider() bucket = name.getHost(); ClientConfiguration awsConf = new ClientConfiguration(); awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS))); awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP); awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES))); awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT))); maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS)); partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE)); partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
2,018
cannedACL = null; } if (!s3.doesBucketExist(bucket)) { throw new IOException("Bucket " + bucket + " does not exist"); } <BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART); long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE); </BUG> if (purgeExistingMultipart) {
boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART)); long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE));
2,019
import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AOutputStream extends OutputStream {</BUG> private OutputStream backupStream; private File backupFile; private boolean closed;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AOutputStream extends OutputStream {
2,020
this.client = client; this.progress = progress; this.fs = fs; this.cannedACL = cannedACL; this.statistics = statistics; <BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (conf.get(BUFFER_DIR, null) != null) {
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
2,021
EditorCell_Collection result = jetbrains.mps.nodeEditor.cells.EditorCell_Collection.createIndent2(editorContext, node); result.setBig(true); result.getStyle().putAll(StyleRegistry.getInstance().getStyle("LINE_COMMENT"), 1); result.addEditorCell(createCommentConstantCell(editorContext, node, true)); result.addEditorCell(mainCell); <BUG>result.addEditorCell(createCommentConstantCell(editorContext, node, false)); return result;</BUG> } private EditorCell_Constant createCommentConstantCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node, boolean left) { EditorCell_Constant cell = new EditorCell_Constant(editorContext, node, left ? "/*" : "*/", false);
result.setCellId("main_comment_collection"); return result;
2,022
} private EditorCell_Constant createCommentConstantCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node, boolean left) { EditorCell_Constant cell = new EditorCell_Constant(editorContext, node, left ? "/*" : "*/", false); StyleImpl style = new StyleImpl(); style.set(left ? StyleAttributes.PUNCTUATION_RIGHT : StyleAttributes.PUNCTUATION_LEFT, 0, true); <BUG>cell.getStyle().putAll(style, 0); return cell;</BUG> } @Override public EditorCell createInspectedCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node) {
cell.setCellId(left ? "left_comment_constant" : "right_comment_constant"); return cell;
2,023
import org.jetbrains.annotations.NotNull; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; import jetbrains.mps.openapi.editor.EditorContext; import jetbrains.mps.openapi.editor.selection.Selection; import jetbrains.mps.openapi.editor.selection.SingularSelection; <BUG>import jetbrains.mps.openapi.editor.cells.EditorCell; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;</BUG> import org.jetbrains.mps.util.Condition; import jetbrains.mps.editor.runtime.selection.SelectionUtil; import jetbrains.mps.openapi.editor.selection.SelectionManager;
import jetbrains.mps.openapi.editor.cells.EditorCell_Label; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;
2,024
import jetbrains.mps.editor.runtime.cells.AbstractCellAction; import org.jetbrains.mps.openapi.model.SNode; import org.jetbrains.annotations.NotNull; import jetbrains.mps.openapi.editor.EditorContext; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; <BUG>import jetbrains.mps.openapi.editor.cells.EditorCell; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;</BUG> import org.jetbrains.mps.util.Condition; import jetbrains.mps.editor.runtime.selection.SelectionUtil; import jetbrains.mps.openapi.editor.selection.SelectionManager;
import jetbrains.mps.openapi.editor.cells.EditorCell_Label; import jetbrains.mps.nodeEditor.cells.CellFinderUtil;
2,025
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]
2,026
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);
2,027
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());
2,028
.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);
2,029
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());
2,030
} } 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);
2,031
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();
2,032
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());
2,033
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());
2,034
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());
2,035
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());
2,036
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();
2,037
} 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, {
2,038
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());
2,039
} 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, {
2,040
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, {
2,041
.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());
2,042
.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());
2,043
.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());
2,044
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());
2,045
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());
2,046
<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;
2,047
mView.showContent(sectionListBean); } }, new Action1<Throwable>() { @Override public void call(Throwable throwable) { <BUG>mView.showError("数据加载失败"); </BUG> } }); addSubscrebe(rxSubscription);
mView.showError("数据加载失败ヽ(≧Д≦)ノ");
2,048
mView.showContent(dailyListBean); } }, new Action1<Throwable>() { @Override public void call(Throwable throwable) { <BUG>mView.showError("数据加载失败"); </BUG> } }); addSubscrebe(rxSubscription);
mView.showError("数据加载失败ヽ(≧Д≦)ノ");
2,049
new Action1<Throwable>() { @Override public void call(Throwable throwable) { registerEvent(); LogUtil.d(throwable.toString()); <BUG>mView.showError("数据加载失败"); </BUG> }}); addSubscrebe(rxSubscription); }
mView.showError("数据加载失败ヽ(≧Д≦)ノ");
2,050
mView.showContent(themeChildListBean); } }, new Action1<Throwable>() { @Override public void call(Throwable throwable) { <BUG>mView.showError("数据加载失败"); </BUG> } }); addSubscrebe(rxSubscription);
mView.showError("数据加载失败ヽ(≧Д≦)ノ");
2,051
mView.showContent(commentBean); } }, new Action1<Throwable>() { @Override public void call(Throwable throwable) { <BUG>mView.showError("数据加载失败"); </BUG> } }); addSubscrebe(rxSubscription);
mView.showError("数据加载失败ヽ(≧Д≦)ノ");
2,052
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;
2,053
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;
2,054
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"),
2,055
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]
2,056
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) {
2,057
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;
2,058
import org.eclipse.xtext.resource.IEObjectDescription; import org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal; import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext; import org.eclipse.xtext.ui.editor.contentassist.ContentProposalLabelProvider; import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; <BUG>import org.yakindu.base.expressions.expressions.ElementReferenceExpression; import org.yakindu.base.expressions.expressions.FeatureCall;</BUG> import org.yakindu.base.types.Operation; import org.yakindu.base.types.Type; import org.yakindu.sct.model.stext.services.STextGrammarAccess;
import org.yakindu.base.expressions.expressions.ExpressionsPackage; import org.yakindu.base.expressions.expressions.FeatureCall;
2,059
suppressKeywords.addAll(getKeywords(grammarAccess.getAlwaysEventAccess().getGroup().eContents())); suppressKeywords.addAll(getKeywords(grammarAccess.getTimeEventTypeAccess().getAlternatives().eContents())); suppressKeywords.add(grammarAccess.getDirectionAccess().getLOCALLocalKeyword_0_0()); } protected void suppressKeywords(List<Keyword> suppressKeywords, FeatureCall featureCall) { <BUG>if (!(featureCall.getFeature() instanceof Operation)) { suppressKeywords.add(grammarAccess.getFeatureCallAccess().getOperationCallLeftParenthesisKeyword_1_3_0_0_0()); }</BUG> } protected void suppressKeywords(List<Keyword> suppressKeywords, ElementReferenceExpression referenceExpression) {
suppressKeywords
2,060
Predicate<IEObjectDescription> predicate = calculateFilterPredicate(context, reference); return new FilteringScope(scope, predicate);</BUG> } public IScope scope_ElementReferenceExpression_reference(final EObject context, EReference reference) { <BUG>IScope namdScope = getNamedTopLevelScope(context, reference); IScope unnamedScope = getUnnamedTopLevelScope(context, reference); Predicate<IEObjectDescription> predicate = calculateFilterPredicate(context, reference); unnamedScope = new FilteringScope(unnamedScope, predicate); return new SimpleScope(Iterables.concat(namdScope.getAllElements(), unnamedScope.getAllElements()));</BUG> }
} catch (Throwable t) { t.printStackTrace(); return null; public IScope scope_TypeSpecifier_type(final EObject context, EReference reference) { return getDelegate().getScope(context, reference); IScope scope = getUnnamedTopLevelScope(context, reference); scope = getNamedTopLevelScope(context, reference, scope); return scope;
2,061
if (name != null && name.trim().length() > 0) { scopeCandidates.add(scope); } } } <BUG>return Scopes.scopeFor(scopeCandidates); </BUG> } protected IScope getUnnamedTopLevelScope(final EObject context, EReference reference) { List<EObject> scopeCandidates = Lists.newArrayList();
return Scopes.scopeFor(scopeCandidates, outer);
2,062
public Message remove() { Message retval; synchronized(msgs) { Long key=new Long(next_to_remove); retval=(Message)msgs.remove(key); <BUG>if(retval != null) next_to_remove++; }</BUG> return retval;
if(retval != null) { if(log.isTraceEnabled()) log.trace("removed seqno=" + next_to_remove);
2,063
import org.jgroups.protocols.UNICAST; import org.jgroups.stack.IpAddress; import org.jgroups.stack.Protocol; import org.jgroups.util.Util; import java.util.Properties; <BUG>import java.util.Vector; public class UNICASTTest extends TestCase {</BUG> IpAddress a1, a2; Vector members; View v;
import java.nio.ByteBuffer; public class UNICASTTest extends TestCase {
2,064
if(num_mgs_received % 1000 == 0) System.out.println("<== " + num_mgs_received); } } public int getNumberOfReceivedMessages() { <BUG>return num_mgs_received; }</BUG> } public static Test suite() { TestSuite s=new TestSuite(UNICASTTest.class);
public Throwable getException() { return exception;
2,065
case Event.MSG: msg=(Message)evt.getArg(); dst=msg.getDest(); if(dst == null || dst.isMulticastAddress()) // only handle unicast messages break; // pass up <BUG>hdr=(UnicastHeader)msg.removeHeader(name); if(hdr == null) break;</BUG> src=msg.getSrc(); switch(hdr.type) { case UnicastHeader.DATA: // received regular message
hdr=(UnicastHeader)msg.getHeader(name); // changed from removeHeader() if(hdr == null) break;
2,066
src=msg.getSrc(); switch(hdr.type) { case UnicastHeader.DATA: // received regular message handleDataReceived(src, hdr.seqno, msg); sendAck(src, hdr.seqno); // only send an ACK if added to the received_msgs table (bela Aug 2006) <BUG>break; case UnicastHeader.ACK: // received ACK for previously sent message</BUG> handleAckReceived(src, hdr.seqno); break; default:
return; // we pass the deliverable message up in handleDataReceived() case UnicastHeader.ACK: // received ACK for previously sent message
2,067
package org.jfaster.mango; import com.google.common.collect.Lists; <BUG>import org.jfaster.mango.annotation.*; import org.jfaster.mango.operator.Mango;</BUG> import org.jfaster.mango.operator.cache.Day; import org.jfaster.mango.util.reflect.TypeToken; import org.jfaster.mango.support.DataSourceConfig;
import org.jfaster.mango.operator.Config; import org.jfaster.mango.operator.Mango;
2,068
package org.jfaster.mango.operator.cache; import org.jfaster.mango.binding.InvocationContext; import org.jfaster.mango.descriptor.MethodDescriptor; import org.jfaster.mango.exception.DescriptionException; <BUG>import org.jfaster.mango.operator.Config; </BUG> import org.jfaster.mango.operator.UpdateOperator; import org.jfaster.mango.parser.ASTJDBCIterableParameter; import org.jfaster.mango.parser.ASTRootNode;
import org.jfaster.mango.operator.ConfigHolder;
2,069
import java.util.List; import java.util.Set; public class CacheableUpdateOperator extends UpdateOperator { private final static InternalLogger logger = InternalLoggerFactory.getInstance(CacheableUpdateOperator.class); private CacheDriver driver; <BUG>public CacheableUpdateOperator(ASTRootNode rootNode, MethodDescriptor md, CacheDriver cacheDriver, Config config) { super(rootNode, md, config); </BUG> this.driver = cacheDriver;
public CacheableUpdateOperator(ASTRootNode rootNode, MethodDescriptor md, CacheDriver cacheDriver, ConfigHolder configHolder) { super(rootNode, md, configHolder);
2,070
package org.jfaster.mango; import com.google.common.collect.Lists; <BUG>import org.jfaster.mango.annotation.*; import org.jfaster.mango.operator.Mango;</BUG> import org.jfaster.mango.operator.cache.Day; import org.jfaster.mango.operator.cache.LocalCacheHandler; import org.jfaster.mango.support.DataSourceConfig;
import org.jfaster.mango.operator.Config; import org.jfaster.mango.operator.Mango;
2,071
package org.jfaster.mango.operator.cache; import org.jfaster.mango.binding.InvocationContext; import org.jfaster.mango.descriptor.MethodDescriptor; import org.jfaster.mango.operator.BatchUpdateOperator; <BUG>import org.jfaster.mango.operator.Config; </BUG> import org.jfaster.mango.parser.ASTRootNode; import org.jfaster.mango.util.Iterables; import org.jfaster.mango.util.logging.InternalLogger;
import org.jfaster.mango.operator.ConfigHolder;
2,072
import java.util.Map; import java.util.Set; public class CacheableBatchUpdateOperator extends BatchUpdateOperator { private final static InternalLogger logger = InternalLoggerFactory.getInstance(CacheableBatchUpdateOperator.class); private CacheDriver driver; <BUG>public CacheableBatchUpdateOperator(ASTRootNode rootNode, MethodDescriptor md, CacheDriver cacheDriver, Config config) { super(rootNode, md, config); </BUG> this.driver = cacheDriver;
public CacheableBatchUpdateOperator(ASTRootNode rootNode, MethodDescriptor md, CacheDriver cacheDriver, ConfigHolder configHolder) { super(rootNode, md, configHolder);
2,073
private InterceptorChain interceptorChain = new InterceptorChain(); private JdbcOperations jdbcOperations = new JdbcTemplate(); private ParameterNameDiscover parameterNameDiscover = new SerialNumberParameterNameDiscover(); private final ConcurrentHashMap<Method, StatsCounter> statsCounterMap = new ConcurrentHashMap<Method, StatsCounter>(); <BUG>private Config config = new Config(); </BUG> private final static CopyOnWriteArrayList<Mango> instances = new CopyOnWriteArrayList<Mango>(); private Mango() { }
private ConfigHolder configHolder = new ConfigHolder();
2,074
import java.util.Map; public class UpdateOperator extends AbstractOperator { private boolean returnGeneratedId; private Transformer transformer; private TypeHandler<? extends Number> generatedKeyTypeHandler; <BUG>public UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config) { super(rootNode, md.getDaoClass(), config); </BUG> init(md, rootNode.getSQLType());
public UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, ConfigHolder configHolder) { super(rootNode, md.getDaoClass(), configHolder);
2,075
public class QueryOperator extends AbstractOperator { protected RowMapper<?> rowMapper; protected ReturnDescriptor returnDescriptor; protected ListSupplier listSupplier; protected SetSupplier setSupplier; <BUG>public QueryOperator(ASTRootNode rootNode, MethodDescriptor md, Config config) { super(rootNode, md.getDaoClass(), config); </BUG> init(md);
public QueryOperator(ASTRootNode rootNode, MethodDescriptor md, ConfigHolder configHolder) { super(rootNode, md.getDaoClass(), configHolder);
2,076
for (Result resultAnno : resultAnnos) { ptc.put(resultAnno.property().trim(), resultAnno.column().trim()); } } <BUG>} return new BeanPropertyRowMapper<T>(clazz, ptc, config.isCheckColumn());</BUG> } protected Object EmptyObject() { return new QueryVisitor() {
final Config config = configHolder.get(); return new BeanPropertyRowMapper<T>(clazz, ptc, config.isCheckColumn());
2,077
import org.jfaster.mango.interceptor.InvocationInterceptorChain; import org.jfaster.mango.jdbc.JdbcOperations; import org.jfaster.mango.parser.ASTRootNode; import org.jfaster.mango.stat.StatsCounter; public abstract class AbstractOperator implements Operator { <BUG>protected AbstractOperator(ASTRootNode rootNode, Class<?> daoClass, Config config) { this.rootNode = rootNode; this.daoClass = daoClass; this.config = config; }</BUG> protected final ASTRootNode rootNode;
[DELETED]
2,078
import org.jfaster.mango.util.ToStringHelper; import javax.sql.DataSource; import java.util.*; public class BatchUpdateOperator extends AbstractOperator { protected Transformer transformer; <BUG>public BatchUpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config) { super(rootNode, md.getDaoClass(), config); </BUG> transformer = TRANSFORMERS.get(md.getReturnRawType());
public BatchUpdateOperator(ASTRootNode rootNode, MethodDescriptor md, ConfigHolder configHolder) { super(rootNode, md.getDaoClass(), configHolder);
2,079
import org.jfaster.mango.binding.InvocationContext; import org.jfaster.mango.descriptor.MethodDescriptor; import org.jfaster.mango.exception.DescriptionException; import org.jfaster.mango.invoker.GetterInvoker; import org.jfaster.mango.invoker.InvokerCache; <BUG>import org.jfaster.mango.operator.Config; </BUG> import org.jfaster.mango.operator.QueryOperator; import org.jfaster.mango.parser.ASTJDBCIterableParameter; import org.jfaster.mango.parser.ASTRootNode;
import org.jfaster.mango.operator.ConfigHolder;
2,080
import java.util.*; public class CacheableQueryOperator extends QueryOperator { private final static InternalLogger logger = InternalLoggerFactory.getInstance(CacheableUpdateOperator.class); private CacheDriver driver; GetterInvoker propertyOfMapperInvoker; <BUG>public CacheableQueryOperator(ASTRootNode rootNode, MethodDescriptor md, CacheDriver cacheDriver, Config config) { super(rootNode, md, config); </BUG> this.driver = cacheDriver;
public CacheableQueryOperator(ASTRootNode rootNode, MethodDescriptor md, CacheDriver cacheDriver, ConfigHolder configHolder) { super(rootNode, md, configHolder);
2,081
@Override public String toString() { return "desc"; } }; <BUG>public static final SortOrder DEFAULT = DESC; private static final SortOrder PROTOTYPE = DEFAULT; </BUG> @Override public SortOrder readFrom(StreamInput in) throws IOException {
return "asc"; }, DESC { private static final SortOrder PROTOTYPE = ASC;
2,082
GeoDistance geoDistance = GeoDistance.DEFAULT; boolean reverse = false; MultiValueMode sortMode = null; NestedInnerQueryParseSupport nestedHelper = null; final boolean indexCreatedBeforeV2_0 = context.indexShard().getIndexSettings().getIndexVersionCreated().before(Version.V_2_0_0); <BUG>boolean coerce = false; boolean ignoreMalformed = false; XContentParser.Token token;</BUG> String currentName = parser.currentName(); while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
boolean coerce = GeoDistanceSortBuilder.DEFAULT_COERCE; boolean ignoreMalformed = GeoDistanceSortBuilder.DEFAULT_IGNORE_MALFORMED; XContentParser.Token token;
2,083
String currentName = parser.currentName(); while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { currentName = parser.currentName(); } else if (token == XContentParser.Token.START_ARRAY) { <BUG>parseGeoPoints(parser, geoPoints); </BUG> fieldName = currentName; } else if (token == XContentParser.Token.START_OBJECT) { if ("nested_filter".equals(currentName) || "nestedFilter".equals(currentName)) {
GeoDistanceSortBuilder.parseGeoPoints(parser, geoPoints);
2,084
package org.elasticsearch.search.sort; <BUG>import org.elasticsearch.script.Script; public class SortBuilders {</BUG> public static ScoreSortBuilder scoreSort() { return new ScoreSortBuilder(); }
import org.elasticsearch.common.geo.GeoPoint; import java.util.Arrays; public class SortBuilders {
2,085
public GeoDistanceSortBuilder ignoreMalformed(boolean ignoreMalformed) { this.ignoreMalformed = ignoreMalformed; return this; }</BUG> @Override <BUG>public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject("_geo_distance"); if (geohashes.size() == 0 && points.size() == 0) { throw new ElasticsearchParseException("No points provided for _geo_distance sort."); }</BUG> builder.startArray(fieldName);
if (coerce == false) { } } public boolean ignoreMalformed() { return this.ignoreMalformed; } builder.startObject(NAME);
2,086
public class HBaseConsumerTest extends CamelHBaseTestSupport { @Before public void setUp() throws Exception { if (systemReady) { try { <BUG>hbaseUtil.createTable(HBaseHelper.getHBaseFieldAsBytes(DEFAULTTABLE), families); </BUG> } catch (TableExistsException ex) { } super.setUp();
hbaseUtil.createTable(HBaseHelper.getHBaseFieldAsBytes(PERSON_TABLE), families);
2,087
protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() { from("direct:start") <BUG>.to("hbase://" + DEFAULTTABLE); from("hbase://" + DEFAULTTABLE) </BUG> .to("mock:result");
.to("hbase://" + PERSON_TABLE); from("hbase://" + PERSON_TABLE)
2,088
import org.junit.Test; public class HBaseConvertionsTest extends CamelHBaseTestSupport { protected Object[] key = {1, "2", "3"}; protected final Object[] body = {1L, false, "3"}; protected final String[] column = {"DEFAULTCOLUMN"}; <BUG>protected final byte[][] families = {DEFAULTFAMILY.getBytes()}; </BUG> @Before public void setUp() throws Exception { if (systemReady) {
protected final byte[][] families = {INFO_FAMILY.getBytes()};
2,089
</BUG> @Before public void setUp() throws Exception { if (systemReady) { try { <BUG>hbaseUtil.createTable(HBaseHelper.getHBaseFieldAsBytes(DEFAULTTABLE), families); </BUG> } catch (TableExistsException ex) { } super.setUp();
import org.junit.Test; public class HBaseConvertionsTest extends CamelHBaseTestSupport { protected Object[] key = {1, "2", "3"}; protected final Object[] body = {1L, false, "3"}; protected final String[] column = {"DEFAULTCOLUMN"}; protected final byte[][] families = {INFO_FAMILY.getBytes()}; hbaseUtil.createTable(HBaseHelper.getHBaseFieldAsBytes(PERSON_TABLE), families);
2,090
} } @After public void tearDown() throws Exception { if (systemReady) { <BUG>hbaseUtil.deleteTable(DEFAULTTABLE.getBytes()); </BUG> super.tearDown(); } }
super.setUp(); hbaseUtil.deleteTable(PERSON_TABLE.getBytes());
2,091
List<Filter> filters = new LinkedList<Filter>(); @Before public void setUp() throws Exception { if (systemReady) { try { <BUG>hbaseUtil.createTable(HBaseHelper.getHBaseFieldAsBytes(DEFAULTTABLE), families); </BUG> } catch (TableExistsException ex) { } super.setUp();
hbaseUtil.createTable(HBaseHelper.getHBaseFieldAsBytes(PERSON_TABLE), families);
2,092
} } @After public void tearDown() throws Exception { if (systemReady) { <BUG>hbaseUtil.deleteTable(DEFAULTTABLE.getBytes()); </BUG> super.tearDown(); } }
super.setUp(); hbaseUtil.deleteTable(PERSON_TABLE.getBytes());
2,093
putMultipleRows(); ProducerTemplate template = context.createProducerTemplate(); Endpoint endpoint = context.getEndpoint("direct:scan"); Exchange exchange = endpoint.createExchange(ExchangePattern.InOut); exchange.getIn().setHeader(HbaseAttribute.HBASE_FAMILY.asHeader(), family[0]); <BUG>exchange.getIn().setHeader(HbaseAttribute.HBASE_QUALIFIER.asHeader(), column[0]); exchange.getIn().setHeader(HbaseAttribute.HBASE_VALUE.asHeader(), body[0]); </BUG> Exchange resp = template.send(endpoint, exchange);
exchange.getIn().setHeader(HbaseAttribute.HBASE_QUALIFIER.asHeader(), column[0][0]); exchange.getIn().setHeader(HbaseAttribute.HBASE_VALUE.asHeader(), body[0][0][0]);
2,094
exchange.getIn().setHeader(HbaseAttribute.HBASE_VALUE.asHeader(), body[0]); </BUG> Exchange resp = template.send(endpoint, exchange); Message out = resp.getOut(); <BUG>assertTrue(out.getHeaders().containsValue(body[0]) && !out.getHeaders().containsValue(body[1]) && !out.getHeaders().containsValue(body[2])); </BUG> } } @Override
putMultipleRows(); ProducerTemplate template = context.createProducerTemplate(); Endpoint endpoint = context.getEndpoint("direct:scan"); Exchange exchange = endpoint.createExchange(ExchangePattern.InOut); exchange.getIn().setHeader(HbaseAttribute.HBASE_FAMILY.asHeader(), family[0]); exchange.getIn().setHeader(HbaseAttribute.HBASE_QUALIFIER.asHeader(), column[0][0]); exchange.getIn().setHeader(HbaseAttribute.HBASE_VALUE.asHeader(), body[0][0][0]); assertTrue(out.getHeaders().containsValue(body[0][0][0]) && !out.getHeaders().containsValue(body[1][0][0]) && !out.getHeaders().containsValue(body[2][0][0]));
2,095
for (int childIndex = 1; childIndex <= childCount; childIndex++) { final A_Tuple child = object.slot(SUBTUPLE_AT_, childIndex); assert child.treeTupleLevel() == myLevelMinusOne; assert myLevelMinusOne == 0 <BUG>|| child.childCount() >= minWidthOfNonRoot; cumulativeSize += child.tupleSize(); assert object.intSlot(CUMULATIVE_SIZES_AREA_, childIndex)</BUG> == cumulativeSize; }
result.setIntSlot( CUMULATIVE_SIZES_AREA_, childIndex, result.intSlot(CUMULATIVE_SIZES_AREA_, childIndex) + delta);
2,096
final A_Tuple right, final int newLevel, final int newHashOrZero) { assert left.treeTupleLevel() == newLevel - 1; <BUG>assert right.treeTupleLevel() == newLevel - 1; final AvailObject newNode = createUninitializedTree(newLevel, 2);</BUG> newNode.setSlot(SUBTUPLE_AT_, 1, left); newNode.setSlot(SUBTUPLE_AT_, 2, right); newNode.setIntSlot(CUMULATIVE_SIZES_AREA_, 1, left.tupleSize());
assert left.tupleSize() > 0; assert right.tupleSize() > 0; final AvailObject newNode = createUninitializedTree(newLevel, 2);
2,097
void emitOn ( final InstructionGenerator generator, final A_Type phraseType) { generator.emit(this, NEW_LIST); <BUG>emitWithoutInitialNewListPushOn (generator, phraseType); }</BUG> @InnerAccess void emitWithoutInitialNewListPushOn ( final InstructionGenerator generator, final A_Type phraseType)
[DELETED]
2,098
usedOrdinalsList.add(e.explicitOrdinal()); } } final int size = usedOrdinalsList.size(); final Set<Integer> usedOrdinalsSet = <BUG>new HashSet<Integer>(usedOrdinalsList); final List<Integer> sortedOrdinalsList =</BUG> new ArrayList<>(usedOrdinalsList); Collections.sort(sortedOrdinalsList); if (usedOrdinalsSet.size() < usedOrdinalsList.size()
new HashSet<>(usedOrdinalsList); final List<Integer> sortedOrdinalsList =
2,099
beforeDagger.permutedArguments); final int permutationIndex = indexForPermutation(permutationTuple); generator.emit(this, PERMUTE_LIST, permutationIndex); } <BUG>assert expressionCounter == beforeDagger.arguments.size(); </BUG> } private void emitDoubleWrappedAfterDaggerOn ( final InstructionGenerator generator,
assert index == beforeDagger.arguments.size();
2,100
final Label $after = new Label(); generator.emit(this, BRANCH, $absent); generator.emit(this, SAVE_PARSE_POSITION); assert sequence.argumentsAreReordered != Boolean.TRUE; for (final Expression expression : sequence.expressions) <BUG>{ expression.emitOn( generator, null); //TODO MvG - FIGURE OUT the types.</BUG> }
expression.emitOn(generator, ListNodeTypeDescriptor.empty());