id
int64 1
49k
| buggy
stringlengths 34
37.5k
| fixed
stringlengths 2
37k
|
---|---|---|
47,701 | nativeAttrLength = -4;
}
}
}
if (typesWithLength.contains(nativeAttrType)) {
<BUG>if (nativeAttrLength == LENGTH_ABSENT_IN_NATIVE_SCHEMA && msgClass == MessageClass.bytes) {
throw new ParseConnectionDocumentException("Length attribute should be present for parameter: "
+ nativeAttrName + " In native schema file for message class bytes");</BUG>
}
if ((nativeAttrLength < 0) && nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) {
| throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA_FOR_MSG_CLASS_BYTES", nativeAttrName )); //$NON-NLS-1$
|
47,702 | if (streamSchema.getAttribute(nativeAttrName) != null) {
streamAttrName = streamSchema.getAttribute(nativeAttrName).getName();
streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if ((msgClass == MessageClass.stream || msgClass == MessageClass.map)
&& !mapSPLToNativeSchemaDataTypesForOtherMsgClass.get(streamAttrMetaType.getLanguageType())
<BUG>.equals(nativeAttrType)) {
throw new ParseConnectionDocumentException("Attribute Name: " + nativeAttrName + " with type:"
+ nativeAttrType + " in the native schema cannot be mapped with attribute: "
+ streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG>
}
| throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
|
47,703 | + nativeAttrType + " in the native schema cannot be mapped with attribute: "
+ streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG>
}
else if (msgClass == MessageClass.bytes
&& !mapSPLToNativeSchemaDataTypesForBytes.get(streamAttrMetaType.getLanguageType()).equals(
<BUG>nativeAttrType)) {
throw new ParseConnectionDocumentException("Attribute Name: " + nativeAttrName + " with type:"
+ nativeAttrType + " in the native schema cannot be mapped with attribute: "
+ streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG>
}
| if (streamSchema.getAttribute(nativeAttrName) != null) {
streamAttrName = streamSchema.getAttribute(nativeAttrName).getName();
streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if ((msgClass == MessageClass.stream || msgClass == MessageClass.map)
&& !mapSPLToNativeSchemaDataTypesForOtherMsgClass.get(streamAttrMetaType.getLanguageType())
.equals(nativeAttrType)) {
throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
|
47,704 | package com.ibm.streamsx.messaging.i18n;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
<BUG>private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.mqtt.MQTTMessages"; //$NON-NLS-1$
</BUG>
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
private Messages() {
| private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.i18n.CommonMessages"; //$NON-NLS-1$
|
47,705 | else {
final MessageBus bus = project.getMessageBus();
notifyLaterIfNeeded(bus, fun);
}
return;
<BUG>}
FrameStateManager.getInstance().getApplicationActive().doWhenDone(new Runnable() {
</BUG>
@Override
public void run() {
| FrameStateManager frameStateManager = FrameStateManager.getInstance();
if (frameStateManager != null) {
frameStateManager.getApplicationActive().doWhenDone(new Runnable() {
|
47,706 | public void onCreate(final Bundle savedInstanceState) {
PrefsUtility.applyTheme(this);
super.onCreate(savedInstanceState);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
<BUG>OptionsMenuUtility.fixActionBar(this, getString(R.string.app_name));
RedditAccountManager.getInstance(this).addUpdateListener(this);</BUG>
if(getIntent() != null) {
final Intent intent = getIntent();
final String url = intent.getDataString();
| getSupportActionBar().setTitle(getString(R.string.app_name));
RedditAccountManager.getInstance(this).addUpdateListener(this);
|
47,707 | sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
if (savedInstanceState == null) {
if(PrefsUtility.pref_behaviour_skiptofrontpage(this, sharedPreferences))
onSelected(SubredditPostListURL.getFrontPage());
}
<BUG>OptionsMenuUtility.fixActionBar(this, getString(R.string.app_name));
twoPane = General.isTablet(this, sharedPreferences);</BUG>
doRefresh(RefreshableFragment.MAIN_RELAYOUT, false, null);
RedditAccountManager.getInstance(this).addUpdateListener(this);
final PackageInfo pInfo;
| getSupportActionBar().setTitle(R.string.app_name);
twoPane = General.isTablet(this, sharedPreferences);
|
47,708 | Log.i("AlbumListingActivity", "Got album, " + info.images.size() + " image(s)");
AndroidApi.UI_THREAD_HANDLER.post(new Runnable() {
@Override
public void run() {
if(info.title != null && !info.title.trim().isEmpty()) {
<BUG>OptionsMenuUtility.fixActionBar(AlbumListingActivity.this, getString(R.string.imgur_album) + ": " + info.title);
}</BUG>
layout.removeAllViews();
final ScrollbarRecyclerViewManager recyclerViewManager
= new ScrollbarRecyclerViewManager(AlbumListingActivity.this, null, false);
| getSupportActionBar().setTitle(getString(R.string.imgur_album) + ": " + info.title);
}
|
47,709 | public void onCreate(final Bundle savedInstanceState) {
PrefsUtility.applyTheme(this);
super.onCreate(savedInstanceState);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
<BUG>OptionsMenuUtility.fixActionBar(this, getString(R.string.app_name));
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);</BUG>
final View layout = getLayoutInflater().inflate(R.layout.main_single, null);
setBaseActivityContentView(layout);
mPane = (FrameLayout)layout.findViewById(R.id.main_single_frame);
| getSupportActionBar().setTitle(R.string.app_name);
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
47,710 | if(!isModmail) {
title = getString(R.string.mainmenu_inbox);
} else {
title = getString(R.string.mainmenu_modmail);
}
<BUG>OptionsMenuUtility.fixActionBar(this, title);
final LinearLayout outer = new LinearLayout(this);</BUG>
outer.setOrientation(android.widget.LinearLayout.VERTICAL);
loadingView = new LoadingView(this, getString(R.string.download_waiting), true, true);
notifications = new LinearLayout(this);
| getSupportActionBar().setTitle(title);
final LinearLayout outer = new LinearLayout(this);
|
47,711 | @Override
protected void onCreate(final Bundle savedInstanceState) {
PrefsUtility.applySettingsTheme(this);
setToolbarActionBarEnabled(false);
super.onCreate(savedInstanceState);
<BUG>OptionsMenuUtility.fixActionBar(this, getString(R.string.title_changelog));
getSupportActionBar().setHomeButtonEnabled(true);</BUG>
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
final LinearLayout items = new LinearLayout(this);
items.setOrientation(LinearLayout.VERTICAL);
| getSupportActionBar().setTitle(R.string.title_changelog);
getSupportActionBar().setHomeButtonEnabled(true);
|
47,712 | package org.apache.jmeter.protocol.mail.sampler;
import java.io.ByteArrayOutputStream;
<BUG>import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Properties;</BUG>
import javax.mail.Address;
import javax.mail.BodyPart;
| import java.io.InputStream;
import java.util.Enumeration;
import java.util.Properties;
|
47,713 | }
public SampleResult sample(Entry e) {
SampleResult parent = new SampleResult();
boolean isOK = false; // Did sample succeed?
boolean deleteMessages = getDeleteMessages();
<BUG>parent.setSampleLabel(getName());
int port=getPortAsInt();
if (port > 0){
parent.setSamplerData(getServerType() + "://" + getUserName() + "@" + getServer()+ ":" + port);
} else {
parent.setSamplerData(getServerType() + "://" + getUserName() + "@" + getServer());
}</BUG>
parent.sampleStart(); // Start timing
| String samplerString = toString();
parent.setSamplerData(samplerString);
|
47,714 | parent.sampleStart(); // Start timing
try {
Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
Store store = session.getStore(getServerType());
<BUG>if (port > 0){
store.connect(getServer(), port, getUserName(), getPassword());
} else {
store.connect(getServer(), getUserName(), getPassword());
}</BUG>
Folder folder = store.getFolder(getFolder());
| store.connect(getServer(), getPortAsInt(), getUserName(), getPassword());
|
47,715 | parent.sampleEnd();
}
parent.setSuccessful(isOK);
return parent;
}
<BUG>private void appendMessageData(StringBuilder cdata, Message message)
throws MessagingException, IOException {
cdata.append("Date: "); // $NON-NLS-1$</BUG>
cdata.append(message.getSentDate());// TODO - use a different format here?
| private void appendMessageData(SampleResult child, Message message)
StringBuilder cdata = new StringBuilder();
cdata.append("Date: "); // $NON-NLS-1$
|
47,716 | throws MessagingException, IOException {
cdata.append("Date: "); // $NON-NLS-1$</BUG>
cdata.append(message.getSentDate());// TODO - use a different format here?
cdata.append(NEW_LINE);
cdata.append("To: "); // $NON-NLS-1$
<BUG>Address[] recips = message.getAllRecipients();
for (int j = 0; j < recips.length; j++) {
</BUG>
cdata.append(recips[j].toString());
| StringBuilder cdata = new StringBuilder();
cdata.append("Date: "); // $NON-NLS-1$
Address[] recips = message.getAllRecipients(); // may be null
for (int j = 0; recips != null && j < recips.length; j++) {
|
47,717 | cdata.append("; "); // $NON-NLS-1$
}
}
cdata.append(NEW_LINE);
cdata.append("From: "); // $NON-NLS-1$
<BUG>Address[] from = message.getFrom();
for (int j = 0; j < from.length; j++) {
</BUG>
cdata.append(from[j].toString());
| Address[] from = message.getFrom(); // may be null
for (int j = 0; from != null && j < from.length; j++) {
|
47,718 | cdata.append(message.getSubject());
cdata.append(NEW_LINE);
cdata.append(NEW_LINE);
Object content = message.getContent();
if (content instanceof MimeMultipart) {
<BUG>MimeMultipart mmp = (MimeMultipart) content;
int count = mmp.getCount();
cdata.append("Multipart. Count: ");
cdata.append(count);
cdata.append(NEW_LINE);</BUG>
for (int j=0; j<count;j++){
| String preamble = mmp.getPreamble();
if (preamble != null ){
cdata.append(preamble);
}
child.setResponseData(cdata.toString(),child.getDataEncodingNoDefault());
|
47,719 | package org.mule.providers.email;
import org.mule.config.i18n.Messages;
import org.mule.providers.AbstractMessageAdapter;
<BUG>import org.mule.umo.MessagingException;
import org.mule.umo.provider.MessageTypeNotSupportedException;</BUG>
import javax.mail.Address;
import javax.mail.Header;
import javax.mail.Message;
| import org.mule.umo.transformer.TransformerException;
import org.mule.umo.provider.MessageTypeNotSupportedException;
|
47,720 | import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Enumeration;
public class MailMessageAdapter extends AbstractMessageAdapter {
<BUG>public static final String PROPERTY_TO_ADDRESSES = "toAddresses";
public static final String PROPERTY_FROM_ADDRESS = "fromAddress";
public static final String PROPERTY_FROM_ADDRESSES = "fromAddresses";
public static final String PROPERTY_CC_ADDRESSES = "ccAddresses";
public static final String PROPERTY_BCC_ADDRESSES = "bccAddresses";
public static final String PROPERTY_SUBJECT = "subject";</BUG>
private Part messagePart = null;
| [DELETED] |
47,721 | return i2;
}
public static String propertiesToString(Map props, boolean newline)
{
StringBuffer buf = new StringBuffer();
<BUG>buf.append("Properties{");
if (newline) {</BUG>
buf.append("\n");
}
Map.Entry entry;
| if(props==null || props.entrySet().size()==0) {
buf.append("none}");
return buf.toString();
if (newline) {
|
47,722 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.List;
<BUG>import java.util.Optional;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandDelete extends FCCommandBase {
private static final FlagMapper MAPPER = map -> key -> value -> {
map.put(key, value);
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
47,723 | .append(Text.of(TextColors.GREEN, "Usage: "))
.append(getUsage(source))
.build());
return CommandResult.empty();
} else if (isIn(REGIONS_ALIASES, parse.args[0])) {
<BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
IRegion region = FGManager.getInstance().getRegion(parse.args[1]);
</BUG>
boolean isWorldRegion = false;
if (region == null) {
| String regionName = parse.args[1];
IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
|
47,724 | </BUG>
isWorldRegion = true;
}
if (region == null)
<BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!"));
if (region instanceof GlobalWorldRegion) {
</BUG>
throw new CommandException(Text.of("You may not delete the global region!"));
}
| if (world == null)
throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!"));
if (world == null) throw new CommandException(Text.of("Must specify a world!"));
region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null);
throw new CommandException(Text.of("No region exists with the name \"" + regionName + "\"!"));
if (region instanceof IGlobal) {
|
47,725 | source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region"
);
return CommandResult.success();
} else if (isIn(HANDLERS_ALIASES, parse.args[0])) {
if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
<BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[1]);
if (handler == null)
throw new ArgumentParseException(Text.of("No handler exists with that name!"), parse.args[1], 1);
if (handler instanceof GlobalHandler)</BUG>
throw new CommandException(Text.of("You may not delete the global handler!"));
| Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]);
if (!handlerOpt.isPresent())
IHandler handler = handlerOpt.get();
if (handler instanceof GlobalHandler)
|
47,726 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
47,727 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
47,728 | @Dependency(id = "foxcore")
},
description = "A world protection plugin built for SpongeAPI. Requires FoxCore.",
authors = {"gravityfox"},
url = "https://github.com/FoxDenStudio/FoxGuard")
<BUG>public final class FoxGuardMain {
public final Cause pluginCause = Cause.builder().named("plugin", this).build();
private static FoxGuardMain instanceField;</BUG>
@Inject
private Logger logger;
| private static FoxGuardMain instanceField;
|
47,729 | private UserStorageService userStorage;
private EconomyService economyService = null;
private boolean loaded = false;
private FCCommandDispatcher fgDispatcher;
public static FoxGuardMain instance() {
<BUG>return instanceField;
}</BUG>
@Listener
public void construct(GameConstructionEvent event) {
instanceField = this;
| }
public static Cause getCause() {
return instance().pluginCause;
}
|
47,730 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
47,731 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.*;
<BUG>import java.util.stream.Collectors;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandHere extends FCCommandBase {
private static final String[] PRIORITY_ALIASES = {"priority", "prio", "p"};
private static final FlagMapper MAPPER = map -> key -> value -> {
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
47,732 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index > 0) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
47,733 | private static FGStorageManager instance;
private final Logger logger = FoxGuardMain.instance().getLogger();</BUG>
private final Set<LoadEntry> loaded = new HashSet<>();
private final Path directory = getDirectory();
private final Map<String, Path> worldDirectories;
<BUG>private FGStorageManager() {
defaultModifiedMap = new CacheMap<>((k, m) -> {</BUG>
if (k instanceof IFGObject) {
m.put((IFGObject) k, true);
return true;
| public final HashMap<IFGObject, Boolean> defaultModifiedMap;
private final UserStorageService userStorageService;
private final Logger logger = FoxGuardMain.instance().getLogger();
userStorageService = FoxGuardMain.instance().getUserStorage();
defaultModifiedMap = new CacheMap<>((k, m) -> {
|
47,734 | String name = fgObject.getName();
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| UUID owner = fgObject.getOwner();
boolean isOwned = !owner.equals(SERVER_UUID);
Optional<User> userOwner = userStorageService.get(owner);
String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name;
if (fgObject.autoSave()) {
Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving handler " + logName + " in directory: " + singleDir);
|
47,735 | if (fgObject.autoSave()) {
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
|
47,736 | public synchronized void loadRegionLinks() {
logger.info("Loading region links");
try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getRegion(entry.getKey());
if (region != null) {
logger.info("Loading links for region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());
if (regionOpt.isPresent()) {
IRegion region = regionOpt.get();
logger.info("Loading links for region \"" + region.getName() + "\"");
|
47,737 | public synchronized void loadWorldRegionLinks(World world) {
logger.info("Loading world region links for world \"" + world.getName() + "\"");
try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (region != null) {
logger.info("Loading links for world region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (regionOpt.isPresent()) {
IWorldRegion region = regionOpt.get();
logger.info("Loading links for world region \"" + region.getName() + "\"");
|
47,738 | StringBuilder builder = new StringBuilder();
for (Iterator<IHandler> it = handlers.iterator(); it.hasNext(); ) {
builder.append(it.next().getName());
if (it.hasNext()) builder.append(",");
}
<BUG>return builder.toString();
}</BUG>
private final class LoadEntry {
public final String name;
public final Type type;
| public enum Type {
REGION, WREGION, HANDLER
|
47,739 | .autoCloseQuotes(true)
.leaveFinalAsIs(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream()
</BUG>
.filter(new StartsWithPredicate(parse.current.token))
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "worldregion", "handler", "controller")
|
47,740 | 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;
|
47,741 | @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));
|
47,742 | 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;
|
47,743 | 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;
|
47,744 | 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;
|
47,745 | @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));
|
47,746 | import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class DependencyConvergenceReport
extends AbstractProjectInfoReport
<BUG>{
private List reactorProjects;
private static final int PERCENTAGE = 100;</BUG>
public String getOutputName()
{
| private static final int PERCENTAGE = 100;
private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment
.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
|
47,747 | sink.section1();
sink.sectionTitle1();
sink.text( getI18nString( locale, "title" ) );
sink.sectionTitle1_();
Map dependencyMap = getDependencyMap();
<BUG>generateLegend( locale, sink );
generateStats( locale, sink, dependencyMap );
generateConvergence( locale, sink, dependencyMap );
sink.section1_();</BUG>
sink.body_();
| sink.lineBreak();
sink.section1_();
|
47,748 | Iterator it = artifactMap.keySet().iterator();
while ( it.hasNext() )
{
String version = (String) it.next();
sink.tableRow();
<BUG>sink.tableCell();
sink.text( version );</BUG>
sink.tableCell_();
sink.tableCell();
generateVersionDetails( sink, artifactMap, version );
| sink.tableCell( String.valueOf( cellWidth ) + "px" );
sink.text( version );
|
47,749 | sink.tableCell();
sink.text( getI18nString( locale, "legend.shared" ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableCell();
iconError( sink );</BUG>
sink.tableCell_();
sink.tableCell();
sink.text( getI18nString( locale, "legend.different" ) );
| sink.tableCell( "15px" ); // according /images/icon_error_sml.gif
iconError( sink );
|
47,750 | sink.tableCaption();
sink.text( getI18nString( locale, "stats.caption" ) );
sink.tableCaption_();</BUG>
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.subprojects" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
| sink.bold();
sink.bold_();
sink.tableCaption_();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.subprojects" ) );
sink.tableHeaderCell_();
|
47,751 | sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.dependencies" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( depCount ) );
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.dependencies" ) );
sink.tableHeaderCell_();
|
47,752 | sink.text( String.valueOf( convergence ) + "%" );
sink.bold_();
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.readyrelease" ) );
sink.tableHeaderCell_();
|
47,753 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| iconError( sink );
|
47,754 | 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;
|
47,755 | @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));
|
47,756 | 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;
|
47,757 | 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;
|
47,758 | 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;
|
47,759 | @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));
|
47,760 | @Description("Whether this instance should only participate as slave in cluster. If set to true, it will never be elected as master.")
public static final Setting<Boolean> slave_only = setting( "ha.slave_only", BOOLEAN, Settings.FALSE );
@Description( "Policy for how to handle branched data." )
public static final Setting<BranchedDataPolicy> branched_data_policy = setting( "ha.branched_data_policy",
options( BranchedDataPolicy.class ), "keep_all" );
<BUG>@Description( "List of ZooKeeper coordinators. Only needed for rolling upgrade from 1.8 to 1.9." )
@Deprecated
public static final Setting<List<HostnamePort>> coordinators = setting( "ha.upgrade_coordinators", list( ",", HOSTNAME_PORT ),
"" );
@Description( "ZooKeeper session timeout. Only needed for rolling upgrade from 1.8 to 1.9." )
@Deprecated
public static final Setting<Long> zk_session_timeout = setting( "ha.zk_session_timeout", DURATION, "5s");</BUG>
@Description( "Max size of the data chunks that flows between master and slaves in HA. Bigger size may increase " +
| [DELETED] |
47,761 | private volatile IndexProvider localIndexProvider;
private final int machineId;
private volatile MasterServer masterServer;
private final AtomicBoolean reevaluatingMyself = new AtomicBoolean();
private ScheduledExecutorService updatePuller;
<BUG>private volatile Machine cachedMaster = Machine.NO_MACHINE;
private volatile boolean started;</BUG>
private final List<KernelEventHandler> kernelEventHandlers =
new CopyOnWriteArrayList<KernelEventHandler>();
private final Collection<TransactionEventHandler<?>> transactionEventHandlers =
| [DELETED] |
47,762 | System.out.println( "looked up master " + master );
master = broker.getMasterReally();
<BUG>}
boolean iAmCurrentlyMaster = masterServer != null;
boolean restarted = false;
if ( cachedMaster.getMachineId() != master.other().getMachineId() )
{</BUG>
if ( master.other().getMachineId() == machineId )
{
if ( this.localGraph == null || !iAmCurrentlyMaster )
| [DELETED] |
47,763 | if ( this.localGraph == null || !iAmCurrentlyMaster )
{
internalShutdown();
startAsMaster();
restarted = true;
<BUG>}
}</BUG>
else
{
if ( this.localGraph == null || iAmCurrentlyMaster )
| broker.rebindMaster();
|
47,764 | startAsSlave();
tryToEnsureIAmNotABrokenMachine( master );
restarted = true;
}
}
<BUG>}
if ( masterServer != null )
{
broker.rebindMaster();
}</BUG>
if ( restarted )
| [DELETED] |
47,765 | this.localGraph.registerKernelEventHandler( handler );
}
this.localDataSourceManager =
localGraph.getConfig().getTxModule().getXaDataSourceManager();
}
<BUG>cachedMaster = master.other();
started = true;</BUG>
}
finally
{
| [DELETED] |
47,766 | connectedSlaveChannels.remove( channel );
}
}
public void shutdown()
{
<BUG>deadConnectionsPoller.shutdown();
channelGroup.close().awaitUninterruptibly();</BUG>
}
private boolean channelIsClosed( Channel channel )
{
| System.out.println( "Master server shutdown, closing all channels" );
channelGroup.close().awaitUninterruptibly();
|
47,767 | package water.fvec;
import water.*;
<BUG>public class C2Chunk extends Chunk {
static final int OFF=0;
C2Chunk( byte[] bs ) { super(Short.MIN_VALUE); _mem=bs; _start = -1; _len = _mem.length>>1; }
@Override public long get ( int i ) { return UDP.get2(_mem,(i<<1)+OFF);}
@Override public double getd( int i ) {</BUG>
int res = UDP.get2(_mem,(i<<1)+OFF);
| static private final long _NA = Short.MIN_VALUE;
C2Chunk( byte[] bs ) { _mem=bs; _start = -1; _len = _mem.length>>1; }
@Override public long get ( int i ) {
|
47,768 | package water.fvec;
import water.*;
public class C8DChunk extends Chunk {
<BUG>C8DChunk( byte[] bs ) {super(Long.MIN_VALUE); _mem=bs; _start = -1; _len = _mem.length>>3; }
@Override public long get ( int i ) { double res = UDP.get8d(_mem,i<<3); return Double.isNaN(res)?NA():(long)res;}
@Override public double getd( int i ) { return UDP.get8d(_mem,i<<3); }
@Override void append2 ( long l, int exp ) { throw H2O.fail(); }</BUG>
@Override public AutoBuffer write(AutoBuffer bb) {return bb.putA1(_mem,_mem.length);}
| C8DChunk( byte[] bs ) { _mem=bs; _start = -1; _len = _mem.length>>3; }
@Override public long get ( int i ) {
double res = UDP.get8d(_mem,i<<3);
return Double.isNaN(res)?_vec._iNA:(long)res;
@Override public double getd( int i ) {
double res = UDP.get8d(_mem,i<<3);
return Double.isNaN(res)?_vec._fNA:res;
@Override void append2 ( long l, int exp ) { throw H2O.fail(); }
|
47,769 | package water.fvec;
import water.*;
public class C4FChunk extends Chunk {
<BUG>C4FChunk( byte[] bs ) { super(Long.MIN_VALUE);_mem=bs; _start = -1; _len = _mem.length>>2; }
@Override public long get ( int i ) { float res = UDP.get4f(_mem,i<<2); return Float.isNaN(res)?NA():(long)res;}
@Override public double getd( int i ) { return UDP.get4f(_mem,i<<2); }
@Override void append2 ( long l, int exp ) { throw H2O.fail(); }</BUG>
@Override public AutoBuffer write(AutoBuffer bb) { return bb.putA1(_mem,_mem.length); }
| C4FChunk( byte[] bs ) { _mem=bs; _start = -1; _len = _mem.length>>2; }
@Override public long get ( int i ) {
float res = UDP.get4f(_mem,i<<2);
return Float.isNaN(res)?_vec._iNA:(long)res;
@Override public double getd( int i ) {
float res = UDP.get4f(_mem,i<<2);
return Float.isNaN(res)?_vec._fNA:res;
@Override void append2 ( long l, int exp ) { throw H2O.fail(); }
|
47,770 | public class NewChunk extends Chunk {
final int _cidx;
transient long _ls[]; // Mantissa
transient int _xs[]; // Exponent
transient double _min, _max, _sum;
<BUG>NewChunk( AppendableVec vec, int cidx ) {
super(Long.MIN_VALUE);
_vec = vec; // Owning AppendableVec</BUG>
_cidx = cidx; // This chunk#
_ls = new long[4]; // A little room for data
| _vec = vec;
|
47,771 | public final double atd( long i ) {
long x = i-_start;
if( 0 <= x && x < _len ) return getd((int)x);
return _vec.getd(i);
}
<BUG>public final boolean isNA( long i ) {
long x = i-_start;
if( 0 <= x && x < _len ) return isNA0((int)x);
return _vec.isNA(i);
}</BUG>
public abstract long get ( int i );
| [DELETED] |
47,772 | public static class CalcSumsTask extends MRTask2<CalcSumsTask> {
long _n; // Rows used
double _sumX,_sumY,_sumX2; // Sum of X's, Y's, X^2's
@Override public void map( Chunk xs, Chunk ys ) {
for( int i=0; i<xs._len; i++ ) {
<BUG>if( !xs.isNA(i) && !ys.isNA(i) ) {
double X = xs.at0(i);
_sumX += X;
_sumY += ys.at0(i);
_sumX2+= X*X;</BUG>
_n++;
| double X = xs.getd(i);
double Y = ys.getd(i);
if( !Double.isNaN(X) && !Double.isNaN(Y)) {
_sumY += Y;
_sumX2+= X*X;
|
47,773 | final double _meanX, _meanY;
double _XXbar, _YYbar, _XYbar;
CalcSquareErrorsTasks( double meanX, double meanY ) { _meanX = meanX; _meanY = meanY; }
@Override public void map( Chunk xs, Chunk ys ) {
for( int i=0; i<xs._len; i++ ) {
<BUG>if( !xs.isNA(i) && !ys.isNA(i) ) {
double Xa = (xs.at0(i)-_meanX);
double Ya = (ys.at0(i)-_meanY);
_XXbar += Xa*Xa;</BUG>
_YYbar += Ya*Ya;
| double Xa = xs.getd(i);
double Ya = ys.getd(i);
if(!Double.isNaN(Xa) && !Double.isNaN(Ya)) {
Xa -= _meanX;
Ya -= _meanY;
_XXbar += Xa*Xa;
|
47,774 | final double _beta0, _beta1;
double _rss, _ssr;
CalcRegressionTask(double beta0, double beta1, double meanY) {_beta0=beta0; _beta1=beta1; _meanY=meanY;}
@Override public void map( Chunk xs, Chunk ys ) {
for( int i=0; i<xs._len; i++ ) {
<BUG>if( !xs.isNA(i) && !ys.isNA(i) ) {
double fit = _beta1*xs.at(i) + _beta0;
double rs = fit-ys.at(i);
</BUG>
_rss += rs*rs;
| double X = xs.getd(i); double Y = ys.getd(i);
if( !Double.isNaN(X) && !Double.isNaN(Y) ) {
double fit = _beta1*X + _beta0;
double rs = fit-Y;
|
47,775 | throws DataStoreException {
String fileName = getFileName(identifier);
try {
if (getLength(identifier) > -1) {
LOG.trace("getRecord: [{}] retrieved using getLength",
<BUG>identifier);
touchInternal(identifier);
usesIdentifier(identifier);</BUG>
return new CachingDataRecord(this, identifier);
} else if (asyncWriteCache.hasEntry(fileName, minModifiedDate > 0)) {
| if (minModifiedDate > 0) {
}
usesIdentifier(identifier);
|
47,776 | public class CodecManager
{
private final ConverterManager defaultManager = ConverterManager.defaultManager();
private final Map<Class<? extends Codec>, Codec> codecs = new HashMap<Class<? extends Codec>, Codec>();
@SuppressWarnings("unchecked")
<BUG>public <Codec extends de.cubeisland.engine.reflect.codec.Codec> Codec getCodec(Class<Codec> codecClass)
{
Codec codec = (Codec)this.codecs.get(codecClass);
if (codec == null) // Codec not registered yet! Try to auto-register...</BUG>
{
| public <C extends Codec> C getCodec(Class<C> codecClass)
C codec = (C)this.codecs.get(codecClass);
if (codec == null) // Codec not registered yet! Try to auto-register...
|
47,777 | throw new ReflectedInstantiationException("Could not instantiate unregistered Codec! " + codecClass.getName(), e);
}
}
return codec;
}
<BUG>public <Codec extends de.cubeisland.engine.reflect.codec.Codec> void registerCodec(Codec codec)
{</BUG>
this.codecs.put(codec.getClass(), codec);
codec.setConverterManager(ConverterManager.emptyManager(this.defaultManager));
}
| catch (IllegalAccessException e)
{
public <C extends Codec> void registerCodec(C codec)
{
|
47,778 | package de.cubeisland.engine.reflect;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
import de.cubeisland.engine.reflect.exception.ReflectedInstantiationException;
public class SectionFactory
<BUG>{
public static boolean isSectionClass(Class clazz)</BUG>
{
return Section.class.isAssignableFrom(clazz);
}
| private SectionFactory() {}
public static boolean isSectionClass(Class clazz)
|
47,779 | {
try
{
if (fieldNode instanceof NullNode)
{
<BUG>errorNodes.addAll(dumpDefaultIntoField(defaultSection, section, field, reflected));
if (section != defaultSection)
{</BUG>
reflected.addInheritedField(field);
}
| private ConverterManager converterManager = null;
final void setConverterManager(ConverterManager converterManager)
this.converterManager = converterManager;
|
47,780 | reflected.addInheritedField(field);
}
}
else
{
<BUG>errorNodes.addAll(dumpIntoField(defaultSection, section, field, fieldNode, reflected));
}</BUG>
}
catch (InvalidReflectedObjectException e) // rethrow
{
| errorNodes.addAll(dumpIntoField(dSection, section, field, fieldNode, reflected));
|
47,781 | return errorNodes;
}
@SuppressWarnings("unchecked")
private Collection<ErrorNode> dumpDefaultIntoField(Section parentSection, Section section, Field field, Reflected reflected) throws ConversionException, IllegalAccessException
{
<BUG>if (parentSection != section)
{
if (getFieldType(field) == FieldType.SECTION_COLLECTION)
</BUG>
{
| if (parentSection != section && getFieldType(field) == FieldType.SECTION_COLLECTION)
|
47,782 | import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
<BUG>import java.util.Map.Entry;
import java.util.logging.Level;</BUG>
import java.util.logging.Logger;
import de.cubeisland.engine.reflect.codec.Codec;
import de.cubeisland.engine.reflect.exception.InvalidReflectedObjectException;
| import java.util.Set;
import java.util.logging.Level;
|
47,783 | {
private transient Reflector factory;
private transient Reflected defaultReflected = this;
private transient final Class<C> defaultCodec = getCodecClass(this.getClass());
protected transient File file;
<BUG>private transient HashSet<Field> inheritedFields;
public final void init(Reflector factory)</BUG>
{
this.factory = factory;
this.onInit();
| private transient Set<Field> inheritedFields;
public final void init(Reflector factory)
|
47,784 | if (defaulted != null)
{
this.updateInheritance(entry.getValue(), defaulted);
}
}
<BUG>break;
}</BUG>
}
}
}
| default:
throw new IllegalArgumentException("Illegal FieldType");
|
47,785 | String s = node.asText();
if (s == null)
{
return null;
}
<BUG>if (s.equalsIgnoreCase("true") || s.equalsIgnoreCase("on")
|| s.equalsIgnoreCase("yes") || s.equalsIgnoreCase("1"))
</BUG>
{
| if ("true".equalsIgnoreCase(s) || "on".equalsIgnoreCase(s)
|| "yes".equalsIgnoreCase(s) || "1".equalsIgnoreCase(s))
|
47,786 | || s.equalsIgnoreCase("yes") || s.equalsIgnoreCase("1"))
</BUG>
{
return true;
}
<BUG>if (s.equalsIgnoreCase("false") || s.equalsIgnoreCase("off")
|| s.equalsIgnoreCase("no") || s.equalsIgnoreCase("0"))
</BUG>
{
| String s = node.asText();
if (s == null)
return null;
if ("true".equalsIgnoreCase(s) || "on".equalsIgnoreCase(s)
|| "yes".equalsIgnoreCase(s) || "1".equalsIgnoreCase(s))
if ("false".equalsIgnoreCase(s) || "off".equalsIgnoreCase(s)
|| "no".equalsIgnoreCase(s) || "0".equalsIgnoreCase(s))
|
47,787 | package de.cubeisland.engine.reflect;
public class StringUtils
<BUG>{
public static String implode(String delimiter, String[] strings)</BUG>
{
if (strings.length == 0)
{
| private StringUtils() {}
public static String implode(String delimiter, String[] strings)
|
47,788 | import java.util.List;
import java.util.Set;
import static de.cubeisland.engine.reflect.node.ReflectedPath.LIST;
public class ListNode extends ParentNode
{
<BUG>private ArrayList<Node> listedNodes = new ArrayList<Node>();
public ListNode(Iterable list)</BUG>
{
if (list != null)
{
| private List<Node> listedNodes = new ArrayList<Node>();
public ListNode(Iterable list)
|
47,789 | writer.append("{}");
}
else
{
writer.append(LINE_BREAK);
<BUG>convertMapNode(writer, ((MapNode)entry.getValue()), offset + 1, false);
}</BUG>
endOfMapOrList = true;
}
else if (entry.getValue() instanceof ListNode) // List-Node? -> list the nodes
| convertMapNode(writer, (MapNode)entry.getValue(), offset + 1, false);
|
47,790 | assert callOperationNode != null;
PsiElement callElement = call.getCallElement();
assert callElement != null;
trace.report(UNNECESSARY_SAFE_CALL.on((JetElement) callOperationNode.getTreeParent().getPsi(), callOperationNode, type));
}
<BUG>};
for (ResolutionTask<D> task : prioritizedTasks) {</BUG>
TemporaryBindingTrace temporaryTrace = TemporaryBindingTrace.create(trace);
OverloadResolutionResults<D> results = performResolution(temporaryTrace, scope, expectedType, task, tracing);
if (results.isSuccess()) {
| TemporaryBindingTrace traceForFirstNonemptyCandidateSet = null;
OverloadResolutionResults<D> resultsForFirstNonemptyCandidateSet = null;
for (ResolutionTask<D> task : prioritizedTasks) {
|
47,791 | ResolvedCallImpl<D> maximallySpecificGenericsDiscriminated = overloadingConflictResolver.findMaximallySpecific(cleanCandidates, true);
if (maximallySpecificGenericsDiscriminated != null) {
return OverloadResolutionResults.success(maximallySpecificGenericsDiscriminated);
}
Set<ResolvedCallImpl<D>> noOverrides = OverridingUtil.filterOverrides(candidates, MAP_TO_RESULT);
<BUG>if (allClean) {
tracing.ambiguity(trace, noOverrides);
}
tracing.recordAmbiguity(trace, noOverrides);</BUG>
return OverloadResolutionResults.ambiguity(noOverrides);
| [DELETED] |
47,792 | trace.record(slicedMapKey.getSlice(), slicedMapKey.getKey(), value);
}
for (Diagnostic diagnostic : diagnostics) {
trace.report(diagnostic);
}
<BUG>}
@Override</BUG>
public void report(@NotNull Diagnostic diagnostic) {
diagnostics.add(diagnostic);
}
| public void clear() {
map.clear();
diagnostics.clear();
@Override
|
47,793 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
47,794 | final int lineStride = dst.getScanlineStride();
final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final byte[][] data = dst.getByteDataArrays();
final float[] warpData = new float[2 * dstWidth];
<BUG>int lineOffset = 0;
if (ctable == null) { // source does not have IndexColorModel
if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
47,795 | pixelOffset += pixelStride;
} // COLS LOOP
} // ROWS LOOP
}
} else {// source has IndexColorModel
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| } else if (caseB) {
for (int h = 0; h < dstHeight; h++) {
|
47,796 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
47,797 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
47,798 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
47,799 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
47,800 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|