id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
45,101
if (previous != null) applyAnimations(previous.animation, previous.time, current.animation, current.time, transitionCurrentTime / transitionTargetTime); else applyAnimation(current.animation, current.time); updating = false; <BUG>} public void setAnimation(final String id, int loopCount, float speed, final AnimationListener listener) { setAnimation(obtain(id, loopCount, speed, listener)); </BUG> }
[DELETED]
45,102
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AFileSystem extends FileSystem {</BUG> private URI uri; private Path workingDir; private AmazonS3Client s3;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AFileSystem extends FileSystem {
45,103
public void initialize(URI name, Configuration conf) throws IOException { super.initialize(name, conf); uri = URI.create(name.getScheme() + "://" + name.getAuthority()); workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri, this.getWorkingDirectory()); <BUG>String accessKey = conf.get(ACCESS_KEY, null); String secretKey = conf.get(SECRET_KEY, null); </BUG> String userInfo = name.getUserInfo();
String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null)); String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
45,104
} else { accessKey = userInfo; } } AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain( <BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey), new InstanceProfileCredentialsProvider(), new S3AAnonymousAWSCredentialsProvider() );</BUG> bucket = name.getHost();
new BasicAWSCredentialsProvider(accessKey, secretKey), new AnonymousAWSCredentialsProvider()
45,105
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)); </BUG> s3 = new AmazonS3Client(credentials, awsConf); <BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS); partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (partSize < 5 * 1024 * 1024) {
new InstanceProfileCredentialsProvider(), new AnonymousAWSCredentialsProvider() bucket = name.getHost(); ClientConfiguration awsConf = new ClientConfiguration(); awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS))); awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP); awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES))); awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT))); maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS)); partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE)); partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
45,106
cannedACL = null; } if (!s3.doesBucketExist(bucket)) { throw new IOException("Bucket " + bucket + " does not exist"); } <BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART); long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE); </BUG> if (purgeExistingMultipart) {
boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART)); long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE));
45,107
import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AOutputStream extends OutputStream {</BUG> private OutputStream backupStream; private File backupFile; private boolean closed;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AOutputStream extends OutputStream {
45,108
this.client = client; this.progress = progress; this.fs = fs; this.cannedACL = cannedACL; this.statistics = statistics; <BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (conf.get(BUFFER_DIR, null) != null) {
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
45,109
package net.java.sip.communicator.plugin.notificationconfiguration; import java.awt.*; import javax.swing.*; import javax.swing.table.*; <BUG>class StringTableRenderer extends DefaultTableCellRenderer {</BUG> StringTableRenderer() { super();
import net.java.sip.communicator.util.*; class StringTableRenderer
45,110
} else if (value instanceof String) { String stringValue = (String) value; if(stringValue.equals(NotificationsTable.ENABLED)) <BUG>{ setText(null); setIcon(NotificationsTable.getColumnIconValue(column)); setHorizontalAlignment(SwingConstants.CENTER);</BUG> }
setHorizontalAlignment(SwingConstants.CENTER);
45,111
setText(null); setIcon(NotificationsTable.getColumnIconValue(column)); setHorizontalAlignment(SwingConstants.CENTER);</BUG> } else if (stringValue.equals(NotificationsTable.DISABLED)) <BUG>{ setText(null); setIcon(null);</BUG> } }
setIcon(null);
45,112
import net.java.sip.communicator.service.audionotifier.*; import net.java.sip.communicator.service.gui.*; import net.java.sip.communicator.service.notification.*; import net.java.sip.communicator.util.*; import org.osgi.framework.*; <BUG>public class NotificationConfigurationActivator implements BundleActivator {</BUG> private final Logger logger = Logger.getLogger(NotificationConfigurationActivator.class); public static BundleContext bundleContext;
public class NotificationConfigurationActivator {
45,113
30), properties); if (logger.isTraceEnabled()) logger.trace("Notification Configuration: [ STARTED ]"); } <BUG>public void stop(BundleContext arg0) throws Exception {</BUG> } public static AudioNotifierService getAudioNotifierService() {
public void stop(BundleContext bc)
45,114
} public static AudioNotifierService getAudioNotifierService() { if(audioService == null) { <BUG>ServiceReference audioReference = bundleContext.getServiceReference( AudioNotifierService.class.getName()); audioService = (AudioNotifierService) bundleContext.getService( audioReference);</BUG> }
public void stop(BundleContext bc) throws Exception audioService = ServiceUtils.getService( bundleContext, AudioNotifierService.class);
45,115
customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString()); customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName); customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString()); customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName); customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString()); <BUG>customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName); }</BUG> public void init() { try { LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName); customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName); }
45,116
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;
45,117
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)
45,118
} 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);
45,119
} 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);
45,120
} } 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);
45,121
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);
45,122
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 {
45,123
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() {
45,124
private Iterator<U> rightIt; private U next; private HasNextState hasNext = HasNextState.UNKNOWN; private ComparingIterator() { } <BUG>public boolean hasNext() { if (hasNext.unknown()) { init();</BUG> moveToNext(); }
if (leftIt == null || rightIt == null) { init();
45,125
private HasNextState hasNext = HasNextState.UNKNOWN; private Iterator<U> leftIt; private Iterator<U> rightIt; private ConcatingIterator() { } <BUG>public boolean hasNext() { if (hasNext.unknown()) { init();</BUG> moveToNext(); }
if (leftIt == null || rightIt == null) { init();
45,126
private Iterator<U> inputIterator; private HasNextState hasNext = HasNextState.UNKNOWN; private U next; private FilteringIterator() { } <BUG>public boolean hasNext() { if (hasNext.unknown()) { init();</BUG> moveToNext(); }
if (inputIterator == null) { init();
45,127
if (this.writer == null) { this.writer = new JoseHeadersReaderWriter(); } this.keyEncryptionAlgo = keyEncryptionAlgo; this.contentEncryptionAlgo = contentEncryptionAlgo; <BUG>} protected AlgorithmParameterSpec getAlgorithmParameterSpec(byte[] theIv) { return contentEncryptionAlgo.getAlgorithmParameterSpec(theIv); </BUG> }
protected ContentEncryptionAlgorithm getContentEncryptionAlgorithm() { return contentEncryptionAlgo; return getContentEncryptionAlgorithm().getAlgorithmParameterSpec(theIv);
45,128
</BUG> } @Override public String getContentAlgorithm() { <BUG>return contentEncryptionAlgo.getAlgorithm(); </BUG> } @Override public JweEncryptionState createJweEncryptionState(JweHeaders jweHeaders) { JweEncryptionInternal state = getInternalState(jweHeaders);
protected JweHeaders getJweHeaders() { return headers; public String getKeyAlgorithm() { return getKeyEncryptionAlgo().getAlgorithm(); return getContentEncryptionAlgorithm().getAlgorithm();
45,129
private JweEncryptionInternal getInternalState(JweHeaders jweHeaders) { byte[] theCek = getContentEncryptionKey(); String contentEncryptionAlgoJavaName = Algorithm.toJavaName(headers.getContentEncryptionAlgorithm()); KeyProperties keyProps = new KeyProperties(contentEncryptionAlgoJavaName); keyProps.setCompressionSupported(compressionRequired(headers)); <BUG>byte[] theIv = contentEncryptionAlgo.getInitVector(); </BUG> AlgorithmParameterSpec specParams = getAlgorithmParameterSpec(theIv); keyProps.setAlgoSpec(specParams); byte[] jweContentEncryptionKey = getEncryptedContentEncryptionKey(theCek);
byte[] theIv = getContentEncryptionAlgorithm().getInitVector();
45,130
public class DirectKeyJweEncryption extends AbstractJweEncryption { public DirectKeyJweEncryption(ContentEncryptionAlgorithm ceAlgo) { this(new JweHeaders(ceAlgo.getAlgorithm()), ceAlgo); } public DirectKeyJweEncryption(JweHeaders headers, ContentEncryptionAlgorithm ceAlgo) { <BUG>super(headers, ceAlgo, new DirectKeyEncryptionAlgorithm()); }</BUG> protected byte[] getProvidedContentEncryptionKey() { return validateCek(super.getProvidedContentEncryptionKey());
this(headers, ceAlgo, new DirectKeyEncryptionAlgorithm()); protected DirectKeyJweEncryption(JweHeaders headers, ContentEncryptionAlgorithm ceAlgo, DirectKeyEncryptionAlgorithm direct) { super(headers, ceAlgo, direct);
45,131
import de.vanita5.twittnuker.receiver.NotificationReceiver; import de.vanita5.twittnuker.service.LengthyOperationsService; import de.vanita5.twittnuker.util.ActivityTracker; import de.vanita5.twittnuker.util.AsyncTwitterWrapper; import de.vanita5.twittnuker.util.DataStoreFunctionsKt; <BUG>import de.vanita5.twittnuker.util.DataStoreUtils; import de.vanita5.twittnuker.util.ImagePreloader;</BUG> import de.vanita5.twittnuker.util.InternalTwitterContentUtils; import de.vanita5.twittnuker.util.JsonSerializer; import de.vanita5.twittnuker.util.NotificationManagerWrapper;
import de.vanita5.twittnuker.util.DebugLog; import de.vanita5.twittnuker.util.ImagePreloader;
45,132
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);
45,133
@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);
45,134
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);
45,135
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);
45,136
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);
45,137
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);
45,138
import de.vanita5.twittnuker.annotation.CustomTabType; import de.vanita5.twittnuker.library.MicroBlog; import de.vanita5.twittnuker.library.MicroBlogException; import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus; import de.vanita5.twittnuker.library.twitter.model.Status; <BUG>import de.vanita5.twittnuker.fragment.AbsStatusesFragment; 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;
45,139
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());
45,140
import java.util.List; import java.util.Map.Entry; import javax.inject.Singleton; import okhttp3.Dns; @Singleton <BUG>public class TwidereDns implements Constants, Dns { </BUG> private static final String RESOLVER_LOGTAG = "TwittnukerDns"; private final SharedPreferences mHostMapping; private final SharedPreferencesWrapper mPreferences;
public class TwidereDns implements Dns, Constants {
45,141
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);
45,142
import org.sonar.api.utils.log.Loggers; import org.sonar.server.computation.component.CrawlerDepthLimit; import org.sonar.server.computation.component.SettingsRepository; import org.sonar.server.computation.component.TypeAwareVisitorAdapter; import org.sonar.server.computation.issue.ComponentIssuesRepository; <BUG>import org.sonar.server.computation.measure.api.MeasureComputerImplementationContext; import org.sonar.server.computation.metric.MetricRepository;</BUG> import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER; public class MeasureComputersVisitor extends TypeAwareVisitorAdapter {
import org.sonar.server.computation.measure.api.MeasureComputerContextImpl; import org.sonar.server.computation.measure.api.MeasureComputerWrapper; import org.sonar.server.computation.metric.MetricRepository;
45,143
this.settings = settings; this.measureComputersHolder = measureComputersHolder; this.componentIssuesRepository = componentIssuesRepository; } @Override <BUG>public void visitAny(org.sonar.server.computation.component.Component component) { for (MeasureComputer computer : measureComputersHolder.getMeasureComputers()) { LOGGER.trace("Measure computer '{}' is computing component {}", computer.getImplementation(), component); MeasureComputerImplementationContext measureComputerContext = new MeasureComputerImplementationContext(component, computer, settings, measureRepository, metricRepository, componentIssuesRepository); computer.getImplementation().compute(measureComputerContext);</BUG> }
[DELETED]
45,144
package org.sonar.server.computation.measure; import com.google.common.base.Predicates; import javax.annotation.CheckForNull; <BUG>import org.sonar.api.ce.measure.MeasureComputer; import static com.google.common.base.Preconditions.checkState;</BUG> import static com.google.common.collect.FluentIterable.from; import static java.util.Objects.requireNonNull; public class MeasureComputersHolderImpl implements MutableMeasureComputersHolder {
import org.sonar.server.computation.measure.api.MeasureComputerWrapper; import static com.google.common.base.Preconditions.checkState;
45,145
super(name); this.value = value; } @Override <BUG>public BigDecimal getDecimal() { return Conversions.convert(value).toDecimal(); } @Override public double getDouble() { </BUG> return value;
public Double getValue() {
45,146
package org.neo4j.kernel.manage; <BUG>import static java.lang.management.ManagementFactory.getPlatformMBeanServer; import java.util.ArrayList;</BUG> import java.util.List; import java.util.Map; import java.util.logging.Logger;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList;
45,147
public void createDynamicConfigurationMBean( Map<Object, Object> params ) { if ( !register( new Configuration( instanceId, params ) ) ) failedToRegister( "ConfigurationMBean" ); } <BUG>public void createMemoryMappingMBean( XaDataSourceManager datasourceMananger ) { NeoStoreXaDataSource datasource = (NeoStoreXaDataSource) datasourceMananger.getXaDataSource( "nioneodb" );</BUG> if ( !register( new MemoryMappingMonitor.MXBeanImplementation(
public void createMemoryMappingMBean( NeoStoreXaDataSource datasource = (NeoStoreXaDataSource) datasourceMananger.getXaDataSource( "nioneodb" );
45,148
{ log.info( "Failed to register " + mBean ); } private final ObjectName objectName; Neo4jJmx( int instanceId ) <BUG>{ StringBuilder identifier = new StringBuilder( "org.neo4j:" );</BUG> identifier.append( "instance=kernel#" ); identifier.append( instanceId ); identifier.append( ",name=" );
if ( !register( new LockManager( instanceId, lockManager ) ) ) failedToRegister( "LockManagerMBean" ); private boolean register( Neo4jJmx bean )
45,149
{ return clazz.getSimpleName();</BUG> } <BUG>try { return iface.getField( "NAME" ).get( null ); } catch ( Exception e ) { } } throw new IllegalStateException( "Invalid Neo4jMonitor implementation." ); } }</BUG>
if ( !register( new LockManager( instanceId, lockManager ) ) ) failedToRegister( "LockManagerMBean" );
45,150
return graphDbImpl.beginTx(); } public Config getConfig() { return graphDbImpl.getConfig(); <BUG>} @Override</BUG> public String toString() { return super.toString() + " [" + graphDbImpl.getStoreDir() + "]";
public <T> T getManagementBean( Class<T> type ) return graphDbImpl.getManagementBean( type ); @Override
45,151
jmx.createTransactionManagerMBean( getConfig().getTxModule() ); jmx.createMemoryMappingMBean( getConfig().getTxModule().getXaDataSourceManager() ); jmx.createXaManagerMBean( getConfig().getTxModule().getXaDataSourceManager() ); } } ); <BUG>} public static Map<String,String> loadConfigurations( String file )</BUG> { Properties props = new Properties(); try
<T> T getManagementBean( Class<T> beanClass ) return Neo4jJmx.getBean( instanceId, beanClass ); public static Map<String,String> loadConfigurations( String file )
45,152
package com.intellij.refactoring.move.moveInner; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; <BUG>import com.intellij.psi.PsiAnonymousClass; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; </BUG> import com.intellij.refactoring.move.MoveCallback;
import com.intellij.psi.*;
45,153
import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; </BUG> import com.intellij.refactoring.move.MoveCallback; import com.intellij.refactoring.util.CommonRefactoringUtil; <BUG>import com.intellij.refactoring.RefactoringBundle; public class MoveInnerImpl {</BUG> private static final Logger LOG = Logger.getInstance("#com.intellij.refactoring.move.moveInner.MoveInnerImpl"); public static final String REFACTORING_NAME = RefactoringBundle.message("move.inner.to.upper.level.title"); public static void doMove(final Project project, PsiElement[] elements, final MoveCallback moveCallback) {
package com.intellij.refactoring.move.moveInner; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.ide.util.PackageChooserDialog; import org.jetbrains.annotations.Nullable; public class MoveInnerImpl {
45,154
package com.intellij.refactoring; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiDocumentManager; <BUG>import com.intellij.psi.PsiManager; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.refactoring.move.moveInner.MoveInnerProcessor; public class MoveInnerTest extends MultiFileTestCase {</BUG> protected String getTestRoot() {
import com.intellij.psi.PsiElement; import com.intellij.refactoring.move.moveInner.MoveInnerImpl; public class MoveInnerTest extends MultiFileTestCase {
45,155
final boolean searchInNonJava) { return new PerformAction() { public void performAction(VirtualFile rootDir, VirtualFile rootAfter) throws Exception { final PsiManager manager = PsiManager.getInstance(myProject); final PsiClass aClass = manager.findClass(innerClassName, GlobalSearchScope.moduleScope(myModule)); <BUG>final MoveInnerProcessor moveInnerProcessor = new MoveInnerProcessor(myProject, null); moveInnerProcessor.setup(aClass, newClassName, passOuterClass, parameterName, searchInComments, searchInNonJava); </BUG> moveInnerProcessor.run();
final PsiElement targetContainer = MoveInnerImpl.getTargetContainer(aClass, false); assertNotNull(targetContainer); searchInComments, searchInNonJava, targetContainer);
45,156
import com.intellij.refactoring.HelpID; import com.intellij.refactoring.RefactoringBundle; import com.intellij.refactoring.RefactoringSettings; import com.intellij.refactoring.move.MoveInstanceMembersUtil; import com.intellij.refactoring.ui.NameSuggestionsField; <BUG>import com.intellij.refactoring.ui.RefactoringDialog; import com.intellij.refactoring.util.RefactoringMessageUtil; import com.intellij.refactoring.util.CommonRefactoringUtil;</BUG> import com.intellij.ui.EditorTextField; import com.intellij.ui.NonFocusableCheckBox;
import com.intellij.refactoring.util.CommonRefactoringUtil;
45,157
return null; } } public boolean isPassOuterClass() { return myCbPassOuterClass.isSelected(); <BUG>} public PsiClass getInnerClass() {</BUG> return myInnerClass; } protected void init() {
@NotNull public PsiClass getInnerClass() {
45,158
panel.add(options, BorderLayout.CENTER); return panel; } protected JComponent createCenterPanel() { return null; <BUG>} protected void doAction() {</BUG> String message = null; final String className = getClassName(); PsiManager manager = PsiManager.getInstance(myProject);
@NotNull public PsiElement getTargetContainer() { return myTargetContainer; protected void doAction() {
45,159
else if (!manager.getNameHelper().isIdentifier(parameterName)) { message = RefactoringMessageUtil.getIncorrectIdentifierMessage(parameterName); } } if (message == null) { <BUG>PsiElement targetContainer = MoveInnerImpl.getTargetContainer(myInnerClass); if (targetContainer instanceof PsiClass) { PsiClass targetClass = (PsiClass)targetContainer; </BUG> PsiClass[] classes = targetClass.getInnerClasses();
if (myTargetContainer instanceof PsiClass) { PsiClass targetClass = (PsiClass)myTargetContainer;
45,160
import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; import com.intellij.refactoring.*; import com.intellij.refactoring.move.moveClassesOrPackages.AutocreatingSingleSourceRootMoveDestination; <BUG>import com.intellij.refactoring.move.moveClassesOrPackages.MultipleRootsMoveDestination; public class RefactoringFactoryImpl extends RefactoringFactory implements ProjectComponent {</BUG> private static final Logger LOG = Logger.getInstance("#com.intellij.refactoring.openapi.impl.RefactoringFactoryImpl"); private final Project myProject; public RefactoringFactoryImpl(Project project) {
import com.intellij.refactoring.move.moveInner.MoveInnerImpl; public class RefactoringFactoryImpl extends RefactoringFactory implements ProjectComponent {
45,161
public void disposeComponent() { } public RenameRefactoring createRename(PsiElement element, String newName) { return new RenameRefactoringImpl(myProject, element, newName, true, true); } <BUG>public MoveInnerRefactoring createMoveInner(PsiClass innerClass, String newName, boolean passOuterClass, String parameterName) { return new MoveInnerRefactoringImpl(myProject, innerClass, newName, passOuterClass, parameterName); </BUG> } public MoveDestination createSourceFolderPreservingMoveDestination(String targetPackage) {
final PsiElement targetContainer = MoveInnerImpl.getTargetContainer(innerClass, false); if (targetContainer == null) return null; return new MoveInnerRefactoringImpl(myProject, innerClass, newName, passOuterClass, parameterName, targetContainer);
45,162
private UsageInfo[] myUsagesAfterRefactoring; public MoveInnerProcessor(Project project, MoveCallback moveCallback) { super(project); myMoveCallback = moveCallback; } <BUG>public MoveInnerProcessor(Project project, PsiClass innerClass, String name, boolean passOuterClass, String parameterName) { super(project); setup(innerClass, name, passOuterClass, parameterName, true, true); </BUG> }
public MoveInnerProcessor(Project project, PsiClass innerClass, String name, boolean passOuterClass, String parameterName, final PsiElement targetContainer) { setup(innerClass, name, passOuterClass, parameterName, true, true, targetContainer);
45,163
return new MoveInnerViewDescriptor(myInnerClass); } @NotNull protected UsageInfo[] findUsages() { PsiManager manager = PsiManager.getInstance(myProject); <BUG>PsiSearchHelper helper = manager.getSearchHelper(); PsiReference[] innerClassRefs = helper.findReferences(myInnerClass, GlobalSearchScope.projectScope(myProject), false);</BUG> ArrayList<UsageInfo> usageInfos = new ArrayList<UsageInfo>(innerClassRefs.length); for (PsiReference innerClassRef : innerClassRefs) { PsiElement ref = innerClassRef.getElement();
LOG.assertTrue(myTargetContainer != null); PsiReference[] innerClassRefs = helper.findReferences(myInnerClass, GlobalSearchScope.projectScope(myProject), false);
45,164
public void setup(final PsiClass innerClass, final String className, final boolean passOuterClass, final String parameterName, boolean searchInComments, <BUG>boolean searchInNonJava) { myNewClassName = className;</BUG> myInnerClass = innerClass; myDescriptiveName = UsageViewUtil.getDescriptiveName(myInnerClass);
boolean searchInNonJava, final @NotNull PsiElement targetContainer) { myNewClassName = className;
45,165
super.clearCaches(); myScriptClass = null; myScriptClassInitialized = false; mySyntheticArgsParameter = null; } <BUG>public GroovyPsiElement getContext() { return myContext;</BUG> } public void setContext(GroovyPsiElement context) { myContext = context;
public PsiElement getContext() { final PsiElement context = super.getContext(); if (context != null) return context; return myContext;
45,166
return response = RpcResponse.BAD_REQUEST; } if (validator.validate(callSign).size() != 0) { return response = RpcResponse.VALIDATION_ERROR; } <BUG>clusterManager.getState().getCallSigns().removeByName(callSign.getName()); clusterManager.getState().getCallSigns().add(callSign);</BUG> if (Settings.getModelSettings().isSavingImmediately()) clusterManager.getState().writeToFile();
if (validator.validate(call).size() != 0) { clusterManager.getState().getCalls().add(call); clusterManager.getTransmissionManager().handleCall(call);
45,167
} else { call.getCallSignNames().remove(callSign); } }); deleteCalls.stream().forEach(call -> clusterManager.getState().getCalls().remove(call)); <BUG>if (!clusterManager.getState().getCallSigns().removeByName(callSign)) { </BUG> return response = RpcResponse.BAD_REQUEST; } else { if (Settings.getModelSettings().isSavingImmediately())
if (clusterManager.getState().getCallSigns().remove(callSign) == null) {
45,168
} ArrayList<News> deleteNews = new ArrayList<>(); clusterManager.getState().getNews().stream().filter(news -> news.getRubricName().equals(rubric)) .forEach(news -> deleteNews.add(news)); deleteNews.stream().forEach(news -> clusterManager.getState().getNews().remove(news)); <BUG>if (!clusterManager.getState().getRubrics().removeByName(rubric)) { </BUG> return response = RpcResponse.BAD_REQUEST; } else { if (Settings.getModelSettings().isSavingImmediately())
}); deleteCalls.stream().forEach(call -> clusterManager.getState().getCalls().remove(call)); if (clusterManager.getState().getCallSigns().remove(callSign) == null) {
45,169
return response = RpcResponse.BAD_REQUEST; } if (validator.validate(transmitterGroup).size() != 0) { return response = RpcResponse.VALIDATION_ERROR; } <BUG>clusterManager.getState().getTransmitterGroups().removeByName(transmitterGroup.getName()); clusterManager.getState().getTransmitterGroups().add(transmitterGroup);</BUG> if (Settings.getModelSettings().isSavingImmediately()) clusterManager.getState().writeToFile();
} else { String myNodeName = clusterManager.getChannel().getName(); if (transmitter.getNodeName().equals(myNodeName)) { clusterManager.getTransmitterManager().removeTransmitter(transmitter);
45,170
} else { call.getTransmitterGroupNames().remove(transmitterGroup); } }); deleteCalls.stream().forEach(call -> clusterManager.getState().getCalls().remove(call)); <BUG>if (!clusterManager.getState().getTransmitterGroups().removeByName(transmitterGroup)) { </BUG> return response = RpcResponse.BAD_REQUEST; } else { if (Settings.getModelSettings().isSavingImmediately())
transmitterGroup.getTransmitterNames().remove(transmitterName); deleteTransmitterGroupNames.stream().forEach(name -> deleteTransmitterGroup(name)); Transmitter transmitter = clusterManager.getState().getTransmitters().remove(transmitterName); if (transmitter == null) {
45,171
return response = RpcResponse.BAD_REQUEST; } if (validator.validate(user).size() != 0) { return response = RpcResponse.VALIDATION_ERROR; } <BUG>clusterManager.getState().getUsers().removeByName(user.getName()); clusterManager.getState().getUsers().add(user);</BUG> if (Settings.getModelSettings().isSavingImmediately()) clusterManager.getState().writeToFile();
} else { String myNodeName = clusterManager.getChannel().getName(); if (transmitter.getNodeName().equals(myNodeName)) { clusterManager.getTransmitterManager().removeTransmitter(transmitter);
45,172
ArrayList<News> deleteNews = new ArrayList<>(); clusterManager.getState().getNews().stream().filter(news -> news.getOwnerName().equals(user)) .forEach(news -> deleteNews.add(news)); deleteNews.stream().forEach(news -> clusterManager.getState().getNews().remove(news)); ArrayList<String> deleteRubricNames = new ArrayList<>(); <BUG>clusterManager.getState().getRubrics().stream().filter(rubric -> rubric.getOwnerNames().contains(user)) .forEach(rubric -> { if (rubric.getOwnerNames().size() == 1) {</BUG> deleteRubricNames.add(rubric.getName()); } else {
clusterManager.getState().getRubrics().values().stream() .filter(rubric -> rubric.getOwnerNames().contains(user)).forEach(rubric -> { if (rubric.getOwnerNames().size() == 1) {
45,173
rubric.getOwnerNames().remove(user); } }); deleteRubricNames.stream().forEach(name -> deleteRubric(name)); ArrayList<String> deleteTransmitterGroupNames = new ArrayList<>(); <BUG>clusterManager.getState().getTransmitterGroups().stream() </BUG> .filter(transmitterGroup -> transmitterGroup.getOwnerNames().contains(user)) .forEach(transmitterGroup -> { if (transmitterGroup.getOwnerNames().size() == 1) {
clusterManager.getState().getTransmitterGroups().values().stream()
45,174
transmitterGroup.getOwnerNames().remove(user); } }); deleteTransmitterGroupNames.stream().forEach(name -> deleteTransmitterGroup(name)); ArrayList<String> deleteTransmitterNames = new ArrayList<>(); <BUG>clusterManager.getState().getTransmitters().stream() </BUG> .filter(transmitter -> transmitter.getOwnerNames().contains(user)).forEach(transmitter -> { if (transmitter.getOwnerNames().size() == 1) { deleteTransmitterNames.add(transmitter.getName());
clusterManager.getState().getTransmitters().values().stream()
45,175
Address sender = msg.getSrc(); if (clusterManager == null) { logger.error("Authentication has no reference to ClusterManager"); return false; } <BUG>Node node = clusterManager.getState().getNodes().findByName(sender.toString()); </BUG> if (node == null) { logger.warn("Authentication of Node " + sender.toString() + " failed: Unknown node"); return false;
Node node = clusterManager.getState().getNodes().get(sender.toString());
45,176
public static void setState(State statePar) { state = statePar; } @ValidName(message = "must contain names of existing transmitterGroups", fieldName = "transmitterGroupNames", constraintName = "ValidTransmitterGroupNames") public ArrayList<TransmitterGroup> getTransmitterGroups() throws Exception { <BUG>if (state == null) throw new Exception("StateNotSetException"); ArrayList<TransmitterGroup> transmitterGroups = new ArrayList<>(); if (transmitterGroupNames == null) return null; for (String transmitterGroup : transmitterGroupNames) { if (state.getTransmitterGroups().contains(transmitterGroup)) transmitterGroups.add(state.getTransmitterGroups().findByName(transmitterGroup));</BUG> }
if (state == null) { if (transmitterGroupNames == null) {
45,177
logger.catching(e); DAPNETCore.stopDAPNETCore(); } if (clusterManager.getChannel().getView().size() == 1) { printCreateClusterWarning(); <BUG>if (clusterManager.getState().getNodes().contains(channel.getName())) { </BUG> updateFirstNode(); } else { createFirstNode();
if (clusterManager.getState().getNodes().containsKey(channel.getName())) {
45,178
.getAuthValue(); } public void checkQuorum() { int activeNodeCount = 0; // Count of online and unknown Nodes int onlineNodeCount = 0; <BUG>for (Node node : state.getNodes()) { </BUG> if (node.getStatus() != Node.Status.SUSPENDED)// Node is in UNKNOWN activeNodeCount++; if (node.getStatus() == Node.Status.ONLINE)
for (Node node : state.getNodes().values()) {
45,179
import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.os.Handler; <BUG>import android.support.v4.app.NavUtils; import android.support.v7.app.AppCompatActivity;</BUG> import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.ContextMenu;
import android.support.v4.view.MenuItemCompat; import android.support.v7.app.AppCompatActivity;
45,180
import android.database.ContentObserver; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.os.Handler; <BUG>import android.support.v4.app.NavUtils; import android.support.v7.app.AppCompatActivity;</BUG> import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.ContextMenu;
import android.support.v4.view.MenuItemCompat; import android.support.v7.app.AppCompatActivity;
45,181
import android.os.Handler; import android.os.Looper; import android.os.PowerManager; import android.os.PowerManager.WakeLock; import android.preference.PreferenceManager; <BUG>import android.support.design.widget.FloatingActionButton; import android.support.v7.widget.Toolbar;</BUG> import android.util.Log; import android.view.ContextMenu; import android.view.KeyEvent;
import android.support.v4.view.MenuItemCompat; import android.support.v7.widget.Toolbar;
45,182
mAltitude.setOnCheckedChangeListener(mCheckedChangeListener); mDistance.setOnCheckedChangeListener(mCheckedChangeListener); mCompass.setOnCheckedChangeListener(mCheckedChangeListener); mLocation.setOnCheckedChangeListener(mCheckedChangeListener); builder.setTitle(R.string.dialog_layer_title).setIcon(android.R.drawable.ic_dialog_map).setPositiveButton <BUG>(R.string.btn_okay, null).setView(view); </BUG> dialog = builder.create(); return dialog; case DIALOG_NOTRACK:
(android.R.string.ok, null).setView(view);
45,183
bootstrap.setOption("receiveBufferSizePredictorFactory", new FixedReceiveBufferSizePredictorFactory(8192)); bootstrap.setOption("child.receiveBufferSize", getRecvBufferSize()); return bootstrap; } @Override <BUG>protected List<Pair<String, ? extends ChannelHandler>> getBaseChannelHandlers(MessageInput input) { final List<Pair<String, ? extends ChannelHandler>> baseChannelHandlers = super.getBaseChannelHandlers(input); baseChannelHandlers.add(Pair.of("connection-counter", connectionCounter)); </BUG> return baseChannelHandlers;
protected LinkedHashMap<String, Callable<? extends ChannelHandler>> getBaseChannelHandlers( final LinkedHashMap<String, Callable<? extends ChannelHandler>> baseChannelHandlers = baseChannelHandlers.put("connection-counter", Callables.returning(connectionCounter));
45,184
package org.graylog2.inputs.transports; <BUG>import com.google.common.collect.Lists; </BUG> import com.google.inject.assistedinject.Assisted; import com.google.inject.assistedinject.AssistedInject; import org.graylog2.plugin.ConfigClass;
import com.google.common.collect.Maps;
45,185
</BUG> return new ChannelPipelineFactory() { @Override public ChannelPipeline getPipeline() throws Exception { <BUG>ChannelPipeline p = Channels.pipeline(); for (Pair<String, ? extends ChannelHandler> pair : handlerList) { p.addLast(pair.first(), pair.second()); }</BUG> return p;
? configuration.getInt(CK_RECV_BUFFER_SIZE) : MessageInput.getDefaultRecvBufferSize(); this.localRegistry = localRegistry; localRegistry.registerAll(MetricSets.of(throughputCounter.gauges())); } private ChannelPipelineFactory getPipelineFactory(final LinkedHashMap<String, Callable<? extends ChannelHandler>> handlerList) { final ChannelPipeline p = Channels.pipeline(); for (final Map.Entry<String, Callable<? extends ChannelHandler>> entry : handlerList.entrySet()) { p.addLast(entry.getKey(), entry.getValue().call());
45,186
public void setMessageAggregator(@Nullable CodecAggregator aggregator) { this.aggregator = aggregator; } @Override public void launch(final MessageInput input) throws MisfireException { <BUG>final List<Pair<String, ? extends ChannelHandler>> handlerList = getBaseChannelHandlers(input); final List<Pair<String, ? extends ChannelHandler>> finalChannelHandlers = getFinalChannelHandlers(input); handlerList.addAll(finalChannelHandlers); </BUG> try {
final LinkedHashMap<String, Callable<? extends ChannelHandler>> handlerList = getBaseChannelHandlers(input); final LinkedHashMap<String, Callable<? extends ChannelHandler>> finalHandlers = getFinalChannelHandlers(input); handlerList.putAll(finalHandlers);
45,187
r.addField(ConfigurationRequest.Templates.portNumber(CK_PORT, 5555)); r.addField(ConfigurationRequest.Templates.recvBufferSize(CK_RECV_BUFFER_SIZE, 1024 * 1024)); return r; } protected abstract Bootstrap getBootstrap(); <BUG>protected List<Pair<String, ? extends ChannelHandler>> getBaseChannelHandlers(MessageInput input) { List<Pair<String, ? extends ChannelHandler>> handlerList = Lists.newArrayList(); handlerList.add(Pair.of("packet-meta-dumper", new PacketInformationDumper(input))); handlerList.add(Pair.of("traffic-counter", throughputCounter)); </BUG> return handlerList;
[DELETED]
45,188
package org.graylog2.inputs.transports; <BUG>import com.google.common.collect.Lists; </BUG> import com.google.inject.assistedinject.Assisted; import com.google.inject.assistedinject.AssistedInject; import org.graylog2.plugin.ConfigClass;
import com.google.common.collect.Maps;
45,189
workerPoolProvider, connectionCounter); enableCors = configuration.getBoolean(CK_ENABLE_CORS); } @Override <BUG>protected List<Pair<String, ? extends ChannelHandler>> getBaseChannelHandlers(MessageInput input) { final List<Pair<String, ? extends ChannelHandler>> baseChannelHandlers = super.getBaseChannelHandlers(input); baseChannelHandlers.add(Pair.of("decoder", new HttpRequestDecoder())); baseChannelHandlers.add(Pair.of("encoder", new HttpResponseEncoder())); baseChannelHandlers.add(Pair.of("decompressor", new HttpContentDecompressor())); return baseChannelHandlers;</BUG> }
[DELETED]
45,190
baseChannelHandlers.add(Pair.of("encoder", new HttpResponseEncoder())); baseChannelHandlers.add(Pair.of("decompressor", new HttpContentDecompressor())); return baseChannelHandlers;</BUG> } @Override <BUG>protected List<Pair<String, ? extends ChannelHandler>> getFinalChannelHandlers(MessageInput input) { final List<Pair<String, ? extends ChannelHandler>> handlers = Lists.newArrayList(); handlers.add(Pair.of("http-handler", new Handler(enableCors))); handlers.addAll(super.getFinalChannelHandlers(input)); </BUG> return handlers;
workerPoolProvider, connectionCounter); enableCors = configuration.getBoolean(CK_ENABLE_CORS); protected LinkedHashMap<String, Callable<? extends ChannelHandler>> getBaseChannelHandlers(MessageInput input) { final LinkedHashMap<String, Callable<? extends ChannelHandler>> baseChannelHandlers = super.getBaseChannelHandlers(input); baseChannelHandlers.put("decoder", new Callable<ChannelHandler>() { public ChannelHandler call() throws Exception { return new HttpRequestDecoder();
45,191
package mousio.etcd4j.responses; <BUG>public class EtcdAuthenticationException extends Exception { public EtcdAuthenticationException(</BUG> final String message) { super(message); }
import static mousio.etcd4j.responses.EtcdResponseDecoders.StringToObjectDecoder; public static final EtcdResponseDecoder<EtcdAuthenticationException> DECODER = new StringToObjectDecoder<EtcdAuthenticationException>() { @Override protected EtcdAuthenticationException newInstance(String message) { return new EtcdAuthenticationException(message); }; public EtcdAuthenticationException(
45,192
package mousio.etcd4j.transport; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; <BUG>import io.netty.handler.codec.http.FullHttpResponse; import io.netty.handler.codec.http.HttpResponseStatus;</BUG> import io.netty.util.concurrent.Promise; import mousio.client.exceptions.PrematureDisconnectException; import mousio.etcd4j.requests.EtcdRequest;
import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpResponseStatus;
45,193
import mousio.client.retry.RetryPolicy; import mousio.etcd4j.responses.EtcdResponseDecoders; import mousio.etcd4j.transport.EtcdClientImpl; public class EtcdOldVersionRequest extends AbstractEtcdRequest<String> { public EtcdOldVersionRequest(EtcdClientImpl clientImpl, RetryPolicy retryHandler) { <BUG>super("/version", clientImpl, HttpMethod.GET, retryHandler, EtcdResponseDecoders.STINRG); </BUG> } @Override public EtcdOldVersionRequest setRetryPolicy(RetryPolicy retryPolicy) {
super("/version", clientImpl, HttpMethod.GET, retryHandler, EtcdResponseDecoders.STRING_DECODER);
45,194
public class EtcdResponseDecoders { protected static final CharSequence X_ETCD_CLUSTER_ID = "X-Etcd-Cluster-Id"; protected static final CharSequence X_ETCD_INDEX = "X-Etcd-Index"; protected static final CharSequence X_RAFT_INDEX = "X-Raft-Index"; protected static final CharSequence X_RAFT_TERM = "X-Raft-Term"; <BUG>public static final EtcdResponseDecoder<String> STINRG = new StringDecoder(); </BUG> private static final ObjectMapper MAPPER = new ObjectMapper() .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) .registerModules(new AfterburnerModule());
public static final EtcdResponseDecoder<String> STRING_DECODER = new StringDecoder();
45,195
import com.intellij.icons.AllIcons; import com.intellij.idea.ActionsBundle; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; <BUG>import com.intellij.openapi.ui.MessageType; import com.intellij.openapi.vcs.FilePath;</BUG> import com.intellij.openapi.vcs.FileStatus; import com.intellij.openapi.vcs.ProjectLevelVcsManager; import com.intellij.openapi.vcs.VcsDataKeys;
import com.intellij.openapi.util.Condition; import com.intellij.openapi.vcs.FilePath;
45,196
import com.intellij.openapi.vcs.changes.ui.ChangesListView; import com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager; import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.wm.ToolWindow; <BUG>import com.intellij.openapi.wm.ToolWindowManager; import com.intellij.vcsUtil.VcsUtil; import gnu.trove.THashSet;</BUG> import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable;
import com.intellij.util.ArrayUtil; import com.intellij.util.ObjectUtils; import com.intellij.util.containers.ContainerUtil;
45,197
public MoveChangesToAnotherListAction() { super(ActionsBundle.actionText(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST), ActionsBundle.actionDescription(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST), AllIcons.Actions.MoveToAnotherChangelist); } <BUG>public void update(AnActionEvent e) { final boolean isEnabled = isEnabled(e); if (ActionPlaces.isPopupPlace(e.getPlace())) { e.getPresentation().setVisible(isEnabled); </BUG> }
public void update(@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(isEnabled);
45,198
import com.intellij.openapi.vcs.AbstractVcs; import com.intellij.openapi.vcs.VcsBundle; import com.intellij.openapi.vcs.VcsDataKeys; import com.intellij.openapi.vcs.changes.*; import com.intellij.openapi.vcs.changes.actions.MoveChangesToAnotherListAction; <BUG>import com.intellij.openapi.vcs.changes.actions.RollbackDialogAction; import com.intellij.ui.ColoredListCellRendererWrapper;</BUG> import com.intellij.ui.SimpleTextAttributes; import com.intellij.util.EventDispatcher; import com.intellij.util.ObjectUtils;
import com.intellij.openapi.vfs.VirtualFile; import com.intellij.ui.ColoredListCellRendererWrapper;
45,199
Change change = e.getData(VcsDataKeys.CURRENT_CHANGE); if (change == null) return false; return super.isEnabled(e); <BUG>} public void actionPerformed(AnActionEvent e) { Change change = e.getData(VcsDataKeys.CURRENT_CHANGE); askAndMove(myProject, Collections.singletonList(change), null); </BUG> }
[DELETED]
45,200
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.*;