id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
10,301 | prop.load(input);
String file = prop.getProperty("whiteList");
loadWhiteDomains(file);
this.index = index;
}
<BUG>private void loadWhiteDomains(String file) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(DomainWhiteLister.class.getResourceAsStream(file)));
while (br.ready()) {</BUG>
String line = br.readLine();
whiteList.add(line);
| BufferedReader br = new BufferedReader(
while (br.ready()) {
|
10,302 | InputStream input = CorporationAffixCleaner.class.getResourceAsStream("/config/agdistis.properties");
prop.load(input);
String file = prop.getProperty("corporationAffixes");
loadCorporationAffixes(file);
}
<BUG>private void loadCorporationAffixes(String file) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(CorporationAffixCleaner.class.getResourceAsStream(file)));
while (br.ready()) {</BUG>
String line = br.readLine();
corporationAffixes.add(line);
| BufferedReader br = new BufferedReader(
while (br.ready()) {
|
10,303 | public ReportElement getBase() {
return base;
}
@Override
public float print(PDDocument document, PDPageContentStream stream, int pageNumber, float startX, float startY, float allowedWidth) throws IOException {
<BUG>PDPage currPage = (PDPage) document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, true, false);
</BUG>
base.print(document, pageStream, pageNo, x, y, width);
pageStream.close();
| PDPage currPage = document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, PDPageContentStream.AppendMode.APPEND, false);
|
10,304 | public PdfTextStyle(String config) {
Assert.hasText(config);
String[] split = config.split(",");
Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000");
fontSize = Integer.parseInt(split[0]);
<BUG>font = resolveStandard14Name(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));</BUG>
}
public int getFontSize() {
return fontSize;
| font = getFont(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));
|
10,305 | package cc.catalysts.boot.report.pdf.elements;
import cc.catalysts.boot.report.pdf.config.PdfTextStyle;
import cc.catalysts.boot.report.pdf.utils.ReportAlignType;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
<BUG>import org.apache.pdfbox.pdmodel.font.PDFont;
import org.slf4j.Logger;</BUG>
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
import java.io.IOException;
| import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.apache.pdfbox.util.Matrix;
import org.slf4j.Logger;
|
10,306 | addTextSimple(stream, textConfig, textX, nextLineY, "");
return nextLineY;
}
try {
<BUG>String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, fixedText);
</BUG>
float x = calculateAlignPosition(textX, align, textConfig, allowedWidth, split[0]);
if (!underline) {
addTextSimple(stream, textConfig, x, nextLineY, split[0]);
} else {
| String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, text);
|
10,307 | public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
try {
stream.setFont(textConfig.getFont(), textConfig.getFontSize());
stream.setNonStrokingColor(textConfig.getColor());
stream.beginText();
<BUG>stream.newLineAtOffset(textX, textY);
stream.showText(text);</BUG>
} catch (Exception e) {
LOG.warn("Could not add text: " + e.getClass() + " - " + e.getMessage());
}
| stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY));
stream.showText(text);
|
10,308 | public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
addTextSimple(stream, textConfig, textX, textY, text);
try {
float lineOffset = textConfig.getFontSize() / 8F;
stream.setStrokingColor(textConfig.getColor());
<BUG>stream.setLineWidth(0.5F);
stream.drawLine(textX, textY - lineOffset, textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
</BUG>
stream.stroke();
} catch (IOException e) {
| stream.moveTo(textX, textY - lineOffset);
stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
|
10,309 | list.add(text.length());
return list;
}
public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) {
String endPart = "";
<BUG>String shortenedText = text;
List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {</BUG>
String[] splittedFirst = splitText(font, fontSize, allowedWidth, breakSplitted.get(0));
StringBuilder remaining = new StringBuilder(splittedFirst[1] == null ? "" : splittedFirst[1] + "\n");
| List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {
|
10,310 | package cc.catalysts.boot.report.pdf.elements;
import org.apache.pdfbox.pdmodel.PDDocument;
<BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
import java.io.IOException;</BUG>
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
| import org.apache.pdfbox.pdmodel.PDPageContentStream;
import java.io.IOException;
|
10,311 | import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import com.appboy.configuration.XmlAppConfigurationProvider;
<BUG>import com.appboy.push.AppboyNotificationUtils;
public final class AppboyGcmReceiver extends BroadcastReceiver {</BUG>
private static final String TAG = String.format("%s.%s", Constants.APPBOY_LOG_TAG_PREFIX, AppboyGcmReceiver.class.getName());
private static final String GCM_RECEIVE_INTENT_ACTION = "com.google.android.c2dm.intent.RECEIVE";
private static final String GCM_REGISTRATION_INTENT_ACTION = "com.google.android.c2dm.intent.REGISTRATION";
| import com.appboy.support.AppboyLogger;
public final class AppboyGcmReceiver extends BroadcastReceiver {
|
10,312 | private static final String GCM_DELETED_MESSAGES_KEY = "deleted_messages";
private static final String GCM_NUMBER_OF_MESSAGES_DELETED_KEY = "total_deleted";
public static final String CAMPAIGN_ID_KEY = Constants.APPBOY_PUSH_CAMPAIGN_ID_KEY;
@Override
public void onReceive(Context context, Intent intent) {
<BUG>Log.i(TAG, String.format("Received broadcast message. Message: %s", intent.toString()));
</BUG>
String action = intent.getAction();
if (GCM_REGISTRATION_INTENT_ACTION.equals(action)) {
XmlAppConfigurationProvider appConfigurationProvider = new XmlAppConfigurationProvider(context);
| AppboyLogger.i(TAG, String.format("Received broadcast message. Message: %s", intent.toString()));
|
10,313 | } else if (Constants.APPBOY_CANCEL_NOTIFICATION_ACTION.equals(action) && intent.hasExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG)) {
int notificationId = intent.getIntExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG, Constants.APPBOY_DEFAULT_NOTIFICATION_ID);
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(Constants.APPBOY_PUSH_NOTIFICATION_TAG, notificationId);
} else {
<BUG>Log.w(TAG, String.format("The GCM receiver received a message not sent from Appboy. Ignoring the message."));
</BUG>
}
}
boolean handleRegistrationIntent(Context context, Intent intent) {
| AppboyLogger.w(TAG, String.format("The GCM receiver received a message not sent from Appboy. Ignoring the message."));
|
10,314 | Log.e(TAG, "Device does not support GCM.");
} else if ("INVALID_PARAMETERS".equals(error)) {
Log.e(TAG, "The request sent by the device does not contain the expected parameters. This phone does not " +
"currently support GCM.");
} else {
<BUG>Log.w(TAG, String.format("Received an unrecognised GCM registration error type. Ignoring. Error: %s", error));
</BUG>
}
} else if (registrationId != null) {
Appboy.getInstance(context).registerAppboyPushMessages(registrationId);
| AppboyLogger.w(TAG, String.format("Received an unrecognised GCM registration error type. Ignoring. Error: %s", error));
|
10,315 | } else if (registrationId != null) {
Appboy.getInstance(context).registerAppboyPushMessages(registrationId);
} else if (intent.hasExtra(GCM_UNREGISTERED_KEY)) {
Appboy.getInstance(context).unregisterAppboyPushMessages();
} else {
<BUG>Log.w(TAG, "The GCM registration message is missing error information, registration id, and unregistration " +
</BUG>
"confirmation. Ignoring.");
return false;
}
| AppboyLogger.w(TAG, "The GCM registration message is missing error information, registration id, and unregistration " +
|
10,316 | if (GCM_DELETED_MESSAGES_KEY.equals(messageType)) {
int totalDeleted = intent.getIntExtra(GCM_NUMBER_OF_MESSAGES_DELETED_KEY, -1);
if (totalDeleted == -1) {
Log.e(TAG, String.format("Unable to parse GCM message. Intent: %s", intent.toString()));
} else {
<BUG>Log.i(TAG, String.format("GCM deleted %d messages. Fetch them from Appboy.", totalDeleted));
</BUG>
}
return false;
} else {
| AppboyLogger.i(TAG, String.format("GCM deleted %d messages. Fetch them from Appboy.", totalDeleted));
|
10,317 | package com.appboy;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
<BUG>import android.util.Log;
import android.content.Context;</BUG>
import android.app.Notification;
import android.app.NotificationManager;
import com.appboy.configuration.XmlAppConfigurationProvider;
| import com.appboy.support.AppboyLogger;
import android.content.Context;
|
10,318 | } else if (Constants.APPBOY_CANCEL_NOTIFICATION_ACTION.equals(action) && intent.hasExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG)) {
int notificationId = intent.getIntExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG, Constants.APPBOY_DEFAULT_NOTIFICATION_ID);
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(Constants.APPBOY_PUSH_NOTIFICATION_TAG, notificationId);
} else {
<BUG>Log.w(TAG, String.format("The ADM receiver received a message not sent from Appboy. Ignoring the message."));
</BUG>
}
}
boolean handleRegistrationIntent(Context context, Intent intent) {
| AppboyLogger.w(TAG, String.format("The ADM receiver received a message not sent from Appboy. Ignoring the message."));
|
10,319 | Notification notification = null;
IAppboyNotificationFactory appboyNotificationFactory = AppboyNotificationUtils.getActiveNotificationFactory();
try {
notification = appboyNotificationFactory.createNotification(appConfigurationProvider, context, admExtras, appboyExtras);
} catch(Exception e) {
<BUG>Log.e(TAG, "Failed to create notification.", e);
</BUG>
return false;
}
if (notification == null) {
| AppboyLogger.e(TAG, "Failed to create notification.", e);
|
10,320 | package com.appboy;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
<BUG>import android.util.Log;
import java.io.InputStream;</BUG>
import java.net.MalformedURLException;
import java.net.UnknownHostException;
public class AppboyImageUtils {
| import com.appboy.support.AppboyLogger;
import java.io.InputStream;
|
10,321 | public class AppboyImageUtils {
private static final String TAG = String.format("%s.%s", Constants.APPBOY_LOG_TAG_PREFIX, AppboyImageUtils.class.getName());
public static final int BASELINE_SCREEN_DPI = 160;
public static Bitmap downloadImageBitmap(String imageUrl) {
if (imageUrl == null || imageUrl.length() == 0) {
<BUG>Log.i(TAG, "Null or empty Url string passed to image bitmap download. Not attempting download.");
</BUG>
return null;
}
Bitmap bitmap = null;
| AppboyLogger.i(TAG, "Null or empty Url string passed to image bitmap download. Not attempting download.");
|
10,322 | if (version == 2) {
X509Certificate caCert;
String b64CaCert = XmlUtil.getValueOfFirstElementChild(root, namespace, "CACert");
try {
caCert = X509Util.parseBase64EncodedCert(b64CaCert);
<BUG>} catch (CertificateException | IOException ex) {
throw new CmpRequestorException("could no parse the CA certificate", ex);</BUG>
}
ClientCmpControl cmpControl = null;
Element cmpCtrlElement = XmlUtil.getFirstElementChild(root, namespace, "cmpControl");
| } catch (CertificateException ex) {
throw new CmpRequestorException("could no parse the CA certificate", ex);
|
10,323 | P11CryptService p11CryptService = p11CryptServicePool.getP11CryptService(moduleName);
ASN1Encodable respItvInfoValue = null;
if (P11ProxyConstants.ACTION_addCert == action) {
Asn1EntityIdAndCert asn1 = Asn1EntityIdAndCert.getInstance(reqValue);
P11Slot slot = getSlot(p11CryptService, asn1.getEntityId());
<BUG>X509Certificate cert = new X509CertificateObject(asn1.getCertificate());
</BUG>
slot.addCert(asn1.getEntityId().getObjectId().getObjectId(), cert);
} else if (P11ProxyConstants.ACTION_genKeypair_DSA == action) {
Asn1GenDSAKeypairParams asn1 = Asn1GenDSAKeypairParams.getInstance(reqValue);
| X509Certificate cert = X509Util.toX509Cert(asn1.getCertificate());
|
10,324 | respItvInfoValue = new DEROctetString(signature);
} else if (P11ProxyConstants.ACTION_updateCerificate == action) {
Asn1EntityIdAndCert asn1 = Asn1EntityIdAndCert.getInstance(reqValue);
P11Slot slot = getSlot(p11CryptService, asn1.getEntityId());
slot.updateCertificate(asn1.getEntityId().getObjectId().getObjectId(),
<BUG>new X509CertificateObject(asn1.getCertificate()));
} else if (P11ProxyConstants.ACTION_removeObjects == action) {</BUG>
Asn1RemoveObjectsParams asn1 = Asn1RemoveObjectsParams.getInstance(reqValue);
P11Slot slot = getSlot(p11CryptService, asn1.getSlotId());
int num = slot.removeObjects(asn1.getObjectId(), asn1.getObjectLabel());
| X509Util.toX509Cert(asn1.getCertificate()));
} else if (P11ProxyConstants.ACTION_removeObjects == action) {
|
10,325 | import java.security.KeyPair;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.SecureRandom;
import java.security.cert.Certificate;
<BUG>import java.security.cert.CertificateParsingException;
import java.security.cert.X509Certificate;</BUG>
import java.security.interfaces.DSAPrivateKey;
import java.security.interfaces.DSAPublicKey;
import java.security.interfaces.ECPrivateKey;
| import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
|
10,326 | package org.xipki.pki.ca.qa;
import java.io.IOException;
import java.math.BigInteger;
<BUG>import java.security.cert.CertificateParsingException;
import java.security.cert.X509Certificate;</BUG>
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
| import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
|
10,327 | private static X509Cert parseCert(final X509PublicKeyCertificate p11Cert)
throws P11TokenException {
try {
byte[] encoded = p11Cert.getValue().getByteArrayValue();
return new X509Cert(X509Util.parseCert(encoded), encoded);
<BUG>} catch (CertificateException | IOException ex) {
throw new P11TokenException("could not parse certificate: " + ex.getMessage(), ex);</BUG>
}
}
private synchronized Session borrowWritableSession() throws P11TokenException {
| } catch (CertificateException ex) {
throw new P11TokenException("could not parse certificate: " + ex.getMessage(), ex);
|
10,328 | if (cert != null) {
tmpCert = cert;
} else {
try {
tmpCert = X509Util.parseBase64EncodedCert(tmpB64Cert);
<BUG>} catch (CertificateException | IOException ex) {
throw new CaMgmtException("could not parse the stored certificate for CA '"</BUG>
+ name + "'" + ex.getMessage(), ex);
}
}
| } catch (CertificateException ex) {
throw new CaMgmtException("could not parse the stored certificate for CA '"
|
10,329 | String subject = null;
if (b64Cert != null) {
try {
subject = canonicalizName(
X509Util.parseBase64EncodedCert(b64Cert).getSubjectX500Principal());
<BUG>} catch (CertificateException | IOException ex) {
subject = "ERROR";</BUG>
}
}
LOG.info("changed CMP requestor '{}': {}", name, subject);
| } catch (CertificateException ex) {
subject = "ERROR";
|
10,330 | } else {
try {
String subject = canonicalizName(
X509Util.parseBase64EncodedCert(txt).getSubjectX500Principal());
sb.append(subject);
<BUG>} catch (CertificateException | IOException ex) {
sb.append("ERROR");</BUG>
}
}
sb.append("'; ");
| } catch (CertificateException ex) {
sb.append("ERROR");
|
10,331 | String subject = null;
if (txt != null) {
try {
subject = canonicalizName(
X509Util.parseBase64EncodedCert(txt).getSubjectX500Principal());
<BUG>} catch (CertificateException | IOException ex) {
subject = "ERROR";</BUG>
}
}
sb.append("signerCert: '").append(subject).append("'; ");
| } catch (CertificateException ex) {
subject = "ERROR";
|
10,332 | } else {
try {
String subject = canonicalizName(
X509Util.parseBase64EncodedCert(txt).getSubjectX500Principal());
sb.append(subject);
<BUG>} catch (CertificateException | IOException ex) {
sb.append("ERROR");</BUG>
}
}
sb.append("'; ");
| } catch (CertificateException ex) {
sb.append("ERROR");
|
10,333 | private static final Logger LOGGER = LoggerFactory.getLogger(DefaultTaskPlanExecutor.class);
public void process(TaskExecutionPlan taskExecutionPlan, TaskExecutionListener taskListener) {
Spec<TaskInfo> anyTask = Specs.satisfyAll();
TaskInfo taskInfo = taskExecutionPlan.getTaskToExecute(anyTask);
while (taskInfo != null) {
<BUG>executeTask(taskInfo, taskExecutionPlan, taskListener);
</BUG>
taskInfo = taskExecutionPlan.getTaskToExecute(anyTask);
}
taskExecutionPlan.awaitCompletion();
| processTask(taskInfo, taskExecutionPlan, taskListener);
|
10,334 | try {
task.executeWithoutThrowingTaskFailure();
} finally {
taskListener.afterExecute(task, task.getState());
}
<BUG>if (task.getState().getFailure() != null) {
taskExecutionPlan.taskFailed(taskInfo);
} else {
taskExecutionPlan.taskComplete(taskInfo);</BUG>
}
| executeTask(taskInfo, taskListener);
} catch (Throwable e) {
taskInfo.setExecutionFailure(e);
taskExecutionPlan.taskComplete(taskInfo);
|
10,335 | class DefaultTaskExecutionPlan implements TaskExecutionPlan {
private final Lock lock = new ReentrantLock();
private final Condition condition = lock.newCondition();
private final LinkedHashMap<Task, TaskInfo> executionPlan = new LinkedHashMap<Task, TaskInfo>();
private Spec<? super Task> filter = Specs.satisfyAll();
<BUG>private Exception failure;
private TaskFailureHandler failureHandler = new RethrowingFailureHandler();</BUG>
public void addToTaskGraph(Collection<? extends Task> tasks) {
List<Task> queue = new ArrayList<Task>(tasks);
Collections.sort(queue);
| private Throwable failure;
private TaskFailureHandler failureHandler = new RethrowingFailureHandler();
|
10,336 | public TaskInfo getTaskToExecute(Spec<TaskInfo> criteria) {
lock.lock();
try {
TaskInfo nextMatching;
while ((nextMatching = getNextReadyAndMatching(criteria)) != null) {
<BUG>while (!nextMatching.dependenciesExecuted()) {
</BUG>
try {
condition.await();
} catch (InterruptedException e) {
| while (!nextMatching.allDependenciesComplete()) {
|
10,337 | nextMatching.startExecution();
if (nextMatching.dependenciesFailed()) {
abortTask(nextMatching);</BUG>
} else {
<BUG>return nextMatching;
}</BUG>
}
return null;
} finally {
lock.unlock();
| nextMatching.skipExecution();
condition.signalAll();
|
10,338 | return taskInfo;
}
}
return null;
}
<BUG>private void abortTask(TaskInfo taskInfo) {
taskInfo.executionFailed();
condition.signalAll();
}
public void taskComplete(TaskInfo task) {
</BUG>
lock.lock();
| public void taskComplete(TaskInfo taskInfo) {
|
10,339 | } catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
if (failure != null) {
<BUG>UncheckedException.throwAsUncheckedException(failure);
</BUG>
}
} finally {
lock.unlock();
| throw UncheckedException.throwAsUncheckedException(failure);
|
10,340 | final String taskPath = taskInfo.getTask().getPath();
LOGGER.warn(taskPath + " (" + Thread.currentThread() + " - start");
stateCacheAccess.useCache("Executing " + taskPath, new Runnable() {
public void run() {
LOGGER.warn(taskPath + " (" + Thread.currentThread() + ") - have cache: executing");
<BUG>executeTask(taskInfo, taskExecutionPlan, taskListener);
</BUG>
LOGGER.warn(taskPath + " (" + Thread.currentThread() + ") - execute done: releasing cache");
}
});
| processTask(taskInfo, taskExecutionPlan, taskListener);
|
10,341 | ConfigDepot _configDepot;
@Override
public String getHashKey() {
String value = HashKey.value();
if (value == null) {
<BUG>_configDepot.set(HashKey, getBase64EncodedRandomKey(128));
}</BUG>
return HashKey.value();
}
@Override
| _configDao.getValueAndInitIfNotExist(HashKey.key(), HashKey.category(), getBase64EncodedRandomKey(128), HashKey.description());
|
10,342 | }
@Override
public String getEncryptionKey() {
String value = EncryptionKey.value();
if (value == null) {
<BUG>_configDepot.set(EncryptionKey, getBase64EncodedRandomKey(128));
}</BUG>
return EncryptionKey.value();
}
@Override
| return HashKey.value();
_configDao.getValueAndInitIfNotExist(EncryptionKey.key(), EncryptionKey.category(), getBase64EncodedRandomKey(128),
EncryptionKey.description());
|
10,343 | return sourceSet.getExportedHeaders().getSrcDirs();
}
});
task.source(sourceSet.getSource());
final Project project = task.getProject();
<BUG>task.setOutputDir(project.file(String.valueOf(project.getBuildDir()) + "/objs/" + binary.getNamingScheme().getOutputDirectoryBase() + "/" + ((LanguageSourceSetInternal) sourceSet).getProjectScopedName()));
PreprocessingTool rcCompiler = (PreprocessingTool) binary.getToolByName("rcCompiler");</BUG>
task.setMacros(rcCompiler.getMacros());
task.setCompilerArgs(rcCompiler.getArgs());
FileTree resourceOutputs = task.getOutputs().getFiles().getAsFileTree().matching(new PatternSet().include("**/*.res"));
| task.setOutputDir(new File(binary.getNamingScheme().withOutputType("objs").getOutputDirectory(project.getBuildDir()), ((LanguageSourceSetInternal) sourceSet).getProjectScopedName()));
PreprocessingTool rcCompiler = (PreprocessingTool) binary.getToolByName("rcCompiler");
|
10,344 | public NativePlatform transform(PlatformRequirement platformRequirement) {
return platforms.resolve(NativePlatform.class, platformRequirement);
}
});
}
<BUG>private static BinaryNamingScheme maybeAddDimension(BinaryNamingScheme builder, Collection<?> variations, String name) {
if (variations.size() > 1) {
builder = builder.withVariantDimension(name);
}
return builder;
}</BUG>
private static void executeForEachBuildType(
| [DELETED] |
10,345 | Set<? extends Flavor> allFlavors,
NativeDependencyResolver nativeDependencyResolver
) {
Set<BuildType> targetBuildTypes = ((TargetedNativeComponentInternal) projectNativeComponent).chooseBuildTypes(allBuildTypes);
for (BuildType buildType : targetBuildTypes) {
<BUG>BinaryNamingScheme namingSchemeWithBuildType = maybeAddDimension(namingScheme, targetBuildTypes, buildType.getName());
executeForEachFlavor(</BUG>
projectNativeComponent,
platform,
buildType,
| BinaryNamingScheme namingSchemeWithBuildType = namingScheme.withVariantDimension(buildType, targetBuildTypes);
executeForEachFlavor(
|
10,346 | return sourceSet.getSource().getSrcDirs();
}
});
final Project project = task.getProject();
task.source(sourceSet.getPrefixHeaderFile());
<BUG>task.setObjectFileDir(project.file(String.valueOf(project.getBuildDir()) + "/objs/" + binary.getNamingScheme().getOutputDirectoryBase() + "/" + languageSourceSet.getProjectScopedName() + "PCH"));
task.dependsOn(project.getTasks().withType(PrefixHeaderFileGenerateTask.class).matching(new Spec<PrefixHeaderFileGenerateTask>() {</BUG>
@Override
public boolean isSatisfiedBy(PrefixHeaderFileGenerateTask prefixHeaderFileGenerateTask) {
return prefixHeaderFileGenerateTask.getPrefixHeaderFile().equals(sourceSet.getPrefixHeaderFile());
| task.setObjectFileDir(new File(binary.getNamingScheme().withOutputType("objs").getOutputDirectory(project.getBuildDir()), languageSourceSet.getProjectScopedName() + "PCH"));
task.dependsOn(project.getTasks().withType(PrefixHeaderFileGenerateTask.class).matching(new Spec<PrefixHeaderFileGenerateTask>() {
|
10,347 | package org.gradle.platform.base.internal;
import org.gradle.api.Nullable;
<BUG>import org.gradle.util.GUtil;
import java.util.ArrayList;
import java.util.Collections;</BUG>
import java.util.List;
public class DefaultBinaryNamingScheme implements BinaryNamingScheme {
| import org.gradle.api.Named;
import java.io.File;
import java.util.Collection;
import java.util.Collections;
|
10,348 | import org.gradle.language.base.LanguageSourceSet;
import org.gradle.language.base.internal.LanguageSourceSetInternal;
import org.gradle.language.base.internal.SourceTransformTaskConfig;
import org.gradle.nativeplatform.Tool;
import org.gradle.nativeplatform.internal.NativeBinarySpecInternal;
<BUG>import org.gradle.platform.base.BinarySpec;
public class AssembleTaskConfig implements SourceTransformTaskConfig {</BUG>
public String getTaskPrefix() {
return "assemble";
}
| import java.io.File;
public class AssembleTaskConfig implements SourceTransformTaskConfig {
|
10,349 | task.setDescription(String.format("Assembles the %s of %s", sourceSet, binary));
task.setToolChain(binary.getToolChain());
task.setTargetPlatform(binary.getTargetPlatform());
task.source(sourceSet.getSource());
final Project project = task.getProject();
<BUG>task.setObjectFileDir(project.file(project.getBuildDir() + "/objs/" + binary.getNamingScheme().getOutputDirectoryBase() + "/" + sourceSet.getProjectScopedName()));
Tool assemblerTool = binary.getToolByName("assembler");</BUG>
task.setAssemblerArgs(assemblerTool.getArgs());
binary.binaryInputs(task.getOutputs().getFiles().getAsFileTree().matching(new PatternSet().include("**/*.obj", "**/*.o")));
}
| task.setObjectFileDir(new File(binary.getNamingScheme().withOutputType("objs").getOutputDirectory(project.getBuildDir()), sourceSet.getProjectScopedName()));
Tool assemblerTool = binary.getToolByName("assembler");
|
10,350 | package org.gradle.platform.base.internal;
<BUG>import org.gradle.api.Nullable;
import java.util.List;</BUG>
public interface BinaryNamingScheme {
String getBaseName();
String getBinaryName();
| import org.gradle.api.Named;
import java.io.File;
import java.util.Collection;
import java.util.List;
|
10,351 | import org.gradle.language.base.internal.registry.LanguageTransform;
import org.gradle.language.nativeplatform.tasks.AbstractNativeCompileTask;
import org.gradle.language.nativeplatform.tasks.AbstractNativeSourceCompileTask;
import org.gradle.nativeplatform.ObjectFile;
import org.gradle.nativeplatform.internal.NativeBinarySpecInternal;
<BUG>import org.gradle.nativeplatform.toolchain.internal.PreCompiledHeader;
public class SourceCompileTaskConfig extends CompileTaskConfig {</BUG>
public SourceCompileTaskConfig(LanguageTransform<? extends LanguageSourceSet, ObjectFile> languageTransform, Class<? extends DefaultTask> taskType) {
super(languageTransform, taskType);
}
| import java.io.File;
public class SourceCompileTaskConfig extends CompileTaskConfig {
|
10,352 | protected void configureCompileTask(AbstractNativeCompileTask abstractTask, final NativeBinarySpecInternal binary, final LanguageSourceSetInternal sourceSet) {
AbstractNativeSourceCompileTask task = (AbstractNativeSourceCompileTask) abstractTask;
task.setDescription(String.format("Compiles the %s of %s", sourceSet, binary));
task.source(sourceSet.getSource());
final Project project = task.getProject();
<BUG>task.setObjectFileDir(project.file(String.valueOf(project.getBuildDir()) + "/objs/" + binary.getNamingScheme().getOutputDirectoryBase() + "/" + sourceSet.getProjectScopedName()));
if (sourceSet instanceof DependentSourceSetInternal && ((DependentSourceSetInternal) sourceSet).getPreCompiledHeader() != null) {</BUG>
final DependentSourceSetInternal dependentSourceSet = (DependentSourceSetInternal)sourceSet;
PreCompiledHeader pch = binary.getPrefixFileToPCH().get(dependentSourceSet.getPrefixHeaderFile());
pch.setPrefixHeaderFile(dependentSourceSet.getPrefixHeaderFile());
| task.setObjectFileDir(new File(binary.getNamingScheme().withOutputType("objs").getOutputDirectory(project.getBuildDir()), sourceSet.getProjectScopedName()));
if (sourceSet instanceof DependentSourceSetInternal && ((DependentSourceSetInternal) sourceSet).getPreCompiledHeader() != null) {
|
10,353 | package org.gradle.nativeplatform.internal.configure;
import org.gradle.model.Defaults;
import org.gradle.model.RuleSource;
<BUG>import org.gradle.nativeplatform.NativeBinarySpec;
import org.gradle.nativeplatform.NativeExecutableBinarySpec;
import org.gradle.nativeplatform.SharedLibraryBinarySpec;
import org.gradle.nativeplatform.StaticLibraryBinarySpec;</BUG>
import org.gradle.nativeplatform.internal.NativeBinarySpecInternal;
| import org.gradle.nativeplatform.*;
|
10,354 | package com.liferay.portalweb.portal.dbupgrade.sampledatalatest.calendar.calendarevent;
import com.liferay.portalweb.portal.BaseTestCase;
import com.liferay.portalweb.portal.util.RuntimeVariables;
public class AddCalendarEventTest extends BaseTestCase {
public void testAddCalendarEvent() throws Exception {
<BUG>selenium.open("/web/guest/home/");
for (int second = 0;; second++) {</BUG>
if (second >= 60) {
fail("timeout");
}
| selenium.open("/web/calendar-event-community/");
for (int second = 0;; second++) {
|
10,355 | package org.datavec.spark.transform.sparkfunction.sequence;
import org.apache.spark.api.java.JavaRDD;
<BUG>import org.apache.spark.api.java.function.Function2;
import org.apache.spark.sql.DataFrame;
</BUG>
import org.datavec.api.transform.schema.Schema;
import org.datavec.api.writable.Writable;
| import org.apache.spark.sql.Row;
import org.apache.spark.sql.Dataset;
|
10,356 | 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 {
|
10,357 | 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));
|
10,358 | } 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()
|
10,359 |
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));
|
10,360 | 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));
|
10,361 | 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 {
|
10,362 | 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);
|
10,363 | thisTag.removeRoutingTo(next);
continue;
}
synchronized (this) {
sentRequest = true;
<BUG>}
boolean failed;
synchronized(backgroundTransfers) {
failed = receiveFailed;
}
if(failed) {
thisTag.removeRoutingTo(next);
return; // don't need to set status as killed by CHKInsertHandler
}</BUG>
Message msg = null;
| if(failIfReceiveFailed(thisTag, next)) return;
|
10,364 | thisTag.removeRoutingTo(next);
return; // don't need to set status as killed by CHKInsertHandler
}</BUG>
Message msg = null;
if(!waitAccepted(next, thisTag)) {
<BUG>thisTag.removeRoutingTo(next);
synchronized(backgroundTransfers) {
failed = receiveFailed;
}
if(failed) {
return; // don't need to set status as killed by CHKInsertHandler
}</BUG>
continue; // Try another node
| continue;
synchronized (this) {
sentRequest = true;
if(failIfReceiveFailed(thisTag, next)) return;
if(failIfReceiveFailed(thisTag, next)) return;
|
10,365 | MessageFilter mfRejectedOverload = MessageFilter.create().setSource(next).setField(DMT.UID, uid).setTimeout(searchTimeout).setType(DMT.FNPRejectedOverload);
MessageFilter mfRouteNotFound = MessageFilter.create().setSource(next).setField(DMT.UID, uid).setTimeout(searchTimeout).setType(DMT.FNPRouteNotFound);
MessageFilter mfDataInsertRejected = MessageFilter.create().setSource(next).setField(DMT.UID, uid).setTimeout(searchTimeout).setType(DMT.FNPDataInsertRejected);
MessageFilter mfTimeout = MessageFilter.create().setSource(next).setField(DMT.UID, uid).setTimeout(searchTimeout).setType(DMT.FNPRejectedTimeout);
MessageFilter mf = mfInsertReply.or(mfRouteNotFound.or(mfDataInsertRejected.or(mfTimeout.or(mfRejectedOverload))));
<BUG>if(logMINOR) Logger.minor(this, "Sending DataInsert");
synchronized(backgroundTransfers) {
failed = receiveFailed;
}
if(failed) {
thisTag.removeRoutingTo(next);
return; // don't need to set status as killed by CHKInsertHandler
}</BUG>
try {
| if(failIfReceiveFailed(thisTag, next)) return;
next.sendSync(dataInsert, this);
} catch (NotConnectedException e1) {
if(logMINOR) Logger.minor(this, "Not connected sending DataInsert: "+next+" for "+uid);
|
10,366 | thisTag.removeRoutingTo(next);
continue;
}
if(logMINOR) Logger.minor(this, "Sending data");
startBackgroundTransfer(next, prb);
<BUG>while (true) {
synchronized(backgroundTransfers) {
failed = receiveFailed;
}
if(failed) {
thisTag.removeRoutingTo(next);
return; // don't need to set status as killed by CHKInsertHandler
}</BUG>
try {
| if(failIfReceiveFailed(thisTag, next)) return;
|
10,367 | } catch (DisconnectedException e) {
Logger.normal(this, "Disconnected from " + next
+ " while waiting for InsertReply on " + this);
thisTag.removeRoutingTo(next);
break;
<BUG>}
synchronized(backgroundTransfers) {
failed = receiveFailed;
}
if(failed) {
thisTag.removeRoutingTo(next);
return; // don't need to set status as killed by CHKInsertHandler
}</BUG>
if (msg == null) {
| if(failIfReceiveFailed(thisTag, next)) return;
|
10,368 | int numberHashInt = 0;
for(int i = 0; i < numbers.length; i++){
numberHashInt += (numbers[i] % (i+100));
}
String alphabet = this.alphabet;
<BUG>char ret = alphabet.toCharArray()[numberHashInt % alphabet.length()];
char lottery = ret;
</BUG>
long num;
| final char ret = alphabet.toCharArray()[numberHashInt % alphabet.length()];
final char lottery = ret;
|
10,369 | ret_str = alphabet.substring(halfLen) + ret_str + alphabet.substring(0, halfLen);
int excess = ret_str.length() - this.minHashLength;
</BUG>
if(excess > 0){
<BUG>int start_pos = excess / 2;
</BUG>
ret_str = ret_str.substring(start_pos, start_pos + this.minHashLength);
}
}
return ret_str;
| final int excess = ret_str.length() - this.minHashLength;
final int start_pos = excess / 2;
|
10,370 | pos = alphabet.indexOf(input_arr[i]);
number += pos * Math.pow(alphabet.length(), input.length() - i - 1);
}
return Long.valueOf(number);
}
<BUG>public static int checkedCast(long value) {
int result = (int) value;
</BUG>
if (result != value) {
| public static int checkedCast(final long value) {
final int result = (int) value;
|
10,371 | int sceneWidth = _inputProduct.getSceneRasterWidth();
int sceneHeight = _inputProduct.getSceneRasterHeight();
_outputProduct = new Product(productName, productType, sceneWidth, sceneHeight);
writer = ProcessorUtils.createProductWriter(prod);
_outputProduct.setProductWriter(writer);
<BUG>_outputProduct.addFlagCoding(FlagsManager.getFlagCoding());
FlagsManager.addBitmaskDefsToProduct(_outputProduct);
ProductUtils.copyTiePointGrids(_inputProduct, _outputProduct);
ProductUtils.copyGeoCoding(_inputProduct, _outputProduct);
ProductUtils.copyFlagBands(_inputProduct, _outputProduct);
copyRequestMetaData(_outputProduct);</BUG>
addBandsToOutputProduct();
| copyRequestMetaData(_outputProduct);
|
10,372 | package org.esa.beam.processor.toa;
public class ToaVegConstants {
public static final String PROC_NAME = "MERIS TOA-VEG";
<BUG>public static final String PROC_VERSION = "1.1.1";
</BUG>
public static final String PROC_COPYRIGHT = "Copyright 2005 by NOVELTIS";
public static final String LOGGER_NAME = "beam.processor.toa";
public static final String DEFAULT_LOG_PREFIX = "toa";
| public static final String PROC_VERSION = "1.1.2";
|
10,373 | import org.esa.beam.processor.toa.ui.ToaVegUi;
import org.esa.beam.processor.toa.utils.ToaVegMerisPixel;
import org.esa.beam.processor.toa.utils.ToaVegProcessorConfigurationParser;
import org.esa.beam.util.ProductUtils;
import org.esa.beam.util.ResourceInstaller;
<BUG>import org.esa.beam.util.io.FileUtils;
import java.io.File;</BUG>
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
| import org.esa.beam.dataio.envisat.EnvisatConstants;
import java.io.File;
|
10,374 | int sceneHeight = _inputProduct.getSceneRasterHeight();
_outputProduct = new Product(productName, productType, sceneWidth, sceneHeight);
writer = ProcessorUtils.createProductWriter(prod);
_outputProduct.setProductWriter(writer);
ProductUtils.copyTiePointGrids(_inputProduct, _outputProduct);
<BUG>ProductUtils.copyGeoCoding(_inputProduct, _outputProduct);
ProductUtils.copyFlagBands(_inputProduct, _outputProduct);
copyRequestMetaData(_outputProduct);
addBandsToOutputProduct();</BUG>
_outputProduct.addFlagCoding(VegFlagsManager.getCoding(ToaVegConstants.VEG_FLAGS_BAND_NAME));
| copyBand(EnvisatConstants.MERIS_AMORGOS_L1B_CORR_LATITUDE_BAND_NAME, _inputProduct, _outputProduct);
copyBand(EnvisatConstants.MERIS_AMORGOS_L1B_CORR_LONGITUDE_BAND_NAME, _inputProduct, _outputProduct);
copyBand(EnvisatConstants.MERIS_AMORGOS_L1B_ALTIUDE_BAND_NAME, _inputProduct, _outputProduct);
addBandsToOutputProduct();
|
10,375 | int sceneHeight = _inputProduct.getSceneRasterHeight();
_outputProduct = new Product(productName, productType, sceneWidth, sceneHeight);
writer = ProcessorUtils.createProductWriter(prod);
_outputProduct.setProductWriter(writer);
ProductUtils.copyTiePointGrids(_inputProduct, _outputProduct);
<BUG>ProductUtils.copyGeoCoding(_inputProduct, _outputProduct);
ProductUtils.copyFlagBands(_inputProduct, _outputProduct);
copyRequestMetaData(_outputProduct);</BUG>
addBandsToOutputProduct();
_outputProduct.addFlagCoding(VegFlagsManager.getCoding(TocVegConstants.VEG_FLAGS_BAND_NAME));
| copyRequestMetaData(_outputProduct);
|
10,376 | import java.util.Set;
import javax.annotation.Nullable;
import javax.ws.rs.Path;
final class ProgramResources {
private static final Logger LOG = LoggerFactory.getLogger(ProgramResources.class);
<BUG>private static final List<String> HADOOP_PACKAGES = ImmutableList.of("org.apache.hadoop");
private static final String HBASE_PACKAGE_PREFIX = "org/apache/hadoop/hbase/";
private static final List<String> SPARK_PACKAGES = ImmutableList.of("org.apache.spark", "scala");
private static final List<String> CDAP_API_PACKAGES = ImmutableList.of("co.cask.cdap.api", "co.cask.cdap.internal");
private static final List<String> JAVAX_WS_RS_PACKAGES = ImmutableList.of("javax.ws.rs");</BUG>
private static final Predicate<URI> JAR_ONLY_URI = new Predicate<URI>() {
| private static final List<String> HADOOP_PACKAGES = ImmutableList.of("org.apache.hadoop.");
private static final List<String> HBASE_PACKAGES = ImmutableList.of("org.apache.hadoop.hbase.");
private static final List<String> SPARK_PACKAGES = ImmutableList.of("org.apache.spark.", "scala.");
|
10,377 | package co.cask.cdap.common.lang;
<BUG>import co.cask.cdap.api.app.Application;
import org.junit.Assert;
import org.junit.Test;
import java.io.IOException;
import javax.script.ScriptEngineFactory;
public class FilterClassLoaderTest {</BUG>
@Test(expected = ClassNotFoundException.class)
| import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.VersionInfo;
import org.slf4j.Logger;
import javax.ws.rs.PUT;
public class FilterClassLoaderTest {
|
10,378 | classLoader.loadClass(FilterClassLoader.class.getName());
}
@Test
public void testAPIVisible() throws ClassNotFoundException {
FilterClassLoader classLoader = FilterClassLoader.create(this.getClass().getClassLoader());
<BUG>Assert.assertSame(Application.class, classLoader.loadClass(Application.class.getName()));
}</BUG>
@Test
public void testBootstrapResourcesVisible() throws IOException {
FilterClassLoader classLoader = FilterClassLoader.create(this.getClass().getClassLoader());
| Assert.assertSame(Logger.class, classLoader.loadClass(Logger.class.getName()));
Assert.assertSame(PUT.class, classLoader.loadClass(PUT.class.getName()));
|
10,379 | import us.ihmc.robotics.robotSide.SideDependentList;
import us.ihmc.wholeBodyController.DRCHandType;
public enum AtlasRobotVersion
{
ATLAS_UNPLUGGED_V5_NO_HANDS,
<BUG>ATLAS_UNPLUGGED_V5_DUAL_ROBOTIQ,
ATLAS_UNPLUGGED_V5_INVISIBLE_CONTACTABLE_PLANE_HANDS,</BUG>
ATLAS_UNPLUGGED_V5_ROBOTIQ_AND_SRI,
ATLAS_UNPLUGGED_V5_TROOPER;
private static String[] resourceDirectories;
| ATLAS_UNPLUGGED_V5_NO_FOREARMS,
ATLAS_UNPLUGGED_V5_INVISIBLE_CONTACTABLE_PLANE_HANDS,
|
10,380 | case ATLAS_UNPLUGGED_V5_DUAL_ROBOTIQ:
case ATLAS_UNPLUGGED_V5_TROOPER:
return DRCHandType.ROBOTIQ;
case ATLAS_UNPLUGGED_V5_ROBOTIQ_AND_SRI:
return DRCHandType.ROBOTIQ_AND_SRI;
<BUG>case ATLAS_UNPLUGGED_V5_NO_HANDS:
case ATLAS_UNPLUGGED_V5_INVISIBLE_CONTACTABLE_PLANE_HANDS:</BUG>
default:
return DRCHandType.NONE;
}
| case ATLAS_UNPLUGGED_V5_NO_FOREARMS:
case ATLAS_UNPLUGGED_V5_INVISIBLE_CONTACTABLE_PLANE_HANDS:
|
10,381 | }
}
public static final String chestName = "utorso";
public static final String pelvisName = "pelvis";
public static final String headName = "head";
<BUG>private final LegJointName[] legJoints = { HIP_YAW, HIP_ROLL, HIP_PITCH, KNEE_PITCH, ANKLE_PITCH, ANKLE_ROLL };
private final ArmJointName[] armJoints = { SHOULDER_YAW, SHOULDER_ROLL, ELBOW_PITCH, ELBOW_ROLL, FIRST_WRIST_PITCH, WRIST_ROLL, SECOND_WRIST_PITCH };
private final SpineJointName[] spineJoints = { SPINE_PITCH, SPINE_ROLL, SPINE_YAW };
private final NeckJointName[] neckJoints = { PROXIMAL_NECK_PITCH };
private final LinkedHashMap<String, JointRole> jointRoles = new LinkedHashMap<String, JointRole>();</BUG>
private final LinkedHashMap<String, ImmutablePair<RobotSide, LimbName>> limbNames = new LinkedHashMap<String, ImmutablePair<RobotSide, LimbName>>();
| private final LegJointName[] legJoints = {HIP_YAW, HIP_ROLL, HIP_PITCH, KNEE_PITCH, ANKLE_PITCH, ANKLE_ROLL};
private final ArmJointName[] armJoints;
private final SpineJointName[] spineJoints = {SPINE_PITCH, SPINE_ROLL, SPINE_YAW};
private final NeckJointName[] neckJoints = {PROXIMAL_NECK_PITCH};
private final LinkedHashMap<String, JointRole> jointRoles = new LinkedHashMap<String, JointRole>();
|
10,382 | jointNamesBeforeFeet[0] = getJointBeforeFootName(RobotSide.LEFT);
jointNamesBeforeFeet[1] = getJointBeforeFootName(RobotSide.RIGHT);
}
@Override
public SideDependentList<String> getNameOfJointBeforeHands()
<BUG>{
return nameOfJointsBeforeHands;
}</BUG>
@Override
public SideDependentList<String> getNameOfJointBeforeThighs()
| if (atlasVersion != AtlasRobotVersion.ATLAS_UNPLUGGED_V5_NO_FOREARMS)
return null;
|
10,383 | }
@Override
public List<ImmutablePair<String, Vector3D>> getJointNameGroundContactPointMap()
{
return contactPointParameters.getJointNameGroundContactPointMap();
<BUG>}
@Override public List<ImmutablePair<String, YoPDGains>> getPassiveJointNameWithGains(YoVariableRegistry registry)
{</BUG>
return null;
}
| jointNamesBeforeFeet[0] = getJointBeforeFootName(RobotSide.LEFT);
jointNamesBeforeFeet[1] = getJointBeforeFootName(RobotSide.RIGHT);
|
10,384 | {
return atlasPhysicalProperties;
}
public String[] getHighInertiaForStableSimulationJoints()
{
<BUG>return new String[] { "hokuyo_joint" };
}</BUG>
}
| return RobotSide.values;
@Override
public Enum<?> getEndEffectorsRobotSegment(String joineNameBeforeEndEffector)
|
10,385 | package org.seleniumhq.selenium.fluent;
<BUG>import org.openqa.selenium.Dimension;
import org.openqa.selenium.Point;</BUG>
import org.openqa.selenium.WebDriver;
import java.util.List;
public abstract class BaseFluentWebElement extends BaseFluentWebDriver {
| [DELETED] |
10,386 | }
public FluentSelects selects(By by) {
MultipleResult multiple = multiple(by, "select");
return newFluentSelects(multiple.getResult(), multiple.getCtx());
}
<BUG>public FluentWebElement h1() {
</BUG>
SingleResult single = single(tagName("h1"), "h1");
return newFluentWebElement(delegate, single.getResult(), single.getCtx());
}
| protected BaseFluentWebElements spans() {
return newFluentWebElements(multiple(tagName("span"), "span"));
|
10,387 | import org.apache.sling.jcr.resource.JcrResourceConstants;
import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl;
import org.apache.sling.jcr.resource.internal.helper.MapEntries;
import org.apache.sling.jcr.resource.internal.helper.Mapping;
import org.apache.sling.performance.annotation.PerformanceTestSuite;
<BUG>import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;</BUG>
import org.junit.runner.RunWith;
| import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest;
import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
|
10,388 | @PerformanceTestSuite
public ParameterizedTestList testPerformance() throws Exception {
Helper helper = new Helper();
ParameterizedTestList testCenter = new ParameterizedTestList();
testCenter.setTestSuiteTitle("jcr.resource-2.0.10");
<BUG>testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper));
testCenter.addTestObject(new ResolveNonExistingWith5000VanityPathTest(helper));
testCenter.addTestObject(new ResolveNonExistingWith10000VanityPathTest(helper));
testCenter.addTestObject(new ResolveNonExistingWith1000AliasTest(helper));
testCenter.addTestObject(new ResolveNonExistingWith5000AliasTest(helper));
testCenter.addTestObject(new ResolveNonExistingWith10000AliasTest(helper));
</BUG>
return testCenter;
| testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper, 100, 10));
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper, 100, 50));
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith10000VanityPathTest",helper, 100, 100));
testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWithManyAliasTest",helper, 1000));
testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith5000AliasTest",helper, 5000));
testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith10000AliasTest",helper, 10000));
|
10,389 | package org.apache.sling.performance;
<BUG>import static org.mockito.Mockito.*;
import javax.jcr.NamespaceRegistry;</BUG>
import javax.jcr.Session;
import junitx.util.PrivateAccessor;
| import static org.mockito.Mockito.when;
import static org.mockito.Mockito.mock;
import javax.jcr.NamespaceRegistry;
|
10,390 | import org.apache.sling.jcr.resource.JcrResourceConstants;
import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl;
import org.apache.sling.jcr.resource.internal.helper.MapEntries;
import org.apache.sling.jcr.resource.internal.helper.Mapping;
import org.apache.sling.performance.annotation.PerformanceTestSuite;
<BUG>import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;</BUG>
import org.junit.runner.RunWith;
| import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest;
import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
|
10,391 | import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.jcr.api.SlingRepository;
import org.apache.sling.jcr.resource.JcrResourceConstants;
import org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProviderFactory;
import org.apache.sling.performance.annotation.PerformanceTestSuite;
<BUG>import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest;
import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;</BUG>
import org.apache.sling.resourceresolver.impl.ResourceResolverFactoryActivator;
| import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest;
import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
|
10,392 | @PerformanceTestSuite
public ParameterizedTestList testPerformance() throws Exception {
Helper helper = new Helper();
ParameterizedTestList testCenter = new ParameterizedTestList();
testCenter.setTestSuiteTitle("jcr.resource-2.2.0");
<BUG>testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper));
testCenter.addTestObject(new ResolveNonExistingWith5000VanityPathTest(helper));
testCenter.addTestObject(new ResolveNonExistingWith10000VanityPathTest(helper));
testCenter.addTestObject(new ResolveNonExistingWith1000AliasTest(helper));
testCenter.addTestObject(new ResolveNonExistingWith5000AliasTest(helper));
testCenter.addTestObject(new ResolveNonExistingWith10000AliasTest(helper));
</BUG>
return testCenter;
| testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper, 100, 10));
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper, 100, 50));
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith10000VanityPathTest",helper, 100, 100));
testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith1000AliasTest",helper, 1000));
testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith5000AliasTest",helper, 5000));
testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith10000AliasTest",helper, 10000));
|
10,393 | import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.FavouritesListActivity;
import net.osmand.plus.activities.FavouritesListFragment;
<BUG>import net.osmand.plus.activities.NavigatePointFragment;
import net.osmand.plus.views.controls.PagerSlidingTabStrip;</BUG>
import net.osmand.util.Algorithms;
import android.app.ActionBar;
import android.content.Intent;
| import net.osmand.plus.activities.TabActivity;
import net.osmand.plus.views.controls.PagerSlidingTabStrip;
|
10,394 | import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import com.example.android.common.view.SlidingTabLayout;
<BUG>public class SearchActivity extends ActionBarActivity implements OsmAndLocationListener {
</BUG>
public static final int POI_TAB_INDEX = 0;
public static final int ADDRESS_TAB_INDEX = 1;
public static final int LOCATION_TAB_INDEX = 2;
| public class SearchActivity extends TabActivity implements OsmAndLocationListener {
|
10,395 | getSupportActionBar().setTitle("");
getSupportActionBar().setElevation(0);
if (!showOnlyOneTab) {
ViewPager mViewPager = (ViewPager) findViewById(R.id.pager);
PagerSlidingTabStrip mSlidingTabLayout = (PagerSlidingTabStrip) findViewById(R.id.sliding_tabs);
<BUG>mTabs.add(getTabIndicator(R.drawable.tab_search_poi_icon, R.string.poi, getFragment(POI_TAB_INDEX)));
mTabs.add(getTabIndicator(R.drawable.tab_search_address_icon, R.string.address, getFragment(ADDRESS_TAB_INDEX)));
mTabs.add(getTabIndicator(R.drawable.tab_search_location_icon, R.string.search_tabs_location, getFragment(LOCATION_TAB_INDEX)));
mTabs.add(getTabIndicator(R.drawable.tab_search_favorites_icon, R.string.favorite, getFragment(FAVORITES_TAB_INDEX)));
mTabs.add(getTabIndicator(R.drawable.tab_search_history_icon, R.string.history, getFragment(HISTORY_TAB_INDEX)));
mViewPager.setAdapter(new SearchFragmentPagerAdapter(getSupportFragmentManager()));
mSlidingTabLayout.setViewPager(mViewPager);</BUG>
mViewPager.setCurrentItem(Math.min(tab, HISTORY_TAB_INDEX));
| mTabs.add(getTabIndicator(R.string.poi, getFragment(POI_TAB_INDEX)));
mTabs.add(getTabIndicator(R.string.address, getFragment(ADDRESS_TAB_INDEX)));
mTabs.add(getTabIndicator(R.string.search_tabs_location, getFragment(LOCATION_TAB_INDEX)));
mTabs.add(getTabIndicator(R.string.favorite, getFragment(FAVORITES_TAB_INDEX)));
mTabs.add(getTabIndicator(R.string.history, getFragment(HISTORY_TAB_INDEX)));
setViewPagerAdapter(mViewPager);
mSlidingTabLayout.setViewPager(mViewPager);
|
10,396 | package net.osmand.plus.activities;
<BUG>import java.io.File;
import java.util.ArrayList;
import android.content.Intent;
import android.os.Build;
import android.support.v7.app.ActionBarActivity;</BUG>
import android.support.v7.widget.Toolbar;
| import java.lang.ref.WeakReference;
import java.util.List;
|
10,397 | }
if(!hasGpx) {
setContentView(R.layout.search_activity_single);
getSupportFragmentManager().beginTransaction().add(R.id.layout, new FavouritesTreeFragment()).commit();
} else {
<BUG>setContentView(R.layout.tab_content);
tabHost = (TabHost) findViewById(android.R.id.tabhost);
tabHost.setup();</BUG>
OsmandSettings settings = ((OsmandApplication) getApplication()).getSettings();
| setContentView(R.layout.search_main);
PagerSlidingTabStrip mSlidingTabLayout = (PagerSlidingTabStrip) findViewById(R.id.sliding_tabs);
|
10,398 | protected void onPause() {
super.onPause();
((OsmandApplication) getApplication()).getSelectedGpxHelper().setUiListener(FavouritesActivity.class, null);
}
public void updateSelectedTracks() {
<BUG>if (selectedTrack != null) {
GpxSelectionHelper gpx = ((OsmandApplication) getApplication()).getSelectedGpxHelper();</BUG>
String vl = getString(R.string.selected_track);
if (gpx.isShowingAnyGpxFiles()) {
vl += " (" + gpx.getSelectedGPXFiles().size()
| for (WeakReference<Fragment> ref : fragList) {
Fragment f = ref.get();
if (f instanceof SelectedGPXFragment && !f.isDetached()) {
GpxSelectionHelper gpx = ((OsmandApplication) getApplication()).getSelectedGpxHelper();
|
10,399 | vl += " (" + gpx.getSelectedGPXFiles().size()
+ ")";
} else {
vl += " (0)";
}
<BUG>try {
((TextView)tabHost.getTabWidget().getChildAt(2).findViewById(android.R.id.title)).setText(vl);
} catch (Exception e) {
</BUG>
}
| [DELETED] |
10,400 | 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;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.