id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
14,901 | Term terme = new Term();
terme.setId_thesaurus(idTheso);
terme.setLang(langueEdit);
terme.setLexical_value(valueEdit);
terme.setId_term(idT);
<BUG>if (new TermHelper().isTermExist(connect.getPoolConnexion(),
</BUG>
terme.getLexical_value(),
terme.getId_thesaurus(), terme.getLang())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error4")));
| if (termHelper.isTermExist(connect.getPoolConnexion(),
|
14,902 | Term terme = new Term();
terme.setId_thesaurus(idTheso);
terme.setLang(langueEdit);
terme.setLexical_value(valueEdit);
terme.setId_term(idT);
<BUG>if (new TermHelper().isTermExist(connect.getPoolConnexion(),
</BUG>
terme.getLexical_value(),
terme.getId_thesaurus(), terme.getLang())) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, langueBean.getMsg("error") + " :", langueBean.getMsg("sTerme.error4")));
| if (termHelper.isTermExist(connect.getPoolConnexion(),
|
14,903 | langues = new ArrayList<>();
HashMap<String, String> tempMapL = new HashMap<>();
for (NodeTermTraduction ntt : tempNTT) {
tempMapL.put(ntt.getLang(), ntt.getLexicalValue());
}
<BUG>langues.addAll(tempMapL.entrySet());
}</BUG>
langueEdit = "";
valueEdit = "";
if (!tradExist) {
| if(newTraduction) {
nom = termHelper.getThisTerm(connect.getPoolConnexion(),idC, idTheso, idlangue).getLexical_value();
|
14,904 | if (n.getTitle().trim().isEmpty()) {
dynamicTreeNode = (TreeNode) new MyTreeNode(1, n.getIdConcept(), idTheso, idlangue, "", "", "dossier", n.getIdConcept(), root);
} else {
dynamicTreeNode = (TreeNode) new MyTreeNode(1, n.getIdConcept(), idTheso, idlangue, "", "", "dossier", n.getTitle(), root);
}
<BUG>new DefaultTreeNode("fake", dynamicTreeNode);
}</BUG>
}
public void onNodeExpand(NodeExpandEvent event) {
String theso = ((MyTreeNode) event.getTreeNode()).getIdTheso();
| DefaultTreeNode defaultTreeNode = new DefaultTreeNode("fake", dynamicTreeNode);
defaultTreeNode.setExpanded(true);
|
14,905 | SKOSXmlDocument sxd = new ReadFileSKOS().readStringBuffer(sb);
for (SKOSResource resource : sxd.getResourcesList()) {
NodeAlignment na = new NodeAlignment();
na.setInternal_id_concept(idC);
na.setInternal_id_thesaurus(idTheso);
<BUG>na.setThesaurus_target("OpenTheso");
</BUG>
na.setUri_target(resource.getUri());
for(SKOSLabel label : resource.getLabelsList()) {
switch (label.getProperty()) {
| na.setThesaurus_target("Pactols");
|
14,906 | return locale.getLanguage();
}
}));
}
};
<BUG>private static final Key<String> LAST_CALCULATION_FILE_NAME = Key.create("PROPERTIES_FILE_LAST_CALCULATION_FILE_NAME");
private static final Key<String> BASE_NAME = Key.create("PROPERTIES_FILE_BASE_NAME");</BUG>
@Deprecated
public static boolean isPropertyComplete(final Project project, final ResourceBundle resourceBundle, final String propertyName) {
return isPropertyComplete(resourceBundle, propertyName);
| [DELETED] |
14,907 | final Matcher matcher = LOCALE_PATTERN.matcher(name);
final String baseNameWithExtension;
int matchIndex = 0;
while (matcher.find(matchIndex)) {
final MatchResult matchResult = matcher.toMatchResult();
<BUG>final String[] split = matchResult.group(1).split("_");
if (split.length > 1) {
final String langCode = split[1];
</BUG>
if (!LOCALES_LANGUAGE_CODES.getValue().contains(langCode)) {
| final String[] splitted = matchResult.group(1).split("_");
if (splitted.length > 1) {
final String langCode = splitted[1];
|
14,908 | baseNameWithExtension = name.substring(0, matchResult.start(1)) + name.substring(matchResult.end(1));
return FileUtil.getNameWithoutExtension(baseNameWithExtension);
}
}
baseNameWithExtension = name;
<BUG>calculatedBaseName = FileUtil.getNameWithoutExtension(baseNameWithExtension);
}
file.putUserData(LAST_CALCULATION_FILE_NAME, name);
file.putUserData(BASE_NAME, calculatedBaseName);
return calculatedBaseName;</BUG>
}
| [DELETED] |
14,909 | import java.io.InputStream;
import java.net.URL;
import static org.assertj.core.api.Assertions.assertThat;
public class TomcatWebServerTest {
@Test
<BUG>public void shouldBootWebServer() throws Exception {
try(WeldContainer weldContainer = new Weld().disableDiscovery()</BUG>
.extensions(new ConfigurationExtension())
.beanClasses(TomcatWebServer.class, DefaultServlet.class, MessageProvider.class,
WebServerConfiguration.class, DefaultConfigPropertyProducer.class)
| SSLBypass.disableSSLChecks();
try(WeldContainer weldContainer = new Weld().disableDiscovery()
|
14,910 | tomcat.start();
try(InputStream stream = new URL("http://localhost:8080/").openStream()) {
String data = IOUtils.toString(stream).trim();
assertThat(data).isEqualTo(MessageProvider.DATA);
}
<BUG>try(InputStream stream = new URL("http://localhost:8080/rest").openStream()) {
</BUG>
String data = IOUtils.toString(stream).trim();
assertThat(data).isEqualTo("Hello, world!");
}
| try(InputStream stream = new URL("https://localhost:8443/rest").openStream()) {
|
14,911 | import java.io.InputStream;
import java.net.URL;
import static org.assertj.core.api.Assertions.assertThat;
public class JettyBootTest {
@Test
<BUG>public void shouldBootWebServer() throws Exception {
try(WeldContainer weldContainer = new Weld().disableDiscovery()</BUG>
.extensions(new ConfigurationExtension())
.beanClasses(JettyWebServer.class, DefaultServlet.class, MessageProvider.class,
WebServerConfiguration.class, DefaultConfigPropertyProducer.class)
| SSLBypass.disableSSLChecks();
try(WeldContainer weldContainer = new Weld().disableDiscovery()
|
14,912 | webServer.start();
try(InputStream stream = new URL("http://localhost:8080/").openStream()) {
String data = IOUtils.toString(stream).trim();
assertThat(data).isEqualTo(MessageProvider.DATA);
}
<BUG>try(InputStream stream = new URL("http://localhost:8080/").openStream()) {
</BUG>
String data = IOUtils.toString(stream).trim();
assertThat(data).isEqualTo(MessageProvider.DATA);
}
| try(InputStream stream = new URL("https://localhost:8443/").openStream()) {
|
14,913 | }
public String getAddress() {
return address;
}
public boolean isSecuredConfigured(){
<BUG>return securedPort != 0 && keystorePath != null && truststorePassword != null;
}</BUG>
public int getSecuredPort(){
return securedPort;
}
| public int getPort() {
return port;
return securedPort != 0;
|
14,914 | package org.sonar.batch.scan.filesystem;
import com.google.common.collect.ImmutableSet;
import org.apache.commons.io.FileUtils;
<BUG>import org.apache.commons.lang.StringUtils;
import org.picocontainer.injectors.ProviderAdapter;</BUG>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.CoreProperties;
| import org.jfree.util.Log;
import org.picocontainer.injectors.ProviderAdapter;
|
14,915 | builder.sourceCharset(guessCharset(settings));
builder.workingDir(guessWorkingDir(module, tempDirectories));
initBinaryDirs(module, pathResolver, builder);
initSources(module, pathResolver, builder);
initTests(module, pathResolver, builder);
<BUG>initPluginFilters(builder, pluginFileFilters);
initSourceInclusions(builder, settings);
initTestInclusions(builder, settings);</BUG>
singleton = builder.build();
| initCustomFilters(builder, pluginFileFilters);
|
14,916 | charset = Charset.defaultCharset();
LOG.warn("Source encoding is platform dependent (" + charset.displayName() + "), default locale: " + Locale.getDefault());
}
return charset;
}
<BUG>private void initSources(ProjectDefinition module, PathResolver pathResolver, DefaultModuleFileSystem.Builder builder) {
for (String sourcePath : module.getSourceDirs()) {
builder.addSourceDir(pathResolver.relativeFile(module.getBaseDir(), sourcePath));
}</BUG>
List<File> sourceFiles = pathResolver.relativeFiles(module.getBaseDir(), module.getSourceFiles());
| if (!module.getSourceDirs().isEmpty()) {
LOG.info("Source dirs: ");
File dir = pathResolver.relativeFile(module.getBaseDir(), sourcePath);
LOG.info(" " + dir.getAbsolutePath());
builder.addSourceDir(dir);
|
14,917 | System.out.println("<out mov> <n frames>");
return;
}
int width = 640;
int height = 480;
<BUG>Picture pic = Picture.create(width, height, ColorSpace.YUV422_10);
Arrays.fill(pic.getPlaneData(1), 512);
Arrays.fill(pic.getPlaneData(2), 512);</BUG>
drawGrad(pic.getPlaneData(0), new Size(pic.getWidth(), pic.getHeight()));
| Picture8Bit pic = Picture8Bit.create(width, height, ColorSpace.YUV422);
|
14,918 | Arrays.fill(pic.getPlaneData(2), 512);</BUG>
drawGrad(pic.getPlaneData(0), new Size(pic.getWidth(), pic.getHeight()));
V210Encoder encoder = new V210Encoder();
MP4Muxer muxer = MP4Muxer.createMP4MuxerToChannel(writableChannel(new File(args[0])));
ByteBuffer out = ByteBuffer.allocate(width * height * 10);
<BUG>ByteBuffer frame = encoder.encodeFrame(out, pic);
</BUG>
FramesMP4MuxerTrack videoTrack = muxer.addVideoTrack("v210", new Size(width, height), "jcodec", 24000);
for (int i = 0; i < Integer.parseInt(args[1]); i++) {
videoTrack.addFrame(MP4Packet.createMP4Packet(frame, i * 1001, 24000, 1001, i, true, null, 0, i * 1001, 0));
| System.out.println("<out mov> <n frames>");
return;
}
int width = 640;
int height = 480;
Picture8Bit pic = Picture8Bit.create(width, height, ColorSpace.YUV422);
ByteBuffer frame = encoder.encodeFrame8Bit(out, pic);
|
14,919 | readDCCoeffs(bits, qMat, out, blocksPerSlice, 4);
readACCoeffs(bits, qMat, out, blocksPerSlice, scan, 4, 2);
for (int i = 0; i < blocksPerSlice; i++) {
IDCT2x2.idct(out, i << 2);
}
<BUG>}
public Picture8Bit decodeFrame8Bit(ByteBuffer data, byte[][] target) {</BUG>
FrameHeader fh = readFrameHeader(data);
int codedWidth = ((fh.width + 15) & ~0xf) >> 2;
int codedHeight = ((fh.height + 15) & ~0xf) >> 2;
| @Override
public Picture8Bit decodeFrame8Bit(ByteBuffer data, byte[][] target) {
|
14,920 |
cr.put(i & 0x3ff);
</BUG>
i = dat.get();
<BUG>y.put(i & 0x3ff);
y.put(i >> 20);
cr.put((i >> 10) & 0x3ff);
</BUG>
}
| package org.jcodec.codecs.raw;
import static java.nio.ByteOrder.LITTLE_ENDIAN;
import static org.jcodec.common.model.ColorSpace.YUV422;
import org.jcodec.common.model.Picture8Bit;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
public class V210Decoder {
private int width;
private int height;
public V210Decoder(int width, int height) {
this.width = width;
this.height = height;
|
14,921 | String execute(OneLineText oneLineString);
}
public MultiLineText()
{
super();
<BUG>setPadding(2,8);
</BUG>
}
public MultiLineText(Converter converter)
{
| setPadding(7,8);
|
14,922 | </BUG>
}
public MultiLineText(Converter converter)
{
super(converter);
<BUG>setPadding(1,8);
</BUG>
}
protected MultiLineText(MultiLineText lineText) throws CloneNotSupportedException
{
| String execute(OneLineText oneLineString);
public MultiLineText()
super();
setPadding(7,8);
setPadding(6,8);
|
14,923 | import com.liferay.portal.kernel.dao.orm.Projection;
import com.liferay.portal.kernel.dao.orm.ProjectionFactoryUtil;
import com.liferay.portal.kernel.dao.orm.ProjectionList;</BUG>
import com.liferay.portal.kernel.dao.orm.Property;
<BUG>import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
import com.liferay.portal.kernel.search.BaseIndexer;</BUG>
import com.liferay.portal.kernel.search.BooleanClauseOccur;
import com.liferay.portal.kernel.search.BooleanQuery;
import com.liferay.portal.kernel.search.BooleanQueryFactoryUtil;
import com.liferay.portal.kernel.search.Document;
| package com.liferay.portlet.bookmarks.util;
import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
import com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.search.BaseIndexer;
|
14,924 | import com.liferay.portal.kernel.search.SearchEngineUtil;
import com.liferay.portal.kernel.search.Summary;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.model.Group;
import com.liferay.portal.security.pacl.PACLClassLoaderUtil;
<BUG>import com.liferay.portal.service.GroupLocalServiceUtil;
import com.liferay.portal.util.PortletKeys;</BUG>
import com.liferay.portlet.bookmarks.model.BookmarksEntry;
import com.liferay.portlet.bookmarks.model.BookmarksFolder;
import com.liferay.portlet.bookmarks.model.BookmarksFolderConstants;
| import com.liferay.portal.service.persistence.GroupActionableDynamicQuery;
import com.liferay.portal.util.PortletKeys;
|
14,925 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
14,926 | final int lineStride = dst.getScanlineStride();
final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final byte[][] data = dst.getByteDataArrays();
final float[] warpData = new float[2 * dstWidth];
<BUG>int lineOffset = 0;
if (ctable == null) { // source does not have IndexColorModel
if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
14,927 | pixelOffset += pixelStride;
} // COLS LOOP
} // ROWS LOOP
}
} else {// source has IndexColorModel
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| } else if (caseB) {
for (int h = 0; h < dstHeight; h++) {
|
14,928 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
14,929 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
14,930 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
14,931 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
14,932 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
14,933 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final int[][] data = dst.getIntDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
14,934 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
14,935 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final float[][] data = dst.getFloatDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
14,936 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
14,937 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final double[][] data = dst.getDoubleDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
14,938 | </BUG>
return 0;
}
@Override
<BUG>public LuaValue arg1() {
</BUG>
return NIL;
}
@Override
public String tojstring() {
| public LuaValue arg(int i) {
public int count() {
public LuaValue first() {
|
14,939 | default:
b = i >>> 23;
c = (i >> 14) & 0x1ff;
v = b > 0 ?
ValueFactory.varargsOf(stack, a + 1, b - 1) : // exact arg count
<BUG>ValueFactory.varargsOf(stack, a + 1, top - v.narg() - (a + 1), v); // from prev top
</BUG>
v = stack[a].invoke(state, v);
if (c > 0) {
while (--c > 0) {
| ValueFactory.varargsOf(stack, a + 1, top - v.count() - (a + 1), v); // from prev top
|
14,940 | while (--c > 0) {
stack[a + c - 1] = v.arg(c);
}
v = Constants.NONE; // TODO: necessary?
} else {
<BUG>top = a + v.narg();
</BUG>
}
continue;
}
| top = a + v.count();
|
14,941 | return new TailcallVarargs(stack[a], ValueFactory.varargsOf(stack[a + 1], stack[a + 2], stack[a + 3]));
default:
b = i >>> 23;
v = b > 0 ?
ValueFactory.varargsOf(stack, a + 1, b - 1) : // exact arg count
<BUG>ValueFactory.varargsOf(stack, a + 1, top - v.narg() - (a + 1), v); // from prev top
</BUG>
return new TailcallVarargs(stack[a], v);
}
b = i >>> 23;
| ValueFactory.varargsOf(stack, a + 1, top - v.count() - (a + 1), v); // from prev top
|
14,942 | return new TailcallVarargs(stack[a], v);
}
b = i >>> 23;
switch (b) {
case 0:
<BUG>return ValueFactory.varargsOf(stack, a, top - v.narg() - a, v);
</BUG>
case 1:
return Constants.NONE;
case 2:
| return ValueFactory.varargsOf(stack, a, top - v.count() - a, v);
|
14,943 | pc += (i >>> 14) - 0x1ffff;
}
}
continue;
case Lua.OP_FORPREP: /* A sBx R(A)-=R(A+2): pc+=sBx */ {
<BUG>LuaValue init = stack[a].checknumber("'for' initial value must be a number");
LuaValue limit = stack[a + 1].checknumber("'for' limit must be a number");
LuaValue step = stack[a + 2].checknumber("'for' step must be a number");
</BUG>
stack[a] = OperationHelper.sub(state, init, step);
| LuaValue init = stack[a].checkNumber("'for' initial value must be a number");
LuaValue limit = stack[a + 1].checkNumber("'for' limit must be a number");
LuaValue step = stack[a + 2].checkNumber("'for' step must be a number");
|
14,944 | stack[a] = newcl;
}
continue;
b = i >>> 23;
if (b == 0) {
<BUG>top = a + (b = varargs.narg());
</BUG>
v = varargs;
} else {
for (int j = 1; j < b; ++j) {
| top = a + (b = varargs.count());
|
14,945 | 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 {
|
14,946 | 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));
|
14,947 | } 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()
|
14,948 |
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));
|
14,949 | 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));
|
14,950 | 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 {
|
14,951 | 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);
|
14,952 | package org.osgl.inject;
<BUG>import org.osgl.$;
import org.osgl.inject.annotation.Provides;</BUG>
import org.osgl.inject.annotation.RequestScoped;
import org.osgl.inject.annotation.SessionScoped;
import org.osgl.inject.provider.*;
| import org.osgl.exception.UnexpectedException;
import org.osgl.inject.annotation.PostConstructProcess;
import org.osgl.inject.annotation.Provides;
|
14,953 | import org.osgl.inject.annotation.SessionScoped;
import org.osgl.inject.provider.*;
import org.osgl.inject.util.AnnotationUtil;
import org.osgl.logging.LogManager;
import org.osgl.logging.Logger;
<BUG>import org.osgl.util.C;
import org.osgl.util.S;</BUG>
import javax.inject.Inject;
import javax.inject.Provider;
import javax.inject.Scope;
| import org.osgl.util.E;
import org.osgl.util.S;
|
14,954 | import java.lang.annotation.Annotation;
import java.lang.reflect.*;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
<BUG>public final class Genie {
static final Logger logger = LogManager.get(Genie.class);</BUG>
private static final ThreadLocal<Integer> AFFINITY = new ThreadLocal<Integer>();
public static class Binder<T> {
private Class<T> type;
| public final class Genie implements Injector {
static final Logger logger = LogManager.get(Genie.class);
|
14,955 | this.realProvider = realProvider;
}</BUG>
@Override
public T get() {
T t = realProvider.get();
<BUG>for (PostConstructProcessor<T> processor : processores) {
processor.apply(t);
}</BUG>
return t;
| this.processors = processors;
}
for ($.T2<Annotation, PostConstructProcessor<T>> pair : processors) {
pair._2.process(t, pair._1);
|
14,956 | Set<Annotation> loaders() {
return elementLoaders;
}
Set<Annotation> filters() {
return filters;
<BUG>}
Annotation valueLoader() {</BUG>
return valueLoader;
}
boolean isValueLoad() {
| Set<Annotation> postProcessors() {
return postProcessors;
Annotation valueLoader() {
|
14,957 | return;
}
Class<?> rawType = rawType();
boolean isMap = Map.class.isAssignableFrom(rawType);
boolean isContainer = Collection.class.isAssignableFrom(rawType) || isMap;
<BUG>MapKey mapKey = null;
for (Annotation anno : aa) {
Class cls = anno.annotationType();
</BUG>
if (Inject.class == cls || Provides.class == cls) {
| List<Annotation> loadValueIncompatibles = new ArrayList<Annotation>();
Class<? extends Annotation> cls = anno.annotationType();
|
14,958 | if (cls.isAnnotationPresent(LoadValue.class)) {
valueLoader = anno;
} else if (cls.isAnnotationPresent(LoadCollection.class)) {
if (isContainer) {
elementLoaders.add(anno);
<BUG>annotations.add(anno);
} else {</BUG>
Genie.logger.warn("LoadCollection annotation[%s] ignored as target type is neither Collection nor Map", cls.getSimpleName());
}
} else if (cls.isAnnotationPresent(Qualifier.class)) {
| loadValueIncompatibles.add(anno);
} else {
|
14,959 | 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;
|
14,960 | 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;
|
14,961 | 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"),
|
14,962 | 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] |
14,963 | 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) {
|
14,964 | 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;
|
14,965 | "gekostet",
"kosten"
};
AnalysisService analysisService = AnalyzerTestUtils.createAnalysisService();
TokenFilterFactory tokenFilter = analysisService.tokenFilter("baseform");
<BUG>Tokenizer tokenizer = analysisService.tokenizer("standard").create(new StringReader(source));
assertSimpleTSOutput(tokenFilter.create(tokenizer), expected);</BUG>
}
@Test
public void testTwo() throws IOException {
| Tokenizer tokenizer = analysisService.tokenizer("standard").create();
tokenizer.setReader(new StringReader(source));
assertSimpleTSOutput(tokenFilter.create(tokenizer), expected);
|
14,966 | "transportieren",
"transportieren"
};
AnalysisService analysisService = AnalyzerTestUtils.createAnalysisService();
TokenFilterFactory tokenFilter = analysisService.tokenFilter("baseform");
<BUG>Tokenizer tokenizer = analysisService.tokenizer("standard").create(new StringReader(source));
assertSimpleTSOutput(tokenFilter.create(tokenizer), expected);</BUG>
}
@Test
public void testThree() throws IOException {
| Tokenizer tokenizer = analysisService.tokenizer("standard").create();
tokenizer.setReader(new StringReader(source));
assertSimpleTSOutput(tokenFilter.create(tokenizer), expected);
|
14,967 | "gemacht",
"machen"
};
AnalysisService analysisService = AnalyzerTestUtils.createAnalysisService();
TokenFilterFactory tokenFilter = analysisService.tokenFilter("baseform");
<BUG>Tokenizer tokenizer = analysisService.tokenizer("standard").create(new StringReader(source));
assertSimpleTSOutput(tokenFilter.create(tokenizer), expected);</BUG>
}
private void assertSimpleTSOutput(TokenStream stream, String[] expected) throws IOException {
stream.reset();
| Tokenizer tokenizer = analysisService.tokenizer("standard").create();
tokenizer.setReader(new StringReader(source));
assertSimpleTSOutput(tokenFilter.create(tokenizer), expected);
|
14,968 | null, null, null, null, false);
}
@Test
public void testOffsetChange() throws Exception {
AnalysisService analysisService = AnalyzerTestUtils.createAnalysisService("/org/xbib/elasticsearch/index/analysis/worddelimiter/worddelimiter.json");
<BUG>Tokenizer tokenizer = analysisService.tokenizer("keyword").create(new StringReader("übelkeit"));
TokenStream ts = analysisService.tokenFilter("wd").create(tokenizer);</BUG>
assertTokenStreamContents(ts,
new String[]{"übelkeit" },
new int[]{0},
| Tokenizer tokenizer = analysisService.tokenizer("keyword").create();
tokenizer.setReader(new StringReader("übelkeit"));
TokenStream ts = analysisService.tokenFilter("wd").create(tokenizer);
|
14,969 | new int[]{0},
new int[]{8});
}
public void doSplit(final String input, String... output) throws Exception {
int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
<BUG>WordDelimiterFilter2 wdf = new WordDelimiterFilter2(new MockTokenizer(
new StringReader(input), MockTokenizer.KEYWORD, false), WordDelimiterIterator.DEFAULT_WORD_DELIM_TABLE, flags, null);
assertTokenStreamContents(wdf, output);</BUG>
}
@Test
| Tokenizer tokenizer = new MockTokenizer(MockTokenizer.KEYWORD, false);
tokenizer.setReader(new StringReader(input));
WordDelimiterFilter2 wdf = new WordDelimiterFilter2(tokenizer, WordDelimiterIterator.DEFAULT_WORD_DELIM_TABLE, flags, null);
assertTokenStreamContents(wdf, output);
|
14,970 | new int[]{1, 1, 1, 1, 0},
null,
false);
Analyzer a2 = new Analyzer() {
@Override
<BUG>public TokenStreamComponents createComponents(String field, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
return new TokenStreamComponents(tokenizer, new WordDelimiterFilter2(</BUG>
new LargePosIncTokenFilter(tokenizer),
flags, protWords));
| public TokenStreamComponents createComponents(String field) {
Tokenizer tokenizer = new MockTokenizer(MockTokenizer.WHITESPACE, false);
return new TokenStreamComponents(tokenizer, new WordDelimiterFilter2(
|
14,971 | new int[]{1, 11, 1},
null,
false);
Analyzer a3 = new Analyzer() {
@Override
<BUG>public TokenStreamComponents createComponents(String field, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
StopFilter filter = new StopFilter(TEST_VERSION_CURRENT,
tokenizer, StandardAnalyzer.STOP_WORDS_SET);</BUG>
return new TokenStreamComponents(tokenizer, new WordDelimiterFilter2(filter, flags, protWords));
| public TokenStreamComponents createComponents(String field) {
Tokenizer tokenizer = new MockTokenizer(MockTokenizer.WHITESPACE, false);
StopFilter filter = new StopFilter(tokenizer, StandardAnalyzer.STOP_WORDS_SET);
|
14,972 | new int[]{1, 0, 0, 0, 0},
null,
false);
Analyzer a2 = new Analyzer() {
@Override
<BUG>public TokenStreamComponents createComponents(String field, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
return new TokenStreamComponents(tokenizer, new WordDelimiterFilter2(</BUG>
new LargePosIncTokenFilter(tokenizer),
flags, protWords));
| public TokenStreamComponents createComponents(String field) {
Tokenizer tokenizer = new MockTokenizer(MockTokenizer.WHITESPACE, false);
return new TokenStreamComponents(tokenizer, new WordDelimiterFilter2(
|
14,973 | new int[]{6, 14, 19},
null,
new int[]{1, 11, 1});
Analyzer a3 = new Analyzer() {
@Override
<BUG>public TokenStreamComponents createComponents(String field, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
StopFilter filter = new StopFilter(TEST_VERSION_CURRENT,
tokenizer, StandardAnalyzer.STOP_WORDS_SET);</BUG>
return new TokenStreamComponents(tokenizer, new WordDelimiterFilter2(filter, flags, protWords));
| public TokenStreamComponents createComponents(String field) {
Tokenizer tokenizer = new MockTokenizer(MockTokenizer.WHITESPACE, false);
StopFilter filter = new StopFilter(tokenizer, StandardAnalyzer.STOP_WORDS_SET);
|
14,974 | "wir",
"zum",
"Ende"
};
AnalysisService analysisService = AnalyzerTestUtils.createAnalysisService("/org/xbib/elasticsearch/index/analysis/icu/icu_tokenizer.json");
<BUG>Tokenizer tokenizer = analysisService.tokenizer("my_hyphen_icu_tokenizer").create(new StringReader(source));
assertSimpleTSOutput(tokenizer, expected);</BUG>
}
@Test
public void testIdentifierNonBreak() throws IOException {
| Tokenizer tokenizer = analysisService.tokenizer("my_hyphen_icu_tokenizer").create();
tokenizer.setReader(new StringReader(source));
assertSimpleTSOutput(tokenizer, expected);
|
14,975 | String[] expected = {
"ISBN",
"3-428-84350-9"
};
AnalysisService analysisService = AnalyzerTestUtils.createAnalysisService("/org/xbib/elasticsearch/index/analysis/icu/icu_tokenizer.json");
<BUG>Tokenizer tokenizer = analysisService.tokenizer("my_hyphen_icu_tokenizer").create(new StringReader(source));
assertSimpleTSOutput(tokenizer, expected);</BUG>
}
@Test
public void testIdentifierNonBreakSingleToken() throws IOException {
| Tokenizer tokenizer = analysisService.tokenizer("my_hyphen_icu_tokenizer").create();
tokenizer.setReader(new StringReader(source));
assertSimpleTSOutput(tokenizer, expected);
|
14,976 | String source = "3-428-84350-9";
String[] expected = {
"3-428-84350-9"
};
AnalysisService analysisService = AnalyzerTestUtils.createAnalysisService("/org/xbib/elasticsearch/index/analysis/icu/icu_tokenizer.json");
<BUG>Tokenizer tokenizer = analysisService.tokenizer("my_hyphen_icu_tokenizer").create(new StringReader(source));
}</BUG>
private void assertSimpleTSOutput(TokenStream stream, String[] expected) throws IOException {
stream.reset();
CharTermAttribute termAttr = stream.getAttribute(CharTermAttribute.class);
| Tokenizer tokenizer = analysisService.tokenizer("my_hyphen_icu_tokenizer").create();
tokenizer.setReader(new StringReader(source));
}
|
14,977 | "gekostet",
"gekosten"
};
AnalysisService analysisService = AnalyzerTestUtils.createAnalysisService("/org/xbib/elasticsearch/index/analysis/decompound/decompound_analysis.json");
TokenFilterFactory tokenFilter = analysisService.tokenFilter("decomp");
<BUG>Tokenizer tokenizer = analysisService.tokenizer("standard").create(new StringReader(source));
assertSimpleTSOutput(tokenFilter.create(tokenizer), expected);</BUG>
}
private void assertSimpleTSOutput(TokenStream stream, String[] expected) throws IOException {
stream.reset();
| Tokenizer tokenizer = analysisService.tokenizer("standard").create();
tokenizer.setReader(new StringReader(source));
assertSimpleTSOutput(tokenFilter.create(tokenizer), expected);
|
14,978 | src.append(" {\n\n");
if (!Direction.None.equals(getProperty(permissionPropagation))) {
src.append("\tstatic {\n\t\tSchemaRelationshipNode.registerPropagatingRelationshipType(\"").append(getRelationshipType()).append("\");\n\t}\n\n");
}
src.append(SchemaHelper.extractProperties(this, propertyNames, validators, enums, viewProperties, errorBuffer));
<BUG>src.append(SchemaHelper.extractViews(this, viewProperties, errorBuffer));
src.append(SchemaHelper.extractMethods(this, actions));
src.append("\tpublic static final Property<java.lang.String> sourceIdProperty = new SourceId(\"sourceId\");\n");</BUG>
src.append("\tpublic static final Property<java.lang.String> targetIdProperty = new TargetId(\"targetId\");\n");
SchemaHelper.addPropertyToView(PropertyView.Ui, "sourceId", viewProperties);
| SchemaHelper.extractViews(this, viewProperties, errorBuffer);
SchemaHelper.extractMethods(this, actions);
src.append("\tpublic static final Property<java.lang.String> sourceIdProperty = new SourceId(\"sourceId\");\n");
|
14,979 | final String propertyName = inRel.getPropertyName(_className, existingPropertyNames, false);
src.append(inRel.getPropertySource(propertyName, false));
addPropertyNameToViews(propertyName, viewProperties);
}
src.append(SchemaHelper.extractProperties(this, propertyNames, validators, enums, viewProperties, errorBuffer));
<BUG>src.append(SchemaHelper.extractViews(this, viewProperties, errorBuffer));
src.append(SchemaHelper.extractMethods(this, saveActions));
for (final String enumDefition : enums) {</BUG>
src.append(enumDefition);
}
| SchemaHelper.extractViews(this, viewProperties, errorBuffer);
SchemaHelper.extractMethods(this, saveActions);
for (final String enumDefition : enums) {
|
14,980 | final Set<Validator> validators = new LinkedHashSet<>();
final Set<String> enums = new LinkedHashSet<>();
final String _className = getProperty(name);
final ErrorBuffer dummyErrorBuffer = new ErrorBuffer();
final String propertyDefinitions = SchemaHelper.extractProperties(this, propertyNames, validators, enums, viewProperties, dummyErrorBuffer);
<BUG>final String viewDefinitions = SchemaHelper.extractViews(this, viewProperties, dummyErrorBuffer);
final String methodDefinitions = SchemaHelper.extractMethods(this, saveActions);
if (!propertyNames.isEmpty() || !viewProperties.isEmpty() || validators.isEmpty() || !saveActions.isEmpty()) {</BUG>
final StringBuilder src = new StringBuilder();
src.append("package org.structr.dynamic;\n\n");
| if (!propertyNames.isEmpty() || !viewProperties.isEmpty() || validators.isEmpty() || !saveActions.isEmpty()) {
|
14,981 | src.append("\n");
}
if (!propertyNames.isEmpty()) {
src.append("\n");
src.append(propertyDefinitions);
<BUG>src.append(viewDefinitions);
src.append(methodDefinitions);</BUG>
src.append("\n\tstatic {\n\n");
for (final String name : propertyNames) {
final String propertyName = name + "Property";
| [DELETED] |
14,982 | import com.facebook.ads.AdSize;
import com.facebook.ads.AdView;
public class FacebookBanner implements MediatedBannerAdView {
private AdView adView;
@Override
<BUG>public void requestAd(MediatedBannerAdViewController mBC, Activity activity, String parameter, String uid, int width, int height, TargetingParameters tp) {
</BUG>
FacebookListener fbListener = new FacebookListener(mBC, this.getClass().getSimpleName());
adView = new AdView(activity, uid, AdSize.BANNER_320_50);
if (width != AdSize.BANNER_320_50.getWidth() || height != AdSize.BANNER_320_50.getHeight()) {
| public View requestAd(MediatedBannerAdViewController mBC, Activity activity, String parameter, String uid, int width, int height, TargetingParameters tp) {
|
14,983 | adView = new AdView(activity, uid, AdSize.BANNER_320_50);
if (width != AdSize.BANNER_320_50.getWidth() || height != AdSize.BANNER_320_50.getHeight()) {
Clog.d(Clog.mediationLogTag, "Facebook - Attempted to instantiate with size other than the allowed size of 320x50. Instantiating with allowed size.");
}
adView.setAdListener(fbListener);
<BUG>mBC.setView(adView);
adView.loadAd();
}</BUG>
@Override
public void destroy() {
| return adView;
|
14,984 | import com.appnexus.opensdk.TargetingParameters;
public class AmazonBanner implements MediatedBannerAdView {
AmazonListener amazonListener = null;
AdLayout adView = null;
@Override
<BUG>public void requestAd(MediatedBannerAdViewController mBC, Activity activity, String parameter, String uid, int width, int height, TargetingParameters tp) {
</BUG>
adView = new AdLayout(activity, new AdSize(width, height));
this.amazonListener = new AmazonListener(mBC, AmazonBanner.class.getSimpleName());
adView.setListener(this.amazonListener);
| public View requestAd(MediatedBannerAdViewController mBC, Activity activity, String parameter, String uid, int width, int height, TargetingParameters tp) {
|
14,985 | public ReportElement getBase() {
return base;
}
@Override
public float print(PDDocument document, PDPageContentStream stream, int pageNumber, float startX, float startY, float allowedWidth) throws IOException {
<BUG>PDPage currPage = (PDPage) document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, true, false);
</BUG>
base.print(document, pageStream, pageNo, x, y, width);
pageStream.close();
| PDPage currPage = document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, PDPageContentStream.AppendMode.APPEND, false);
|
14,986 | public PdfTextStyle(String config) {
Assert.hasText(config);
String[] split = config.split(",");
Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000");
fontSize = Integer.parseInt(split[0]);
<BUG>font = resolveStandard14Name(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));</BUG>
}
public int getFontSize() {
return fontSize;
| font = getFont(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));
|
14,987 | package cc.catalysts.boot.report.pdf.elements;
import cc.catalysts.boot.report.pdf.config.PdfTextStyle;
import cc.catalysts.boot.report.pdf.utils.ReportAlignType;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
<BUG>import org.apache.pdfbox.pdmodel.font.PDFont;
import org.slf4j.Logger;</BUG>
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
import java.io.IOException;
| import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.apache.pdfbox.util.Matrix;
import org.slf4j.Logger;
|
14,988 | addTextSimple(stream, textConfig, textX, nextLineY, "");
return nextLineY;
}
try {
<BUG>String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, fixedText);
</BUG>
float x = calculateAlignPosition(textX, align, textConfig, allowedWidth, split[0]);
if (!underline) {
addTextSimple(stream, textConfig, x, nextLineY, split[0]);
} else {
| String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, text);
|
14,989 | public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
try {
stream.setFont(textConfig.getFont(), textConfig.getFontSize());
stream.setNonStrokingColor(textConfig.getColor());
stream.beginText();
<BUG>stream.newLineAtOffset(textX, textY);
stream.showText(text);</BUG>
} catch (Exception e) {
LOG.warn("Could not add text: " + e.getClass() + " - " + e.getMessage());
}
| stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY));
stream.showText(text);
|
14,990 | public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
addTextSimple(stream, textConfig, textX, textY, text);
try {
float lineOffset = textConfig.getFontSize() / 8F;
stream.setStrokingColor(textConfig.getColor());
<BUG>stream.setLineWidth(0.5F);
stream.drawLine(textX, textY - lineOffset, textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
</BUG>
stream.stroke();
} catch (IOException e) {
| stream.moveTo(textX, textY - lineOffset);
stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
|
14,991 | list.add(text.length());
return list;
}
public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) {
String endPart = "";
<BUG>String shortenedText = text;
List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {</BUG>
String[] splittedFirst = splitText(font, fontSize, allowedWidth, breakSplitted.get(0));
StringBuilder remaining = new StringBuilder(splittedFirst[1] == null ? "" : splittedFirst[1] + "\n");
| List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {
|
14,992 | package cc.catalysts.boot.report.pdf.elements;
import org.apache.pdfbox.pdmodel.PDDocument;
<BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
import java.io.IOException;</BUG>
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
| import org.apache.pdfbox.pdmodel.PDPageContentStream;
import java.io.IOException;
|
14,993 | import edu.kit.joana.ifc.sdg.util.BytecodeLocation;
import edu.kit.joana.ifc.sdg.util.JavaMethodSignature;
import edu.kit.joana.ifc.sdg.util.JavaType;
import edu.kit.joana.ifc.sdg.util.JavaType.Format;
import edu.kit.joana.util.Log;
<BUG>import edu.kit.joana.util.Logger;
import edu.kit.joana.util.Stubs;</BUG>
import edu.kit.joana.util.io.IOFactory;
import edu.kit.joana.wala.core.NullProgressMonitor;
import edu.kit.joana.wala.core.SDGBuilder;
| import edu.kit.joana.util.Pair;
import edu.kit.joana.util.Stubs;
|
14,994 | import edu.kit.joana.util.io.IOFactory;
import edu.kit.joana.wala.core.NullProgressMonitor;
import edu.kit.joana.wala.core.SDGBuilder;
import edu.kit.joana.wala.summary.SummaryComputation;
import edu.kit.joana.wala.summary.WorkPackage;
<BUG>import edu.kit.joana.wala.summary.WorkPackage.EntryPoint;
import gnu.trove.set.TIntSet;</BUG>
import gnu.trove.set.hash.TIntHashSet;
public class SDGProgram {
public static class ClassLoader {
| import edu.kit.joana.wala.util.PrettyWalaNames;
import gnu.trove.set.TIntSet;
|
14,995 | private final SDGClassResolver classRes = new SDGClassResolver();
private final SDGClassComputation classComp;
private final Set<SDGClass> classes = new HashSet<SDGClass>();
private final SDG sdg;
private SDGProgramPartParserBC ppartParser;
<BUG>private final Map<SDGProgramPart, Collection<Annotation>> annotations = new HashMap<SDGProgramPart, Collection<Annotation>>();
</BUG>
private final AnnotationTypeBasedNodeCollector coll;
private static Logger debug = Log.getLogger(Log.L_API_DEBUG);
public SDGProgram(SDG sdg) {
| private final Map<SDGProgramPart, Collection<Pair<Annotation,String>>> annotations = new HashMap<>();
|
14,996 | <BUG>package edu.kit.joana.api.annotations;
import edu.kit.joana.api.sdg.SDGMethod;</BUG>
import edu.kit.joana.api.sdg.SDGProgramPart;
public class IFCAnnotation {
private final AnnotationType type;
| import edu.kit.joana.api.annotations.cause.AnnotationCause;
import edu.kit.joana.api.annotations.cause.UnknownCause;
import edu.kit.joana.api.sdg.SDGMethod;
|
14,997 | public IFCAnnotation(AnnotationType type, String level, SDGProgramPart annotatedPart) {
this(type, level, annotatedPart, null);
</BUG>
}
<BUG>public IFCAnnotation(AnnotationType type, String level, SDGProgramPart annotatedPart, SDGMethod context) {
</BUG>
if (type == AnnotationType.DECLASS || type == null || level == null || annotatedPart == null) {
throw new IllegalArgumentException();
}
this.type = type;
| this(type, level, annotatedPart, null, UnknownCause.INSTANCE);
public IFCAnnotation(AnnotationType type, String level, SDGProgramPart annotatedPart, SDGMethod context, AnnotationCause cause) {
|
14,998 | import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
<BUG>import java.util.Set;
import com.google.common.collect.Sets;</BUG>
import com.ibm.wala.shrikeCT.AnnotationsReader.ArrayElementValue;
import com.ibm.wala.shrikeCT.AnnotationsReader.ConstantElementValue;
import com.ibm.wala.shrikeCT.AnnotationsReader.ElementValue;
| import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.Sets;
|
14,999 | import com.ibm.wala.types.TypeReference;
import com.ibm.wala.types.annotations.Annotation;
import edu.kit.joana.api.annotations.AnnotationType;
import edu.kit.joana.api.annotations.IFCAnnotation;
import edu.kit.joana.api.annotations.IFCAnnotationManager;
<BUG>import edu.kit.joana.api.annotations.NodeAnnotationInfo;
import edu.kit.joana.api.lattice.BuiltinLattices;</BUG>
import edu.kit.joana.api.sdg.SDGActualParameter;
import edu.kit.joana.api.sdg.SDGAttribute;
import edu.kit.joana.api.sdg.SDGCall;
| import edu.kit.joana.api.annotations.cause.AnnotationCause;
import edu.kit.joana.api.annotations.cause.JavaSinkAnnotation;
import edu.kit.joana.api.annotations.cause.JavaSourceAnnotation;
import edu.kit.joana.api.annotations.cause.UnknownCause;
import edu.kit.joana.api.lattice.BuiltinLattices;
|
15,000 | private IFCAnnotationManager annManager;
private IStaticLattice<String> secLattice;
private IFCType ifcType = IFCType.CLASSICAL_NI;
private IFC<String> ifc;
private boolean timeSensitiveAnalysis = false;
<BUG>private boolean removeRedundantFlows = false;
public static final IStaticLattice<String> stdLattice = BuiltinLattices.getBinaryLattice();</BUG>
private static Logger debug = Log.getLogger("api.debug");
public IFCAnalysis(SDGProgram program, IStaticLattice<String> secLattice) {
if (program == null || secLattice == null) {
| private Multimap<SDGProgramPart, Pair<Source,String>> sources = null;
private Multimap<SDGProgramPart, Pair<Sink,String>> sinks = null;
public static final IStaticLattice<String> stdLattice = BuiltinLattices.getBinaryLattice();
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.