id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
44,601 | for (User user : users) {
userCount++;</BUG>
if (user.getVerified() == Verification.VERIFIED) {
continue;
<BUG>}
userNameMap.put(user, user.getDisplayName());</BUG>
for (OtrClient client : user.getOtrClients()) {
if (client.getVerified() == Verification.VERIFIED) {
continue;
}
| userCount++;
userNameMap.put(user, user.getDisplayName());
|
44,602 | 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);
}
|
44,603 | if (chosenCard != null && sourceObject != null && controller != null) {
Player owner = game.getPlayer(chosenCard.getOwnerId());
if (owner == null) {
return false;
}
<BUG>FilterCard filterNamedCards = new FilterCard();
filterNamedCards.add(new NamePredicate(chosenCard.getName()));
for (Card checkCard : owner.getGraveyard().getCards(game)) {</BUG>
if (checkCard.getName().equals(chosenCard.getName())) {
controller.moveCardToExileWithInfo(checkCard, null, "", source.getSourceId(), game, Zone.GRAVEYARD);
| FilterCard filterNamedCard = new FilterCard();
filterNamedCard.add(new NamePredicate(chosenCard.getName()));
for (Card checkCard : owner.getGraveyard().getCards(game)) {
|
44,604 | package com.intellij.codeInsight.template;
import com.intellij.codeInsight.template.impl.TemplateImpl;
<BUG>import com.intellij.codeInsight.template.impl.Variable;
import com.intellij.openapi.diagnostic.Logger;</BUG>
import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.containers.HashMap;
import com.intellij.util.containers.HashSet;
| import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
|
44,605 | import com.intellij.openapi.editor.event.CaretEvent;
import com.intellij.openapi.editor.event.DocumentAdapter;
import com.intellij.openapi.editor.event.DocumentEvent;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.text.StringUtil;
<BUG>import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiElement;</BUG>
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiFileFactory;
import com.intellij.psi.codeStyle.CodeStyleManager;
| import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
|
44,606 | }
@Nullable
public static String calculateTemplateText(@NotNull Editor editor, @NotNull PsiFile file, boolean expandPrimitiveAbbreviations) {
if (file instanceof XmlFile) {
final Ref<TemplateImpl> generatedTemplate = new Ref<TemplateImpl>();
<BUG>CustomTemplateCallback callback = createCallback(editor, file, generatedTemplate);
PsiElement context = callback.getContext();</BUG>
ZenCodingGenerator generator = ZenCodingTemplate.findApplicableDefaultGenerator(context, false);
if (generator != null) {
final String templatePrefix = new ZenCodingTemplate().computeTemplateKeyWithoutContextChecking(callback);
| PsiDocumentManager.getInstance(file.getProject()).commitDocument(editor.getDocument());
PsiElement context = callback.getContext();
|
44,607 | import com.intellij.codeInsight.hint.HintManagerImpl;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.*;
import com.intellij.openapi.editor.colors.EditorColors;
<BUG>import com.intellij.openapi.editor.colors.EditorColorsScheme;
import com.intellij.openapi.editor.event.EditorFactoryAdapter;</BUG>
import com.intellij.openapi.editor.event.EditorFactoryEvent;
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.editor.impl.EditorImpl;
| import com.intellij.openapi.editor.event.DocumentAdapter;
import com.intellij.openapi.editor.event.DocumentEvent;
import com.intellij.openapi.editor.event.EditorFactoryAdapter;
|
44,608 | import com.intellij.ui.components.JBPanel;
import com.intellij.util.Alarm;
import com.intellij.util.DocumentUtil;
import com.intellij.util.Producer;
import org.jetbrains.annotations.NotNull;
<BUG>import org.jetbrains.annotations.Nullable;
import javax.swing.*;</BUG>
import java.awt.*;
public class EmmetPreviewHint extends LightweightHint implements Disposable {
private static final Key<EmmetPreviewHint> KEY = new Key<EmmetPreviewHint>("emmet.preview");
| import org.jetbrains.annotations.TestOnly;
import javax.swing.*;
|
44,609 | EditorFactory.getInstance().releaseEditor(myEditor);
}
}
@NotNull
private Pair<Point, Short> guessPosition() {
<BUG>JLayeredPane layeredPane = myParentEditor.getContentComponent().getRootPane().getLayeredPane();
LogicalPosition logicalPosition = myParentEditor.getCaretModel().getLogicalPosition();</BUG>
LogicalPosition pos = new LogicalPosition(logicalPosition.line, logicalPosition.column);
Point p1 = HintManagerImpl.getHintPosition(this, myParentEditor, pos, HintManager.UNDER);
| JRootPane rootPane = myParentEditor.getContentComponent().getRootPane();
JComponent layeredPane = rootPane != null ? rootPane.getLayeredPane() : myParentEditor.getComponent();
LogicalPosition logicalPosition = myParentEditor.getCaretModel().getLogicalPosition();
|
44,610 | Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.tab_qibla, container, false);
final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass);
qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north),
((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla));
<BUG>sOrientationListener = new SensorListener() {
</BUG>
public void onSensorChanged(int s, float v[]) {
float northDirection = v[SensorManager.DATA_X];
qiblaCompassView.setDirections(northDirection, sQiblaDirection);
| sOrientationListener = new android.hardware.SensorListener() {
|
44,611 | ConsoleView console = new TextConsoleBuilderImpl(myProject).getConsole();
final MyProcessHandler processHandler = new MyProcessHandler();
console.attachToProcess(processHandler);
final List<ExternalTaskPojo> tasks = ContainerUtilRt.newArrayList();
for (String taskName : mySettings.getTaskNames()) {
<BUG>tasks.add(new ExternalTaskPojo(taskName, mySettings.getExternalProjectPath(), null));
</BUG>
}
if (tasks.isEmpty()) {
throw new ExecutionException(ExternalSystemBundle.message("run.error.undefined.task"));
| tasks.add(new ExternalTaskPojo(taskName, mySettings.getExternalProjectPath(), null, null));
|
44,612 | package com.intellij.openapi.externalSystem.model;
import com.intellij.notification.NotificationGroup;
import com.intellij.openapi.actionSystem.DataKey;
<BUG>import com.intellij.openapi.externalSystem.model.serialization.ExternalTaskPojo;
import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel;</BUG>
import org.jetbrains.annotations.NotNull;
public class ExternalSystemDataKeys {
@NotNull public static final DataKey<ProjectSystemId> EXTERNAL_SYSTEM_ID = DataKey.create("external.system.id");
| import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemRecentTaskListModel;
import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel;
|
44,613 | @NonNls @NotNull public static final String LINKED_PROJECT_PATH_KEY = "external.linked.project.path";
@NonNls @NotNull public static final String TOOL_WINDOW_TOOLBAR_ACTIONS_GROUP_ID = "ExternalSystem.ToolWindow.Toolbar";
@NonNls @NotNull public static final String TREE_ACTIONS_GROUP_ID = "ExternalSystem.Tree.Context";
@NonNls @NotNull public static final String TOOL_WINDOW_PLACE = "ExternalSystem.ToolWindow";
@NonNls @NotNull public static final String TREE_PLACE = "ExternalSystem.Tree";
<BUG>public static final boolean VERBOSE_PROCESSING = SystemProperties.getBooleanProperty("external.system.verbose.processing", false);
public static final char PATH_SEPARATOR = '/';</BUG>
public static final int BUILTIN_SERVICE_ORDER = 42;
public static final int BUILTIN_TOOL_WINDOW_SERVICE_ORDER = 62;
public static final int UNORDERED = 1000;
| public static final int RECENT_TASKS_NUMBER = SystemProperties.getIntProperty("external.system.recent.tasks.number", 5);
public static final char PATH_SEPARATOR = '/';
|
44,614 | package com.cronutils.model.time.generator;
import java.util.Collections;
<BUG>import java.util.List;
import org.apache.commons.lang3.Validate;</BUG>
import com.cronutils.model.field.CronField;
import com.cronutils.model.field.expression.FieldExpression;
public abstract class FieldValueGenerator {
| import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.Validate;
|
44,615 | import java.util.ResourceBundle;
import java.util.function.Function;</BUG>
class DescriptionStrategyFactory {
private DescriptionStrategyFactory() {}
public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression) {
<BUG>final Function<Integer, String> nominal = integer -> new DateTime().withDayOfWeek(integer).dayOfWeek().getAsText(bundle.getLocale());
</BUG>
NominalDescriptionStrategy dow = new NominalDescriptionStrategy(bundle, nominal, expression);
dow.addDescription(fieldExpression -> {
if (fieldExpression instanceof On) {
| import java.util.function.Function;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
final Function<Integer, String> nominal = integer -> DayOfWeek.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale());
|
44,616 | return dom;
}
public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) {
return new NominalDescriptionStrategy(
bundle,
<BUG>integer -> new DateTime().withMonthOfYear(integer).monthOfYear().getAsText(bundle.getLocale()),
expression</BUG>
);
}
public static DescriptionStrategy plainInstance(ResourceBundle bundle, final FieldExpression expression) {
| integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()),
expression
|
44,617 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.mapper.WeekDay;</BUG>
import com.cronutils.model.field.CronField;
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.constraint.FieldConstraintsBuilder;
| import java.time.LocalDate;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.Validate;
import com.cronutils.mapper.WeekDay;
|
44,618 | import com.cronutils.model.field.expression.Between;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.parser.CronParserField;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
<BUG>import org.apache.commons.lang3.Validate;
import org.joda.time.DateTime;
import java.util.Collections;
import java.util.List;
import java.util.Set;</BUG>
class BetweenDayOfWeekValueGenerator extends FieldValueGenerator {
| [DELETED] |
44,619 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
| import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.List;
import org.apache.commons.lang3.Validate;
import com.cronutils.model.field.CronField;
|
44,620 | import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
import com.google.common.collect.Lists;
<BUG>import org.apache.commons.lang3.Validate;
import org.joda.time.DateTime;
import java.util.List;</BUG>
class OnDayOfMonthValueGenerator extends FieldValueGenerator {
private int year;
| package com.cronutils.model.time.generator;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.List;
import com.cronutils.model.field.CronField;
|
44,621 | class OnDayOfMonthValueGenerator extends FieldValueGenerator {
private int year;
private int month;
public OnDayOfMonthValueGenerator(CronField cronField, int year, int month) {
super(cronField);
<BUG>Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of month");
this.year = year;</BUG>
this.month = month;
}
| Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" +
" month");
this.year = year;
|
44,622 | package com.cronutils.mapper;
public class ConstantsMapper {
private ConstantsMapper() {}
public static final WeekDay QUARTZ_WEEK_DAY = new WeekDay(2, false);
<BUG>public static final WeekDay JODATIME_WEEK_DAY = new WeekDay(1, false);
</BUG>
public static final WeekDay CRONTAB_WEEK_DAY = new WeekDay(1, true);
public static int weekDayMapping(WeekDay source, WeekDay target, int weekday){
return source.mapTo(weekday, target);
| public static final WeekDay JAVA8 = new WeekDay(1, false);
|
44,623 | return nextMatch;
} catch (NoSuchValueException e) {
throw new IllegalArgumentException(e);
}
}
<BUG>DateTime nextClosestMatch(DateTime date) throws NoSuchValueException {
</BUG>
List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear());
TimeNode days = null;
int lowestMonth = months.getValues().get(0);
| ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException {
|
44,624 | boolean questionMarkSupported =
cronDefinition.getFieldDefinition(DAY_OF_WEEK).getConstraints().getSpecialChars().contains(QUESTION_MARK);
if(questionMarkSupported){
return new TimeNode(
generateDayCandidatesQuestionMarkSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
44,625 | )
);
}else{
return new TimeNode(
generateDayCandidatesQuestionMarkNotSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
44,626 | }
public DateTime lastExecution(DateTime date){
</BUG>
Validate.notNull(date);
try {
<BUG>DateTime previousMatch = previousClosestMatch(date);
</BUG>
if(previousMatch.equals(date)){
previousMatch = previousClosestMatch(date.minusSeconds(1));
}
| public java.time.Duration timeToNextExecution(ZonedDateTime date){
return java.time.Duration.between(date, nextExecution(date));
public ZonedDateTime lastExecution(ZonedDateTime date){
ZonedDateTime previousMatch = previousClosestMatch(date);
|
44,627 | return previousMatch;
} catch (NoSuchValueException e) {
throw new IllegalArgumentException(e);
}
}
<BUG>public Duration timeFromLastExecution(DateTime date){
return new Interval(lastExecution(date), date).toDuration();
}
public boolean isMatch(DateTime date){
</BUG>
return nextExecution(lastExecution(date)).equals(date);
| [DELETED] |
44,628 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.google.common.annotations.VisibleForTesting;
| import java.time.ZonedDateTime;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cronutils.model.field.CronField;
|
44,629 | import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
<BUG>import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;</BUG>
class EveryFieldValueGenerator extends FieldValueGenerator {
| package com.cronutils.model.time.generator;
import java.time.ZonedDateTime;
import java.util.List;
import com.cronutils.model.field.CronField;
|
44,630 | private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class);
public EveryFieldValueGenerator(CronField cronField) {
super(cronField);
log.trace(String.format(
"processing \"%s\" at %s",
<BUG>cronField.getExpression().asString(), DateTime.now()
</BUG>
));
}
@Override
| cronField.getExpression().asString(), ZonedDateTime.now()
|
44,631 | package org.weasis.dicom.codec;
<BUG>import java.net.URI;
import java.util.Hashtable;</BUG>
import java.util.List;
import org.dcm4che3.data.ItemPointer;
import org.dcm4che3.data.Tag;
| import java.io.IOException;
import java.util.Dictionary;
import java.util.Hashtable;
|
44,632 | case UN:
return length > 64;
}
return false;
}
<BUG>};
@Override</BUG>
public String[] getReaderMIMETypes() {
return new String[] { DicomMediaIO.MIMETYPE, DicomMediaIO.SERIES_XDSI, DicomMediaIO.IMAGE_MIMETYPE,
DicomMediaIO.SERIES_VIDEO_MIMETYPE, DicomMediaIO.SERIES_ENCAP_DOC_MIMETYPE };
| private final RLEImageReaderSpi rleImageReaderSpi = new RLEImageReaderSpi();
@Override
|
44,633 | import org.dcm4che3.image.Overlays;
import org.dcm4che3.image.PhotometricInterpretation;
import org.dcm4che3.imageio.codec.ImageReaderFactory;
import org.dcm4che3.imageio.codec.jpeg.PatchJPEGLS;
import org.dcm4che3.imageio.codec.jpeg.PatchJPEGLSImageInputStream;
<BUG>import org.dcm4che3.imageio.plugins.dcm.DicomImageReadParam;
import org.dcm4che3.imageio.plugins.dcm.DicomMetaData;</BUG>
import org.dcm4che3.imageio.stream.ImageInputStreamAdapter;
import org.dcm4che3.imageio.stream.SegmentedInputImageStream;
import org.dcm4che3.io.DicomInputStream;
| import org.dcm4che3.imageio.plugins.dcm.DicomImageReaderSpi;
import org.dcm4che3.imageio.plugins.dcm.DicomMetaData;
|
44,634 | return new RejectedKOSpecialElement(mediaIO);
}
return new KOSpecialElement(mediaIO);
}
});
<BUG>}
private static final SoftHashMap<DicomMediaIO, DicomMetaData> HEADER_CACHE =</BUG>
new SoftHashMap<DicomMediaIO, DicomMetaData>() {
@Override
public void removeElement(Reference<? extends DicomMetaData> soft) {
| static final DicomImageReaderSpi dicomImageReaderSpi = new DicomImageReaderSpi();
private static final SoftHashMap<DicomMediaIO, DicomMetaData> HEADER_CACHE =
|
44,635 | private boolean skipLargePrivate = true;
private volatile boolean readingHeader = false;
private volatile boolean readingImage = false;
private final FileCache fileCache;
public DicomMediaIO(URI uri) {
<BUG>super(DicomCodec.DicomImageReaderSpi);
this.uri = Objects.requireNonNull(uri);</BUG>
this.numberOfFrame = 0;
this.tags = new HashMap<>();
this.mimeType = MIMETYPE;
| super(dicomImageReaderSpi);
this.uri = Objects.requireNonNull(uri);
|
44,636 | package org.weasis.dicom.au;
import java.util.Map;
import javax.swing.Icon;
<BUG>import javax.swing.ImageIcon;
import org.weasis.core.api.explorer.DataExplorerView;</BUG>
import org.weasis.core.api.explorer.model.DataExplorerModel;
import org.weasis.core.api.image.GridBagLayoutModel;
import org.weasis.core.api.media.data.MediaElement;
| import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.Deactivate;
import org.weasis.core.api.explorer.DataExplorerView;
|
44,637 | 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 {
|
44,638 | 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));
|
44,639 | } 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()
|
44,640 |
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));
|
44,641 | 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));
|
44,642 | 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 {
|
44,643 | 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);
|
44,644 | super.install(statusBar);
final EditorEventMulticaster multicaster = EditorFactory.getInstance().getEventMulticaster();
multicaster.addCaretListener(this, this);
multicaster.addSelectionListener(this, this);
}
<BUG>private static void appendLogicalPosition(LogicalPosition caret, StringBuilder message) {
message.append(caret.line + 1);
message.append(":");
message.append(caret.column + 1);
}</BUG>
@Override
| [DELETED] |
44,645 | package org.glowroot.agent.config;
import com.google.common.collect.ImmutableList;
<BUG>import org.immutables.value.Value;
import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;</BUG>
@Value.Immutable
public abstract class UiConfig {
@Value.Default
| import org.glowroot.common.config.ConfigDefaults;
import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;
|
44,646 | class RepoAdminImpl implements RepoAdmin {
private final DataSource dataSource;
private final List<CappedDatabase> rollupCappedDatabases;
private final CappedDatabase traceCappedDatabase;
private final ConfigRepository configRepository;
<BUG>private final AgentDao agentDao;
</BUG>
private final GaugeValueDao gaugeValueDao;
private final GaugeNameDao gaugeNameDao;
private final TransactionTypeDao transactionTypeDao;
| private final EnvironmentDao agentDao;
|
44,647 | private final TransactionTypeDao transactionTypeDao;
private final FullQueryTextDao fullQueryTextDao;
private final TraceAttributeNameDao traceAttributeNameDao;
RepoAdminImpl(DataSource dataSource, List<CappedDatabase> rollupCappedDatabases,
CappedDatabase traceCappedDatabase, ConfigRepository configRepository,
<BUG>AgentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao,
</BUG>
TransactionTypeDao transactionTypeDao, FullQueryTextDao fullQueryTextDao,
TraceAttributeNameDao traceAttributeNameDao) {
this.dataSource = dataSource;
| EnvironmentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao,
|
44,648 | this.fullQueryTextDao = fullQueryTextDao;
this.traceAttributeNameDao = traceAttributeNameDao;
}
@Override
public void deleteAllData() throws Exception {
<BUG>Environment environment = agentDao.readEnvironment("");
dataSource.deleteAll();</BUG>
agentDao.reinitAfterDeletingDatabase();
gaugeValueDao.reinitAfterDeletingDatabase();
gaugeNameDao.invalidateCache();
| Environment environment = agentDao.read("");
dataSource.deleteAll();
|
44,649 | public class SimpleRepoModule {
private static final long SNAPSHOT_REAPER_PERIOD_MINUTES = 5;
private final DataSource dataSource;
private final ImmutableList<CappedDatabase> rollupCappedDatabases;
private final CappedDatabase traceCappedDatabase;
<BUG>private final AgentDao agentDao;
private final TransactionTypeDao transactionTypeDao;</BUG>
private final AggregateDao aggregateDao;
private final TraceAttributeNameDao traceAttributeNameDao;
private final TraceDao traceDao;
| private final EnvironmentDao environmentDao;
private final TransactionTypeDao transactionTypeDao;
|
44,650 | rollupCappedDatabases.add(new CappedDatabase(file, sizeKb, ticker));
}
this.rollupCappedDatabases = ImmutableList.copyOf(rollupCappedDatabases);
traceCappedDatabase = new CappedDatabase(new File(dataDir, "trace-detail.capped.db"),
storageConfig.traceCappedDatabaseSizeMb() * 1024, ticker);
<BUG>agentDao = new AgentDao(dataSource);
</BUG>
transactionTypeDao = new TransactionTypeDao(dataSource);
rollupLevelService = new RollupLevelService(configRepository, clock);
FullQueryTextDao fullQueryTextDao = new FullQueryTextDao(dataSource);
| environmentDao = new EnvironmentDao(dataSource);
|
44,651 | traceDao = new TraceDao(dataSource, traceCappedDatabase, transactionTypeDao,
fullQueryTextDao, traceAttributeNameDao);
GaugeNameDao gaugeNameDao = new GaugeNameDao(dataSource);
gaugeValueDao = new GaugeValueDao(dataSource, gaugeNameDao, clock);
repoAdmin = new RepoAdminImpl(dataSource, rollupCappedDatabases, traceCappedDatabase,
<BUG>configRepository, agentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao,
</BUG>
fullQueryTextDao, traceAttributeNameDao);
if (backgroundExecutor == null) {
reaperRunnable = null;
| configRepository, environmentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao,
|
44,652 | new TraceCappedDatabaseStats(traceCappedDatabase),
"org.glowroot:type=TraceCappedDatabase");
platformMBeanServerLifecycle.lazyRegisterMBean(new H2DatabaseStats(dataSource),
"org.glowroot:type=H2Database");
}
<BUG>public AgentDao getAgentDao() {
return agentDao;
</BUG>
}
public TransactionTypeRepository getTransactionTypeRepository() {
| public EnvironmentDao getEnvironmentDao() {
return environmentDao;
|
44,653 | package org.glowroot.agent.embedded.init;
import java.io.Closeable;
import java.io.File;
<BUG>import java.lang.instrument.Instrumentation;
import java.util.Map;</BUG>
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
| import java.util.List;
import java.util.Map;
|
44,654 | import java.util.concurrent.ScheduledExecutorService;
import javax.annotation.Nullable;
import com.google.common.base.MoreObjects;
import com.google.common.base.Stopwatch;
import com.google.common.base.Supplier;
<BUG>import com.google.common.base.Ticker;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;</BUG>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.glowroot.agent.collector.Collector.AgentConfigUpdater;
| import com.google.common.collect.ImmutableList;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
44,655 | import org.glowroot.agent.init.EnvironmentCreator;
import org.glowroot.agent.init.GlowrootThinAgentInit;
import org.glowroot.agent.init.JRebelWorkaround;
import org.glowroot.agent.util.LazyPlatformMBeanServer;
import org.glowroot.common.live.LiveAggregateRepository.LiveAggregateRepositoryNop;
<BUG>import org.glowroot.common.live.LiveTraceRepository.LiveTraceRepositoryNop;
import org.glowroot.common.repo.ConfigRepository;
import org.glowroot.common.util.Clock;</BUG>
import org.glowroot.common.util.OnlyUsedByTests;
import org.glowroot.ui.CreateUiModuleBuilder;
| import org.glowroot.common.repo.AgentRepository;
import org.glowroot.common.repo.ImmutableAgentRollup;
import org.glowroot.common.util.Clock;
|
44,656 | SimpleRepoModule simpleRepoModule = new SimpleRepoModule(dataSource,
dataDir, clock, ticker, configRepository, backgroundExecutor);
simpleRepoModule.registerMBeans(new PlatformMBeanServerLifecycleImpl(
agentModule.getLazyPlatformMBeanServer()));
CollectorImpl collectorImpl = new CollectorImpl(
<BUG>simpleRepoModule.getAgentDao(), simpleRepoModule.getAggregateDao(),
simpleRepoModule.getTraceDao(),</BUG>
simpleRepoModule.getGaugeValueDao());
collectorProxy.setInstance(collectorImpl);
collectorImpl.init(baseDir, EnvironmentCreator.create(glowrootVersion),
| simpleRepoModule.getEnvironmentDao(),
simpleRepoModule.getTraceDao(),
|
44,657 | .baseDir(baseDir)
.glowrootDir(glowrootDir)
.ticker(ticker)
.clock(clock)
.liveJvmService(agentModule.getLiveJvmService())
<BUG>.configRepository(simpleRepoModule.getConfigRepository())
.agentRepository(simpleRepoModule.getAgentDao())
</BUG>
.transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository())
.traceAttributeNameRepository(
| .agentRepository(new AgentRepositoryImpl())
.environmentRepository(simpleRepoModule.getEnvironmentDao())
|
44,658 | .baseDir(baseDir)
.glowrootDir(glowrootDir)
.ticker(ticker)
.clock(clock)
.liveJvmService(null)
<BUG>.configRepository(simpleRepoModule.getConfigRepository())
.agentRepository(simpleRepoModule.getAgentDao())
</BUG>
.transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository())
.traceAttributeNameRepository(
| .liveJvmService(agentModule.getLiveJvmService())
.agentRepository(new AgentRepositoryImpl())
.environmentRepository(simpleRepoModule.getEnvironmentDao())
|
44,659 | }
@Override
public void lazyRegisterMBean(Object object, String name) {
lazyPlatformMBeanServer.lazyRegisterMBean(object, name);
}
<BUG>}
}
</BUG>
| void initEmbeddedServer() throws Exception {
if (simpleRepoModule == null) {
return;
|
44,660 | List<GaugeConfig> configs = Lists.newArrayList(configService.getGaugeConfigs());
for (GaugeConfig loopConfig : configs) {
if (loopConfig.mbeanObjectName().equals(gaugeConfig.getMbeanObjectName())) {
throw new DuplicateMBeanObjectNameException();
}
<BUG>}
String version = Versions.getVersion(gaugeConfig);
for (GaugeConfig loopConfig : configs) {
if (Versions.getVersion(loopConfig.toProto()).equals(version)) {
throw new IllegalStateException("This exact gauge already exists");
}
}
configs.add(GaugeConfig.create(gaugeConfig));</BUG>
configService.updateGaugeConfigs(configs);
| [DELETED] |
44,661 | configService.updateGaugeConfigs(configs);
}
}
@Override
public void updateGaugeConfig(String agentId, AgentConfig.GaugeConfig gaugeConfig,
<BUG>String priorVersion) throws Exception {
synchronized (writeLock) {</BUG>
List<GaugeConfig> configs = Lists.newArrayList(configService.getGaugeConfigs());
boolean found = false;
for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) {
| GaugeConfig config = GaugeConfig.create(gaugeConfig);
synchronized (writeLock) {
|
44,662 | boolean found = false;
for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) {
GaugeConfig loopConfig = i.next();
String loopVersion = Versions.getVersion(loopConfig.toProto());
if (loopVersion.equals(priorVersion)) {
<BUG>i.set(GaugeConfig.create(gaugeConfig));
found = true;
break;</BUG>
} else if (loopConfig.mbeanObjectName().equals(gaugeConfig.getMbeanObjectName())) {
throw new DuplicateMBeanObjectNameException();
| i.set(config);
|
44,663 | boolean found = false;
for (ListIterator<PluginConfig> i = configs.listIterator(); i.hasNext();) {
PluginConfig loopPluginConfig = i.next();
if (pluginId.equals(loopPluginConfig.id())) {
String loopVersion = Versions.getVersion(loopPluginConfig.toProto());
<BUG>checkVersionsEqual(loopVersion, priorVersion);
PluginDescriptor pluginDescriptor = getPluginDescriptor(pluginId);
i.set(PluginConfig.create(pluginDescriptor, properties));</BUG>
found = true;
break;
| for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) {
GaugeConfig loopConfig = i.next();
String loopVersion = Versions.getVersion(loopConfig.toProto());
if (loopVersion.equals(version)) {
i.remove();
|
44,664 | boolean found = false;
for (ListIterator<InstrumentationConfig> i = configs.listIterator(); i.hasNext();) {
InstrumentationConfig loopConfig = i.next();
String loopVersion = Versions.getVersion(loopConfig.toProto());
if (loopVersion.equals(priorVersion)) {
<BUG>i.set(InstrumentationConfig.create(instrumentationConfig));
found = true;
break;
}</BUG>
}
| i.set(config);
} else if (loopConfig.equals(config)) {
throw new IllegalStateException("This exact instrumentation already exists");
|
44,665 | package org.glowroot.agent.embedded.init;
import java.io.File;
import java.util.List;
import org.glowroot.agent.collector.Collector;
<BUG>import org.glowroot.agent.embedded.repo.AgentDao;
import org.glowroot.agent.embedded.repo.AggregateDao;
import org.glowroot.agent.embedded.repo.GaugeValueDao;</BUG>
import org.glowroot.agent.embedded.repo.TraceDao;
import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;
| import org.glowroot.agent.embedded.repo.EnvironmentDao;
import org.glowroot.agent.embedded.repo.GaugeValueDao;
|
44,666 | </BUG>
private final AggregateDao aggregateDao;
private final TraceDao traceDao;
private final GaugeValueDao gaugeValueDao;
<BUG>CollectorImpl(AgentDao agentDao, AggregateDao aggregateRepository, TraceDao traceRepository,
GaugeValueDao gaugeValueRepository) {
this.agentDao = agentDao;</BUG>
this.aggregateDao = aggregateRepository;
this.traceDao = traceRepository;
| import org.glowroot.wire.api.model.CollectorServiceOuterClass.Environment;
import org.glowroot.wire.api.model.CollectorServiceOuterClass.GaugeValue;
import org.glowroot.wire.api.model.CollectorServiceOuterClass.LogEvent;
import org.glowroot.wire.api.model.TraceOuterClass.Trace;
class CollectorImpl implements Collector {
private final EnvironmentDao agentDao;
CollectorImpl(EnvironmentDao agentDao, AggregateDao aggregateRepository,
TraceDao traceRepository, GaugeValueDao gaugeValueRepository) {
this.agentDao = agentDao;
|
44,667 | 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);
}
|
44,668 | package com.advancedeffects;
import android.app.Activity;
import android.os.Bundle;
<BUG>import android.view.KeyEvent;
import com.facebook.react.LifecycleState;</BUG>
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactRootView;
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
| import android.view.View;
import com.facebook.react.LifecycleState;
|
44,669 | .addPackage(new RNGLPackage())
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
mReactRootView.startReactApplication(mReactInstanceManager, "AdvancedEffects", null);
<BUG>setContentView(mReactRootView);
}</BUG>
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) {
| getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
}
|
44,670 | private final ChannelMarshal<STATE> marshal;
private final Supplier<DatabaseHealth> databaseHealthSupplier;
private final int numberOfEntriesBeforeRotation;
private int numberOfEntriesWrittenInActiveFile;
private File currentStoreFile;
<BUG>private PhysicalFlushableChannel currentStoreChannel;
public DurableStateStorage( FileSystemAbstraction fileSystemAbstraction, File stateDir, String name,
</BUG>
StateMarshal<STATE> marshal, int numberOfEntriesBeforeRotation,
Supplier<DatabaseHealth> databaseHealthSupplier, LogProvider logProvider )
| private File stateDir( File baseDir, String name )
{
return new File( baseDir, name + "-state" );
}
public DurableStateStorage( FileSystemAbstraction fileSystemAbstraction, File baseDir, String name,
|
44,671 | import org.neo4j.kernel.internal.DatabaseHealth;
import org.neo4j.kernel.lifecycle.LifeSupport;
import org.neo4j.logging.LogProvider;
import static java.util.concurrent.TimeUnit.SECONDS;
public class ReplicationModule
<BUG>{
private final RaftReplicator replicator;</BUG>
private final ProgressTrackerImpl progressTracker;
private final SessionTracker sessionTracker;
public ReplicationModule( MemberId myself, PlatformModule platformModule, Config config, ConsensusModule consensusModule,
| public static final String LAST_FLUSHED_NAME = "last-flushed";
public static final String SESSION_TRACKER_NAME = "session-tracker";
private final RaftReplicator replicator;
|
44,672 | import org.neo4j.logging.LogProvider;
import org.neo4j.udc.UsageData;
import static org.neo4j.coreedge.server.core.RoleProcedure.CoreOrEdge.CORE;
public class EnterpriseCoreEditionModule extends EditionModule
{
<BUG>public static final String CLUSTER_STATE_DIRECTORY_NAME = "cluster-state";
private final ConsensusModule consensusModule;</BUG>
private final CoreTopologyService discoveryService;
private final LogProvider logProvider;
private final CoreStateMachinesModule coreStateMachinesModule;
| public static final String CORE_MEMBER_ID_NAME = "core-member-id";
private final ConsensusModule consensusModule;
|
44,673 | final Supplier<DatabaseHealth> databaseHealthSupplier = dependencies.provideDependency( DatabaseHealth.class );
MemberId myself;
try
{
StateStorage<MemberId> idStorage = life.add( new DurableStateStorage<>(
<BUG>fileSystem, clusterStateDirectory, "raft-member-id", new MemberIdMarshal(), 1,
</BUG>
databaseHealthSupplier, logProvider ) );
MemberId member = idStorage.getInitialState();
if ( member == null )
| fileSystem, clusterStateDirectory, CORE_MEMBER_ID_NAME, new MemberIdMarshal(), 1,
|
44,674 | import org.neo4j.kernel.internal.DatabaseHealth;
import org.neo4j.kernel.lifecycle.LifeSupport;
import org.neo4j.logging.LogProvider;
import org.neo4j.storageengine.api.Token;
public class CoreStateMachinesModule
<BUG>{
public final IdGeneratorFactory idGeneratorFactory;</BUG>
public final IdTypeConfigurationProvider idTypeConfigurationProvider;
public final LabelTokenHolder labelTokenHolder;
public final PropertyKeyTokenHolder propertyKeyTokenHolder;
| public static final String ID_ALLOCATION_NAME = "id-allocation";
public static final String LOCK_TOKEN_NAME = "lock-token";
public final IdGeneratorFactory idGeneratorFactory;
|
44,675 | import org.neo4j.kernel.lifecycle.LifeSupport;
import org.neo4j.kernel.lifecycle.Lifecycle;
import org.neo4j.logging.LogProvider;
import static java.time.Clock.systemUTC;
public class ConsensusModule
<BUG>{
private final MonitoredRaftLog raftLog;</BUG>
private final RaftInstance raftInstance;
private final DelayedRenewableTimeoutService raftTimeoutService;
private final RaftMembershipManager raftMembershipManager;
| public static final String RAFT_MEMBERSHIP_NAME = "membership";
public static final String RAFT_TERM_NAME = "term";
public static final String RAFT_VOTE_NAME = "vote";
private final MonitoredRaftLog raftLog;
|
44,676 | StateStorage<VoteState> voteState;
StateStorage<RaftMembershipState> raftMembershipStorage;
try
{
StateStorage<TermState> durableTermState = life.add(
<BUG>new DurableStateStorage<>( fileSystem, new File( clusterStateDirectory, "term-state" ),
"term-state", new TermState.Marshal(),
config.get( CoreEdgeClusterSettings.term_state_size ), databaseHealthSupplier,
logProvider ) );</BUG>
termState = new MonitoredTermStateStorage( durableTermState, platformModule.monitors );
| new DurableStateStorage<>( fileSystem, clusterStateDirectory, RAFT_TERM_NAME,
new TermState.Marshal(), config.get( CoreEdgeClusterSettings.term_state_size ),
databaseHealthSupplier, logProvider ) );
|
44,677 | new MethodGuardedAdversary(
new CountingAdversary( 20, true ),
FileSystemAbstraction.class.getMethod( "truncate", File.class, long.class ) ),
normalFSA );
SelectiveFileSystemAbstraction combinedFSA = new SelectiveFileSystemAbstraction(
<BUG>new File( testDir.directory(), "long.a" ), breakingFSA, normalFSA );
</BUG>
LongState persistedState = new LongState( combinedFSA, testDir.directory(), 14 );
long lastValue = 0;
try
| new File( new File( testDir.directory(), "long-state" ), "long.a" ), breakingFSA, normalFSA );
|
44,678 | new MethodGuardedAdversary(
new CountingAdversary( 40, true ),
StoreChannel.class.getMethod( "force", boolean.class ) ),
normalFSA );
SelectiveFileSystemAbstraction combinedFSA = new SelectiveFileSystemAbstraction(
<BUG>new File( testDir.directory(), "long.a" ), breakingFSA, normalFSA );
</BUG>
LongState persistedState = new LongState( combinedFSA, testDir.directory(), 14 );
long lastValue = 0;
try
| new CountingAdversary( 20, true ),
FileSystemAbstraction.class.getMethod( "truncate", File.class, long.class ) ),
new File( new File( testDir.directory(), "long-state" ), "long.a" ), breakingFSA, normalFSA );
|
44,679 | new MethodGuardedAdversary(
new CountingAdversary( 5, true ),
StoreChannel.class.getMethod( "close" ) ),
normalFSA );
SelectiveFileSystemAbstraction combinedFSA = new SelectiveFileSystemAbstraction(
<BUG>new File( testDir.directory(), "long.a" ), breakingFSA, normalFSA );
</BUG>
LongState persistedState = new LongState( combinedFSA, testDir.directory(), 14 );
long lastValue = 0;
try
| new CountingAdversary( 20, true ),
FileSystemAbstraction.class.getMethod( "truncate", File.class, long.class ) ),
new File( new File( testDir.directory(), "long-state" ), "long.a" ), breakingFSA, normalFSA );
|
44,680 | final Supplier<DatabaseHealth> databaseHealthSupplier = dependencies.provideDependency( DatabaseHealth.class );
StateStorage<Long> lastFlushedStorage;
try
{
lastFlushedStorage = life.add(
<BUG>new DurableStateStorage<>( fileSystem, new File( clusterStateDirectory, "last-flushed-state" ),
"last-flushed", new LongIndexMarshal(), config.get( CoreEdgeClusterSettings.last_flushed_state_size ),
databaseHealthSupplier, logProvider ) );</BUG>
}
catch ( IOException e )
| new DurableStateStorage<>( fileSystem, clusterStateDirectory, ReplicationModule.LAST_FLUSHED_NAME,
databaseHealthSupplier, logProvider ) );
|
44,681 | </BUG>
}
private File stateFileB()
{
<BUG>return new File( testDir.directory(), "state.b" );
</BUG>
}
@SuppressWarnings("unchecked")
private Supplier<DatabaseHealth> health()
{
| return atomicInteger.get();
private File stateFileA()
return new File( new File( testDir.directory(), "state-state" ), "state.a" );
return new File( new File( testDir.directory(), "state-state" ), "state.b" );
|
44,682 | protected MovedInHierarchy(Code moveUp, Code moveDown) {
this.moveUp = moveUp;
this.moveDown = moveDown;
}
protected void doVisit(@Nullable JavaModelElement oldEl, @Nullable JavaModelElement newEl) {
<BUG>if (oldEl == null || newEl == null) {
return;
}
if (oldEl.isInherited() == newEl.isInherited()) {
return;
}
if (!isBothAccessible(oldEl, newEl)) {</BUG>
return;
| [DELETED] |
44,683 | public EnumSet<Type> getInterest() {
return EnumSet.of(Type.METHOD);
}
@Override
protected void doVisitMethod(@Nullable JavaMethodElement oldMethod, @Nullable JavaMethodElement newMethod) {
<BUG>if (oldMethod == null || newMethod == null) {
return;
}
boolean onInterfaces = oldMethod.getParent().getDeclaringElement().getKind() == ElementKind.INTERFACE</BUG>
&& newMethod.getParent().getDeclaringElement().getKind() == ElementKind.INTERFACE;
| if (!isBothAccessible(oldMethod, newMethod)) {
assert oldMethod != null;
assert newMethod != null;
boolean onInterfaces = oldMethod.getParent().getDeclaringElement().getKind() == ElementKind.INTERFACE
|
44,684 | public EnumSet<Type> getInterest() {
return EnumSet.of(Type.FIELD);
}
@Override
protected void doVisitField(JavaFieldElement oldField, JavaFieldElement newField) {
<BUG>if (!shouldCheck(oldField, newField)) {
</BUG>
return;
}
if (oldField.getDeclaringElement().getConstantValue() == null
| if (!isBothAccessible(oldField, newField)) {
|
44,685 | import org.revapi.java.spi.JavaAnnotationElement;
public final class Removed extends CheckBase {
@Override
protected List<Difference> doVisitAnnotation(JavaAnnotationElement oldAnnotation,
JavaAnnotationElement newAnnotation) {
<BUG>if (oldAnnotation != null && newAnnotation == null) {
return Collections.singletonList(</BUG>
createDifference(Code.ANNOTATION_REMOVED, Code.attachmentsFor(oldAnnotation, null))
);
}
| if (oldAnnotation != null && newAnnotation == null && isAccessible(oldAnnotation.getParent())) {
return Collections.singletonList(
|
44,686 | import org.revapi.java.spi.Util;
public final class AttributeValueChanged extends CheckBase {
@Override
protected List<Difference> doVisitAnnotation(JavaAnnotationElement oldElement,
JavaAnnotationElement newElement) {
<BUG>if (oldElement == null || newElement == null) {
return null;</BUG>
}
AnnotationMirror oldAnnotation = oldElement.getAnnotation();
AnnotationMirror newAnnotation = newElement.getAnnotation();
| if (oldElement == null || newElement == null || !isAccessible(newElement.getParent())) {
return null;
|
44,687 | public EnumSet<Type> getInterest() {
return EnumSet.of(Type.FIELD);
}
@Override
protected void doVisitField(JavaFieldElement oldField, JavaFieldElement newField) {
<BUG>if (!shouldCheck(oldField, newField)) {
</BUG>
return;
}
String oldType = Util.toUniqueString(
| if (!isBothAccessible(oldField, newField)) {
|
44,688 | }
@Override
protected void doVisitClass(@Nullable JavaTypeElement oldType, @Nullable JavaTypeElement newType) {
if (!isBothAccessible(oldType, newType)) {
return;
<BUG>}
List<? extends TypeMirror> oldSuperTypes = getOldTypeEnvironment().getTypeUtils().directSupertypes(</BUG>
oldType.getModelRepresentation());
List<? extends TypeMirror> newSuperTypes = getNewTypeEnvironment().getTypeUtils().directSupertypes(
newType.getModelRepresentation());
| assert oldType != null;
assert newType != null;
List<? extends TypeMirror> oldSuperTypes = getOldTypeEnvironment().getTypeUtils().directSupertypes(
|
44,689 | public EnumSet<Type> getInterest() {
return EnumSet.of(Type.FIELD);
}
@Override
protected void doVisitField(JavaFieldElement oldField, JavaFieldElement newField) {
<BUG>if (!shouldCheck(oldField, newField)) {
</BUG>
return;
}
Object oldC = oldField.getDeclaringElement().getConstantValue();
| if (!isBothAccessible(oldField, newField)) {
|
44,690 | public EnumSet<Type> getInterest() {
return EnumSet.of(Type.FIELD);
}
@Override
protected void doVisitField(JavaFieldElement oldField, JavaFieldElement newField) {
<BUG>if (oldField == null || newField == null) {
return;</BUG>
}
if (!SERIAL_VERSION_UID_FIELD_NAME.equals(oldField.getDeclaringElement().getSimpleName().toString())) {
return;
| if (oldField == null || newField == null || !isAccessible(newField.getParent())) {
|
44,691 | public EnumSet<Type> getInterest() {
return EnumSet.of(Type.CLASS);
}
@Override
protected void doVisitClass(JavaTypeElement oldType, JavaTypeElement newType) {
<BUG>if (oldType == null || newType == null || isBothPrivate(oldType, newType)) {
return;</BUG>
}
List<? extends TypeMirror> newInterfaces = newType.getDeclaringElement().getInterfaces();
List<? extends TypeMirror> oldInterfaces = oldType.getDeclaringElement().getInterfaces();
| if (!isBothAccessible(oldType, newType)) {
return;
|
44,692 | this.added = added;
this.code = code;
this.modifier = modifier;
}
protected final void doVisit(JavaModelElement oldElement, JavaModelElement newElement) {
<BUG>if (oldElement == null || newElement == null) {
return;
}
if (isBothPrivate(oldElement, newElement)) {
</BUG>
return;
| if (!isBothAccessible(oldElement, newElement)) {
|
44,693 | import org.revapi.java.spi.JavaAnnotationElement;
public final class Added extends CheckBase {
@Override
protected List<Difference> doVisitAnnotation(JavaAnnotationElement oldAnnotation,
JavaAnnotationElement newAnnotation) {
<BUG>if (oldAnnotation == null && newAnnotation != null) {
return Collections.singletonList(</BUG>
createDifference(Code.ANNOTATION_ADDED, Code.attachmentsFor(null, newAnnotation))
);
}
| if (oldAnnotation == null && newAnnotation != null && isAccessible(newAnnotation.getParent())) {
return Collections.singletonList(
|
44,694 | public EnumSet<Type> getInterest() {
return EnumSet.of(Type.FIELD);
}
@Override
protected void doVisitField(JavaFieldElement oldField, JavaFieldElement newField) {
<BUG>if (!shouldCheck(oldField, newField)) {
</BUG>
return;
}
if (oldField.getDeclaringElement().getConstantValue() != null
| if (!isBothAccessible(oldField, newField)) {
|
44,695 | }
@Override
protected void doVisitClass(@Nullable JavaTypeElement oldType, @Nullable JavaTypeElement newType) {
isEnumClass = newType != null && newType.getDeclaringElement().getKind() == ElementKind.ENUM;
}
<BUG>@Override
protected boolean shouldCheck(JavaFieldElement oldField, JavaFieldElement newField) {
return isEnumClass && super.shouldCheck(oldField, newField)
</BUG>
&& oldField.getDeclaringElement().getKind() == ElementKind.ENUM_CONSTANT
| private boolean shouldCheck(JavaFieldElement oldField, JavaFieldElement newField) {
return isEnumClass && isBothAccessible(oldField, newField)
|
44,696 | public EnumSet<Type> getInterest() {
return EnumSet.of(Type.CLASS);
}
@Override
protected void doVisitClass(JavaTypeElement oldType, JavaTypeElement newType) {
<BUG>if (oldType == null || newType == null) {
return;</BUG>
}
List<TypeMirror> newInterfaces = Util.getAllSuperInterfaces(getNewTypeEnvironment().getTypeUtils(),
newType.getModelRepresentation());
| if (!isBothAccessible(oldType, newType)) {
return;
|
44,697 | config = new MavenSettingsConfig(c.id, c.name, c.comment, c.content, MavenSettingsConfig.isReplaceAllDefault, null);
}
listener.getLogger().println("using settings config with name " + config.name);
listener.getLogger().println("Replacing all maven server entries not found in credentials list is " + config.getIsReplaceAll());
if (StringUtils.isNotBlank(config.content)) {
<BUG>FilePath workDir = ManagedFileUtil.tempDir(build.getWorkspace());
try {
String fileContent = config.content;</BUG>
final List<ServerCredentialMapping> serverCredentialMappings = config.getServerCredentialMappings();
final Map<String, StandardUsernameCredentials> resolvedCredentials = CredentialsHelper.resolveCredentials(build, serverCredentialMappings);
| FilePath workspace = build.getWorkspace();
if (workspace != null) {
FilePath workDir = ManagedFileUtil.tempDir(workspace);
String fileContent = config.content;
|
44,698 | </BUG>
LOGGER.log(Level.FINE, "Create {0}", new Object[]{f});
build.getEnvironments().add(new SimpleEnvironment("MVN_SETTINGS", f.getRemote()));
build.addAction(new CleanTempFilesAction(f.getRemote()));
<BUG>return f;
} catch (Exception e) {</BUG>
throw new IllegalStateException("the settings.xml could not be supplied for the current build: " + e.getMessage(), e);
}
}
}
| fileContent = CredentialsHelper.fillAuthentication(fileContent, isReplaceAll, resolvedCredentials, workDir, tempFiles);
for (String tempFile : tempFiles) {
build.addAction(new CleanTempFilesAction(tempFile));
final FilePath f = workspace.createTextTempFile("settings", ".xml", fileContent, false);
} else {
listener.getLogger().println("ERROR: can't supply maven settings, workspace is null / slave seems not contected...");
|
44,699 | config = new GlobalMavenSettingsConfig(c.id, c.name, c.comment, c.content, GlobalMavenSettingsConfig.isReplaceAllDefault, null);
}
listener.getLogger().println("using global settings config with name " + config.name);
listener.getLogger().println("Replacing all maven server entries not found in credentials list is " + config.getIsReplaceAll());
if (StringUtils.isNotBlank(config.content)) {
<BUG>try {
FilePath workDir = ManagedFileUtil.tempDir(build.getWorkspace());
</BUG>
String fileContent = config.content;
final Map<String, StandardUsernameCredentials> resolvedCredentials = CredentialsHelper.resolveCredentials(build, config.getServerCredentialMappings());
| FilePath workspace = build.getWorkspace();
if (workspace != null) {
FilePath workDir = ManagedFileUtil.tempDir(workspace);
|
44,700 | </BUG>
LOGGER.log(Level.FINE, "Create {0}", new Object[]{configurationFile});
build.getEnvironments().add(new SimpleEnvironment("MVN_GLOBALSETTINGS", configurationFile.getRemote()));
build.addAction(new CleanTempFilesAction(configurationFile.getRemote()));
<BUG>return configurationFile;
} catch (Exception e) {</BUG>
throw new IllegalStateException("the global settings.xml could not be supplied for the current build: " + e.getMessage());
}
}
}
| fileContent = CredentialsHelper.fillAuthentication(fileContent, isReplaceAll, resolvedCredentials, workDir, tempFiles);
for (String tempFile : tempFiles) {
build.addAction(new CleanTempFilesAction(tempFile));
FilePath configurationFile = workspace.createTextTempFile("global-settings", ".xml", fileContent, false);
} else {
listener.getLogger().println("ERROR: can't supply maven settings, workspace is null / slave seems not contected...");
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.