id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
15,301 | import java.util.concurrent.TimeUnit;
@Beta
public class HttpClientConfig
{
public static final String JAVAX_NET_SSL_KEY_STORE = "javax.net.ssl.keyStore";
<BUG>public static final String JAVAX_NET_SSL_KEY_STORE_PASSWORD = "javax.net.ssl.keyStorePassword";
private boolean http2Enabled;</BUG>
private Duration connectTimeout = new Duration(1, TimeUnit.SECONDS);
private Duration requestTimeout = new Duration(5, TimeUnit.MINUTES);
private Duration idleTimeout = new Duration(1, TimeUnit.MINUTES);
| public static final String JAVAX_NET_SSL_TRUST_STORE = "javax.net.ssl.trustStore";
public static final String JAVAX_NET_SSL_TRUST_STORE_PASSWORD = "javax.net.ssl.trustStorePassword";
private boolean http2Enabled;
|
15,302 | private int maxConnectionsPerServer = 20;
private int maxRequestsQueuedPerDestination = 1024;
private DataSize maxContentLength = new DataSize(16, Unit.MEGABYTE);
private HostAndPort socksProxy;
private String keyStorePath = System.getProperty(JAVAX_NET_SSL_KEY_STORE);
<BUG>private String keyStorePassword = System.getProperty(JAVAX_NET_SSL_KEY_STORE_PASSWORD);
private boolean authenticationEnabled;</BUG>
private String kerberosPrincipal;
private String kerberosRemoteServiceName;
public boolean isHttp2Enabled()
| private String trustStorePath = System.getProperty(JAVAX_NET_SSL_TRUST_STORE);
private String trustStorePassword = System.getProperty(JAVAX_NET_SSL_TRUST_STORE_PASSWORD);
private boolean authenticationEnabled;
|
15,303 | import org.testng.annotations.Test;
import javax.validation.constraints.NotNull;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import static io.airlift.http.client.HttpClientConfig.JAVAX_NET_SSL_KEY_STORE;
<BUG>import static io.airlift.http.client.HttpClientConfig.JAVAX_NET_SSL_KEY_STORE_PASSWORD;
import static io.airlift.testing.ValidationAssertions.assertFailsValidation;</BUG>
public class TestHttpClientConfig
{
@Test
| import static io.airlift.http.client.HttpClientConfig.JAVAX_NET_SSL_TRUST_STORE;
import static io.airlift.http.client.HttpClientConfig.JAVAX_NET_SSL_TRUST_STORE_PASSWORD;
import static io.airlift.testing.ValidationAssertions.assertFailsValidation;
|
15,304 | .setMaxConnectionsPerServer(20)
.setMaxRequestsQueuedPerDestination(1024)
.setMaxContentLength(new DataSize(16, Unit.MEGABYTE))
.setSocksProxy(null)
.setKeyStorePath(System.getProperty(JAVAX_NET_SSL_KEY_STORE))
<BUG>.setKeyStorePassword(System.getProperty(JAVAX_NET_SSL_KEY_STORE_PASSWORD))
.setAuthenticationEnabled(false)</BUG>
.setKerberosRemoteServiceName(null)
.setKerberosPrincipal(null));
}
| .setTrustStorePath(System.getProperty(JAVAX_NET_SSL_TRUST_STORE))
.setTrustStorePassword(System.getProperty(JAVAX_NET_SSL_TRUST_STORE_PASSWORD))
.setAuthenticationEnabled(false)
|
15,305 | .put("http-client.max-connections-per-server", "3")
.put("http-client.max-requests-queued-per-destination", "10")
.put("http-client.max-content-length", "1MB")
.put("http-client.socks-proxy", "localhost:1080")
.put("http-client.key-store-path", "key-store")
<BUG>.put("http-client.key-store-password", "key-store-password")
.put("http-client.authentication.enabled", "true")</BUG>
.put("http-client.authentication.krb5.remote-service-name", "airlift")
.put("http-client.authentication.krb5.principal", "airlift-client")
.build();
| .put("http-client.trust-store-path", "trust-store")
.put("http-client.trust-store-password", "trust-store-password")
.put("http-client.authentication.enabled", "true")
|
15,306 | .setMaxConnectionsPerServer(3)
.setMaxRequestsQueuedPerDestination(10)
.setMaxContentLength(new DataSize(1, Unit.MEGABYTE))
.setSocksProxy(HostAndPort.fromParts("localhost", 1080))
.setKeyStorePath("key-store")
<BUG>.setKeyStorePassword("key-store-password")
.setAuthenticationEnabled(true)</BUG>
.setKerberosRemoteServiceName("airlift")
.setKerberosPrincipal("airlift-client");
ConfigAssertions.assertFullMapping(properties, expected);
| .setTrustStorePath("trust-store")
.setTrustStorePassword("trust-store-password")
.setAuthenticationEnabled(true)
|
15,307 | SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setEndpointIdentificationAlgorithm("HTTPS");
if (config.getKeyStorePath() != null) {
sslContextFactory.setKeyStorePath(config.getKeyStorePath());
sslContextFactory.setKeyStorePassword(config.getKeyStorePassword());
<BUG>}
HttpClientTransport transport;</BUG>
if (config.isHttp2Enabled()) {
HTTP2Client client = new HTTP2Client();
client.setSelectors(CLIENT_TRANSPORT_SELECTORS);
| if (config.getTrustStorePath() != null) {
sslContextFactory.setTrustStorePath(config.getTrustStorePath());
sslContextFactory.setTrustStorePassword(config.getTrustStorePassword());
HttpClientTransport transport;
|
15,308 | protected HttpClientConfig createClientConfig()
{
return new HttpClientConfig()
.setHttp2Enabled(false)
.setKeyStorePath(getResource("localhost.keystore").getPath())
<BUG>.setKeyStorePassword("changeit");
}</BUG>
@Override
public <T, E extends Exception> T executeRequest(Request request, ResponseHandler<T, E> responseHandler)
throws Exception
| .setKeyStorePassword("changeit")
.setTrustStorePath(getResource("localhost.truststore").getPath())
.setTrustStorePassword("changeit");
}
|
15,309 | final PutResult putResult = putResolver.performPut(storIOContentResolver, cv);
putResultsMap.put(cv, putResult);
}
return PutResults.newInstance(putResultsMap);
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during Put operation. contentValues = " + contentValues, exception);
|
15,310 | if (putResult.wasInserted() || putResult.wasUpdated()) {
internal.notifyAboutChanges(Changes.newInstance(putResult.affectedTables()));
}
return putResult;
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during Put operation. object = " + object, exception);
|
15,311 | return getResolver.mapFromCursor(cursor);
} finally {
cursor.close();
}
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@Override
| throw new StorIOException("Error has occurred during Get operation. query = " + (query != null ? query : rawQuery), exception);
|
15,312 | @Override
public Cursor executeAsBlocking() {
try {
return getResolver.performGet(storIOContentResolver, query);
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during Get operation. query = " + query, exception);
|
15,313 | return getResolver.performGet(storIOSQLite, rawQuery);
} else {
throw new IllegalStateException("Please specify query");
}
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during Get operation. query = " + (query != null ? query : rawQuery), exception);
|
15,314 | @Override
public PutResult executeAsBlocking() {
try {
return putResolver.performPut(storIOContentResolver, contentValues);
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during Put operation. contentValues = " + contentValues, exception);
|
15,315 | if (putResult.wasInserted() || putResult.wasUpdated()) {
storIOSQLite.internal().notifyAboutChanges(Changes.newInstance(putResult.affectedTables()));
}
return putResult;
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during Delete operation. contentValues = " + contentValues, exception);
|
15,316 | return getResolver.mapFromCursor(cursor);
} finally {
cursor.close();
}
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during Get operation. query = " + query, exception);
|
15,317 | return getResolver.mapFromCursor(cursor);
} finally {
cursor.close();
}
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during Get operation. query = " + query, exception);
|
15,318 | if (deleteResult.numberOfRowsDeleted() > 0) {
internal.notifyAboutChanges(Changes.newInstance(deleteResult.affectedTables()));
}
return deleteResult;
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during Delete operation. object = " + object, exception);
|
15,319 | package com.pushtorefresh.storio.contentresolver.operations.delete;
<BUG>import android.support.annotation.NonNull;
class TestItem {
private TestItem() {
}</BUG>
@NonNull
| import android.support.annotation.Nullable;
@Nullable
private final String data;
private TestItem(@Nullable String data) {
this.data = data;
}
|
15,320 | public void shouldThrowExceptionIfNoTypeMappingWasFoundWithoutAffectingContentProviderAsSingle() {
final StorIOContentResolver storIOContentResolver = mock(StorIOContentResolver.class);
final StorIOContentResolver.Internal internal = mock(StorIOContentResolver.Internal.class);
when(storIOContentResolver.internal()).thenReturn(internal);
when(storIOContentResolver.delete()).thenReturn(new PreparedDelete.Builder(storIOContentResolver));
<BUG>final TestItem testItem = TestItem.newInstance();
final List<TestItem> items = asList(testItem, TestItem.newInstance());
</BUG>
final TestSubscriber<DeleteResults<TestItem>> testSubscriber = new TestSubscriber<DeleteResults<TestItem>>();
storIOContentResolver
| final List<TestItem> items = asList(TestItem.newInstance("test item 1"), TestItem.newInstance("test item 2"));
|
15,321 | if (deleteResult.numberOfRowsDeleted() > 0) {
storIOSQLite.internal().notifyAboutChanges(Changes.newInstance(deleteResult.affectedTables()));
}
return deleteResult;
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during Delete operation. query = " + deleteQuery, exception);
|
15,322 | return unmodifiableList(list);
} finally {
cursor.close();
}
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during Get operation. query = " + (query != null ? query : rawQuery), exception);
|
15,323 | @Override
public DeleteResult executeAsBlocking() {
try {
return deleteResolver.performDelete(storIOContentResolver, deleteQuery);
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during Delete operation. query = " + deleteQuery, exception);
|
15,324 | return getResolver.mapFromCursor(cursor);
} finally {
cursor.close();
}
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during Get operation. query = " + (query != null ? query : rawQuery), exception);
|
15,325 | if (affectedTables.size() > 0) {
storIOSQLite.internal().notifyAboutChanges(Changes.newInstance(affectedTables));
}
return new Object();
} catch (Exception exception) {
<BUG>throw new StorIOException(exception);
}</BUG>
}
@NonNull
@CheckResult
| throw new StorIOException("Error has occurred during ExecuteSQL operation. query = " + rawQuery, exception);
|
15,326 | package com.example.mapdemo;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
<BUG>import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Polygon;</BUG>
import com.google.android.gms.maps.model.PolygonOptions;
import android.graphics.Color;
| import com.google.android.gms.maps.model.Dash;
import com.google.android.gms.maps.model.Dot;
import com.google.android.gms.maps.model.Gap;
import com.google.android.gms.maps.model.JointType;
import com.google.android.gms.maps.model.PatternItem;
import com.google.android.gms.maps.model.Polygon;
|
15,327 | 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;
|
15,328 | 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());
|
15,329 | 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);
|
15,330 | 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);
|
15,331 | 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);
|
15,332 | 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;
|
15,333 | 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);
|
15,334 | 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);
|
15,335 | 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;
|
15,336 | }
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);
|
15,337 | 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);
|
15,338 | @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);
|
15,339 | 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);
|
15,340 | this.classLoaderReference = new WeakReference<ClassLoader>(localClassLoader);
this.properties = properties == null ? new Properties() : new Properties(properties);
this.cacheNamePrefix = cacheNamePrefix();
}
@Override
<BUG>public synchronized <K, V, C extends Configuration<K, V>> Cache<K, V> createCache(String cacheName, C configuration)
throws IllegalArgumentException {</BUG>
if (isClosed()) {
throw new IllegalStateException();
}
| public <K, V, C extends Configuration<K, V>> Cache<K, V> createCache(String cacheName, C configuration)
throws IllegalArgumentException {
|
15,341 | conf.get(Constants.CFG_LOCAL_DATA_DIR),
conf.get(Constants.AppFabric.OUTPUT_DIR));
File workDir = new File(dir);
Map<String, LocalResource> localResources =
new LinkedHashMap<String, LocalResource>();
<BUG>MRApps.setupDistributedCache(conf, localResources);
Map<String, Path> classpaths = new HashMap<String, Path>();</BUG>
Path[] archiveClassPaths = DistributedCache.getArchiveClassPaths(conf);
if (archiveClassPaths != null) {
for (Path p : archiveClassPaths) {
| AtomicLong uniqueNumberGenerator =
new AtomicLong(System.currentTimeMillis());
Map<String, Path> classpaths = new HashMap<String, Path>();
|
15,342 | .setNameFormat("LocalDistributedCacheManagerWithFix Downloader #%d")
.build();
exec = Executors.newCachedThreadPool(tf);
Path destPath = localDirAllocator.getLocalPathForWrite(".", conf);
Map<LocalResource, Future<Path>> resourcesToPaths = Maps.newHashMap();
<BUG>Random rand = new Random();
for (LocalResource resource : localResources.values()) {
Callable<Path> download = new FSDownload(localFSFileContext, ugi, conf,
new Path(destPath, Long.toString(rand.nextLong())), resource);
Future<Path> future = exec.submit(download);</BUG>
resourcesToPaths.put(resource, future);
| Callable<Path> download =
new Path(destPath, Long.toString(uniqueNumberGenerator.incrementAndGet())),
Future<Path> future = exec.submit(download);
|
15,343 | @Nullable
public String getName() {
return myName;
}
public List<ModulePath> getModulePaths() {
<BUG>return new ArrayList<ModulePath>(myPath2VFolderMap.keySet());
}</BUG>
public boolean contains(@NotNull ModulePath path) {
return myPath2VFolderMap.containsKey(path);
}
| return new ArrayList<>(myPath2VFolderMap.keySet());
|
15,344 | import java.util.Map;
public abstract class ProjectBase extends Project {
private static final Logger LOG = LogManager.getLogger(ProjectBase.class);
private final ProjectManager myProjectManager = ProjectManager.getInstance();
protected ProjectDescriptor myProjectDescriptor;
<BUG>private final Map<SModule, ModulePath> myModuleToPathMap = new LinkedHashMap<SModule, ModulePath>();
private final ModuleLoader myModuleLoader;</BUG>
protected ProjectBase(@NotNull ProjectDescriptor projectDescriptor) {
super(projectDescriptor.getName());
myProjectDescriptor = projectDescriptor;
| private final Map<SModule, ModulePath> myModuleToPathMap = new LinkedHashMap<>();
private final ModuleLoader myModuleLoader;
|
15,345 | if (!myModuleToPathMap.containsKey(module)) {
LOG.warn("Module has not been registered in the project: " + module);
}
IFile descriptorFile = getDescriptorFileChecked(module);
if (descriptorFile != null) {
<BUG>myModuleToPathMap.remove(module);
myProjectDescriptor.removeModulePath(new ModulePath(descriptorFile.getPath()));
</BUG>
}
}
| final ModulePath modulePath = myModuleToPathMap.remove(module);
myProjectDescriptor.removeModulePath(modulePath);
|
15,346 | import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
public final class ModulePath {
<BUG>private final Logger LOG = LogManager.getLogger(ModulePath.class);
@NotNull private String myPath; // always canonical path to the module descriptor file
@Nullable private String myVirtualFolder; // virtual folder, optional
public ModulePath(@NotNull String path) {</BUG>
try {
| @NotNull
@Nullable
public ModulePath(@NotNull String path) {
|
15,347 | 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() );
|
15,348 | 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_();
|
15,349 | 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 );
|
15,350 | 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 );
|
15,351 | 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_();
|
15,352 | 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_();
|
15,353 | 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_();
|
15,354 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| iconError( sink );
|
15,355 | } else if (type == Aggregate.MAX) {
if (newscore < current.getScore()) {
newscore = current.getScore();
}
}
<BUG>destination.add(new ZSetEntry(key, newscore));
}</BUG>
}
}
}
| destination.add(key, newscore);
|
15,356 | public MultiBulkReply zrange(byte[] key0, byte[] start1, byte[] stop2, byte[] withscores3) throws RedisException {
if (key0 == null || start1 == null || stop2 == null) {
throw new RedisException("invalid number of argumenst for 'zrange' command");
}
boolean withscores = _checkcommand(withscores3, "withscores", true);
<BUG>BytesKeyZSet zset = _getzset(key0, false);
int size = zset.size();</BUG>
int start = _torange(start1, size);
int end = _torange(stop2, size);
Iterator<ZSetEntry> iterator = zset.iterator();
| int size = zset.size();
|
15,357 | if (offset < 0 || number < 1) {
throw notInteger();
}
}
Score min = _toscorerange(min1);
<BUG>Score max = _toscorerange(max2);
NavigableSet<ZSetEntry> entries = zset.subSet(new ZSetEntry(null, min.value), min.inclusive,
new ZSetEntry(null, max.value), max.inclusive);
if (reverse) entries = entries.descendingSet();</BUG>
int current = 0;
| List<ZSetEntry> entries = zset.subSet(min.value, max.value);
if (reverse) Collections.reverse(entries);
|
15,358 | boolean inclusive = true;
double value;
}
@Override
public Reply zrank(byte[] key0, byte[] member1) throws RedisException {
<BUG>BytesKeyZSet zset = _getzset(key0, false);
</BUG>
return _zrank(member1, zset);
}
@Override
| List<ZSetEntry> zset = _getzset(key0, false).list();
|
15,359 | public MultiBulkReply zrevrange(byte[] key0, byte[] start1, byte[] stop2, byte[] withscores3) throws RedisException {
if (key0 == null || start1 == null || stop2 == null) {
throw new RedisException("invalid number of argumenst for 'zrevrange' command");
}
boolean withscores = _checkcommand(withscores3, "withscores", true);
<BUG>BytesKeyZSet zset = _getzset(key0, false);
int size = zset.size();</BUG>
int end = size - _torange(start1, size) -1 ;
int start = size - _torange(stop2, size) - 1;
Iterator<ZSetEntry> iterator = zset.iterator();
| int size = zset.size();
|
15,360 | }
return NIL_REPLY;
}
@Override
public BulkReply zscore(byte[] key0, byte[] member1) throws RedisException {
<BUG>BytesKeyZSet zset = _getzset(key0, false);
BytesKey member = new BytesKey(member1);
ZSetEntry entry = zset.get(member);
</BUG>
double score = entry.getScore();
| return new MultiBulkReply(list.toArray(new Reply[list.size()]));
|
15,361 | 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);
|
15,362 | 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));
|
15,363 | 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;
|
15,364 | 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);
|
15,365 | 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);
|
15,366 | 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);
|
15,367 | 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) {
|
15,368 | 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;
|
15,369 | package Reika.ChromatiCraft.Block;
import java.util.Random;
import net.minecraft.block.Block;
<BUG>import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;</BUG>
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
| import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.texture.IIconRegister;
|
15,370 | private IIcon colorIcon;
private IIcon fastIcon;
private IIcon center;</BUG>
private static final Random rand = new Random();
<BUG>public BlockCrystalPlant(Material xMaterial) {
super(Material.plants);
this.setTickRandomly(true);</BUG>
this.setLightOpacity(0);
this.setHardness(0);
| private IIcon colorIcon2;
private IIcon fastIcon2;
private IIcon center;
public BlockCrystalPlant(Material mat) {
super(mat);
this.setTickRandomly(true);
|
15,371 | public Item getItemDropped(int meta, Random rand, int fortune) {
return ChromaItems.SEED.getItemInstance();
}
@Override
public int damageDropped(int meta) {
<BUG>return meta+16;
</BUG>
}
@Override
public int colorMultiplier(IBlockAccess iba, int x, int y, int z) {/*
| return meta%16+16;
|
15,372 | import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Items.HighTransformationCoreRecipe;
import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Items.HighVoidCoreRecipe;
import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Items.IridescentChunkRecipe;
import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Items.LumenChunkRecipe;
import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Items.LumenCoreRecipe;
<BUG>import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Items.RawCrystalRecipe;
import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Items.TransformationCoreRecipe;</BUG>
import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Items.VoidCoreRecipe;
import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Items.VoidStorageRecipe;
import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Special.DoubleJumpRecipe;
| import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Items.ThrowableGemRecipe;
import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Items.TransformationCoreRecipe;
|
15,373 | this.addRecipe(new TintedLensRecipe(e, ChromaStacks.crystalLens, Items.iron_ingot, 1));
this.addRecipe(new TintedLensRecipe(e, ChromaStacks.crystalLens, Items.gold_ingot, 2));
this.addRecipe(new TintedLensRecipe(e, ChromaStacks.crystalLens, ChromaStacks.chromaIngot, 4));
sr = ReikaRecipeHelper.getShapedRecipeFor(lamp, " s ", "sss", "SSS", 's', shard, 'S', ReikaItemHelper.stoneSlab);
this.addRecipe(new CrystalLampRecipe(lamp, sr));
<BUG>this.addRecipe(new RelayRecipe(e));
for (int k = 0; k < Bases.baseList.length; k++) {</BUG>
Bases b = Bases.baseList[k];
ItemStack glow = ChromaBlocks.GLOW.getStackOfMetadata(i+k*16);
sr = ReikaRecipeHelper.getShapedRecipeFor(glow, "S", "s", 'S', shard, 's', b.ingredient);
| this.addRecipe(new ThrowableGemRecipe(e));
for (int k = 0; k < Bases.baseList.length; k++) {
|
15,374 | package Reika.ChromatiCraft.Auxiliary.RecipeManagers;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
<BUG>import java.util.HashSet;
import net.minecraft.item.ItemStack;</BUG>
import thaumcraft.api.aspects.Aspect;
import Reika.ChromatiCraft.Block.BlockPylonStructure.StoneTypes;
import Reika.ChromatiCraft.Block.Worldgen.BlockStructureShield;
| import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
|
15,375 | import Reika.ChromatiCraft.Registry.ChromaBlocks;
import Reika.ChromatiCraft.Registry.CrystalElement;
import Reika.ChromatiCraft.Registry.ItemMagicRegistry;
import Reika.DragonAPI.ModList;
import Reika.DragonAPI.Instantiable.Data.KeyedItemStack;
<BUG>import Reika.DragonAPI.Libraries.Registry.ReikaItemHelper;
public class FabricationRecipes {</BUG>
private static final FabricationRecipes instance = new FabricationRecipes();
private final HashMap<KeyedItemStack, ElementTagCompound> data = new HashMap();
private static final float SCALE = 0.8F;
| import Reika.DragonAPI.ModInteract.ItemHandlers.BloodMagicHandler;
public class FabricationRecipes {
|
15,376 | protected final ElementTagCompound energy = new ElementTagCompound();
protected final boolean requestEnergy(CrystalElement e, int amt) {
Collection<WirelessSource> c = CrystalNetworker.instance.getNearTilesOfType(worldObj, xCoord, yCoord, zCoord, WirelessSource.class, this.getReceiveRange(e));
for (WirelessSource s : c) {
if (s.canConduct() && s.canTransmitTo(this)) {
<BUG>if (s.request(e, amt, xCoord, yCoord, zCoord)) {
ReikaPacketHelper.sendDataPacketWithRadius(ChromatiCraft.packetChannel, ChromaPackets.WIRELESS.ordinal(), this, 64, s.getX(), s.getY(), s.getZ(), e.ordinal(), amt);</BUG>
return true;
}
}
| energy.addValueToColor(e, amt);
ReikaPacketHelper.sendDataPacketWithRadius(ChromatiCraft.packetChannel, ChromaPackets.WIRELESS.ordinal(), this, 64, s.getX(), s.getY(), s.getZ(), e.ordinal(), amt);
|
15,377 | import Reika.ChromatiCraft.Registry.ChromaBlocks;
import Reika.ChromatiCraft.Registry.ChromaTiles;
import Reika.ChromatiCraft.Registry.CrystalElement;
import Reika.ChromatiCraft.TileEntity.Technical.TileEntityDimensionCore;
import Reika.ChromatiCraft.World.Dimension.Structure.AltarGenerator;
<BUG>import Reika.ChromatiCraft.World.Dimension.Structure.AntFarmGenerator;
import Reika.ChromatiCraft.World.Dimension.Structure.GOLGenerator;</BUG>
import Reika.ChromatiCraft.World.Dimension.Structure.GravityPuzzleGenerator;
import Reika.ChromatiCraft.World.Dimension.Structure.LaserPuzzleGenerator;
import Reika.ChromatiCraft.World.Dimension.Structure.LocksGenerator;
| import Reika.ChromatiCraft.World.Dimension.Structure.BridgeGenerator;
import Reika.ChromatiCraft.World.Dimension.Structure.GOLGenerator;
|
15,378 | NONEUCLID(NonEuclideanGenerator.class, "Complex Spaces"),
GOL(GOLGenerator.class, "Cellular Automata"),
ANTFARM(AntFarmGenerator.class, "Fading Light"),
LASER(LaserPuzzleGenerator.class, "Chromatic Beams"),
PINBALL(PinballGenerator.class, "Expanding Motion"),
<BUG>GRAVITY(GravityPuzzleGenerator.class, "Luma Bursts");
private final Class generatorClass;</BUG>
private final String desc;
private final boolean gennedCore;
| GRAVITY(GravityPuzzleGenerator.class, "Luma Bursts"),
BRIDGE(BridgeGenerator.class, "Dynamic Bridges");
private final Class generatorClass;
|
15,379 | public final void generateDataTile(int x, int y, int z, Object... data) {
world.setTileEntity(x, y, z, ChromaBlocks.DIMDATA.getBlockInstance(), 0, new StructureDataCallback(this, data));
}
public final void generateLootChest(int x, int y, int z, ForgeDirection dir, String chest, int bonus, ItemStack... extras) {
world.setTileEntity(x, y, z, ChromaBlocks.LOOTCHEST.getBlockInstance(), BlockLootChest.getMeta(dir), new LootChestCallback(chest, bonus, extras));
<BUG>}
private static final class StructureDataCallback implements TileCallback {</BUG>
private final DimensionStructureGenerator generator;
private final HashMap<String, Object> data;
private StructureDataCallback(DimensionStructureGenerator gen, Object[] data) {
| public void tickPlayer(EntityPlayer ep) {
private static final class StructureDataCallback implements TileCallback {
|
15,380 | @Override
public boolean matchInWorld(World world, int x, int y, int z) {
Block b = world.getBlock(x, y, z);
if (b == ChromaBlocks.CHROMA.getBlockInstance()) {
TileEntityChroma te = (TileEntityChroma)world.getTileEntity(x, y, z);
<BUG>return te.getElement() == color && te.getBerryCount() == TileEntityChroma.BERRY_SATURATION;
</BUG>
}
return false;
}
| return te != null && te.getElement() == color && te.getBerryCount() == TileEntityChroma.BERRY_SATURATION;
|
15,381 | } else {
logger.error(e.getMessage(), e);
}
return false;
}
<BUG>logger.warn("adding : " + vs.getName() + " virtual sensor[" + vs.getFileName() + "]");
</BUG>
if (Mappings.addVSensorInstance(pool)) {
try {
fireVSensorLoading(pool.getConfig());
| logger.info("adding : " + vs.getName() + " virtual sensor[" + vs.getFileName() + "]");
|
15,382 | removeAllVSResources(pool);
}
return true;
}
private void removeVirtualSensor(VSensorConfig configFile) {
<BUG>logger.warn ("removing : " + configFile.getName ( ));
</BUG>
VirtualSensor sensorInstance = Mappings.getVSensorInstanceByFileName ( configFile.getFileName ( ) );
Mappings.removeFilename ( configFile.getFileName ( ) );
removeAllVSResources ( sensorInstance );
| logger.info ("removing : " + configFile.getName ( ));
|
15,383 | configuration.getFileName ( ) + " is already used by : " + Mappings.getVSensorConfig ( vsName ).getFileName ( ));
logger.error ( "Note that the virtual sensor name is case insensitive and all the spaces in it's name will be removed automatically." );
</BUG>
return false;
}
<BUG>if ( !isValidJavaIdentifier( vsName ) ) {
logger.error ("Adding the virtual sensor specified in " + configuration.getFileName ( ) +
" failed because the virtual sensor name is not following the requirements : ");
logger.error ( "The virtual sensor name is case insensitive and all the spaces in it's name will be removed automatically." );
logger.error ( "That the name of the virutal sensor should starting by alphabetical character and they can contain numerical characters afterwards." );
</BUG>
return false;
| logger.info( "Note that the virtual sensor name is case insensitive and all the spaces in it's name will be removed automatically." );
|
15,384 | final AbstractWrapper wrapper = streamSource.getWrapper ( );
streamSource.getInputStream().getRenamingMapping().remove(streamSource.getAlias());
try {
wrapper.removeListener(streamSource);
} catch (SQLException e) {
<BUG>logger.error(e.getMessage(),e);
logger.error("Release the resources failed !");
</BUG>
}
}
| logger.error("Release the resources failed !" + e.getMessage());
|
15,385 | wrapper.releaseResources();
}catch(SQLException sql){
logger.error(sql.getMessage(),sql);
}
}
<BUG>logger.error(e.getMessage(),e);
logger.error("Preparation of the stream source failed : "+streamSource.getAlias()+ " from the input stream : "+inputStream.getInputStreamName());
</BUG>
}
}
| wrapper=null;
} catch (Exception e) {
if (wrapper!=null){
try{
logger.error("Preparation of the stream source failed : "+streamSource.getAlias()+ " from the input stream : "+inputStream.getInputStreamName()+". " + e.getMessage(),e);
|
15,386 | this.isActive = false;
this.interrupt ( );
for ( String configFile : Mappings.getAllKnownFileName ( ) ) {
VirtualSensor sensorInstance = Mappings.getVSensorInstanceByFileName ( configFile );
removeAllVSResources ( sensorInstance );
<BUG>logger.warn ( "Removing the resources associated with : " + sensorInstance.getConfig ( ).getFileName ( ) + " [done]." );
</BUG>
}
try {
Main.getWindowStorage().shutdown( );
| logger.info( "Removing the resources associated with : " + sensorInstance.getConfig ( ).getFileName ( ) + " [done]." );
|
15,387 | import gsn.storage.SQLUtils;
import gsn.utils.ValidityTools;
import gsn.utils.graph.Graph;
import gsn.utils.graph.Node;
import gsn.utils.graph.NodeNotExistsExeption;
<BUG>import java.io.FileInputStream;
import java.io.FileNotFoundException;</BUG>
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
| [DELETED] |
15,388 | import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
<BUG>import org.jibx.runtime.BindingDirectory;
import org.jibx.runtime.IBindingFactory;
import org.jibx.runtime.IUnmarshallingContext;
import org.jibx.runtime.JiBXException;</BUG>
public final class Modifications {
| [DELETED] |
15,389 | try {
VsConf vsConf=VsConf.load(file);
configuration=BeansInitializer.vsensor(vsConf);
configuration.setFileName( file );
if ( !configuration.validate( ) ) {
<BUG>logger.error( new StringBuilder( ).append( "Adding the virtual sensor specified in " ).append( file ).append( " failed because of one or more problems in configuration file." )
.toString( ) );
logger.error( new StringBuilder( ).append( "Please check the file and try again" ).toString( ) );</BUG>
continue ;
| logger.error("Adding the virtual sensor specified in "+file+" failed because of one or more problems in configuration file.");
logger.info("Please check the file and try again");
|
15,390 | .toString( ) );
logger.error( new StringBuilder( ).append( "Please check the file and try again" ).toString( ) );</BUG>
continue ;
}
list.add( configuration );
<BUG>} catch ( Exception e ) {
logger.error( e.getMessage( ) , e );
logger.error( new StringBuilder( ).append( "Adding the virtual sensor specified in " ).append( file ).append( " failed." ).toString( ) );</BUG>
}
}
| try {
VsConf vsConf=VsConf.load(file);
configuration=BeansInitializer.vsensor(vsConf);
configuration.setFileName( file );
if ( !configuration.validate( ) ) {
logger.error("Adding the virtual sensor specified in "+file+" failed because of one or more problems in configuration file.");
logger.info("Please check the file and try again");
logger.error("Adding the virtual sensor specified in "+file+" failed."+ e.getMessage());
|
15,391 | String vsName = vsensorName.toLowerCase().trim();
VSensorConfig sensorConfig = vsNameTOVSConfig.get(vsName);
if(sensorConfig == null)
sensorConfig = Mappings.getVSensorConfig(vsName);
if(sensorConfig == null){
<BUG>logger.debug("There is no virtaul sensor with name >" + vsName + "< in the >" + config.getName() + "< virtual sensor");
</BUG>
if(addressingIndex == addressing.length - 1 && !hasValidAddressing){
try {
graph.removeNode(config);
| logger.debug("There is no virtual sensor with name >" + vsName + "< in the >" + config.getName() + "< virtual sensor");
|
15,392 | logger.warn ( "The >host< parameter is missing from the RemoteWrapper wrapper." );
return false;
}
port = addressBean.getPredicateValueAsInt("port" ,ContainerConfig.DEFAULT_GSN_PORT);
if ( port > 65000 || port <= 0 ) {
<BUG>logger.error("Remote wrapper initialization failed, bad port number:"+port);
</BUG>
return false;
}
}
| logger.warn("Remote wrapper initialization failed, bad port number:"+port);
|
15,393 | private LinkedBlockingQueue<DistributionRequest> locker = new LinkedBlockingQueue<DistributionRequest>();
private ConcurrentHashMap<DistributionRequest, Boolean> candidatesForNextRound = new ConcurrentHashMap<DistributionRequest, Boolean>();
public void addListener(DistributionRequest listener) {
synchronized (listeners) {
if (!listeners.contains(listener)) {
<BUG>logger.warn("Adding a listener to Distributer:" + listener.toString());
</BUG>
boolean needsAnd = SQLValidator.removeSingleQuotes(SQLValidator.removeQuotes(listener.getQuery())).indexOf(" where ") > 0;
String query = SQLValidator.addPkField(listener.getQuery());
if (needsAnd)
| logger.info("Adding a listener to Distributer:" + listener.toString());
|
15,394 | if (sources==null || sources.length==0) {
logger.error("Input Stream "+getInputStreamName()+ " is not valid (No stream sources are specified), deployment failed !");
return false;
}
for ( StreamSource ss : sources ) {
<BUG>if ( !ss.validate( ) ) {
logger.error( new StringBuilder( ).append( "The Stream Source : " ).append( ss.getAlias( ) ).append( " specified in the Input Stream : " ).append( this.getInputStreamName( ) ).append(
" is not valid." ).toString( ) );</BUG>
return (cachedValidationResult=false);
}
| logger.error("The Stream Source : "+ss.getAlias( )+" specified in the Input Stream : "+getInputStreamName( )+" is not valid.");
|
15,395 | public void invalidateCachedQuery(StreamSource streamSource){
queryCached = false;
rewrittenSQL = null;
}
public boolean executeQuery( final CharSequence alias ) throws SQLException{
<BUG>logger.debug( new StringBuilder( ).append( "Notified by StreamSource on the alias: " ).append( alias ).toString( ) );
if ( this.pool == null ) {</BUG>
logger.debug( "The input is dropped b/c the VSensorInstance is not set yet." );
return false;
}
| logger.debug("Notified by StreamSource on the alias: " + alias );
if ( this.pool == null ) {
|
15,396 |
logger.warn( e.getMessage( ) , e );</BUG>
} catch ( final VirtualSensorInitializationFailedException e ) {
logger.error( "The stream element can't deliver its data to the virtual sensor " + sensor.getVirtualSensorConfiguration( ).getName( )
<BUG>+ " because initialization of that virtual sensor failed" );
logger.error(e.getMessage(),e);</BUG>
} finally {
this.pool.returnVS( sensor );
}
| elementCounterForDebugging++;
StreamElement element= resultOfTheQuery.nextElement( );
sensor.dataAvailable_decorated( this.getInputStreamName( ) , element );
} catch ( final UnsupportedOperationException e ) {
logger.warn( "The stream element produced by the virtual sensor is dropped because of the following error : "+ e.getMessage());
+ " because initialization of that virtual sensor failed: " + e.getMessage());
|
15,397 | wrappers = WrappersUtil.loadWrappers(new HashMap<String, Class<?>>());
logger.info ( "Loading wrappers.properties at : " + WrappersUtil.DEFAULT_WRAPPER_PROPERTIES_FILE);</BUG>
logger.info ( "Wrappers initialization ..." );
} catch ( FileNotFoundException e ) {
<BUG>logger.error ("The the configuration file : " + Main.DEFAULT_GSN_CONF_FILE + " doesn't exist.");
logger.error ( e.getMessage ( ) );
logger.error ( "Check the path of the configuration file and try again." );
</BUG>
System.exit ( 1 );
| logger.error ("The the configuration file : " + Main.DEFAULT_GSN_CONF_FILE + " doesn't exist. "+ e.getMessage());
logger.info ( "Check the path of the configuration file and try again." );
|
15,398 | logger.error ( e.getMessage ( ) );
logger.error ( "Check the path of the configuration file and try again." );
</BUG>
System.exit ( 1 );
} catch ( ClassNotFoundException e ) {
<BUG>logger.error ( "The file wrapper.properties refers to one or more classes which don't exist in the classpath");
logger.error ( e.getMessage ( ),e );</BUG>
System.exit ( 1 );
}
| wrappers = WrappersUtil.loadWrappers(new HashMap<String, Class<?>>());
logger.info ( "Wrappers initialization ..." );
} catch ( FileNotFoundException e ) {
logger.error ("The the configuration file : " + Main.DEFAULT_GSN_CONF_FILE + " doesn't exist. "+ e.getMessage());
logger.info ( "Check the path of the configuration file and try again." );
logger.error ( "The file wrapper.properties refers to one or more classes which don't exist in the classpath"+ e.getMessage());
|
15,399 | public void restartConnection() {
}},"requester-1"), cfg);
future.join();
session = future.getSession();
} catch (RuntimeIOException e) {
<BUG>logger.error("Failed to connect to "+host+":"+port);
logger.error( e.getMessage(),e);</BUG>
}finally {
if (session!=null)
| logger.error("Failed to connect to "+host+":"+port+": "+e.getMessage());
|
15,400 | int effected = 0;
try {
logger.debug("Enforcing the limit size on the VS table by : " + query);
effected = Main.getStorage(config.getName()).executeUpdate(query);
} catch (SQLException e) {
<BUG>logger.error("Error in executing: " + query);
logger.error(e.getMessage(), e);</BUG>
}
logger.debug("There were " + effected + " old rows dropped from " + config.getName());
| logger.error("Error in executing: " + query + ". "+ e.getMessage());
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.