id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
39,901
.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))
39,902
@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;
39,903
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; }
39,904
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
39,905
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.*;
39,906
.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))
39,907
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) -> {
39,908
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);
39,909
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);
39,910
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() + "\"");
39,911
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() + "\"");
39,912
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
39,913
.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")
39,914
throw new OutOfMemoryError("Native allocator returned address == 0"); } } catch (UnsatisfiedLinkError e) { throw new RuntimeException("No native JavaCPP library in memory. (Has Loader.load() been called?)", e); } catch (OutOfMemoryError e) { <BUG>OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new BytePointer(" + size + "), " + "totalBytes = " + totalBytes() + ", physicalBytes = " + physicalBytes()); </BUG> e2.initCause(e);
OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new BytePointer(" + size + "): " + "totalBytes = " + formatBytes(totalBytes()) + ", physicalBytes = " + formatBytes(physicalBytes()));
39,915
throw new OutOfMemoryError("Native allocator returned address == 0"); } } catch (UnsatisfiedLinkError e) { throw new RuntimeException("No native JavaCPP library in memory. (Has Loader.load() been called?)", e); } catch (OutOfMemoryError e) { <BUG>OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new IntPointer(" + size + "), " + "totalBytes = " + totalBytes() + ", physicalBytes = " + physicalBytes()); </BUG> e2.initCause(e);
OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new IntPointer(" + size + "): " + "totalBytes = " + formatBytes(totalBytes()) + ", physicalBytes = " + formatBytes(physicalBytes()));
39,916
throw new OutOfMemoryError("Native allocator returned address == 0"); } } catch (UnsatisfiedLinkError e) { throw new RuntimeException("No native JavaCPP library in memory. (Has Loader.load() been called?)", e); } catch (OutOfMemoryError e) { <BUG>OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new FloatPointer(" + size + "), " + "totalBytes = " + totalBytes() + ", physicalBytes = " + physicalBytes()); </BUG> e2.initCause(e);
OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new FloatPointer(" + size + "): " + "totalBytes = " + formatBytes(totalBytes()) + ", physicalBytes = " + formatBytes(physicalBytes()));
39,917
break; } i++; } long size = Long.parseLong(string.substring(0, i)); <BUG>switch (string.substring(i).toLowerCase()) { </BUG> case "": break; default: throw new NumberFormatException("Cannot parse into bytes: " + string); }
switch (string.substring(i).trim().toLowerCase()) {
39,918
limit = arrayLimit; return b; } public Buffer asBuffer() { return asByteBuffer(); <BUG>} public static native Pointer memchr(Pointer p, int ch, long size);</BUG> public static native int memcmp(Pointer p1, Pointer p2, long size); public static native Pointer memcpy(Pointer dst, Pointer src, long size); public static native Pointer memmove(Pointer dst, Pointer src, long size);
public static native Pointer malloc(long size); public static native Pointer calloc(long n, long size); public static native Pointer realloc(Pointer p, long size); public static native void free(Pointer p); public static native Pointer memchr(Pointer p, int ch, long size);
39,919
throw new OutOfMemoryError("Native allocator returned address == 0"); } } catch (UnsatisfiedLinkError e) { throw new RuntimeException("No native JavaCPP library in memory. (Has Loader.load() been called?)", e); } catch (OutOfMemoryError e) { <BUG>OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new BoolPointer(" + size + "), " + "totalBytes = " + totalBytes() + ", physicalBytes = " + physicalBytes()); </BUG> e2.initCause(e);
OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new BoolPointer(" + size + "): " + "totalBytes = " + formatBytes(totalBytes()) + ", physicalBytes = " + formatBytes(physicalBytes()));
39,920
throw new OutOfMemoryError("Native allocator returned address == 0"); } } catch (UnsatisfiedLinkError e) { throw new RuntimeException("No native JavaCPP library in memory. (Has Loader.load() been called?)", e); } catch (OutOfMemoryError e) { <BUG>OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new PointerPointer(" + size + "), " + "totalBytes = " + totalBytes() + ", physicalBytes = " + physicalBytes()); </BUG> e2.initCause(e);
OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new PointerPointer(" + size + "): " + "totalBytes = " + formatBytes(totalBytes()) + ", physicalBytes = " + formatBytes(physicalBytes()));
39,921
throw new OutOfMemoryError("Native allocator returned address == 0"); } } catch (UnsatisfiedLinkError e) { throw new RuntimeException("No native JavaCPP library in memory. (Has Loader.load() been called?)", e); } catch (OutOfMemoryError e) { <BUG>OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new LongPointer(" + size + "), " + "totalBytes = " + totalBytes() + ", physicalBytes = " + physicalBytes()); </BUG> e2.initCause(e);
OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new LongPointer(" + size + "): " + "totalBytes = " + formatBytes(totalBytes()) + ", physicalBytes = " + formatBytes(physicalBytes()));
39,922
throw new OutOfMemoryError("Native allocator returned address == 0"); } } catch (UnsatisfiedLinkError e) { throw new RuntimeException("No native JavaCPP library in memory. (Has Loader.load() been called?)", e); } catch (OutOfMemoryError e) { <BUG>OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new CharPointer(" + size + "), " + "totalBytes = " + totalBytes() + ", physicalBytes = " + physicalBytes()); </BUG> e2.initCause(e);
OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new CharPointer(" + size + "): " + "totalBytes = " + formatBytes(totalBytes()) + ", physicalBytes = " + formatBytes(physicalBytes()));
39,923
throw new OutOfMemoryError("Native allocator returned address == 0"); } } catch (UnsatisfiedLinkError e) { throw new RuntimeException("No native JavaCPP library in memory. (Has Loader.load() been called?)", e); } catch (OutOfMemoryError e) { <BUG>OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new CLongPointer(" + size + "), " + "totalBytes = " + totalBytes() + ", physicalBytes = " + physicalBytes()); </BUG> e2.initCause(e);
OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new CLongPointer(" + size + "): " + "totalBytes = " + formatBytes(totalBytes()) + ", physicalBytes = " + formatBytes(physicalBytes()));
39,924
throw new OutOfMemoryError("Native allocator returned address == 0"); } } catch (UnsatisfiedLinkError e) { throw new RuntimeException("No native JavaCPP library in memory. (Has Loader.load() been called?)", e); } catch (OutOfMemoryError e) { <BUG>OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new DoublePointer(" + size + "), " + "totalBytes = " + totalBytes() + ", physicalBytes = " + physicalBytes()); </BUG> e2.initCause(e);
OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new DoublePointer(" + size + "): " + "totalBytes = " + formatBytes(totalBytes()) + ", physicalBytes = " + formatBytes(physicalBytes()));
39,925
assertTrue(Pointer.DeallocatorReference.totalBytes >= (chunks - 1) * chunkSize * byteSize); try { fieldReference = pointers; new BytePointer(chunkSize); fail("OutOfMemoryError should have been thrown."); <BUG>} catch (OutOfMemoryError e) { } for (int j = 0; j < chunks; j++) {</BUG> pointers[j] = null; } fieldReference = null;
} catch (OutOfMemoryError e) { System.out.println(e); System.out.println(e.getCause()); for (int j = 0; j < chunks; j++) {
39,926
assertTrue(Pointer.DeallocatorReference.totalBytes >= (chunks - 1) * chunkSize * shortSize); try { fieldReference = pointers; new ShortPointer(chunkSize); fail("OutOfMemoryError should have been thrown."); <BUG>} catch (OutOfMemoryError e) { } for (int j = 0; j < chunks; j++) {</BUG> pointers[j] = null; } fieldReference = null;
} catch (OutOfMemoryError e) { System.out.println(e); System.out.println(e.getCause()); for (int j = 0; j < chunks; j++) {
39,927
assertTrue(Pointer.DeallocatorReference.totalBytes >= (chunks - 1) * chunkSize * intSize); try { fieldReference = pointers; new IntPointer(chunkSize); fail("OutOfMemoryError should have been thrown."); <BUG>} catch (OutOfMemoryError e) { } for (int j = 0; j < chunks; j++) {</BUG> pointers[j] = null; } fieldReference = null;
} catch (OutOfMemoryError e) { System.out.println(e); System.out.println(e.getCause()); for (int j = 0; j < chunks; j++) {
39,928
assertTrue(Pointer.DeallocatorReference.totalBytes >= (chunks - 1) * chunkSize * longSize); try { fieldReference = pointers; new LongPointer(chunkSize); fail("OutOfMemoryError should have been thrown."); <BUG>} catch (OutOfMemoryError e) { } for (int j = 0; j < chunks; j++) {</BUG> pointers[j] = null; } fieldReference = null;
} catch (OutOfMemoryError e) { System.out.println(e); System.out.println(e.getCause()); for (int j = 0; j < chunks; j++) {
39,929
assertTrue(Pointer.DeallocatorReference.totalBytes >= (chunks - 1) * chunkSize * floatSize); try { fieldReference = pointers; new FloatPointer(chunkSize); fail("OutOfMemoryError should have been thrown."); <BUG>} catch (OutOfMemoryError e) { } for (int j = 0; j < chunks; j++) {</BUG> pointers[j] = null; } fieldReference = null;
} catch (OutOfMemoryError e) { System.out.println(e); System.out.println(e.getCause()); for (int j = 0; j < chunks; j++) {
39,930
assertTrue(Pointer.DeallocatorReference.totalBytes >= (chunks - 1) * chunkSize * doubleSize); try { fieldReference = pointers; new DoublePointer(chunkSize); fail("OutOfMemoryError should have been thrown."); <BUG>} catch (OutOfMemoryError e) { } for (int j = 0; j < chunks; j++) {</BUG> pointers[j] = null; } fieldReference = null;
} catch (OutOfMemoryError e) { System.out.println(e); System.out.println(e.getCause()); for (int j = 0; j < chunks; j++) {
39,931
assertTrue(Pointer.DeallocatorReference.totalBytes >= (chunks - 1) * chunkSize * charSize); try { fieldReference = pointers; new CharPointer(chunkSize); fail("OutOfMemoryError should have been thrown."); <BUG>} catch (OutOfMemoryError e) { } for (int j = 0; j < chunks; j++) {</BUG> pointers[j] = null; } fieldReference = null;
} catch (OutOfMemoryError e) { System.out.println(e); System.out.println(e.getCause()); for (int j = 0; j < chunks; j++) {
39,932
throw new OutOfMemoryError("Native allocator returned address == 0"); } } catch (UnsatisfiedLinkError e) { throw new RuntimeException("No native JavaCPP library in memory. (Has Loader.load() been called?)", e); } catch (OutOfMemoryError e) { <BUG>OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new SizeTPointer(" + size + "), " + "totalBytes = " + totalBytes() + ", physicalBytes = " + physicalBytes()); </BUG> e2.initCause(e);
OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new SizeTPointer(" + size + "): " + "totalBytes = " + formatBytes(totalBytes()) + ", physicalBytes = " + formatBytes(physicalBytes()));
39,933
throw new OutOfMemoryError("Native allocator returned address == 0"); } } catch (UnsatisfiedLinkError e) { throw new RuntimeException("No native JavaCPP library in memory. (Has Loader.load() been called?)", e); } catch (OutOfMemoryError e) { <BUG>OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new ShortPointer(" + size + "), " + "totalBytes = " + totalBytes() + ", physicalBytes = " + physicalBytes()); </BUG> e2.initCause(e);
OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new ShortPointer(" + size + "): " + "totalBytes = " + formatBytes(totalBytes()) + ", physicalBytes = " + formatBytes(physicalBytes()));
39,934
result.setTarget(genre.getTargetXml()); } else { result.setTarget(genre.getName()); } } <BUG>wrapper.setResult(result); return wrapper;</BUG> } @RequestMapping(value = "/genres/list", method = RequestMethod.GET)
return wrapper.setResult(result);
39,935
studio = jsonApiStorageService.getStudio(Long.parseLong(name)); } else { LOG.debug("Getting studio '{}'", name); studio = jsonApiStorageService.getStudio(name); } <BUG>wrapper.setResult(studio); return wrapper;</BUG> } @RequestMapping(value = "/studios/list", method = RequestMethod.GET)
return wrapper.setResult(studio);
39,936
} @RequestMapping(value = "/studios/list", method = RequestMethod.GET) public ApiWrapperList<Studio> getStudios(@ModelAttribute("options") OptionsSingleType options) { LOG.debug("Getting studio list - Options: {}", options); ApiWrapperList<Studio> wrapper = new ApiWrapperList<>(options); <BUG>wrapper.setResults(jsonApiStorageService.getStudios(wrapper)); return wrapper;</BUG> } @RequestMapping(value = "/country", method = RequestMethod.GET)
return wrapper.setResult(studio); return wrapper.setResults(jsonApiStorageService.getStudios(wrapper));
39,937
public ApiWrapperList<ApiCountryDTO> getCountryFilename( @RequestParam(required = true, defaultValue = "") String filename, @RequestParam(required = false) String language) { LOG.debug("Getting countries for filename '{}'", filename); <BUG>OptionsId options = new OptionsId(); options.setLanguage(language); ApiWrapperList<ApiCountryDTO> wrapper = new ApiWrapperList<>(options); wrapper.setResults(jsonApiStorageService.getCountryFilename(options, filename)); return wrapper;</BUG> }
ApiWrapperList<ApiCountryDTO> wrapper = new ApiWrapperList<>(); return wrapper.setResults(jsonApiStorageService.getCountryFilename(filename, language));
39,938
package org.yamj.core; <BUG>import static org.yamj.core.CachingNames.*; import net.sf.ehcache.config.CacheConfiguration;</BUG> import net.sf.ehcache.config.PersistenceConfiguration; import net.sf.ehcache.store.MemoryStoreEvictionPolicy; import org.slf4j.Logger;
import static org.yamj.core.ServiceConstants.DEFAULT; import net.sf.ehcache.config.CacheConfiguration;
39,939
private static final int TTL_ONE_WEEK = TTL_ONE_DAY * 7; @Bean(destroyMethod="shutdown") public net.sf.ehcache.CacheManager ehCacheManager() { return net.sf.ehcache.CacheManager.create( new net.sf.ehcache.config.Configuration() <BUG>.defaultCache(cacheConfig("default", 100, TTL_10_MINUTES)) </BUG> .cache(cacheConfig(ATTACHMENTS, 300, TTL_10_MINUTES)) .cache(cacheConfigDatabase(DB_GENRE, 50, TTL_ONE_DAY)) .cache(cacheConfigDatabase(DB_STUDIO, 50, TTL_ONE_DAY))
.defaultCache(cacheConfig(DEFAULT, 100, TTL_10_MINUTES))
39,940
protected static final String LITERAL_METADATA_TYPE = "metaDataType"; protected static final String LITERAL_COUNTRY_CODE = "countryCode"; protected static final String LITERAL_CERTIFICATE = "certificate"; protected static final String LITERAL_PLOT = "plot"; protected static final String LITERAL_OUTLINE = "outline"; <BUG>protected static final String LITERAL_COMBINED = "combined"; protected static final String SQL_UNION = " UNION ";</BUG> protected static final String SQL_UNION_ALL = " UNION ALL "; protected static final String SQL_AS_VIDEO_TYPE = "' AS videoType"; protected static final String SQL_COMMA_SPACE_QUOTE = ", '";
protected static final String LITERAL_BASENAME = "baseName"; protected static final String LITERAL_STAGE_DIRECTORY = "stageDirectory"; protected static final String LITERAL_CHECK_DATE = "checkDate"; protected static final String SQL_UNION = " UNION ";
39,941
package org.yamj.core.database; <BUG>import static java.sql.Connection.TRANSACTION_READ_COMMITTED; import java.util.Properties;</BUG> import javax.sql.DataSource; import org.apache.commons.dbcp.BasicDataSource; import org.slf4j.Logger;
import static org.yamj.core.ServiceConstants.DEFAULT; import java.util.Properties;
39,942
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.transaction.annotation.EnableTransactionManagement; @Configuration @EnableTransactionManagement <BUG>@Profile("default") public class DefaultDatabaseConfiguration extends AbstractDatabaseConfiguration {</BUG> private static final Logger LOG = LoggerFactory.getLogger(DefaultDatabaseConfiguration.class); @Value("${yamj3.database.driver}") private String driverClassName;
@Profile(DEFAULT) public class DefaultDatabaseConfiguration extends AbstractDatabaseConfiguration {
39,943
import jetbrains.mps.openapi.editor.cells.CellActionType; import jetbrains.mps.editor.runtime.cells.AbstractCellAction; import jetbrains.mps.internal.collections.runtime.ListSequence; import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; <BUG>import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations; public class IfStatement_LastBrace {</BUG> public static void setCellActions(EditorCell editorCell, SNode node, EditorContext context) { editorCell.setAction(CellActionType.DELETE, new IfStatement_LastBrace.IfStatement_LastBrace_DELETE(node)); editorCell.setAction(CellActionType.BACKSPACE, new IfStatement_LastBrace.IfStatement_LastBrace_BACKSPACE(node));
import jetbrains.mps.editor.runtime.selection.SelectionUtil; import jetbrains.mps.openapi.editor.selection.SelectionManager; public class IfStatement_LastBrace {
39,944
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.*;
39,945
.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);
39,946
</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) {
39,947
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)
39,948
.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))
39,949
.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))
39,950
@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;
39,951
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; }
39,952
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
39,953
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.*;
39,954
.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))
39,955
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) -> {
39,956
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);
39,957
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);
39,958
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() + "\"");
39,959
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() + "\"");
39,960
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
39,961
.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")
39,962
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class StopAnalyzerProvider extends AbstractAnalyzerProvider<StopAnalyzer> { </BUG> private final Set<String> stopWords; private final StopAnalyzer stopAnalyzer; @Inject public StopAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
public class StopAnalyzerProvider extends AbstractIndexAnalyzerProvider<StopAnalyzer> {
39,963
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class StandardAnalyzerProvider extends AbstractAnalyzerProvider<StandardAnalyzer> { </BUG> private final Set<String> stopWords; private final int maxTokenLength; private final StandardAnalyzer standardAnalyzer;
public class StandardAnalyzerProvider extends AbstractIndexAnalyzerProvider<StandardAnalyzer> {
39,964
import org.elasticsearch.index.Index; import org.elasticsearch.index.settings.IndexSettings; import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.settings.Settings; <BUG>public class KeywordAnalyzerProvider extends AbstractAnalyzerProvider<KeywordAnalyzer> { </BUG> private final KeywordAnalyzer keywordAnalyzer; @Inject public KeywordAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) { super(index, indexSettings, name);
public class KeywordAnalyzerProvider extends AbstractIndexAnalyzerProvider<KeywordAnalyzer> {
39,965
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class CzechAnalyzerProvider extends AbstractAnalyzerProvider<CzechAnalyzer> { </BUG> private final Set<?> stopWords; private final CzechAnalyzer analyzer; @Inject public CzechAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
public class CzechAnalyzerProvider extends AbstractIndexAnalyzerProvider<CzechAnalyzer> {
39,966
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class ArabicAnalyzerProvider extends AbstractAnalyzerProvider<ArabicAnalyzer> { </BUG> private final Set<String> stopWords; private final ArabicAnalyzer arabicAnalyzer; @Inject public ArabicAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
public class ArabicAnalyzerProvider extends AbstractIndexAnalyzerProvider<ArabicAnalyzer> {
39,967
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class CjkAnalyzerProvider extends AbstractAnalyzerProvider<CJKAnalyzer> { </BUG> private final Set<?> stopWords; private final CJKAnalyzer analyzer; @Inject public CjkAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
public class CjkAnalyzerProvider extends AbstractIndexAnalyzerProvider<CJKAnalyzer> {
39,968
Class<? extends TokenFilterFactory> type = tokenFilterSettings.getAsClass("type", null, "org.elasticsearch.index.analysis.", "TokenFilterFactory"); if (type == null) { throw new IllegalArgumentException("Token Filter [" + tokenFilterName + "] must have a type associated with it"); } tokenFilterBinder.addBinding(tokenFilterName).toProvider(FactoryProvider.newFactory(TokenFilterFactoryFactory.class, type)).in(Scopes.SINGLETON); <BUG>} for (AnalysisBinderProcessor processor : processors) { processor.processTokenFilters(tokenFilterBinder, tokenFiltersSettings); </BUG> }
AnalysisBinderProcessor.TokenFiltersBindings tokenFiltersBindings = new AnalysisBinderProcessor.TokenFiltersBindings(tokenFilterBinder, tokenFiltersSettings); processor.processTokenFilters(tokenFiltersBindings);
39,969
Class<? extends TokenizerFactory> type = tokenizerSettings.getAsClass("type", null, "org.elasticsearch.index.analysis.", "TokenizerFactory"); if (type == null) { throw new IllegalArgumentException("Tokenizer [" + tokenizerName + "] must have a type associated with it"); } tokenizerBinder.addBinding(tokenizerName).toProvider(FactoryProvider.newFactory(TokenizerFactoryFactory.class, type)).in(Scopes.SINGLETON); <BUG>} for (AnalysisBinderProcessor processor : processors) { processor.processTokenizers(tokenizerBinder, tokenizersSettings); </BUG> }
AnalysisBinderProcessor.TokenizersBindings tokenizersBindings = new AnalysisBinderProcessor.TokenizersBindings(tokenizerBinder, tokenizersSettings); processor.processTokenizers(tokenizersBindings);
39,970
} else { throw new IllegalArgumentException("Analyzer [" + analyzerName + "] must have a type associated with it or a tokenizer"); } } analyzerBinder.addBinding(analyzerName).toProvider(FactoryProvider.newFactory(AnalyzerProviderFactory.class, type)).in(Scopes.SINGLETON); <BUG>} for (AnalysisBinderProcessor processor : processors) { processor.processAnalyzers(analyzerBinder, analyzersSettings); </BUG> }
AnalysisBinderProcessor.AnalyzersBindings analyzersBindings = new AnalysisBinderProcessor.AnalyzersBindings(analyzerBinder, analyzersSettings, indicesAnalysisService); processor.processAnalyzers(analyzersBindings);
39,971
import org.elasticsearch.index.settings.IndexSettings; import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; <BUG>public class ThaiAnalyzerProvider extends AbstractAnalyzerProvider<ThaiAnalyzer> { </BUG> private final ThaiAnalyzer analyzer; @Inject public ThaiAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) { super(index, indexSettings, name);
public class ThaiAnalyzerProvider extends AbstractIndexAnalyzerProvider<ThaiAnalyzer> {
39,972
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class PersianAnalyzerProvider extends AbstractAnalyzerProvider<PersianAnalyzer> { </BUG> private final Set<?> stopWords; private final PersianAnalyzer analyzer; @Inject public PersianAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
public class PersianAnalyzerProvider extends AbstractIndexAnalyzerProvider<PersianAnalyzer> {
39,973
import org.elasticsearch.index.Index; import org.elasticsearch.index.settings.IndexSettings; import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.settings.Settings; <BUG>public class ChineseAnalyzerProvider extends AbstractAnalyzerProvider<ChineseAnalyzer> { </BUG> private final ChineseAnalyzer analyzer; @Inject public ChineseAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) { super(index, indexSettings, name);
public class ChineseAnalyzerProvider extends AbstractIndexAnalyzerProvider<ChineseAnalyzer> {
39,974
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class BrazilianAnalyzerProvider extends AbstractAnalyzerProvider<BrazilianAnalyzer> { </BUG> private final Set<?> stopWords; private final Set<?> stemExclusion; private final BrazilianAnalyzer analyzer;
public class BrazilianAnalyzerProvider extends AbstractIndexAnalyzerProvider<BrazilianAnalyzer> {
39,975
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class GermanAnalyzerProvider extends AbstractAnalyzerProvider<GermanAnalyzer> { </BUG> private final Set<?> stopWords; private final Set<?> stemExclusion; private final GermanAnalyzer analyzer;
public class GermanAnalyzerProvider extends AbstractIndexAnalyzerProvider<GermanAnalyzer> {
39,976
import org.elasticsearch.util.settings.ImmutableSettings; import org.elasticsearch.util.settings.Settings; import java.util.List; import java.util.Map; import static org.elasticsearch.util.collect.Lists.*; <BUG>public class CustomAnalyzerProvider extends AbstractAnalyzerProvider<CustomAnalyzer> { </BUG> private final TokenizerFactory tokenizerFactory; private final TokenFilterFactory[] tokenFilterFactories; private final CustomAnalyzer customAnalyzer;
public class CustomAnalyzerProvider extends AbstractIndexAnalyzerProvider<CustomAnalyzer> {
39,977
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class DutchAnalyzerProvider extends AbstractAnalyzerProvider<DutchAnalyzer> { </BUG> private final Set<?> stopWords; private final Set<?> stemExclusion; private final DutchAnalyzer analyzer;
public class DutchAnalyzerProvider extends AbstractIndexAnalyzerProvider<DutchAnalyzer> {
39,978
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class FrenchAnalyzerProvider extends AbstractAnalyzerProvider<FrenchAnalyzer> { </BUG> private final Set<?> stopWords; private final Set<?> stemExclusion; private final FrenchAnalyzer analyzer;
public class FrenchAnalyzerProvider extends AbstractIndexAnalyzerProvider<FrenchAnalyzer> {
39,979
import org.elasticsearch.index.Index; import org.elasticsearch.index.settings.IndexSettings; import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.settings.Settings; <BUG>public class SimpleAnalyzerProvider extends AbstractAnalyzerProvider<SimpleAnalyzer> { </BUG> private final SimpleAnalyzer simpleAnalyzer; @Inject public SimpleAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) { super(index, indexSettings, name);
public class SimpleAnalyzerProvider extends AbstractIndexAnalyzerProvider<SimpleAnalyzer> {
39,980
import org.elasticsearch.util.collect.Iterators; import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; <BUG>public class RussianAnalyzerProvider extends AbstractAnalyzerProvider<RussianAnalyzer> { </BUG> private final RussianAnalyzer analyzer; @Inject public RussianAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) { super(index, indexSettings, name);
public class RussianAnalyzerProvider extends AbstractIndexAnalyzerProvider<RussianAnalyzer> {
39,981
import org.elasticsearch.util.inject.Inject; import org.elasticsearch.util.inject.assistedinject.Assisted; import org.elasticsearch.util.lucene.Lucene; import org.elasticsearch.util.settings.Settings; import java.util.Set; <BUG>public class GreekAnalyzerProvider extends AbstractAnalyzerProvider<GreekAnalyzer> { </BUG> private final Set<?> stopWords; private final GreekAnalyzer analyzer; @Inject public GreekAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
public class GreekAnalyzerProvider extends AbstractIndexAnalyzerProvider<GreekAnalyzer> {
39,982
} @RootTask static Task<Exec.Result> exec(String parameter, int number) { Task<String> task1 = MyTask.create(parameter); Task<Integer> task2 = Adder.create(number, number + 2); <BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh") .in(() -> task1)</BUG> .in(() -> task2) .process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\""))); }
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
39,983
return args; } static class MyTask { static final int PLUS = 10; static Task<String> create(String parameter) { <BUG>return Task.ofType(String.class).named("MyTask", parameter) .in(() -> Adder.create(parameter.length(), PLUS))</BUG> .in(() -> Fib.create(parameter.length())) .process((sum, fib) -> something(parameter, sum, fib)); }
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
39,984
final String instanceField = "from instance"; final TaskContext context = TaskContext.inmem(); final AwaitingConsumer<String> val = new AwaitingConsumer<>(); @Test public void shouldJavaUtilSerialize() throws Exception { <BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39) .process(() -> 9999L); Task<String> task2 = Task.ofType(String.class).named("Baz", 40) .in(() -> task1)</BUG> .ins(() -> singletonList(task1))
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
39,985
assertEquals(des.id().name(), "Baz"); assertEquals(val.awaitAndGet(), "[9999] hello 10004"); } @Test(expected = NotSerializableException.class) public void shouldNotSerializeWithInstanceFieldReference() throws Exception { <BUG>Task<String> task = Task.ofType(String.class).named("WithRef") .process(() -> instanceField + " causes an outer reference");</BUG> serialize(task); } @Test
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
39,986
serialize(task); } @Test public void shouldSerializeWithLocalReference() throws Exception { String local = instanceField; <BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef") .process(() -> local + " won't cause an outer reference");</BUG> serialize(task); Task<String> des = deserialize(); context.evaluate(des).consume(val);
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
39,987
} @RootTask public static Task<String> standardArgs(int first, String second) { firstInt = first; secondString = second; <BUG>return Task.ofType(String.class).named("StandardArgs", first, second) .process(() -> second + " " + first * 100);</BUG> } @Test public void shouldParseFlags() throws Exception {
return Task.named("StandardArgs", first, second).ofType(String.class) .process(() -> second + " " + first * 100);
39,988
assertThat(parsedEnum, is(CustomEnum.BAR)); } @RootTask public static Task<String> enums(CustomEnum enm) { parsedEnum = enm; <BUG>return Task.ofType(String.class).named("Enums", enm) .process(enm::toString);</BUG> } @Test public void shouldParseCustomTypes() throws Exception {
return Task.named("Enums", enm).ofType(String.class) .process(enm::toString);
39,989
assertThat(parsedType.content, is("blarg parsed for you!")); } @RootTask public static Task<String> customType(CustomType myType) { parsedType = myType; <BUG>return Task.ofType(String.class).named("Types", myType.content) .process(() -> myType.content);</BUG> } public enum CustomEnum { BAR
return Task.named("Types", myType.content).ofType(String.class) .process(() -> myType.content);
39,990
TaskContext taskContext = TaskContext.inmem(); TaskContext.Value<Long> value = taskContext.evaluate(fib92); value.consume(f92 -> System.out.println("fib(92) = " + f92)); } static Task<Long> create(long n) { <BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n); </BUG> if (n < 2) { return fib .process(() -> n);
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
39,991
package com.projecttango.examples.java.augmentedreality; import com.google.atap.tangoservice.Tango; import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoCameraIntrinsics; import com.google.atap.tangoservice.TangoConfig; <BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoEvent;</BUG> import com.google.atap.tangoservice.TangoOutOfDateException; import com.google.atap.tangoservice.TangoPoseData; import com.google.atap.tangoservice.TangoXyzIjData;
import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
39,992
super.onResume(); if (!mIsConnected) { mTango = new Tango(AugmentedRealityActivity.this, new Runnable() { @Override public void run() { <BUG>try { connectTango();</BUG> setupRenderer(); mIsConnected = true; } catch (TangoOutOfDateException e) {
TangoSupport.initialize(); connectTango();
39,993
if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) { mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics); mCameraPoseTimestamp = lastFramePose.timestamp;</BUG> } else { <BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread); }</BUG> } } } @Override
mRenderer.updateRenderCameraPose(lastFramePose); mCameraPoseTimestamp = lastFramePose.timestamp; Log.w(TAG, "Can't get device pose at time: " +
39,994
import org.rajawali3d.materials.Material; import org.rajawali3d.materials.methods.DiffuseMethod; import org.rajawali3d.materials.textures.ATexture; import org.rajawali3d.materials.textures.StreamingTexture; import org.rajawali3d.materials.textures.Texture; <BUG>import org.rajawali3d.math.Matrix4; import org.rajawali3d.math.vector.Vector3;</BUG> import org.rajawali3d.primitives.ScreenQuad; import org.rajawali3d.primitives.Sphere; import org.rajawali3d.renderer.RajawaliRenderer;
import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3;
39,995
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) { Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics); getCurrentCamera().setRotation(cameraPose.getOrientation()); getCurrentCamera().setPosition(cameraPose.getPosition()); }</BUG> public int getTextureId() {
public void updateRenderCameraPose(TangoPoseData cameraPose) { float[] rotation = cameraPose.getRotationAsFloats(); float[] translation = cameraPose.getTranslationAsFloats(); Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]); getCurrentCamera().setRotation(quaternion.conjugate()); getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
39,996
package com.projecttango.examples.java.helloareadescription; import com.google.atap.tangoservice.Tango; <BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener; import com.google.atap.tangoservice.TangoConfig;</BUG> import com.google.atap.tangoservice.TangoCoordinateFramePair; import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig;
39,997
package edu.isi.wings.common; import java.io.Serializable; import java.net.URI; <BUG>public class URIEntity implements Serializable { </BUG> private static final long serialVersionUID = 1L; private URI id; public URIEntity(String id) {
public class URIEntity implements Serializable, Comparable<URIEntity> {
39,998
import edu.isi.wings.workflow.template.classes.sets.SetCreationRule.SetType; import edu.isi.wings.workflow.template.classes.variables.*; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; <BUG>import java.util.HashSet; import java.util.Properties;</BUG> import java.util.TreeMap; public class WorkflowGenerationKB implements WorkflowGenerationAPI { private Logger logger;
import java.util.LinkedHashMap; import java.util.Properties;
39,999
package edu.isi.wings.catalog.component.classes; <BUG>import java.util.ArrayList; import java.util.HashMap; import edu.isi.wings.ontapi.KBTriple;</BUG> import edu.isi.wings.workflow.template.classes.Role; import edu.isi.wings.workflow.template.classes.variables.*;
import java.util.LinkedHashMap; import java.util.Map; import edu.isi.wings.ontapi.KBTriple;
40,000
this.requirements = requirements; this.explanations = new ArrayList<String>(); inputRoles = new ArrayList<String>(); this.isInvalid = false; } <BUG>public HashMap<Variable, Role> createReverseMap(HashMap<Role, Variable> map) { HashMap<Variable, Role> rmap = new HashMap<Variable, Role>(); </BUG> for (Role cp : map.keySet()) {
public LinkedHashMap<Variable, Role> createReverseMap(Map<Role, Variable> map) { LinkedHashMap<Variable, Role> rmap = new LinkedHashMap<Variable, Role>();