id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
16,801 | 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);
|
16,802 | 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));
|
16,803 | 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;
|
16,804 | 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);
|
16,805 | 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);
|
16,806 | 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);
|
16,807 | 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) {
|
16,808 | 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;
|
16,809 | import org.apache.commons.lang3.math.NumberUtils;
import org.json.JSONException;
import org.mariotaku.microblog.library.MicroBlog;
import org.mariotaku.microblog.library.MicroBlogException;
import org.mariotaku.microblog.library.twitter.model.RateLimitStatus;
<BUG>import org.mariotaku.microblog.library.twitter.model.Status;
import org.mariotaku.sqliteqb.library.AllColumns;</BUG>
import org.mariotaku.sqliteqb.library.Columns;
import org.mariotaku.sqliteqb.library.Columns.Column;
import org.mariotaku.sqliteqb.library.Expression;
| import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
|
16,810 | context.getApplicationContext().sendBroadcast(intent);
}
}
@Nullable
public static Location getCachedLocation(Context context) {
<BUG>if (BuildConfig.DEBUG) {
Log.v(LOGTAG, "Fetching cached location", new Exception());
}</BUG>
Location location = null;
| DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
|
16,811 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
16,812 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBackgroundImage(fileBody, tile);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
16,813 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
return twitter.updateProfileImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
16,814 | import org.mariotaku.twidere.receiver.NotificationReceiver;
import org.mariotaku.twidere.service.LengthyOperationsService;
import org.mariotaku.twidere.util.ActivityTracker;
import org.mariotaku.twidere.util.AsyncTwitterWrapper;
import org.mariotaku.twidere.util.DataStoreFunctionsKt;
<BUG>import org.mariotaku.twidere.util.DataStoreUtils;
import org.mariotaku.twidere.util.ImagePreloader;</BUG>
import org.mariotaku.twidere.util.InternalTwitterContentUtils;
import org.mariotaku.twidere.util.JsonSerializer;
import org.mariotaku.twidere.util.NotificationManagerWrapper;
| import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.ImagePreloader;
|
16,815 | final List<InetAddress> addresses = mDns.lookup(host);
for (InetAddress address : addresses) {
c.addRow(new String[]{host, address.getHostAddress()});
}
} catch (final IOException ignore) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, ignore);
}</BUG>
}
| DebugLog.w(LOGTAG, null, ignore);
|
16,816 | for (Location location : twitter.getAvailableTrends()) {
map.put(location);
}
return map.pack();
} catch (final MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| DebugLog.w(LOGTAG, null, e);
|
16,817 | import android.content.Context;
import android.content.SharedPreferences;
import android.location.Location;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
<BUG>import android.util.Log;
import org.mariotaku.twidere.BuildConfig;
import org.mariotaku.twidere.Constants;
import org.mariotaku.twidere.util.JsonSerializer;</BUG>
import org.mariotaku.twidere.util.Utils;
| import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.JsonSerializer;
|
16,818 | }
public static LatLng getCachedLatLng(@NonNull final Context context) {
final Context appContext = context.getApplicationContext();
final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences();
if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null;
<BUG>if (BuildConfig.DEBUG) {
Log.d(HotMobiLogger.LOGTAG, "getting cached location");
}</BUG>
final Location location = Utils.getCachedLocation(appContext);
| DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
|
16,819 | public int destroySavedSearchAsync(final UserKey accountKey, final long searchId) {
final DestroySavedSearchTask task = new DestroySavedSearchTask(accountKey, searchId);
return asyncTaskManager.add(task, true);
}
public int destroyStatusAsync(final UserKey accountKey, final String statusId) {
<BUG>final DestroyStatusTask task = new DestroyStatusTask(context,accountKey, statusId);
</BUG>
return asyncTaskManager.add(task, true);
}
public int destroyUserListAsync(final UserKey accountKey, final String listId) {
| final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
|
16,820 | @Override
public void afterExecute(Bus handler, SingleResponse<Relationship> result) {
if (result.hasData()) {
handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData()));
} else if (result.hasException()) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, "Unable to update friendship", result.getException());
}</BUG>
}
| public UserKey[] getAccountKeys() {
return DataStoreUtils.getActivatedAccountKeys(context);
|
16,821 | MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId);
if (!Utils.isOfficialCredentials(context, accountId)) continue;
try {
microBlog.setActivitiesAboutMeUnread(cursor);
} catch (MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| DebugLog.w(LOGTAG, null, e);
|
16,822 | import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;</BUG>
public class CollectorsTest {
@Test
public void testToCollection() {
<BUG>Collection<Integer> result = Stream.range(0, 10)
</BUG>
.collect(Collectors.toCollection(new Supplier<Collection<Integer>>() {
@Override
public Collection<Integer> get() {
| import org.junit.Test;
Collection<Integer> result = Stream.range(0, 5)
|
16,823 | .collect(Collectors.toCollection(new Supplier<Collection<Integer>>() {
@Override
public Collection<Integer> get() {
return new LinkedList<Integer>();
}
<BUG>}));
assertEquals(10, result.size());
int index = 0;
for (int v : result) {
assertEquals(index++, v);
}</BUG>
assertThat(result, instanceOf(LinkedList.class));
| [DELETED] |
16,824 | public String apply(String value) {
if ("c0".equals(value)) return null;
return String.valueOf(Character.toUpperCase(value.charAt(0)));
}
}));
<BUG>assertEquals(3, chars.size());
assertEquals("A", chars.get('a'));
assertEquals("B", chars.get('b'));
assertEquals("D", chars.get('d'));
}</BUG>
@Test
| assertThat(chars.size(), is(3));
assertThat(chars, allOf(
hasEntry('a', "A"),
hasEntry('b', "B"),
hasEntry('d', "D")
|
16,825 | public Double apply(Double value1, Double value2) {
return value1 + value2;
}
})
);
<BUG>assertEquals(2.28, sumDiv, 0.01);
}</BUG>
@Test
public void testGroupingBy() {
final Integer partitionItem = 1;
| assertThat(sumDiv, closeTo(2.28, 0.01));
|
16,826 | public void testGroupingBy() {
final Integer partitionItem = 1;
List<Integer> items = Arrays.asList(1, 2, 3, 1, 2, 3, 1, 2, 3);
Map<Boolean, List<Integer>> groupedBy = Stream.of(items)
.collect(Collectors.groupingBy(Functions.equalityPartitionItem(partitionItem)));
<BUG>assertThat(groupedBy.get(true), is(Arrays.asList(1, 1, 1)));
assertThat(groupedBy.get(false), is(Arrays.asList(2, 3, 2, 3, 2, 3)));
}</BUG>
@Test
| assertThat(groupedBy, allOf(
hasEntry(true, Arrays.asList(1, 1, 1)),
hasEntry(false, Arrays.asList(2, 3, 2, 3, 2, 3))
}
|
16,827 | public void testGroupingByCounting() {
Map<Integer, Long> byCounting = Stream.of(1, 2, 2, 3, 3, 3, 4, 4, 4, 4)
.collect(Collectors.groupingBy(
UnaryOperator.Util.<Integer>identity(),
Collectors.counting()));
<BUG>for (int i = 1; i <= 4; i++) {
assertEquals(i, byCounting.get(i).longValue());
}
}</BUG>
@Test
| assertThat(byCounting, allOf(
hasEntry(1, 1L),
hasEntry(2, 2L),
hasEntry(3, 3L),
hasEntry(4, 4L)
|
16,828 | currentMaps.clear();
int counter = 0;
selectedMap = 0;
maps.repaint();
LaunchFrame.updateMapInstallLocs(new String[] { "" });
<BUG>mapInfo.setText("");
HashMap<Integer, List<Map>> sorted = Maps.newHashMap();</BUG>
sorted.put(0, new ArrayList<Map>());
sorted.put(1, new ArrayList<Map>());
for (Map map : Map.getMapArray()) {
| ModPack FTBPack = FTBPacksPane.getInstance().getSelectedPack();
ModPack ThirdpartyPack = ThirdPartyPane.getInstance().getSelectedPack();
HashMap<Integer, List<Map>> sorted = Maps.newHashMap();
|
16,829 | texturePackPanels.clear();
texturePacks.removeAll();
currentTexturePacks.clear();
int counter = 0;
selectedTexturePack = 0;
<BUG>texturePacks.repaint();
HashMap<Integer, List<TexturePack>> sorted = Maps.newHashMap();</BUG>
sorted.put(0, new ArrayList<TexturePack>());
sorted.put(1, new ArrayList<TexturePack>());
for (TexturePack texturePack : TexturePack.getTexturePackArray()) {
| ModPack FTBPack = FTBPacksPane.getInstance().getSelectedPack();
ModPack ThirdpartyPack = ThirdPartyPane.getInstance().getSelectedPack();
HashMap<Integer, List<TexturePack>> sorted = Maps.newHashMap();
|
16,830 | import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class DependencyConvergenceReport
extends AbstractProjectInfoReport
<BUG>{
private List reactorProjects;
private static final int PERCENTAGE = 100;</BUG>
public String getOutputName()
{
| private static final int PERCENTAGE = 100;
private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment
.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
|
16,831 | sink.section1();
sink.sectionTitle1();
sink.text( getI18nString( locale, "title" ) );
sink.sectionTitle1_();
Map dependencyMap = getDependencyMap();
<BUG>generateLegend( locale, sink );
generateStats( locale, sink, dependencyMap );
generateConvergence( locale, sink, dependencyMap );
sink.section1_();</BUG>
sink.body_();
| sink.lineBreak();
sink.section1_();
|
16,832 | Iterator it = artifactMap.keySet().iterator();
while ( it.hasNext() )
{
String version = (String) it.next();
sink.tableRow();
<BUG>sink.tableCell();
sink.text( version );</BUG>
sink.tableCell_();
sink.tableCell();
generateVersionDetails( sink, artifactMap, version );
| sink.tableCell( String.valueOf( cellWidth ) + "px" );
sink.text( version );
|
16,833 | sink.tableCell();
sink.text( getI18nString( locale, "legend.shared" ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableCell();
iconError( sink );</BUG>
sink.tableCell_();
sink.tableCell();
sink.text( getI18nString( locale, "legend.different" ) );
| sink.tableCell( "15px" ); // according /images/icon_error_sml.gif
iconError( sink );
|
16,834 | sink.tableCaption();
sink.text( getI18nString( locale, "stats.caption" ) );
sink.tableCaption_();</BUG>
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.subprojects" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
| sink.bold();
sink.bold_();
sink.tableCaption_();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.subprojects" ) );
sink.tableHeaderCell_();
|
16,835 | sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.dependencies" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( depCount ) );
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.dependencies" ) );
sink.tableHeaderCell_();
|
16,836 | sink.text( String.valueOf( convergence ) + "%" );
sink.bold_();
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.readyrelease" ) );
sink.tableHeaderCell_();
|
16,837 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| iconError( sink );
|
16,838 | }
return stack;
}
public static boolean canItemStacksStack(@Nonnull ItemStack a, @Nonnull ItemStack b)
{
<BUG>if (a.func_190926_b() || !a.isItemEqual(b))
return false;
final NBTTagCompound aTag = a.getTagCompound();
final NBTTagCompound bTag = b.getTagCompound();
return (aTag != null || bTag == null) && (aTag == null || aTag.equals(bTag));</BUG>
}
| if (a.func_190926_b() || !a.isItemEqual(b) || a.hasTagCompound() != b.hasTagCompound())
return (!a.hasTagCompound() || a.getTagCompound().equals(b.getTagCompound())) && a.areCapsCompatible(b);
|
16,839 | import hudson.remoting.RemoteInputStream;
import hudson.remoting.RemoteOutputStream;
import hudson.remoting.SocketInputStream;
import hudson.remoting.SocketOutputStream;
import hudson.remoting.Which;
<BUG>import hudson.tasks.Maven.MavenInstallation;
import hudson.util.ArgumentListBuilder;</BUG>
import hudson.util.IOException2;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
| import hudson.tasks._maven.MavenConsoleAnnotator;
import hudson.util.ArgumentListBuilder;
|
16,840 | import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.net.ServerSocket;
import java.net.Socket;
<BUG>import java.net.SocketTimeoutException;
import java.util.Arrays;</BUG>
import java.util.logging.Logger;
final class MavenProcessFactory implements ProcessCache.Factory {
private final MavenModuleSet mms;
| import java.nio.charset.Charset;
import java.nio.charset.UnsupportedCharsetException;
import java.util.Arrays;
|
16,841 | }
if (tags != null) {
for (Map.Entry<String, String> entry : tags.entrySet()) {
if (entry.getKey().contains(" ")) {
throw new IllegalArgumentException("Series tag name can include only printable characters");
<BUG>}
command += " t:" + escape(entry.getKey()) +"=" + escape(entry.getValue());
</BUG>
}
}
| if (metric.contains(" ")) {
throw new IllegalArgumentException("Metric name can include only printable characters");
String command = "series";
command += " ms:" + date.getTime();
command += " e:" + escape(entity);
command += " m:" + escape(metric)+"=" + value;
|
16,842 | package org.neo4j.legacy.consistency;
<BUG>import org.junit.Rule;
import org.junit.Test;</BUG>
import java.io.File;
import java.io.IOException;
import java.util.Date;
| [DELETED] |
16,843 | import org.junit.Test;</BUG>
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
<BUG>import java.util.Map;
import org.neo4j.graphdb.GraphDatabaseService;</BUG>
import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.RelationshipType;
| package org.neo4j.legacy.consistency;
import org.junit.Rule;
import org.junit.Test;
import org.neo4j.graphdb.GraphDatabaseService;
|
16,844 | import org.neo4j.graphdb.config.Configuration;
import org.neo4j.graphdb.config.Setting;
import org.neo4j.graphdb.factory.Description;
import org.neo4j.helpers.HostnamePort;
import org.neo4j.helpers.Service;
<BUG>import org.neo4j.kernel.configuration.Config;
import org.neo4j.kernel.configuration.ConfigValues;</BUG>
import org.neo4j.kernel.extension.KernelExtensionFactory;
import org.neo4j.kernel.impl.core.ThreadToStatementContextBridge;
import org.neo4j.kernel.impl.factory.GraphDatabaseFacade;
| import org.neo4j.kernel.configuration.ConfigGroups;
import org.neo4j.kernel.configuration.ConfigValues;
|
16,845 | public class BoltKernelExtension extends KernelExtensionFactory<BoltKernelExtension.Dependencies>
{
public static class Settings
{
public static final Function<ConfigValues,List<Configuration>> connector_group =
<BUG>Config.groups( "dbms.connector" );
</BUG>
@Description( "Enable Neo4j Bolt" )
public static final Setting<Boolean> enabled = setting( "enabled", BOOLEAN, "false" );
@Description( "Set the encryption level for Neo4j Bolt protocol ports" )
| ConfigGroups.groups( "dbms.connector" );
|
16,846 | public Config registerSettingsClasses( Iterable<Class<?>> settingsClasses )
{
this.settingsClasses = Iterables.concat( settingsClasses, this.settingsClasses );
this.migrator = new AnnotationBasedConfigurationMigrator( settingsClasses );
this.validator = new ConfigurationValidator( settingsClasses );
<BUG>this.applyChanges( getParams() );
</BUG>
return this;
}
public Iterable<Class<?>> getSettingsClasses()
| this.replaceSettings( getParams() );
|
16,847 | package org.neo4j.consistency;
<BUG>import org.junit.Rule;
import org.junit.Test;</BUG>
import java.io.File;
import java.io.IOException;
import java.util.Date;
| [DELETED] |
16,848 | import org.junit.Test;</BUG>
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
<BUG>import java.util.Map;
import org.neo4j.consistency.ConsistencyCheckService.Result;</BUG>
import org.neo4j.consistency.checking.GraphStoreFixture;
import org.neo4j.consistency.checking.full.ConsistencyCheckIncompleteException;
import org.neo4j.graphdb.GraphDatabaseService;
| package org.neo4j.consistency;
import org.junit.Rule;
import org.junit.Test;
import org.neo4j.consistency.ConsistencyCheckService.Result;
|
16,849 | chart.addYAxisLabels(AxisLabelsFactory.newAxisLabels(labels));
chart.addXAxisLabels(AxisLabelsFactory.newNumericRangeAxisLabels(0, max));
chart.setBarWidth(BarChart.AUTO_RESIZE);
chart.setSize(600, 500);
chart.setHorizontal(true);
<BUG>chart.setTitle("Total Evaluations by User");
showChartImg(resp, chart.toURLString());
}</BUG>
private List<Entry<String, Integer>> sortEntries(Collection<Entry<String, Integer>> entries) {
List<Entry<String, Integer>> result = new ArrayList<Entry<String, Integer>>(entries);
| chart.setDataEncoding(DataEncoding.TEXT);
return chart;
}
|
16,850 | checkEvaluationsEqual(eval4, foundissueProto.getEvaluations(0));
checkEvaluationsEqual(eval5, foundissueProto.getEvaluations(1));
}
public void testGetRecentEvaluationsNoneFound() throws Exception {
DbIssue issue = createDbIssue("fad", persistenceHelper);
<BUG>DbEvaluation eval1 = createEvaluation(issue, "someone", 100);
DbEvaluation eval2 = createEvaluation(issue, "someone", 200);
DbEvaluation eval3 = createEvaluation(issue, "someone", 300);
issue.addEvaluations(eval1, eval2, eval3);</BUG>
getPersistenceManager().makePersistent(issue);
| [DELETED] |
16,851 | public int read() throws IOException {
return inputStream.read();
}
});
}
<BUG>}
protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {</BUG>
DbUser user;
Query query = getPersistenceManager().newQuery("select from " + persistenceHelper.getDbUserClass().getName()
+ " where openid == :myopenid");
| @SuppressWarnings({"unchecked"})
protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {
|
16,852 | eval.setComment("my comment");
eval.setDesignation("MUST_FIX");
eval.setIssue(issue);
eval.setWhen(when);
eval.setWho(user.createKeyObject());
<BUG>eval.setEmail(who);
return eval;</BUG>
}
protected PersistenceManager getPersistenceManager() {
return testHelper.getPersistenceManager();
| issue.addEvaluation(eval);
return eval;
|
16,853 | String command = null;
String result = null;
Socket socket;
while (continueListenning() && (socket = getSocket()) != null) {
try {
<BUG>time = System.currentTimeMillis();
try {</BUG>
InputStream inputStream = socket.getInputStream();
InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "ISO-8859-1");
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
| InetAddress ipAddress = socket.getInetAddress();
|
16,854 | InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "ISO-8859-1");
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
command = bufferedReader.readLine();
if (command == null) {
command = "DISCONNECTED";
<BUG>} else {
result = AdministrationTCP.this.processCommand(command);
</BUG>
OutputStream outputStream = socket.getOutputStream();
outputStream.write(result.getBytes("ISO-8859-1"));
| Client client = Client.get(ipAddress);
User user = client == null ? null : client.getUser();
result = AdministrationTCP.this.processCommand(user, command);
|
16,855 | } catch (SocketException ex) {
Server.logDebug("interrupted " + getName() + " connection.");
result = "INTERRUPTED\n";
} finally {
socket.close();
<BUG>InetAddress address = socket.getInetAddress();
</BUG>
clearSocket();
Server.logAdministration(
time,
| InetAddress address = ipAddress;
|
16,856 | names[i] = prefixes[j] + entityName;
}
return names;
}
protected UtilCache getCache(String entityName) {
<BUG>synchronized (UtilCache.utilCacheTable) {
return (UtilCache) UtilCache.utilCacheTable.get(getCacheName(entityName));
}</BUG>
}
| return UtilCache.findCache(getCacheName(entityName));
|
16,857 | }</BUG>
}
protected UtilCache getOrCreateCache(String entityName) {
synchronized (UtilCache.utilCacheTable) {
String name = getCacheName(entityName);
<BUG>UtilCache cache = (UtilCache) UtilCache.utilCacheTable.get(name);
</BUG>
if (cache == null) {
cache = new UtilCache(name, 0, 0, true);
String[] names = getCacheNames(entityName);
| names[i] = prefixes[j] + entityName;
return names;
protected UtilCache getCache(String entityName) {
return UtilCache.findCache(getCacheName(entityName));
UtilCache cache = UtilCache.findCache(name);
|
16,858 | String targetEntityName = (String) entry.getKey();
storeHook(targetEntityName, isPK, convert(isPK, targetEntityName, oldEntity), convert(false, targetEntityName, newEntity));
}
}
protected void storeHook(String entityName, boolean isPK, List oldValues, List newValues) {
<BUG>UtilCache entityCache = null;
synchronized (UtilCache.utilCacheTable) {
entityCache = (UtilCache) UtilCache.utilCacheTable.get(getCacheName(entityName));
}</BUG>
if (newValues == null || newValues.size() == 0 || newValues.get(0) == null) {
| UtilCache entityCache = UtilCache.findCache(getCacheName(entityName));
|
16,859 | try {
number = Integer.parseInt(numString);
} catch (Exception e) {
return "error";
}
<BUG>UtilCache utilCache = (UtilCache) UtilCache.utilCacheTable.get(name);
</BUG>
if (utilCache != null) {
Object key = null;
if (utilCache.getMaxSize() > 0) {
| UtilCache utilCache = UtilCache.findCache(name);
|
16,860 | if (name == null) {
errMsg = UtilProperties.getMessage(UtilCacheEvents.err_resource, "utilCache.couldNotClearCache", locale) + ".";
request.setAttribute("_ERROR_MESSAGE_", errMsg);
return "error";
}
<BUG>UtilCache utilCache = (UtilCache) UtilCache.utilCacheTable.get(name);
</BUG>
if (utilCache != null) {
utilCache.clear();
errMsg = UtilProperties.getMessage(UtilCacheEvents.err_resource, "utilCache.clearCache", UtilMisc.toMap("name", name), locale) + ".";
| UtilCache utilCache = UtilCache.findCache(name);
|
16,861 | maxSize = Long.valueOf(maxSizeStr);
} catch (Exception e) {}
try {
expireTime = Long.valueOf(expireTimeStr);
} catch (Exception e) {}
<BUG>UtilCache utilCache = (UtilCache) UtilCache.utilCacheTable.get(name);
</BUG>
if (utilCache != null) {
if (maxSize != null)
utilCache.setMaxSize(maxSize.intValue());
| UtilCache utilCache = UtilCache.findCache(name);
|
16,862 | import java.sql.SQLException;
import java.sql.Statement;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
<BUG>import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;</BUG>
import java.util.concurrent.locks.Lock;
| import java.util.HashMap;
import java.util.Map;
import java.util.Set;
|
16,863 | if (msgin != null) {
try {
msgin.close();
} catch (IOException e) {
}
<BUG>}
}
}
protected void updateSourceSequence(SourceSequence seq)
</BUG>
throws SQLException {
| releaseResources(stmt, null);
protected void storeMessage(Identifier sid, RMMessage msg, boolean outbound)
throws IOException, SQLException {
storeMessage(connection, sid, msg, outbound);
protected void updateSourceSequence(Connection con, SourceSequence seq)
|
16,864 | } catch (SQLException ex) {
if (!isTableExistsError(ex)) {
throw ex;
} else {
LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists.");
<BUG>verifyTable(SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
</BUG>
}
} finally {
stmt.close();
| verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
|
16,865 | } catch (SQLException ex) {
if (!isTableExistsError(ex)) {
throw ex;
} else {
LOG.fine("Table CXF_RM_DEST_SEQUENCES already exists.");
<BUG>verifyTable(DEST_SEQUENCES_TABLE_NAME, DEST_SEQUENCES_TABLE_COLS);
</BUG>
}
} finally {
stmt.close();
| LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists.");
verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
|
16,866 | }
} finally {
stmt.close();
}
for (String tableName : new String[] {OUTBOUND_MSGS_TABLE_NAME, INBOUND_MSGS_TABLE_NAME}) {
<BUG>stmt = connection.createStatement();
try {</BUG>
stmt.executeUpdate(MessageFormat.format(CREATE_MESSAGES_TABLE_STMT, tableName));
} catch (SQLException ex) {
if (!isTableExistsError(ex)) {
| stmt = con.createStatement();
try {
stmt.executeUpdate(CREATE_DEST_SEQUENCES_TABLE_STMT);
|
16,867 | throw ex;
} else {
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Table " + tableName + " already exists.");
}
<BUG>verifyTable(tableName, MESSAGES_TABLE_COLS);
</BUG>
}
} finally {
stmt.close();
| LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists.");
verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
|
16,868 | if (newCols.size() > 0) {
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "Table " + tableName + " needs additional columns");
}
for (String[] newCol : newCols) {
<BUG>Statement st = connection.createStatement();
try {</BUG>
st.executeUpdate(MessageFormat.format(ALTER_TABLE_STMT_STR,
tableName, newCol[0], newCol[1]));
if (LOG.isLoggable(Level.FINE)) {
| Statement st = con.createStatement();
try {
|
16,869 | if (nextReconnectAttempt < System.currentTimeMillis()) {
nextReconnectAttempt = System.currentTimeMillis() + reconnectDelay;
reconnectDelay = reconnectDelay * useExponentialBackOff;
}
}
<BUG>}
public static void deleteDatabaseFiles() {</BUG>
deleteDatabaseFiles(DEFAULT_DATABASE_NAME, true);
}
public static void deleteDatabaseFiles(String dbName, boolean now) {
| public static void deleteDatabaseFiles() {
|
16,870 | package com.liferay.portlet.journal.service.persistence;
import com.liferay.portal.kernel.dao.orm.QueryDefinition;
import com.liferay.portal.kernel.test.ExecutionTestListeners;
<BUG>import com.liferay.portal.kernel.transaction.Transactional;
import com.liferay.portal.kernel.workflow.WorkflowConstants;</BUG>
import com.liferay.portal.model.Group;
import com.liferay.portal.test.EnvironmentExecutionTestListener;
import com.liferay.portal.test.LiferayIntegrationJUnitTestRunner;
| import com.google.common.collect.Lists;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.workflow.WorkflowConstants;
|
16,871 | import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.GregorianCalendar;
<BUG>import java.util.List;
import org.junit.Assert;</BUG>
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
| import com.liferay.portlet.journal.util.comparator.*;
import org.junit.Assert;
|
16,872 | @RunWith(LiferayIntegrationJUnitTestRunner.class)
@Sync
@Transactional
public class JournalArticleFinderTest {
@Before
<BUG>public void setUp() throws Exception {
_group = GroupTestUtil.addGroup();</BUG>
_ddmStructure = DDMStructureTestUtil.addStructure(
_group.getGroupId(), JournalArticle.class.getName());
_folder = JournalTestUtil.addFolder(_group.getGroupId(), "Folder 1");
| JournalArticle addedArticle;
_group = GroupTestUtil.addGroup();
|
16,873 | _basicWebContentDDMStructure =
DDMStructureTestUtil.addStructure(
_group.getGroupId(), JournalArticle.class.getName());
DDMTemplate basicWebContentTemplate = DDMTemplateTestUtil.addTemplate(
_group.getGroupId(), _basicWebContentDDMStructure.getStructureId());
<BUG>_article = JournalTestUtil.addArticleWithXMLContent(
</BUG>
_group.getGroupId(), _folder.getFolderId(),
JournalArticleConstants.CLASSNAME_ID_DEFAULT,
"<title>Article 1</title>",
| addedArticle = JournalTestUtil.addArticleWithXMLContent(
|
16,874 | List<JournalArticle> articles = JournalArticleFinderUtil.findByG_C_S(
groupId, classNameId, ddmStructureKey, queryDefinition);
actualCount = articles.size();
Assert.assertEquals(expectedCount, actualCount);
}
<BUG>protected void doQueryByG_F(
</BUG>
long groupId, List<Long> folderIds, QueryDefinition queryDefinition,
int expectedCount)
throws Exception {
| protected void doQueryByG_F_CheckingCount(
|
16,875 | model.addAttribute("to", new Integer(to));
model.addAttribute("hasMore", (announcements.size() > to));
model.addAttribute("increment", new Integer(pageSize));
model.addAttribute("announcements", announcementsShort);
model.addAttribute("emergency", emergencyAnnouncements);
<BUG>model.addAttribute("hideAbstract",prefs.getValue(PREFERENCE_HIDE_ABSTRACT,"false"));
</BUG>
return viewNameSelector.select(request, "displayAnnouncements");
}
@RequestMapping(value="VIEW",params="action=displayFullAnnouncement")
| model.addAttribute("hideAbstract", Boolean.valueOf(prefs.getValue(PREFERENCE_HIDE_ABSTRACT,"false")));
|
16,876 | } else {
model.addAttribute("isGuest", Boolean.FALSE);
}
model.addAttribute("topicSubscriptions", myTopics);
model.addAttribute("topicsToUpdate", myTopics.size());
<BUG>model.addAttribute("prefHideAbstract",prefs.getValue(PREFERENCE_HIDE_ABSTRACT,"false"));
</BUG>
return viewNameSelector.select(request, "editDisplayPreferences");
}
@RequestMapping("EDIT")
| model.addAttribute("prefHideAbstract",Boolean.valueOf(prefs.getValue(PREFERENCE_HIDE_ABSTRACT,"false")));
|
16,877 | announcementService.addOrSaveTopicSubscription(newSubscription);
} catch (Exception e) {
logger.error("ERROR saving TopicSubscriptions for user "+request.getRemoteUser()+". Message: "+e.getMessage());
}
}
<BUG>String hideAbstract = ("TRUE".equalsIgnoreCase(request.getParameter("hideAbstract"))) ? "true" : "false";
prefs.setValue(PREFERENCE_HIDE_ABSTRACT,hideAbstract);</BUG>
prefs.store();
response.setPortletMode(PortletMode.VIEW);
response.setRenderParameter("action", "displayAnnouncements");
| String hideAbstract = Boolean.valueOf(request.getParameter("hideAbstract")).toString();
prefs.setValue(PREFERENCE_HIDE_ABSTRACT,hideAbstract);
|
16,878 | import org.codehaus.groovy.control.CompilationUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class GroovyTreeParser implements TreeParser {
private static final Logger logger = LoggerFactory.getLogger(GroovyTreeParser.class);
<BUG>private static final String GROOVY_DEFAULT_INTERFACE = "groovy.lang.GroovyObject";
private static final String JAVA_DEFAULT_OBJECT = "java.lang.Object";
private Map<URI, Set<SymbolInformation>> fileSymbols = Maps.newHashMap();
private Map<String, Set<SymbolInformation>> typeReferences = Maps.newHashMap();</BUG>
private final Supplier<CompilationUnit> unitSupplier;
| private Indexer indexer = new Indexer();
|
16,879 | if (scriptClass != null) {
sourceUnit.getAST().getStatementBlock().getVariableScope().getDeclaredVariables().values().forEach(
variable -> {
SymbolInformation symbol =
getVariableSymbolInformation(scriptClass.getName(), sourceUri, variable);
<BUG>addToValueSet(newTypeReferences, variable.getType().getName(), symbol);
symbols.add(symbol);
});
}
newFileSymbols.put(workspaceUriSupplier.get(sourceUri), symbols);</BUG>
});
| newIndexer.addSymbol(sourceUnit.getSource().getURI(), symbol);
if (classes.containsKey(variable.getType().getName())) {
newIndexer.addReference(classes.get(variable.getType().getName()),
GroovyLocations.createLocation(sourceUri, variable.getType()));
|
16,880 | }
if (typeReferences.containsKey(foundSymbol.getName())) {
foundReferences.addAll(typeReferences.get(foundSymbol.getName()));</BUG>
}
<BUG>return foundReferences;
}</BUG>
@Override
public Set<SymbolInformation> getFilteredSymbols(String query) {
checkNotNull(query, "query must not be null");
Pattern pattern = getQueryPattern(query);
| });
sourceUnit.getAST().getStatementBlock()
.visit(new MethodVisitor(newIndexer, sourceUri, sourceUnit.getAST().getScriptClassDummy(),
classes, Maps.newHashMap(), Optional.absent(), workspaceUriSupplier));
|
16,881 | <BUG>package com.palantir.ls.server.api;
import io.typefox.lsapi.ReferenceParams;</BUG>
import io.typefox.lsapi.SymbolInformation;
import java.net.URI;
import java.util.Map;
| import com.google.common.base.Optional;
import io.typefox.lsapi.Location;
import io.typefox.lsapi.Position;
import io.typefox.lsapi.ReferenceParams;
|
16,882 | import java.util.Map;
import java.util.Set;
public interface TreeParser {
void parseAllSymbols();
Map<URI, Set<SymbolInformation>> getFileSymbols();
<BUG>Map<String, Set<SymbolInformation>> getTypeReferences();
Set<SymbolInformation> findReferences(ReferenceParams params);
Set<SymbolInformation> getFilteredSymbols(String query);</BUG>
}
| Map<Location, Set<Location>> getReferences();
Set<Location> findReferences(ReferenceParams params);
Optional<Location> gotoDefinition(URI uri, Position position);
Set<SymbolInformation> getFilteredSymbols(String query);
|
16,883 | .workspaceSymbolProvider(true)
.referencesProvider(true)
.completionProvider(new CompletionOptionsBuilder()
.resolveProvider(false)
.triggerCharacter(".")
<BUG>.build())
.build();</BUG>
InitializeResult result = new InitializeResultBuilder()
.capabilities(capabilities)
.build();
| .definitionProvider(true)
|
16,884 | package com.palantir.ls.server;
import com.palantir.ls.server.api.CompilerWrapper;
import com.palantir.ls.server.api.TreeParser;
import com.palantir.ls.server.api.WorkspaceCompiler;
<BUG>import io.typefox.lsapi.FileEvent;
import io.typefox.lsapi.PublishDiagnosticsParams;</BUG>
import io.typefox.lsapi.ReferenceParams;
import io.typefox.lsapi.SymbolInformation;
import io.typefox.lsapi.TextDocumentContentChangeEvent;
| import com.google.common.base.Optional;
import io.typefox.lsapi.Location;
import io.typefox.lsapi.Position;
import io.typefox.lsapi.PublishDiagnosticsParams;
|
16,885 | public void onClickStop(View v) {
if (mMediaPlayer != null) {
mMediaPlayer.stop();
mMediaPlayer.reset();
}
<BUG>mIsStopped = true;
}</BUG>
public void releaseWithoutStop() {
if (mMediaPlayer != null) {
mMediaPlayer.setDisplay(null);
| mMediaPlayer = null;
|
16,886 | package com.pili.pldroid.playerdemo;
import android.app.Activity;
<BUG>import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;</BUG>
import android.content.Intent;
import android.os.Bundle;
| [DELETED] |
16,887 | mEditText.setText(DEFAULT_TEST_URL);
mActivitySpinner = (Spinner) findViewById(R.id.TestSpinner);</BUG>
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, TEST_ACTIVITY_ARRAY);
mActivitySpinner.setAdapter(adapter);
}
<BUG>public void onClickPlaySetting(View v) {
showPlaySettingDialog();
}</BUG>
public void onClickLocalFile(View v) {
Intent intent = new Intent(this, VideoFileActivity.class);
| mStreamingTypeRadioGroup = (RadioGroup) findViewById(R.id.StreamingTypeRadioGroup);
mDecodeTypeRadioGroup = (RadioGroup) findViewById(R.id.DecodeTypeRadioGroup);
mActivitySpinner = (Spinner) findViewById(R.id.TestSpinner);
@Override
protected void onDestroy() {
super.onDestroy();
PLNetworkManager.getInstance().stopDnsCacheService(this);
|
16,888 | mVideoView.setOnBufferingUpdateListener(mOnBufferingUpdateListener);
mVideoView.setOnCompletionListener(mOnCompletionListener);
mVideoView.setOnSeekCompleteListener(mOnSeekCompleteListener);
mVideoView.setOnErrorListener(mOnErrorListener);
mVideoView.setVideoPath(mVideoPath);
<BUG>mMediaController = new MediaController(this, false, isLiveStreaming(mVideoPath));
</BUG>
mVideoView.setMediaController(mMediaController);
}
@Override
| mMediaController = new MediaController(this, false, isLiveStreaming==1);
|
16,889 | import static org.metaborg.runtime.task.util.TermTools.makeShort;
import static org.metaborg.runtime.task.util.TermTools.takeBool;
import static org.metaborg.runtime.task.util.TermTools.takeLong;
import static org.metaborg.runtime.task.util.TermTools.takeShort;
import java.util.Map.Entry;
<BUG>import org.spoofax.interpreter.core.Tools;
import org.spoofax.interpreter.library.ssl.StrategoHashMap;
import org.spoofax.interpreter.terms.IStrategoAppl;</BUG>
import org.spoofax.interpreter.terms.IStrategoInt;
import org.spoofax.interpreter.terms.IStrategoList;
| [DELETED] |
16,890 | public IStrategoTerm toTerm(ITaskEngine taskEngine, ITermFactory factory) {
final TermAttachmentSerializer serializer = new TermAttachmentSerializer(factory);
IStrategoList tasks = factory.makeList();
for(final Entry<IStrategoTerm, Task> entry : taskEngine.getTaskEntries()) {
final IStrategoTerm taskID = entry.getKey();
<BUG>final Task task = entry.getValue();
final Iterable<IStrategoTerm> sources = taskEngine.getSourcesOf(taskID);
final Iterable<IStrategoTerm> dependencies = taskEngine.getDependencies(taskID);
final Iterable<IStrategoTerm> reads = taskEngine.getReads(taskID);
final IStrategoTerm results = serializeResults(task.results(), factory, serializer);</BUG>
IStrategoTerm message = task.message();
| IStrategoTerm results = serializer.toAnnotations(makeList(factory, task.results()));
|
16,891 | public IStrategoTerm addTask(IStrategoTerm source, IStrategoList dependencies, IStrategoTerm instruction,
boolean isCombinator, boolean shortCircuit) {
return current.addTask(source, dependencies, instruction, isCombinator, shortCircuit);
}
@Override
<BUG>public void addPersistedTask(IStrategoTerm taskID, Task task, Iterable<IStrategoTerm> partitions,
IStrategoList initialDependencies, Iterable<IStrategoTerm> dependencies, Iterable<IStrategoTerm> reads) {
current.addPersistedTask(taskID, task, partitions, initialDependencies, dependencies, reads);
}</BUG>
@Override
| public void addPersistedTask(IStrategoTerm taskID, Task task, IStrategoList initialDependencies) {
current.addPersistedTask(taskID, task, initialDependencies);
|
16,892 | public abstract ITermDigester getDigester();
public abstract ITaskEvaluationFrontend getEvaluationFrontend();
public abstract void setEvaluationFrontend(ITaskEvaluationFrontend evaluator);
public abstract void startCollection(IStrategoTerm source);
public abstract IStrategoTerm createTaskID(IStrategoTerm instruction, IStrategoList dependencies);
<BUG>public abstract IStrategoTerm addTask(IStrategoTerm source, IStrategoList dependencies,
IStrategoTerm instruction, boolean isCombinator, boolean shortCircuit);
public abstract void addPersistedTask(IStrategoTerm taskID, Task task, Iterable<IStrategoTerm> sources,
IStrategoList initialDependencies, Iterable<IStrategoTerm> dependencies, Iterable<IStrategoTerm> reads);</BUG>
public abstract void removeTask(IStrategoTerm taskID);
| public abstract IStrategoTerm addTask(IStrategoTerm source, IStrategoList dependencies, IStrategoTerm instruction,
public abstract void addPersistedTask(IStrategoTerm taskID, Task task, IStrategoList initialDependencies);
|
16,893 | add("Jesús"); // interjection
add("Salvo");
add("Sin");
add("Van"); // verb
}};
<BUG>private static final Pattern otherNamePattern = Pattern.compile("\\b(Al\\w+|A[^l]\\w*|[B-Z]\\w+)");
private static final Pattern pPronounDeterminers = Pattern.compile("(tod|otr|un)[oa]s?");</BUG>
public static String getOverrideTag(String word, String containingPhrase) {
if (containingPhrase == null)
return null;
| [DELETED] |
16,894 | return "sp000";
}</BUG>
if (actuallyNames.contains(word))
return "np00000";
if (word.equals("sino") && containingPhrase.endsWith(word))
<BUG>return "nc0s000";
else if (word.equals("mañana") || word.equals("paso") || word.equals("monta") || word.equals("deriva")
|| word.equals("visto"))
return "nc0s000";
else if (word.equals("frente") && containingPhrase.startsWith("al frente"))</BUG>
return "nc0s000";
| else if (word.equals("Sin") && containingPhrase.startsWith("Sin embargo"))
else if (word.equals("mañana"))
|
16,895 | String word = t.firstChild().value();
String containingPhraseStr = getContainingPhrase(t, parent);
String overrideTag = ManualUWModel.getOverrideTag(word, containingPhraseStr);
if (overrideTag != null)
return overrideTag;
<BUG>Set<String> unigramTaggerKeys = unigramTagger.firstKeySet();
Pair<String, List<String>> strippedVerb = SpanishVerbStripper.separatePronouns(word);
if (strippedVerb != null && unigramTaggerKeys.contains(strippedVerb.first())) {
String pos = Counters.argmax(unigramTagger.getCounter(strippedVerb.first()));
if (pos.startsWith("v"))
return pos;
}</BUG>
if (unigramTagger.firstKeySet().contains(word))
| [DELETED] |
16,896 | TreeReader tr = trf.newTreeReader(br);
PrintWriter pw = new PrintWriter(new PrintStream(new FileOutputStream(new File(treeFile + ".fixed")),false,"UTF-8"));
int nTrees = 0;
for(Tree t; (t = tr.readTree()) != null;nTrees++) {
traverseAndFix(t, null, pretermLabel, unigramTagger, retainNER);
<BUG>t = MultiWordTreeExpander.expandPhrases(t, tn, tf);
if (tn != null)</BUG>
t = tn.normalizeWholeTree(t, tf);
pw.println(t.toString());
}
| t = MultiWordTreeExpander.expandPhrases(t);
if (tn != null)
|
16,897 | tlpp = new FrenchTreebankParserParams();
break;
case Hebrew:
tlpp = new HebrewTreebankParserParams();
break;
<BUG>case Spanish:
tlpp = new SpanishTreebankParserParams();
break;</BUG>
default:
tlpp = new EnglishTreebankParserParams();
| [DELETED] |
16,898 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.List;
<BUG>import java.util.Optional;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandDelete extends FCCommandBase {
private static final FlagMapper MAPPER = map -> key -> value -> {
map.put(key, value);
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
16,899 | .append(Text.of(TextColors.GREEN, "Usage: "))
.append(getUsage(source))
.build());
return CommandResult.empty();
} else if (isIn(REGIONS_ALIASES, parse.args[0])) {
<BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
IRegion region = FGManager.getInstance().getRegion(parse.args[1]);
</BUG>
boolean isWorldRegion = false;
if (region == null) {
| String regionName = parse.args[1];
IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
|
16,900 | </BUG>
isWorldRegion = true;
}
if (region == null)
<BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!"));
if (region instanceof GlobalWorldRegion) {
</BUG>
throw new CommandException(Text.of("You may not delete the global region!"));
}
| if (world == null)
throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!"));
if (world == null) throw new CommandException(Text.of("Must specify a world!"));
region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null);
throw new CommandException(Text.of("No region exists with the name \"" + regionName + "\"!"));
if (region instanceof IGlobal) {
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.